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.15.12\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-12-22 16:09+0000\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 ../examples/guestfs-testing.pod:3 ../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 ../examples/guestfs-testing.pod:7 ../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:31 ../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:112 ../resize/virt-resize.pod:262 ../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:116 ../resize/virt-resize.pod:266 ../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:118 ../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:120
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:122
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:128
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:135
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:137
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:139 ../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:142
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:145
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:147
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:149
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:152
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:154
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:156
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:351 ../rescue/virt-rescue.pod:161 ../src/guestfs.pod:2878
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:165
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:169
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:172
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:497 ../sparsify/virt-sparsify.pod:177
358 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:499 ../sparsify/virt-sparsify.pod:179
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:219 ../sparsify/virt-sparsify.pod:183
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:221 ../sparsify/virt-sparsify.pod:185
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:223 ../sparsify/virt-sparsify.pod:187
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:225 ../resize/virt-resize.pod:567 ../sparsify/virt-sparsify.pod:189
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:227 ../resize/virt-resize.pod:569 ../sparsify/virt-sparsify.pod:191 ../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:229 ../resize/virt-resize.pod:571 ../sparsify/virt-sparsify.pod:193 ../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:240 ../sparsify/virt-sparsify.pod:195 ../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:242 ../sparsify/virt-sparsify.pod:197
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 consumer hard drive with 512 byte sectors:"
530 #: ../align/virt-alignment-scan.pod:234
533 " $ cat /sys/block/sda/queue/hw_sector_size\n"
535 " $ cat /sys/block/sda/queue/physical_block_size\n"
537 " $ cat /sys/block/sda/queue/logical_block_size\n"
539 " $ cat /sys/block/sda/queue/minimum_io_size\n"
541 " $ cat /sys/block/sda/queue/optimal_io_size\n"
547 #: ../align/virt-alignment-scan.pod:245
548 msgid "For a new consumer hard drive with 4Kbyte sectors:"
552 #: ../align/virt-alignment-scan.pod:247
555 " $ cat /sys/block/sda/queue/hw_sector_size\n"
557 " $ cat /sys/block/sda/queue/physical_block_size\n"
559 " $ cat /sys/block/sda/queue/logical_block_size\n"
561 " $ cat /sys/block/sda/queue/minimum_io_size\n"
563 " $ cat /sys/block/sda/queue/optimal_io_size\n"
569 #: ../align/virt-alignment-scan.pod:258
570 msgid "For a NetApp LUN:"
574 #: ../align/virt-alignment-scan.pod:260
577 " $ cat /sys/block/sdc/queue/logical_block_size\n"
579 " $ cat /sys/block/sdc/queue/physical_block_size\n"
581 " $ cat /sys/block/sdc/queue/minimum_io_size\n"
583 " $ cat /sys/block/sdc/queue/optimal_io_size\n"
589 #: ../align/virt-alignment-scan.pod:269
591 "The NetApp allows 512 byte accesses (but they will be very inefficient), "
592 "prefers a minimum 4K I/O size, but the optimal I/O size is 64K."
596 #: ../align/virt-alignment-scan.pod:273
598 "For detailed information about what these numbers mean, see "
599 "L<http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/newstorage-iolimits.html>"
603 #: ../align/virt-alignment-scan.pod:276
605 "[Thanks to Matt Booth for providing 4K drive data. Thanks to Mike Snitzer "
606 "for providing NetApp data and additional information.]"
610 #: ../align/virt-alignment-scan.pod:279
611 msgid "1 MB PARTITION ALIGNMENT"
615 #: ../align/virt-alignment-scan.pod:281
617 "Microsoft picked 1 MB as the default alignment for all partitions starting "
618 "with Windows 2008 Server, and Linux has followed this."
622 #: ../align/virt-alignment-scan.pod:284
624 "Assuming 512 byte sectors in the guest, you will now see the first partition "
625 "starting at sector 2048, and subsequent partitions (if any) will start at a "
626 "multiple of 2048 sectors."
630 #: ../align/virt-alignment-scan.pod:288
632 "1 MB alignment is compatible with all current alignment requirements (4K, "
633 "64K) and provides room for future growth in physical block sizes."
637 #: ../align/virt-alignment-scan.pod:291
638 msgid "SETTING ALIGNMENT"
642 #: ../align/virt-alignment-scan.pod:293
644 "L<virt-resize(1)> can change the alignment of the partitions of some "
645 "guests. Currently it can fully align all the partitions of all Windows "
646 "guests, and it will fix the bootloader where necessary. For Linux guests, "
647 "it can align the second and subsequent partitions, so the majority of OS "
648 "accesses except at boot will be aligned."
652 #: ../align/virt-alignment-scan.pod:299
654 "Another way to correct partition alignment problems is to reinstall your "
655 "guest operating systems. If you install operating systems from templates, "
656 "ensure these have correct partition alignment too."
660 #: ../align/virt-alignment-scan.pod:303
662 "For older versions of Windows, the following NetApp document contains useful "
663 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
667 #: ../align/virt-alignment-scan.pod:306
669 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
670 "an explicit C<%pre> section that creates aligned partitions using "
671 "L<parted(8)>. Do not use the Kickstart C<part> command. The NetApp "
672 "document above contains an example."
676 #: ../align/virt-alignment-scan.pod:311 ../cat/virt-cat.pod:231 ../cat/virt-filesystems.pod:373 ../cat/virt-ls.pod:483 ../clone/virt-sysprep.pod:475 ../df/virt-df.pod:241 ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:367 ../rescue/virt-rescue.pod:303 ../resize/virt-resize.pod:682 ../tools/virt-list-filesystems.pl:188 ../tools/virt-list-partitions.pl:258 ../tools/virt-make-fs.pl:550 ../tools/virt-tar.pl:289 ../tools/virt-win-reg.pl:744
677 msgid "SHELL QUOTING"
681 #: ../align/virt-alignment-scan.pod:313 ../cat/virt-cat.pod:233 ../cat/virt-filesystems.pod:375 ../cat/virt-ls.pod:485 ../clone/virt-sysprep.pod:477 ../df/virt-df.pod:243 ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:369 ../rescue/virt-rescue.pod:305 ../resize/virt-resize.pod:684 ../tools/virt-list-filesystems.pl:190 ../tools/virt-list-partitions.pl:260 ../tools/virt-make-fs.pl:552 ../tools/virt-tar.pl:291 ../tools/virt-win-reg.pl:752
683 "Libvirt guest names can contain arbitrary characters, some of which have "
684 "meaning to the shell such as C<#> and space. You may need to quote or "
685 "escape these characters on the command line. See the shell manual page "
686 "L<sh(1)> for details."
690 #: ../align/virt-alignment-scan.pod:318 ../cat/virt-cat.pod:238 ../cat/virt-filesystems.pod:380 ../cat/virt-ls.pod:490 ../clone/virt-sysprep.pod:482 ../df/virt-df.pod:248 ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1114 ../fuse/guestmount.pod:312 ../inspector/virt-inspector.pod:390 ../resize/virt-resize.pod:689 ../sparsify/virt-sparsify.pod:251 ../test-tool/libguestfs-test-tool.pod:90
695 #: ../align/virt-alignment-scan.pod:320
696 msgid "This program returns:"
700 #: ../align/virt-alignment-scan.pod:324 ../align/virt-alignment-scan.pod:330 ../align/virt-alignment-scan.pod:336 ../align/virt-alignment-scan.pod:343 ../cat/virt-cat.pod:177 ../cat/virt-cat.pod:182 ../cat/virt-cat.pod:187 ../cat/virt-cat.pod:198 ../cat/virt-cat.pod:202 ../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 ../examples/guestfs-testing.pod:110 ../examples/guestfs-testing.pod:114 ../examples/guestfs-testing.pod:118 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:441 ../fish/guestfish-actions.pod:449 ../fish/guestfish-actions.pod:456 ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:1293 ../fish/guestfish-actions.pod:1297 ../fish/guestfish-actions.pod:1301 ../fish/guestfish-actions.pod:1305 ../fish/guestfish-actions.pod:1313 ../fish/guestfish-actions.pod:1317 ../fish/guestfish-actions.pod:1321 ../fish/guestfish-actions.pod:1331 ../fish/guestfish-actions.pod:1335 ../fish/guestfish-actions.pod:1339 ../fish/guestfish-actions.pod:1429 ../fish/guestfish-actions.pod:1433 ../fish/guestfish-actions.pod:1438 ../fish/guestfish-actions.pod:1443 ../fish/guestfish-actions.pod:1485 ../fish/guestfish-actions.pod:1489 ../fish/guestfish-actions.pod:1494 ../fish/guestfish-actions.pod:1750 ../fish/guestfish-actions.pod:1757 ../fish/guestfish-actions.pod:1764 ../fish/guestfish-actions.pod:2167 ../fish/guestfish-actions.pod:2173 ../fish/guestfish-actions.pod:2181 ../fish/guestfish-actions.pod:2188 ../fish/guestfish-actions.pod:2195 ../fish/guestfish.pod:445 ../fish/guestfish.pod:449 ../fish/guestfish.pod:453 ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:408 ../inspector/virt-inspector.pod:412 ../resize/virt-resize.pod:365 ../resize/virt-resize.pod:369 ../resize/virt-resize.pod:378 ../resize/virt-resize.pod:384 ../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:641 ../src/guestfs-actions.pod:649 ../src/guestfs-actions.pod:656 ../src/guestfs-actions.pod:663 ../src/guestfs-actions.pod:2118 ../src/guestfs-actions.pod:2122 ../src/guestfs-actions.pod:2126 ../src/guestfs-actions.pod:2130 ../src/guestfs-actions.pod:2138 ../src/guestfs-actions.pod:2142 ../src/guestfs-actions.pod:2146 ../src/guestfs-actions.pod:2156 ../src/guestfs-actions.pod:2160 ../src/guestfs-actions.pod:2164 ../src/guestfs-actions.pod:2302 ../src/guestfs-actions.pod:2306 ../src/guestfs-actions.pod:2311 ../src/guestfs-actions.pod:2316 ../src/guestfs-actions.pod:2377 ../src/guestfs-actions.pod:2381 ../src/guestfs-actions.pod:2386 ../src/guestfs-actions.pod:2801 ../src/guestfs-actions.pod:2808 ../src/guestfs-actions.pod:2815 ../src/guestfs-actions.pod:3360 ../src/guestfs-actions.pod:3366 ../src/guestfs-actions.pod:3374 ../src/guestfs-actions.pod:3381 ../src/guestfs-actions.pod:3388 ../src/guestfs.pod:403 ../src/guestfs.pod:408 ../src/guestfs.pod:413 ../src/guestfs.pod:417 ../src/guestfs.pod:422 ../src/guestfs.pod:426 ../src/guestfs.pod:431 ../src/guestfs.pod:436 ../src/guestfs.pod:1109 ../src/guestfs.pod:1113 ../src/guestfs.pod:1117 ../src/guestfs.pod:1122 ../src/guestfs.pod:1130 ../src/guestfs.pod:1149 ../src/guestfs.pod:1157 ../src/guestfs.pod:1179 ../src/guestfs.pod:1183 ../src/guestfs.pod:1187 ../src/guestfs.pod:1191 ../src/guestfs.pod:1195 ../src/guestfs.pod:1199 ../src/guestfs.pod:1689 ../src/guestfs.pod:1694 ../src/guestfs.pod:1698 ../src/guestfs.pod:1800 ../src/guestfs.pod:1805 ../src/guestfs.pod:1809 ../src/guestfs.pod:1819 ../src/guestfs.pod:2108 ../src/guestfs.pod:2113 ../src/guestfs.pod:2119 ../src/guestfs.pod:2127 ../src/guestfs.pod:2645 ../src/guestfs.pod:2651 ../src/guestfs.pod:2656 ../src/guestfs.pod:2662 ../src/guestfs.pod:3048 ../src/guestfs.pod:3053 ../src/guestfs.pod:3057 ../src/guestfs.pod:3061 ../src/guestfs.pod:3065 ../src/guestfs.pod:3079 ../src/guestfs.pod:3084 ../src/guestfs.pod:3316 ../src/guestfs.pod:3320 ../src/guestfs.pod:3324 ../src/guestfs.pod:3328 ../tools/virt-win-reg.pl:197 ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208 ../tools/virt-win-reg.pl:721 ../tools/virt-win-reg.pl:727 ../tools/virt-win-reg.pl:733
705 #: ../align/virt-alignment-scan.pod:326
710 #: ../align/virt-alignment-scan.pod:328
711 msgid "successful exit, all partitions are aligned E<ge> 64K for best performance"
715 #: ../align/virt-alignment-scan.pod:332
720 #: ../align/virt-alignment-scan.pod:334
721 msgid "an error scanning the disk image or guest"
725 #: ../align/virt-alignment-scan.pod:338
730 #: ../align/virt-alignment-scan.pod:340
732 "successful exit, some partitions have alignment E<lt> 64K which can result "
733 "in poor performance on high end network storage"
737 #: ../align/virt-alignment-scan.pod:345
742 #: ../align/virt-alignment-scan.pod:347
744 "successful exit, some partitions have alignment E<lt> 4K which can result in "
745 "poor performance on most hypervisors"
749 #: ../align/virt-alignment-scan.pod:352 ../cat/virt-cat.pod:243 ../cat/virt-filesystems.pod:385 ../cat/virt-ls.pod:495 ../clone/virt-sysprep.pod:486 ../df/virt-df.pod:253 ../edit/virt-edit.pod:354 ../erlang/examples/guestfs-erlang.pod:97 ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384 ../examples/guestfs-testing.pod:291 ../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:395 ../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:325 ../resize/virt-resize.pod:694 ../ruby/examples/guestfs-ruby.pod:36 ../sparsify/virt-sparsify.pod:275 ../src/guestfs.pod:3256 ../test-tool/libguestfs-test-tool.pod:100 ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265 ../tools/virt-make-fs.pl:557 ../tools/virt-tar.pl:296 ../tools/virt-win-reg.pl:757
754 #: ../align/virt-alignment-scan.pod:354
756 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
757 "L<virt-resize(1)>, L<http://libguestfs.org/>."
761 #: ../align/virt-alignment-scan.pod:361 ../cat/virt-cat.pod:252 ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:507 ../clone/virt-sysprep.pod:501 ../df/virt-df.pod:261 ../edit/virt-edit.pod:368 ../rescue/virt-rescue.pod:334 ../resize/virt-resize.pod:717 ../sparsify/virt-sparsify.pod:288 ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277 ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:311 ../tools/virt-win-reg.pl:783
766 #: ../align/virt-alignment-scan.pod:363 ../cat/virt-cat.pod:254 ../cat/virt-filesystems.pod:398 ../cat/virt-ls.pod:509 ../clone/virt-sysprep.pod:503 ../df/virt-df.pod:263 ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:410 ../rescue/virt-rescue.pod:336 ../resize/virt-resize.pod:719 ../sparsify/virt-sparsify.pod:290 ../tools/virt-list-filesystems.pl:210 ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:584 ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:785
767 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
771 #: ../align/virt-alignment-scan.pod:365 ../cat/virt-cat.pod:256 ../cat/virt-filesystems.pod:400 ../cat/virt-ls.pod:511 ../clone/virt-sysprep.pod:505 ../df/virt-df.pod:265 ../edit/virt-edit.pod:372 ../erlang/examples/guestfs-erlang.pod:114 ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401 ../examples/guestfs-testing.pod:302 ../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:418 ../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:338 ../resize/virt-resize.pod:721 ../ruby/examples/guestfs-ruby.pod:52 ../sparsify/virt-sparsify.pod:292 ../src/guestfs.pod:3339 ../test-tool/libguestfs-test-tool.pod:110 ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281 ../tools/virt-make-fs.pl:586 ../tools/virt-tar.pl:315 ../tools/virt-win-reg.pl:787
776 #: ../align/virt-alignment-scan.pod:367 ../clone/virt-sysprep.pod:507 ../sparsify/virt-sparsify.pod:294
777 msgid "Copyright (C) 2011 Red Hat Inc."
781 #: ../align/virt-alignment-scan.pod:369 ../cat/virt-cat.pod:260 ../cat/virt-filesystems.pod:404 ../cat/virt-ls.pod:515 ../clone/virt-sysprep.pod:509 ../df/virt-df.pod:269 ../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:422 ../rescue/virt-rescue.pod:342 ../resize/virt-resize.pod:725 ../sparsify/virt-sparsify.pod:296 ../test-tool/libguestfs-test-tool.pod:115 ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285 ../tools/virt-make-fs.pl:590 ../tools/virt-tar.pl:319 ../tools/virt-win-reg.pl:791
783 "This program is free software; you can redistribute it and/or modify it "
784 "under the terms of the GNU General Public License as published by the Free "
785 "Software Foundation; either version 2 of the License, or (at your option) "
790 #: ../align/virt-alignment-scan.pod:374 ../cat/virt-cat.pod:265 ../cat/virt-filesystems.pod:409 ../cat/virt-ls.pod:520 ../clone/virt-sysprep.pod:514 ../df/virt-df.pod:274 ../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:427 ../rescue/virt-rescue.pod:347 ../resize/virt-resize.pod:730 ../sparsify/virt-sparsify.pod:301 ../test-tool/libguestfs-test-tool.pod:120 ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290 ../tools/virt-make-fs.pl:595 ../tools/virt-tar.pl:324 ../tools/virt-win-reg.pl:796
792 "This program is distributed in the hope that it will be useful, but WITHOUT "
793 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
794 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
799 #: ../align/virt-alignment-scan.pod:379 ../cat/virt-cat.pod:270 ../cat/virt-filesystems.pod:414 ../cat/virt-ls.pod:525 ../clone/virt-sysprep.pod:519 ../df/virt-df.pod:279 ../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:432 ../rescue/virt-rescue.pod:352 ../resize/virt-resize.pod:735 ../sparsify/virt-sparsify.pod:306 ../test-tool/libguestfs-test-tool.pod:125 ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295 ../tools/virt-make-fs.pl:600 ../tools/virt-tar.pl:329 ../tools/virt-win-reg.pl:801
801 "You should have received a copy of the GNU General Public License along with "
802 "this program; if not, write to the Free Software Foundation, Inc., 51 "
803 "Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA."
807 #: ../cat/virt-cat.pod:5
808 msgid "virt-cat - Display files in a virtual machine"
812 #: ../cat/virt-cat.pod:9
815 " virt-cat [--options] -d domname file [file ...]\n"
820 #: ../cat/virt-cat.pod:11
823 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
828 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15 ../inspector/virt-inspector.pod:13
833 #: ../cat/virt-cat.pod:15
836 " virt-cat domname file\n"
841 #: ../cat/virt-cat.pod:17
844 " virt-cat disk.img file\n"
849 #: ../cat/virt-cat.pod:21
851 "C<virt-cat> is a command line tool to display the contents of C<file> where "
852 "C<file> exists in the named virtual machine (or disk image)."
856 #: ../cat/virt-cat.pod:24
858 "Multiple filenames can be given, in which case they are concatenated "
859 "together. Each filename must be a full path, starting at the root directory "
860 "(starting with '/')."
864 #: ../cat/virt-cat.pod:28
866 "C<virt-cat> can be used to quickly view a file. To edit a file, use "
867 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
868 "tool (see L</USING GUESTFISH> below)."
872 #: ../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
877 #: ../cat/virt-cat.pod:34
878 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
882 #: ../cat/virt-cat.pod:37
885 " virt-cat -d mydomain /etc/fstab\n"
890 #: ../cat/virt-cat.pod:39
891 msgid "List syslog messages from a VM disk image file:"
895 #: ../cat/virt-cat.pod:41
898 " virt-cat -a disk.img /var/log/messages | tail\n"
903 #: ../cat/virt-cat.pod:43
904 msgid "Find out what DHCP IP address a VM acquired:"
908 #: ../cat/virt-cat.pod:45
911 " virt-cat -d mydomain /var/log/messages | \\\n"
912 " grep 'dhclient: bound to' | tail\n"
917 #: ../cat/virt-cat.pod:48
918 msgid "Find out what packages were recently installed:"
922 #: ../cat/virt-cat.pod:50
925 " virt-cat -d mydomain /var/log/yum.log | tail\n"
930 #: ../cat/virt-cat.pod:52
931 msgid "Find out who is logged on inside a virtual machine:"
935 #: ../cat/virt-cat.pod:54
938 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
944 #: ../cat/virt-cat.pod:57
945 msgid "or who was logged on:"
949 #: ../cat/virt-cat.pod:59
952 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
953 " last -f /tmp/wtmp\n"
958 #: ../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:124
960 "Add I<file> which should be a disk image from a virtual machine. If the "
961 "virtual machine has multiple block devices, you must supply all of them with "
962 "separate I<-a> options."
966 #: ../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
967 msgid "B<--echo-keys>"
971 #: ../cat/virt-cat.pod:100
973 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
974 "so you cannot see what you are typing. If you are not worried about Tempest "
975 "attacks and there is no one else in the room you can specify this flag to "
976 "see what you are typing."
980 #: ../cat/virt-cat.pod:116
983 " virt-cat --format=raw -a disk.img file\n"
988 #: ../cat/virt-cat.pod:120
991 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
996 #: ../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
997 msgid "B<--keys-from-stdin>"
1001 #: ../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
1003 "Read key or passphrase parameters from stdin. The default is to try to read "
1004 "passphrases from the user by opening C</dev/tty>."
1008 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179 ../inspector/virt-inspector.pod:144 ../rescue/virt-rescue.pod:246
1009 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
1013 #: ../cat/virt-cat.pod:154
1014 msgid "Previous versions of virt-cat allowed you to write either:"
1018 #: ../cat/virt-cat.pod:156
1021 " virt-cat disk.img [disk.img ...] file\n"
1026 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185 ../inspector/virt-inspector.pod:150 ../rescue/virt-rescue.pod:252
1031 #: ../cat/virt-cat.pod:160
1034 " virt-cat guestname file\n"
1039 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189 ../inspector/virt-inspector.pod:154 ../rescue/virt-rescue.pod:256
1041 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1042 "the confusing case where a disk image might have the same name as a guest."
1046 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193 ../inspector/virt-inspector.pod:158 ../rescue/virt-rescue.pod:260
1047 msgid "For compatibility the old style is still supported."
1051 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
1052 msgid "WINDOWS PATHS"
1056 #: ../cat/virt-cat.pod:170
1058 "C<virt-cat> has a limited ability to understand Windows drive letters and "
1059 "paths (eg. C<E:\\foo\\bar.txt>)."
1063 #: ../cat/virt-cat.pod:173 ../edit/virt-edit.pod:262
1064 msgid "If and only if the guest is running Windows then:"
1068 #: ../cat/virt-cat.pod:179 ../edit/virt-edit.pod:268
1070 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
1071 "to the correct filesystem."
1075 #: ../cat/virt-cat.pod:184 ../edit/virt-edit.pod:273
1077 "Any backslash (C<\\>) characters in the path are replaced with forward "
1078 "slashes so that libguestfs can process it."
1082 #: ../cat/virt-cat.pod:189
1084 "The path is resolved case insensitively to locate the file that should be "
1089 #: ../cat/virt-cat.pod:194 ../edit/virt-edit.pod:283
1090 msgid "There are some known shortcomings:"
1094 #: ../cat/virt-cat.pod:200 ../edit/virt-edit.pod:289
1095 msgid "Some NTFS symbolic links may not be followed correctly."
1099 #: ../cat/virt-cat.pod:204 ../edit/virt-edit.pod:293
1100 msgid "NTFS junction points that cross filesystems are not followed."
1104 #: ../cat/virt-cat.pod:208 ../edit/virt-edit.pod:297
1105 msgid "USING GUESTFISH"
1109 #: ../cat/virt-cat.pod:210
1111 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1112 "C<virt-cat> doesn't work."
1116 #: ../cat/virt-cat.pod:213
1117 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1121 #: ../cat/virt-cat.pod:215
1124 " guestfish --ro -i -d domname download file -\n"
1129 #: ../cat/virt-cat.pod:217
1131 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1132 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1136 #: ../cat/virt-cat.pod:221
1138 "The command above uses libguestfs's guest inspection feature and so does not "
1139 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1140 "disk images that don't contain guests. To display a file from a disk image "
1145 #: ../cat/virt-cat.pod:226
1148 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1153 #: ../cat/virt-cat.pod:228
1155 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1156 "the disk image, and C<file> is the full path to the file."
1160 #: ../cat/virt-cat.pod:240 ../cat/virt-filesystems.pod:382 ../cat/virt-ls.pod:492 ../df/virt-df.pod:250 ../edit/virt-edit.pod:351 ../fuse/guestmount.pod:314 ../inspector/virt-inspector.pod:392 ../resize/virt-resize.pod:691 ../sparsify/virt-sparsify.pod:253
1161 msgid "This program returns 0 if successful, or non-zero if there was an error."
1165 #: ../cat/virt-cat.pod:245
1167 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
1168 "L<virt-tar-out(1)>, L<http://libguestfs.org/>."
1172 #: ../cat/virt-cat.pod:258 ../inspector/virt-inspector.pod:420 ../resize/virt-resize.pod:723 ../tools/virt-make-fs.pl:588
1173 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1177 #: ../cat/virt-filesystems.pod:5
1179 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1180 "virtual machine or disk image"
1184 #: ../cat/virt-filesystems.pod:9
1187 " virt-filesystems [--options] -d domname\n"
1192 #: ../cat/virt-filesystems.pod:11
1195 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1200 #: ../cat/virt-filesystems.pod:15
1202 "This tool allows you to discover filesystems, partitions, logical volumes, "
1203 "and their sizes in a disk image or virtual machine. It is a replacement for "
1204 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1208 #: ../cat/virt-filesystems.pod:20
1210 "One use for this tool is from shell scripts to iterate over all filesystems "
1211 "from a disk image:"
1215 #: ../cat/virt-filesystems.pod:23
1218 " for fs in $(virt-filesystems -a disk.img); do\n"
1225 #: ../cat/virt-filesystems.pod:27
1227 "Another use is to list partitions before using another tool to modify those "
1228 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1229 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1233 #: ../cat/virt-filesystems.pod:32
1235 "Various command line options control what this program displays. You need "
1236 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1237 "guest respectively. If you just specify that then the program shows "
1238 "filesystems found, one per line, like this:"
1242 #: ../cat/virt-filesystems.pod:37
1245 " $ virt-filesystems -a disk.img\n"
1247 " /dev/vg_guest/lv_root\n"
1252 #: ../cat/virt-filesystems.pod:41
1253 msgid "If you add I<-l> or I<--long> then the output includes extra information:"
1257 #: ../cat/virt-filesystems.pod:44
1260 " $ virt-filesystems -a disk.img -l\n"
1261 " Name Type VFS Label Size\n"
1262 " /dev/sda1 filesystem ext4 boot 524288000\n"
1263 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1268 #: ../cat/virt-filesystems.pod:49
1270 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1275 #: ../cat/virt-filesystems.pod:52
1278 " $ virt-filesystems -a disk.img --extra\n"
1280 " /dev/vg_guest/lv_root\n"
1281 " /dev/vg_guest/lv_swap\n"
1282 " /dev/vg_guest/lv_data\n"
1287 #: ../cat/virt-filesystems.pod:58
1288 msgid "If you add I<--partitions> then partitions are shown instead of filesystems:"
1292 #: ../cat/virt-filesystems.pod:60
1295 " $ virt-filesystems -a disk.img --partitions\n"
1302 #: ../cat/virt-filesystems.pod:64
1304 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, "
1305 "I<--physical-volumes>, I<--block-devices> to list those items."
1309 #: ../cat/virt-filesystems.pod:67
1311 "You can use these options in combination as well (if you want a combination "
1312 "including filesystems, you have to add I<--filesystems>). Notice that some "
1313 "items fall into several categories (eg. C</dev/sda1> might be both a "
1314 "partition and a filesystem). These items are listed several times. To get "
1315 "a list which includes absolutely everything that virt-filesystems knows "
1316 "about, use the I<--all> option."
1320 #: ../cat/virt-filesystems.pod:74
1322 "UUIDs (because they are quite long) are not shown by default. Add the "
1323 "I<--uuid> option to display device and filesystem UUIDs in the long output."
1327 #: ../cat/virt-filesystems.pod:78
1329 "I<--all --long --uuid> is a useful combination to display all possible "
1330 "information about everything."
1334 #: ../cat/virt-filesystems.pod:81
1337 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1338 " Name Type VFS Label Size Parent UUID\n"
1339 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1340 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1341 " /dev/sda1 partition - - 100M /dev/sda -\n"
1342 " /dev/sda2 partition - - 20G /dev/sda -\n"
1343 " /dev/sda device - - 20G - -\n"
1348 #: ../cat/virt-filesystems.pod:89
1349 msgid "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1353 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1358 #: ../cat/virt-filesystems.pod:112
1360 "Display everything. This is currently the same as specifying these options: "
1361 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, "
1362 "I<--logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may "
1363 "be added to this list in future)."
1367 #: ../cat/virt-filesystems.pod:117
1368 msgid "See also I<--long>."
1372 #: ../cat/virt-filesystems.pod:119
1373 msgid "B<--blkdevs>"
1377 #: ../cat/virt-filesystems.pod:121
1378 msgid "B<--block-devices>"
1382 #: ../cat/virt-filesystems.pod:123
1383 msgid "Display block devices."
1387 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1392 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1394 "Write out the results in CSV format (comma-separated values). This format "
1395 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1396 "ABOUT CSV FORMAT> below."
1400 #: ../cat/virt-filesystems.pod:150
1402 "When prompting for keys and passphrases, virt-filesystems normally turns "
1403 "echoing off so you cannot see what you are typing. If you are not worried "
1404 "about Tempest attacks and there is no one else in the room you can specify "
1405 "this flag to see what you are typing."
1409 #: ../cat/virt-filesystems.pod:155
1414 #: ../cat/virt-filesystems.pod:157
1416 "This causes filesystems that are not ordinary, mountable filesystems to be "
1417 "displayed. This category includes swapspace, and filesystems that are empty "
1418 "or contain unknown data."
1422 #: ../cat/virt-filesystems.pod:161
1423 msgid "This option implies I<--filesystems>."
1427 #: ../cat/virt-filesystems.pod:163
1428 msgid "B<--filesystems>"
1432 #: ../cat/virt-filesystems.pod:165
1434 "Display mountable filesystems. If no display option was selected then this "
1435 "option is implied."
1439 #: ../cat/virt-filesystems.pod:168
1440 msgid "With I<--extra>, non-mountable filesystems are shown too."
1444 #: ../cat/virt-filesystems.pod:181
1447 " virt-filesystems --format=raw -a disk.img\n"
1452 #: ../cat/virt-filesystems.pod:185
1455 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1460 #: ../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
1465 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354 ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1466 msgid "B<--human-readable>"
1470 #: ../cat/virt-filesystems.pod:198
1471 msgid "In I<--long> mode, display sizes in human-readable format."
1475 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366 ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1480 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368 ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1485 #: ../cat/virt-filesystems.pod:209
1486 msgid "Display extra columns of data (\"long format\")."
1490 #: ../cat/virt-filesystems.pod:211
1491 msgid "A title row is added unless you also specify I<--no-title>."
1495 #: ../cat/virt-filesystems.pod:213
1497 "The extra columns displayed depend on what output you select, and the "
1498 "ordering of columns may change in future versions. Use the title row, "
1499 "I<--csv> output and/or L<csvtool(1)> to match columns to data in external "
1504 #: ../cat/virt-filesystems.pod:218
1506 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1507 "default is to show raw numbers of I<bytes>."
1511 #: ../cat/virt-filesystems.pod:221
1512 msgid "Use I<--uuid> to display UUIDs too."
1516 #: ../cat/virt-filesystems.pod:223
1521 #: ../cat/virt-filesystems.pod:225
1522 msgid "B<--logvols>"
1526 #: ../cat/virt-filesystems.pod:227
1527 msgid "B<--logical-volumes>"
1531 #: ../cat/virt-filesystems.pod:229
1533 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1534 "of whether the LVs contain filesystems."
1538 #: ../cat/virt-filesystems.pod:232
1539 msgid "B<--no-title>"
1543 #: ../cat/virt-filesystems.pod:234
1544 msgid "In I<--long> mode, don't add a title row."
1548 #: ../cat/virt-filesystems.pod:236
1550 "Note that the order of the columns is not fixed, and may change in future "
1551 "versions of virt-filesystems, so using this option may give you unexpected "
1556 #: ../cat/virt-filesystems.pod:240
1561 #: ../cat/virt-filesystems.pod:242
1562 msgid "B<--partitions>"
1566 #: ../cat/virt-filesystems.pod:244
1568 "Display partitions. In this mode, these are displayed irrespective of "
1569 "whether the partitions contain filesystems."
1573 #: ../cat/virt-filesystems.pod:247
1578 #: ../cat/virt-filesystems.pod:249
1579 msgid "B<--physvols>"
1583 #: ../cat/virt-filesystems.pod:251
1584 msgid "B<--physical-volumes>"
1588 #: ../cat/virt-filesystems.pod:253
1589 msgid "Display LVM physical volumes."
1593 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1598 #: ../cat/virt-filesystems.pod:257
1603 #: ../cat/virt-filesystems.pod:259
1604 msgid "In I<--long> mode, display UUIDs as well."
1608 #: ../cat/virt-filesystems.pod:273
1613 #: ../cat/virt-filesystems.pod:275
1614 msgid "B<--volgroups>"
1618 #: ../cat/virt-filesystems.pod:277
1619 msgid "B<--volume-groups>"
1623 #: ../cat/virt-filesystems.pod:279
1624 msgid "Display LVM volume groups."
1628 #: ../cat/virt-filesystems.pod:287
1633 #: ../cat/virt-filesystems.pod:289
1635 "Note that columns in the output are subject to reordering and change in "
1636 "future versions of this tool."
1640 #: ../cat/virt-filesystems.pod:294
1645 #: ../cat/virt-filesystems.pod:296
1646 msgid "The filesystem, partition, block device or LVM name."
1650 #: ../cat/virt-filesystems.pod:298
1652 "For device and partition names these are displayed as canonical libguestfs "
1653 "names, so that for example C</dev/sda2> is the second partition on the first "
1658 #: ../cat/virt-filesystems.pod:302
1660 "If the I<--long> option is B<not> specified, then only the name column is "
1661 "shown in the output."
1665 #: ../cat/virt-filesystems.pod:305
1670 #: ../cat/virt-filesystems.pod:307
1671 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1675 #: ../cat/virt-filesystems.pod:309
1680 #: ../cat/virt-filesystems.pod:311
1682 "If there is a filesystem, then this column displays the filesystem type if "
1683 "one could be detected, eg. C<ext4>."
1687 #: ../cat/virt-filesystems.pod:314
1692 #: ../cat/virt-filesystems.pod:316
1694 "If the object has a label (used for identifying and mounting filesystems) "
1695 "then this column contains the label."
1699 #: ../cat/virt-filesystems.pod:319
1704 #: ../cat/virt-filesystems.pod:321
1706 "The partition type byte, displayed as a two digit hexadecimal number. A "
1707 "comprehensive list of partition types can be found here: "
1708 "L<http://www.win.tue.nl/~aeb/partitions/partition_types-1.html>"
1712 #: ../cat/virt-filesystems.pod:325
1713 msgid "This is only applicable for DOS (MBR) partitions."
1717 #: ../cat/virt-filesystems.pod:327
1722 #: ../cat/virt-filesystems.pod:329
1724 "The size of the object in bytes. If the I<--human> option is used then the "
1725 "size is displayed in a human-readable form."
1729 #: ../cat/virt-filesystems.pod:332
1734 #: ../cat/virt-filesystems.pod:334
1736 "The parent column records the parent relationship between objects. For "
1737 "example, if the object is a partition, then this column contains the name of "
1738 "the containing device. If the object is a logical volume, then this column "
1739 "is the name of the volume group."
1743 #: ../cat/virt-filesystems.pod:339
1748 #: ../cat/virt-filesystems.pod:341
1750 "If the object has a UUID (used for identifying and mounting filesystems and "
1751 "block devices) then this column contains the UUID as a string."
1755 #: ../cat/virt-filesystems.pod:345
1756 msgid "The UUID is only displayed if the I<--uuid> option is given."
1760 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:459 ../df/virt-df.pod:217
1761 msgid "NOTE ABOUT CSV FORMAT"
1765 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:461 ../df/virt-df.pod:219
1767 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1768 "should be easy to parse, but it is definitely not easy to parse."
1772 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:464 ../df/virt-df.pod:222
1774 "Myth: Just split fields at commas. Reality: This does I<not> work "
1775 "reliably. This example has two columns:"
1779 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:467 ../df/virt-df.pod:225
1782 " \"foo,bar\",baz\n"
1787 #: ../cat/virt-filesystems.pod:359 ../cat/virt-ls.pod:469 ../df/virt-df.pod:227
1789 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1790 "reliably. This example has one row:"
1794 #: ../cat/virt-filesystems.pod:362 ../cat/virt-ls.pod:472 ../df/virt-df.pod:230
1803 #: ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:475 ../df/virt-df.pod:233
1805 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1806 "packaged in major Linux distributions)."
1810 #: ../cat/virt-filesystems.pod:368 ../cat/virt-ls.pod:478 ../df/virt-df.pod:236
1812 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1813 "or Python's built-in csv library)."
1817 #: ../cat/virt-filesystems.pod:371 ../cat/virt-ls.pod:481 ../df/virt-df.pod:239
1818 msgid "Most spreadsheets and databases can import CSV directly."
1822 #: ../cat/virt-filesystems.pod:387
1824 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
1825 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, "
1826 "L<http://libguestfs.org/>."
1830 #: ../cat/virt-filesystems.pod:402 ../tools/virt-win-reg.pl:789
1831 msgid "Copyright (C) 2010 Red Hat Inc."
1835 #: ../cat/virt-ls.pod:5
1836 msgid "virt-ls - List files in a virtual machine"
1840 #: ../cat/virt-ls.pod:9
1843 " virt-ls [--options] -d domname directory [directory ...]\n"
1848 #: ../cat/virt-ls.pod:11
1851 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory "
1857 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:15
1862 #: ../cat/virt-ls.pod:15
1865 " virt-ls [--options] domname directory\n"
1870 #: ../cat/virt-ls.pod:17
1873 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1878 #: ../cat/virt-ls.pod:21
1880 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1881 "more from a virtual machine or disk image."
1885 #: ../cat/virt-ls.pod:24
1887 "Multiple directory names can be given, in which case the output from each is "
1892 #: ../cat/virt-ls.pod:27
1894 "To list directories from a libvirt guest use the I<-d> option to specify the "
1895 "name of the guest. For a disk image, use the I<-a> option."
1899 #: ../cat/virt-ls.pod:31
1901 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1902 "may need to use L<guestfish(1)>, or write a program directly to the "
1903 "L<guestfs(3)> API."
1907 #: ../cat/virt-ls.pod:37
1908 msgid "Get a list of all files and directories in a virtual machine:"
1912 #: ../cat/virt-ls.pod:39
1915 " virt-ls -R -d guest /\n"
1920 #: ../cat/virt-ls.pod:41 ../examples/guestfs-testing.pod:182
1921 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1925 #: ../cat/virt-ls.pod:43
1928 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1933 #: ../cat/virt-ls.pod:45 ../examples/guestfs-testing.pod:186
1934 msgid "List all public-writable directories in a Linux virtual machine:"
1938 #: ../cat/virt-ls.pod:47
1941 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1946 #: ../cat/virt-ls.pod:49 ../examples/guestfs-testing.pod:190
1947 msgid "List all Unix domain sockets in a Linux virtual machine:"
1951 #: ../cat/virt-ls.pod:51
1954 " virt-ls -lR -d guest / | grep '^s'\n"
1959 #: ../cat/virt-ls.pod:53 ../examples/guestfs-testing.pod:194
1960 msgid "List all regular files with filenames ending in '.png':"
1964 #: ../cat/virt-ls.pod:55
1967 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1972 #: ../cat/virt-ls.pod:57
1973 msgid "To display files larger than 10MB in home directories:"
1977 #: ../cat/virt-ls.pod:59
1980 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1985 #: ../cat/virt-ls.pod:61 ../examples/guestfs-testing.pod:202
1986 msgid "Find everything modified in the last 7 days:"
1990 #: ../cat/virt-ls.pod:63
1993 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1998 #: ../cat/virt-ls.pod:65 ../examples/guestfs-testing.pod:206
1999 msgid "Find regular files modified in the last 24 hours:"
2003 #: ../cat/virt-ls.pod:67
2006 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
2011 #: ../cat/virt-ls.pod:69
2012 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
2016 #: ../cat/virt-ls.pod:71
2018 "Find the differences between files in a guest and an earlier snapshot of the "
2023 #: ../cat/virt-ls.pod:74
2026 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
2027 " virt-ls -lR -a current.img / --uids --time-t > new\n"
2028 " diff -u old new | less\n"
2033 #: ../cat/virt-ls.pod:78
2035 "The commands above won't find files where the content has changed but the "
2036 "metadata (eg. file size and modification date) is the same. To do that, you "
2037 "need to add the I<--checksum> parameter to both C<virt-ls> commands. "
2038 "I<--checksum> can be quite slow since it has to read and compute a checksum "
2039 "of every regular file in the virtual machine."
2043 #: ../cat/virt-ls.pod:84
2044 msgid "OUTPUT MODES"
2048 #: ../cat/virt-ls.pod:86
2050 "C<virt-ls> has four output modes, controlled by different combinations of "
2051 "the I<-l> and I<-R> options."
2055 #: ../cat/virt-ls.pod:89
2056 msgid "SIMPLE LISTING"
2060 #: ../cat/virt-ls.pod:91
2061 msgid "A simple listing is like the ordinary L<ls(1)> command:"
2065 #: ../cat/virt-ls.pod:93
2068 " $ virt-ls -d guest /\n"
2076 #: ../cat/virt-ls.pod:98
2077 msgid "LONG LISTING"
2081 #: ../cat/virt-ls.pod:100
2083 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
2084 "(more specifically, like the C<guestfs_ll> function)."
2088 #: ../cat/virt-ls.pod:103
2091 " $ virt-ls -l -d guest /\n"
2093 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2094 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2100 #: ../cat/virt-ls.pod:109
2102 "Note that while this is useful for displaying a directory, do not try "
2103 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2108 #: ../cat/virt-ls.pod:113
2109 msgid "RECURSIVE LISTING"
2113 #: ../cat/virt-ls.pod:115
2115 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2116 "and directories recursively:"
2120 #: ../cat/virt-ls.pod:118
2123 " $ virt-ls -R -d guest /tmp\n"
2131 #: ../cat/virt-ls.pod:123
2133 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2134 "converts C<\\0> characters to C<\\n>."
2138 #: ../cat/virt-ls.pod:126
2139 msgid "RECURSIVE LONG LISTING"
2143 #: ../cat/virt-ls.pod:128
2145 "Using I<-lR> options together changes the output to display directories "
2146 "recursively, with file stats, and optionally other features such as "
2147 "checksums and extended attributes."
2151 #: ../cat/virt-ls.pod:132
2153 "Most of the interesting features of C<virt-ls> are only available when using "
2158 #: ../cat/virt-ls.pod:135
2160 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2161 "you cannot use the output in another program (because filenames can contain "
2162 "spaces and other unsafe characters). If the guest was untrusted and someone "
2163 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2164 "on you by creating filenames with embedded newline characters. To B<safely> "
2165 "parse the output in another program, use the I<--csv> (Comma-Separated "
2170 #: ../cat/virt-ls.pod:143
2172 "Note that this output format is completely unrelated to the C<ls -lR> "
2177 #: ../cat/virt-ls.pod:146
2180 " $ virt-ls -lR -d guest /bin\n"
2181 " d 0555 4096 /bin\n"
2182 " - 0755 123 /bin/alsaunmute\n"
2183 " - 0755 28328 /bin/arch\n"
2184 " l 0777 4 /bin/awk -> gawk\n"
2185 " - 0755 27216 /bin/basename\n"
2186 " - 0755 943360 /bin/bash\n"
2192 #: ../cat/virt-ls.pod:155
2193 msgid "These basic fields are always shown:"
2197 #: ../cat/virt-ls.pod:159
2202 #: ../cat/virt-ls.pod:161
2204 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2205 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2206 "link), C<s> (socket) or C<u> (unknown)."
2210 #: ../cat/virt-ls.pod:171
2215 #: ../cat/virt-ls.pod:173
2216 msgid "The Unix permissions, displayed as a 4 digit octal number."
2220 #: ../cat/virt-ls.pod:175
2225 #: ../cat/virt-ls.pod:177
2227 "The size of the file. This is shown in bytes unless I<-h> or "
2228 "I<--human-readable> option is given, in which case this is shown as a "
2229 "human-readable number."
2233 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4519
2238 #: ../cat/virt-ls.pod:183
2239 msgid "The full path of the file or directory."
2243 #: ../cat/virt-ls.pod:185
2248 #: ../cat/virt-ls.pod:187
2249 msgid "For symbolic links only, the link target."
2253 #: ../cat/virt-ls.pod:191
2255 "In I<-lR> mode, additional command line options enable the display of more "
2260 #: ../cat/virt-ls.pod:194
2262 "With the I<--uids> flag, these additional fields are displayed before the "
2267 #: ../cat/virt-ls.pod:199
2272 #: ../cat/virt-ls.pod:201
2277 #: ../cat/virt-ls.pod:203
2279 "The UID and GID of the owner of the file (displayed numerically). Note "
2280 "these only make sense in the context of a Unix-like guest."
2284 #: ../cat/virt-ls.pod:208
2285 msgid "With the I<--times> flag, these additional fields are displayed:"
2289 #: ../cat/virt-ls.pod:212
2294 #: ../cat/virt-ls.pod:214
2295 msgid "The time of last access."
2299 #: ../cat/virt-ls.pod:216
2304 #: ../cat/virt-ls.pod:218
2305 msgid "The time of last modification."
2309 #: ../cat/virt-ls.pod:220
2314 #: ../cat/virt-ls.pod:222
2315 msgid "The time of last status change."
2319 #: ../cat/virt-ls.pod:226
2321 "The time fields are displayed as string dates and times, unless one of the "
2322 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2326 #: ../cat/virt-ls.pod:229
2327 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2331 #: ../cat/virt-ls.pod:233
2336 #: ../cat/virt-ls.pod:235
2338 "The device containing the file (displayed as major:minor). This may not "
2339 "match devices as known to the guest."
2343 #: ../cat/virt-ls.pod:238
2348 #: ../cat/virt-ls.pod:240
2349 msgid "The inode number."
2353 #: ../cat/virt-ls.pod:242
2358 #: ../cat/virt-ls.pod:244
2359 msgid "The number of hard links."
2363 #: ../cat/virt-ls.pod:246
2368 #: ../cat/virt-ls.pod:248
2369 msgid "For block and char special files, the device (displayed as major:minor)."
2373 #: ../cat/virt-ls.pod:251
2378 #: ../cat/virt-ls.pod:253
2379 msgid "The number of 512 byte blocks allocated to the file."
2383 #: ../cat/virt-ls.pod:257
2385 "With the I<--checksum> flag, the checksum of the file contents is shown "
2386 "(only for regular files). Computing file checksums can take a considerable "
2391 #: ../cat/virt-ls.pod:280
2392 msgid "B<--checksum>"
2396 #: ../cat/virt-ls.pod:282
2397 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2401 #: ../cat/virt-ls.pod:284
2403 "Display checksum over file contents for regular files. With no argument, "
2404 "this defaults to using I<md5>. Using an argument, you can select the "
2405 "checksum type to use."
2409 #: ../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
2411 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2416 #: ../cat/virt-ls.pod:316
2418 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2419 "so you cannot see what you are typing. If you are not worried about Tempest "
2420 "attacks and there is no one else in the room you can specify this flag to "
2421 "see what you are typing."
2425 #: ../cat/virt-ls.pod:321
2426 msgid "B<--extra-stats>"
2430 #: ../cat/virt-ls.pod:323
2431 msgid "Display extra stats."
2435 #: ../cat/virt-ls.pod:339
2438 " virt-ls --format=raw -a disk.img /dir\n"
2443 #: ../cat/virt-ls.pod:343
2446 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2451 #: ../cat/virt-ls.pod:356
2452 msgid "Display file sizes in human-readable format."
2456 #: ../cat/virt-ls.pod:370
2461 #: ../cat/virt-ls.pod:372
2462 msgid "B<--recursive>"
2466 #: ../cat/virt-ls.pod:374
2468 "Select the mode. With neither of these options, C<virt-ls> produces a "
2469 "simple, flat list of the files in the named directory. See L</SIMPLE "
2474 #: ../cat/virt-ls.pod:378
2476 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See "
2481 #: ../cat/virt-ls.pod:381
2483 "C<virt-ls -R> produces a recursive list of files starting at the named "
2484 "directory. See L</RECURSIVE LISTING>."
2488 #: ../cat/virt-ls.pod:384
2490 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2491 "parsed. See L</RECURSIVE LONG LISTING>."
2495 #: ../cat/virt-ls.pod:387
2500 #: ../cat/virt-ls.pod:389
2501 msgid "Display time fields."
2505 #: ../cat/virt-ls.pod:394
2506 msgid "B<--time-days>"
2510 #: ../cat/virt-ls.pod:396
2511 msgid "Display time fields as days before now (negative if in the future)."
2515 #: ../cat/virt-ls.pod:398
2517 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2518 "of the file is between 0 and 86399 seconds."
2522 #: ../cat/virt-ls.pod:404
2523 msgid "B<--time-relative>"
2527 #: ../cat/virt-ls.pod:406
2528 msgid "Display time fields as seconds before now (negative if in the future)."
2532 #: ../cat/virt-ls.pod:411
2537 #: ../cat/virt-ls.pod:413
2538 msgid "Display time fields as seconds since the Unix epoch."
2542 #: ../cat/virt-ls.pod:418
2547 #: ../cat/virt-ls.pod:420
2548 msgid "Display UID and GID fields."
2552 #: ../cat/virt-ls.pod:445
2553 msgid "Previous versions of virt-ls allowed you to write either:"
2557 #: ../cat/virt-ls.pod:447
2560 " virt-ls disk.img [disk.img ...] /dir\n"
2565 #: ../cat/virt-ls.pod:451
2568 " virt-ls guestname /dir\n"
2573 #: ../cat/virt-ls.pod:497
2575 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, "
2576 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
2577 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
2581 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:267 ../edit/virt-edit.pod:374 ../rescue/virt-rescue.pod:340
2582 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2586 #: ../clone/virt-sysprep.pod:5
2587 msgid "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
2591 #: ../clone/virt-sysprep.pod:9
2594 " virt-sysprep [--options] -d domname\n"
2599 #: ../clone/virt-sysprep.pod:11
2602 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
2607 #: ../clone/virt-sysprep.pod:15
2609 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
2610 "can be made from it. Steps in this process include removing SSH host keys, "
2611 "removing persistent network MAC configuration, and removing user accounts. "
2612 "Each step can be enabled or disabled as required."
2616 #: ../clone/virt-sysprep.pod:21
2618 "Virt-sysprep is a simple shell script, allowing easy inspection or "
2619 "customization by the system administrator."
2623 #: ../clone/virt-sysprep.pod:24
2625 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
2626 "be shut down. If you want to preserve the existing contents of the guest, "
2627 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> "
2632 #: ../clone/virt-sysprep.pod:29
2634 "You do I<not> need to run virt-sysprep as root. In fact we'd generally "
2635 "recommend that you don't. The time you might want to run it as root is when "
2636 "you need root in order to access the disk image, but even in this case it "
2637 "would be better to change the permissions on the disk image to be writable "
2638 "as the non-root user running virt-sysprep."
2642 #: ../clone/virt-sysprep.pod:35
2644 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
2645 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
2646 "machines in preparation for cloning them. Having said that, virt-sysprep "
2647 "does I<not> currently work on Microsoft Windows guests. We plan to support "
2648 "Windows sysprepping in a future version, and we already have code to do it."
2652 #: ../clone/virt-sysprep.pod:76
2653 msgid "B<--enable=...>"
2657 #: ../clone/virt-sysprep.pod:78
2659 "Choose which sysprep operations to perform. Give a comma-separated list of "
2660 "operations, for example:"
2664 #: ../clone/virt-sysprep.pod:81
2667 " --enable=ssh-hostkeys,udev-persistent-net\n"
2672 #: ../clone/virt-sysprep.pod:83
2673 msgid "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
2677 #: ../clone/virt-sysprep.pod:85
2679 "If the I<--enable> option is not given, then we default to trying all "
2680 "possible sysprep operations. But some sysprep operations are skipped for "
2685 #: ../clone/virt-sysprep.pod:89
2687 "Use I<--list-operations> to list operations supported by a particular "
2688 "version of virt-sysprep."
2692 #: ../clone/virt-sysprep.pod:92
2693 msgid "See L</OPERATIONS> below for a list and an explanation of each operation."
2697 #: ../clone/virt-sysprep.pod:106
2700 " virt-sysprep --format=raw -a disk.img\n"
2705 #: ../clone/virt-sysprep.pod:110
2708 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
2713 #: ../clone/virt-sysprep.pod:119
2714 msgid "B<--hostname> newhostname"
2718 #: ../clone/virt-sysprep.pod:121
2720 "Change the hostname. See the L</hostname> operation below. If not given, "
2721 "defaults to C<localhost.localdomain>."
2725 #: ../clone/virt-sysprep.pod:124
2726 msgid "B<--list-operations>"
2730 #: ../clone/virt-sysprep.pod:126
2731 msgid "List the operations supported by the virt-sysprep program."
2735 #: ../clone/virt-sysprep.pod:128
2736 msgid "B<--selinux-relabel>"
2740 #: ../clone/virt-sysprep.pod:130
2741 msgid "B<--no-selinux-relabel>"
2745 #: ../clone/virt-sysprep.pod:132
2747 "I<--selinux-relabel> forces SELinux relabelling next time the guest boots. "
2748 "I<--no-selinux-relabel> disables relabelling."
2752 #: ../clone/virt-sysprep.pod:135
2754 "The default is to try to detect if SELinux relabelling is required. See "
2755 "L</SELINUX RELABELLING> below for more details."
2759 #: ../clone/virt-sysprep.pod:156
2764 #: ../clone/virt-sysprep.pod:158
2766 "If the I<--enable> option is I<not> given, then I<all sysprep operations are "
2767 "enabled>, although some are skipped depending on the type of guest."
2771 #: ../clone/virt-sysprep.pod:162
2773 "Operations can be individually enabled using the I<--enable> option. Use a "
2774 "comma-separated list, for example:"
2778 #: ../clone/virt-sysprep.pod:165
2781 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
2786 #: ../clone/virt-sysprep.pod:167
2788 "To list the operations supported by the current version of virt-sysprep, use "
2789 "I<--list-operations>."
2793 #: ../clone/virt-sysprep.pod:170
2795 "Future versions of virt-sysprep may add more operations. If you are using "
2796 "virt-sysprep and want predictable behaviour, specify only the operations "
2797 "that you want to have enabled."
2801 #: ../clone/virt-sysprep.pod:174
2806 #: ../clone/virt-sysprep.pod:176
2807 msgid "Remove user at-jobs and cron-jobs."
2811 #: ../clone/virt-sysprep.pod:178
2812 msgid "dhcp-client-state"
2816 #: ../clone/virt-sysprep.pod:180
2817 msgid "Remove DHCP client leases."
2821 #: ../clone/virt-sysprep.pod:182
2822 msgid "dhcp-server-state"
2826 #: ../clone/virt-sysprep.pod:184
2827 msgid "Remove DHCP server leases."
2831 #: ../clone/virt-sysprep.pod:186
2836 #: ../clone/virt-sysprep.pod:188
2838 "Changes the hostname of the guest to the value given in the I<--hostname> "
2843 #: ../clone/virt-sysprep.pod:191
2845 "If the I<--hostname> parameter is not given, then the hostname is changed to "
2846 "C<localhost.localdomain>."
2850 #: ../clone/virt-sysprep.pod:194
2855 #: ../clone/virt-sysprep.pod:196
2856 msgid "Remove many log files."
2860 #: ../clone/virt-sysprep.pod:198
2865 #: ../clone/virt-sysprep.pod:200
2866 msgid "Remove email from the local mail spool directory."
2870 #: ../clone/virt-sysprep.pod:202
2875 #: ../clone/virt-sysprep.pod:204
2877 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
2878 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
2882 #: ../clone/virt-sysprep.pod:207
2887 #: ../clone/virt-sysprep.pod:209
2889 "Write some random bytes from the host into the random seed file of the "
2894 #: ../clone/virt-sysprep.pod:212
2895 msgid "See L</RANDOM SEED> below."
2899 #: ../clone/virt-sysprep.pod:214
2900 msgid "rhn-systemid"
2904 #: ../clone/virt-sysprep.pod:216
2905 msgid "Remove the RHN system ID."
2909 #: ../clone/virt-sysprep.pod:218
2914 #: ../clone/virt-sysprep.pod:220
2915 msgid "Remove the Smolt hardware UUID."
2919 #: ../clone/virt-sysprep.pod:222
2920 msgid "ssh-hostkeys"
2924 #: ../clone/virt-sysprep.pod:224
2925 msgid "Remove the SSH host keys in the guest."
2929 #: ../clone/virt-sysprep.pod:226
2931 "The SSH host keys are regenerated (differently) next time the guest is "
2936 #: ../clone/virt-sysprep.pod:229
2938 "If, after cloning, the guest gets the same IP address, ssh will give you a "
2939 "stark warning about the host key changing:"
2943 #: ../clone/virt-sysprep.pod:232
2946 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2947 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
2948 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2949 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
2954 #: ../clone/virt-sysprep.pod:237
2955 msgid "udev-persistent-net"
2959 #: ../clone/virt-sysprep.pod:239
2961 "Remove udev persistent net rules which map the guest's existing MAC address "
2962 "to a fixed ethernet device (eg. eth0)."
2966 #: ../clone/virt-sysprep.pod:242
2968 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
2969 "address occupies the old name (eg. eth0), this means the fresh MAC address "
2970 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
2971 "Erasing the udev persistent net rules avoids this."
2975 #: ../clone/virt-sysprep.pod:247
2980 #: ../clone/virt-sysprep.pod:249
2981 msgid "Remove the utmp file."
2985 #: ../clone/virt-sysprep.pod:251
2987 "This records who is currently logged in on a machine. In modern Linux "
2988 "distros it is stored in a ramdisk and hence not part of the virtual "
2989 "machine's disk, but it was stored on disk in older distros."
2993 #: ../clone/virt-sysprep.pod:255
2998 #: ../clone/virt-sysprep.pod:257
2999 msgid "Remove the yum UUID."
3003 #: ../clone/virt-sysprep.pod:259
3005 "Yum creates a fresh UUID the next time it runs when it notices that the "
3006 "original UUID has been erased."
3010 #: ../clone/virt-sysprep.pod:262
3011 msgid "COPYING AND CLONING"
3015 #: ../clone/virt-sysprep.pod:264
3017 "Virt-sysprep can be used as part of a process of cloning guests, or to "
3018 "prepare a template from which guests can be cloned. There are many "
3019 "different ways to achieve this using the virt tools, and this section is "
3020 "just an introduction."
3024 #: ../clone/virt-sysprep.pod:269
3025 msgid "A virtual machine (when switched off) consists of two parts:"
3029 #: ../clone/virt-sysprep.pod:273
3030 msgid "I<configuration>"
3034 #: ../clone/virt-sysprep.pod:275
3036 "The configuration or description of the guest. eg. The libvirt XML (see "
3037 "C<virsh dumpxml>), the running configuration of the guest, or another "
3038 "external format like OVF."
3042 #: ../clone/virt-sysprep.pod:279
3043 msgid "Some configuration items that might need to be changed:"
3047 #: ../clone/virt-sysprep.pod:285
3052 #: ../clone/virt-sysprep.pod:289 ../clone/virt-sysprep.pod:316
3057 #: ../clone/virt-sysprep.pod:293
3058 msgid "path to block device(s)"
3062 #: ../clone/virt-sysprep.pod:297
3063 msgid "network card MAC address"
3067 #: ../clone/virt-sysprep.pod:301
3068 msgid "I<block device(s)>"
3072 #: ../clone/virt-sysprep.pod:303
3074 "One or more hard disk images, themselves containing files, directories, "
3075 "applications, kernels, configuration, etc."
3079 #: ../clone/virt-sysprep.pod:306
3080 msgid "Some things inside the block devices that might need to be changed:"
3084 #: ../clone/virt-sysprep.pod:312
3085 msgid "hostname and other net configuration"
3089 #: ../clone/virt-sysprep.pod:320
3090 msgid "SSH host keys"
3094 #: ../clone/virt-sysprep.pod:324
3095 msgid "Windows unique security ID (SID)"
3099 #: ../clone/virt-sysprep.pod:328
3100 msgid "Puppet registration"
3104 #: ../clone/virt-sysprep.pod:334
3105 msgid "COPYING THE BLOCK DEVICE"
3109 #: ../clone/virt-sysprep.pod:336
3111 "Starting with an original guest, you probably wish to copy the guest block "
3112 "device and its configuration to make a template. Then once you are happy "
3113 "with the template, you will want to make many clones from it."
3117 #: ../clone/virt-sysprep.pod:341
3123 " original guest --------> template ---------->\n"
3124 " \\------> cloned\n"
3125 " \\-----> guests\n"
3131 #: ../clone/virt-sysprep.pod:349
3133 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3138 #: ../clone/virt-sysprep.pod:352
3142 " original guest --------> template ---------->\n"
3143 " \\------> cloned\n"
3144 " \\-----> guests\n"
3150 #: ../clone/virt-sysprep.pod:358
3151 msgid "There are some smarter (and faster) ways too:"
3155 #: ../clone/virt-sysprep.pod:364
3159 " template ---------->\n"
3160 " \\------> cloned\n"
3161 " \\-----> guests\n"
3167 #: ../clone/virt-sysprep.pod:370
3169 "Use the block device as a backing file and create a snapshot on top for each "
3170 "guest. The advantage is that you don't need to copy the block device (very "
3171 "fast) and only changes are stored (less storage required)."
3175 #: ../clone/virt-sysprep.pod:375
3177 "Note that writing to the backing file once you have created guests on top of "
3178 "it is not possible: you will corrupt the guests."
3182 #: ../clone/virt-sysprep.pod:378
3184 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 "
3185 "-o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3186 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3187 "also create cheap snapshots from files or LUNs."
3191 #: ../clone/virt-sysprep.pod:386
3192 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3196 #: ../clone/virt-sysprep.pod:390
3197 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3201 #: ../clone/virt-sysprep.pod:394
3206 #: ../clone/virt-sysprep.pod:396
3208 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3209 "and/or modify the external libvirt configuration of a guest. It will reset "
3210 "the name, UUID and MAC address of the guest in the libvirt XML."
3214 #: ../clone/virt-sysprep.pod:401
3216 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3217 "image. This was the original motivation to write virt-sysprep."
3221 #: ../clone/virt-sysprep.pod:404
3226 #: ../clone/virt-sysprep.pod:406
3230 " original guest --------> template\n"
3235 #: ../clone/virt-sysprep.pod:409
3237 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3238 "it easier to compress and/or faster to copy."
3242 #: ../clone/virt-sysprep.pod:412
3244 "Notice that since virt-sparsify also copies the image, you can use it to "
3245 "make the initial copy (instead of C<dd>)."
3249 #: ../clone/virt-sysprep.pod:415
3254 #: ../clone/virt-sysprep.pod:417
3258 " template ---------->\n"
3259 " \\------> cloned\n"
3260 " \\-----> guests\n"
3266 #: ../clone/virt-sysprep.pod:423
3268 "If you want to give people cloned guests, but let them pick the size of the "
3269 "guest themselves (eg. depending on how much they are prepared to pay for "
3270 "disk space), then instead of copying the template, you can run "
3271 "L<virt-resize(1)>. Virt-resize performs a copy and resize, and thus is "
3272 "ideal for cloning guests from a template."
3276 #: ../clone/virt-sysprep.pod:429 ../src/guestfs.pod:1164
3281 #: ../clone/virt-sysprep.pod:431
3283 "Although virt-sysprep removes some sensitive information from the guest, it "
3284 "does not pretend to remove all of it. You should examine the L</OPERATIONS> "
3285 "above, and the implementation of the operations in the shell script. You "
3286 "should also examine the guest afterwards."
3290 #: ../clone/virt-sysprep.pod:436
3292 "Sensitive files are simply removed. The data they contained may still exist "
3293 "on the disk, easily recovered with a hex editor or undelete tool. Use "
3294 "L<virt-sparsify(1)> as one way to remove this content. See also the "
3295 "L<scrub(1)> command to get rid of deleted content in directory entries and "
3300 #: ../clone/virt-sysprep.pod:442
3305 #: ../clone/virt-sysprep.pod:444
3306 msgid "I<(This section applies to Linux guests only)>"
3310 #: ../clone/virt-sysprep.pod:446
3312 "The virt-sysprep C<random-seed> operation writes a few bytes of randomness "
3313 "from the host into the guest's random seed file."
3317 #: ../clone/virt-sysprep.pod:449
3319 "If this is just done once and the guest is cloned from the same template, "
3320 "then each guest will start with the same entropy, and things like SSH host "
3321 "keys and TCP sequence numbers may be predictable."
3325 #: ../clone/virt-sysprep.pod:453
3327 "Therefore you should arrange to add more randomness I<after> cloning from a "
3328 "template too, which can be done by just enabling the C<random-seed> "
3333 #: ../clone/virt-sysprep.pod:457
3336 " cp template.img newguest.img\n"
3337 " virt-sysprep --enable=random-seed -a newguest.img\n"
3342 #: ../clone/virt-sysprep.pod:460
3343 msgid "SELINUX RELABELLING"
3347 #: ../clone/virt-sysprep.pod:462
3348 msgid "I<(This section applies to Linux guests using SELinux only)>"
3352 #: ../clone/virt-sysprep.pod:464
3354 "If any new files are created by virt-sysprep, then virt-sysprep touches "
3355 "C</.autorelabel> so that these will be correctly labelled by SELinux the "
3356 "next time the guest is booted. This process interrupts boot and can take "
3361 #: ../clone/virt-sysprep.pod:469
3363 "You can force relabelling for all guests by supplying the "
3364 "I<--selinux-relabel> option."
3368 #: ../clone/virt-sysprep.pod:472
3370 "You can disable relabelling entirely by supplying the "
3371 "I<--no-selinux-relabel> option."
3375 #: ../clone/virt-sysprep.pod:484
3376 msgid "This program returns 0 on success, or 1 if there was an error."
3380 #: ../clone/virt-sysprep.pod:488
3382 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, "
3383 "L<virt-resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<lvcreate(8)>, "
3384 "L<qemu-img(1)>, L<scrub(1)>, L<http://libguestfs.org/>, "
3385 "L<http://libvirt.org/>."
3389 #: ../df/virt-df.pod:5
3390 msgid "virt-df - Display free space on virtual filesystems"
3394 #: ../df/virt-df.pod:9
3397 " virt-df [--options]\n"
3402 #: ../df/virt-df.pod:11
3405 " virt-df [--options] -d domname\n"
3410 #: ../df/virt-df.pod:13
3413 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3418 #: ../df/virt-df.pod:17
3421 " virt-df [--options] domname\n"
3426 #: ../df/virt-df.pod:19
3429 " virt-df [--options] disk.img [disk.img ...]\n"
3434 #: ../df/virt-df.pod:23
3436 "C<virt-df> is a command line tool to display free space on virtual machine "
3437 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3438 "allocated to a virtual machine, but can look inside disk images to see how "
3439 "much space is really being used."
3443 #: ../df/virt-df.pod:28
3445 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3446 "to get a list of all active and inactive guests, and performs a C<df>-type "
3447 "operation on each one in turn, printing out the results."
3451 #: ../df/virt-df.pod:32
3453 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a "
3454 "C<df>-type operation on either the single named libvirt domain, or on the "
3455 "disk image(s) listed on the command line (which must all belong to a single "
3456 "VM). In this mode (with arguments), C<virt-df> will I<only work for a "
3457 "single guest>. If you want to run on multiple guests, then you have to "
3458 "invoke C<virt-df> multiple times."
3462 #: ../df/virt-df.pod:39
3464 "Use the I<--csv> option to get a format which can be easily parsed by other "
3465 "programs. Other options are similar to the standard L<df(1)> command."
3469 #: ../df/virt-df.pod:45
3471 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3472 "output human-readable:"
3476 #: ../df/virt-df.pod:48
3479 " # virt-df -d F14x64 -h\n"
3480 " Filesystem Size Used Available Use%\n"
3481 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3482 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3487 #: ../df/virt-df.pod:53
3488 msgid "Show disk usage for a disk image file called C<test.img>:"
3492 #: ../df/virt-df.pod:55
3495 " $ virt-df -a test1.img\n"
3496 " Filesystem 1K-blocks Used Available Use%\n"
3497 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3502 #: ../df/virt-df.pod:112
3505 " virt-df --format=raw -a disk.img\n"
3510 #: ../df/virt-df.pod:116
3513 " virt-df --format=raw -a disk.img --format -a another.img\n"
3518 #: ../df/virt-df.pod:129
3519 msgid "Print sizes in human-readable format."
3523 #: ../df/virt-df.pod:131
3524 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3528 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:164
3533 #: ../df/virt-df.pod:135
3538 #: ../df/virt-df.pod:137
3539 msgid "Print inodes instead of blocks."
3543 #: ../df/virt-df.pod:139
3544 msgid "B<--one-per-guest>"
3548 #: ../df/virt-df.pod:141
3550 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3551 "disks from several guests to a single libguestfs appliance."
3555 #: ../df/virt-df.pod:144
3556 msgid "You might use this option in the following circumstances:"
3560 #: ../df/virt-df.pod:150
3562 "If you think an untrusted guest might actively try to exploit the libguestfs "
3563 "appliance kernel, then this prevents one guest from interfering with the "
3564 "stats printed for another guest."
3568 #: ../df/virt-df.pod:156
3570 "If the kernel has a bug which stops it from accessing a filesystem in one "
3571 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3572 "and report stats for further guests."
3576 #: ../df/virt-df.pod:165
3578 "Print UUIDs instead of names. This is useful for following a guest even "
3579 "when the guest is migrated or renamed, or when two guests happen to have the "
3584 #: ../df/virt-df.pod:169
3586 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3587 "images, we still print the disk image name even when this option is "
3592 #: ../df/virt-df.pod:191
3593 msgid "STATVFS NUMBERS"
3597 #: ../df/virt-df.pod:193
3599 "C<virt-df> (and L<df(1)>) get information by issuing a L<statvfs(3)> system "
3600 "call. You can get the same information directly, either from the host "
3601 "(using libguestfs) or inside the guest:"
3605 #: ../df/virt-df.pod:199
3606 msgid "From the host"
3610 #: ../df/virt-df.pod:201 ../df/virt-df.pod:209
3611 msgid "Run this command:"
3615 #: ../df/virt-df.pod:203
3618 " guestfish --ro -d GuestName -i statvfs /\n"
3623 #: ../df/virt-df.pod:205 ../df/virt-df.pod:213
3624 msgid "(change C</> to see stats for other filesystems)."
3628 #: ../df/virt-df.pod:207
3629 msgid "From inside the guest"
3633 #: ../df/virt-df.pod:211
3636 " python -c 'import os; s = os.statvfs (\"/\"); print s'\n"
3641 #: ../df/virt-df.pod:255
3643 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
3644 "L<http://libguestfs.org/>."
3648 #: ../edit/virt-edit.pod:5
3649 msgid "virt-edit - Edit a file in a virtual machine"
3653 #: ../edit/virt-edit.pod:9
3656 " virt-edit [--options] -d domname file [file ...]\n"
3661 #: ../edit/virt-edit.pod:11
3664 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
3669 #: ../edit/virt-edit.pod:13
3672 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
3677 #: ../edit/virt-edit.pod:17
3680 " virt-edit domname file\n"
3685 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
3688 " virt-edit disk.img [disk.img ...] file\n"
3693 #: ../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:21 ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
3698 #: ../edit/virt-edit.pod:23
3700 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
3701 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
3702 "doing this, but doesn't catch all cases."
3706 #: ../edit/virt-edit.pod:29
3708 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
3709 "exists in the named virtual machine (or disk image)."
3713 #: ../edit/virt-edit.pod:32
3715 "Multiple filenames can be given, in which case they are each edited in "
3716 "turn. Each filename must be a full path, starting at the root directory "
3717 "(starting with '/')."
3721 #: ../edit/virt-edit.pod:36
3722 msgid "If you want to just view a file, use L<virt-cat(1)>."
3726 #: ../edit/virt-edit.pod:38
3728 "For more complex cases you should look at the L<guestfish(1)> tool (see "
3729 "L</USING GUESTFISH> below)."
3733 #: ../edit/virt-edit.pod:41
3735 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
3736 "that and much more."
3740 #: ../edit/virt-edit.pod:46
3741 msgid "Edit the named files interactively:"
3745 #: ../edit/virt-edit.pod:48
3748 " virt-edit -d mydomain /boot/grub/grub.conf\n"
3753 #: ../edit/virt-edit.pod:50
3756 " virt-edit -d mydomain /etc/passwd\n"
3761 #: ../edit/virt-edit.pod:52
3762 msgid "For Windows guests, some Windows paths are understood:"
3766 #: ../edit/virt-edit.pod:54
3769 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
3774 #: ../edit/virt-edit.pod:56
3776 "If Perl is installed, you can also edit files non-interactively (see "
3777 "L</NON-INTERACTIVE EDITING> below). To change the init default level to 5:"
3781 #: ../edit/virt-edit.pod:60
3784 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
3789 #: ../edit/virt-edit.pod:81
3790 msgid "B<-b> extension"
3794 #: ../edit/virt-edit.pod:83
3795 msgid "B<--backup> extension"
3799 #: ../edit/virt-edit.pod:85
3801 "Create a backup of the original file I<in the guest disk image>. The backup "
3802 "has the original filename with C<extension> added."
3806 #: ../edit/virt-edit.pod:88
3808 "Usually the first character of C<extension> would be a dot C<.> so you would "
3813 #: ../edit/virt-edit.pod:91
3816 " virt-edit -b .orig [etc]\n"
3821 #: ../edit/virt-edit.pod:93
3822 msgid "By default, no backup file is made."
3826 #: ../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
3831 #: ../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
3832 msgid "B<--connect URI>"
3836 #: ../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
3838 "If you specify guest block devices directly, then libvirt is not used at "
3843 #: ../edit/virt-edit.pod:114
3845 "When prompting for keys and passphrases, virt-edit normally turns echoing "
3846 "off so you cannot see what you are typing. If you are not worried about "
3847 "Tempest attacks and there is no one else in the room you can specify this "
3848 "flag to see what you are typing."
3852 #: ../edit/virt-edit.pod:119
3857 #: ../edit/virt-edit.pod:121
3858 msgid "B<--expr> EXPR"
3862 #: ../edit/virt-edit.pod:123
3864 "Instead of launching the external editor, non-interactively apply the Perl "
3865 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
3870 #: ../edit/virt-edit.pod:127
3872 "Be careful to properly quote the expression to prevent it from being altered "
3877 #: ../edit/virt-edit.pod:130
3878 msgid "Note that this option is only available when Perl 5 is installed."
3882 #: ../edit/virt-edit.pod:132
3883 msgid "B<--format> raw|qcow2|..."
3887 #: ../edit/virt-edit.pod:143
3890 " virt-edit --format=raw -a disk.img file\n"
3895 #: ../edit/virt-edit.pod:147
3898 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
3903 #: ../edit/virt-edit.pod:181
3904 msgid "Previous versions of virt-edit allowed you to write either:"
3908 #: ../edit/virt-edit.pod:187
3911 " virt-edit guestname file\n"
3916 #: ../edit/virt-edit.pod:195
3917 msgid "NON-INTERACTIVE EDITING"
3921 #: ../edit/virt-edit.pod:197
3923 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
3924 "administrator can interactively edit the file."
3928 #: ../edit/virt-edit.pod:200
3930 "There are two ways also to use C<virt-edit> from scripts in order to make "
3931 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
3932 "like this, it's less error-prone to write scripts directly using the "
3933 "libguestfs API and Augeas for configuration file editing.)"
3937 #: ../edit/virt-edit.pod:206
3939 "The first method is to temporarily set C<$EDITOR> to any script or program "
3940 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
3941 "update C<tmpfile> in place however it likes."
3945 #: ../edit/virt-edit.pod:210
3947 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
3948 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
3949 "instances of C<foo> with C<bar> in a file:"
3953 #: ../edit/virt-edit.pod:214
3956 " virt-edit -d domname filename -e 's/foo/bar/'\n"
3961 #: ../edit/virt-edit.pod:216
3963 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
3964 "For example to delete root's password you could do:"
3968 #: ../edit/virt-edit.pod:219
3971 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3976 #: ../edit/virt-edit.pod:221
3978 "What really happens is that the snippet is evaluated as a Perl expression "
3979 "for each line of the file. The line, including the final C<\\n>, is passed "
3980 "in C<$_> and the expression should update C<$_> or leave it unchanged."
3984 #: ../edit/virt-edit.pod:226
3986 "To delete a line, set C<$_> to the empty string. For example, to delete the "
3987 "C<apache> user account from the password file you can do:"
3991 #: ../edit/virt-edit.pod:229
3994 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
3999 #: ../edit/virt-edit.pod:231
4001 "To insert a line, prepend or append it to C<$_>. However appending lines to "
4002 "the end of the file is rather difficult this way since there is no concept "
4003 "of \"last line of the file\" - your expression just doesn't get called "
4004 "again. You might want to use the first method (setting C<$EDITOR>) if you "
4009 #: ../edit/virt-edit.pod:237
4011 "The variable C<$lineno> contains the current line number. As is "
4012 "traditional, the first line in the file is number C<1>."
4016 #: ../edit/virt-edit.pod:240
4018 "The return value from the expression is ignored, but the expression may call "
4019 "C<die> in order to abort the whole program, leaving the original file "
4024 #: ../edit/virt-edit.pod:244
4026 "Remember when matching the end of a line that C<$_> may contain the final "
4027 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
4028 "newline then neither of these. Thus to match or substitute some text at the "
4029 "end of a line, use this regular expression:"
4033 #: ../edit/virt-edit.pod:249
4036 " /some text(\\r?\\n)?$/\n"
4041 #: ../edit/virt-edit.pod:251
4043 "Alternately, use the perl C<chomp> function, being careful not to chomp "
4044 "C<$_> itself (since that would remove all newlines from the file):"
4048 #: ../edit/virt-edit.pod:255
4051 " my $m = $_; chomp $m; $m =~ /some text$/\n"
4056 #: ../edit/virt-edit.pod:259
4058 "C<virt-edit> has a limited ability to understand Windows drive letters and "
4059 "paths (eg. C<E:\\foo\\bar.txt>)."
4063 #: ../edit/virt-edit.pod:278
4065 "The path is resolved case insensitively to locate the file that should be "
4070 #: ../edit/virt-edit.pod:299
4072 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
4073 "C<virt-edit> doesn't work."
4077 #: ../edit/virt-edit.pod:302
4078 msgid "Using C<virt-edit> is approximately equivalent to doing:"
4082 #: ../edit/virt-edit.pod:304
4085 " guestfish --rw -i -d domname edit /file\n"
4090 #: ../edit/virt-edit.pod:306
4092 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
4097 #: ../edit/virt-edit.pod:309
4099 "The command above uses libguestfs's guest inspection feature and so does not "
4100 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
4101 "disk images that don't contain guests. To edit a file on a disk image "
4106 #: ../edit/virt-edit.pod:314
4109 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4114 #: ../edit/virt-edit.pod:316
4116 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4117 "the disk image to edit, and C</file> is the full path to the file."
4121 #: ../edit/virt-edit.pod:320
4123 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4124 "C<write> or C<upload> instead:"
4128 #: ../edit/virt-edit.pod:323
4131 " guestfish --rw -i -d domname touch /newfile\n"
4136 #: ../edit/virt-edit.pod:325
4139 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4144 #: ../edit/virt-edit.pod:327
4147 " guestfish --rw -i -d domname upload localfile /newfile\n"
4152 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1119 ../rescue/virt-rescue.pod:298 ../sparsify/virt-sparsify.pod:256 ../src/guestfs.pod:3195 ../test-tool/libguestfs-test-tool.pod:95
4153 msgid "ENVIRONMENT VARIABLES"
4157 #: ../edit/virt-edit.pod:333
4162 #: ../edit/virt-edit.pod:335
4164 "If set, this string is used as the editor. It may contain arguments, "
4165 "eg. C<\"emacs -nw\">"
4169 #: ../edit/virt-edit.pod:338
4170 msgid "If not set, C<vi> is used."
4174 #: ../edit/virt-edit.pod:356
4176 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
4177 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
4178 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4182 #: ../erlang/examples/guestfs-erlang.pod:5
4183 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4187 #: ../erlang/examples/guestfs-erlang.pod:9
4190 " {ok, G} = guestfs:create(),\n"
4191 " ok = guestfs:add_drive_opts(G, Disk,\n"
4192 " [{format, \"raw\"}, {readonly, true}]),\n"
4193 " ok = guestfs:launch(G),\n"
4194 " [Device] = guestfs:list_devices(G),\n"
4195 " ok = guestfs:close(G).\n"
4200 #: ../erlang/examples/guestfs-erlang.pod:18
4202 "This manual page documents how to call libguestfs from the Erlang "
4203 "programming language. This page just documents the differences from the C "
4204 "API and gives some examples. If you are not familiar with using libguestfs, "
4205 "you also need to read L<guestfs(3)>."
4209 #: ../erlang/examples/guestfs-erlang.pod:23
4210 msgid "OPENING AND CLOSING THE HANDLE"
4214 #: ../erlang/examples/guestfs-erlang.pod:25
4216 "The Erlang bindings are implemented using an external program called "
4217 "C<erl-guestfs>. This program must be on the current PATH, or else you "
4218 "should specify the full path to the program:"
4222 #: ../erlang/examples/guestfs-erlang.pod:29
4225 " {ok, G} = guestfs:create().\n"
4230 #: ../erlang/examples/guestfs-erlang.pod:31
4233 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4238 #: ../erlang/examples/guestfs-erlang.pod:33
4239 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4243 #: ../erlang/examples/guestfs-erlang.pod:36
4244 msgid "To close the handle:"
4248 #: ../erlang/examples/guestfs-erlang.pod:38
4251 " ok = guestfs:close(G).\n"
4256 #: ../erlang/examples/guestfs-erlang.pod:40
4257 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4261 #: ../erlang/examples/guestfs-erlang.pod:42
4263 "For functions that take optional arguments, the first arguments are the "
4264 "non-optional ones. The last argument is a list of tuples supplying the "
4265 "remaining optional arguments."
4269 #: ../erlang/examples/guestfs-erlang.pod:46
4272 " ok = guestfs:add_drive_opts(G, Disk,\n"
4273 " [{format, \"raw\"}, {readonly, true}]).\n"
4278 #: ../erlang/examples/guestfs-erlang.pod:49
4279 msgid "If the last argument would be an empty list, you can also omit it:"
4283 #: ../erlang/examples/guestfs-erlang.pod:51
4286 " ok = guestfs:add_drive_opts(G, Disk).\n"
4291 #: ../erlang/examples/guestfs-erlang.pod:53
4292 msgid "RETURN VALUES AND ERRORS"
4296 #: ../erlang/examples/guestfs-erlang.pod:55
4298 "On success, most functions return a C<Result> term (which could be a list, "
4299 "string, tuple etc.). If there is nothing for the function to return, then "
4300 "the atom C<ok> is returned."
4304 #: ../erlang/examples/guestfs-erlang.pod:59
4305 msgid "On error, you would see one of the following tuples:"
4309 #: ../erlang/examples/guestfs-erlang.pod:63
4310 msgid "C<{error, Msg, Errno}>"
4314 #: ../erlang/examples/guestfs-erlang.pod:65
4315 msgid "This indicates an ordinary error from the function."
4319 #: ../erlang/examples/guestfs-erlang.pod:67
4321 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4326 #: ../erlang/examples/guestfs-erlang.pod:70
4327 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4331 #: ../erlang/examples/guestfs-erlang.pod:72
4332 msgid "C<{unknown, Function}>"
4336 #: ../erlang/examples/guestfs-erlang.pod:74
4338 "This indicates that the function you called is not known. Generally this "
4339 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4340 "which you should not do."
4344 #: ../erlang/examples/guestfs-erlang.pod:78
4345 msgid "C<Function> is the name of the unknown function."
4349 #: ../erlang/examples/guestfs-erlang.pod:80
4350 msgid "C<{unknownarg, Arg}>"
4354 #: ../erlang/examples/guestfs-erlang.pod:82
4356 "This indicates that you called a function with optional arguments, with an "
4357 "unknown argument name."
4361 #: ../erlang/examples/guestfs-erlang.pod:85
4362 msgid "C<Arg> is the name of the unknown argument."
4366 #: ../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
4367 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4371 #: ../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
4376 #: ../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
4377 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4381 #: ../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
4386 #: ../erlang/examples/guestfs-erlang.pod:99
4388 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
4389 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4390 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://www.erlang.org/>. "
4391 "L<http://libguestfs.org/>."
4395 #: ../erlang/examples/guestfs-erlang.pod:110 ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397 ../examples/guestfs-testing.pod:298 ../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:404 ../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:3335 ../test-tool/libguestfs-test-tool.pod:106
4400 #: ../erlang/examples/guestfs-erlang.pod:112 ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399 ../examples/guestfs-testing.pod:300 ../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:3337 ../test-tool/libguestfs-test-tool.pod:108
4401 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4405 #: ../erlang/examples/guestfs-erlang.pod:116 ../examples/guestfs-testing.pod:304 ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4406 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4410 #: ../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
4412 "The examples in this manual page may be freely copied, modified and "
4413 "distributed without any restrictions."
4417 #: ../erlang/examples/guestfs-erlang.pod:121 ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408 ../examples/guestfs-testing.pod:306 ../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:3344
4419 "This library is free software; you can redistribute it and/or modify it "
4420 "under the terms of the GNU Lesser General Public License as published by the "
4421 "Free Software Foundation; either version 2 of the License, or (at your "
4422 "option) any later version."
4426 #: ../erlang/examples/guestfs-erlang.pod:126 ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413 ../examples/guestfs-testing.pod:311 ../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:3349
4428 "This library is distributed in the hope that it will be useful, but WITHOUT "
4429 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4430 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4435 #: ../erlang/examples/guestfs-erlang.pod:131 ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418 ../examples/guestfs-testing.pod:316 ../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:3354
4437 "You should have received a copy of the GNU Lesser General Public License "
4438 "along with this library; if not, write to the Free Software Foundation, "
4439 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4443 #: ../examples/guestfs-examples.pod:5
4444 msgid "guestfs-examples - Examples of using libguestfs from C"
4448 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4451 " #include <guestfs.h>\n"
4456 #: ../examples/guestfs-examples.pod:11
4459 " guestfs_h *g = guestfs_create ();\n"
4460 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4461 " guestfs_launch (g);\n"
4466 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4469 " cc prog.c -o prog -lguestfs\n"
4471 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4476 #: ../examples/guestfs-examples.pod:21
4478 "This manual page contains examples of calling libguestfs from the C "
4479 "programming language. If you are not familiar with using libguestfs, you "
4480 "also need to read L<guestfs(3)>."
4484 #: ../examples/guestfs-examples.pod:35
4486 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
4487 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4488 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4492 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97 ../python/examples/guestfs-python.pod:60 ../ruby/examples/guestfs-ruby.pod:54
4493 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4497 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4502 #: ../examples/guestfs-recipes.pod:5
4504 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4505 "here. The only way which works for both sorts of output is to just write "
4506 "the URL directly. Do NOT use L<...> for URLs."
4510 #: ../examples/guestfs-recipes.pod:9
4512 "We break with tradition here and don't use ALL CAPS for the section "
4513 "headings, as this makes them much easier to read."
4517 #: ../examples/guestfs-recipes.pod:16
4518 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4522 #: ../examples/guestfs-recipes.pod:20
4524 "This page contains recipes for and links to things you can do using "
4525 "libguestfs, L<guestfish(1)> and the virt tools."
4529 #: ../examples/guestfs-recipes.pod:23
4530 msgid "Audit a virtual machine for setuid files"
4534 #: ../examples/guestfs-recipes.pod:25
4536 "The link below contains a small program which can be used to audit a Linux "
4537 "virtual machine to see what setuid and setgid files it contains."
4541 #: ../examples/guestfs-recipes.pod:28
4542 msgid "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-files/#content"
4546 #: ../examples/guestfs-recipes.pod:30
4547 msgid "Change the background image in a Windows XP VM"
4551 #: ../examples/guestfs-recipes.pod:32
4553 "The links below explain how to use L<guestfish(1)> to change the background "
4554 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4555 "be substantially different for each version of Windows."
4559 #: ../examples/guestfs-recipes.pod:37
4561 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html "
4562 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4566 #: ../examples/guestfs-recipes.pod:40
4567 msgid "Cloning a virtual machine (Linux)"
4571 #: ../examples/guestfs-recipes.pod:42
4573 "The guestfish technique described in the link below works well for most "
4574 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4579 #: ../examples/guestfs-recipes.pod:46
4580 msgid "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/#content"
4584 #: ../examples/guestfs-recipes.pod:48
4586 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
4591 #: ../examples/guestfs-recipes.pod:51
4592 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4596 #: ../examples/guestfs-recipes.pod:53
4597 msgid "Cloning a virtual machine (Windows)"
4601 #: ../examples/guestfs-recipes.pod:55
4603 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
4604 "straightforward. Currently there is code in the Aeolus Oz project which "
4605 "does this (using libguestfs). As part of our review of the virt-clone tool, "
4606 "we may add sysprepping ability."
4610 #: ../examples/guestfs-recipes.pod:60
4612 "https://github.com/clalancette/oz "
4613 "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4617 #: ../examples/guestfs-recipes.pod:63
4618 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
4622 #: ../examples/guestfs-recipes.pod:65
4623 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
4627 #: ../examples/guestfs-recipes.pod:67
4630 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
4635 #: ../examples/guestfs-recipes.pod:69
4636 msgid "To export just a subdirectory, eg. C</files>, do:"
4640 #: ../examples/guestfs-recipes.pod:71
4643 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
4648 #: ../examples/guestfs-recipes.pod:73
4649 msgid "Create empty disk images"
4653 #: ../examples/guestfs-recipes.pod:75
4655 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
4656 "The useful guide below explains the options available."
4660 #: ../examples/guestfs-recipes.pod:78
4661 msgid "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/#content"
4665 #: ../examples/guestfs-recipes.pod:80
4666 msgid "Dump raw filesystem content from inside a disk image or VM"
4670 #: ../examples/guestfs-recipes.pod:82
4672 "You can use the L<guestfish(1)> C<download> command to extract the raw "
4673 "filesystem content from any filesystem in a disk image or a VM (even one "
4674 "which is encrypted or buried inside an LV):"
4678 #: ../examples/guestfs-recipes.pod:86
4681 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
4686 #: ../examples/guestfs-recipes.pod:88
4689 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
4694 #: ../examples/guestfs-recipes.pod:90
4695 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
4699 #: ../examples/guestfs-recipes.pod:92
4700 msgid "Edit grub configuration in a VM"
4704 #: ../examples/guestfs-recipes.pod:94
4705 msgid "You can use this to:"
4709 #: ../examples/guestfs-recipes.pod:100
4710 msgid "Fix a virtual machine that does not boot."
4714 #: ../examples/guestfs-recipes.pod:104
4715 msgid "Change which kernel is used to boot the VM."
4719 #: ../examples/guestfs-recipes.pod:108
4720 msgid "Change kernel command line options."
4724 #: ../examples/guestfs-recipes.pod:112
4725 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
4729 #: ../examples/guestfs-recipes.pod:114
4732 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
4737 #: ../examples/guestfs-recipes.pod:116
4739 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
4744 #: ../examples/guestfs-recipes.pod:119
4747 " virt-rescue -d BrokenGuest\n"
4752 #: ../examples/guestfs-recipes.pod:121
4753 msgid "Export any directory from a VM"
4757 #: ../examples/guestfs-recipes.pod:123
4758 msgid "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
4762 #: ../examples/guestfs-recipes.pod:126 ../examples/guestfs-testing.pod:93
4765 " virt-copy-out -d Guest /home .\n"
4770 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1481 ../fish/guestfish-actions.pod:1746 ../fish/guestfish-actions.pod:2163 ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:2373 ../src/guestfs-actions.pod:2797 ../src/guestfs-actions.pod:3356 ../src/guestfs.pod:1685 ../tools/virt-win-reg.pl:717
4775 #: ../examples/guestfs-recipes.pod:134
4777 "The final dot of the command is not a printing error. It means we want to "
4778 "copy out to the current directory."
4782 #: ../examples/guestfs-recipes.pod:139
4783 msgid "This creates a directory called C<home> under the current directory."
4787 #: ../examples/guestfs-recipes.pod:143
4789 "If the guest is a Windows guest then you can use drive letters and "
4790 "backslashes, but you must prefix the path with C<win:> and quote it to "
4791 "protect it from the shell, like this:"
4795 #: ../examples/guestfs-recipes.pod:147
4798 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
4803 #: ../examples/guestfs-recipes.pod:149
4804 msgid "To get the output as a compressed tarball, do:"
4808 #: ../examples/guestfs-recipes.pod:151
4811 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
4816 #: ../examples/guestfs-recipes.pod:153
4818 "Although it sounds tempting, this is usually not a reliable way to get a "
4819 "backup from a running guest. See the entry in the FAQ: "
4820 "http://libguestfs.org/FAQ.html#backup"
4824 #: ../examples/guestfs-recipes.pod:157
4825 msgid "Find out which user is using the most space"
4829 #: ../examples/guestfs-recipes.pod:159
4831 "This simple script examines a Linux guest to find out which user is using "
4832 "the most space in their home directory:"
4836 #: ../examples/guestfs-recipes.pod:162
4844 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
4852 #: ../examples/guestfs-recipes.pod:166
4861 #: ../examples/guestfs-recipes.pod:169
4864 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
4869 #: ../examples/guestfs-recipes.pod:171
4872 " for d in $(guestfish --remote ls \"$dir\"); do\n"
4873 " echo -n \"$dir/$d\"\n"
4875 " guestfish --remote du \"$dir/$d\";\n"
4876 " done | sort -nr -k 2\n"
4881 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
4884 " guestfish --remote exit\n"
4889 #: ../examples/guestfs-recipes.pod:179
4890 msgid "Get DHCP address from a VM"
4894 #: ../examples/guestfs-recipes.pod:181
4896 "The link below explains the many different possible techniques for getting "
4897 "the last assigned DHCP address of a virtual machine."
4901 #: ../examples/guestfs-recipes.pod:184
4902 msgid "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-a-virtual-machine-disk-image/#content"
4906 #: ../examples/guestfs-recipes.pod:186
4908 "In the libguestfs source examples directory you will find the latest version "
4909 "of the C<virt-dhcp-address.c> program."
4913 #: ../examples/guestfs-recipes.pod:189
4914 msgid "Get the operating system product name string"
4918 #: ../examples/guestfs-recipes.pod:191
4919 msgid "Save the following script into a file called C<product-name.sh>:"
4923 #: ../examples/guestfs-recipes.pod:193
4928 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4929 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4930 " guestfish --remote inspect-get-product-name \"$root\"\n"
4931 " guestfish --remote exit\n"
4936 #: ../examples/guestfs-recipes.pod:200
4937 msgid "Make the script executable and run it on a named guest:"
4941 #: ../examples/guestfs-recipes.pod:202
4944 " # product-name.sh RHEL60x64\n"
4945 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
4950 #: ../examples/guestfs-recipes.pod:205
4952 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
4953 "C<xpath> command line tool or from your favourite programming language:"
4957 #: ../examples/guestfs-recipes.pod:209
4960 " # virt-inspector RHEL60x64 > xml\n"
4961 " # xpath '//product_name' < xml\n"
4964 " <product_name>Red Hat Enterprise Linux Server release 6.0 "
4965 "(Santiago)</product_name>\n"
4970 #: ../examples/guestfs-recipes.pod:215
4971 msgid "Get the default boot kernel for a Linux VM"
4975 #: ../examples/guestfs-recipes.pod:217
4977 "The link below contains a program to print the default boot kernel for a "
4982 #: ../examples/guestfs-recipes.pod:220
4983 msgid "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-kernel-for-a-vm/#content"
4987 #: ../examples/guestfs-recipes.pod:222
4989 "It uses Augeas, and the technique is generally applicable for many different "
4994 #: ../examples/guestfs-recipes.pod:229
4995 msgid "listing the user accounts in the guest"
4999 #: ../examples/guestfs-recipes.pod:233
5000 msgid "what repositories is it configured to use"
5004 #: ../examples/guestfs-recipes.pod:237
5005 msgid "what NTP servers does it connect to"
5009 #: ../examples/guestfs-recipes.pod:241
5010 msgid "what were the boot messages last time it booted"
5014 #: ../examples/guestfs-recipes.pod:245
5015 msgid "listing who was logged in recently"
5019 #: ../examples/guestfs-recipes.pod:249
5020 msgid "http://augeas.net/"
5024 #: ../examples/guestfs-recipes.pod:251
5025 msgid "Install RPMs in a guest"
5029 #: ../examples/guestfs-recipes.pod:253
5031 "The link below contains a method to install RPMs in a guest. In fact the "
5032 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
5033 "installs them next time the guest is booted. You could use this technique "
5034 "to install vital security updates in an offline guest."
5038 #: ../examples/guestfs-recipes.pod:259
5039 msgid "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
5043 #: ../examples/guestfs-recipes.pod:261
5044 msgid "List applications installed in a VM"
5048 #: ../examples/guestfs-recipes.pod:263
5049 msgid "Save the following to a file C<list-apps.sh>:"
5053 #: ../examples/guestfs-recipes.pod:265
5058 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5059 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5060 " guestfish --remote inspect-list-applications \"$root\"\n"
5061 " guestfish --remote exit\n"
5066 #: ../examples/guestfs-recipes.pod:272
5068 "Make the file executable and then you can run it on any named virtual "
5073 #: ../examples/guestfs-recipes.pod:275
5076 " # list-apps.sh WinGuest\n"
5078 " app_name: Mozilla Firefox (3.6.12)\n"
5079 " app_display_name: Mozilla Firefox (3.6.12)\n"
5081 " app_version: 3.6.12 (en-GB)\n"
5083 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
5084 " app_trans_path:\n"
5085 " app_publisher: Mozilla\n"
5086 " app_url: http://www.mozilla.com/en-GB/\n"
5087 " app_source_package:\n"
5089 " app_description: Mozilla Firefox\n"
5092 " app_name: VLC media player\n"
5093 " app_display_name: VLC media player 1.1.5\n"
5095 " app_version: 1.1.5\n"
5097 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
5098 " app_trans_path:\n"
5099 " app_publisher: VideoLAN\n"
5100 " app_url: http://www.videolan.org/\n"
5101 " app_source_package:\n"
5103 " app_description:\n"
5109 #: ../examples/guestfs-recipes.pod:305
5111 "If you want to run the script on disk images (instead of libvirt virtual "
5112 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also "
5113 "L<virt-inspector(1)>."
5117 #: ../examples/guestfs-recipes.pod:309
5118 msgid "List files and directories in a VM"
5122 #: ../examples/guestfs-recipes.pod:311
5123 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5127 #: ../examples/guestfs-recipes.pod:313
5130 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5135 #: ../examples/guestfs-recipes.pod:315
5136 msgid "List services in a Windows VM"
5140 #: ../examples/guestfs-recipes.pod:317
5142 "The link below contains a script that can be used to list out the services "
5143 "from a Windows VM, and whether those services run at boot time or are loaded "
5148 #: ../examples/guestfs-recipes.pod:321
5149 msgid "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/#content"
5153 #: ../examples/guestfs-recipes.pod:323
5154 msgid "Make a disk image sparse"
5158 #: ../examples/guestfs-recipes.pod:325
5160 "The link below contains some guides for making a disk image sparse (or "
5161 "reintroducing sparseness)."
5165 #: ../examples/guestfs-recipes.pod:328
5166 msgid "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5170 #: ../examples/guestfs-recipes.pod:330
5171 msgid "Monitor disk usage over time"
5175 #: ../examples/guestfs-recipes.pod:332
5177 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5178 "The link below contains a guide."
5182 #: ../examples/guestfs-recipes.pod:335
5183 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5187 #: ../examples/guestfs-recipes.pod:337
5188 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5192 #: ../examples/guestfs-recipes.pod:339
5194 "L<guestfish(1)> plus the tools described in the link below can be used to "
5195 "read out the Windows Event Log from any virtual machine running Windows "
5196 "Vista or a later version."
5200 #: ../examples/guestfs-recipes.pod:343
5201 msgid "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-guestfish/#content"
5205 #: ../examples/guestfs-recipes.pod:345
5206 msgid "Remove root password (Linux)"
5210 #: ../examples/guestfs-recipes.pod:347
5212 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5213 "files. One use is to remove the root password from a Linux guest:"
5217 #: ../examples/guestfs-recipes.pod:350
5220 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5225 #: ../examples/guestfs-recipes.pod:352
5226 msgid "Remove Administrator password (Windows)"
5230 #: ../examples/guestfs-recipes.pod:354
5232 "The link below contains one technique for removing the Administrator "
5233 "password from a Windows VM, or to be more precise, it gives you a command "
5234 "prompt the next time you log in which you can use to bypass any security:"
5238 #: ../examples/guestfs-recipes.pod:359
5239 msgid "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-administrator-password-with-guestfish/"
5243 #: ../examples/guestfs-recipes.pod:361
5244 msgid "Unpack a live CD"
5248 #: ../examples/guestfs-recipes.pod:363
5250 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5251 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5252 "layers, as outlined in the guide below."
5256 #: ../examples/guestfs-recipes.pod:367
5257 msgid "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/#content"
5261 #: ../examples/guestfs-recipes.pod:369
5262 msgid "Uploading and downloading files"
5266 #: ../examples/guestfs-recipes.pod:371
5268 "The link below contains general tips on uploading (copying in) and "
5269 "downloading (copying out) files from VMs."
5273 #: ../examples/guestfs-recipes.pod:374
5274 msgid "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5278 #: ../examples/guestfs-recipes.pod:376
5279 msgid "Use libguestfs tools on VMware ESX guests"
5283 #: ../examples/guestfs-recipes.pod:378
5285 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5286 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5290 #: ../examples/guestfs-recipes.pod:382
5291 msgid "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/#content"
5295 #: ../examples/guestfs-recipes.pod:386
5297 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, "
5298 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
5299 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
5300 "L<http://libguestfs.org/>."
5304 #: ../examples/guestfs-recipes.pod:403
5305 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5309 #: ../examples/guestfs-testing.pod:5
5310 msgid "guestfs-testing - manual testing of libguestfs, you can help!"
5314 #: ../examples/guestfs-testing.pod:9
5316 "This page has manual tests you can try on libguestfs. Everyone has a "
5317 "slightly different combination of platform, hardware and guests, so this "
5318 "testing is very valuable. Thanks for helping out!"
5322 #: ../examples/guestfs-testing.pod:13
5323 msgid "These tests require libguestfs E<ge> 1.14."
5327 #: ../examples/guestfs-testing.pod:15
5329 "Tests marked with a B<*> (asterisk) can B<destroy data> if you're not "
5330 "careful. The others are safe and won't modify anything."
5334 #: ../examples/guestfs-testing.pod:18
5335 msgid "You can report bugs you find through this link:"
5339 #: ../examples/guestfs-testing.pod:20
5340 msgid "https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools"
5344 #: ../examples/guestfs-testing.pod:22
5346 "or post on the mailing list (registration is B<not> required, but if you're "
5347 "not registered then you'll have to wait for a moderator to manually approve "
5352 #: ../examples/guestfs-testing.pod:26
5353 msgid "https://www.redhat.com/mailman/listinfo/libguestfs"
5357 #: ../examples/guestfs-testing.pod:28
5362 #: ../examples/guestfs-testing.pod:30
5363 msgid "Check KVM acceleration is being used."
5367 #: ../examples/guestfs-testing.pod:32
5369 "If your host has hardware virt acceleration, then with a hot cache "
5370 "libguestfs should be able to start up in a few seconds. Run the following "
5371 "command a few times:"
5375 #: ../examples/guestfs-testing.pod:36
5378 " time guestfish -a /dev/null run\n"
5383 #: ../examples/guestfs-testing.pod:38
5385 "After a few runs, the time should settle down to a few seconds (under 5 "
5386 "seconds on fast 64 bit hardware)."
5390 #: ../examples/guestfs-testing.pod:41
5391 msgid "How to check for hardware virt:"
5395 #: ../examples/guestfs-testing.pod:43
5396 msgid "http://virt-tools.org/learning/check-hardware-virt/"
5400 #: ../examples/guestfs-testing.pod:45
5401 msgid "If the command above does not work at all, use L<libguestfs-test-tool(1)>."
5405 #: ../examples/guestfs-testing.pod:48
5406 msgid "Run virt-alignment-scan on all your guests."
5410 #: ../examples/guestfs-testing.pod:50
5411 msgid "Run L<virt-alignment-scan(1)> on guests or disk images:"
5415 #: ../examples/guestfs-testing.pod:52
5418 " virt-alignment-scan -a /path/to/disk.img\n"
5423 #: ../examples/guestfs-testing.pod:54 ../examples/guestfs-testing.pod:161 ../examples/guestfs-testing.pod:174 ../examples/guestfs-testing.pod:234 ../src/guestfs.pod:2793
5428 #: ../examples/guestfs-testing.pod:56
5431 " virt-alignment-scan -d Guest\n"
5436 #: ../examples/guestfs-testing.pod:58
5437 msgid "Does the alignment report match how the guest partitions are aligned?"
5441 #: ../examples/guestfs-testing.pod:60
5442 msgid "Run virt-cat on some files in guests."
5446 #: ../examples/guestfs-testing.pod:62
5447 msgid "L<virt-cat(1)> can display files from guests. For a Linux guest, try:"
5451 #: ../examples/guestfs-testing.pod:64
5454 " virt-cat LinuxGuest /etc/passwd\n"
5459 #: ../examples/guestfs-testing.pod:66
5460 msgid "A recent feature is support for Windows paths, for example:"
5464 #: ../examples/guestfs-testing.pod:68
5467 " virt-cat WindowsGuest 'c:\\windows\\win.ini'\n"
5472 #: ../examples/guestfs-testing.pod:70
5474 "An even better test is if you have a Windows guest with multiple drives. Do "
5475 "C<D:>, C<E:> etc paths work correctly?"
5479 #: ../examples/guestfs-testing.pod:73
5480 msgid "B<*> Copy some files into a B<shut off> guest."
5484 #: ../examples/guestfs-testing.pod:75
5486 "L<virt-copy-in(1)> can recursively copy files and directories into a guest "
5491 #: ../examples/guestfs-testing.pod:78
5494 " virt-copy-in -d Guest /etc /tmp\n"
5499 #: ../examples/guestfs-testing.pod:80
5501 "This should copy local directory C</etc> to C</tmp/etc> in the guest "
5502 "(recursively). If you boot the guest, can you see all of the copied files "
5507 #: ../examples/guestfs-testing.pod:84
5508 msgid "Shut the guest down and try copying multiple files and directories:"
5512 #: ../examples/guestfs-testing.pod:86
5515 " virt-copy-in -d Guest /home /etc/issue /tmp\n"
5520 #: ../examples/guestfs-testing.pod:88
5521 msgid "Copy some files out of a guest."
5525 #: ../examples/guestfs-testing.pod:90
5527 "L<virt-copy-out(1)> can recursively copy files and directories out of a "
5528 "guest or disk image."
5532 #: ../examples/guestfs-testing.pod:95
5533 msgid "Note the final space and period in the command is not a typo."
5537 #: ../examples/guestfs-testing.pod:97
5538 msgid "This should copy C</home> from the guest into the current directory."
5542 #: ../examples/guestfs-testing.pod:99
5543 msgid "Run virt-df."
5547 #: ../examples/guestfs-testing.pod:101
5548 msgid "L<virt-df(1)> lists disk space. Run:"
5552 #: ../examples/guestfs-testing.pod:103
5560 #: ../examples/guestfs-testing.pod:105
5562 "You can try comparing this to the results from L<df(1)> inside the guest, "
5563 "but there are some provisos:"
5567 #: ../examples/guestfs-testing.pod:112
5568 msgid "The guest must be idle."
5572 #: ../examples/guestfs-testing.pod:116
5573 msgid "The guest disks must be synched using L<sync(1)>."
5577 #: ../examples/guestfs-testing.pod:120
5579 "Any action such as booting the guest will write log files causing the "
5580 "numbers to change."
5584 #: ../examples/guestfs-testing.pod:125
5586 "We don't guarantee that the numbers will be identical even under these "
5587 "circumstances. They should be similar. It would indicate a bug if you saw "
5588 "greatly differing numbers."
5592 #: ../examples/guestfs-testing.pod:129
5593 msgid "Try importing virt-df CSV output into a spreadsheet or database."
5597 #: ../examples/guestfs-testing.pod:131 ../src/guestfs.pod:3069
5602 #: ../examples/guestfs-testing.pod:133
5605 " virt-df --csv > /tmp/report.csv\n"
5610 #: ../examples/guestfs-testing.pod:135
5612 "Now try to load this into your favorite spreadsheet or database. Are the "
5613 "results reproduced faithfully in the spreadsheet/database?"
5617 #: ../examples/guestfs-testing.pod:138
5619 "http://www.postgresql.org/docs/8.1/static/sql-copy.html "
5620 "http://dev.mysql.com/doc/refman/5.1/en/load-data.html"
5624 #: ../examples/guestfs-testing.pod:141
5625 msgid "B<*> Edit a file in a B<shut off> guest."
5629 #: ../examples/guestfs-testing.pod:143
5631 "L<virt-edit(1)> can edit files in guests. Try this command on a RHEL or "
5636 #: ../examples/guestfs-testing.pod:146
5639 " virt-edit LinuxGuest /etc/sysconfig/network\n"
5644 #: ../examples/guestfs-testing.pod:148
5645 msgid "On other Linux guests try editing other files such as:"
5649 #: ../examples/guestfs-testing.pod:150
5652 " virt-edit LinuxGuest /etc/motd\n"
5657 #: ../examples/guestfs-testing.pod:152
5658 msgid "Are the changes seen inside the guest when it is booted?"
5662 #: ../examples/guestfs-testing.pod:154
5663 msgid "Display the filesystems / partitions / LVs in a guest."
5667 #: ../examples/guestfs-testing.pod:156
5669 "L<virt-filesystems(1)> can be used to display filesystems in a guest. Try "
5670 "this command on any disk image or guest:"
5674 #: ../examples/guestfs-testing.pod:159
5677 " virt-filesystems -a /path/to/disk.img --all --long -h\n"
5682 #: ../examples/guestfs-testing.pod:163
5685 " virt-filesystems -d Guest --all --long -h\n"
5690 #: ../examples/guestfs-testing.pod:165
5691 msgid "Do the results match what is seen in the guest?"
5695 #: ../examples/guestfs-testing.pod:167
5696 msgid "Run virt-inspector on all your guests."
5700 #: ../examples/guestfs-testing.pod:169
5702 "Use L<virt-inspector(1)> to get a report on all of your guests or disk "
5707 #: ../examples/guestfs-testing.pod:172
5710 " virt-inspector -a /path/to/disk.img | less\n"
5715 #: ../examples/guestfs-testing.pod:176
5718 " virt-inspector -d Guest | less\n"
5723 #: ../examples/guestfs-testing.pod:178
5724 msgid "Do the results match what is actually in the guest?"
5728 #: ../examples/guestfs-testing.pod:180
5729 msgid "Try the auditing features of virt-ls on all your guests."
5733 #: ../examples/guestfs-testing.pod:184
5736 " virt-ls -lR -d Guest / | grep '^- [42]'\n"
5741 #: ../examples/guestfs-testing.pod:188
5744 " virt-ls -lR -d Guest / | grep '^d ...7'\n"
5749 #: ../examples/guestfs-testing.pod:192
5752 " virt-ls -lR -d Guest / | grep '^s'\n"
5757 #: ../examples/guestfs-testing.pod:196
5760 " virt-ls -lR -d Guest / | grep -i '^-.*\\.png$'\n"
5765 #: ../examples/guestfs-testing.pod:198
5766 msgid "Display files larger than 10MB in home directories:"
5770 #: ../examples/guestfs-testing.pod:200
5773 " virt-ls -lR -d Guest /home | awk '$3 > 10*1024*1024'\n"
5778 #: ../examples/guestfs-testing.pod:204
5781 " virt-ls -lR -d Guest --time-days / | awk '$6 <= 7'\n"
5786 #: ../examples/guestfs-testing.pod:208
5789 " virt-ls -lR -d Guest --time-days / | grep '^-' | awk '$6 < 1'\n"
5794 #: ../examples/guestfs-testing.pod:210
5795 msgid "Do the results match what is in the guest?"
5799 #: ../examples/guestfs-testing.pod:212
5800 msgid "Create a disk image from a tarball."
5804 #: ../examples/guestfs-testing.pod:214
5806 "Use L<virt-make-fs(1)> to create a disk image from any tarball that you "
5811 #: ../examples/guestfs-testing.pod:217
5814 " virt-make-fs --partition=mbr --type=vfat /any/tarball.tar.gz output.img\n"
5819 #: ../examples/guestfs-testing.pod:219
5821 "Add 'output.img' as a raw disk to an existing guest. Check the guest can "
5822 "see the files. This test is particularly useful if you try it with a "
5827 #: ../examples/guestfs-testing.pod:223
5828 msgid "Try other partitioning schemes, eg. I<--partition=gpt>."
5832 #: ../examples/guestfs-testing.pod:225
5833 msgid "Try other filesystem formats, eg. I<--type=ntfs>, I<--type=ext2>."
5837 #: ../examples/guestfs-testing.pod:227
5838 msgid "B<*> Run virt-rescue on a B<shut off> disk image or guest."
5842 #: ../examples/guestfs-testing.pod:229
5844 "Use L<virt-rescue(1)> to examine, rescue or repair a B<shut off> guest or "
5849 #: ../examples/guestfs-testing.pod:232
5852 " virt-rescue -a /path/to/disk.img\n"
5857 #: ../examples/guestfs-testing.pod:236
5860 " virt-rescue -d Guest\n"
5865 #: ../examples/guestfs-testing.pod:238
5866 msgid "Can you use ordinary shell commands to examine the guest?"
5870 #: ../examples/guestfs-testing.pod:240
5871 msgid "B<*> Resize your guests."
5875 #: ../examples/guestfs-testing.pod:242
5877 "Use L<virt-resize(1)> to give a guest some more disk space. For example, if "
5878 "you have a disk image that is smaller than 30G, increase it to 30G by doing:"
5882 #: ../examples/guestfs-testing.pod:246
5885 " truncate -s 30G newdisk.img\n"
5886 " virt-filesystems -a /path/to/olddisk.img --all --long -h\n"
5887 " virt-resize /path/to/olddisk.img newdisk.img --expand /dev/sda1\n"
5888 " qemu-kvm -m 1024 -hda newdisk.img\n"
5893 #: ../examples/guestfs-testing.pod:251
5894 msgid "Does the guest still boot? Try expanding other partitions."
5898 #: ../examples/guestfs-testing.pod:253
5899 msgid "B<*> Sparsify a guest disk."
5903 #: ../examples/guestfs-testing.pod:255
5904 msgid "Using L<virt-sparsify(1)>, make a disk image more sparse:"
5908 #: ../examples/guestfs-testing.pod:257
5911 " virt-sparsify /path/to/olddisk.img newdisk.img\n"
5916 #: ../examples/guestfs-testing.pod:259
5918 "Is C<newdisk.img> still bootable after sparsifying? Is the resulting disk "
5919 "image smaller (use C<du> to check)?"
5923 #: ../examples/guestfs-testing.pod:262
5924 msgid "B<*> \"sysprep\" a B<shut off> Linux guest."
5928 #: ../examples/guestfs-testing.pod:264
5930 "Note that this really will mess up an existing guest, so it's better to "
5931 "clone the guest before trying this."
5935 #: ../examples/guestfs-testing.pod:267
5938 " virt-sysprep --hostname newhost.example.com -a /path/to/disk.img\n"
5943 #: ../examples/guestfs-testing.pod:269
5945 "Was the sysprep successful? After booting, what changes were made and were "
5950 #: ../examples/guestfs-testing.pod:272
5951 msgid "Dump the Windows Registry from your Windows guests."
5955 #: ../examples/guestfs-testing.pod:274
5957 "Use L<virt-win-reg(1)> to dump out the Windows Registry from any Windows "
5958 "guests that you have."
5962 #: ../examples/guestfs-testing.pod:277
5965 " virt-win-reg --unsafe-printable-strings WindowsGuest 'HKLM\\Software' |\n"
5971 #: ../examples/guestfs-testing.pod:280
5974 " virt-win-reg --unsafe-printable-strings WindowsGuest 'HKLM\\System' |\n"
5980 #: ../examples/guestfs-testing.pod:283
5981 msgid "Does the output match running C<regedit> inside the guest?"
5985 #: ../examples/guestfs-testing.pod:285
5987 "A recent feature is the ability to dump user registries, so try this, "
5988 "replacing I<username> with the name of a local user in the guest:"
5992 #: ../examples/guestfs-testing.pod:288
5995 " virt-win-reg --unsafe-printable-strings WindowsGuest 'HKEY_USERS\\username' "
6002 #: ../examples/guestfs-testing.pod:293
6004 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, "
6005 "L<http://libguestfs.org/>."
6009 #: ../fish/guestfish-actions.pod:1
6014 #: ../fish/guestfish-actions.pod:3
6017 " add-cdrom filename\n"
6022 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
6023 msgid "This function adds a virtual CD-ROM disk image to the guest."
6027 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
6028 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
6032 #: ../fish/guestfish-actions.pod:15
6034 "This call checks for the existence of C<filename>. This stops you from "
6035 "specifying other types of drive which are supported by qemu such as C<nbd:> "
6036 "and C<http:> URLs. To specify those, use the general L</config> call "
6041 #: ../fish/guestfish-actions.pod:22
6043 "If you just want to add an ISO file (often you use this as an efficient way "
6044 "to transfer large files into the guest), then you should probably use "
6045 "L</add-drive-ro> instead."
6049 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:214 ../fish/guestfish-actions.pod:228
6051 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
6056 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:217 ../fish/guestfish-actions.pod:231 ../fish/guestfish-actions.pod:972 ../fish/guestfish-actions.pod:1007 ../fish/guestfish-actions.pod:1180 ../fish/guestfish-actions.pod:1540 ../fish/guestfish-actions.pod:1554 ../fish/guestfish-actions.pod:3423 ../fish/guestfish-actions.pod:3734 ../fish/guestfish-actions.pod:3782 ../fish/guestfish-actions.pod:4700 ../fish/guestfish-actions.pod:4720 ../fish/guestfish-actions.pod:4739 ../fish/guestfish-actions.pod:4777 ../fish/guestfish-actions.pod:5505 ../fish/guestfish-actions.pod:5608 ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:305 ../src/guestfs-actions.pod:326 ../src/guestfs-actions.pod:1619 ../src/guestfs-actions.pod:1676 ../src/guestfs-actions.pod:1959 ../src/guestfs-actions.pod:2458 ../src/guestfs-actions.pod:2479 ../src/guestfs-actions.pod:5281 ../src/guestfs-actions.pod:5803 ../src/guestfs-actions.pod:5903 ../src/guestfs-actions.pod:7199 ../src/guestfs-actions.pod:7240 ../src/guestfs-actions.pod:7271 ../src/guestfs-actions.pod:7331 ../src/guestfs-actions.pod:8385 ../src/guestfs-actions.pod:8494 ../src/guestfs-actions.pod:8674
6058 "Deprecated functions will not be removed from the API, but the fact that "
6059 "they are deprecated indicates that there are problems with correct use of "
6064 #: ../fish/guestfish-actions.pod:35
6069 #: ../fish/guestfish-actions.pod:37
6074 #: ../fish/guestfish-actions.pod:39
6077 " add-domain dom [libvirturi:..] [readonly:true|false] [iface:..] "
6078 "[live:true|false] [allowuuid:true|false] [readonlydisk:..]\n"
6083 #: ../fish/guestfish-actions.pod:41
6085 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
6086 "It works by connecting to libvirt, requesting the domain and domain XML from "
6087 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
6091 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:65
6093 "The number of disks added is returned. This operation is atomic: if an "
6094 "error is returned, then no disks are added."
6098 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:68
6100 "This function does some minimal checks to make sure the libvirt domain is "
6101 "not running (unless C<readonly> is true). In a future version we will try "
6102 "to acquire the libvirt lock on each disk."
6106 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:72
6108 "Disks must be accessible locally. This often means that adding disks from a "
6109 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
6110 "unless those disks are accessible via the same device path locally too."
6114 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:77
6116 "The optional C<libvirturi> parameter sets the libvirt URI (see "
6117 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
6118 "default libvirt URI (or one set through an environment variable, see the "
6119 "libvirt documentation for full details)."
6123 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:83
6125 "The optional C<live> flag controls whether this call will try to connect to "
6126 "a running virtual machine C<guestfsd> process if it sees a suitable "
6127 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
6128 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
6129 "DAEMONS> for more information."
6133 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:90
6135 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
6136 "passed instead of the domain name. The C<dom> string is treated as a UUID "
6137 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
6142 #: ../fish/guestfish-actions.pod:76 ../src/guestfs-actions.pod:95
6144 "The optional C<readonlydisk> parameter controls what we do for disks which "
6145 "are marked E<lt>readonly/E<gt> in the libvirt XML. Possible values are:"
6149 #: ../fish/guestfish-actions.pod:82 ../src/guestfs-actions.pod:101
6150 msgid "readonlydisk = \"error\""
6154 #: ../fish/guestfish-actions.pod:84 ../fish/guestfish-actions.pod:95 ../fish/guestfish-actions.pod:106 ../src/guestfs-actions.pod:103 ../src/guestfs-actions.pod:114 ../src/guestfs-actions.pod:125
6155 msgid "If C<readonly> is false:"
6159 #: ../fish/guestfish-actions.pod:86 ../src/guestfs-actions.pod:105
6161 "The whole call is aborted with an error if any disk with the "
6162 "E<lt>readonly/E<gt> flag is found."
6166 #: ../fish/guestfish-actions.pod:89 ../fish/guestfish-actions.pod:100 ../fish/guestfish-actions.pod:110 ../src/guestfs-actions.pod:108 ../src/guestfs-actions.pod:119 ../src/guestfs-actions.pod:129
6167 msgid "If C<readonly> is true:"
6171 #: ../fish/guestfish-actions.pod:91 ../fish/guestfish-actions.pod:102 ../fish/guestfish-actions.pod:112 ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:131
6172 msgid "Disks with the E<lt>readonly/E<gt> flag are added read-only."
6176 #: ../fish/guestfish-actions.pod:93 ../src/guestfs-actions.pod:112
6177 msgid "readonlydisk = \"read\""
6181 #: ../fish/guestfish-actions.pod:97 ../src/guestfs-actions.pod:116
6183 "Disks with the E<lt>readonly/E<gt> flag are added read-only. Other disks "
6184 "are added read/write."
6188 #: ../fish/guestfish-actions.pod:104 ../src/guestfs-actions.pod:123
6189 msgid "readonlydisk = \"write\" (default)"
6193 #: ../fish/guestfish-actions.pod:108 ../src/guestfs-actions.pod:127
6194 msgid "Disks with the E<lt>readonly/E<gt> flag are added read/write."
6198 #: ../fish/guestfish-actions.pod:114 ../src/guestfs-actions.pod:133
6199 msgid "readonlydisk = \"ignore\""
6203 #: ../fish/guestfish-actions.pod:116 ../src/guestfs-actions.pod:135
6204 msgid "If C<readonly> is true or false:"
6208 #: ../fish/guestfish-actions.pod:118 ../src/guestfs-actions.pod:137
6209 msgid "Disks with the E<lt>readonly/E<gt> flag are skipped."
6213 #: ../fish/guestfish-actions.pod:122
6215 "The other optional parameters are passed directly through to "
6216 "L</add-drive-opts>."
6220 #: ../fish/guestfish-actions.pod:125 ../fish/guestfish-actions.pod:194 ../fish/guestfish-actions.pod:655 ../fish/guestfish-actions.pod:866 ../fish/guestfish-actions.pod:887 ../fish/guestfish-actions.pod:925 ../fish/guestfish-actions.pod:934 ../fish/guestfish-actions.pod:943 ../fish/guestfish-actions.pod:957 ../fish/guestfish-actions.pod:2202 ../fish/guestfish-actions.pod:3250 ../fish/guestfish-actions.pod:3472 ../fish/guestfish-actions.pod:3635 ../fish/guestfish-actions.pod:3770 ../fish/guestfish-actions.pod:5141
6222 "This command has one or more optional arguments. See L</OPTIONAL "
6227 #: ../fish/guestfish-actions.pod:127
6232 #: ../fish/guestfish-actions.pod:129
6235 " add-drive filename\n"
6240 #: ../fish/guestfish-actions.pod:131
6242 "This function is the equivalent of calling L</add-drive-opts> with no "
6243 "optional parameters, so the disk is added writable, with the format being "
6244 "detected automatically."
6248 #: ../fish/guestfish-actions.pod:135
6250 "Automatic detection of the format opens you up to a potential security hole "
6251 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6252 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
6253 "you should think about replacing calls to this function with calls to "
6254 "L</add-drive-opts>, and specifying the format."
6258 #: ../fish/guestfish-actions.pod:142
6259 msgid "add-drive-opts"
6263 #: ../fish/guestfish-actions.pod:144
6268 #: ../fish/guestfish-actions.pod:146
6271 " add-drive-opts filename [readonly:true|false] [format:..] [iface:..] "
6277 #: ../fish/guestfish-actions.pod:148 ../src/guestfs-actions.pod:208
6279 "This function adds a virtual machine disk image C<filename> to libguestfs. "
6280 "The first time you call this function, the disk appears as C</dev/sda>, the "
6281 "second time as C</dev/sdb>, and so on."
6285 #: ../fish/guestfish-actions.pod:153 ../src/guestfs-actions.pod:213
6287 "You don't necessarily need to be root when using libguestfs. However you "
6288 "obviously do need sufficient permissions to access the filename for whatever "
6289 "operations you want to perform (ie. read access if you just want to read the "
6290 "image or write access if you want to modify the image)."
6294 #: ../fish/guestfish-actions.pod:159 ../src/guestfs-actions.pod:219
6295 msgid "This call checks that C<filename> exists."
6299 #: ../fish/guestfish-actions.pod:161 ../fish/guestfish-actions.pod:3434 ../src/guestfs-actions.pod:221 ../src/guestfs-actions.pod:5318
6300 msgid "The optional arguments are:"
6304 #: ../fish/guestfish-actions.pod:165 ../src/guestfs-actions.pod:225
6309 #: ../fish/guestfish-actions.pod:167 ../src/guestfs-actions.pod:227
6311 "If true then the image is treated as read-only. Writes are still allowed, "
6312 "but they are stored in a temporary snapshot overlay which is discarded at "
6313 "the end. The disk that you add is not modified."
6317 #: ../fish/guestfish-actions.pod:171 ../src/guestfs-actions.pod:231
6322 #: ../fish/guestfish-actions.pod:173
6324 "This forces the image format. If you omit this (or use L</add-drive> or "
6325 "L</add-drive-ro>) then the format is automatically detected. Possible "
6326 "formats include C<raw> and C<qcow2>."
6330 #: ../fish/guestfish-actions.pod:177 ../src/guestfs-actions.pod:237
6332 "Automatic detection of the format opens you up to a potential security hole "
6333 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6334 "RHBZ#642934. Specifying the format closes this security hole."
6338 #: ../fish/guestfish-actions.pod:182 ../src/guestfs-actions.pod:242
6343 #: ../fish/guestfish-actions.pod:184
6345 "This rarely-used option lets you emulate the behaviour of the deprecated "
6346 "L</add-drive-with-if> call (q.v.)"
6350 #: ../fish/guestfish-actions.pod:187 ../fish/guestfish-actions.pod:3277 ../src/guestfs-actions.pod:247 ../src/guestfs-actions.pod:5039
6355 #: ../fish/guestfish-actions.pod:189 ../src/guestfs-actions.pod:249
6357 "The name the drive had in the original guest, e.g. /dev/sdb. This is used as "
6358 "a hint to the guest inspection process if it is available."
6362 #: ../fish/guestfish-actions.pod:196
6363 msgid "add-drive-ro"
6367 #: ../fish/guestfish-actions.pod:198
6372 #: ../fish/guestfish-actions.pod:200
6375 " add-drive-ro filename\n"
6380 #: ../fish/guestfish-actions.pod:202
6382 "This function is the equivalent of calling L</add-drive-opts> with the "
6383 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
6384 "is added read-only, with the format being detected automatically."
6388 #: ../fish/guestfish-actions.pod:207
6389 msgid "add-drive-ro-with-if"
6393 #: ../fish/guestfish-actions.pod:209
6396 " add-drive-ro-with-if filename iface\n"
6401 #: ../fish/guestfish-actions.pod:211
6403 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
6404 "interface emulation to use at run time."
6408 #: ../fish/guestfish-actions.pod:221
6409 msgid "add-drive-with-if"
6413 #: ../fish/guestfish-actions.pod:223
6416 " add-drive-with-if filename iface\n"
6421 #: ../fish/guestfish-actions.pod:225
6423 "This is the same as L</add-drive> but it allows you to specify the QEMU "
6424 "interface emulation to use at run time."
6428 #: ../fish/guestfish-actions.pod:235
6433 #: ../fish/guestfish-actions.pod:237
6436 " aug-clear augpath\n"
6441 #: ../fish/guestfish-actions.pod:239 ../src/guestfs-actions.pod:343
6443 "Set the value associated with C<path> to C<NULL>. This is the same as the "
6444 "L<augtool(1)> C<clear> command."
6448 #: ../fish/guestfish-actions.pod:242
6453 #: ../fish/guestfish-actions.pod:244
6461 #: ../fish/guestfish-actions.pod:246
6463 "Close the current Augeas handle and free up any resources used by it. After "
6464 "calling this, you have to call L</aug-init> again before you can use any "
6465 "other Augeas functions."
6469 #: ../fish/guestfish-actions.pod:251
6474 #: ../fish/guestfish-actions.pod:253
6477 " aug-defnode name expr val\n"
6482 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:372
6483 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
6487 #: ../fish/guestfish-actions.pod:258
6489 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
6490 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
6491 "containing that single node."
6495 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:379
6497 "On success this returns a pair containing the number of nodes in the "
6498 "nodeset, and a boolean flag if a node was created."
6502 #: ../fish/guestfish-actions.pod:266
6507 #: ../fish/guestfish-actions.pod:268
6510 " aug-defvar name expr\n"
6515 #: ../fish/guestfish-actions.pod:270 ../src/guestfs-actions.pod:396
6517 "Defines an Augeas variable C<name> whose value is the result of evaluating "
6518 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
6522 #: ../fish/guestfish-actions.pod:274 ../src/guestfs-actions.pod:400
6524 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
6525 "evaluates to something which is not a nodeset."
6529 #: ../fish/guestfish-actions.pod:277
6534 #: ../fish/guestfish-actions.pod:279
6537 " aug-get augpath\n"
6542 #: ../fish/guestfish-actions.pod:281 ../src/guestfs-actions.pod:413
6544 "Look up the value associated with C<path>. If C<path> matches exactly one "
6545 "node, the C<value> is returned."
6549 #: ../fish/guestfish-actions.pod:284
6554 #: ../fish/guestfish-actions.pod:286
6557 " aug-init root flags\n"
6562 #: ../fish/guestfish-actions.pod:288 ../src/guestfs-actions.pod:428
6564 "Create a new Augeas handle for editing configuration files. If there was "
6565 "any previous Augeas handle associated with this guestfs session, then it is "
6570 #: ../fish/guestfish-actions.pod:292
6571 msgid "You must call this before using any other L</aug-*> commands."
6575 #: ../fish/guestfish-actions.pod:295 ../src/guestfs-actions.pod:435
6576 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
6580 #: ../fish/guestfish-actions.pod:298 ../src/guestfs-actions.pod:438
6582 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
6583 "logical I<or> of the following integers:"
6587 #: ../fish/guestfish-actions.pod:304 ../src/guestfs-actions.pod:444
6588 msgid "C<AUG_SAVE_BACKUP> = 1"
6592 #: ../fish/guestfish-actions.pod:306 ../src/guestfs-actions.pod:446
6593 msgid "Keep the original file with a C<.augsave> extension."
6597 #: ../fish/guestfish-actions.pod:308 ../src/guestfs-actions.pod:448
6598 msgid "C<AUG_SAVE_NEWFILE> = 2"
6602 #: ../fish/guestfish-actions.pod:310 ../src/guestfs-actions.pod:450
6604 "Save changes into a file with extension C<.augnew>, and do not overwrite "
6605 "original. Overrides C<AUG_SAVE_BACKUP>."
6609 #: ../fish/guestfish-actions.pod:313 ../src/guestfs-actions.pod:453
6610 msgid "C<AUG_TYPE_CHECK> = 4"
6614 #: ../fish/guestfish-actions.pod:315 ../src/guestfs-actions.pod:455
6615 msgid "Typecheck lenses."
6619 #: ../fish/guestfish-actions.pod:317
6621 "This option is only useful when debugging Augeas lenses. Use of this option "
6622 "may require additional memory for the libguestfs appliance. You may need to "
6623 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
6627 #: ../fish/guestfish-actions.pod:322 ../src/guestfs-actions.pod:462
6628 msgid "C<AUG_NO_STDINC> = 8"
6632 #: ../fish/guestfish-actions.pod:324 ../src/guestfs-actions.pod:464
6633 msgid "Do not use standard load path for modules."
6637 #: ../fish/guestfish-actions.pod:326 ../src/guestfs-actions.pod:466
6638 msgid "C<AUG_SAVE_NOOP> = 16"
6642 #: ../fish/guestfish-actions.pod:328 ../src/guestfs-actions.pod:468
6643 msgid "Make save a no-op, just record what would have been changed."
6647 #: ../fish/guestfish-actions.pod:330 ../src/guestfs-actions.pod:470
6648 msgid "C<AUG_NO_LOAD> = 32"
6652 #: ../fish/guestfish-actions.pod:332
6653 msgid "Do not load the tree in L</aug-init>."
6657 #: ../fish/guestfish-actions.pod:336
6658 msgid "To close the handle, you can call L</aug-close>."
6662 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:478
6663 msgid "To find out more about Augeas, see L<http://augeas.net/>."
6667 #: ../fish/guestfish-actions.pod:340
6672 #: ../fish/guestfish-actions.pod:342
6675 " aug-insert augpath label true|false\n"
6680 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:492
6682 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
6683 "or after C<path> (depending on the boolean flag C<before>)."
6687 #: ../fish/guestfish-actions.pod:348 ../src/guestfs-actions.pod:496
6689 "C<path> must match exactly one existing node in the tree, and C<label> must "
6690 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
6694 #: ../fish/guestfish-actions.pod:352
6699 #: ../fish/guestfish-actions.pod:354
6707 #: ../fish/guestfish-actions.pod:356 ../src/guestfs-actions.pod:509
6708 msgid "Load files into the tree."
6712 #: ../fish/guestfish-actions.pod:358 ../src/guestfs-actions.pod:511
6713 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
6717 #: ../fish/guestfish-actions.pod:361
6722 #: ../fish/guestfish-actions.pod:363
6730 #: ../fish/guestfish-actions.pod:365
6732 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
6733 "resulting nodes into alphabetical order."
6737 #: ../fish/guestfish-actions.pod:368
6742 #: ../fish/guestfish-actions.pod:370
6745 " aug-match augpath\n"
6750 #: ../fish/guestfish-actions.pod:372 ../src/guestfs-actions.pod:539
6752 "Returns a list of paths which match the path expression C<path>. The "
6753 "returned paths are sufficiently qualified so that they match exactly one "
6754 "node in the current tree."
6758 #: ../fish/guestfish-actions.pod:376
6763 #: ../fish/guestfish-actions.pod:378
6766 " aug-mv src dest\n"
6771 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:556
6773 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6774 "C<dest> is overwritten if it exists."
6778 #: ../fish/guestfish-actions.pod:383
6783 #: ../fish/guestfish-actions.pod:385
6791 #: ../fish/guestfish-actions.pod:387 ../src/guestfs-actions.pod:569
6792 msgid "Remove C<path> and all of its children."
6796 #: ../fish/guestfish-actions.pod:389 ../src/guestfs-actions.pod:571
6797 msgid "On success this returns the number of entries which were removed."
6801 #: ../fish/guestfish-actions.pod:391
6806 #: ../fish/guestfish-actions.pod:393
6814 #: ../fish/guestfish-actions.pod:395 ../src/guestfs-actions.pod:582
6815 msgid "This writes all pending changes to disk."
6819 #: ../fish/guestfish-actions.pod:397
6821 "The flags which were passed to L</aug-init> affect exactly how files are "
6826 #: ../fish/guestfish-actions.pod:400
6831 #: ../fish/guestfish-actions.pod:402
6834 " aug-set augpath val\n"
6839 #: ../fish/guestfish-actions.pod:404 ../src/guestfs-actions.pod:598
6840 msgid "Set the value associated with C<path> to C<val>."
6844 #: ../fish/guestfish-actions.pod:406
6846 "In the Augeas API, it is possible to clear a node by setting the value to "
6847 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6848 "this call. Instead you must use the L</aug-clear> call."
6852 #: ../fish/guestfish-actions.pod:411
6857 #: ../fish/guestfish-actions.pod:413
6860 " available 'groups ...'\n"
6865 #: ../fish/guestfish-actions.pod:415 ../src/guestfs-actions.pod:615
6867 "This command is used to check the availability of some groups of "
6868 "functionality in the appliance, which not all builds of the libguestfs "
6869 "appliance will be able to provide."
6873 #: ../fish/guestfish-actions.pod:419
6875 "The libguestfs groups, and the functions that those groups correspond to, "
6876 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6877 "runtime by calling L</available-all-groups>."
6881 #: ../fish/guestfish-actions.pod:424 ../src/guestfs-actions.pod:624
6883 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
6884 "\"augeas\"]> would check for the availability of the Linux inotify functions "
6885 "and Augeas (configuration file editing) functions."
6889 #: ../fish/guestfish-actions.pod:429 ../src/guestfs-actions.pod:629
6890 msgid "The command returns no error if I<all> requested groups are available."
6894 #: ../fish/guestfish-actions.pod:431 ../src/guestfs-actions.pod:631
6896 "It fails with an error if one or more of the requested groups is unavailable "
6901 #: ../fish/guestfish-actions.pod:434 ../src/guestfs-actions.pod:634
6903 "If an unknown group name is included in the list of groups then an error is "
6908 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:637
6913 #: ../fish/guestfish-actions.pod:443
6914 msgid "You must call L</launch> before calling this function."
6918 #: ../fish/guestfish-actions.pod:445 ../src/guestfs-actions.pod:645
6920 "The reason is because we don't know what groups are supported by the "
6921 "appliance/daemon until it is running and can be queried."
6925 #: ../fish/guestfish-actions.pod:451 ../src/guestfs-actions.pod:651
6927 "If a group of functions is available, this does not necessarily mean that "
6928 "they will work. You still have to check for errors when calling individual "
6929 "API functions even if they are available."
6933 #: ../fish/guestfish-actions.pod:458 ../src/guestfs-actions.pod:658
6935 "It is usually the job of distro packagers to build complete functionality "
6936 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6937 "with all requirements satisfied, will support everything."
6941 #: ../fish/guestfish-actions.pod:465
6943 "This call was added in version C<1.0.80>. In previous versions of "
6944 "libguestfs all you could do would be to speculatively execute a command to "
6945 "find out if the daemon implemented it. See also L</version>."
6949 #: ../fish/guestfish-actions.pod:472
6950 msgid "available-all-groups"
6954 #: ../fish/guestfish-actions.pod:474
6957 " available-all-groups\n"
6962 #: ../fish/guestfish-actions.pod:476
6964 "This command returns a list of all optional groups that this daemon knows "
6965 "about. Note this returns both supported and unsupported groups. To find "
6966 "out which ones the daemon can actually support you have to call "
6967 "L</available> on each member of the returned list."
6971 #: ../fish/guestfish-actions.pod:482
6972 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6976 #: ../fish/guestfish-actions.pod:484
6981 #: ../fish/guestfish-actions.pod:486
6984 " base64-in (base64file|-) filename\n"
6989 #: ../fish/guestfish-actions.pod:488 ../src/guestfs-actions.pod:702
6990 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
6994 #: ../fish/guestfish-actions.pod:491 ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:780 ../fish/guestfish-actions.pod:864 ../fish/guestfish-actions.pod:885 ../fish/guestfish-actions.pod:1056 ../fish/guestfish-actions.pod:1075 ../fish/guestfish-actions.pod:1449 ../fish/guestfish-actions.pod:4997 ../fish/guestfish-actions.pod:5009 ../fish/guestfish-actions.pod:5020 ../fish/guestfish-actions.pod:5031 ../fish/guestfish-actions.pod:5162 ../fish/guestfish-actions.pod:5171 ../fish/guestfish-actions.pod:5225 ../fish/guestfish-actions.pod:5248
6995 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6999 #: ../fish/guestfish-actions.pod:493
7004 #: ../fish/guestfish-actions.pod:495
7007 " base64-out filename (base64file|-)\n"
7012 #: ../fish/guestfish-actions.pod:497 ../src/guestfs-actions.pod:716
7014 "This command downloads the contents of C<filename>, writing it out to local "
7015 "file C<base64file> encoded as base64."
7019 #: ../fish/guestfish-actions.pod:502
7024 #: ../fish/guestfish-actions.pod:504
7032 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:729
7034 "This command returns block device attributes for C<device>. The following "
7035 "fields are usually present in the returned hash. Other fields may also be "
7040 #: ../fish/guestfish-actions.pod:511 ../src/guestfs-actions.pod:734
7045 #: ../fish/guestfish-actions.pod:513 ../src/guestfs-actions.pod:736
7046 msgid "The uuid of this device."
7050 #: ../fish/guestfish-actions.pod:515 ../src/guestfs-actions.pod:738
7055 #: ../fish/guestfish-actions.pod:517 ../src/guestfs-actions.pod:740
7056 msgid "The label of this device."
7060 #: ../fish/guestfish-actions.pod:519 ../src/guestfs-actions.pod:742
7065 #: ../fish/guestfish-actions.pod:521 ../src/guestfs-actions.pod:744
7066 msgid "The version of blkid command."
7070 #: ../fish/guestfish-actions.pod:523 ../src/guestfs-actions.pod:746
7075 #: ../fish/guestfish-actions.pod:525 ../src/guestfs-actions.pod:748
7076 msgid "The filesystem type or RAID of this device."
7080 #: ../fish/guestfish-actions.pod:527 ../src/guestfs-actions.pod:750
7085 #: ../fish/guestfish-actions.pod:529 ../src/guestfs-actions.pod:752
7086 msgid "The usage of this device, for example C<filesystem> or C<raid>."
7090 #: ../fish/guestfish-actions.pod:533
7091 msgid "blockdev-flushbufs"
7095 #: ../fish/guestfish-actions.pod:535
7098 " blockdev-flushbufs device\n"
7103 #: ../fish/guestfish-actions.pod:537 ../src/guestfs-actions.pod:768
7104 msgid "This tells the kernel to flush internal buffers associated with C<device>."
7108 #: ../fish/guestfish-actions.pod:540 ../fish/guestfish-actions.pod:551 ../fish/guestfish-actions.pod:560 ../fish/guestfish-actions.pod:570 ../fish/guestfish-actions.pod:582 ../fish/guestfish-actions.pod:595 ../fish/guestfish-actions.pod:603 ../fish/guestfish-actions.pod:614 ../fish/guestfish-actions.pod:622 ../fish/guestfish-actions.pod:630 ../src/guestfs-actions.pod:771 ../src/guestfs-actions.pod:788 ../src/guestfs-actions.pod:803 ../src/guestfs-actions.pod:819 ../src/guestfs-actions.pod:837 ../src/guestfs-actions.pod:856 ../src/guestfs-actions.pod:870 ../src/guestfs-actions.pod:888 ../src/guestfs-actions.pod:902 ../src/guestfs-actions.pod:916
7109 msgid "This uses the L<blockdev(8)> command."
7113 #: ../fish/guestfish-actions.pod:542
7114 msgid "blockdev-getbsz"
7118 #: ../fish/guestfish-actions.pod:544
7121 " blockdev-getbsz device\n"
7126 #: ../fish/guestfish-actions.pod:546 ../src/guestfs-actions.pod:783
7127 msgid "This returns the block size of a device."
7131 #: ../fish/guestfish-actions.pod:548 ../fish/guestfish-actions.pod:611 ../src/guestfs-actions.pod:785 ../src/guestfs-actions.pod:885
7133 "(Note this is different from both I<size in blocks> and I<filesystem block "
7138 #: ../fish/guestfish-actions.pod:553
7139 msgid "blockdev-getro"
7143 #: ../fish/guestfish-actions.pod:555
7146 " blockdev-getro device\n"
7151 #: ../fish/guestfish-actions.pod:557 ../src/guestfs-actions.pod:800
7153 "Returns a boolean indicating if the block device is read-only (true if "
7154 "read-only, false if not)."
7158 #: ../fish/guestfish-actions.pod:562
7159 msgid "blockdev-getsize64"
7163 #: ../fish/guestfish-actions.pod:564
7166 " blockdev-getsize64 device\n"
7171 #: ../fish/guestfish-actions.pod:566 ../src/guestfs-actions.pod:815
7172 msgid "This returns the size of the device in bytes."
7176 #: ../fish/guestfish-actions.pod:568
7177 msgid "See also L</blockdev-getsz>."
7181 #: ../fish/guestfish-actions.pod:572
7182 msgid "blockdev-getss"
7186 #: ../fish/guestfish-actions.pod:574
7189 " blockdev-getss device\n"
7194 #: ../fish/guestfish-actions.pod:576 ../src/guestfs-actions.pod:831
7196 "This returns the size of sectors on a block device. Usually 512, but can be "
7197 "larger for modern devices."
7201 #: ../fish/guestfish-actions.pod:579
7202 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
7206 #: ../fish/guestfish-actions.pod:584
7207 msgid "blockdev-getsz"
7211 #: ../fish/guestfish-actions.pod:586
7214 " blockdev-getsz device\n"
7219 #: ../fish/guestfish-actions.pod:588 ../src/guestfs-actions.pod:849
7221 "This returns the size of the device in units of 512-byte sectors (even if "
7222 "the sectorsize isn't 512 bytes ... weird)."
7226 #: ../fish/guestfish-actions.pod:591
7228 "See also L</blockdev-getss> for the real sector size of the device, and "
7229 "L</blockdev-getsize64> for the more useful I<size in bytes>."
7233 #: ../fish/guestfish-actions.pod:597
7234 msgid "blockdev-rereadpt"
7238 #: ../fish/guestfish-actions.pod:599
7241 " blockdev-rereadpt device\n"
7246 #: ../fish/guestfish-actions.pod:601 ../src/guestfs-actions.pod:868
7247 msgid "Reread the partition table on C<device>."
7251 #: ../fish/guestfish-actions.pod:605
7252 msgid "blockdev-setbsz"
7256 #: ../fish/guestfish-actions.pod:607
7259 " blockdev-setbsz device blocksize\n"
7264 #: ../fish/guestfish-actions.pod:609 ../src/guestfs-actions.pod:883
7265 msgid "This sets the block size of a device."
7269 #: ../fish/guestfish-actions.pod:616
7270 msgid "blockdev-setro"
7274 #: ../fish/guestfish-actions.pod:618
7277 " blockdev-setro device\n"
7282 #: ../fish/guestfish-actions.pod:620 ../src/guestfs-actions.pod:900
7283 msgid "Sets the block device named C<device> to read-only."
7287 #: ../fish/guestfish-actions.pod:624
7288 msgid "blockdev-setrw"
7292 #: ../fish/guestfish-actions.pod:626
7295 " blockdev-setrw device\n"
7300 #: ../fish/guestfish-actions.pod:628 ../src/guestfs-actions.pod:914
7301 msgid "Sets the block device named C<device> to read-write."
7305 #: ../fish/guestfish-actions.pod:632
7306 msgid "btrfs-filesystem-resize"
7310 #: ../fish/guestfish-actions.pod:634
7313 " btrfs-filesystem-resize mountpoint [size:N]\n"
7318 #: ../fish/guestfish-actions.pod:636 ../src/guestfs-actions.pod:936
7319 msgid "This command resizes a btrfs filesystem."
7323 #: ../fish/guestfish-actions.pod:638 ../src/guestfs-actions.pod:938
7325 "Note that unlike other resize calls, the filesystem has to be mounted and "
7326 "the parameter is the mountpoint not the device (this is a requirement of "
7331 #: ../fish/guestfish-actions.pod:642 ../fish/guestfish-actions.pod:3199 ../fish/guestfish-actions.pod:3745 ../fish/guestfish-actions.pod:5071 ../src/guestfs-actions.pod:942 ../src/guestfs-actions.pod:4935 ../src/guestfs-actions.pod:5842 ../src/guestfs-actions.pod:7818
7332 msgid "The optional parameters are:"
7336 #: ../fish/guestfish-actions.pod:646 ../fish/guestfish-actions.pod:3749 ../src/guestfs-actions.pod:946 ../src/guestfs-actions.pod:5846
7341 #: ../fish/guestfish-actions.pod:648 ../src/guestfs-actions.pod:948
7343 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
7344 "resized to the maximum size."
7348 #: ../fish/guestfish-actions.pod:653 ../src/guestfs-actions.pod:953
7349 msgid "See also L<btrfs(8)>."
7353 #: ../fish/guestfish-actions.pod:657
7354 msgid "case-sensitive-path"
7358 #: ../fish/guestfish-actions.pod:659
7361 " case-sensitive-path path\n"
7366 #: ../fish/guestfish-actions.pod:661 ../src/guestfs-actions.pod:987
7368 "This can be used to resolve case insensitive paths on a filesystem which is "
7369 "case sensitive. The use case is to resolve paths which you have read from "
7370 "Windows configuration files or the Windows Registry, to the true path."
7374 #: ../fish/guestfish-actions.pod:666 ../src/guestfs-actions.pod:992
7376 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
7377 "(and probably others), which is that although the underlying filesystem is "
7378 "case-insensitive, the driver exports the filesystem to Linux as "
7383 #: ../fish/guestfish-actions.pod:671 ../src/guestfs-actions.pod:997
7385 "One consequence of this is that special directories such as C<c:\\windows> "
7386 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
7387 "precise details of how they were created. In Windows itself this would not "
7392 #: ../fish/guestfish-actions.pod:677 ../src/guestfs-actions.pod:1003
7394 "Bug or feature? You decide: "
7395 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
7399 #: ../fish/guestfish-actions.pod:680 ../src/guestfs-actions.pod:1006
7401 "This function resolves the true case of each element in the path and returns "
7402 "the case-sensitive path."
7406 #: ../fish/guestfish-actions.pod:683
7408 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
7409 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
7410 "how the directories were originally created under Windows)."
7414 #: ../fish/guestfish-actions.pod:688 ../src/guestfs-actions.pod:1014
7415 msgid "I<Note>: This function does not handle drive names, backslashes etc."
7419 #: ../fish/guestfish-actions.pod:691
7420 msgid "See also L</realpath>."
7424 #: ../fish/guestfish-actions.pod:693
7429 #: ../fish/guestfish-actions.pod:695
7437 #: ../fish/guestfish-actions.pod:697 ../fish/guestfish-actions.pod:4176 ../src/guestfs-actions.pod:1030 ../src/guestfs-actions.pod:6502
7438 msgid "Return the contents of the file named C<path>."
7442 #: ../fish/guestfish-actions.pod:699
7444 "Note that this function cannot correctly handle binary files (specifically, "
7445 "files containing C<\\0> character which is treated as end of string). For "
7446 "those you need to use the L</read-file> or L</download> functions which have "
7447 "a more complex interface."
7451 #: ../fish/guestfish-actions.pod:704 ../fish/guestfish-actions.pod:839 ../fish/guestfish-actions.pod:851 ../fish/guestfish-actions.pod:1134 ../fish/guestfish-actions.pod:1144 ../fish/guestfish-actions.pod:1211 ../fish/guestfish-actions.pod:1221 ../fish/guestfish-actions.pod:1413 ../fish/guestfish-actions.pod:1726 ../fish/guestfish-actions.pod:1736 ../fish/guestfish-actions.pod:1786 ../fish/guestfish-actions.pod:1801 ../fish/guestfish-actions.pod:1811 ../fish/guestfish-actions.pod:1830 ../fish/guestfish-actions.pod:4046 ../fish/guestfish-actions.pod:4061 ../fish/guestfish-actions.pod:4137 ../fish/guestfish-actions.pod:4154 ../fish/guestfish-actions.pod:4169 ../fish/guestfish-actions.pod:4838 ../fish/guestfish-actions.pod:4884 ../fish/guestfish-actions.pod:4969 ../fish/guestfish-actions.pod:4984 ../fish/guestfish-actions.pod:5469 ../fish/guestfish-actions.pod:5481 ../fish/guestfish-actions.pod:5499 ../fish/guestfish-actions.pod:5516 ../fish/guestfish-actions.pod:5526 ../fish/guestfish-actions.pod:5580 ../fish/guestfish-actions.pod:5590 ../fish/guestfish-actions.pod:5619 ../fish/guestfish-actions.pod:5629 ../src/guestfs-actions.pod:1040 ../src/guestfs-actions.pod:1219 ../src/guestfs-actions.pod:1239 ../src/guestfs-actions.pod:1894 ../src/guestfs-actions.pod:1913 ../src/guestfs-actions.pod:2016 ../src/guestfs-actions.pod:2035 ../src/guestfs-actions.pod:2281 ../src/guestfs-actions.pod:2763 ../src/guestfs-actions.pod:2782 ../src/guestfs-actions.pod:2847 ../src/guestfs-actions.pod:2871 ../src/guestfs-actions.pod:2888 ../src/guestfs-actions.pod:2917 ../src/guestfs-actions.pod:6284 ../src/guestfs-actions.pod:6310 ../src/guestfs-actions.pod:6441 ../src/guestfs-actions.pod:6467 ../src/guestfs-actions.pod:6491 ../src/guestfs-actions.pod:7446 ../src/guestfs-actions.pod:7501 ../src/guestfs-actions.pod:7647 ../src/guestfs-actions.pod:7671 ../src/guestfs-actions.pod:8458 ../src/guestfs-actions.pod:8478 ../src/guestfs-actions.pod:8511 ../src/guestfs-actions.pod:8530 ../src/guestfs-actions.pod:8549 ../src/guestfs-actions.pod:8640 ../src/guestfs-actions.pod:8659 ../src/guestfs-actions.pod:8705 ../src/guestfs-actions.pod:8724
7453 "Because of the message protocol, there is a transfer limit of somewhere "
7454 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
7458 #: ../fish/guestfish-actions.pod:707
7463 #: ../fish/guestfish-actions.pod:709
7466 " checksum csumtype path\n"
7471 #: ../fish/guestfish-actions.pod:711 ../src/guestfs-actions.pod:1052
7472 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
7476 #: ../fish/guestfish-actions.pod:714 ../src/guestfs-actions.pod:1055
7478 "The type of checksum to compute is given by the C<csumtype> parameter which "
7479 "must have one of the following values:"
7483 #: ../fish/guestfish-actions.pod:719 ../src/guestfs-actions.pod:1060
7488 #: ../fish/guestfish-actions.pod:721 ../src/guestfs-actions.pod:1062
7490 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
7495 #: ../fish/guestfish-actions.pod:724 ../src/guestfs-actions.pod:1065
7500 #: ../fish/guestfish-actions.pod:726 ../src/guestfs-actions.pod:1067
7501 msgid "Compute the MD5 hash (using the C<md5sum> program)."
7505 #: ../fish/guestfish-actions.pod:728 ../src/guestfs-actions.pod:1069
7510 #: ../fish/guestfish-actions.pod:730 ../src/guestfs-actions.pod:1071
7511 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
7515 #: ../fish/guestfish-actions.pod:732 ../src/guestfs-actions.pod:1073
7520 #: ../fish/guestfish-actions.pod:734 ../src/guestfs-actions.pod:1075
7521 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
7525 #: ../fish/guestfish-actions.pod:736 ../src/guestfs-actions.pod:1077
7530 #: ../fish/guestfish-actions.pod:738 ../src/guestfs-actions.pod:1079
7531 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
7535 #: ../fish/guestfish-actions.pod:740 ../src/guestfs-actions.pod:1081
7540 #: ../fish/guestfish-actions.pod:742 ../src/guestfs-actions.pod:1083
7541 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
7545 #: ../fish/guestfish-actions.pod:744 ../src/guestfs-actions.pod:1085
7550 #: ../fish/guestfish-actions.pod:746 ../src/guestfs-actions.pod:1087
7551 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
7555 #: ../fish/guestfish-actions.pod:750 ../src/guestfs-actions.pod:1091
7556 msgid "The checksum is returned as a printable string."
7560 #: ../fish/guestfish-actions.pod:752
7561 msgid "To get the checksum for a device, use L</checksum-device>."
7565 #: ../fish/guestfish-actions.pod:754
7566 msgid "To get the checksums for many files, use L</checksums-out>."
7570 #: ../fish/guestfish-actions.pod:756
7571 msgid "checksum-device"
7575 #: ../fish/guestfish-actions.pod:758
7578 " checksum-device csumtype device\n"
7583 #: ../fish/guestfish-actions.pod:760
7585 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
7586 "device named C<device>. For the types of checksums supported see the "
7587 "L</checksum> command."
7591 #: ../fish/guestfish-actions.pod:764
7592 msgid "checksums-out"
7596 #: ../fish/guestfish-actions.pod:766
7599 " checksums-out csumtype directory (sumsfile|-)\n"
7604 #: ../fish/guestfish-actions.pod:768 ../src/guestfs-actions.pod:1126
7606 "This command computes the checksums of all regular files in C<directory> and "
7607 "then emits a list of those checksums to the local output file C<sumsfile>."
7611 #: ../fish/guestfish-actions.pod:772 ../src/guestfs-actions.pod:1130
7613 "This can be used for verifying the integrity of a virtual machine. However "
7614 "to be properly secure you should pay attention to the output of the checksum "
7615 "command (it uses the ones from GNU coreutils). In particular when the "
7616 "filename is not printable, coreutils uses a special backslash syntax. For "
7617 "more information, see the GNU coreutils info file."
7621 #: ../fish/guestfish-actions.pod:782
7626 #: ../fish/guestfish-actions.pod:784
7629 " chmod mode path\n"
7634 #: ../fish/guestfish-actions.pod:786 ../src/guestfs-actions.pod:1149
7636 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
7641 #: ../fish/guestfish-actions.pod:789 ../src/guestfs-actions.pod:1152
7643 "I<Note>: When using this command from guestfish, C<mode> by default would be "
7644 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
7649 #: ../fish/guestfish-actions.pod:793 ../fish/guestfish-actions.pod:3398 ../fish/guestfish-actions.pod:3537 ../fish/guestfish-actions.pod:3547 ../fish/guestfish-actions.pod:3557 ../src/guestfs-actions.pod:1156 ../src/guestfs-actions.pod:5249 ../src/guestfs-actions.pod:5458 ../src/guestfs-actions.pod:5477 ../src/guestfs-actions.pod:5496
7650 msgid "The mode actually set is affected by the umask."
7654 #: ../fish/guestfish-actions.pod:795
7659 #: ../fish/guestfish-actions.pod:797
7662 " chown owner group path\n"
7667 #: ../fish/guestfish-actions.pod:799 ../src/guestfs-actions.pod:1170
7668 msgid "Change the file owner to C<owner> and group to C<group>."
7672 #: ../fish/guestfish-actions.pod:801 ../fish/guestfish-actions.pod:2738 ../src/guestfs-actions.pod:1172 ../src/guestfs-actions.pod:4167
7674 "Only numeric uid and gid are supported. If you want to use names, you will "
7675 "need to locate and parse the password file yourself (Augeas support makes "
7676 "this relatively easy)."
7680 #: ../fish/guestfish-actions.pod:805
7685 #: ../fish/guestfish-actions.pod:807
7688 " command 'arguments ...'\n"
7693 #: ../fish/guestfish-actions.pod:809 ../src/guestfs-actions.pod:1186
7695 "This call runs a command from the guest filesystem. The filesystem must be "
7696 "mounted, and must contain a compatible operating system (ie. something "
7697 "Linux, with the same or compatible processor architecture)."
7701 #: ../fish/guestfish-actions.pod:814
7703 "The single parameter is an argv-style list of arguments. The first element "
7704 "is the name of the program to run. Subsequent elements are parameters. The "
7705 "list must be non-empty (ie. must contain a program name). Note that the "
7706 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
7710 #: ../fish/guestfish-actions.pod:821 ../src/guestfs-actions.pod:1198
7711 msgid "The return value is anything printed to I<stdout> by the command."
7715 #: ../fish/guestfish-actions.pod:824 ../src/guestfs-actions.pod:1201
7717 "If the command returns a non-zero exit status, then this function returns an "
7718 "error message. The error message string is the content of I<stderr> from "
7723 #: ../fish/guestfish-actions.pod:828 ../src/guestfs-actions.pod:1205
7725 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
7726 "C</bin>. If you require a program from another location, you should provide "
7727 "the full path in the first parameter."
7731 #: ../fish/guestfish-actions.pod:833 ../src/guestfs-actions.pod:1210
7733 "Shared libraries and data files required by the program must be available on "
7734 "filesystems which are mounted in the correct places. It is the caller's "
7735 "responsibility to ensure all filesystems that are needed are mounted at the "
7740 #: ../fish/guestfish-actions.pod:842
7741 msgid "command-lines"
7745 #: ../fish/guestfish-actions.pod:844
7748 " command-lines 'arguments ...'\n"
7753 #: ../fish/guestfish-actions.pod:846
7754 msgid "This is the same as L</command>, but splits the result into a list of lines."
7758 #: ../fish/guestfish-actions.pod:849
7759 msgid "See also: L</sh-lines>"
7763 #: ../fish/guestfish-actions.pod:854
7764 msgid "compress-device-out"
7768 #: ../fish/guestfish-actions.pod:856
7771 " compress-device-out ctype device (zdevice|-) [level:N]\n"
7776 #: ../fish/guestfish-actions.pod:858 ../src/guestfs-actions.pod:1260
7778 "This command compresses C<device> and writes it out to the local file "
7783 #: ../fish/guestfish-actions.pod:861
7785 "The C<ctype> and optional C<level> parameters have the same meaning as in "
7790 #: ../fish/guestfish-actions.pod:868
7791 msgid "compress-out"
7795 #: ../fish/guestfish-actions.pod:870
7798 " compress-out ctype file (zfile|-) [level:N]\n"
7803 #: ../fish/guestfish-actions.pod:872 ../src/guestfs-actions.pod:1312
7805 "This command compresses C<file> and writes it out to the local file "
7810 #: ../fish/guestfish-actions.pod:875 ../src/guestfs-actions.pod:1315
7812 "The compression program used is controlled by the C<ctype> parameter. "
7813 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
7814 "Some compression types may not be supported by particular builds of "
7815 "libguestfs, in which case you will get an error containing the substring "
7816 "\"not supported\"."
7820 #: ../fish/guestfish-actions.pod:881 ../src/guestfs-actions.pod:1321
7822 "The optional C<level> parameter controls compression level. The meaning and "
7823 "default for this parameter depends on the compression program being used."
7827 #: ../fish/guestfish-actions.pod:889
7832 #: ../fish/guestfish-actions.pod:891
7835 " config qemuparam qemuvalue\n"
7840 #: ../fish/guestfish-actions.pod:893 ../src/guestfs-actions.pod:1362
7842 "This can be used to add arbitrary qemu command line parameters of the form "
7843 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
7844 "setting some parameters which would interfere with parameters that we use."
7848 #: ../fish/guestfish-actions.pod:898 ../src/guestfs-actions.pod:1367
7849 msgid "The first character of C<param> string must be a C<-> (dash)."
7853 #: ../fish/guestfish-actions.pod:900 ../src/guestfs-actions.pod:1369
7854 msgid "C<value> can be NULL."
7858 #: ../fish/guestfish-actions.pod:902
7859 msgid "copy-device-to-device"
7863 #: ../fish/guestfish-actions.pod:904
7866 " copy-device-to-device src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7871 #: ../fish/guestfish-actions.pod:906
7873 "The four calls L</copy-device-to-device>, L</copy-device-to-file>, "
7874 "L</copy-file-to-device>, and L</copy-file-to-file> let you copy from a "
7875 "source (device|file) to a destination (device|file)."
7879 #: ../fish/guestfish-actions.pod:913 ../src/guestfs-actions.pod:1399
7881 "Partial copies can be made since you can specify optionally the source "
7882 "offset, destination offset and size to copy. These values are all specified "
7883 "in bytes. If not given, the offsets both default to zero, and the size "
7884 "defaults to copying as much as possible until we hit the end of the source."
7888 #: ../fish/guestfish-actions.pod:919 ../src/guestfs-actions.pod:1405
7890 "The source and destination may be the same object. However overlapping "
7891 "regions may not be copied correctly."
7895 #: ../fish/guestfish-actions.pod:922 ../src/guestfs-actions.pod:1408
7897 "If the destination is a file, it is created if required. If the destination "
7898 "file is not large enough, it is extended."
7902 #: ../fish/guestfish-actions.pod:927
7903 msgid "copy-device-to-file"
7907 #: ../fish/guestfish-actions.pod:929
7910 " copy-device-to-file src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7915 #: ../fish/guestfish-actions.pod:931 ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:949
7916 msgid "See L</copy-device-to-device> for a general overview of this call."
7920 #: ../fish/guestfish-actions.pod:936
7921 msgid "copy-file-to-device"
7925 #: ../fish/guestfish-actions.pod:938
7928 " copy-file-to-device src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7933 #: ../fish/guestfish-actions.pod:945
7934 msgid "copy-file-to-file"
7938 #: ../fish/guestfish-actions.pod:947
7941 " copy-file-to-file src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7946 #: ../fish/guestfish-actions.pod:952
7948 "This is B<not> the function you want for copying files. This is for copying "
7949 "blocks within existing files. See L</cp>, L</cp-a> and L</mv> for general "
7950 "file copying and moving functions."
7954 #: ../fish/guestfish-actions.pod:959
7959 #: ../fish/guestfish-actions.pod:961
7962 " copy-size src dest size\n"
7967 #: ../fish/guestfish-actions.pod:963 ../src/guestfs-actions.pod:1623
7969 "This command copies exactly C<size> bytes from one source device or file "
7970 "C<src> to another destination device or file C<dest>."
7974 #: ../fish/guestfish-actions.pod:966 ../src/guestfs-actions.pod:1626
7976 "Note this will fail if the source is too short or if the destination is not "
7981 #: ../fish/guestfish-actions.pod:969 ../fish/guestfish-actions.pod:1004
7983 "I<This function is deprecated.> In new code, use the "
7984 "L</copy_device_to_device> call instead."
7988 #: ../fish/guestfish-actions.pod:976
7993 #: ../fish/guestfish-actions.pod:978
8001 #: ../fish/guestfish-actions.pod:980 ../src/guestfs-actions.pod:1645
8003 "This copies a file from C<src> to C<dest> where C<dest> is either a "
8004 "destination filename or destination directory."
8008 #: ../fish/guestfish-actions.pod:983
8013 #: ../fish/guestfish-actions.pod:985
8021 #: ../fish/guestfish-actions.pod:987 ../src/guestfs-actions.pod:1659
8023 "This copies a file or directory from C<src> to C<dest> recursively using the "
8028 #: ../fish/guestfish-actions.pod:990
8033 #: ../fish/guestfish-actions.pod:992
8041 #: ../fish/guestfish-actions.pod:994 ../src/guestfs-actions.pod:1680
8043 "This command copies from one source device or file C<src> to another "
8044 "destination device or file C<dest>. Normally you would use this to copy to "
8045 "or from a device or partition, for example to duplicate a filesystem."
8049 #: ../fish/guestfish-actions.pod:999
8051 "If the destination is a device, it must be as large or larger than the "
8052 "source file or device, otherwise the copy will fail. This command cannot do "
8053 "partial copies (see L</copy-device-to-device>)."
8057 #: ../fish/guestfish-actions.pod:1011
8062 #: ../fish/guestfish-actions.pod:1013
8070 #: ../fish/guestfish-actions.pod:1015 ../src/guestfs-actions.pod:1699
8071 msgid "This command runs the C<df> command to report disk space used."
8075 #: ../fish/guestfish-actions.pod:1017 ../fish/guestfish-actions.pod:1028
8077 "This command is mostly useful for interactive sessions. It is I<not> "
8078 "intended that you try to parse the output string. Use L</statvfs> from "
8083 #: ../fish/guestfish-actions.pod:1021
8088 #: ../fish/guestfish-actions.pod:1023
8096 #: ../fish/guestfish-actions.pod:1025 ../src/guestfs-actions.pod:1715
8098 "This command runs the C<df -h> command to report disk space used in "
8099 "human-readable format."
8103 #: ../fish/guestfish-actions.pod:1032
8108 #: ../fish/guestfish-actions.pod:1034
8116 #: ../fish/guestfish-actions.pod:1036 ../src/guestfs-actions.pod:1732
8118 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
8119 "This is sometimes useful for extended debugging of problems."
8123 #: ../fish/guestfish-actions.pod:1040
8125 "Another way to get the same information is to enable verbose messages with "
8126 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
8127 "before running the program."
8131 #: ../fish/guestfish-actions.pod:1045
8136 #: ../fish/guestfish-actions.pod:1047
8139 " download remotefilename (filename|-)\n"
8144 #: ../fish/guestfish-actions.pod:1049 ../fish/guestfish-actions.pod:1062 ../src/guestfs-actions.pod:1753 ../src/guestfs-actions.pod:1778
8146 "Download file C<remotefilename> and save it as C<filename> on the local "
8151 #: ../fish/guestfish-actions.pod:1052 ../fish/guestfish-actions.pod:5221 ../src/guestfs-actions.pod:1756 ../src/guestfs-actions.pod:8028
8152 msgid "C<filename> can also be a named pipe."
8156 #: ../fish/guestfish-actions.pod:1054
8157 msgid "See also L</upload>, L</cat>."
8161 #: ../fish/guestfish-actions.pod:1058
8162 msgid "download-offset"
8166 #: ../fish/guestfish-actions.pod:1060
8169 " download-offset remotefilename (filename|-) offset size\n"
8174 #: ../fish/guestfish-actions.pod:1065 ../src/guestfs-actions.pod:1781
8176 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
8177 "region must be within the file or device)."
8181 #: ../fish/guestfish-actions.pod:1068
8183 "Note that there is no limit on the amount of data that can be downloaded "
8184 "with this call, unlike with L</pread>, and this call always reads the full "
8185 "amount unless an error occurs."
8189 #: ../fish/guestfish-actions.pod:1073
8190 msgid "See also L</download>, L</pread>."
8194 #: ../fish/guestfish-actions.pod:1077
8199 #: ../fish/guestfish-actions.pod:1079
8202 " drop-caches whattodrop\n"
8207 #: ../fish/guestfish-actions.pod:1081 ../src/guestfs-actions.pod:1806
8209 "This instructs the guest kernel to drop its page cache, and/or dentries and "
8210 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
8211 "to drop, see L<http://linux-mm.org/Drop_Caches>"
8215 #: ../fish/guestfish-actions.pod:1086 ../src/guestfs-actions.pod:1811
8216 msgid "Setting C<whattodrop> to 3 should drop everything."
8220 #: ../fish/guestfish-actions.pod:1088 ../src/guestfs-actions.pod:1813
8222 "This automatically calls L<sync(2)> before the operation, so that the "
8223 "maximum guest memory is freed."
8227 #: ../fish/guestfish-actions.pod:1091
8232 #: ../fish/guestfish-actions.pod:1093
8240 #: ../fish/guestfish-actions.pod:1095 ../src/guestfs-actions.pod:1826
8242 "This command runs the C<du -s> command to estimate file space usage for "
8247 #: ../fish/guestfish-actions.pod:1098 ../src/guestfs-actions.pod:1829
8249 "C<path> can be a file or a directory. If C<path> is a directory then the "
8250 "estimate includes the contents of the directory and all subdirectories "
8255 #: ../fish/guestfish-actions.pod:1102 ../src/guestfs-actions.pod:1833
8256 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
8260 #: ../fish/guestfish-actions.pod:1105
8265 #: ../fish/guestfish-actions.pod:1107
8268 " e2fsck-f device\n"
8273 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1851
8275 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
8276 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
8281 #: ../fish/guestfish-actions.pod:1113
8283 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
8284 "should use L</fsck>."
8288 #: ../fish/guestfish-actions.pod:1116
8293 #: ../fish/guestfish-actions.pod:1118
8296 " echo-daemon 'words ...'\n"
8301 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1868
8303 "This command concatenates the list of C<words> passed with single spaces "
8304 "between them and returns the resulting string."
8308 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1871
8309 msgid "You can use this command to test the connection through to the daemon."
8313 #: ../fish/guestfish-actions.pod:1125
8314 msgid "See also L</ping-daemon>."
8318 #: ../fish/guestfish-actions.pod:1127
8323 #: ../fish/guestfish-actions.pod:1129
8326 " egrep regex path\n"
8331 #: ../fish/guestfish-actions.pod:1131 ../src/guestfs-actions.pod:1887
8332 msgid "This calls the external C<egrep> program and returns the matching lines."
8336 #: ../fish/guestfish-actions.pod:1137
8341 #: ../fish/guestfish-actions.pod:1139
8344 " egrepi regex path\n"
8349 #: ../fish/guestfish-actions.pod:1141 ../src/guestfs-actions.pod:1906
8350 msgid "This calls the external C<egrep -i> program and returns the matching lines."
8354 #: ../fish/guestfish-actions.pod:1147
8359 #: ../fish/guestfish-actions.pod:1149
8362 " equal file1 file2\n"
8367 #: ../fish/guestfish-actions.pod:1151 ../src/guestfs-actions.pod:1925
8369 "This compares the two files C<file1> and C<file2> and returns true if their "
8370 "content is exactly equal, or false otherwise."
8374 #: ../fish/guestfish-actions.pod:1154 ../src/guestfs-actions.pod:1928
8375 msgid "The external L<cmp(1)> program is used for the comparison."
8379 #: ../fish/guestfish-actions.pod:1156
8384 #: ../fish/guestfish-actions.pod:1158
8392 #: ../fish/guestfish-actions.pod:1160 ../src/guestfs-actions.pod:1940
8394 "This returns C<true> if and only if there is a file, directory (or anything) "
8395 "with the given C<path> name."
8399 #: ../fish/guestfish-actions.pod:1163
8400 msgid "See also L</is-file>, L</is-dir>, L</stat>."
8404 #: ../fish/guestfish-actions.pod:1165
8409 #: ../fish/guestfish-actions.pod:1167
8412 " fallocate path len\n"
8417 #: ../fish/guestfish-actions.pod:1169 ../fish/guestfish-actions.pod:1188 ../src/guestfs-actions.pod:1963 ../src/guestfs-actions.pod:1982
8419 "This command preallocates a file (containing zero bytes) named C<path> of "
8420 "size C<len> bytes. If the file exists already, it is overwritten."
8424 #: ../fish/guestfish-actions.pod:1173 ../src/guestfs-actions.pod:1967
8426 "Do not confuse this with the guestfish-specific C<alloc> command which "
8427 "allocates a file in the host and attaches it as a device."
8431 #: ../fish/guestfish-actions.pod:1177
8433 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
8438 #: ../fish/guestfish-actions.pod:1184
8443 #: ../fish/guestfish-actions.pod:1186
8446 " fallocate64 path len\n"
8451 #: ../fish/guestfish-actions.pod:1192
8453 "Note that this call allocates disk blocks for the file. To create a sparse "
8454 "file use L</truncate-size> instead."
8458 #: ../fish/guestfish-actions.pod:1195
8460 "The deprecated call L</fallocate> does the same, but owing to an oversight "
8461 "it only allowed 30 bit lengths to be specified, effectively limiting the "
8462 "maximum size of files created through that call to 1GB."
8466 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:1994
8468 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
8469 "commands which create a file in the host and attach it as a device."
8473 #: ../fish/guestfish-actions.pod:1204
8478 #: ../fish/guestfish-actions.pod:1206
8481 " fgrep pattern path\n"
8486 #: ../fish/guestfish-actions.pod:1208 ../src/guestfs-actions.pod:2009
8487 msgid "This calls the external C<fgrep> program and returns the matching lines."
8491 #: ../fish/guestfish-actions.pod:1214
8496 #: ../fish/guestfish-actions.pod:1216
8499 " fgrepi pattern path\n"
8504 #: ../fish/guestfish-actions.pod:1218 ../src/guestfs-actions.pod:2028
8505 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
8509 #: ../fish/guestfish-actions.pod:1224
8514 #: ../fish/guestfish-actions.pod:1226
8522 #: ../fish/guestfish-actions.pod:1228 ../src/guestfs-actions.pod:2046
8524 "This call uses the standard L<file(1)> command to determine the type or "
8525 "contents of the file."
8529 #: ../fish/guestfish-actions.pod:1231 ../src/guestfs-actions.pod:2049
8531 "This call will also transparently look inside various types of compressed "
8536 #: ../fish/guestfish-actions.pod:1234 ../src/guestfs-actions.pod:2052
8538 "The exact command which runs is C<file -zb path>. Note in particular that "
8539 "the filename is not prepended to the output (the I<-b> option)."
8543 #: ../fish/guestfish-actions.pod:1238 ../src/guestfs-actions.pod:2056
8545 "The output depends on the output of the underlying L<file(1)> command and it "
8546 "can change in future in ways beyond our control. In other words, the output "
8547 "is not guaranteed by the ABI."
8551 #: ../fish/guestfish-actions.pod:1242
8553 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
8554 "(etc), L</is-zero>."
8558 #: ../fish/guestfish-actions.pod:1245
8559 msgid "file-architecture"
8563 #: ../fish/guestfish-actions.pod:1247
8566 " file-architecture filename\n"
8571 #: ../fish/guestfish-actions.pod:1249 ../src/guestfs-actions.pod:2074
8573 "This detects the architecture of the binary C<filename>, and returns it if "
8578 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:2077
8579 msgid "Currently defined architectures are:"
8583 #: ../fish/guestfish-actions.pod:1256 ../src/guestfs-actions.pod:2081
8588 #: ../fish/guestfish-actions.pod:1258 ../src/guestfs-actions.pod:2083
8590 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
8591 "irrespective of the precise processor requirements of the binary."
8595 #: ../fish/guestfish-actions.pod:1261 ../src/guestfs-actions.pod:2086
8600 #: ../fish/guestfish-actions.pod:1263 ../src/guestfs-actions.pod:2088
8601 msgid "64 bit x86-64."
8605 #: ../fish/guestfish-actions.pod:1265 ../src/guestfs-actions.pod:2090
8610 #: ../fish/guestfish-actions.pod:1267 ../src/guestfs-actions.pod:2092
8611 msgid "32 bit SPARC."
8615 #: ../fish/guestfish-actions.pod:1269 ../src/guestfs-actions.pod:2094
8620 #: ../fish/guestfish-actions.pod:1271 ../src/guestfs-actions.pod:2096
8621 msgid "64 bit SPARC V9 and above."
8625 #: ../fish/guestfish-actions.pod:1273 ../src/guestfs-actions.pod:2098
8630 #: ../fish/guestfish-actions.pod:1275 ../src/guestfs-actions.pod:2100
8631 msgid "Intel Itanium."
8635 #: ../fish/guestfish-actions.pod:1277 ../src/guestfs-actions.pod:2102
8640 #: ../fish/guestfish-actions.pod:1279 ../src/guestfs-actions.pod:2104
8641 msgid "32 bit Power PC."
8645 #: ../fish/guestfish-actions.pod:1281 ../src/guestfs-actions.pod:2106
8650 #: ../fish/guestfish-actions.pod:1283 ../src/guestfs-actions.pod:2108
8651 msgid "64 bit Power PC."
8655 #: ../fish/guestfish-actions.pod:1287 ../src/guestfs-actions.pod:2112
8656 msgid "Libguestfs may return other architecture strings in future."
8660 #: ../fish/guestfish-actions.pod:1289 ../src/guestfs-actions.pod:2114
8661 msgid "The function works on at least the following types of files:"
8665 #: ../fish/guestfish-actions.pod:1295 ../src/guestfs-actions.pod:2120
8666 msgid "many types of Un*x and Linux binary"
8670 #: ../fish/guestfish-actions.pod:1299 ../src/guestfs-actions.pod:2124
8671 msgid "many types of Un*x and Linux shared library"
8675 #: ../fish/guestfish-actions.pod:1303 ../src/guestfs-actions.pod:2128
8676 msgid "Windows Win32 and Win64 binaries"
8680 #: ../fish/guestfish-actions.pod:1307 ../src/guestfs-actions.pod:2132
8681 msgid "Windows Win32 and Win64 DLLs"
8685 #: ../fish/guestfish-actions.pod:1309 ../src/guestfs-actions.pod:2134
8686 msgid "Win32 binaries and DLLs return C<i386>."
8690 #: ../fish/guestfish-actions.pod:1311 ../src/guestfs-actions.pod:2136
8691 msgid "Win64 binaries and DLLs return C<x86_64>."
8695 #: ../fish/guestfish-actions.pod:1315 ../src/guestfs-actions.pod:2140
8696 msgid "Linux kernel modules"
8700 #: ../fish/guestfish-actions.pod:1319 ../src/guestfs-actions.pod:2144
8701 msgid "Linux new-style initrd images"
8705 #: ../fish/guestfish-actions.pod:1323 ../src/guestfs-actions.pod:2148
8706 msgid "some non-x86 Linux vmlinuz kernels"
8710 #: ../fish/guestfish-actions.pod:1327 ../src/guestfs-actions.pod:2152
8711 msgid "What it can't do currently:"
8715 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:2158
8716 msgid "static libraries (libfoo.a)"
8720 #: ../fish/guestfish-actions.pod:1337 ../src/guestfs-actions.pod:2162
8721 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
8725 #: ../fish/guestfish-actions.pod:1341 ../src/guestfs-actions.pod:2166
8726 msgid "x86 Linux vmlinuz kernels"
8730 #: ../fish/guestfish-actions.pod:1343 ../src/guestfs-actions.pod:2168
8732 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
8733 "compressed code, and are horribly hard to unpack. If you want to find the "
8734 "architecture of a kernel, use the architecture of the associated initrd or "
8735 "kernel module(s) instead."
8739 #: ../fish/guestfish-actions.pod:1350
8744 #: ../fish/guestfish-actions.pod:1352
8752 #: ../fish/guestfish-actions.pod:1354 ../src/guestfs-actions.pod:2186
8753 msgid "This command returns the size of C<file> in bytes."
8757 #: ../fish/guestfish-actions.pod:1356
8759 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
8760 "L</is-file> etc. To get the size of block devices, use "
8761 "L</blockdev-getsize64>."
8765 #: ../fish/guestfish-actions.pod:1360
8770 #: ../fish/guestfish-actions.pod:1362
8773 " fill c len path\n"
8778 #: ../fish/guestfish-actions.pod:1364 ../src/guestfs-actions.pod:2204
8780 "This command creates a new file called C<path>. The initial content of the "
8781 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
8786 #: ../fish/guestfish-actions.pod:1368
8788 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
8789 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
8794 #: ../fish/guestfish-actions.pod:1373
8795 msgid "fill-pattern"
8799 #: ../fish/guestfish-actions.pod:1375
8802 " fill-pattern pattern len path\n"
8807 #: ../fish/guestfish-actions.pod:1377
8809 "This function is like L</fill> except that it creates a new file of length "
8810 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
8811 "is truncated if necessary to ensure the length of the file is exactly C<len> "
8816 #: ../fish/guestfish-actions.pod:1382
8821 #: ../fish/guestfish-actions.pod:1384
8829 #: ../fish/guestfish-actions.pod:1386 ../src/guestfs-actions.pod:2250
8831 "This command lists out all files and directories, recursively, starting at "
8832 "C<directory>. It is essentially equivalent to running the shell command "
8833 "C<find directory -print> but some post-processing happens on the output, "
8838 #: ../fish/guestfish-actions.pod:1391 ../src/guestfs-actions.pod:2255
8840 "This returns a list of strings I<without any prefix>. Thus if the directory "
8845 #: ../fish/guestfish-actions.pod:1394 ../src/guestfs-actions.pod:2258
8855 #: ../fish/guestfish-actions.pod:1398
8856 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
8860 #: ../fish/guestfish-actions.pod:1401 ../src/guestfs-actions.pod:2265
8871 #: ../fish/guestfish-actions.pod:1406 ../src/guestfs-actions.pod:2270
8872 msgid "If C<directory> is not a directory, then this command returns an error."
8876 #: ../fish/guestfish-actions.pod:1409 ../src/guestfs-actions.pod:2273
8877 msgid "The returned list is sorted."
8881 #: ../fish/guestfish-actions.pod:1411
8882 msgid "See also L</find0>."
8886 #: ../fish/guestfish-actions.pod:1416
8891 #: ../fish/guestfish-actions.pod:1418
8894 " find0 directory (files|-)\n"
8899 #: ../fish/guestfish-actions.pod:1420 ../src/guestfs-actions.pod:2293
8901 "This command lists out all files and directories, recursively, starting at "
8902 "C<directory>, placing the resulting list in the external file called "
8907 #: ../fish/guestfish-actions.pod:1424
8908 msgid "This command works the same way as L</find> with the following exceptions:"
8912 #: ../fish/guestfish-actions.pod:1431 ../src/guestfs-actions.pod:2304
8913 msgid "The resulting list is written to an external file."
8917 #: ../fish/guestfish-actions.pod:1435 ../src/guestfs-actions.pod:2308
8919 "Items (filenames) in the result are separated by C<\\0> characters. See "
8920 "L<find(1)> option I<-print0>."
8924 #: ../fish/guestfish-actions.pod:1440 ../src/guestfs-actions.pod:2313
8925 msgid "This command is not limited in the number of names that it can return."
8929 #: ../fish/guestfish-actions.pod:1445 ../src/guestfs-actions.pod:2318
8930 msgid "The result list is not sorted."
8934 #: ../fish/guestfish-actions.pod:1451
8935 msgid "findfs-label"
8939 #: ../fish/guestfish-actions.pod:1453
8942 " findfs-label label\n"
8947 #: ../fish/guestfish-actions.pod:1455 ../src/guestfs-actions.pod:2332
8949 "This command searches the filesystems and returns the one which has the "
8950 "given label. An error is returned if no such filesystem can be found."
8954 #: ../fish/guestfish-actions.pod:1459
8955 msgid "To find the label of a filesystem, use L</vfs-label>."
8959 #: ../fish/guestfish-actions.pod:1461
8964 #: ../fish/guestfish-actions.pod:1463
8967 " findfs-uuid uuid\n"
8972 #: ../fish/guestfish-actions.pod:1465 ../src/guestfs-actions.pod:2349
8974 "This command searches the filesystems and returns the one which has the "
8975 "given UUID. An error is returned if no such filesystem can be found."
8979 #: ../fish/guestfish-actions.pod:1469
8980 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
8984 #: ../fish/guestfish-actions.pod:1471
8989 #: ../fish/guestfish-actions.pod:1473
8992 " fsck fstype device\n"
8997 #: ../fish/guestfish-actions.pod:1475 ../src/guestfs-actions.pod:2367
8999 "This runs the filesystem checker (fsck) on C<device> which should have "
9000 "filesystem type C<fstype>."
9004 #: ../fish/guestfish-actions.pod:1478 ../src/guestfs-actions.pod:2370
9006 "The returned integer is the status. See L<fsck(8)> for the list of status "
9007 "codes from C<fsck>."
9011 #: ../fish/guestfish-actions.pod:1487 ../src/guestfs-actions.pod:2379
9012 msgid "Multiple status codes can be summed together."
9016 #: ../fish/guestfish-actions.pod:1491 ../src/guestfs-actions.pod:2383
9018 "A non-zero return code can mean \"success\", for example if errors have been "
9019 "corrected on the filesystem."
9023 #: ../fish/guestfish-actions.pod:1496 ../src/guestfs-actions.pod:2388
9024 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
9028 #: ../fish/guestfish-actions.pod:1501 ../src/guestfs-actions.pod:2393
9029 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
9033 #: ../fish/guestfish-actions.pod:1503
9038 #: ../fish/guestfish-actions.pod:1505
9046 #: ../fish/guestfish-actions.pod:1507 ../src/guestfs-actions.pod:2404
9048 "Return the additional kernel options which are added to the guest kernel "
9053 #: ../fish/guestfish-actions.pod:1510 ../src/guestfs-actions.pod:2407
9054 msgid "If C<NULL> then no options are added."
9058 #: ../fish/guestfish-actions.pod:1512
9059 msgid "get-attach-method"
9063 #: ../fish/guestfish-actions.pod:1514
9066 " get-attach-method\n"
9071 #: ../fish/guestfish-actions.pod:1516
9072 msgid "Return the current attach method. See L</set-attach-method>."
9076 #: ../fish/guestfish-actions.pod:1518
9077 msgid "get-autosync"
9081 #: ../fish/guestfish-actions.pod:1520
9089 #: ../fish/guestfish-actions.pod:1522 ../src/guestfs-actions.pod:2432
9090 msgid "Get the autosync flag."
9094 #: ../fish/guestfish-actions.pod:1524
9099 #: ../fish/guestfish-actions.pod:1526
9107 #: ../fish/guestfish-actions.pod:1528 ../src/guestfs-actions.pod:2443
9108 msgid "Return the direct appliance mode flag."
9112 #: ../fish/guestfish-actions.pod:1530
9117 #: ../fish/guestfish-actions.pod:1532
9120 " get-e2label device\n"
9125 #: ../fish/guestfish-actions.pod:1534 ../src/guestfs-actions.pod:2462
9126 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
9130 #: ../fish/guestfish-actions.pod:1537
9132 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
9137 #: ../fish/guestfish-actions.pod:1544
9142 #: ../fish/guestfish-actions.pod:1546
9145 " get-e2uuid device\n"
9150 #: ../fish/guestfish-actions.pod:1548 ../src/guestfs-actions.pod:2483
9151 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
9155 #: ../fish/guestfish-actions.pod:1551
9157 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
9162 #: ../fish/guestfish-actions.pod:1558
9167 #: ../fish/guestfish-actions.pod:1560
9175 #: ../fish/guestfish-actions.pod:1562 ../src/guestfs-actions.pod:2496
9176 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
9180 #: ../fish/guestfish-actions.pod:1565
9182 "If L</set-memsize> was not called on this handle, and if "
9183 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
9184 "value for memsize."
9188 #: ../fish/guestfish-actions.pod:1569 ../fish/guestfish-actions.pod:1626 ../fish/guestfish-actions.pod:4499 ../fish/guestfish-actions.pod:4601 ../src/guestfs-actions.pod:2503 ../src/guestfs-actions.pod:2595 ../src/guestfs-actions.pod:6960 ../src/guestfs-actions.pod:7086
9189 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
9193 #: ../fish/guestfish-actions.pod:1572
9198 #: ../fish/guestfish-actions.pod:1574
9206 #: ../fish/guestfish-actions.pod:1576 ../src/guestfs-actions.pod:2515
9207 msgid "This returns the enable network flag."
9211 #: ../fish/guestfish-actions.pod:1578
9216 #: ../fish/guestfish-actions.pod:1580
9224 #: ../fish/guestfish-actions.pod:1582 ../src/guestfs-actions.pod:2526
9225 msgid "Return the current search path."
9229 #: ../fish/guestfish-actions.pod:1584 ../src/guestfs-actions.pod:2528
9231 "This is always non-NULL. If it wasn't set already, then this will return "
9236 #: ../fish/guestfish-actions.pod:1587
9241 #: ../fish/guestfish-actions.pod:1589
9249 #: ../fish/guestfish-actions.pod:1591 ../src/guestfs-actions.pod:2541
9250 msgid "This returns the process group flag."
9254 #: ../fish/guestfish-actions.pod:1593
9259 #: ../fish/guestfish-actions.pod:1595
9264 #: ../fish/guestfish-actions.pod:1597
9272 #: ../fish/guestfish-actions.pod:1599 ../src/guestfs-actions.pod:2552
9274 "Return the process ID of the qemu subprocess. If there is no qemu "
9275 "subprocess, then this will return an error."
9279 #: ../fish/guestfish-actions.pod:1602 ../src/guestfs-actions.pod:2555
9280 msgid "This is an internal call used for debugging and testing."
9284 #: ../fish/guestfish-actions.pod:1604
9289 #: ../fish/guestfish-actions.pod:1606
9297 #: ../fish/guestfish-actions.pod:1608 ../src/guestfs-actions.pod:2566
9298 msgid "Return the current qemu binary."
9302 #: ../fish/guestfish-actions.pod:1610 ../src/guestfs-actions.pod:2568
9304 "This is always non-NULL. If it wasn't set already, then this will return "
9305 "the default qemu binary name."
9309 #: ../fish/guestfish-actions.pod:1613
9310 msgid "get-recovery-proc"
9314 #: ../fish/guestfish-actions.pod:1615
9317 " get-recovery-proc\n"
9322 #: ../fish/guestfish-actions.pod:1617 ../src/guestfs-actions.pod:2581
9323 msgid "Return the recovery process enabled flag."
9327 #: ../fish/guestfish-actions.pod:1619
9332 #: ../fish/guestfish-actions.pod:1621
9340 #: ../fish/guestfish-actions.pod:1623
9342 "This returns the current setting of the selinux flag which is passed to the "
9343 "appliance at boot time. See L</set-selinux>."
9347 #: ../fish/guestfish-actions.pod:1629
9352 #: ../fish/guestfish-actions.pod:1631
9360 #: ../fish/guestfish-actions.pod:1633 ../src/guestfs-actions.pod:2607
9361 msgid "This returns the number of virtual CPUs assigned to the appliance."
9365 #: ../fish/guestfish-actions.pod:1635
9370 #: ../fish/guestfish-actions.pod:1637
9378 #: ../fish/guestfish-actions.pod:1639 ../src/guestfs-actions.pod:2618
9380 "This returns the current state as an opaque integer. This is only useful "
9381 "for printing debug and internal error messages."
9385 #: ../fish/guestfish-actions.pod:1642 ../fish/guestfish-actions.pod:2605 ../fish/guestfish-actions.pod:2623 ../fish/guestfish-actions.pod:2661 ../fish/guestfish-actions.pod:2677 ../src/guestfs-actions.pod:2621 ../src/guestfs-actions.pod:3944 ../src/guestfs-actions.pod:3973 ../src/guestfs-actions.pod:4034 ../src/guestfs-actions.pod:4061
9386 msgid "For more information on states, see L<guestfs(3)>."
9390 #: ../fish/guestfish-actions.pod:1644
9395 #: ../fish/guestfish-actions.pod:1646
9403 #: ../fish/guestfish-actions.pod:1648 ../src/guestfs-actions.pod:2632
9404 msgid "Return the command trace flag."
9408 #: ../fish/guestfish-actions.pod:1650
9413 #: ../fish/guestfish-actions.pod:1652
9421 #: ../fish/guestfish-actions.pod:1654
9423 "Return the current umask. By default the umask is C<022> unless it has been "
9424 "set by calling L</umask>."
9428 #: ../fish/guestfish-actions.pod:1657
9433 #: ../fish/guestfish-actions.pod:1659
9441 #: ../fish/guestfish-actions.pod:1661 ../src/guestfs-actions.pod:2655
9442 msgid "This returns the verbose messages flag."
9446 #: ../fish/guestfish-actions.pod:1663
9451 #: ../fish/guestfish-actions.pod:1665
9459 #: ../fish/guestfish-actions.pod:1667 ../src/guestfs-actions.pod:2666
9460 msgid "This gets the SELinux security context of the daemon."
9464 #: ../fish/guestfish-actions.pod:1669
9465 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
9469 #: ../fish/guestfish-actions.pod:1672
9474 #: ../fish/guestfish-actions.pod:1674
9477 " getxattr path name\n"
9482 #: ../fish/guestfish-actions.pod:1676
9484 "Get a single extended attribute from file C<path> named C<name>. This call "
9485 "follows symlinks. If you want to lookup an extended attribute for the "
9486 "symlink itself, use L</lgetxattr>."
9490 #: ../fish/guestfish-actions.pod:1680 ../fish/guestfish-actions.pod:2750
9492 "Normally it is better to get all extended attributes from a file in one go "
9493 "by calling L</getxattrs>. However some Linux filesystem implementations are "
9494 "buggy and do not provide a way to list out attributes. For these "
9495 "filesystems (notably ntfs-3g) you have to know the names of the extended "
9496 "attributes you want in advance and call this function."
9500 #: ../fish/guestfish-actions.pod:1687 ../fish/guestfish-actions.pod:2757 ../src/guestfs-actions.pod:2695 ../src/guestfs-actions.pod:4194
9502 "Extended attribute values are blobs of binary data. If there is no extended "
9503 "attribute named C<name>, this returns an error."
9507 #: ../fish/guestfish-actions.pod:1690
9508 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
9512 #: ../fish/guestfish-actions.pod:1692
9517 #: ../fish/guestfish-actions.pod:1694
9525 #: ../fish/guestfish-actions.pod:1696 ../src/guestfs-actions.pod:2712
9526 msgid "This call lists the extended attributes of the file or directory C<path>."
9530 #: ../fish/guestfish-actions.pod:1699 ../src/guestfs-actions.pod:2715
9532 "At the system call level, this is a combination of the L<listxattr(2)> and "
9533 "L<getxattr(2)> calls."
9537 #: ../fish/guestfish-actions.pod:1702
9538 msgid "See also: L</lgetxattrs>, L<attr(5)>."
9542 #: ../fish/guestfish-actions.pod:1704
9547 #: ../fish/guestfish-actions.pod:1706
9550 " glob-expand pattern\n"
9555 #: ../fish/guestfish-actions.pod:1708 ../src/guestfs-actions.pod:2732
9557 "This command searches for all the pathnames matching C<pattern> according to "
9558 "the wildcard expansion rules used by the shell."
9562 #: ../fish/guestfish-actions.pod:1712 ../src/guestfs-actions.pod:2736
9563 msgid "If no paths match, then this returns an empty list (note: not an error)."
9567 #: ../fish/guestfish-actions.pod:1715 ../src/guestfs-actions.pod:2739
9569 "It is just a wrapper around the C L<glob(3)> function with flags "
9570 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
9574 #: ../fish/guestfish-actions.pod:1719
9579 #: ../fish/guestfish-actions.pod:1721
9582 " grep regex path\n"
9587 #: ../fish/guestfish-actions.pod:1723 ../src/guestfs-actions.pod:2756
9588 msgid "This calls the external C<grep> program and returns the matching lines."
9592 #: ../fish/guestfish-actions.pod:1729
9597 #: ../fish/guestfish-actions.pod:1731
9600 " grepi regex path\n"
9605 #: ../fish/guestfish-actions.pod:1733 ../src/guestfs-actions.pod:2775
9606 msgid "This calls the external C<grep -i> program and returns the matching lines."
9610 #: ../fish/guestfish-actions.pod:1739
9611 msgid "grub-install"
9615 #: ../fish/guestfish-actions.pod:1741
9618 " grub-install root device\n"
9623 #: ../fish/guestfish-actions.pod:1743 ../src/guestfs-actions.pod:2794
9625 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
9626 "with the root directory being C<root>."
9630 #: ../fish/guestfish-actions.pod:1752 ../src/guestfs-actions.pod:2803
9632 "There is currently no way in the API to install grub2, which is used by most "
9633 "modern Linux guests. It is possible to run the grub2 command from the "
9634 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
9638 #: ../fish/guestfish-actions.pod:1759 ../src/guestfs-actions.pod:2810
9640 "This uses C<grub-install> from the host. Unfortunately grub is not always "
9641 "compatible with itself, so this only works in rather narrow circumstances. "
9642 "Careful testing with each guest version is advisable."
9646 #: ../fish/guestfish-actions.pod:1766 ../src/guestfs-actions.pod:2817
9648 "If grub-install reports the error \"No suitable drive was found in the "
9649 "generated device map.\" it may be that you need to create a "
9650 "C</boot/grub/device.map> file first that contains the mapping between grub "
9651 "device names and Linux device names. It is usually sufficient to create a "
9656 #: ../fish/guestfish-actions.pod:1773 ../src/guestfs-actions.pod:2824
9664 #: ../fish/guestfish-actions.pod:1775 ../src/guestfs-actions.pod:2826
9665 msgid "replacing C</dev/vda> with the name of the installation device."
9669 #: ../fish/guestfish-actions.pod:1779
9674 #: ../fish/guestfish-actions.pod:1781
9682 #: ../fish/guestfish-actions.pod:1783 ../src/guestfs-actions.pod:2840
9684 "This command returns up to the first 10 lines of a file as a list of "
9689 #: ../fish/guestfish-actions.pod:1789
9694 #: ../fish/guestfish-actions.pod:1791
9697 " head-n nrlines path\n"
9702 #: ../fish/guestfish-actions.pod:1793 ../src/guestfs-actions.pod:2859
9704 "If the parameter C<nrlines> is a positive number, this returns the first "
9705 "C<nrlines> lines of the file C<path>."
9709 #: ../fish/guestfish-actions.pod:1796 ../src/guestfs-actions.pod:2862
9711 "If the parameter C<nrlines> is a negative number, this returns lines from "
9712 "the file C<path>, excluding the last C<nrlines> lines."
9716 #: ../fish/guestfish-actions.pod:1799 ../fish/guestfish-actions.pod:4982 ../src/guestfs-actions.pod:2865 ../src/guestfs-actions.pod:7665
9717 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
9721 #: ../fish/guestfish-actions.pod:1804
9726 #: ../fish/guestfish-actions.pod:1806
9734 #: ../fish/guestfish-actions.pod:1808 ../src/guestfs-actions.pod:2882
9736 "This runs C<hexdump -C> on the given C<path>. The result is the "
9737 "human-readable, canonical hex dump of the file."
9741 #: ../fish/guestfish-actions.pod:1814
9746 #: ../fish/guestfish-actions.pod:1816
9749 " initrd-cat initrdpath filename\n"
9754 #: ../fish/guestfish-actions.pod:1818 ../src/guestfs-actions.pod:2901
9756 "This command unpacks the file C<filename> from the initrd file called "
9757 "C<initrdpath>. The filename must be given I<without> the initial C</> "
9762 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2905
9764 "For example, in guestfish you could use the following command to examine the "
9765 "boot script (usually called C</init>) contained in a Linux initrd or "
9770 #: ../fish/guestfish-actions.pod:1826 ../src/guestfs-actions.pod:2909
9773 " initrd-cat /boot/initrd-<version>.img init\n"
9778 #: ../fish/guestfish-actions.pod:1828
9779 msgid "See also L</initrd-list>."
9783 #: ../fish/guestfish-actions.pod:1833
9788 #: ../fish/guestfish-actions.pod:1835
9791 " initrd-list path\n"
9796 #: ../fish/guestfish-actions.pod:1837 ../src/guestfs-actions.pod:2928
9797 msgid "This command lists out files contained in an initrd."
9801 #: ../fish/guestfish-actions.pod:1839 ../src/guestfs-actions.pod:2930
9803 "The files are listed without any initial C</> character. The files are "
9804 "listed in the order they appear (not necessarily alphabetical). Directory "
9805 "names are listed as separate items."
9809 #: ../fish/guestfish-actions.pod:1843 ../src/guestfs-actions.pod:2934
9811 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
9812 "initrd. We I<only> support the newer initramfs format (compressed cpio "
9817 #: ../fish/guestfish-actions.pod:1847
9818 msgid "inotify-add-watch"
9822 #: ../fish/guestfish-actions.pod:1849
9825 " inotify-add-watch path mask\n"
9830 #: ../fish/guestfish-actions.pod:1851 ../src/guestfs-actions.pod:2951
9831 msgid "Watch C<path> for the events listed in C<mask>."
9835 #: ../fish/guestfish-actions.pod:1853 ../src/guestfs-actions.pod:2953
9837 "Note that if C<path> is a directory then events within that directory are "
9838 "watched, but this does I<not> happen recursively (in subdirectories)."
9842 #: ../fish/guestfish-actions.pod:1857 ../src/guestfs-actions.pod:2957
9844 "Note for non-C or non-Linux callers: the inotify events are defined by the "
9845 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
9849 #: ../fish/guestfish-actions.pod:1861
9850 msgid "inotify-close"
9854 #: ../fish/guestfish-actions.pod:1863
9862 #: ../fish/guestfish-actions.pod:1865 ../src/guestfs-actions.pod:2970
9864 "This closes the inotify handle which was previously opened by inotify_init. "
9865 "It removes all watches, throws away any pending events, and deallocates all "
9870 #: ../fish/guestfish-actions.pod:1869
9871 msgid "inotify-files"
9875 #: ../fish/guestfish-actions.pod:1871
9883 #: ../fish/guestfish-actions.pod:1873
9885 "This function is a helpful wrapper around L</inotify-read> which just "
9886 "returns a list of pathnames of objects that were touched. The returned "
9887 "pathnames are sorted and deduplicated."
9891 #: ../fish/guestfish-actions.pod:1877
9892 msgid "inotify-init"
9896 #: ../fish/guestfish-actions.pod:1879
9899 " inotify-init maxevents\n"
9904 #: ../fish/guestfish-actions.pod:1881 ../src/guestfs-actions.pod:2999
9906 "This command creates a new inotify handle. The inotify subsystem can be "
9907 "used to notify events which happen to objects in the guest filesystem."
9911 #: ../fish/guestfish-actions.pod:1885
9913 "C<maxevents> is the maximum number of events which will be queued up between "
9914 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
9915 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
9916 "default was 16384 events. Beyond this limit, the kernel throws away events, "
9917 "but records the fact that it threw them away by setting a flag "
9918 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
9922 #: ../fish/guestfish-actions.pod:1895
9924 "Before any events are generated, you have to add some watches to the "
9925 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
9926 "L</inotify-watch-all>."
9930 #: ../fish/guestfish-actions.pod:1901
9932 "Queued up events should be read periodically by calling L</inotify-read> (or "
9933 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
9934 "If you don't read the events out often enough then you risk the internal "
9935 "queue overflowing."
9939 #: ../fish/guestfish-actions.pod:1908
9941 "The handle should be closed after use by calling L</inotify-close>. This "
9942 "also removes any watches automatically."
9946 #: ../fish/guestfish-actions.pod:1912 ../src/guestfs-actions.pod:3030
9948 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9949 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9950 "that there is one global inotify handle per libguestfs instance."
9954 #: ../fish/guestfish-actions.pod:1917
9955 msgid "inotify-read"
9959 #: ../fish/guestfish-actions.pod:1919
9967 #: ../fish/guestfish-actions.pod:1921 ../src/guestfs-actions.pod:3044
9969 "Return the complete queue of events that have happened since the previous "
9974 #: ../fish/guestfish-actions.pod:1924 ../src/guestfs-actions.pod:3047
9975 msgid "If no events have happened, this returns an empty list."
9979 #: ../fish/guestfish-actions.pod:1926 ../src/guestfs-actions.pod:3049
9981 "I<Note>: In order to make sure that all events have been read, you must call "
9982 "this function repeatedly until it returns an empty list. The reason is that "
9983 "the call will read events up to the maximum appliance-to-host message size "
9984 "and leave remaining events in the queue."
9988 #: ../fish/guestfish-actions.pod:1932
9989 msgid "inotify-rm-watch"
9993 #: ../fish/guestfish-actions.pod:1934
9996 " inotify-rm-watch wd\n"
10001 #: ../fish/guestfish-actions.pod:1936
10002 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
10006 #: ../fish/guestfish-actions.pod:1939
10007 msgid "inspect-get-arch"
10011 #: ../fish/guestfish-actions.pod:1941
10014 " inspect-get-arch root\n"
10019 #: ../fish/guestfish-actions.pod:1943
10021 "This returns the architecture of the inspected operating system. The "
10022 "possible return values are listed under L</file-architecture>."
10026 #: ../fish/guestfish-actions.pod:1947 ../src/guestfs-actions.pod:3084
10028 "If the architecture could not be determined, then the string C<unknown> is "
10033 #: ../fish/guestfish-actions.pod:1950 ../fish/guestfish-actions.pod:2045 ../fish/guestfish-actions.pod:2124 ../fish/guestfish-actions.pod:2136 ../fish/guestfish-actions.pod:2220 ../fish/guestfish-actions.pod:2282 ../fish/guestfish-actions.pod:2303 ../fish/guestfish-actions.pod:2317 ../fish/guestfish-actions.pod:2357 ../fish/guestfish-actions.pod:2397 ../fish/guestfish-actions.pod:2410 ../fish/guestfish-actions.pod:2423 ../fish/guestfish-actions.pod:2433 ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2455 ../fish/guestfish-actions.pod:2551 ../fish/guestfish-actions.pod:2585 ../src/guestfs-actions.pod:3087 ../src/guestfs-actions.pod:3189 ../src/guestfs-actions.pod:3293 ../src/guestfs-actions.pod:3312 ../src/guestfs-actions.pod:3443 ../src/guestfs-actions.pod:3527 ../src/guestfs-actions.pod:3555 ../src/guestfs-actions.pod:3576 ../src/guestfs-actions.pod:3629 ../src/guestfs-actions.pod:3677 ../src/guestfs-actions.pod:3697 ../src/guestfs-actions.pod:3717 ../src/guestfs-actions.pod:3734 ../src/guestfs-actions.pod:3750 ../src/guestfs-actions.pod:3768 ../src/guestfs-actions.pod:3870 ../src/guestfs-actions.pod:3911
10034 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
10038 #: ../fish/guestfish-actions.pod:1952
10039 msgid "inspect-get-distro"
10043 #: ../fish/guestfish-actions.pod:1954
10046 " inspect-get-distro root\n"
10051 #: ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:3100
10052 msgid "This returns the distro (distribution) of the inspected operating system."
10056 #: ../fish/guestfish-actions.pod:1959 ../src/guestfs-actions.pod:3103
10057 msgid "Currently defined distros are:"
10061 #: ../fish/guestfish-actions.pod:1963 ../src/guestfs-actions.pod:3107
10062 msgid "\"archlinux\""
10066 #: ../fish/guestfish-actions.pod:1965 ../src/guestfs-actions.pod:3109
10067 msgid "Arch Linux."
10071 #: ../fish/guestfish-actions.pod:1967 ../src/guestfs-actions.pod:3111
10076 #: ../fish/guestfish-actions.pod:1969 ../src/guestfs-actions.pod:3113
10081 #: ../fish/guestfish-actions.pod:1971 ../src/guestfs-actions.pod:3115
10086 #: ../fish/guestfish-actions.pod:1973 ../src/guestfs-actions.pod:3117
10091 #: ../fish/guestfish-actions.pod:1975 ../src/guestfs-actions.pod:3119
10096 #: ../fish/guestfish-actions.pod:1977 ../src/guestfs-actions.pod:3121
10101 #: ../fish/guestfish-actions.pod:1979 ../src/guestfs-actions.pod:3123
10106 #: ../fish/guestfish-actions.pod:1981 ../src/guestfs-actions.pod:3125
10111 #: ../fish/guestfish-actions.pod:1983 ../src/guestfs-actions.pod:3127
10112 msgid "\"linuxmint\""
10116 #: ../fish/guestfish-actions.pod:1985 ../src/guestfs-actions.pod:3129
10117 msgid "Linux Mint."
10121 #: ../fish/guestfish-actions.pod:1987 ../src/guestfs-actions.pod:3131
10126 #: ../fish/guestfish-actions.pod:1989 ../src/guestfs-actions.pod:3133
10131 #: ../fish/guestfish-actions.pod:1991 ../src/guestfs-actions.pod:3135
10132 msgid "\"mandriva\""
10136 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:3137
10141 #: ../fish/guestfish-actions.pod:1995 ../src/guestfs-actions.pod:3139
10146 #: ../fish/guestfish-actions.pod:1997 ../src/guestfs-actions.pod:3141
10151 #: ../fish/guestfish-actions.pod:1999 ../src/guestfs-actions.pod:3143
10152 msgid "\"opensuse\""
10156 #: ../fish/guestfish-actions.pod:2001 ../src/guestfs-actions.pod:3145
10161 #: ../fish/guestfish-actions.pod:2003 ../src/guestfs-actions.pod:3147
10166 #: ../fish/guestfish-actions.pod:2005 ../src/guestfs-actions.pod:3149
10171 #: ../fish/guestfish-actions.pod:2007 ../src/guestfs-actions.pod:3151
10172 msgid "\"redhat-based\""
10176 #: ../fish/guestfish-actions.pod:2009 ../src/guestfs-actions.pod:3153
10177 msgid "Some Red Hat-derived distro."
10181 #: ../fish/guestfish-actions.pod:2011 ../src/guestfs-actions.pod:3155
10186 #: ../fish/guestfish-actions.pod:2013 ../src/guestfs-actions.pod:3157
10187 msgid "Red Hat Enterprise Linux."
10191 #: ../fish/guestfish-actions.pod:2015 ../src/guestfs-actions.pod:3159
10192 msgid "\"scientificlinux\""
10196 #: ../fish/guestfish-actions.pod:2017 ../src/guestfs-actions.pod:3161
10197 msgid "Scientific Linux."
10201 #: ../fish/guestfish-actions.pod:2019 ../src/guestfs-actions.pod:3163
10202 msgid "\"slackware\""
10206 #: ../fish/guestfish-actions.pod:2021 ../src/guestfs-actions.pod:3165
10211 #: ../fish/guestfish-actions.pod:2023 ../src/guestfs-actions.pod:3167
10212 msgid "\"ttylinux\""
10216 #: ../fish/guestfish-actions.pod:2025 ../src/guestfs-actions.pod:3169
10221 #: ../fish/guestfish-actions.pod:2027 ../src/guestfs-actions.pod:3171
10226 #: ../fish/guestfish-actions.pod:2029 ../src/guestfs-actions.pod:3173
10231 #: ../fish/guestfish-actions.pod:2031 ../fish/guestfish-actions.pod:2115 ../fish/guestfish-actions.pod:2388 ../src/guestfs-actions.pod:3175 ../src/guestfs-actions.pod:3284 ../src/guestfs-actions.pod:3668
10232 msgid "\"unknown\""
10236 #: ../fish/guestfish-actions.pod:2033 ../src/guestfs-actions.pod:3177
10237 msgid "The distro could not be determined."
10241 #: ../fish/guestfish-actions.pod:2035 ../fish/guestfish-actions.pod:2372 ../src/guestfs-actions.pod:3179 ../src/guestfs-actions.pod:3652
10242 msgid "\"windows\""
10246 #: ../fish/guestfish-actions.pod:2037 ../src/guestfs-actions.pod:3181
10248 "Windows does not have distributions. This string is returned if the OS type "
10253 #: ../fish/guestfish-actions.pod:2042 ../fish/guestfish-actions.pod:2121 ../fish/guestfish-actions.pod:2394 ../src/guestfs-actions.pod:3186 ../src/guestfs-actions.pod:3290 ../src/guestfs-actions.pod:3674
10255 "Future versions of libguestfs may return other strings here. The caller "
10256 "should be prepared to handle any string."
10260 #: ../fish/guestfish-actions.pod:2047
10261 msgid "inspect-get-drive-mappings"
10265 #: ../fish/guestfish-actions.pod:2049
10268 " inspect-get-drive-mappings root\n"
10273 #: ../fish/guestfish-actions.pod:2051 ../src/guestfs-actions.pod:3202
10275 "This call is useful for Windows which uses a primitive system of assigning "
10276 "drive letters (like \"C:\") to partitions. This inspection API examines the "
10277 "Windows Registry to find out how disks/partitions are mapped to drive "
10278 "letters, and returns a hash table as in the example below:"
10282 #: ../fish/guestfish-actions.pod:2057 ../src/guestfs-actions.pod:3208
10285 " C => /dev/vda2\n"
10286 " E => /dev/vdb1\n"
10287 " F => /dev/vdc1\n"
10292 #: ../fish/guestfish-actions.pod:2061 ../src/guestfs-actions.pod:3212
10294 "Note that keys are drive letters. For Windows, the key is case insensitive "
10295 "and just contains the drive letter, without the customary colon separator "
10300 #: ../fish/guestfish-actions.pod:2065 ../src/guestfs-actions.pod:3216
10302 "In future we may support other operating systems that also used drive "
10303 "letters, but the keys for those might not be case insensitive and might be "
10304 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
10309 #: ../fish/guestfish-actions.pod:2070 ../src/guestfs-actions.pod:3221
10311 "For Windows guests, currently only hard drive mappings are returned. "
10312 "Removable disks (eg. DVD-ROMs) are ignored."
10316 #: ../fish/guestfish-actions.pod:2073 ../src/guestfs-actions.pod:3224
10318 "For guests that do not use drive mappings, or if the drive mappings could "
10319 "not be determined, this returns an empty hash table."
10323 #: ../fish/guestfish-actions.pod:2076
10325 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10326 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
10330 #: ../fish/guestfish-actions.pod:2080
10331 msgid "inspect-get-filesystems"
10335 #: ../fish/guestfish-actions.pod:2082
10338 " inspect-get-filesystems root\n"
10343 #: ../fish/guestfish-actions.pod:2084 ../src/guestfs-actions.pod:3245
10345 "This returns a list of all the filesystems that we think are associated with "
10346 "this operating system. This includes the root filesystem, other ordinary "
10347 "filesystems, and non-mounted devices like swap partitions."
10351 #: ../fish/guestfish-actions.pod:2089 ../src/guestfs-actions.pod:3250
10353 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
10354 "to be shared between operating systems."
10358 #: ../fish/guestfish-actions.pod:2092
10360 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10361 "L</inspect-get-mountpoints>."
10365 #: ../fish/guestfish-actions.pod:2095
10366 msgid "inspect-get-format"
10370 #: ../fish/guestfish-actions.pod:2097
10373 " inspect-get-format root\n"
10378 #: ../fish/guestfish-actions.pod:2099 ../src/guestfs-actions.pod:3268
10380 "This returns the format of the inspected operating system. You can use it "
10381 "to detect install images, live CDs and similar."
10385 #: ../fish/guestfish-actions.pod:2102 ../src/guestfs-actions.pod:3271
10386 msgid "Currently defined formats are:"
10390 #: ../fish/guestfish-actions.pod:2106 ../src/guestfs-actions.pod:3275
10391 msgid "\"installed\""
10395 #: ../fish/guestfish-actions.pod:2108 ../src/guestfs-actions.pod:3277
10396 msgid "This is an installed operating system."
10400 #: ../fish/guestfish-actions.pod:2110 ../src/guestfs-actions.pod:3279
10401 msgid "\"installer\""
10405 #: ../fish/guestfish-actions.pod:2112 ../src/guestfs-actions.pod:3281
10407 "The disk image being inspected is not an installed operating system, but a "
10408 "I<bootable> install disk, live CD, or similar."
10412 #: ../fish/guestfish-actions.pod:2117 ../src/guestfs-actions.pod:3286
10413 msgid "The format of this disk image is not known."
10417 #: ../fish/guestfish-actions.pod:2126
10418 msgid "inspect-get-hostname"
10422 #: ../fish/guestfish-actions.pod:2128
10425 " inspect-get-hostname root\n"
10430 #: ../fish/guestfish-actions.pod:2130 ../src/guestfs-actions.pod:3306
10432 "This function returns the hostname of the operating system as found by "
10433 "inspection of the guest's configuration files."
10437 #: ../fish/guestfish-actions.pod:2133 ../src/guestfs-actions.pod:3309
10439 "If the hostname could not be determined, then the string C<unknown> is "
10444 #: ../fish/guestfish-actions.pod:2138
10445 msgid "inspect-get-icon"
10449 #: ../fish/guestfish-actions.pod:2140
10452 " inspect-get-icon root [favicon:true|false] [highquality:true|false]\n"
10457 #: ../fish/guestfish-actions.pod:2142 ../src/guestfs-actions.pod:3335
10459 "This function returns an icon corresponding to the inspected operating "
10460 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
10461 "to PNG if necessary)."
10465 #: ../fish/guestfish-actions.pod:2146 ../src/guestfs-actions.pod:3339
10467 "If it was not possible to get an icon this function returns a zero-length "
10468 "(non-NULL) buffer. I<Callers must check for this case>."
10472 #: ../fish/guestfish-actions.pod:2149 ../src/guestfs-actions.pod:3342
10474 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
10475 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
10476 "this file will be returned. You can disable favicons by passing the "
10477 "optional C<favicon> boolean as false (default is true)."
10481 #: ../fish/guestfish-actions.pod:2155 ../src/guestfs-actions.pod:3348
10483 "If finding the favicon fails, then we look in other places in the guest for "
10488 #: ../fish/guestfish-actions.pod:2158 ../src/guestfs-actions.pod:3351
10490 "If the optional C<highquality> boolean is true then only high quality icons "
10491 "are returned, which means only icons of high resolution with an alpha "
10492 "channel. The default (false) is to return any icon we can, even if it is of "
10493 "substandard quality."
10497 #: ../fish/guestfish-actions.pod:2169 ../src/guestfs-actions.pod:3362
10499 "Unlike most other inspection API calls, the guest's disks must be mounted up "
10500 "before you call this, since it needs to read information from the guest "
10501 "filesystem during the call."
10505 #: ../fish/guestfish-actions.pod:2175 ../src/guestfs-actions.pod:3368
10507 "B<Security:> The icon data comes from the untrusted guest, and should be "
10508 "treated with caution. PNG files have been known to contain exploits. "
10509 "Ensure that libpng (or other relevant libraries) are fully up to date before "
10510 "trying to process or display the icon."
10514 #: ../fish/guestfish-actions.pod:2183 ../src/guestfs-actions.pod:3376
10516 "The PNG image returned can be any size. It might not be square. Libguestfs "
10517 "tries to return the largest, highest quality icon available. The "
10518 "application must scale the icon to the required size."
10522 #: ../fish/guestfish-actions.pod:2190 ../src/guestfs-actions.pod:3383
10524 "Extracting icons from Windows guests requires the external C<wrestool> "
10525 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
10526 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
10527 "installed separately."
10531 #: ../fish/guestfish-actions.pod:2197 ../src/guestfs-actions.pod:3390
10533 "Operating system icons are usually trademarks. Seek legal advice before "
10534 "using trademarks in applications."
10538 #: ../fish/guestfish-actions.pod:2204
10539 msgid "inspect-get-major-version"
10543 #: ../fish/guestfish-actions.pod:2206
10546 " inspect-get-major-version root\n"
10551 #: ../fish/guestfish-actions.pod:2208 ../src/guestfs-actions.pod:3431
10552 msgid "This returns the major version number of the inspected operating system."
10556 #: ../fish/guestfish-actions.pod:2211 ../src/guestfs-actions.pod:3434
10558 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
10559 "popular public names used by the operating system. Notably the operating "
10560 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
10561 "1). You can find out the real versions corresponding to releases of Windows "
10562 "by consulting Wikipedia or MSDN."
10566 #: ../fish/guestfish-actions.pod:2218 ../fish/guestfish-actions.pod:2229 ../src/guestfs-actions.pod:3441 ../src/guestfs-actions.pod:3458
10567 msgid "If the version could not be determined, then C<0> is returned."
10571 #: ../fish/guestfish-actions.pod:2222
10572 msgid "inspect-get-minor-version"
10576 #: ../fish/guestfish-actions.pod:2224
10579 " inspect-get-minor-version root\n"
10584 #: ../fish/guestfish-actions.pod:2226 ../src/guestfs-actions.pod:3455
10585 msgid "This returns the minor version number of the inspected operating system."
10589 #: ../fish/guestfish-actions.pod:2231
10591 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10592 "L</inspect-get-major-version>."
10596 #: ../fish/guestfish-actions.pod:2234
10597 msgid "inspect-get-mountpoints"
10601 #: ../fish/guestfish-actions.pod:2236
10604 " inspect-get-mountpoints root\n"
10609 #: ../fish/guestfish-actions.pod:2238 ../src/guestfs-actions.pod:3473
10611 "This returns a hash of where we think the filesystems associated with this "
10612 "operating system should be mounted. Callers should note that this is at "
10613 "best an educated guess made by reading configuration files such as "
10614 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
10615 "are non-existent or not mountable and callers should be prepared to handle "
10616 "or ignore failures if they try to mount them."
10620 #: ../fish/guestfish-actions.pod:2247 ../src/guestfs-actions.pod:3482
10622 "Each element in the returned hashtable has a key which is the path of the "
10623 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
10624 "mounted there (eg. C</dev/sda1>)."
10628 #: ../fish/guestfish-actions.pod:2252 ../src/guestfs-actions.pod:3487
10629 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
10633 #: ../fish/guestfish-actions.pod:2255
10635 "For operating systems like Windows which still use drive letters, this call "
10636 "will only return an entry for the first drive \"mounted on\" C</>. For "
10637 "information about the mapping of drive letters to partitions, see "
10638 "L</inspect-get-drive-mappings>."
10642 #: ../fish/guestfish-actions.pod:2261
10644 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10645 "L</inspect-get-filesystems>."
10649 #: ../fish/guestfish-actions.pod:2264
10650 msgid "inspect-get-package-format"
10654 #: ../fish/guestfish-actions.pod:2266
10657 " inspect-get-package-format root\n"
10662 #: ../fish/guestfish-actions.pod:2268
10664 "This function and L</inspect-get-package-management> return the package "
10665 "format and package management tool used by the inspected operating system. "
10666 "For example for Fedora these functions would return C<rpm> (package format) "
10667 "and C<yum> (package management)."
10671 #: ../fish/guestfish-actions.pod:2274 ../src/guestfs-actions.pod:3519
10673 "This returns the string C<unknown> if we could not determine the package "
10674 "format I<or> if the operating system does not have a real packaging system "
10679 #: ../fish/guestfish-actions.pod:2278 ../src/guestfs-actions.pod:3523
10681 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
10682 "C<pkgsrc>. Future versions of libguestfs may return other strings."
10686 #: ../fish/guestfish-actions.pod:2284
10687 msgid "inspect-get-package-management"
10691 #: ../fish/guestfish-actions.pod:2286
10694 " inspect-get-package-management root\n"
10699 #: ../fish/guestfish-actions.pod:2288
10701 "L</inspect-get-package-format> and this function return the package format "
10702 "and package management tool used by the inspected operating system. For "
10703 "example for Fedora these functions would return C<rpm> (package format) and "
10704 "C<yum> (package management)."
10708 #: ../fish/guestfish-actions.pod:2294 ../src/guestfs-actions.pod:3546
10710 "This returns the string C<unknown> if we could not determine the package "
10711 "management tool I<or> if the operating system does not have a real packaging "
10712 "system (eg. Windows)."
10716 #: ../fish/guestfish-actions.pod:2298 ../src/guestfs-actions.pod:3550
10718 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
10719 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
10720 "versions of libguestfs may return other strings."
10724 #: ../fish/guestfish-actions.pod:2305
10725 msgid "inspect-get-product-name"
10729 #: ../fish/guestfish-actions.pod:2307
10732 " inspect-get-product-name root\n"
10737 #: ../fish/guestfish-actions.pod:2309 ../src/guestfs-actions.pod:3568
10739 "This returns the product name of the inspected operating system. The "
10740 "product name is generally some freeform string which can be displayed to the "
10741 "user, but should not be parsed by programs."
10745 #: ../fish/guestfish-actions.pod:2314 ../src/guestfs-actions.pod:3573
10747 "If the product name could not be determined, then the string C<unknown> is "
10752 #: ../fish/guestfish-actions.pod:2319
10753 msgid "inspect-get-product-variant"
10757 #: ../fish/guestfish-actions.pod:2321
10760 " inspect-get-product-variant root\n"
10765 #: ../fish/guestfish-actions.pod:2323 ../src/guestfs-actions.pod:3589
10766 msgid "This returns the product variant of the inspected operating system."
10770 #: ../fish/guestfish-actions.pod:2326 ../src/guestfs-actions.pod:3592
10772 "For Windows guests, this returns the contents of the Registry key "
10773 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
10774 "which is usually a string such as C<Client> or C<Server> (other values are "
10775 "possible). This can be used to distinguish consumer and enterprise versions "
10776 "of Windows that have the same version number (for example, Windows 7 and "
10777 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
10778 "the latter is C<Server>)."
10782 #: ../fish/guestfish-actions.pod:2335 ../src/guestfs-actions.pod:3601
10784 "For enterprise Linux guests, in future we intend this to return the product "
10785 "variant such as C<Desktop>, C<Server> and so on. But this is not "
10786 "implemented at present."
10790 #: ../fish/guestfish-actions.pod:2339 ../src/guestfs-actions.pod:3605
10792 "If the product variant could not be determined, then the string C<unknown> "
10797 #: ../fish/guestfish-actions.pod:2342
10799 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10800 "L</inspect-get-product-name>, L</inspect-get-major-version>."
10804 #: ../fish/guestfish-actions.pod:2346
10805 msgid "inspect-get-roots"
10809 #: ../fish/guestfish-actions.pod:2348
10812 " inspect-get-roots\n"
10817 #: ../fish/guestfish-actions.pod:2350
10819 "This function is a convenient way to get the list of root devices, as "
10820 "returned from a previous call to L</inspect-os>, but without redoing the "
10821 "whole inspection process."
10825 #: ../fish/guestfish-actions.pod:2354
10827 "This returns an empty list if either no root devices were found or the "
10828 "caller has not called L</inspect-os>."
10832 #: ../fish/guestfish-actions.pod:2359
10833 msgid "inspect-get-type"
10837 #: ../fish/guestfish-actions.pod:2361
10840 " inspect-get-type root\n"
10845 #: ../fish/guestfish-actions.pod:2363 ../src/guestfs-actions.pod:3643
10847 "This returns the type of the inspected operating system. Currently defined "
10852 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3648
10857 #: ../fish/guestfish-actions.pod:2370 ../src/guestfs-actions.pod:3650
10858 msgid "Any Linux-based operating system."
10862 #: ../fish/guestfish-actions.pod:2374 ../src/guestfs-actions.pod:3654
10863 msgid "Any Microsoft Windows operating system."
10867 #: ../fish/guestfish-actions.pod:2376 ../src/guestfs-actions.pod:3656
10868 msgid "\"freebsd\""
10872 #: ../fish/guestfish-actions.pod:2378 ../src/guestfs-actions.pod:3658
10877 #: ../fish/guestfish-actions.pod:2380 ../src/guestfs-actions.pod:3660
10882 #: ../fish/guestfish-actions.pod:2382 ../src/guestfs-actions.pod:3662
10887 #: ../fish/guestfish-actions.pod:2384 ../src/guestfs-actions.pod:3664
10892 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3666
10897 #: ../fish/guestfish-actions.pod:2390 ../src/guestfs-actions.pod:3670
10898 msgid "The operating system type could not be determined."
10902 #: ../fish/guestfish-actions.pod:2399
10903 msgid "inspect-get-windows-current-control-set"
10907 #: ../fish/guestfish-actions.pod:2401
10910 " inspect-get-windows-current-control-set root\n"
10915 #: ../fish/guestfish-actions.pod:2403 ../src/guestfs-actions.pod:3690
10917 "This returns the Windows CurrentControlSet of the inspected guest. The "
10918 "CurrentControlSet is a registry key name such as C<ControlSet001>."
10922 #: ../fish/guestfish-actions.pod:2406 ../src/guestfs-actions.pod:3693
10924 "This call assumes that the guest is Windows and that the Registry could be "
10925 "examined by inspection. If this is not the case then an error is returned."
10929 #: ../fish/guestfish-actions.pod:2412
10930 msgid "inspect-get-windows-systemroot"
10934 #: ../fish/guestfish-actions.pod:2414
10937 " inspect-get-windows-systemroot root\n"
10942 #: ../fish/guestfish-actions.pod:2416 ../src/guestfs-actions.pod:3710
10944 "This returns the Windows systemroot of the inspected guest. The systemroot "
10945 "is a directory path such as C</WINDOWS>."
10949 #: ../fish/guestfish-actions.pod:2419 ../src/guestfs-actions.pod:3713
10951 "This call assumes that the guest is Windows and that the systemroot could be "
10952 "determined by inspection. If this is not the case then an error is "
10957 #: ../fish/guestfish-actions.pod:2425
10958 msgid "inspect-is-live"
10962 #: ../fish/guestfish-actions.pod:2427
10965 " inspect-is-live root\n"
10970 #: ../fish/guestfish-actions.pod:2429
10972 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10973 "then this returns true if a live image was detected on the disk."
10977 #: ../fish/guestfish-actions.pod:2435
10978 msgid "inspect-is-multipart"
10982 #: ../fish/guestfish-actions.pod:2437
10985 " inspect-is-multipart root\n"
10990 #: ../fish/guestfish-actions.pod:2439
10992 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10993 "then this returns true if the disk is part of a set."
10997 #: ../fish/guestfish-actions.pod:2445
10998 msgid "inspect-is-netinst"
11002 #: ../fish/guestfish-actions.pod:2447
11005 " inspect-is-netinst root\n"
11010 #: ../fish/guestfish-actions.pod:2449
11012 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
11013 "then this returns true if the disk is a network installer, ie. not a "
11014 "self-contained install CD but one which is likely to require network access "
11015 "to complete the install."
11019 #: ../fish/guestfish-actions.pod:2457
11020 msgid "inspect-list-applications"
11024 #: ../fish/guestfish-actions.pod:2459
11027 " inspect-list-applications root\n"
11032 #: ../fish/guestfish-actions.pod:2461 ../src/guestfs-actions.pod:3780
11033 msgid "Return the list of applications installed in the operating system."
11037 #: ../fish/guestfish-actions.pod:2463
11039 "I<Note:> This call works differently from other parts of the inspection "
11040 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
11041 "then mount up the disks, before calling this. Listing applications is a "
11042 "significantly more difficult operation which requires access to the full "
11043 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
11044 "are just returning data cached in the libguestfs handle, this call actually "
11045 "reads parts of the mounted filesystems during the call."
11049 #: ../fish/guestfish-actions.pod:2473 ../src/guestfs-actions.pod:3792
11051 "This returns an empty list if the inspection code was not able to determine "
11052 "the list of applications."
11056 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3795
11057 msgid "The application structure contains the following fields:"
11061 #: ../fish/guestfish-actions.pod:2480 ../src/guestfs-actions.pod:3799
11062 msgid "C<app_name>"
11066 #: ../fish/guestfish-actions.pod:2482 ../src/guestfs-actions.pod:3801
11068 "The name of the application. For Red Hat-derived and Debian-derived Linux "
11069 "guests, this is the package name."
11073 #: ../fish/guestfish-actions.pod:2485 ../src/guestfs-actions.pod:3804
11074 msgid "C<app_display_name>"
11078 #: ../fish/guestfish-actions.pod:2487 ../src/guestfs-actions.pod:3806
11080 "The display name of the application, sometimes localized to the install "
11081 "language of the guest operating system."
11085 #: ../fish/guestfish-actions.pod:2490 ../src/guestfs-actions.pod:3809
11087 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
11088 "to display something can use C<app_name> instead."
11092 #: ../fish/guestfish-actions.pod:2493 ../src/guestfs-actions.pod:3812
11093 msgid "C<app_epoch>"
11097 #: ../fish/guestfish-actions.pod:2495 ../src/guestfs-actions.pod:3814
11099 "For package managers which use epochs, this contains the epoch of the "
11100 "package (an integer). If unavailable, this is returned as C<0>."
11104 #: ../fish/guestfish-actions.pod:2498 ../src/guestfs-actions.pod:3817
11105 msgid "C<app_version>"
11109 #: ../fish/guestfish-actions.pod:2500 ../src/guestfs-actions.pod:3819
11111 "The version string of the application or package. If unavailable this is "
11112 "returned as an empty string C<\"\">."
11116 #: ../fish/guestfish-actions.pod:2503 ../src/guestfs-actions.pod:3822
11117 msgid "C<app_release>"
11121 #: ../fish/guestfish-actions.pod:2505 ../src/guestfs-actions.pod:3824
11123 "The release string of the application or package, for package managers that "
11124 "use this. If unavailable this is returned as an empty string C<\"\">."
11128 #: ../fish/guestfish-actions.pod:2509 ../src/guestfs-actions.pod:3828
11129 msgid "C<app_install_path>"
11133 #: ../fish/guestfish-actions.pod:2511 ../src/guestfs-actions.pod:3830
11135 "The installation path of the application (on operating systems such as "
11136 "Windows which use installation paths). This path is in the format used by "
11137 "the guest operating system, it is not a libguestfs path."
11141 #: ../fish/guestfish-actions.pod:2516 ../src/guestfs-actions.pod:3835
11142 msgid "If unavailable this is returned as an empty string C<\"\">."
11146 #: ../fish/guestfish-actions.pod:2518 ../src/guestfs-actions.pod:3837
11147 msgid "C<app_trans_path>"
11151 #: ../fish/guestfish-actions.pod:2520 ../src/guestfs-actions.pod:3839
11153 "The install path translated into a libguestfs path. If unavailable this is "
11154 "returned as an empty string C<\"\">."
11158 #: ../fish/guestfish-actions.pod:2523 ../src/guestfs-actions.pod:3842
11159 msgid "C<app_publisher>"
11163 #: ../fish/guestfish-actions.pod:2525 ../src/guestfs-actions.pod:3844
11165 "The name of the publisher of the application, for package managers that use "
11166 "this. If unavailable this is returned as an empty string C<\"\">."
11170 #: ../fish/guestfish-actions.pod:2529 ../src/guestfs-actions.pod:3848
11175 #: ../fish/guestfish-actions.pod:2531 ../src/guestfs-actions.pod:3850
11177 "The URL (eg. upstream URL) of the application. If unavailable this is "
11178 "returned as an empty string C<\"\">."
11182 #: ../fish/guestfish-actions.pod:2534 ../src/guestfs-actions.pod:3853
11183 msgid "C<app_source_package>"
11187 #: ../fish/guestfish-actions.pod:2536 ../src/guestfs-actions.pod:3855
11189 "For packaging systems which support this, the name of the source package. "
11190 "If unavailable this is returned as an empty string C<\"\">."
11194 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3858
11195 msgid "C<app_summary>"
11199 #: ../fish/guestfish-actions.pod:2541 ../src/guestfs-actions.pod:3860
11201 "A short (usually one line) description of the application or package. If "
11202 "unavailable this is returned as an empty string C<\"\">."
11206 #: ../fish/guestfish-actions.pod:2544 ../src/guestfs-actions.pod:3863
11207 msgid "C<app_description>"
11211 #: ../fish/guestfish-actions.pod:2546 ../src/guestfs-actions.pod:3865
11213 "A longer description of the application or package. If unavailable this is "
11214 "returned as an empty string C<\"\">."
11218 #: ../fish/guestfish-actions.pod:2553
11223 #: ../fish/guestfish-actions.pod:2555
11231 #: ../fish/guestfish-actions.pod:2557 ../src/guestfs-actions.pod:3883
11233 "This function uses other libguestfs functions and certain heuristics to "
11234 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
11235 "for operating systems."
11239 #: ../fish/guestfish-actions.pod:2561 ../src/guestfs-actions.pod:3887
11240 msgid "The list returned is empty if no operating systems were found."
11244 #: ../fish/guestfish-actions.pod:2563 ../src/guestfs-actions.pod:3889
11246 "If one operating system was found, then this returns a list with a single "
11247 "element, which is the name of the root filesystem of this operating system. "
11248 "It is also possible for this function to return a list containing more than "
11249 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
11250 "element being the root filesystem of one of the operating systems."
11254 #: ../fish/guestfish-actions.pod:2570
11256 "You can pass the root string(s) returned to other L</inspect-get-*> "
11257 "functions in order to query further information about each operating system, "
11258 "such as the name and version."
11262 #: ../fish/guestfish-actions.pod:2575
11264 "This function uses other libguestfs features such as L</mount-ro> and "
11265 "L</umount-all> in order to mount and unmount filesystems and look at the "
11266 "contents. This should be called with no disks currently mounted. The "
11267 "function may also use Augeas, so any existing Augeas handle will be closed."
11271 #: ../fish/guestfish-actions.pod:2581 ../src/guestfs-actions.pod:3907
11273 "This function cannot decrypt encrypted disks. The caller must do that first "
11274 "(supplying the necessary keys) if the disk is encrypted."
11278 #: ../fish/guestfish-actions.pod:2587 ../fish/guestfish-actions.pod:2785 ../fish/guestfish-actions.pod:2850
11279 msgid "See also L</list-filesystems>."
11283 #: ../fish/guestfish-actions.pod:2589
11284 msgid "is-blockdev"
11288 #: ../fish/guestfish-actions.pod:2591
11291 " is-blockdev path\n"
11296 #: ../fish/guestfish-actions.pod:2593 ../src/guestfs-actions.pod:3927
11298 "This returns C<true> if and only if there is a block device with the given "
11303 #: ../fish/guestfish-actions.pod:2596 ../fish/guestfish-actions.pod:2614 ../fish/guestfish-actions.pod:2633 ../fish/guestfish-actions.pod:2642 ../fish/guestfish-actions.pod:2652 ../fish/guestfish-actions.pod:2686 ../fish/guestfish-actions.pod:2695
11304 msgid "See also L</stat>."
11308 #: ../fish/guestfish-actions.pod:2598
11313 #: ../fish/guestfish-actions.pod:2600
11321 #: ../fish/guestfish-actions.pod:2602 ../src/guestfs-actions.pod:3941
11323 "This returns true iff this handle is busy processing a command (in the "
11328 #: ../fish/guestfish-actions.pod:2607
11333 #: ../fish/guestfish-actions.pod:2609
11336 " is-chardev path\n"
11341 #: ../fish/guestfish-actions.pod:2611 ../src/guestfs-actions.pod:3956
11343 "This returns C<true> if and only if there is a character device with the "
11344 "given C<path> name."
11348 #: ../fish/guestfish-actions.pod:2616
11353 #: ../fish/guestfish-actions.pod:2618
11361 #: ../fish/guestfish-actions.pod:2620 ../src/guestfs-actions.pod:3970
11363 "This returns true iff this handle is being configured (in the C<CONFIG> "
11368 #: ../fish/guestfish-actions.pod:2625
11373 #: ../fish/guestfish-actions.pod:2627
11381 #: ../fish/guestfish-actions.pod:2629 ../src/guestfs-actions.pod:3985
11383 "This returns C<true> if and only if there is a directory with the given "
11384 "C<path> name. Note that it returns false for other objects like files."
11388 #: ../fish/guestfish-actions.pod:2635
11393 #: ../fish/guestfish-actions.pod:2637
11401 #: ../fish/guestfish-actions.pod:2639 ../src/guestfs-actions.pod:4001
11403 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
11404 "given C<path> name."
11408 #: ../fish/guestfish-actions.pod:2644
11413 #: ../fish/guestfish-actions.pod:2646
11421 #: ../fish/guestfish-actions.pod:2648 ../src/guestfs-actions.pod:4016
11423 "This returns C<true> if and only if there is a regular file with the given "
11424 "C<path> name. Note that it returns false for other objects like "
11429 #: ../fish/guestfish-actions.pod:2654
11430 msgid "is-launching"
11434 #: ../fish/guestfish-actions.pod:2656
11442 #: ../fish/guestfish-actions.pod:2658 ../src/guestfs-actions.pod:4031
11444 "This returns true iff this handle is launching the subprocess (in the "
11445 "C<LAUNCHING> state)."
11449 #: ../fish/guestfish-actions.pod:2663
11454 #: ../fish/guestfish-actions.pod:2665
11462 #: ../fish/guestfish-actions.pod:2667 ../src/guestfs-actions.pod:4046
11464 "This command tests whether C<device> is a logical volume, and returns true "
11465 "iff this is the case."
11469 #: ../fish/guestfish-actions.pod:2670
11474 #: ../fish/guestfish-actions.pod:2672
11482 #: ../fish/guestfish-actions.pod:2674 ../src/guestfs-actions.pod:4058
11484 "This returns true iff this handle is ready to accept commands (in the "
11489 #: ../fish/guestfish-actions.pod:2679
11494 #: ../fish/guestfish-actions.pod:2681
11497 " is-socket path\n"
11502 #: ../fish/guestfish-actions.pod:2683 ../src/guestfs-actions.pod:4073
11504 "This returns C<true> if and only if there is a Unix domain socket with the "
11505 "given C<path> name."
11509 #: ../fish/guestfish-actions.pod:2688
11514 #: ../fish/guestfish-actions.pod:2690
11517 " is-symlink path\n"
11522 #: ../fish/guestfish-actions.pod:2692 ../src/guestfs-actions.pod:4088
11524 "This returns C<true> if and only if there is a symbolic link with the given "
11529 #: ../fish/guestfish-actions.pod:2697
11534 #: ../fish/guestfish-actions.pod:2699
11542 #: ../fish/guestfish-actions.pod:2701 ../src/guestfs-actions.pod:4103
11544 "This returns true iff the file exists and the file is empty or it contains "
11549 #: ../fish/guestfish-actions.pod:2704
11550 msgid "is-zero-device"
11554 #: ../fish/guestfish-actions.pod:2706
11557 " is-zero-device device\n"
11562 #: ../fish/guestfish-actions.pod:2708 ../src/guestfs-actions.pod:4116
11563 msgid "This returns true iff the device exists and contains all zero bytes."
11567 #: ../fish/guestfish-actions.pod:2710 ../src/guestfs-actions.pod:4118
11568 msgid "Note that for large devices this can take a long time to run."
11572 #: ../fish/guestfish-actions.pod:2712
11573 msgid "kill-subprocess"
11577 #: ../fish/guestfish-actions.pod:2714
11580 " kill-subprocess\n"
11585 #: ../fish/guestfish-actions.pod:2716 ../src/guestfs-actions.pod:4129
11586 msgid "This kills the qemu subprocess. You should never need to call this."
11590 #: ../fish/guestfish-actions.pod:2718
11595 #: ../fish/guestfish-actions.pod:2720
11600 #: ../fish/guestfish-actions.pod:2722
11608 #: ../fish/guestfish-actions.pod:2724 ../src/guestfs-actions.pod:4140
11610 "Internally libguestfs is implemented by running a virtual machine using "
11615 #: ../fish/guestfish-actions.pod:2727 ../src/guestfs-actions.pod:4143
11617 "You should call this after configuring the handle (eg. adding drives) but "
11618 "before performing any actions."
11622 #: ../fish/guestfish-actions.pod:2730
11627 #: ../fish/guestfish-actions.pod:2732
11630 " lchown owner group path\n"
11635 #: ../fish/guestfish-actions.pod:2734
11637 "Change the file owner to C<owner> and group to C<group>. This is like "
11638 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
11643 #: ../fish/guestfish-actions.pod:2742
11648 #: ../fish/guestfish-actions.pod:2744
11651 " lgetxattr path name\n"
11656 #: ../fish/guestfish-actions.pod:2746 ../src/guestfs-actions.pod:4183
11658 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
11659 "is a symlink, then this call returns an extended attribute from the symlink."
11663 #: ../fish/guestfish-actions.pod:2760
11664 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
11668 #: ../fish/guestfish-actions.pod:2762
11673 #: ../fish/guestfish-actions.pod:2764
11676 " lgetxattrs path\n"
11681 #: ../fish/guestfish-actions.pod:2766
11683 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
11684 "it returns the extended attributes of the link itself."
11688 #: ../fish/guestfish-actions.pod:2770
11693 #: ../fish/guestfish-actions.pod:2772
11701 #: ../fish/guestfish-actions.pod:2774 ../src/guestfs-actions.pod:4226
11703 "List all 9p filesystems attached to the guest. A list of mount tags is "
11708 #: ../fish/guestfish-actions.pod:2777
11709 msgid "list-devices"
11713 #: ../fish/guestfish-actions.pod:2779
11721 #: ../fish/guestfish-actions.pod:2781 ../src/guestfs-actions.pod:4240
11722 msgid "List all the block devices."
11726 #: ../fish/guestfish-actions.pod:2783 ../src/guestfs-actions.pod:4242
11727 msgid "The full block device names are returned, eg. C</dev/sda>."
11731 #: ../fish/guestfish-actions.pod:2787
11732 msgid "list-dm-devices"
11736 #: ../fish/guestfish-actions.pod:2789
11739 " list-dm-devices\n"
11744 #: ../fish/guestfish-actions.pod:2791 ../src/guestfs-actions.pod:4257
11745 msgid "List all device mapper devices."
11749 #: ../fish/guestfish-actions.pod:2793
11751 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
11752 "previous call to L</luks-open>."
11756 #: ../fish/guestfish-actions.pod:2796
11758 "Device mapper devices which correspond to logical volumes are I<not> "
11759 "returned in this list. Call L</lvs> if you want to list logical volumes."
11763 #: ../fish/guestfish-actions.pod:2800
11764 msgid "list-filesystems"
11768 #: ../fish/guestfish-actions.pod:2802
11771 " list-filesystems\n"
11776 #: ../fish/guestfish-actions.pod:2804 ../src/guestfs-actions.pod:4277
11778 "This inspection command looks for filesystems on partitions, block devices "
11779 "and logical volumes, returning a list of devices containing filesystems and "
11784 #: ../fish/guestfish-actions.pod:2808 ../src/guestfs-actions.pod:4281
11786 "The return value is a hash, where the keys are the devices containing "
11787 "filesystems, and the values are the filesystem types. For example:"
11791 #: ../fish/guestfish-actions.pod:2812 ../src/guestfs-actions.pod:4285
11794 " \"/dev/sda1\" => \"ntfs\"\n"
11795 " \"/dev/sda2\" => \"ext2\"\n"
11796 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
11797 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
11802 #: ../fish/guestfish-actions.pod:2817 ../src/guestfs-actions.pod:4290
11804 "The value can have the special value \"unknown\", meaning the content of the "
11805 "device is undetermined or empty. \"swap\" means a Linux swap partition."
11809 #: ../fish/guestfish-actions.pod:2821
11811 "This command runs other libguestfs commands, which might include L</mount> "
11812 "and L</umount>, and therefore you should use this soon after launch and only "
11813 "when nothing is mounted."
11817 #: ../fish/guestfish-actions.pod:2825
11819 "Not all of the filesystems returned will be mountable. In particular, swap "
11820 "partitions are returned in the list. Also this command does not check that "
11821 "each filesystem found is valid and mountable, and some filesystems might be "
11822 "mountable but require special options. Filesystems may not all belong to a "
11823 "single logical operating system (use L</inspect-os> to look for OSes)."
11827 #: ../fish/guestfish-actions.pod:2833
11828 msgid "list-md-devices"
11832 #: ../fish/guestfish-actions.pod:2835
11835 " list-md-devices\n"
11840 #: ../fish/guestfish-actions.pod:2837 ../src/guestfs-actions.pod:4319
11841 msgid "List all Linux md devices."
11845 #: ../fish/guestfish-actions.pod:2839
11846 msgid "list-partitions"
11850 #: ../fish/guestfish-actions.pod:2841
11853 " list-partitions\n"
11858 #: ../fish/guestfish-actions.pod:2843 ../src/guestfs-actions.pod:4332
11859 msgid "List all the partitions detected on all block devices."
11863 #: ../fish/guestfish-actions.pod:2845 ../src/guestfs-actions.pod:4334
11864 msgid "The full partition device names are returned, eg. C</dev/sda1>"
11868 #: ../fish/guestfish-actions.pod:2847
11870 "This does not return logical volumes. For that you will need to call "
11875 #: ../fish/guestfish-actions.pod:2852
11880 #: ../fish/guestfish-actions.pod:2854
11888 #: ../fish/guestfish-actions.pod:2856 ../src/guestfs-actions.pod:4353
11890 "List the files in C<directory> (relative to the root directory, there is no "
11891 "cwd) in the format of 'ls -la'."
11895 #: ../fish/guestfish-actions.pod:2859 ../src/guestfs-actions.pod:4356
11897 "This command is mostly useful for interactive sessions. It is I<not> "
11898 "intended that you try to parse the output string."
11902 #: ../fish/guestfish-actions.pod:2862
11907 #: ../fish/guestfish-actions.pod:2864
11910 " ln target linkname\n"
11915 #: ../fish/guestfish-actions.pod:2866 ../src/guestfs-actions.pod:4371
11916 msgid "This command creates a hard link using the C<ln> command."
11920 #: ../fish/guestfish-actions.pod:2868
11925 #: ../fish/guestfish-actions.pod:2870
11928 " ln-f target linkname\n"
11933 #: ../fish/guestfish-actions.pod:2872 ../src/guestfs-actions.pod:4384
11935 "This command creates a hard link using the C<ln -f> command. The I<-f> "
11936 "option removes the link (C<linkname>) if it exists already."
11940 #: ../fish/guestfish-actions.pod:2875
11945 #: ../fish/guestfish-actions.pod:2877
11948 " ln-s target linkname\n"
11953 #: ../fish/guestfish-actions.pod:2879 ../src/guestfs-actions.pod:4398
11954 msgid "This command creates a symbolic link using the C<ln -s> command."
11958 #: ../fish/guestfish-actions.pod:2881
11963 #: ../fish/guestfish-actions.pod:2883
11966 " ln-sf target linkname\n"
11971 #: ../fish/guestfish-actions.pod:2885 ../src/guestfs-actions.pod:4411
11973 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
11974 "option removes the link (C<linkname>) if it exists already."
11978 #: ../fish/guestfish-actions.pod:2888
11979 msgid "lremovexattr"
11983 #: ../fish/guestfish-actions.pod:2890
11986 " lremovexattr xattr path\n"
11991 #: ../fish/guestfish-actions.pod:2892
11993 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
11994 "it removes an extended attribute of the link itself."
11998 #: ../fish/guestfish-actions.pod:2896
12003 #: ../fish/guestfish-actions.pod:2898
12011 #: ../fish/guestfish-actions.pod:2900 ../src/guestfs-actions.pod:4439
12013 "List the files in C<directory> (relative to the root directory, there is no "
12014 "cwd). The '.' and '..' entries are not returned, but hidden files are "
12019 #: ../fish/guestfish-actions.pod:2904
12021 "This command is mostly useful for interactive sessions. Programs should "
12022 "probably use L</readdir> instead."
12026 #: ../fish/guestfish-actions.pod:2907
12031 #: ../fish/guestfish-actions.pod:2909
12034 " lsetxattr xattr val vallen path\n"
12039 #: ../fish/guestfish-actions.pod:2911
12041 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
12042 "sets an extended attribute of the link itself."
12046 #: ../fish/guestfish-actions.pod:2915
12051 #: ../fish/guestfish-actions.pod:2917
12059 #: ../fish/guestfish-actions.pod:2919 ../fish/guestfish-actions.pod:4817 ../src/guestfs-actions.pod:4475 ../src/guestfs-actions.pod:7405
12060 msgid "Returns file information for the given C<path>."
12064 #: ../fish/guestfish-actions.pod:2921
12066 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
12067 "the link is stat-ed, not the file it refers to."
12071 #: ../fish/guestfish-actions.pod:2925 ../src/guestfs-actions.pod:4481
12072 msgid "This is the same as the C<lstat(2)> system call."
12076 #: ../fish/guestfish-actions.pod:2927
12081 #: ../fish/guestfish-actions.pod:2929
12084 " lstatlist path 'names ...'\n"
12089 #: ../fish/guestfish-actions.pod:2931
12091 "This call allows you to perform the L</lstat> operation on multiple files, "
12092 "where all files are in the directory C<path>. C<names> is the list of files "
12093 "from this directory."
12097 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4500
12099 "On return you get a list of stat structs, with a one-to-one correspondence "
12100 "to the C<names> list. If any name did not exist or could not be lstat'd, "
12101 "then the C<ino> field of that structure is set to C<-1>."
12105 #: ../fish/guestfish-actions.pod:2940
12107 "This call is intended for programs that want to efficiently list a directory "
12108 "contents without making many round-trips. See also L</lxattrlist> for a "
12109 "similarly efficient call for getting extended attributes. Very long "
12110 "directory listings might cause the protocol message size to be exceeded, "
12111 "causing this call to fail. The caller must split up such requests into "
12112 "smaller groups of names."
12116 #: ../fish/guestfish-actions.pod:2948
12117 msgid "luks-add-key"
12121 #: ../fish/guestfish-actions.pod:2950
12124 " luks-add-key device keyslot\n"
12129 #: ../fish/guestfish-actions.pod:2952 ../src/guestfs-actions.pod:4528
12131 "This command adds a new key on LUKS device C<device>. C<key> is any "
12132 "existing key, and is used to access the device. C<newkey> is the new key to "
12133 "add. C<keyslot> is the key slot that will be replaced."
12137 #: ../fish/guestfish-actions.pod:2957
12139 "Note that if C<keyslot> already contains a key, then this command will "
12140 "fail. You have to use L</luks-kill-slot> first to remove that key."
12144 #: ../fish/guestfish-actions.pod:2961 ../fish/guestfish-actions.pod:2983 ../fish/guestfish-actions.pod:2993 ../fish/guestfish-actions.pod:3004 ../fish/guestfish-actions.pod:3030 ../fish/guestfish-actions.pod:3040
12146 "This command has one or more key or passphrase parameters. Guestfish will "
12147 "prompt for these separately."
12151 #: ../fish/guestfish-actions.pod:2964
12156 #: ../fish/guestfish-actions.pod:2966
12159 " luks-close device\n"
12164 #: ../fish/guestfish-actions.pod:2968
12166 "This closes a LUKS device that was created earlier by L</luks-open> or "
12167 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
12168 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
12169 "underlying block device."
12173 #: ../fish/guestfish-actions.pod:2974
12174 msgid "luks-format"
12178 #: ../fish/guestfish-actions.pod:2976
12181 " luks-format device keyslot\n"
12186 #: ../fish/guestfish-actions.pod:2978 ../src/guestfs-actions.pod:4569
12188 "This command erases existing data on C<device> and formats the device as a "
12189 "LUKS encrypted device. C<key> is the initial key, which is added to key "
12190 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
12194 #: ../fish/guestfish-actions.pod:2986
12195 msgid "luks-format-cipher"
12199 #: ../fish/guestfish-actions.pod:2988
12202 " luks-format-cipher device keyslot cipher\n"
12207 #: ../fish/guestfish-actions.pod:2990
12209 "This command is the same as L</luks-format> but it also allows you to set "
12210 "the C<cipher> used."
12214 #: ../fish/guestfish-actions.pod:2996
12215 msgid "luks-kill-slot"
12219 #: ../fish/guestfish-actions.pod:2998
12222 " luks-kill-slot device keyslot\n"
12227 #: ../fish/guestfish-actions.pod:3000 ../src/guestfs-actions.pod:4610
12229 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
12230 "device C<device>. C<key> must be one of the I<other> keys."
12234 #: ../fish/guestfish-actions.pod:3007
12239 #: ../fish/guestfish-actions.pod:3009
12242 " luks-open device mapname\n"
12247 #: ../fish/guestfish-actions.pod:3011 ../src/guestfs-actions.pod:4630
12249 "This command opens a block device which has been encrypted according to the "
12250 "Linux Unified Key Setup (LUKS) standard."
12254 #: ../fish/guestfish-actions.pod:3014 ../src/guestfs-actions.pod:4633
12255 msgid "C<device> is the encrypted block device or partition."
12259 #: ../fish/guestfish-actions.pod:3016 ../src/guestfs-actions.pod:4635
12261 "The caller must supply one of the keys associated with the LUKS block "
12262 "device, in the C<key> parameter."
12266 #: ../fish/guestfish-actions.pod:3019 ../src/guestfs-actions.pod:4638
12268 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
12269 "writes to this block device are decrypted from and encrypted to the "
12270 "underlying C<device> respectively."
12274 #: ../fish/guestfish-actions.pod:3023
12276 "If this block device contains LVM volume groups, then calling L</vgscan> "
12277 "followed by L</vg-activate-all> will make them visible."
12281 #: ../fish/guestfish-actions.pod:3027
12282 msgid "Use L</list-dm-devices> to list all device mapper devices."
12286 #: ../fish/guestfish-actions.pod:3033
12287 msgid "luks-open-ro"
12291 #: ../fish/guestfish-actions.pod:3035
12294 " luks-open-ro device mapname\n"
12299 #: ../fish/guestfish-actions.pod:3037
12301 "This is the same as L</luks-open> except that a read-only mapping is "
12306 #: ../fish/guestfish-actions.pod:3043
12311 #: ../fish/guestfish-actions.pod:3045
12314 " lvcreate logvol volgroup mbytes\n"
12319 #: ../fish/guestfish-actions.pod:3047 ../src/guestfs-actions.pod:4684
12321 "This creates an LVM logical volume called C<logvol> on the volume group "
12322 "C<volgroup>, with C<size> megabytes."
12326 #: ../fish/guestfish-actions.pod:3050
12327 msgid "lvm-canonical-lv-name"
12331 #: ../fish/guestfish-actions.pod:3052
12334 " lvm-canonical-lv-name lvname\n"
12339 #: ../fish/guestfish-actions.pod:3054 ../src/guestfs-actions.pod:4697
12341 "This converts alternative naming schemes for LVs that you might find to the "
12342 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
12347 #: ../fish/guestfish-actions.pod:3058 ../src/guestfs-actions.pod:4701
12349 "This command returns an error if the C<lvname> parameter does not refer to a "
12354 #: ../fish/guestfish-actions.pod:3061
12355 msgid "See also L</is-lv>."
12359 #: ../fish/guestfish-actions.pod:3063
12360 msgid "lvm-clear-filter"
12364 #: ../fish/guestfish-actions.pod:3065
12367 " lvm-clear-filter\n"
12372 #: ../fish/guestfish-actions.pod:3067
12374 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
12379 #: ../fish/guestfish-actions.pod:3070 ../fish/guestfish-actions.pod:3098 ../src/guestfs-actions.pod:4719 ../src/guestfs-actions.pod:4758
12380 msgid "This command also clears the LVM cache and performs a volume group scan."
12384 #: ../fish/guestfish-actions.pod:3073
12385 msgid "lvm-remove-all"
12389 #: ../fish/guestfish-actions.pod:3075
12392 " lvm-remove-all\n"
12397 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4731
12399 "This command removes all LVM logical volumes, volume groups and physical "
12404 #: ../fish/guestfish-actions.pod:3080
12405 msgid "lvm-set-filter"
12409 #: ../fish/guestfish-actions.pod:3082
12412 " lvm-set-filter 'devices ...'\n"
12417 #: ../fish/guestfish-actions.pod:3084 ../src/guestfs-actions.pod:4744
12419 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
12420 "block devices in the list C<devices>, and will ignore all other attached "
12425 #: ../fish/guestfish-actions.pod:3088 ../src/guestfs-actions.pod:4748
12427 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
12428 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
12429 "there are two types of duplication possible: either cloned PVs/VGs which "
12430 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
12431 "same name. In normal operation you cannot create this situation, but you "
12432 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
12433 "inside the LVM metadata."
12437 #: ../fish/guestfish-actions.pod:3101 ../src/guestfs-actions.pod:4761
12438 msgid "You can filter whole block devices or individual partitions."
12442 #: ../fish/guestfish-actions.pod:3103 ../src/guestfs-actions.pod:4763
12444 "You cannot use this if any VG is currently in use (eg. contains a mounted "
12445 "filesystem), even if you are not filtering out that VG."
12449 #: ../fish/guestfish-actions.pod:3107
12454 #: ../fish/guestfish-actions.pod:3109
12457 " lvremove device\n"
12462 #: ../fish/guestfish-actions.pod:3111 ../src/guestfs-actions.pod:4777
12464 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
12465 "LV, such as C</dev/VG/LV>."
12469 #: ../fish/guestfish-actions.pod:3114 ../src/guestfs-actions.pod:4780
12471 "You can also remove all LVs in a volume group by specifying the VG name, "
12476 #: ../fish/guestfish-actions.pod:3117
12481 #: ../fish/guestfish-actions.pod:3119
12484 " lvrename logvol newlogvol\n"
12489 #: ../fish/guestfish-actions.pod:3121 ../src/guestfs-actions.pod:4794
12490 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
12494 #: ../fish/guestfish-actions.pod:3123
12499 #: ../fish/guestfish-actions.pod:3125
12502 " lvresize device mbytes\n"
12507 #: ../fish/guestfish-actions.pod:3127 ../src/guestfs-actions.pod:4807
12509 "This resizes (expands or shrinks) an existing LVM logical volume to "
12510 "C<mbytes>. When reducing, data in the reduced part is lost."
12514 #: ../fish/guestfish-actions.pod:3131
12515 msgid "lvresize-free"
12519 #: ../fish/guestfish-actions.pod:3133
12522 " lvresize-free lv percent\n"
12527 #: ../fish/guestfish-actions.pod:3135 ../src/guestfs-actions.pod:4822
12529 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
12530 "remaining free space in the volume group. Commonly you would call this with "
12531 "pc = 100 which expands the logical volume as much as possible, using all "
12532 "remaining free space in the volume group."
12536 #: ../fish/guestfish-actions.pod:3141
12541 #: ../fish/guestfish-actions.pod:3143
12549 #: ../fish/guestfish-actions.pod:3145 ../src/guestfs-actions.pod:4837
12551 "List all the logical volumes detected. This is the equivalent of the "
12552 "L<lvs(8)> command."
12556 #: ../fish/guestfish-actions.pod:3148 ../src/guestfs-actions.pod:4840
12558 "This returns a list of the logical volume device names "
12559 "(eg. C</dev/VolGroup00/LogVol00>)."
12563 #: ../fish/guestfish-actions.pod:3151
12564 msgid "See also L</lvs-full>, L</list-filesystems>."
12568 #: ../fish/guestfish-actions.pod:3153
12573 #: ../fish/guestfish-actions.pod:3155
12581 #: ../fish/guestfish-actions.pod:3157 ../src/guestfs-actions.pod:4856
12583 "List all the logical volumes detected. This is the equivalent of the "
12584 "L<lvs(8)> command. The \"full\" version includes all fields."
12588 #: ../fish/guestfish-actions.pod:3160
12593 #: ../fish/guestfish-actions.pod:3162
12601 #: ../fish/guestfish-actions.pod:3164 ../src/guestfs-actions.pod:4871
12602 msgid "This command returns the UUID of the LVM LV C<device>."
12606 #: ../fish/guestfish-actions.pod:3166
12611 #: ../fish/guestfish-actions.pod:3168
12614 " lxattrlist path 'names ...'\n"
12619 #: ../fish/guestfish-actions.pod:3170 ../src/guestfs-actions.pod:4885
12621 "This call allows you to get the extended attributes of multiple files, where "
12622 "all files are in the directory C<path>. C<names> is the list of files from "
12627 #: ../fish/guestfish-actions.pod:3174 ../src/guestfs-actions.pod:4889
12629 "On return you get a flat list of xattr structs which must be interpreted "
12630 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
12631 "C<attrval> in this struct is zero-length to indicate there was an error "
12632 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
12633 "number (the number of following attributes for this file, which could be "
12634 "C<\"0\">). Then after the first xattr struct are the zero or more "
12635 "attributes for the first named file. This repeats for the second and "
12636 "subsequent files."
12640 #: ../fish/guestfish-actions.pod:3184
12642 "This call is intended for programs that want to efficiently list a directory "
12643 "contents without making many round-trips. See also L</lstatlist> for a "
12644 "similarly efficient call for getting standard stats. Very long directory "
12645 "listings might cause the protocol message size to be exceeded, causing this "
12646 "call to fail. The caller must split up such requests into smaller groups of "
12651 #: ../fish/guestfish-actions.pod:3192
12656 #: ../fish/guestfish-actions.pod:3194
12659 " md-create name 'devices ...' [missingbitmap:N] [nrdevices:N] [spare:N] "
12660 "[chunk:N] [level:..]\n"
12665 #: ../fish/guestfish-actions.pod:3196 ../src/guestfs-actions.pod:4932
12667 "Create a Linux md (RAID) device named C<name> on the devices in the list "
12672 #: ../fish/guestfish-actions.pod:3203 ../src/guestfs-actions.pod:4939
12673 msgid "C<missingbitmap>"
12677 #: ../fish/guestfish-actions.pod:3205 ../src/guestfs-actions.pod:4941
12679 "A bitmap of missing devices. If a bit is set it means that a missing device "
12680 "is added to the array. The least significant bit corresponds to the first "
12681 "device in the array."
12685 #: ../fish/guestfish-actions.pod:3209 ../src/guestfs-actions.pod:4945
12686 msgid "As examples:"
12690 #: ../fish/guestfish-actions.pod:3211 ../src/guestfs-actions.pod:4947
12692 "If C<devices = [\"/dev/sda\"]> and C<missingbitmap = 0x1> then the resulting "
12693 "array would be C<[E<lt>missingE<gt>, \"/dev/sda\"]>."
12697 #: ../fish/guestfish-actions.pod:3214 ../src/guestfs-actions.pod:4950
12699 "If C<devices = [\"/dev/sda\"]> and C<missingbitmap = 0x2> then the resulting "
12700 "array would be C<[\"/dev/sda\", E<lt>missingE<gt>]>."
12704 #: ../fish/guestfish-actions.pod:3217 ../src/guestfs-actions.pod:4953
12705 msgid "This defaults to C<0> (no missing devices)."
12709 #: ../fish/guestfish-actions.pod:3219 ../src/guestfs-actions.pod:4955
12711 "The length of C<devices> + the number of bits set in C<missingbitmap> must "
12712 "equal C<nrdevices> + C<spare>."
12716 #: ../fish/guestfish-actions.pod:3222 ../src/guestfs-actions.pod:4958
12717 msgid "C<nrdevices>"
12721 #: ../fish/guestfish-actions.pod:3224 ../src/guestfs-actions.pod:4960
12722 msgid "The number of active RAID devices."
12726 #: ../fish/guestfish-actions.pod:3226 ../src/guestfs-actions.pod:4962
12728 "If not set, this defaults to the length of C<devices> plus the number of "
12729 "bits set in C<missingbitmap>."
12733 #: ../fish/guestfish-actions.pod:3229 ../src/guestfs-actions.pod:4965
12738 #: ../fish/guestfish-actions.pod:3231 ../src/guestfs-actions.pod:4967
12739 msgid "The number of spare devices."
12743 #: ../fish/guestfish-actions.pod:3233 ../src/guestfs-actions.pod:4969
12744 msgid "If not set, this defaults to C<0>."
12748 #: ../fish/guestfish-actions.pod:3235 ../src/guestfs-actions.pod:4971
12753 #: ../fish/guestfish-actions.pod:3237 ../src/guestfs-actions.pod:4973
12754 msgid "The chunk size in bytes."
12758 #: ../fish/guestfish-actions.pod:3239 ../fish/guestfish-actions.pod:3261 ../src/guestfs-actions.pod:4975 ../src/guestfs-actions.pod:5023
12763 #: ../fish/guestfish-actions.pod:3241 ../src/guestfs-actions.pod:4977
12765 "The RAID level, which can be one of: I<linear>, I<raid0>, I<0>, I<stripe>, "
12766 "I<raid1>, I<1>, I<mirror>, I<raid4>, I<4>, I<raid5>, I<5>, I<raid6>, I<6>, "
12767 "I<raid10>, I<10>. Some of these are synonymous, and more levels may be "
12772 #: ../fish/guestfish-actions.pod:3246 ../src/guestfs-actions.pod:4982
12773 msgid "If not set, this defaults to C<raid1>."
12777 #: ../fish/guestfish-actions.pod:3252
12782 #: ../fish/guestfish-actions.pod:3254
12790 #: ../fish/guestfish-actions.pod:3256 ../src/guestfs-actions.pod:5018
12792 "This command exposes the output of 'mdadm -DY <md>'. The following fields "
12793 "are usually present in the returned hash. Other fields may also be present."
12797 #: ../fish/guestfish-actions.pod:3263 ../src/guestfs-actions.pod:5025
12798 msgid "The raid level of the MD device."
12802 #: ../fish/guestfish-actions.pod:3265 ../src/guestfs-actions.pod:5027
12807 #: ../fish/guestfish-actions.pod:3267 ../src/guestfs-actions.pod:5029
12808 msgid "The number of underlying devices in the MD device."
12812 #: ../fish/guestfish-actions.pod:3269 ../src/guestfs-actions.pod:5031
12813 msgid "C<metadata>"
12817 #: ../fish/guestfish-actions.pod:3271 ../src/guestfs-actions.pod:5033
12818 msgid "The metadata version used."
12822 #: ../fish/guestfish-actions.pod:3273 ../src/guestfs-actions.pod:5035
12827 #: ../fish/guestfish-actions.pod:3275 ../src/guestfs-actions.pod:5037
12828 msgid "The UUID of the MD device."
12832 #: ../fish/guestfish-actions.pod:3279 ../src/guestfs-actions.pod:5041
12833 msgid "The name of the MD device."
12837 #: ../fish/guestfish-actions.pod:3283
12842 #: ../fish/guestfish-actions.pod:3285
12850 #: ../fish/guestfish-actions.pod:3287 ../src/guestfs-actions.pod:5057
12852 "This command deactivates the MD array named C<md>. The device is stopped, "
12853 "but it is not destroyed or zeroed."
12857 #: ../fish/guestfish-actions.pod:3290
12862 #: ../fish/guestfish-actions.pod:3292
12870 #: ../fish/guestfish-actions.pod:3294 ../src/guestfs-actions.pod:5068
12871 msgid "Create a directory named C<path>."
12875 #: ../fish/guestfish-actions.pod:3296
12880 #: ../fish/guestfish-actions.pod:3298
12883 " mkdir-mode path mode\n"
12888 #: ../fish/guestfish-actions.pod:3300 ../src/guestfs-actions.pod:5081
12890 "This command creates a directory, setting the initial permissions of the "
12891 "directory to C<mode>."
12895 #: ../fish/guestfish-actions.pod:3303 ../src/guestfs-actions.pod:5084
12897 "For common Linux filesystems, the actual mode which is set will be C<mode & "
12898 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
12903 #: ../fish/guestfish-actions.pod:3307
12904 msgid "See also L</mkdir>, L</umask>"
12908 #: ../fish/guestfish-actions.pod:3309
12913 #: ../fish/guestfish-actions.pod:3311
12921 #: ../fish/guestfish-actions.pod:3313 ../src/guestfs-actions.pod:5100
12923 "Create a directory named C<path>, creating any parent directories as "
12924 "necessary. This is like the C<mkdir -p> shell command."
12928 #: ../fish/guestfish-actions.pod:3316
12933 #: ../fish/guestfish-actions.pod:3318
12936 " mkdtemp template\n"
12941 #: ../fish/guestfish-actions.pod:3320 ../src/guestfs-actions.pod:5113
12943 "This command creates a temporary directory. The C<template> parameter "
12944 "should be a full pathname for the temporary directory name with the final "
12945 "six characters being \"XXXXXX\"."
12949 #: ../fish/guestfish-actions.pod:3325 ../src/guestfs-actions.pod:5118
12951 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
12952 "being suitable for Windows filesystems."
12956 #: ../fish/guestfish-actions.pod:3328 ../src/guestfs-actions.pod:5121
12957 msgid "The name of the temporary directory that was created is returned."
12961 #: ../fish/guestfish-actions.pod:3331 ../src/guestfs-actions.pod:5124
12962 msgid "The temporary directory is created with mode 0700 and is owned by root."
12966 #: ../fish/guestfish-actions.pod:3334 ../src/guestfs-actions.pod:5127
12968 "The caller is responsible for deleting the temporary directory and its "
12969 "contents after use."
12973 #: ../fish/guestfish-actions.pod:3337 ../src/guestfs-actions.pod:5130
12974 msgid "See also: L<mkdtemp(3)>"
12978 #: ../fish/guestfish-actions.pod:3339
12983 #: ../fish/guestfish-actions.pod:3341
12986 " mke2fs-J fstype blocksize device journal\n"
12991 #: ../fish/guestfish-actions.pod:3343 ../src/guestfs-actions.pod:5146
12993 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12994 "C<journal>. It is equivalent to the command:"
12998 #: ../fish/guestfish-actions.pod:3347 ../src/guestfs-actions.pod:5150
13001 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
13006 #: ../fish/guestfish-actions.pod:3349
13007 msgid "See also L</mke2journal>."
13011 #: ../fish/guestfish-actions.pod:3351
13016 #: ../fish/guestfish-actions.pod:3353
13019 " mke2fs-JL fstype blocksize device label\n"
13024 #: ../fish/guestfish-actions.pod:3355 ../src/guestfs-actions.pod:5167
13026 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
13027 "the journal labeled C<label>."
13031 #: ../fish/guestfish-actions.pod:3358
13032 msgid "See also L</mke2journal-L>."
13036 #: ../fish/guestfish-actions.pod:3360
13041 #: ../fish/guestfish-actions.pod:3362
13044 " mke2fs-JU fstype blocksize device uuid\n"
13049 #: ../fish/guestfish-actions.pod:3364 ../src/guestfs-actions.pod:5185
13051 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
13052 "the journal with UUID C<uuid>."
13056 #: ../fish/guestfish-actions.pod:3367
13057 msgid "See also L</mke2journal-U>."
13061 #: ../fish/guestfish-actions.pod:3369
13062 msgid "mke2journal"
13066 #: ../fish/guestfish-actions.pod:3371
13069 " mke2journal blocksize device\n"
13074 #: ../fish/guestfish-actions.pod:3373 ../src/guestfs-actions.pod:5201
13076 "This creates an ext2 external journal on C<device>. It is equivalent to the "
13081 #: ../fish/guestfish-actions.pod:3376 ../src/guestfs-actions.pod:5204
13084 " mke2fs -O journal_dev -b blocksize device\n"
13089 #: ../fish/guestfish-actions.pod:3378
13090 msgid "mke2journal-L"
13094 #: ../fish/guestfish-actions.pod:3380
13097 " mke2journal-L blocksize label device\n"
13102 #: ../fish/guestfish-actions.pod:3382 ../src/guestfs-actions.pod:5218
13103 msgid "This creates an ext2 external journal on C<device> with label C<label>."
13107 #: ../fish/guestfish-actions.pod:3384
13108 msgid "mke2journal-U"
13112 #: ../fish/guestfish-actions.pod:3386
13115 " mke2journal-U blocksize uuid device\n"
13120 #: ../fish/guestfish-actions.pod:3388 ../src/guestfs-actions.pod:5232
13121 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
13125 #: ../fish/guestfish-actions.pod:3390
13130 #: ../fish/guestfish-actions.pod:3392
13133 " mkfifo mode path\n"
13138 #: ../fish/guestfish-actions.pod:3394
13140 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
13141 "is just a convenient wrapper around L</mknod>."
13145 #: ../fish/guestfish-actions.pod:3400
13150 #: ../fish/guestfish-actions.pod:3402
13153 " mkfs fstype device\n"
13158 #: ../fish/guestfish-actions.pod:3404 ../src/guestfs-actions.pod:5262
13160 "This creates a filesystem on C<device> (usually a partition or LVM logical "
13161 "volume). The filesystem type is C<fstype>, for example C<ext3>."
13165 #: ../fish/guestfish-actions.pod:3408
13170 #: ../fish/guestfish-actions.pod:3410
13173 " mkfs-b fstype blocksize device\n"
13178 #: ../fish/guestfish-actions.pod:3412
13180 "This call is similar to L</mkfs>, but it allows you to control the block "
13181 "size of the resulting filesystem. Supported block sizes depend on the "
13182 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
13186 #: ../fish/guestfish-actions.pod:3417 ../fish/guestfish-actions.pod:3444 ../src/guestfs-actions.pod:5290 ../src/guestfs-actions.pod:5328
13188 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
13193 #: ../fish/guestfish-actions.pod:3420
13195 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
13200 #: ../fish/guestfish-actions.pod:3427
13205 #: ../fish/guestfish-actions.pod:3429
13208 " mkfs-opts fstype device [blocksize:N] [features:..] [inode:N] "
13214 #: ../fish/guestfish-actions.pod:3431 ../src/guestfs-actions.pod:5315
13216 "This function creates a filesystem on C<device>. The filesystem type is "
13217 "C<fstype>, for example C<ext3>."
13221 #: ../fish/guestfish-actions.pod:3438 ../src/guestfs-actions.pod:5322
13222 msgid "C<blocksize>"
13226 #: ../fish/guestfish-actions.pod:3440 ../src/guestfs-actions.pod:5324
13228 "The filesystem block size. Supported block sizes depend on the filesystem "
13229 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
13234 #: ../fish/guestfish-actions.pod:3447 ../src/guestfs-actions.pod:5331
13235 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
13239 #: ../fish/guestfish-actions.pod:3449 ../src/guestfs-actions.pod:5333
13240 msgid "C<features>"
13244 #: ../fish/guestfish-actions.pod:3451 ../src/guestfs-actions.pod:5335
13245 msgid "This passes the I<-O> parameter to the external mkfs program."
13249 #: ../fish/guestfish-actions.pod:3453 ../src/guestfs-actions.pod:5337
13251 "For certain filesystem types, this allows extra filesystem features to be "
13252 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
13256 #: ../fish/guestfish-actions.pod:3457 ../src/guestfs-actions.pod:5341
13258 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
13263 #: ../fish/guestfish-actions.pod:3460 ../src/guestfs-actions.pod:5344
13268 #: ../fish/guestfish-actions.pod:3462 ../src/guestfs-actions.pod:5346
13270 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
13271 "sets the inode size (only for ext2/3/4 filesystems at present)."
13275 #: ../fish/guestfish-actions.pod:3465 ../src/guestfs-actions.pod:5349
13276 msgid "C<sectorsize>"
13280 #: ../fish/guestfish-actions.pod:3467 ../src/guestfs-actions.pod:5351
13282 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
13283 "sets sector size for ufs filesystem."
13287 #: ../fish/guestfish-actions.pod:3474
13288 msgid "mkmountpoint"
13292 #: ../fish/guestfish-actions.pod:3476
13295 " mkmountpoint exemptpath\n"
13300 #: ../fish/guestfish-actions.pod:3478
13302 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
13303 "to create extra mountpoints before mounting the first filesystem."
13307 #: ../fish/guestfish-actions.pod:3482 ../src/guestfs-actions.pod:5394
13309 "These calls are I<only> necessary in some very limited circumstances, mainly "
13310 "the case where you want to mount a mix of unrelated and/or read-only "
13311 "filesystems together."
13315 #: ../fish/guestfish-actions.pod:3486 ../src/guestfs-actions.pod:5398
13317 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
13318 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
13319 "inside that. You can unpack this as follows in guestfish:"
13323 #: ../fish/guestfish-actions.pod:3491 ../src/guestfs-actions.pod:5403
13326 " add-ro Fedora-11-i686-Live.iso\n"
13328 " mkmountpoint /cd\n"
13329 " mkmountpoint /sqsh\n"
13330 " mkmountpoint /ext3fs\n"
13331 " mount /dev/sda /cd\n"
13332 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
13333 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
13338 #: ../fish/guestfish-actions.pod:3500 ../src/guestfs-actions.pod:5412
13339 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
13343 #: ../fish/guestfish-actions.pod:3502
13345 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
13346 "unexpected errors if you try to mix these calls. It is safest to manually "
13347 "unmount filesystems and remove mountpoints after use."
13351 #: ../fish/guestfish-actions.pod:3506
13353 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
13354 "for this to work for manual mountpoints, you must ensure that the innermost "
13355 "mountpoints have the longest pathnames, as in the example code above."
13359 #: ../fish/guestfish-actions.pod:3511 ../src/guestfs-actions.pod:5423
13360 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
13364 #: ../fish/guestfish-actions.pod:3513
13366 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
13367 "L</umount-all> to be called when the handle is closed which can also trigger "
13372 #: ../fish/guestfish-actions.pod:3517
13377 #: ../fish/guestfish-actions.pod:3519
13380 " mknod mode devmajor devminor path\n"
13385 #: ../fish/guestfish-actions.pod:3521 ../src/guestfs-actions.pod:5442
13387 "This call creates block or character special devices, or named pipes "
13392 #: ../fish/guestfish-actions.pod:3524 ../src/guestfs-actions.pod:5445
13394 "The C<mode> parameter should be the mode, using the standard constants. "
13395 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
13396 "used when creating block and character special devices."
13400 #: ../fish/guestfish-actions.pod:3529
13402 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
13403 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
13404 "regular file). These constants are available in the standard Linux header "
13405 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
13406 "wrappers around this command which bitwise OR in the appropriate constant "
13411 #: ../fish/guestfish-actions.pod:3539
13416 #: ../fish/guestfish-actions.pod:3541
13419 " mknod-b mode devmajor devminor path\n"
13424 #: ../fish/guestfish-actions.pod:3543
13426 "This call creates a block device node called C<path> with mode C<mode> and "
13427 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
13428 "wrapper around L</mknod>."
13432 #: ../fish/guestfish-actions.pod:3549
13437 #: ../fish/guestfish-actions.pod:3551
13440 " mknod-c mode devmajor devminor path\n"
13445 #: ../fish/guestfish-actions.pod:3553
13447 "This call creates a char device node called C<path> with mode C<mode> and "
13448 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
13449 "wrapper around L</mknod>."
13453 #: ../fish/guestfish-actions.pod:3559
13458 #: ../fish/guestfish-actions.pod:3561
13466 #: ../fish/guestfish-actions.pod:3563 ../src/guestfs-actions.pod:5508
13467 msgid "Create a swap partition on C<device>."
13471 #: ../fish/guestfish-actions.pod:3565
13476 #: ../fish/guestfish-actions.pod:3567
13479 " mkswap-L label device\n"
13484 #: ../fish/guestfish-actions.pod:3569 ../src/guestfs-actions.pod:5521
13485 msgid "Create a swap partition on C<device> with label C<label>."
13489 #: ../fish/guestfish-actions.pod:3571 ../src/guestfs-actions.pod:5523
13491 "Note that you cannot attach a swap label to a block device "
13492 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
13493 "the kernel or swap tools."
13497 #: ../fish/guestfish-actions.pod:3575
13502 #: ../fish/guestfish-actions.pod:3577
13505 " mkswap-U uuid device\n"
13510 #: ../fish/guestfish-actions.pod:3579 ../src/guestfs-actions.pod:5538
13511 msgid "Create a swap partition on C<device> with UUID C<uuid>."
13515 #: ../fish/guestfish-actions.pod:3581
13516 msgid "mkswap-file"
13520 #: ../fish/guestfish-actions.pod:3583
13523 " mkswap-file path\n"
13528 #: ../fish/guestfish-actions.pod:3585 ../src/guestfs-actions.pod:5550
13529 msgid "Create a swap file."
13533 #: ../fish/guestfish-actions.pod:3587
13535 "This command just writes a swap file signature to an existing file. To "
13536 "create the file itself, use something like L</fallocate>."
13540 #: ../fish/guestfish-actions.pod:3590
13545 #: ../fish/guestfish-actions.pod:3592
13548 " modprobe modulename\n"
13553 #: ../fish/guestfish-actions.pod:3594 ../src/guestfs-actions.pod:5565
13554 msgid "This loads a kernel module in the appliance."
13558 #: ../fish/guestfish-actions.pod:3596 ../src/guestfs-actions.pod:5567
13560 "The kernel module must have been whitelisted when libguestfs was built (see "
13561 "C<appliance/kmod.whitelist.in> in the source)."
13565 #: ../fish/guestfish-actions.pod:3599
13570 #: ../fish/guestfish-actions.pod:3601
13573 " mount device mountpoint\n"
13578 #: ../fish/guestfish-actions.pod:3603 ../src/guestfs-actions.pod:5581
13580 "Mount a guest disk at a position in the filesystem. Block devices are named "
13581 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
13582 "those block devices contain partitions, they will have the usual names "
13583 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
13587 #: ../fish/guestfish-actions.pod:3609 ../src/guestfs-actions.pod:5587
13589 "The rules are the same as for L<mount(2)>: A filesystem must first be "
13590 "mounted on C</> before others can be mounted. Other filesystems can only be "
13591 "mounted on directories which already exist."
13595 #: ../fish/guestfish-actions.pod:3614 ../src/guestfs-actions.pod:5592
13597 "The mounted filesystem is writable, if we have sufficient permissions on the "
13598 "underlying device."
13602 #: ../fish/guestfish-actions.pod:3617
13604 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
13605 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
13606 "problems for users. If your program might need to work with older versions "
13607 "of libguestfs, use L</mount-options> instead (using an empty string for the "
13608 "first parameter if you don't want any options)."
13612 #: ../fish/guestfish-actions.pod:3624
13617 #: ../fish/guestfish-actions.pod:3626
13620 " mount-9p mounttag mountpoint [options:..]\n"
13625 #: ../fish/guestfish-actions.pod:3628 ../src/guestfs-actions.pod:5621
13627 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
13632 #: ../fish/guestfish-actions.pod:3631 ../src/guestfs-actions.pod:5624
13634 "If required, C<trans=virtio> will be automatically added to the options. "
13635 "Any other options required can be passed in the optional C<options> "
13640 #: ../fish/guestfish-actions.pod:3637
13645 #: ../fish/guestfish-actions.pod:3639
13648 " mount-loop file mountpoint\n"
13653 #: ../fish/guestfish-actions.pod:3641 ../src/guestfs-actions.pod:5663
13655 "This command lets you mount C<file> (a filesystem image in a file) on a "
13656 "mount point. It is entirely equivalent to the command C<mount -o loop file "
13661 #: ../fish/guestfish-actions.pod:3645
13662 msgid "mount-options"
13666 #: ../fish/guestfish-actions.pod:3647
13669 " mount-options options device mountpoint\n"
13674 #: ../fish/guestfish-actions.pod:3649
13676 "This is the same as the L</mount> command, but it allows you to set the "
13677 "mount options as for the L<mount(8)> I<-o> flag."
13681 #: ../fish/guestfish-actions.pod:3653 ../src/guestfs-actions.pod:5683
13683 "If the C<options> parameter is an empty string, then no options are passed "
13684 "(all options default to whatever the filesystem uses)."
13688 #: ../fish/guestfish-actions.pod:3657
13693 #: ../fish/guestfish-actions.pod:3659
13696 " mount-ro device mountpoint\n"
13701 #: ../fish/guestfish-actions.pod:3661
13703 "This is the same as the L</mount> command, but it mounts the filesystem with "
13704 "the read-only (I<-o ro>) flag."
13708 #: ../fish/guestfish-actions.pod:3664
13713 #: ../fish/guestfish-actions.pod:3666
13716 " mount-vfs options vfstype device mountpoint\n"
13721 #: ../fish/guestfish-actions.pod:3668
13723 "This is the same as the L</mount> command, but it allows you to set both the "
13724 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
13728 #: ../fish/guestfish-actions.pod:3672
13729 msgid "mountpoints"
13733 #: ../fish/guestfish-actions.pod:3674
13741 #: ../fish/guestfish-actions.pod:3676
13743 "This call is similar to L</mounts>. That call returns a list of devices. "
13744 "This one returns a hash table (map) of device name to directory where the "
13745 "device is mounted."
13749 #: ../fish/guestfish-actions.pod:3680
13754 #: ../fish/guestfish-actions.pod:3682
13762 #: ../fish/guestfish-actions.pod:3684 ../src/guestfs-actions.pod:5744
13764 "This returns the list of currently mounted filesystems. It returns the list "
13765 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
13769 #: ../fish/guestfish-actions.pod:3687 ../src/guestfs-actions.pod:5747
13770 msgid "Some internal mounts are not shown."
13774 #: ../fish/guestfish-actions.pod:3689
13775 msgid "See also: L</mountpoints>"
13779 #: ../fish/guestfish-actions.pod:3691
13784 #: ../fish/guestfish-actions.pod:3693
13792 #: ../fish/guestfish-actions.pod:3695 ../src/guestfs-actions.pod:5764
13794 "This moves a file from C<src> to C<dest> where C<dest> is either a "
13795 "destination filename or destination directory."
13799 #: ../fish/guestfish-actions.pod:3698
13800 msgid "ntfs-3g-probe"
13804 #: ../fish/guestfish-actions.pod:3700
13807 " ntfs-3g-probe true|false device\n"
13812 #: ../fish/guestfish-actions.pod:3702 ../src/guestfs-actions.pod:5778
13814 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
13815 "C<device> for mountability. (Not all NTFS volumes can be mounted "
13816 "read-write, and some cannot be mounted at all)."
13820 #: ../fish/guestfish-actions.pod:3706 ../src/guestfs-actions.pod:5782
13822 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
13823 "can be mounted read-write. Set it to false if you want to test if the "
13824 "volume can be mounted read-only."
13828 #: ../fish/guestfish-actions.pod:3710 ../src/guestfs-actions.pod:5786
13830 "The return value is an integer which C<0> if the operation would succeed, or "
13831 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
13835 #: ../fish/guestfish-actions.pod:3714
13840 #: ../fish/guestfish-actions.pod:3716
13843 " ntfsresize device\n"
13848 #: ../fish/guestfish-actions.pod:3718 ../fish/guestfish-actions.pod:3742 ../src/guestfs-actions.pod:5807 ../src/guestfs-actions.pod:5839
13850 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
13851 "size of the underlying device."
13855 #: ../fish/guestfish-actions.pod:3721 ../src/guestfs-actions.pod:5810
13857 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
13858 "consistency check (for safety). You have to boot into Windows to perform "
13859 "this check and clear this condition. Furthermore, ntfsresize refuses to "
13860 "resize filesystems which have been marked in this way. So in effect it is "
13861 "not possible to call ntfsresize multiple times on a single filesystem "
13862 "without booting into Windows between each resize."
13866 #: ../fish/guestfish-actions.pod:3729 ../fish/guestfish-actions.pod:3768 ../src/guestfs-actions.pod:5818 ../src/guestfs-actions.pod:5865
13867 msgid "See also L<ntfsresize(8)>."
13871 #: ../fish/guestfish-actions.pod:3731 ../fish/guestfish-actions.pod:3779
13873 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
13878 #: ../fish/guestfish-actions.pod:3738
13879 msgid "ntfsresize-opts"
13883 #: ../fish/guestfish-actions.pod:3740
13886 " ntfsresize-opts device [size:N] [force:true|false]\n"
13891 #: ../fish/guestfish-actions.pod:3751 ../src/guestfs-actions.pod:5848
13893 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
13894 "resized to fit the container (eg. partition)."
13898 #: ../fish/guestfish-actions.pod:3754 ../fish/guestfish-actions.pod:5075 ../src/guestfs-actions.pod:5851 ../src/guestfs-actions.pod:7822
13903 #: ../fish/guestfish-actions.pod:3756 ../src/guestfs-actions.pod:5853
13905 "If this option is true, then force the resize of the filesystem even if the "
13906 "filesystem is marked as requiring a consistency check."
13910 #: ../fish/guestfish-actions.pod:3759
13912 "After the resize operation, the filesystem is always marked as requiring a "
13913 "consistency check (for safety). You have to boot into Windows to perform "
13914 "this check and clear this condition. If you I<don't> set the C<force> "
13915 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
13916 "a single filesystem without booting into Windows between each resize."
13920 #: ../fish/guestfish-actions.pod:3772
13921 msgid "ntfsresize-size"
13925 #: ../fish/guestfish-actions.pod:3774
13928 " ntfsresize-size device size\n"
13933 #: ../fish/guestfish-actions.pod:3776
13935 "This command is the same as L</ntfsresize> except that it allows you to "
13936 "specify the new size (in bytes) explicitly."
13940 #: ../fish/guestfish-actions.pod:3786
13945 #: ../fish/guestfish-actions.pod:3788
13948 " part-add device prlogex startsect endsect\n"
13953 #: ../fish/guestfish-actions.pod:3790
13955 "This command adds a partition to C<device>. If there is no partition table "
13956 "on the device, call L</part-init> first."
13960 #: ../fish/guestfish-actions.pod:3793 ../src/guestfs-actions.pod:5926
13962 "The C<prlogex> parameter is the type of partition. Normally you should pass "
13963 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
13964 "C<logical>) and C<e> (or C<extended>) partition types."
13968 #: ../fish/guestfish-actions.pod:3798 ../src/guestfs-actions.pod:5931
13970 "C<startsect> and C<endsect> are the start and end of the partition in "
13971 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
13972 "from the end of the disk (C<-1> is the last sector)."
13976 #: ../fish/guestfish-actions.pod:3802
13978 "Creating a partition which covers the whole disk is not so easy. Use "
13979 "L</part-disk> to do that."
13983 #: ../fish/guestfish-actions.pod:3805
13988 #: ../fish/guestfish-actions.pod:3807
13991 " part-del device partnum\n"
13996 #: ../fish/guestfish-actions.pod:3809 ../src/guestfs-actions.pod:5949
13997 msgid "This command deletes the partition numbered C<partnum> on C<device>."
14001 #: ../fish/guestfish-actions.pod:3811 ../src/guestfs-actions.pod:5951
14003 "Note that in the case of MBR partitioning, deleting an extended partition "
14004 "also deletes any logical partitions it contains."
14008 #: ../fish/guestfish-actions.pod:3815
14013 #: ../fish/guestfish-actions.pod:3817
14016 " part-disk device parttype\n"
14021 #: ../fish/guestfish-actions.pod:3819
14023 "This command is simply a combination of L</part-init> followed by "
14024 "L</part-add> to create a single primary partition covering the whole disk."
14028 #: ../fish/guestfish-actions.pod:3823
14030 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
14031 "possible values are described in L</part-init>."
14035 #: ../fish/guestfish-actions.pod:3826
14036 msgid "part-get-bootable"
14040 #: ../fish/guestfish-actions.pod:3828
14043 " part-get-bootable device partnum\n"
14048 #: ../fish/guestfish-actions.pod:3830 ../src/guestfs-actions.pod:5984
14050 "This command returns true if the partition C<partnum> on C<device> has the "
14051 "bootable flag set."
14055 #: ../fish/guestfish-actions.pod:3833
14056 msgid "See also L</part-set-bootable>."
14060 #: ../fish/guestfish-actions.pod:3835
14061 msgid "part-get-mbr-id"
14065 #: ../fish/guestfish-actions.pod:3837
14068 " part-get-mbr-id device partnum\n"
14073 #: ../fish/guestfish-actions.pod:3839 ../src/guestfs-actions.pod:6000
14075 "Returns the MBR type byte (also known as the ID byte) from the numbered "
14076 "partition C<partnum>."
14080 #: ../fish/guestfish-actions.pod:3842 ../fish/guestfish-actions.pod:3986
14082 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
14083 "undefined results for other partition table types (see "
14084 "L</part-get-parttype>)."
14088 #: ../fish/guestfish-actions.pod:3846
14089 msgid "part-get-parttype"
14093 #: ../fish/guestfish-actions.pod:3848
14096 " part-get-parttype device\n"
14101 #: ../fish/guestfish-actions.pod:3850 ../src/guestfs-actions.pod:6017
14103 "This command examines the partition table on C<device> and returns the "
14104 "partition table type (format) being used."
14108 #: ../fish/guestfish-actions.pod:3853
14110 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
14111 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
14112 "possible, although unusual. See L</part-init> for a full list."
14116 #: ../fish/guestfish-actions.pod:3858
14121 #: ../fish/guestfish-actions.pod:3860
14124 " part-init device parttype\n"
14129 #: ../fish/guestfish-actions.pod:3862 ../src/guestfs-actions.pod:6037
14131 "This creates an empty partition table on C<device> of one of the partition "
14132 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
14133 "(for large disks)."
14137 #: ../fish/guestfish-actions.pod:3866
14139 "Initially there are no partitions. Following this, you should call "
14140 "L</part-add> for each partition required."
14144 #: ../fish/guestfish-actions.pod:3869 ../src/guestfs-actions.pod:6044
14145 msgid "Possible values for C<parttype> are:"
14149 #: ../fish/guestfish-actions.pod:3873 ../src/guestfs-actions.pod:6048
14154 #: ../fish/guestfish-actions.pod:3875 ../src/guestfs-actions.pod:6050
14159 #: ../fish/guestfish-actions.pod:3877 ../src/guestfs-actions.pod:6052
14160 msgid "Intel EFI / GPT partition table."
14164 #: ../fish/guestfish-actions.pod:3879 ../src/guestfs-actions.pod:6054
14166 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
14167 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
14168 "the C<mbr> format."
14172 #: ../fish/guestfish-actions.pod:3883 ../src/guestfs-actions.pod:6058
14177 #: ../fish/guestfish-actions.pod:3885 ../src/guestfs-actions.pod:6060
14182 #: ../fish/guestfish-actions.pod:3887 ../src/guestfs-actions.pod:6062
14184 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
14185 "Windows. This partition type will B<only> work for device sizes up to 2 "
14186 "TB. For large disks we recommend using C<gpt>."
14190 #: ../fish/guestfish-actions.pod:3894 ../src/guestfs-actions.pod:6069
14191 msgid "Other partition table types that may work but are not supported include:"
14195 #: ../fish/guestfish-actions.pod:3899 ../src/guestfs-actions.pod:6074
14200 #: ../fish/guestfish-actions.pod:3901 ../src/guestfs-actions.pod:6076
14201 msgid "AIX disk labels."
14205 #: ../fish/guestfish-actions.pod:3903 ../src/guestfs-actions.pod:6078
14210 #: ../fish/guestfish-actions.pod:3905 ../src/guestfs-actions.pod:6080
14215 #: ../fish/guestfish-actions.pod:3907 ../src/guestfs-actions.pod:6082
14216 msgid "Amiga \"Rigid Disk Block\" format."
14220 #: ../fish/guestfish-actions.pod:3909 ../src/guestfs-actions.pod:6084
14225 #: ../fish/guestfish-actions.pod:3911 ../src/guestfs-actions.pod:6086
14226 msgid "BSD disk labels."
14230 #: ../fish/guestfish-actions.pod:3913 ../src/guestfs-actions.pod:6088
14235 #: ../fish/guestfish-actions.pod:3915 ../src/guestfs-actions.pod:6090
14236 msgid "DASD, used on IBM mainframes."
14240 #: ../fish/guestfish-actions.pod:3917 ../src/guestfs-actions.pod:6092
14245 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:6094
14246 msgid "MIPS/SGI volumes."
14250 #: ../fish/guestfish-actions.pod:3921 ../src/guestfs-actions.pod:6096
14255 #: ../fish/guestfish-actions.pod:3923 ../src/guestfs-actions.pod:6098
14256 msgid "Old Mac partition format. Modern Macs use C<gpt>."
14260 #: ../fish/guestfish-actions.pod:3925 ../src/guestfs-actions.pod:6100
14265 #: ../fish/guestfish-actions.pod:3927 ../src/guestfs-actions.pod:6102
14266 msgid "NEC PC-98 format, common in Japan apparently."
14270 #: ../fish/guestfish-actions.pod:3929 ../src/guestfs-actions.pod:6104
14275 #: ../fish/guestfish-actions.pod:3931 ../src/guestfs-actions.pod:6106
14276 msgid "Sun disk labels."
14280 #: ../fish/guestfish-actions.pod:3935
14285 #: ../fish/guestfish-actions.pod:3937
14288 " part-list device\n"
14293 #: ../fish/guestfish-actions.pod:3939 ../src/guestfs-actions.pod:6120
14295 "This command parses the partition table on C<device> and returns the list of "
14296 "partitions found."
14300 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:6123
14301 msgid "The fields in the returned structure are:"
14305 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:6127
14306 msgid "B<part_num>"
14310 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:6129
14311 msgid "Partition number, counting from 1."
14315 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:6131
14316 msgid "B<part_start>"
14320 #: ../fish/guestfish-actions.pod:3952
14322 "Start of the partition I<in bytes>. To get sectors you have to divide by "
14323 "the device's sector size, see L</blockdev-getss>."
14327 #: ../fish/guestfish-actions.pod:3955 ../src/guestfs-actions.pod:6136
14328 msgid "B<part_end>"
14332 #: ../fish/guestfish-actions.pod:3957 ../src/guestfs-actions.pod:6138
14333 msgid "End of the partition in bytes."
14337 #: ../fish/guestfish-actions.pod:3959 ../src/guestfs-actions.pod:6140
14338 msgid "B<part_size>"
14342 #: ../fish/guestfish-actions.pod:3961 ../src/guestfs-actions.pod:6142
14343 msgid "Size of the partition in bytes."
14347 #: ../fish/guestfish-actions.pod:3965
14348 msgid "part-set-bootable"
14352 #: ../fish/guestfish-actions.pod:3967
14355 " part-set-bootable device partnum true|false\n"
14360 #: ../fish/guestfish-actions.pod:3969 ../src/guestfs-actions.pod:6160
14362 "This sets the bootable flag on partition numbered C<partnum> on device "
14363 "C<device>. Note that partitions are numbered from 1."
14367 #: ../fish/guestfish-actions.pod:3972 ../src/guestfs-actions.pod:6163
14369 "The bootable flag is used by some operating systems (notably Windows) to "
14370 "determine which partition to boot from. It is by no means universally "
14375 #: ../fish/guestfish-actions.pod:3976
14376 msgid "part-set-mbr-id"
14380 #: ../fish/guestfish-actions.pod:3978
14383 " part-set-mbr-id device partnum idbyte\n"
14388 #: ../fish/guestfish-actions.pod:3980 ../src/guestfs-actions.pod:6179
14390 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
14391 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
14392 "documentation are in fact hexadecimal numbers, but usually documented "
14393 "without any leading \"0x\" which might be confusing."
14397 #: ../fish/guestfish-actions.pod:3990
14398 msgid "part-set-name"
14402 #: ../fish/guestfish-actions.pod:3992
14405 " part-set-name device partnum name\n"
14410 #: ../fish/guestfish-actions.pod:3994 ../src/guestfs-actions.pod:6201
14412 "This sets the partition name on partition numbered C<partnum> on device "
14413 "C<device>. Note that partitions are numbered from 1."
14417 #: ../fish/guestfish-actions.pod:3997 ../src/guestfs-actions.pod:6204
14419 "The partition name can only be set on certain types of partition table. "
14420 "This works on C<gpt> but not on C<mbr> partitions."
14424 #: ../fish/guestfish-actions.pod:4000
14425 msgid "part-to-dev"
14429 #: ../fish/guestfish-actions.pod:4002
14432 " part-to-dev partition\n"
14437 #: ../fish/guestfish-actions.pod:4004 ../src/guestfs-actions.pod:6217
14439 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
14440 "partition number, returning the device name (eg. \"/dev/sdb\")."
14444 #: ../fish/guestfish-actions.pod:4008 ../fish/guestfish-actions.pod:4020
14446 "The named partition must exist, for example as a string returned from "
14447 "L</list-partitions>."
14451 #: ../fish/guestfish-actions.pod:4011
14452 msgid "See also L</part-to-partnum>."
14456 #: ../fish/guestfish-actions.pod:4013
14457 msgid "part-to-partnum"
14461 #: ../fish/guestfish-actions.pod:4015
14464 " part-to-partnum partition\n"
14469 #: ../fish/guestfish-actions.pod:4017 ../src/guestfs-actions.pod:6237
14471 "This function takes a partition name (eg. \"/dev/sdb1\") and returns the "
14472 "partition number (eg. C<1>)."
14476 #: ../fish/guestfish-actions.pod:4023
14477 msgid "See also L</part-to-dev>."
14481 #: ../fish/guestfish-actions.pod:4025
14482 msgid "ping-daemon"
14486 #: ../fish/guestfish-actions.pod:4027
14494 #: ../fish/guestfish-actions.pod:4029 ../src/guestfs-actions.pod:6254
14496 "This is a test probe into the guestfs daemon running inside the qemu "
14497 "subprocess. Calling this function checks that the daemon responds to the "
14498 "ping message, without affecting the daemon or attached block device(s) in "
14503 #: ../fish/guestfish-actions.pod:4034
14508 #: ../fish/guestfish-actions.pod:4036
14511 " pread path count offset\n"
14516 #: ../fish/guestfish-actions.pod:4038 ../src/guestfs-actions.pod:6272
14518 "This command lets you read part of a file. It reads C<count> bytes of the "
14519 "file, starting at C<offset>, from file C<path>."
14523 #: ../fish/guestfish-actions.pod:4041 ../fish/guestfish-actions.pod:4056 ../src/guestfs-actions.pod:6275 ../src/guestfs-actions.pod:6301
14525 "This may read fewer bytes than requested. For further details see the "
14526 "L<pread(2)> system call."
14530 #: ../fish/guestfish-actions.pod:4044
14531 msgid "See also L</pwrite>, L</pread-device>."
14535 #: ../fish/guestfish-actions.pod:4049
14536 msgid "pread-device"
14540 #: ../fish/guestfish-actions.pod:4051
14543 " pread-device device count offset\n"
14548 #: ../fish/guestfish-actions.pod:4053 ../src/guestfs-actions.pod:6298
14550 "This command lets you read part of a file. It reads C<count> bytes of "
14551 "C<device>, starting at C<offset>."
14555 #: ../fish/guestfish-actions.pod:4059
14556 msgid "See also L</pread>."
14560 #: ../fish/guestfish-actions.pod:4064
14565 #: ../fish/guestfish-actions.pod:4066
14568 " pvcreate device\n"
14573 #: ../fish/guestfish-actions.pod:4068 ../src/guestfs-actions.pod:6321
14575 "This creates an LVM physical volume on the named C<device>, where C<device> "
14576 "should usually be a partition name such as C</dev/sda1>."
14580 #: ../fish/guestfish-actions.pod:4072
14585 #: ../fish/guestfish-actions.pod:4074
14588 " pvremove device\n"
14593 #: ../fish/guestfish-actions.pod:4076 ../src/guestfs-actions.pod:6335
14595 "This wipes a physical volume C<device> so that LVM will no longer recognise "
14600 #: ../fish/guestfish-actions.pod:4079 ../src/guestfs-actions.pod:6338
14602 "The implementation uses the C<pvremove> command which refuses to wipe "
14603 "physical volumes that contain any volume groups, so you have to remove those "
14608 #: ../fish/guestfish-actions.pod:4083
14613 #: ../fish/guestfish-actions.pod:4085
14616 " pvresize device\n"
14621 #: ../fish/guestfish-actions.pod:4087 ../src/guestfs-actions.pod:6352
14623 "This resizes (expands or shrinks) an existing LVM physical volume to match "
14624 "the new size of the underlying device."
14628 #: ../fish/guestfish-actions.pod:4090
14629 msgid "pvresize-size"
14633 #: ../fish/guestfish-actions.pod:4092
14636 " pvresize-size device size\n"
14641 #: ../fish/guestfish-actions.pod:4094
14643 "This command is the same as L</pvresize> except that it allows you to "
14644 "specify the new size (in bytes) explicitly."
14648 #: ../fish/guestfish-actions.pod:4097
14653 #: ../fish/guestfish-actions.pod:4099
14661 #: ../fish/guestfish-actions.pod:4101 ../src/guestfs-actions.pod:6378
14663 "List all the physical volumes detected. This is the equivalent of the "
14664 "L<pvs(8)> command."
14668 #: ../fish/guestfish-actions.pod:4104 ../src/guestfs-actions.pod:6381
14670 "This returns a list of just the device names that contain PVs "
14671 "(eg. C</dev/sda2>)."
14675 #: ../fish/guestfish-actions.pod:4107
14676 msgid "See also L</pvs-full>."
14680 #: ../fish/guestfish-actions.pod:4109
14685 #: ../fish/guestfish-actions.pod:4111
14693 #: ../fish/guestfish-actions.pod:4113 ../src/guestfs-actions.pod:6397
14695 "List all the physical volumes detected. This is the equivalent of the "
14696 "L<pvs(8)> command. The \"full\" version includes all fields."
14700 #: ../fish/guestfish-actions.pod:4116
14705 #: ../fish/guestfish-actions.pod:4118
14713 #: ../fish/guestfish-actions.pod:4120 ../src/guestfs-actions.pod:6412
14714 msgid "This command returns the UUID of the LVM PV C<device>."
14718 #: ../fish/guestfish-actions.pod:4122
14723 #: ../fish/guestfish-actions.pod:4124
14726 " pwrite path content offset\n"
14731 #: ../fish/guestfish-actions.pod:4126 ../src/guestfs-actions.pod:6428
14733 "This command writes to part of a file. It writes the data buffer C<content> "
14734 "to the file C<path> starting at offset C<offset>."
14738 #: ../fish/guestfish-actions.pod:4129 ../src/guestfs-actions.pod:6431
14740 "This command implements the L<pwrite(2)> system call, and like that system "
14741 "call it may not write the full data requested. The return value is the "
14742 "number of bytes that were actually written to the file. This could even be "
14743 "0, although short writes are unlikely for regular files in ordinary "
14748 #: ../fish/guestfish-actions.pod:4135
14749 msgid "See also L</pread>, L</pwrite-device>."
14753 #: ../fish/guestfish-actions.pod:4140
14754 msgid "pwrite-device"
14758 #: ../fish/guestfish-actions.pod:4142
14761 " pwrite-device device content offset\n"
14766 #: ../fish/guestfish-actions.pod:4144 ../src/guestfs-actions.pod:6455
14768 "This command writes to part of a device. It writes the data buffer "
14769 "C<content> to C<device> starting at offset C<offset>."
14773 #: ../fish/guestfish-actions.pod:4147 ../src/guestfs-actions.pod:6458
14775 "This command implements the L<pwrite(2)> system call, and like that system "
14776 "call it may not write the full data requested (although short writes to disk "
14777 "devices and partitions are probably impossible with standard Linux kernels)."
14781 #: ../fish/guestfish-actions.pod:4152
14782 msgid "See also L</pwrite>."
14786 #: ../fish/guestfish-actions.pod:4157
14791 #: ../fish/guestfish-actions.pod:4159
14794 " read-file path\n"
14799 #: ../fish/guestfish-actions.pod:4161 ../src/guestfs-actions.pod:6479
14800 msgid "This calls returns the contents of the file C<path> as a buffer."
14804 #: ../fish/guestfish-actions.pod:4164
14806 "Unlike L</cat>, this function can correctly handle files that contain "
14807 "embedded ASCII NUL characters. However unlike L</download>, this function "
14808 "is limited in the total size of file that can be handled."
14812 #: ../fish/guestfish-actions.pod:4172
14817 #: ../fish/guestfish-actions.pod:4174
14820 " read-lines path\n"
14825 #: ../fish/guestfish-actions.pod:4178 ../src/guestfs-actions.pod:6504
14827 "The file contents are returned as a list of lines. Trailing C<LF> and "
14828 "C<CRLF> character sequences are I<not> returned."
14832 #: ../fish/guestfish-actions.pod:4181
14834 "Note that this function cannot correctly handle binary files (specifically, "
14835 "files containing C<\\0> character which is treated as end of line). For "
14836 "those you need to use the L</read-file> function which has a more complex "
14841 #: ../fish/guestfish-actions.pod:4186
14846 #: ../fish/guestfish-actions.pod:4188
14854 #: ../fish/guestfish-actions.pod:4190 ../src/guestfs-actions.pod:6524
14855 msgid "This returns the list of directory entries in directory C<dir>."
14859 #: ../fish/guestfish-actions.pod:4192 ../src/guestfs-actions.pod:6526
14861 "All entries in the directory are returned, including C<.> and C<..>. The "
14862 "entries are I<not> sorted, but returned in the same order as the underlying "
14867 #: ../fish/guestfish-actions.pod:4196 ../src/guestfs-actions.pod:6530
14869 "Also this call returns basic file type information about each file. The "
14870 "C<ftyp> field will contain one of the following characters:"
14874 #: ../fish/guestfish-actions.pod:4201 ../src/guestfs-actions.pod:6535
14879 #: ../fish/guestfish-actions.pod:4203 ../src/guestfs-actions.pod:6537
14880 msgid "Block special"
14884 #: ../fish/guestfish-actions.pod:4205 ../src/guestfs-actions.pod:6539
14889 #: ../fish/guestfish-actions.pod:4207 ../src/guestfs-actions.pod:6541
14890 msgid "Char special"
14894 #: ../fish/guestfish-actions.pod:4209 ../src/guestfs-actions.pod:6543
14899 #: ../fish/guestfish-actions.pod:4211 ../src/guestfs-actions.pod:6545
14904 #: ../fish/guestfish-actions.pod:4213 ../src/guestfs-actions.pod:6547
14909 #: ../fish/guestfish-actions.pod:4215 ../src/guestfs-actions.pod:6549
14910 msgid "FIFO (named pipe)"
14914 #: ../fish/guestfish-actions.pod:4217 ../src/guestfs-actions.pod:6551
14919 #: ../fish/guestfish-actions.pod:4219 ../src/guestfs-actions.pod:6553
14920 msgid "Symbolic link"
14924 #: ../fish/guestfish-actions.pod:4221 ../src/guestfs-actions.pod:6555
14929 #: ../fish/guestfish-actions.pod:4223 ../src/guestfs-actions.pod:6557
14930 msgid "Regular file"
14934 #: ../fish/guestfish-actions.pod:4225 ../src/guestfs-actions.pod:6559
14939 #: ../fish/guestfish-actions.pod:4227 ../src/guestfs-actions.pod:6561
14944 #: ../fish/guestfish-actions.pod:4229 ../src/guestfs-actions.pod:6563
14949 #: ../fish/guestfish-actions.pod:4231 ../src/guestfs-actions.pod:6565
14950 msgid "Unknown file type"
14954 #: ../fish/guestfish-actions.pod:4233 ../src/guestfs-actions.pod:6567
14959 #: ../fish/guestfish-actions.pod:4235 ../src/guestfs-actions.pod:6569
14960 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
14964 #: ../fish/guestfish-actions.pod:4240
14966 "This function is primarily intended for use by programs. To get a simple "
14967 "list of names, use L</ls>. To get a printable directory for human "
14968 "consumption, use L</ll>."
14972 #: ../fish/guestfish-actions.pod:4244
14977 #: ../fish/guestfish-actions.pod:4246
14985 #: ../fish/guestfish-actions.pod:4248 ../src/guestfs-actions.pod:6590
14986 msgid "This command reads the target of a symbolic link."
14990 #: ../fish/guestfish-actions.pod:4250
14991 msgid "readlinklist"
14995 #: ../fish/guestfish-actions.pod:4252
14998 " readlinklist path 'names ...'\n"
15003 #: ../fish/guestfish-actions.pod:4254 ../src/guestfs-actions.pod:6604
15005 "This call allows you to do a C<readlink> operation on multiple files, where "
15006 "all files are in the directory C<path>. C<names> is the list of files from "
15011 #: ../fish/guestfish-actions.pod:4258 ../src/guestfs-actions.pod:6608
15013 "On return you get a list of strings, with a one-to-one correspondence to the "
15014 "C<names> list. Each string is the value of the symbolic link."
15018 #: ../fish/guestfish-actions.pod:4262 ../src/guestfs-actions.pod:6612
15020 "If the C<readlink(2)> operation fails on any name, then the corresponding "
15021 "result string is the empty string C<\"\">. However the whole operation is "
15022 "completed even if there were C<readlink(2)> errors, and so you can call this "
15023 "function with names where you don't know if they are symbolic links already "
15024 "(albeit slightly less efficient)."
15028 #: ../fish/guestfish-actions.pod:4269 ../src/guestfs-actions.pod:6619
15030 "This call is intended for programs that want to efficiently list a directory "
15031 "contents without making many round-trips. Very long directory listings "
15032 "might cause the protocol message size to be exceeded, causing this call to "
15033 "fail. The caller must split up such requests into smaller groups of names."
15037 #: ../fish/guestfish-actions.pod:4276
15042 #: ../fish/guestfish-actions.pod:4278
15050 #: ../fish/guestfish-actions.pod:4280 ../src/guestfs-actions.pod:6638
15052 "Return the canonicalized absolute pathname of C<path>. The returned path "
15053 "has no C<.>, C<..> or symbolic link path elements."
15057 #: ../fish/guestfish-actions.pod:4283
15058 msgid "removexattr"
15062 #: ../fish/guestfish-actions.pod:4285
15065 " removexattr xattr path\n"
15070 #: ../fish/guestfish-actions.pod:4287 ../src/guestfs-actions.pod:6653
15071 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
15075 #: ../fish/guestfish-actions.pod:4290
15076 msgid "See also: L</lremovexattr>, L<attr(5)>."
15080 #: ../fish/guestfish-actions.pod:4292
15085 #: ../fish/guestfish-actions.pod:4294
15088 " resize2fs device\n"
15093 #: ../fish/guestfish-actions.pod:4296 ../src/guestfs-actions.pod:6668
15095 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
15096 "underlying device."
15100 #: ../fish/guestfish-actions.pod:4299
15102 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
15103 "before calling this command. For unknown reasons C<resize2fs> sometimes "
15104 "gives an error about this and sometimes not. In any case, it is always safe "
15105 "to call L</e2fsck-f> before calling this function."
15109 #: ../fish/guestfish-actions.pod:4305
15110 msgid "resize2fs-M"
15114 #: ../fish/guestfish-actions.pod:4307
15117 " resize2fs-M device\n"
15122 #: ../fish/guestfish-actions.pod:4309
15124 "This command is the same as L</resize2fs>, but the filesystem is resized to "
15125 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
15130 #: ../fish/guestfish-actions.pod:4313
15132 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
15133 "and read the C<Block size> and C<Block count> values. These two numbers, "
15134 "multiplied together, give the resulting size of the minimal filesystem in "
15139 #: ../fish/guestfish-actions.pod:4318
15140 msgid "resize2fs-size"
15144 #: ../fish/guestfish-actions.pod:4320
15147 " resize2fs-size device size\n"
15152 #: ../fish/guestfish-actions.pod:4322
15154 "This command is the same as L</resize2fs> except that it allows you to "
15155 "specify the new size (in bytes) explicitly."
15159 #: ../fish/guestfish-actions.pod:4325
15164 #: ../fish/guestfish-actions.pod:4327
15172 #: ../fish/guestfish-actions.pod:4329 ../src/guestfs-actions.pod:6720
15173 msgid "Remove the single file C<path>."
15177 #: ../fish/guestfish-actions.pod:4331
15182 #: ../fish/guestfish-actions.pod:4333
15190 #: ../fish/guestfish-actions.pod:4335 ../src/guestfs-actions.pod:6732
15192 "Remove the file or directory C<path>, recursively removing the contents if "
15193 "its a directory. This is like the C<rm -rf> shell command."
15197 #: ../fish/guestfish-actions.pod:4339
15202 #: ../fish/guestfish-actions.pod:4341
15210 #: ../fish/guestfish-actions.pod:4343 ../src/guestfs-actions.pod:6746
15211 msgid "Remove the single directory C<path>."
15215 #: ../fish/guestfish-actions.pod:4345
15216 msgid "rmmountpoint"
15220 #: ../fish/guestfish-actions.pod:4347
15223 " rmmountpoint exemptpath\n"
15228 #: ../fish/guestfish-actions.pod:4349
15230 "This calls removes a mountpoint that was previously created with "
15231 "L</mkmountpoint>. See L</mkmountpoint> for full details."
15235 #: ../fish/guestfish-actions.pod:4353
15236 msgid "scrub-device"
15240 #: ../fish/guestfish-actions.pod:4355
15243 " scrub-device device\n"
15248 #: ../fish/guestfish-actions.pod:4357 ../src/guestfs-actions.pod:6772
15250 "This command writes patterns over C<device> to make data retrieval more "
15255 #: ../fish/guestfish-actions.pod:4360 ../fish/guestfish-actions.pod:4372 ../fish/guestfish-actions.pod:4385 ../src/guestfs-actions.pod:6775 ../src/guestfs-actions.pod:6793 ../src/guestfs-actions.pod:6812
15257 "It is an interface to the L<scrub(1)> program. See that manual page for "
15262 #: ../fish/guestfish-actions.pod:4363
15267 #: ../fish/guestfish-actions.pod:4365
15270 " scrub-file file\n"
15275 #: ../fish/guestfish-actions.pod:4367 ../src/guestfs-actions.pod:6788
15277 "This command writes patterns over a file to make data retrieval more "
15282 #: ../fish/guestfish-actions.pod:4370 ../src/guestfs-actions.pod:6791
15283 msgid "The file is I<removed> after scrubbing."
15287 #: ../fish/guestfish-actions.pod:4375
15288 msgid "scrub-freespace"
15292 #: ../fish/guestfish-actions.pod:4377
15295 " scrub-freespace dir\n"
15300 #: ../fish/guestfish-actions.pod:4379
15302 "This command creates the directory C<dir> and then fills it with files until "
15303 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
15304 "deletes them. The intention is to scrub any free space on the partition "
15305 "containing C<dir>."
15309 #: ../fish/guestfish-actions.pod:4388
15314 #: ../fish/guestfish-actions.pod:4390
15319 #: ../fish/guestfish-actions.pod:4392
15322 " set-append append\n"
15327 #: ../fish/guestfish-actions.pod:4394 ../src/guestfs-actions.pod:6825
15329 "This function is used to add additional options to the guest kernel command "
15334 #: ../fish/guestfish-actions.pod:4397 ../src/guestfs-actions.pod:6828
15336 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
15337 "environment variable."
15341 #: ../fish/guestfish-actions.pod:4400 ../src/guestfs-actions.pod:6831
15343 "Setting C<append> to C<NULL> means I<no> additional options are passed "
15344 "(libguestfs always adds a few of its own)."
15348 #: ../fish/guestfish-actions.pod:4403
15349 msgid "set-attach-method"
15353 #: ../fish/guestfish-actions.pod:4405
15354 msgid "attach-method"
15358 #: ../fish/guestfish-actions.pod:4407
15361 " set-attach-method attachmethod\n"
15366 #: ../fish/guestfish-actions.pod:4409 ../src/guestfs-actions.pod:6844
15368 "Set the method that libguestfs uses to connect to the back end guestfsd "
15369 "daemon. Possible methods are:"
15373 #: ../fish/guestfish-actions.pod:4414 ../src/guestfs-actions.pod:6849 ../src/guestfs.pod:2917
15374 msgid "C<appliance>"
15378 #: ../fish/guestfish-actions.pod:4416 ../src/guestfs-actions.pod:6851
15380 "Launch an appliance and connect to it. This is the ordinary method and the "
15385 #: ../fish/guestfish-actions.pod:4419 ../src/guestfs-actions.pod:6854
15386 msgid "C<unix:I<path>>"
15390 #: ../fish/guestfish-actions.pod:4421 ../src/guestfs-actions.pod:6856
15391 msgid "Connect to the Unix domain socket I<path>."
15395 #: ../fish/guestfish-actions.pod:4423 ../src/guestfs-actions.pod:6858
15397 "This method lets you connect to an existing daemon or (using virtio-serial) "
15398 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
15399 "RUNNING DAEMONS>."
15403 #: ../fish/guestfish-actions.pod:4429
15404 msgid "set-autosync"
15408 #: ../fish/guestfish-actions.pod:4431
15413 #: ../fish/guestfish-actions.pod:4433
15416 " set-autosync true|false\n"
15421 #: ../fish/guestfish-actions.pod:4435 ../src/guestfs-actions.pod:6874
15423 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
15424 "effort attempt to make filesystems consistent and synchronized when the "
15425 "handle is closed (also if the program exits without closing handles)."
15429 #: ../fish/guestfish-actions.pod:4440 ../src/guestfs-actions.pod:6879
15431 "This is enabled by default (since libguestfs 1.5.24, previously it was "
15432 "disabled by default)."
15436 #: ../fish/guestfish-actions.pod:4443
15441 #: ../fish/guestfish-actions.pod:4445
15446 #: ../fish/guestfish-actions.pod:4447
15449 " set-direct true|false\n"
15454 #: ../fish/guestfish-actions.pod:4449 ../src/guestfs-actions.pod:6892
15456 "If the direct appliance mode flag is enabled, then stdin and stdout are "
15457 "passed directly through to the appliance once it is launched."
15461 #: ../fish/guestfish-actions.pod:4453
15463 "One consequence of this is that log messages aren't caught by the library "
15464 "and handled by L</set-log-message-callback>, but go straight to stdout."
15468 #: ../fish/guestfish-actions.pod:4457 ../src/guestfs-actions.pod:6900
15469 msgid "You probably don't want to use this unless you know what you are doing."
15473 #: ../fish/guestfish-actions.pod:4460 ../src/guestfs-actions.pod:6903
15474 msgid "The default is disabled."
15478 #: ../fish/guestfish-actions.pod:4462
15479 msgid "set-e2label"
15483 #: ../fish/guestfish-actions.pod:4464
15486 " set-e2label device label\n"
15491 #: ../fish/guestfish-actions.pod:4466 ../src/guestfs-actions.pod:6916
15493 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
15494 "C<label>. Filesystem labels are limited to 16 characters."
15498 #: ../fish/guestfish-actions.pod:4470
15500 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
15501 "label on a filesystem."
15505 #: ../fish/guestfish-actions.pod:4473
15510 #: ../fish/guestfish-actions.pod:4475
15513 " set-e2uuid device uuid\n"
15518 #: ../fish/guestfish-actions.pod:4477 ../src/guestfs-actions.pod:6934
15520 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
15521 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
15522 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
15526 #: ../fish/guestfish-actions.pod:4482
15528 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
15529 "UUID of a filesystem."
15533 #: ../fish/guestfish-actions.pod:4485
15534 msgid "set-memsize"
15538 #: ../fish/guestfish-actions.pod:4487
15543 #: ../fish/guestfish-actions.pod:4489
15546 " set-memsize memsize\n"
15551 #: ../fish/guestfish-actions.pod:4491
15553 "This sets the memory size in megabytes allocated to the qemu subprocess. "
15554 "This only has any effect if called before L</launch>."
15558 #: ../fish/guestfish-actions.pod:4495 ../src/guestfs-actions.pod:6956
15560 "You can also change this by setting the environment variable "
15561 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
15565 #: ../fish/guestfish-actions.pod:4502
15566 msgid "set-network"
15570 #: ../fish/guestfish-actions.pod:4504
15575 #: ../fish/guestfish-actions.pod:4506
15578 " set-network true|false\n"
15583 #: ../fish/guestfish-actions.pod:4508 ../src/guestfs-actions.pod:6973
15585 "If C<network> is true, then the network is enabled in the libguestfs "
15586 "appliance. The default is false."
15590 #: ../fish/guestfish-actions.pod:4511 ../src/guestfs-actions.pod:6976
15592 "This affects whether commands are able to access the network (see "
15593 "L<guestfs(3)/RUNNING COMMANDS>)."
15597 #: ../fish/guestfish-actions.pod:4514
15598 msgid "You must call this before calling L</launch>, otherwise it has no effect."
15602 #: ../fish/guestfish-actions.pod:4517
15607 #: ../fish/guestfish-actions.pod:4521
15610 " set-path searchpath\n"
15615 #: ../fish/guestfish-actions.pod:4523 ../src/guestfs-actions.pod:6992
15616 msgid "Set the path that libguestfs searches for kernel and initrd.img."
15620 #: ../fish/guestfish-actions.pod:4525 ../src/guestfs-actions.pod:6994
15622 "The default is C<$libdir/guestfs> unless overridden by setting "
15623 "C<LIBGUESTFS_PATH> environment variable."
15627 #: ../fish/guestfish-actions.pod:4528 ../src/guestfs-actions.pod:6997
15628 msgid "Setting C<path> to C<NULL> restores the default path."
15632 #: ../fish/guestfish-actions.pod:4530
15637 #: ../fish/guestfish-actions.pod:4532
15642 #: ../fish/guestfish-actions.pod:4534
15645 " set-pgroup true|false\n"
15650 #: ../fish/guestfish-actions.pod:4536 ../src/guestfs-actions.pod:7009
15652 "If C<pgroup> is true, child processes are placed into their own process "
15657 #: ../fish/guestfish-actions.pod:4539 ../src/guestfs-actions.pod:7012
15659 "The practical upshot of this is that signals like C<SIGINT> (from users "
15660 "pressing C<^C>) won't be received by the child process."
15664 #: ../fish/guestfish-actions.pod:4542 ../src/guestfs-actions.pod:7015
15666 "The default for this flag is false, because usually you want C<^C> to kill "
15671 #: ../fish/guestfish-actions.pod:4545
15676 #: ../fish/guestfish-actions.pod:4547
15681 #: ../fish/guestfish-actions.pod:4549
15689 #: ../fish/guestfish-actions.pod:4551 ../src/guestfs-actions.pod:7028
15690 msgid "Set the qemu binary that we will use."
15694 #: ../fish/guestfish-actions.pod:4553 ../src/guestfs-actions.pod:7030
15695 msgid "The default is chosen when the library was compiled by the configure script."
15699 #: ../fish/guestfish-actions.pod:4556 ../src/guestfs-actions.pod:7033
15701 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
15706 #: ../fish/guestfish-actions.pod:4559 ../src/guestfs-actions.pod:7036
15707 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
15711 #: ../fish/guestfish-actions.pod:4561 ../src/guestfs-actions.pod:7038
15713 "Note that you should call this function as early as possible after creating "
15714 "the handle. This is because some pre-launch operations depend on testing "
15715 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
15716 "don't retest features, and so you might see inconsistent results. Using the "
15717 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
15718 "the qemu binary at the same time as the handle is created."
15722 #: ../fish/guestfish-actions.pod:4569
15723 msgid "set-recovery-proc"
15727 #: ../fish/guestfish-actions.pod:4571
15728 msgid "recovery-proc"
15732 #: ../fish/guestfish-actions.pod:4573
15735 " set-recovery-proc true|false\n"
15740 #: ../fish/guestfish-actions.pod:4575
15742 "If this is called with the parameter C<false> then L</launch> does not "
15743 "create a recovery process. The purpose of the recovery process is to stop "
15744 "runaway qemu processes in the case where the main program aborts abruptly."
15748 #: ../fish/guestfish-actions.pod:4580
15750 "This only has any effect if called before L</launch>, and the default is "
15755 #: ../fish/guestfish-actions.pod:4583 ../src/guestfs-actions.pod:7064
15757 "About the only time when you would want to disable this is if the main "
15758 "process will fork itself into the background (\"daemonize\" itself). In "
15759 "this case the recovery process thinks that the main program has disappeared "
15760 "and so kills qemu, which is not very helpful."
15764 #: ../fish/guestfish-actions.pod:4589
15765 msgid "set-selinux"
15769 #: ../fish/guestfish-actions.pod:4591
15774 #: ../fish/guestfish-actions.pod:4593
15777 " set-selinux true|false\n"
15782 #: ../fish/guestfish-actions.pod:4595 ../src/guestfs-actions.pod:7080
15784 "This sets the selinux flag that is passed to the appliance at boot time. "
15785 "The default is C<selinux=0> (disabled)."
15789 #: ../fish/guestfish-actions.pod:4598 ../src/guestfs-actions.pod:7083
15791 "Note that if SELinux is enabled, it is always in Permissive mode "
15792 "(C<enforcing=0>)."
15796 #: ../fish/guestfish-actions.pod:4604
15801 #: ../fish/guestfish-actions.pod:4606
15806 #: ../fish/guestfish-actions.pod:4608
15814 #: ../fish/guestfish-actions.pod:4610 ../src/guestfs-actions.pod:7099
15816 "Change the number of virtual CPUs assigned to the appliance. The default is "
15817 "C<1>. Increasing this may improve performance, though often it has no "
15822 #: ../fish/guestfish-actions.pod:4614
15823 msgid "This function must be called before L</launch>."
15827 #: ../fish/guestfish-actions.pod:4616
15832 #: ../fish/guestfish-actions.pod:4618
15837 #: ../fish/guestfish-actions.pod:4620
15840 " set-trace true|false\n"
15845 #: ../fish/guestfish-actions.pod:4622 ../src/guestfs-actions.pod:7115
15847 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
15848 "return values are traced."
15852 #: ../fish/guestfish-actions.pod:4625 ../src/guestfs-actions.pod:7118
15854 "If you want to trace C API calls into libguestfs (and other libraries) then "
15855 "possibly a better way is to use the external ltrace(1) command."
15859 #: ../fish/guestfish-actions.pod:4629 ../src/guestfs-actions.pod:7122
15861 "Command traces are disabled unless the environment variable "
15862 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
15866 #: ../fish/guestfish-actions.pod:4632
15868 "Trace messages are normally sent to C<stderr>, unless you register a "
15869 "callback to send them somewhere else (see L</set-event-callback>)."
15873 #: ../fish/guestfish-actions.pod:4636
15874 msgid "set-verbose"
15878 #: ../fish/guestfish-actions.pod:4638
15883 #: ../fish/guestfish-actions.pod:4640
15886 " set-verbose true|false\n"
15891 #: ../fish/guestfish-actions.pod:4642 ../src/guestfs-actions.pod:7139
15892 msgid "If C<verbose> is true, this turns on verbose messages."
15896 #: ../fish/guestfish-actions.pod:4644 ../src/guestfs-actions.pod:7141
15898 "Verbose messages are disabled unless the environment variable "
15899 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
15903 #: ../fish/guestfish-actions.pod:4647
15905 "Verbose messages are normally sent to C<stderr>, unless you register a "
15906 "callback to send them somewhere else (see L</set-event-callback>)."
15910 #: ../fish/guestfish-actions.pod:4651
15915 #: ../fish/guestfish-actions.pod:4653
15918 " setcon context\n"
15923 #: ../fish/guestfish-actions.pod:4655 ../src/guestfs-actions.pod:7158
15925 "This sets the SELinux security context of the daemon to the string "
15930 #: ../fish/guestfish-actions.pod:4658 ../src/guestfs-actions.pod:7161
15931 msgid "See the documentation about SELINUX in L<guestfs(3)>."
15935 #: ../fish/guestfish-actions.pod:4660
15940 #: ../fish/guestfish-actions.pod:4662
15943 " setxattr xattr val vallen path\n"
15948 #: ../fish/guestfish-actions.pod:4664 ../src/guestfs-actions.pod:7176
15950 "This call sets the extended attribute named C<xattr> of the file C<path> to "
15951 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
15955 #: ../fish/guestfish-actions.pod:4668
15956 msgid "See also: L</lsetxattr>, L<attr(5)>."
15960 #: ../fish/guestfish-actions.pod:4670
15965 #: ../fish/guestfish-actions.pod:4672
15968 " sfdisk device cyls heads sectors 'lines ...'\n"
15973 #: ../fish/guestfish-actions.pod:4674 ../src/guestfs-actions.pod:7203
15975 "This is a direct interface to the L<sfdisk(8)> program for creating "
15976 "partitions on block devices."
15980 #: ../fish/guestfish-actions.pod:4677 ../src/guestfs-actions.pod:7206
15981 msgid "C<device> should be a block device, for example C</dev/sda>."
15985 #: ../fish/guestfish-actions.pod:4679 ../src/guestfs-actions.pod:7208
15987 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
15988 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
15989 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
15990 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
15991 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
15992 "the kernel) cannot work out the right geometry and you will need to tell it."
15996 #: ../fish/guestfish-actions.pod:4687 ../src/guestfs-actions.pod:7216
15998 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
15999 "refer to the L<sfdisk(8)> manpage."
16003 #: ../fish/guestfish-actions.pod:4690 ../src/guestfs-actions.pod:7219
16005 "To create a single partition occupying the whole disk, you would pass "
16006 "C<lines> as a single element list, when the single element being the string "
16011 #: ../fish/guestfish-actions.pod:4694
16012 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
16016 #: ../fish/guestfish-actions.pod:4697 ../fish/guestfish-actions.pod:4717 ../fish/guestfish-actions.pod:4736
16018 "I<This function is deprecated.> In new code, use the L</part_add> call "
16023 #: ../fish/guestfish-actions.pod:4704
16028 #: ../fish/guestfish-actions.pod:4706
16031 " sfdiskM device 'lines ...'\n"
16036 #: ../fish/guestfish-actions.pod:4708
16038 "This is a simplified interface to the L</sfdisk> command, where partition "
16039 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
16040 "you don't need to specify the cyls, heads and sectors parameters which were "
16041 "rarely if ever used anyway."
16045 #: ../fish/guestfish-actions.pod:4714
16046 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
16050 #: ../fish/guestfish-actions.pod:4724
16055 #: ../fish/guestfish-actions.pod:4726
16058 " sfdisk-N device partnum cyls heads sectors line\n"
16063 #: ../fish/guestfish-actions.pod:4728 ../src/guestfs-actions.pod:7275
16065 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
16066 "(note: C<n> counts from 1)."
16070 #: ../fish/guestfish-actions.pod:4731
16072 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
16073 "cyls/heads/sectors parameters."
16077 #: ../fish/guestfish-actions.pod:4734
16078 msgid "See also: L</part-add>"
16082 #: ../fish/guestfish-actions.pod:4743
16083 msgid "sfdisk-disk-geometry"
16087 #: ../fish/guestfish-actions.pod:4745
16090 " sfdisk-disk-geometry device\n"
16095 #: ../fish/guestfish-actions.pod:4747
16097 "This displays the disk geometry of C<device> read from the partition table. "
16098 "Especially in the case where the underlying block device has been resized, "
16099 "this can be different from the kernel's idea of the geometry (see "
16100 "L</sfdisk-kernel-geometry>)."
16104 #: ../fish/guestfish-actions.pod:4752 ../fish/guestfish-actions.pod:4761 ../src/guestfs-actions.pod:7298 ../src/guestfs-actions.pod:7314
16105 msgid "The result is in human-readable format, and not designed to be parsed."
16109 #: ../fish/guestfish-actions.pod:4755
16110 msgid "sfdisk-kernel-geometry"
16114 #: ../fish/guestfish-actions.pod:4757
16117 " sfdisk-kernel-geometry device\n"
16122 #: ../fish/guestfish-actions.pod:4759 ../src/guestfs-actions.pod:7312
16123 msgid "This displays the kernel's idea of the geometry of C<device>."
16127 #: ../fish/guestfish-actions.pod:4764
16132 #: ../fish/guestfish-actions.pod:4766
16135 " sfdisk-l device\n"
16140 #: ../fish/guestfish-actions.pod:4768 ../src/guestfs-actions.pod:7335
16142 "This displays the partition table on C<device>, in the human-readable output "
16143 "of the L<sfdisk(8)> command. It is not intended to be parsed."
16147 #: ../fish/guestfish-actions.pod:4772
16148 msgid "See also: L</part-list>"
16152 #: ../fish/guestfish-actions.pod:4774
16154 "I<This function is deprecated.> In new code, use the L</part_list> call "
16159 #: ../fish/guestfish-actions.pod:4781
16164 #: ../fish/guestfish-actions.pod:4783
16172 #: ../fish/guestfish-actions.pod:4785 ../src/guestfs-actions.pod:7352
16174 "This call runs a command from the guest filesystem via the guest's "
16179 #: ../fish/guestfish-actions.pod:4788
16180 msgid "This is like L</command>, but passes the command to:"
16184 #: ../fish/guestfish-actions.pod:4790 ../src/guestfs-actions.pod:7357
16187 " /bin/sh -c \"command\"\n"
16192 #: ../fish/guestfish-actions.pod:4792 ../src/guestfs-actions.pod:7359
16194 "Depending on the guest's shell, this usually results in wildcards being "
16195 "expanded, shell expressions being interpolated and so on."
16199 #: ../fish/guestfish-actions.pod:4796
16200 msgid "All the provisos about L</command> apply to this call."
16204 #: ../fish/guestfish-actions.pod:4798
16209 #: ../fish/guestfish-actions.pod:4800
16212 " sh-lines command\n"
16217 #: ../fish/guestfish-actions.pod:4802
16218 msgid "This is the same as L</sh>, but splits the result into a list of lines."
16222 #: ../fish/guestfish-actions.pod:4805
16223 msgid "See also: L</command-lines>"
16227 #: ../fish/guestfish-actions.pod:4807
16232 #: ../fish/guestfish-actions.pod:4809
16240 #: ../fish/guestfish-actions.pod:4811 ../src/guestfs-actions.pod:7393
16241 msgid "Sleep for C<secs> seconds."
16245 #: ../fish/guestfish-actions.pod:4813
16250 #: ../fish/guestfish-actions.pod:4815
16258 #: ../fish/guestfish-actions.pod:4819 ../src/guestfs-actions.pod:7407
16259 msgid "This is the same as the C<stat(2)> system call."
16263 #: ../fish/guestfish-actions.pod:4821
16268 #: ../fish/guestfish-actions.pod:4823
16276 #: ../fish/guestfish-actions.pod:4825 ../src/guestfs-actions.pod:7421
16278 "Returns file system statistics for any mounted file system. C<path> should "
16279 "be a file or directory in the mounted file system (typically it is the mount "
16280 "point itself, but it doesn't need to be)."
16284 #: ../fish/guestfish-actions.pod:4829 ../src/guestfs-actions.pod:7425
16285 msgid "This is the same as the C<statvfs(2)> system call."
16289 #: ../fish/guestfish-actions.pod:4831
16294 #: ../fish/guestfish-actions.pod:4833
16302 #: ../fish/guestfish-actions.pod:4835 ../src/guestfs-actions.pod:7439
16304 "This runs the L<strings(1)> command on a file and returns the list of "
16305 "printable strings found."
16309 #: ../fish/guestfish-actions.pod:4841
16314 #: ../fish/guestfish-actions.pod:4843
16317 " strings-e encoding path\n"
16322 #: ../fish/guestfish-actions.pod:4845
16324 "This is like the L</strings> command, but allows you to specify the encoding "
16325 "of strings that are looked for in the source file C<path>."
16329 #: ../fish/guestfish-actions.pod:4849 ../src/guestfs-actions.pod:7462
16330 msgid "Allowed encodings are:"
16334 #: ../fish/guestfish-actions.pod:4853 ../src/guestfs-actions.pod:7466
16339 #: ../fish/guestfish-actions.pod:4855
16341 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
16342 "ISO-8859-X (this is what L</strings> uses)."
16346 #: ../fish/guestfish-actions.pod:4858 ../src/guestfs-actions.pod:7471
16351 #: ../fish/guestfish-actions.pod:4860 ../src/guestfs-actions.pod:7473
16352 msgid "Single 8-bit-byte characters."
16356 #: ../fish/guestfish-actions.pod:4862 ../src/guestfs-actions.pod:7475
16361 #: ../fish/guestfish-actions.pod:4864 ../src/guestfs-actions.pod:7477
16362 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
16366 #: ../fish/guestfish-actions.pod:4867 ../src/guestfs-actions.pod:7480
16367 msgid "l (lower case letter L)"
16371 #: ../fish/guestfish-actions.pod:4869 ../src/guestfs-actions.pod:7482
16373 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
16374 "examining binaries in Windows guests."
16378 #: ../fish/guestfish-actions.pod:4872 ../src/guestfs-actions.pod:7485
16383 #: ../fish/guestfish-actions.pod:4874 ../src/guestfs-actions.pod:7487
16384 msgid "32-bit big endian such as UCS-4BE."
16388 #: ../fish/guestfish-actions.pod:4876 ../src/guestfs-actions.pod:7489
16393 #: ../fish/guestfish-actions.pod:4878 ../src/guestfs-actions.pod:7491
16394 msgid "32-bit little endian such as UCS-4LE."
16398 #: ../fish/guestfish-actions.pod:4882 ../src/guestfs-actions.pod:7495
16399 msgid "The returned strings are transcoded to UTF-8."
16403 #: ../fish/guestfish-actions.pod:4887
16404 msgid "swapoff-device"
16408 #: ../fish/guestfish-actions.pod:4889
16411 " swapoff-device device\n"
16416 #: ../fish/guestfish-actions.pod:4891
16418 "This command disables the libguestfs appliance swap device or partition "
16419 "named C<device>. See L</swapon-device>."
16423 #: ../fish/guestfish-actions.pod:4895
16424 msgid "swapoff-file"
16428 #: ../fish/guestfish-actions.pod:4897
16431 " swapoff-file file\n"
16436 #: ../fish/guestfish-actions.pod:4899 ../src/guestfs-actions.pod:7526
16437 msgid "This command disables the libguestfs appliance swap on file."
16441 #: ../fish/guestfish-actions.pod:4901
16442 msgid "swapoff-label"
16446 #: ../fish/guestfish-actions.pod:4903
16449 " swapoff-label label\n"
16454 #: ../fish/guestfish-actions.pod:4905 ../src/guestfs-actions.pod:7538
16456 "This command disables the libguestfs appliance swap on labeled swap "
16461 #: ../fish/guestfish-actions.pod:4908
16462 msgid "swapoff-uuid"
16466 #: ../fish/guestfish-actions.pod:4910
16469 " swapoff-uuid uuid\n"
16474 #: ../fish/guestfish-actions.pod:4912 ../src/guestfs-actions.pod:7551
16476 "This command disables the libguestfs appliance swap partition with the given "
16481 #: ../fish/guestfish-actions.pod:4915
16482 msgid "swapon-device"
16486 #: ../fish/guestfish-actions.pod:4917
16489 " swapon-device device\n"
16494 #: ../fish/guestfish-actions.pod:4919
16496 "This command enables the libguestfs appliance to use the swap device or "
16497 "partition named C<device>. The increased memory is made available for all "
16498 "commands, for example those run using L</command> or L</sh>."
16502 #: ../fish/guestfish-actions.pod:4924 ../src/guestfs-actions.pod:7569
16504 "Note that you should not swap to existing guest swap partitions unless you "
16505 "know what you are doing. They may contain hibernation information, or other "
16506 "information that the guest doesn't want you to trash. You also risk leaking "
16507 "information about the host to the guest this way. Instead, attach a new "
16508 "host device to the guest and swap on that."
16512 #: ../fish/guestfish-actions.pod:4931
16513 msgid "swapon-file"
16517 #: ../fish/guestfish-actions.pod:4933
16520 " swapon-file file\n"
16525 #: ../fish/guestfish-actions.pod:4935
16526 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
16530 #: ../fish/guestfish-actions.pod:4938
16531 msgid "swapon-label"
16535 #: ../fish/guestfish-actions.pod:4940
16538 " swapon-label label\n"
16543 #: ../fish/guestfish-actions.pod:4942
16545 "This command enables swap to a labeled swap partition. See "
16546 "L</swapon-device> for other notes."
16550 #: ../fish/guestfish-actions.pod:4945
16551 msgid "swapon-uuid"
16555 #: ../fish/guestfish-actions.pod:4947
16558 " swapon-uuid uuid\n"
16563 #: ../fish/guestfish-actions.pod:4949
16565 "This command enables swap to a swap partition with the given UUID. See "
16566 "L</swapon-device> for other notes."
16570 #: ../fish/guestfish-actions.pod:4952
16575 #: ../fish/guestfish-actions.pod:4954
16583 #: ../fish/guestfish-actions.pod:4956 ../src/guestfs-actions.pod:7624
16585 "This syncs the disk, so that any writes are flushed through to the "
16586 "underlying disk image."
16590 #: ../fish/guestfish-actions.pod:4959 ../src/guestfs-actions.pod:7627
16592 "You should always call this if you have modified a disk image, before "
16593 "closing the handle."
16597 #: ../fish/guestfish-actions.pod:4962
16602 #: ../fish/guestfish-actions.pod:4964
16610 #: ../fish/guestfish-actions.pod:4966 ../src/guestfs-actions.pod:7640
16611 msgid "This command returns up to the last 10 lines of a file as a list of strings."
16615 #: ../fish/guestfish-actions.pod:4972
16620 #: ../fish/guestfish-actions.pod:4974
16623 " tail-n nrlines path\n"
16628 #: ../fish/guestfish-actions.pod:4976 ../src/guestfs-actions.pod:7659
16630 "If the parameter C<nrlines> is a positive number, this returns the last "
16631 "C<nrlines> lines of the file C<path>."
16635 #: ../fish/guestfish-actions.pod:4979 ../src/guestfs-actions.pod:7662
16637 "If the parameter C<nrlines> is a negative number, this returns lines from "
16638 "the file C<path>, starting with the C<-nrlines>th line."
16642 #: ../fish/guestfish-actions.pod:4987
16647 #: ../fish/guestfish-actions.pod:4989
16650 " tar-in (tarfile|-) directory\n"
16655 #: ../fish/guestfish-actions.pod:4991 ../src/guestfs-actions.pod:7683
16657 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
16658 "tar file) into C<directory>."
16662 #: ../fish/guestfish-actions.pod:4994
16663 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
16667 #: ../fish/guestfish-actions.pod:4999
16672 #: ../fish/guestfish-actions.pod:5001
16675 " tar-out directory (tarfile|-)\n"
16680 #: ../fish/guestfish-actions.pod:5003 ../src/guestfs-actions.pod:7700
16682 "This command packs the contents of C<directory> and downloads it to local "
16687 #: ../fish/guestfish-actions.pod:5006
16688 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
16692 #: ../fish/guestfish-actions.pod:5011
16697 #: ../fish/guestfish-actions.pod:5013
16700 " tgz-in (tarball|-) directory\n"
16705 #: ../fish/guestfish-actions.pod:5015 ../src/guestfs-actions.pod:7717
16707 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
16708 "tar file) into C<directory>."
16712 #: ../fish/guestfish-actions.pod:5018
16713 msgid "To upload an uncompressed tarball, use L</tar-in>."
16717 #: ../fish/guestfish-actions.pod:5022
16722 #: ../fish/guestfish-actions.pod:5024
16725 " tgz-out directory (tarball|-)\n"
16730 #: ../fish/guestfish-actions.pod:5026 ../src/guestfs-actions.pod:7733
16732 "This command packs the contents of C<directory> and downloads it to local "
16737 #: ../fish/guestfish-actions.pod:5029
16738 msgid "To download an uncompressed tarball, use L</tar-out>."
16742 #: ../fish/guestfish-actions.pod:5033
16747 #: ../fish/guestfish-actions.pod:5035
16755 #: ../fish/guestfish-actions.pod:5037 ../src/guestfs-actions.pod:7748
16757 "Touch acts like the L<touch(1)> command. It can be used to update the "
16758 "timestamps on a file, or, if the file does not exist, to create a new "
16759 "zero-length file."
16763 #: ../fish/guestfish-actions.pod:5041 ../src/guestfs-actions.pod:7752
16765 "This command only works on regular files, and will fail on other file types "
16766 "such as directories, symbolic links, block special etc."
16770 #: ../fish/guestfish-actions.pod:5044
16775 #: ../fish/guestfish-actions.pod:5046
16783 #: ../fish/guestfish-actions.pod:5048 ../src/guestfs-actions.pod:7765
16785 "This command truncates C<path> to a zero-length file. The file must exist "
16790 #: ../fish/guestfish-actions.pod:5051
16791 msgid "truncate-size"
16795 #: ../fish/guestfish-actions.pod:5053
16798 " truncate-size path size\n"
16803 #: ../fish/guestfish-actions.pod:5055 ../src/guestfs-actions.pod:7779
16805 "This command truncates C<path> to size C<size> bytes. The file must exist "
16810 #: ../fish/guestfish-actions.pod:5058
16812 "If the current file size is less than C<size> then the file is extended to "
16813 "the required size with zero bytes. This creates a sparse file (ie. disk "
16814 "blocks are not allocated for the file until you write to it). To create a "
16815 "non-sparse file of zeroes, use L</fallocate64> instead."
16819 #: ../fish/guestfish-actions.pod:5064
16824 #: ../fish/guestfish-actions.pod:5066
16827 " tune2fs device [force:true|false] [maxmountcount:N] [mountcount:N] "
16828 "[errorbehavior:..] [group:N] [intervalbetweenchecks:N] "
16829 "[reservedblockspercentage:N] [lastmounteddirectory:..] "
16830 "[reservedblockscount:N] [user:N]\n"
16835 #: ../fish/guestfish-actions.pod:5068 ../src/guestfs-actions.pod:7815
16837 "This call allows you to adjust various filesystem parameters of an "
16838 "ext2/ext3/ext4 filesystem called C<device>."
16842 #: ../fish/guestfish-actions.pod:5077 ../src/guestfs-actions.pod:7824
16844 "Force tune2fs to complete the operation even in the face of errors. This is "
16845 "the same as the tune2fs C<-f> option."
16849 #: ../fish/guestfish-actions.pod:5080 ../src/guestfs-actions.pod:7827
16850 msgid "C<maxmountcount>"
16854 #: ../fish/guestfish-actions.pod:5082 ../src/guestfs-actions.pod:7829
16856 "Set the number of mounts after which the filesystem is checked by "
16857 "L<e2fsck(8)>. If this is C<0> then the number of mounts is disregarded. "
16858 "This is the same as the tune2fs C<-c> option."
16862 #: ../fish/guestfish-actions.pod:5086 ../src/guestfs-actions.pod:7833
16863 msgid "C<mountcount>"
16867 #: ../fish/guestfish-actions.pod:5088 ../src/guestfs-actions.pod:7835
16869 "Set the number of times the filesystem has been mounted. This is the same "
16870 "as the tune2fs C<-C> option."
16874 #: ../fish/guestfish-actions.pod:5091 ../src/guestfs-actions.pod:7838
16875 msgid "C<errorbehavior>"
16879 #: ../fish/guestfish-actions.pod:5093 ../src/guestfs-actions.pod:7840
16881 "Change the behavior of the kernel code when errors are detected. Possible "
16882 "values currently are: C<continue>, C<remount-ro>, C<panic>. In practice "
16883 "these options don't really make any difference, particularly for write "
16888 #: ../fish/guestfish-actions.pod:5098 ../src/guestfs-actions.pod:7845
16889 msgid "This is the same as the tune2fs C<-e> option."
16893 #: ../fish/guestfish-actions.pod:5100 ../src/guestfs-actions.pod:7847
16898 #: ../fish/guestfish-actions.pod:5102 ../src/guestfs-actions.pod:7849
16900 "Set the group which can use reserved filesystem blocks. This is the same as "
16901 "the tune2fs C<-g> option except that it can only be specified as a number."
16905 #: ../fish/guestfish-actions.pod:5106 ../src/guestfs-actions.pod:7853
16906 msgid "C<intervalbetweenchecks>"
16910 #: ../fish/guestfish-actions.pod:5108 ../src/guestfs-actions.pod:7855
16912 "Adjust the maximal time between two filesystem checks (in seconds). If the "
16913 "option is passed as C<0> then time-dependent checking is disabled."
16917 #: ../fish/guestfish-actions.pod:5112 ../src/guestfs-actions.pod:7859
16918 msgid "This is the same as the tune2fs C<-i> option."
16922 #: ../fish/guestfish-actions.pod:5114 ../src/guestfs-actions.pod:7861
16923 msgid "C<reservedblockspercentage>"
16927 #: ../fish/guestfish-actions.pod:5116 ../src/guestfs-actions.pod:7863
16929 "Set the percentage of the filesystem which may only be allocated by "
16930 "privileged processes. This is the same as the tune2fs C<-m> option."
16934 #: ../fish/guestfish-actions.pod:5120 ../src/guestfs-actions.pod:7867
16935 msgid "C<lastmounteddirectory>"
16939 #: ../fish/guestfish-actions.pod:5122 ../src/guestfs-actions.pod:7869
16941 "Set the last mounted directory. This is the same as the tune2fs C<-M> "
16946 #: ../fish/guestfish-actions.pod:5125 ../src/guestfs-actions.pod:7872
16948 "C<reservedblockscount> Set the number of reserved filesystem blocks. This "
16949 "is the same as the tune2fs C<-r> option."
16953 #: ../fish/guestfish-actions.pod:5129 ../src/guestfs-actions.pod:7876
16958 #: ../fish/guestfish-actions.pod:5131 ../src/guestfs-actions.pod:7878
16960 "Set the user who can use the reserved filesystem blocks. This is the same "
16961 "as the tune2fs C<-u> option except that it can only be specified as a "
16966 #: ../fish/guestfish-actions.pod:5137
16968 "To get the current values of filesystem parameters, see L</tune2fs-l>. For "
16969 "precise details of how tune2fs works, see the L<tune2fs(8)> man page."
16973 #: ../fish/guestfish-actions.pod:5143
16978 #: ../fish/guestfish-actions.pod:5145
16981 " tune2fs-l device\n"
16986 #: ../fish/guestfish-actions.pod:5147 ../src/guestfs-actions.pod:7920
16988 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
16993 #: ../fish/guestfish-actions.pod:5150 ../src/guestfs-actions.pod:7923
16995 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
16996 "for more details. The list of fields returned isn't clearly defined, and "
16997 "depends on both the version of C<tune2fs> that libguestfs was built against, "
16998 "and the filesystem itself."
17002 #: ../fish/guestfish-actions.pod:5155
17007 #: ../fish/guestfish-actions.pod:5157
17010 " txz-in (tarball|-) directory\n"
17015 #: ../fish/guestfish-actions.pod:5159 ../src/guestfs-actions.pod:7943
17017 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
17018 "tar file) into C<directory>."
17022 #: ../fish/guestfish-actions.pod:5164
17027 #: ../fish/guestfish-actions.pod:5166
17030 " txz-out directory (tarball|-)\n"
17035 #: ../fish/guestfish-actions.pod:5168 ../src/guestfs-actions.pod:7957
17037 "This command packs the contents of C<directory> and downloads it to local "
17038 "file C<tarball> (as an xz compressed tar archive)."
17042 #: ../fish/guestfish-actions.pod:5173
17047 #: ../fish/guestfish-actions.pod:5175
17055 #: ../fish/guestfish-actions.pod:5177 ../src/guestfs-actions.pod:7970
17057 "This function sets the mask used for creating new files and device nodes to "
17062 #: ../fish/guestfish-actions.pod:5180 ../src/guestfs-actions.pod:7973
17064 "Typical umask values would be C<022> which creates new files with "
17065 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
17066 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
17070 #: ../fish/guestfish-actions.pod:5185 ../src/guestfs-actions.pod:7978
17072 "The default umask is C<022>. This is important because it means that "
17073 "directories and device nodes will be created with C<0644> or C<0755> mode "
17074 "even if you specify C<0777>."
17078 #: ../fish/guestfish-actions.pod:5189
17079 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
17083 #: ../fish/guestfish-actions.pod:5192 ../src/guestfs-actions.pod:7985
17084 msgid "This call returns the previous umask."
17088 #: ../fish/guestfish-actions.pod:5194
17093 #: ../fish/guestfish-actions.pod:5196
17098 #: ../fish/guestfish-actions.pod:5198
17101 " umount pathordevice\n"
17106 #: ../fish/guestfish-actions.pod:5200 ../src/guestfs-actions.pod:7997
17108 "This unmounts the given filesystem. The filesystem may be specified either "
17109 "by its mountpoint (path) or the device which contains the filesystem."
17113 #: ../fish/guestfish-actions.pod:5204
17118 #: ../fish/guestfish-actions.pod:5206
17119 msgid "unmount-all"
17123 #: ../fish/guestfish-actions.pod:5208
17131 #: ../fish/guestfish-actions.pod:5210 ../src/guestfs-actions.pod:8010
17132 msgid "This unmounts all mounted filesystems."
17136 #: ../fish/guestfish-actions.pod:5212 ../src/guestfs-actions.pod:8012
17137 msgid "Some internal mounts are not unmounted by this call."
17141 #: ../fish/guestfish-actions.pod:5214
17146 #: ../fish/guestfish-actions.pod:5216
17149 " upload (filename|-) remotefilename\n"
17154 #: ../fish/guestfish-actions.pod:5218 ../fish/guestfish-actions.pod:5231 ../src/guestfs-actions.pod:8025 ../src/guestfs-actions.pod:8049
17155 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
17159 #: ../fish/guestfish-actions.pod:5223
17160 msgid "See also L</download>."
17164 #: ../fish/guestfish-actions.pod:5227
17165 msgid "upload-offset"
17169 #: ../fish/guestfish-actions.pod:5229
17172 " upload-offset (filename|-) remotefilename offset\n"
17177 #: ../fish/guestfish-actions.pod:5234 ../src/guestfs-actions.pod:8052
17179 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
17180 "The intention is to overwrite parts of existing files or devices, although "
17181 "if a non-existant file is specified then it is created with a \"hole\" "
17182 "before C<offset>. The size of the data written is implicit in the size of "
17183 "the source C<filename>."
17187 #: ../fish/guestfish-actions.pod:5241
17189 "Note that there is no limit on the amount of data that can be uploaded with "
17190 "this call, unlike with L</pwrite>, and this call always writes the full "
17191 "amount unless an error occurs."
17195 #: ../fish/guestfish-actions.pod:5246
17196 msgid "See also L</upload>, L</pwrite>."
17200 #: ../fish/guestfish-actions.pod:5250
17205 #: ../fish/guestfish-actions.pod:5252
17208 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
17213 #: ../fish/guestfish-actions.pod:5254 ../src/guestfs-actions.pod:8085
17214 msgid "This command sets the timestamps of a file with nanosecond precision."
17218 #: ../fish/guestfish-actions.pod:5257 ../src/guestfs-actions.pod:8088
17220 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
17225 #: ../fish/guestfish-actions.pod:5260 ../src/guestfs-actions.pod:8091
17227 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
17228 "nanoseconds from the epoch."
17232 #: ../fish/guestfish-actions.pod:5263 ../src/guestfs-actions.pod:8094
17234 "If the C<*nsecs> field contains the special value C<-1> then the "
17235 "corresponding timestamp is set to the current time. (The C<*secs> field is "
17236 "ignored in this case)."
17240 #: ../fish/guestfish-actions.pod:5267 ../src/guestfs-actions.pod:8098
17242 "If the C<*nsecs> field contains the special value C<-2> then the "
17243 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
17248 #: ../fish/guestfish-actions.pod:5271
17253 #: ../fish/guestfish-actions.pod:5273
17261 #: ../fish/guestfish-actions.pod:5275 ../src/guestfs-actions.pod:8111
17262 msgid "Return the libguestfs version number that the program is linked against."
17266 #: ../fish/guestfish-actions.pod:5278 ../src/guestfs-actions.pod:8114
17268 "Note that because of dynamic linking this is not necessarily the version of "
17269 "libguestfs that you compiled against. You can compile the program, and then "
17270 "at runtime dynamically link against a completely different C<libguestfs.so> "
17275 #: ../fish/guestfish-actions.pod:5283 ../src/guestfs-actions.pod:8119
17277 "This call was added in version C<1.0.58>. In previous versions of "
17278 "libguestfs there was no way to get the version number. From C code you can "
17279 "use dynamic linker functions to find out if this symbol exists (if it "
17280 "doesn't, then it's an earlier version)."
17284 #: ../fish/guestfish-actions.pod:5289 ../src/guestfs-actions.pod:8125
17286 "The call returns a structure with four elements. The first three (C<major>, "
17287 "C<minor> and C<release>) are numbers and correspond to the usual version "
17288 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
17289 "but may be used for distro-specific information."
17293 #: ../fish/guestfish-actions.pod:5295 ../src/guestfs-actions.pod:8131
17294 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
17298 #: ../fish/guestfish-actions.pod:5298 ../src/guestfs-actions.pod:8134
17299 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
17303 #: ../fish/guestfish-actions.pod:5300
17305 "I<Note:> Don't use this call to test for availability of features. In "
17306 "enterprise distributions we backport features from later versions into "
17307 "earlier versions, making this an unreliable way to test for features. Use "
17308 "L</available> instead."
17312 #: ../fish/guestfish-actions.pod:5306
17317 #: ../fish/guestfish-actions.pod:5308
17320 " vfs-label device\n"
17325 #: ../fish/guestfish-actions.pod:5310 ../src/guestfs-actions.pod:8154
17326 msgid "This returns the filesystem label of the filesystem on C<device>."
17330 #: ../fish/guestfish-actions.pod:5313 ../src/guestfs-actions.pod:8157
17331 msgid "If the filesystem is unlabeled, this returns the empty string."
17335 #: ../fish/guestfish-actions.pod:5315
17336 msgid "To find a filesystem from the label, use L</findfs-label>."
17340 #: ../fish/guestfish-actions.pod:5317
17345 #: ../fish/guestfish-actions.pod:5319
17348 " vfs-type device\n"
17353 #: ../fish/guestfish-actions.pod:5321 ../src/guestfs-actions.pod:8172
17355 "This command gets the filesystem type corresponding to the filesystem on "
17360 #: ../fish/guestfish-actions.pod:5324 ../src/guestfs-actions.pod:8175
17362 "For most filesystems, the result is the name of the Linux VFS module which "
17363 "would be used to mount this filesystem if you mounted it without specifying "
17364 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
17368 #: ../fish/guestfish-actions.pod:5329
17373 #: ../fish/guestfish-actions.pod:5331
17376 " vfs-uuid device\n"
17381 #: ../fish/guestfish-actions.pod:5333 ../src/guestfs-actions.pod:8191
17382 msgid "This returns the filesystem UUID of the filesystem on C<device>."
17386 #: ../fish/guestfish-actions.pod:5336 ../src/guestfs-actions.pod:8194
17387 msgid "If the filesystem does not have a UUID, this returns the empty string."
17391 #: ../fish/guestfish-actions.pod:5338
17392 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
17396 #: ../fish/guestfish-actions.pod:5340
17397 msgid "vg-activate"
17401 #: ../fish/guestfish-actions.pod:5342
17404 " vg-activate true|false 'volgroups ...'\n"
17409 #: ../fish/guestfish-actions.pod:5344 ../src/guestfs-actions.pod:8210
17411 "This command activates or (if C<activate> is false) deactivates all logical "
17412 "volumes in the listed volume groups C<volgroups>."
17416 #: ../fish/guestfish-actions.pod:5347 ../src/guestfs-actions.pod:8213
17417 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
17421 #: ../fish/guestfish-actions.pod:5349 ../src/guestfs-actions.pod:8215
17423 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
17424 "activated or deactivated."
17428 #: ../fish/guestfish-actions.pod:5352
17429 msgid "vg-activate-all"
17433 #: ../fish/guestfish-actions.pod:5354
17436 " vg-activate-all true|false\n"
17441 #: ../fish/guestfish-actions.pod:5356 ../src/guestfs-actions.pod:8228
17443 "This command activates or (if C<activate> is false) deactivates all logical "
17444 "volumes in all volume groups."
17448 #: ../fish/guestfish-actions.pod:5359 ../src/guestfs-actions.pod:8231
17449 msgid "This command is the same as running C<vgchange -a y|n>"
17453 #: ../fish/guestfish-actions.pod:5361
17458 #: ../fish/guestfish-actions.pod:5363
17461 " vgcreate volgroup 'physvols ...'\n"
17466 #: ../fish/guestfish-actions.pod:5365 ../src/guestfs-actions.pod:8244
17468 "This creates an LVM volume group called C<volgroup> from the non-empty list "
17469 "of physical volumes C<physvols>."
17473 #: ../fish/guestfish-actions.pod:5368
17478 #: ../fish/guestfish-actions.pod:5370
17481 " vglvuuids vgname\n"
17486 #: ../fish/guestfish-actions.pod:5372 ../src/guestfs-actions.pod:8257
17488 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
17489 "volumes created in this volume group."
17493 #: ../fish/guestfish-actions.pod:5375
17495 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
17496 "logical volumes and volume groups."
17500 #: ../fish/guestfish-actions.pod:5378
17501 msgid "See also L</vgpvuuids>."
17505 #: ../fish/guestfish-actions.pod:5380
17510 #: ../fish/guestfish-actions.pod:5382
17513 " vgpvuuids vgname\n"
17518 #: ../fish/guestfish-actions.pod:5384 ../src/guestfs-actions.pod:8277
17520 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
17521 "volumes that this volume group resides on."
17525 #: ../fish/guestfish-actions.pod:5387
17527 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
17528 "physical volumes and volume groups."
17532 #: ../fish/guestfish-actions.pod:5390
17533 msgid "See also L</vglvuuids>."
17537 #: ../fish/guestfish-actions.pod:5392
17542 #: ../fish/guestfish-actions.pod:5394
17545 " vgremove vgname\n"
17550 #: ../fish/guestfish-actions.pod:5396 ../src/guestfs-actions.pod:8297
17551 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
17555 #: ../fish/guestfish-actions.pod:5398 ../src/guestfs-actions.pod:8299
17556 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
17560 #: ../fish/guestfish-actions.pod:5401
17565 #: ../fish/guestfish-actions.pod:5403
17568 " vgrename volgroup newvolgroup\n"
17573 #: ../fish/guestfish-actions.pod:5405 ../src/guestfs-actions.pod:8313
17574 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
17578 #: ../fish/guestfish-actions.pod:5407
17583 #: ../fish/guestfish-actions.pod:5409
17591 #: ../fish/guestfish-actions.pod:5411 ../src/guestfs-actions.pod:8324
17593 "List all the volumes groups detected. This is the equivalent of the "
17594 "L<vgs(8)> command."
17598 #: ../fish/guestfish-actions.pod:5414 ../src/guestfs-actions.pod:8327
17600 "This returns a list of just the volume group names that were detected "
17601 "(eg. C<VolGroup00>)."
17605 #: ../fish/guestfish-actions.pod:5417
17606 msgid "See also L</vgs-full>."
17610 #: ../fish/guestfish-actions.pod:5419
17615 #: ../fish/guestfish-actions.pod:5421
17623 #: ../fish/guestfish-actions.pod:5423 ../src/guestfs-actions.pod:8343
17625 "List all the volumes groups detected. This is the equivalent of the "
17626 "L<vgs(8)> command. The \"full\" version includes all fields."
17630 #: ../fish/guestfish-actions.pod:5426
17635 #: ../fish/guestfish-actions.pod:5428
17643 #: ../fish/guestfish-actions.pod:5430 ../src/guestfs-actions.pod:8357
17645 "This rescans all block devices and rebuilds the list of LVM physical "
17646 "volumes, volume groups and logical volumes."
17650 #: ../fish/guestfish-actions.pod:5433
17655 #: ../fish/guestfish-actions.pod:5435
17663 #: ../fish/guestfish-actions.pod:5437 ../src/guestfs-actions.pod:8370
17664 msgid "This command returns the UUID of the LVM VG named C<vgname>."
17668 #: ../fish/guestfish-actions.pod:5439
17673 #: ../fish/guestfish-actions.pod:5441
17681 #: ../fish/guestfish-actions.pod:5443 ../src/guestfs-actions.pod:8410
17683 "This command counts the characters in a file, using the C<wc -c> external "
17688 #: ../fish/guestfish-actions.pod:5446
17693 #: ../fish/guestfish-actions.pod:5448
17701 #: ../fish/guestfish-actions.pod:5450 ../src/guestfs-actions.pod:8423
17703 "This command counts the lines in a file, using the C<wc -l> external "
17708 #: ../fish/guestfish-actions.pod:5453
17713 #: ../fish/guestfish-actions.pod:5455
17721 #: ../fish/guestfish-actions.pod:5457 ../src/guestfs-actions.pod:8436
17723 "This command counts the words in a file, using the C<wc -w> external "
17728 #: ../fish/guestfish-actions.pod:5460
17733 #: ../fish/guestfish-actions.pod:5462
17736 " write path content\n"
17741 #: ../fish/guestfish-actions.pod:5464 ../src/guestfs-actions.pod:8451
17743 "This call creates a file called C<path>. The content of the file is the "
17744 "string C<content> (which can contain any 8 bit data)."
17748 #: ../fish/guestfish-actions.pod:5467
17749 msgid "See also L</write-append>."
17753 #: ../fish/guestfish-actions.pod:5472
17754 msgid "write-append"
17758 #: ../fish/guestfish-actions.pod:5474
17761 " write-append path content\n"
17766 #: ../fish/guestfish-actions.pod:5476 ../src/guestfs-actions.pod:8471
17768 "This call appends C<content> to the end of file C<path>. If C<path> does "
17769 "not exist, then a new file is created."
17773 #: ../fish/guestfish-actions.pod:5479
17774 msgid "See also L</write>."
17778 #: ../fish/guestfish-actions.pod:5484
17783 #: ../fish/guestfish-actions.pod:5486
17786 " write-file path content size\n"
17791 #: ../fish/guestfish-actions.pod:5488 ../src/guestfs-actions.pod:8498
17793 "This call creates a file called C<path>. The contents of the file is the "
17794 "string C<content> (which can contain any 8 bit data), with length C<size>."
17798 #: ../fish/guestfish-actions.pod:5492 ../src/guestfs-actions.pod:8502
17800 "As a special case, if C<size> is C<0> then the length is calculated using "
17801 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
17805 #: ../fish/guestfish-actions.pod:5496 ../src/guestfs-actions.pod:8506
17807 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
17808 "I<not> work, even if the length is specified."
17812 #: ../fish/guestfish-actions.pod:5502
17813 msgid "I<This function is deprecated.> In new code, use the L</write> call instead."
17817 #: ../fish/guestfish-actions.pod:5509
17822 #: ../fish/guestfish-actions.pod:5511
17825 " zegrep regex path\n"
17830 #: ../fish/guestfish-actions.pod:5513 ../src/guestfs-actions.pod:8523
17831 msgid "This calls the external C<zegrep> program and returns the matching lines."
17835 #: ../fish/guestfish-actions.pod:5519
17840 #: ../fish/guestfish-actions.pod:5521
17843 " zegrepi regex path\n"
17848 #: ../fish/guestfish-actions.pod:5523 ../src/guestfs-actions.pod:8542
17849 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
17853 #: ../fish/guestfish-actions.pod:5529
17858 #: ../fish/guestfish-actions.pod:5531
17866 #: ../fish/guestfish-actions.pod:5533 ../src/guestfs-actions.pod:8560
17867 msgid "This command writes zeroes over the first few blocks of C<device>."
17871 #: ../fish/guestfish-actions.pod:5535 ../src/guestfs-actions.pod:8562
17873 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
17874 "securely wipe the device). It should be sufficient to remove any partition "
17875 "tables, filesystem superblocks and so on."
17879 #: ../fish/guestfish-actions.pod:5539 ../fish/guestfish-actions.pod:5554 ../src/guestfs-actions.pod:8566 ../src/guestfs-actions.pod:8592
17881 "If blocks are already zero, then this command avoids writing zeroes. This "
17882 "prevents the underlying device from becoming non-sparse or growing "
17887 #: ../fish/guestfish-actions.pod:5543
17888 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
17892 #: ../fish/guestfish-actions.pod:5546
17893 msgid "zero-device"
17897 #: ../fish/guestfish-actions.pod:5548
17900 " zero-device device\n"
17905 #: ../fish/guestfish-actions.pod:5550
17907 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
17908 "which just zeroes the first few blocks of a device."
17912 #: ../fish/guestfish-actions.pod:5558
17917 #: ../fish/guestfish-actions.pod:5560
17920 " zerofree device\n"
17925 #: ../fish/guestfish-actions.pod:5562 ../src/guestfs-actions.pod:8611
17927 "This runs the I<zerofree> program on C<device>. This program claims to zero "
17928 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
17929 "possible to compress the filesystem more effectively."
17933 #: ../fish/guestfish-actions.pod:5567 ../src/guestfs-actions.pod:8616
17934 msgid "You should B<not> run this program if the filesystem is mounted."
17938 #: ../fish/guestfish-actions.pod:5570 ../src/guestfs-actions.pod:8619
17940 "It is possible that using this program can damage the filesystem or data on "
17945 #: ../fish/guestfish-actions.pod:5573
17950 #: ../fish/guestfish-actions.pod:5575
17953 " zfgrep pattern path\n"
17958 #: ../fish/guestfish-actions.pod:5577 ../src/guestfs-actions.pod:8633
17959 msgid "This calls the external C<zfgrep> program and returns the matching lines."
17963 #: ../fish/guestfish-actions.pod:5583
17968 #: ../fish/guestfish-actions.pod:5585
17971 " zfgrepi pattern path\n"
17976 #: ../fish/guestfish-actions.pod:5587 ../src/guestfs-actions.pod:8652
17977 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
17981 #: ../fish/guestfish-actions.pod:5593
17986 #: ../fish/guestfish-actions.pod:5595
17989 " zfile meth path\n"
17994 #: ../fish/guestfish-actions.pod:5597 ../src/guestfs-actions.pod:8678
17995 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
17999 #: ../fish/guestfish-actions.pod:5600 ../src/guestfs-actions.pod:8681
18000 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
18004 #: ../fish/guestfish-actions.pod:5602
18005 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
18009 #: ../fish/guestfish-actions.pod:5605
18010 msgid "I<This function is deprecated.> In new code, use the L</file> call instead."
18014 #: ../fish/guestfish-actions.pod:5612
18019 #: ../fish/guestfish-actions.pod:5614
18022 " zgrep regex path\n"
18027 #: ../fish/guestfish-actions.pod:5616 ../src/guestfs-actions.pod:8698
18028 msgid "This calls the external C<zgrep> program and returns the matching lines."
18032 #: ../fish/guestfish-actions.pod:5622
18037 #: ../fish/guestfish-actions.pod:5624
18040 " zgrepi regex path\n"
18045 #: ../fish/guestfish-actions.pod:5626 ../src/guestfs-actions.pod:8717
18046 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
18050 #: ../fish/guestfish-commands.pod:1
18055 #: ../fish/guestfish-commands.pod:3
18060 #: ../fish/guestfish-commands.pod:5
18063 " alloc filename size\n"
18068 #: ../fish/guestfish-commands.pod:7
18070 "This creates an empty (zeroed) file of the given size, and then adds so it "
18071 "can be further examined."
18075 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:243
18076 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
18080 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:245
18081 msgid "Size can be specified using standard suffixes, eg. C<1M>."
18085 #: ../fish/guestfish-commands.pod:14
18087 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
18088 "image, see L</PREPARED DISK IMAGES>."
18092 #: ../fish/guestfish-commands.pod:17
18097 #: ../fish/guestfish-commands.pod:19
18100 " copy-in local [local ...] /remotedir\n"
18105 #: ../fish/guestfish-commands.pod:21
18107 "C<copy-in> copies local files or directories recursively into the disk "
18108 "image, placing them in the directory called C</remotedir> (which must "
18109 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
18110 "other commands as necessary."
18114 #: ../fish/guestfish-commands.pod:26
18116 "Multiple local files and directories can be specified, but the last "
18117 "parameter must always be a remote directory. Wildcards cannot be used."
18121 #: ../fish/guestfish-commands.pod:30
18126 #: ../fish/guestfish-commands.pod:32
18129 " copy-out remote [remote ...] localdir\n"
18134 #: ../fish/guestfish-commands.pod:34
18136 "C<copy-out> copies remote files or directories recursively out of the disk "
18137 "image, placing them on the host disk in a local directory called C<localdir> "
18138 "(which must exist). This guestfish meta-command turns into a sequence of "
18139 "L</download>, L</tar-out> and other commands as necessary."
18143 #: ../fish/guestfish-commands.pod:40
18145 "Multiple remote files and directories can be specified, but the last "
18146 "parameter must always be a local directory. To download to the current "
18147 "directory, use C<.> as in:"
18151 #: ../fish/guestfish-commands.pod:44
18154 " copy-out /home .\n"
18159 #: ../fish/guestfish-commands.pod:46
18161 "Wildcards cannot be used in the ordinary command, but you can use them with "
18162 "the help of L</glob> like this:"
18166 #: ../fish/guestfish-commands.pod:49
18169 " glob copy-out /home/* .\n"
18174 #: ../fish/guestfish-commands.pod:51
18175 msgid "delete-event"
18179 #: ../fish/guestfish-commands.pod:53
18182 " delete-event name\n"
18187 #: ../fish/guestfish-commands.pod:55
18189 "Delete the event handler which was previously registered as C<name>. If "
18190 "multiple event handlers were registered with the same name, they are all "
18195 #: ../fish/guestfish-commands.pod:59
18196 msgid "See also the guestfish commands C<event> and C<list-events>."
18200 #: ../fish/guestfish-commands.pod:61
18205 #: ../fish/guestfish-commands.pod:63
18208 " display filename\n"
18213 #: ../fish/guestfish-commands.pod:65
18215 "Use C<display> (a graphical display program) to display an image file. It "
18216 "downloads the file, and runs C<display> on it."
18220 #: ../fish/guestfish-commands.pod:68
18222 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
18223 "environment variable. For example to use the GNOME display program:"
18227 #: ../fish/guestfish-commands.pod:71
18230 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
18235 #: ../fish/guestfish-commands.pod:73
18236 msgid "See also L<display(1)>."
18240 #: ../fish/guestfish-commands.pod:75
18245 #: ../fish/guestfish-commands.pod:77
18248 " echo [params ...]\n"
18253 #: ../fish/guestfish-commands.pod:79
18254 msgid "This echos the parameters to the terminal."
18258 #: ../fish/guestfish-commands.pod:81
18263 #: ../fish/guestfish-commands.pod:83
18268 #: ../fish/guestfish-commands.pod:85
18273 #: ../fish/guestfish-commands.pod:87
18281 #: ../fish/guestfish-commands.pod:89
18283 "This is used to edit a file. It downloads the file, edits it locally using "
18284 "your editor, then uploads the result."
18288 #: ../fish/guestfish-commands.pod:92
18290 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
18291 "or C<emacs> you will get those corresponding editors."
18295 #: ../fish/guestfish-commands.pod:96
18300 #: ../fish/guestfish-commands.pod:98
18303 " event name eventset \"shell script ...\"\n"
18308 #: ../fish/guestfish-commands.pod:100
18310 "Register a shell script fragment which is executed when an event is raised. "
18311 "See L<guestfs(3)/guestfs_set_event_callback> for a discussion of the event "
18312 "API in libguestfs."
18316 #: ../fish/guestfish-commands.pod:104
18318 "The C<name> parameter is a name that you give to this event handler. It can "
18319 "be any string (even the empty string) and is simply there so you can delete "
18320 "the handler using the guestfish C<delete-event> command."
18324 #: ../fish/guestfish-commands.pod:109
18326 "The C<eventset> parameter is a comma-separated list of one or more events, "
18327 "for example C<close> or C<close,trace>. The special value C<*> means all "
18332 #: ../fish/guestfish-commands.pod:113
18334 "The third and final parameter is the shell script fragment (or any external "
18335 "command) that is executed when any of the events in the eventset occurs. It "
18336 "is executed using C<$SHELL -c>, or if C<$SHELL> is not set then C</bin/sh "
18341 #: ../fish/guestfish-commands.pod:118
18343 "The shell script fragment receives callback parameters as arguments C<$1>, "
18344 "C<$2> etc. The actual event that was called is available in the environment "
18345 "variable C<$EVENT>."
18349 #: ../fish/guestfish-commands.pod:122
18352 " event \"\" close \"echo closed\"\n"
18353 " event messages appliance,library,trace \"echo $@\"\n"
18354 " event \"\" progress \"echo progress: $3/$4\"\n"
18355 " event \"\" * \"echo $EVENT $@\"\n"
18360 #: ../fish/guestfish-commands.pod:127
18361 msgid "See also the guestfish commands C<delete-event> and C<list-events>."
18365 #: ../fish/guestfish-commands.pod:129
18370 #: ../fish/guestfish-commands.pod:131
18373 " glob command args...\n"
18378 #: ../fish/guestfish-commands.pod:133
18380 "Expand wildcards in any paths in the args list, and run C<command> "
18381 "repeatedly on each matching path."
18385 #: ../fish/guestfish-commands.pod:136
18386 msgid "See L</WILDCARDS AND GLOBBING>."
18390 #: ../fish/guestfish-commands.pod:138
18395 #: ../fish/guestfish-commands.pod:140
18398 " hexedit <filename|device>\n"
18399 " hexedit <filename|device> <max>\n"
18400 " hexedit <filename|device> <start> <max>\n"
18405 #: ../fish/guestfish-commands.pod:144
18407 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
18412 #: ../fish/guestfish-commands.pod:147
18414 "This command works by downloading potentially the whole file or device, "
18415 "editing it locally, then uploading it. If the file or device is large, you "
18416 "have to specify which part you wish to edit by using C<max> and/or C<start> "
18417 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
18418 "usual modifiers allowed such as C<1M> (1 megabyte)."
18422 #: ../fish/guestfish-commands.pod:154
18423 msgid "For example to edit the first few sectors of a disk you might do:"
18427 #: ../fish/guestfish-commands.pod:157
18430 " hexedit /dev/sda 1M\n"
18435 #: ../fish/guestfish-commands.pod:159
18437 "which would allow you to edit anywhere within the first megabyte of the "
18442 #: ../fish/guestfish-commands.pod:162
18443 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
18447 #: ../fish/guestfish-commands.pod:164
18450 " hexedit /dev/sda1 0x400 0x400\n"
18455 #: ../fish/guestfish-commands.pod:166
18456 msgid "(assuming the superblock is in the standard location)."
18460 #: ../fish/guestfish-commands.pod:168
18462 "This command requires the external L<hexedit(1)> program. You can specify "
18463 "another program to use by setting the C<HEXEDITOR> environment variable."
18467 #: ../fish/guestfish-commands.pod:172
18468 msgid "See also L</hexdump>."
18472 #: ../fish/guestfish-commands.pod:174
18477 #: ../fish/guestfish-commands.pod:176
18485 #: ../fish/guestfish-commands.pod:178
18486 msgid "Change the local directory, ie. the current directory of guestfish itself."
18490 #: ../fish/guestfish-commands.pod:181
18491 msgid "Note that C<!cd> won't do what you might expect."
18495 #: ../fish/guestfish-commands.pod:183
18496 msgid "list-events"
18500 #: ../fish/guestfish-commands.pod:185
18508 #: ../fish/guestfish-commands.pod:187
18509 msgid "List the event handlers registered using the guestfish C<event> command."
18513 #: ../fish/guestfish-commands.pod:190
18518 #: ../fish/guestfish-commands.pod:192
18523 #: ../fish/guestfish-commands.pod:194
18531 #: ../fish/guestfish-commands.pod:196
18532 msgid "Opens the manual page for guestfish."
18536 #: ../fish/guestfish-commands.pod:198
18541 #: ../fish/guestfish-commands.pod:200
18546 #: ../fish/guestfish-commands.pod:202
18554 #: ../fish/guestfish-commands.pod:204
18562 #: ../fish/guestfish-commands.pod:206
18563 msgid "This is used to view a file."
18567 #: ../fish/guestfish-commands.pod:208
18569 "The default viewer is C<$PAGER>. However if you use the alternate command "
18570 "C<less> you will get the C<less> command specifically."
18574 #: ../fish/guestfish-commands.pod:211
18579 #: ../fish/guestfish-commands.pod:213
18587 #: ../fish/guestfish-commands.pod:215
18589 "Close and reopen the libguestfs handle. It is not necessary to use this "
18590 "normally, because the handle is closed properly when guestfish exits. "
18591 "However this is occasionally useful for testing."
18595 #: ../fish/guestfish-commands.pod:219
18600 #: ../fish/guestfish-commands.pod:221
18603 " setenv VAR value\n"
18608 #: ../fish/guestfish-commands.pod:223
18609 msgid "Set the environment variable C<VAR> to the string C<value>."
18613 #: ../fish/guestfish-commands.pod:225
18614 msgid "To print the value of an environment variable use a shell command such as:"
18618 #: ../fish/guestfish-commands.pod:228
18626 #: ../fish/guestfish-commands.pod:230
18631 #: ../fish/guestfish-commands.pod:232
18634 " sparse filename size\n"
18639 #: ../fish/guestfish-commands.pod:234
18641 "This creates an empty sparse file of the given size, and then adds so it can "
18642 "be further examined."
18646 #: ../fish/guestfish-commands.pod:237
18648 "In all respects it works the same as the L</alloc> command, except that the "
18649 "image file is allocated sparsely, which means that disk blocks are not "
18650 "assigned to the file until they are needed. Sparse disk files only use "
18651 "space when written to, but they are slower and there is a danger you could "
18652 "run out of real disk space during a write operation."
18656 #: ../fish/guestfish-commands.pod:247
18661 #: ../fish/guestfish-commands.pod:249
18669 #: ../fish/guestfish-commands.pod:251
18671 "This command returns a list of the optional groups known to the daemon, and "
18672 "indicates which ones are supported by this build of the libguestfs "
18677 #: ../fish/guestfish-commands.pod:255
18678 msgid "See also L<guestfs(3)/AVAILABILITY>."
18682 #: ../fish/guestfish-commands.pod:257
18687 #: ../fish/guestfish-commands.pod:259
18690 " time command args...\n"
18695 #: ../fish/guestfish-commands.pod:261
18697 "Run the command as usual, but print the elapsed time afterwards. This can "
18698 "be useful for benchmarking operations."
18702 #: ../fish/guestfish-commands.pod:264
18707 #: ../fish/guestfish-commands.pod:266
18715 #: ../fish/guestfish-commands.pod:268
18716 msgid "Remove C<VAR> from the environment."
18720 #: ../fish/guestfish.pod:5
18721 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
18725 #: ../fish/guestfish.pod:9
18728 " guestfish [--options] [commands]\n"
18733 #: ../fish/guestfish.pod:11
18741 #: ../fish/guestfish.pod:13
18744 " guestfish [--ro|--rw] -a disk.img\n"
18749 #: ../fish/guestfish.pod:15
18752 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
18757 #: ../fish/guestfish.pod:17
18760 " guestfish -d libvirt-domain\n"
18765 #: ../fish/guestfish.pod:19
18768 " guestfish [--ro|--rw] -a disk.img -i\n"
18773 #: ../fish/guestfish.pod:21
18776 " guestfish -d libvirt-domain -i\n"
18781 #: ../fish/guestfish.pod:25
18783 "Using guestfish in read/write mode on live virtual machines can be "
18784 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
18785 "option to use guestfish safely if the disk image or virtual machine might be "
18790 #: ../fish/guestfish.pod:32
18792 "Guestfish is a shell and command-line tool for examining and modifying "
18793 "virtual machine filesystems. It uses libguestfs and exposes all of the "
18794 "functionality of the guestfs API, see L<guestfs(3)>."
18798 #: ../fish/guestfish.pod:36
18800 "Guestfish gives you structured access to the libguestfs API, from shell "
18801 "scripts or the command line or interactively. If you want to rescue a "
18802 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
18807 #: ../fish/guestfish.pod:43
18808 msgid "As an interactive shell"
18812 #: ../fish/guestfish.pod:45
18820 #: ../fish/guestfish.pod:47
18823 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
18824 " editing virtual machine filesystems.\n"
18829 #: ../fish/guestfish.pod:50
18832 " Type: 'help' for a list of commands\n"
18833 " 'man' to read the manual\n"
18834 " 'quit' to quit the shell\n"
18839 #: ../fish/guestfish.pod:54
18842 " ><fs> add-ro disk.img\n"
18844 " ><fs> list-filesystems\n"
18845 " /dev/sda1: ext4\n"
18846 " /dev/vg_guest/lv_root: ext4\n"
18847 " /dev/vg_guest/lv_swap: swap\n"
18848 " ><fs> mount /dev/vg_guest/lv_root /\n"
18849 " ><fs> cat /etc/fstab\n"
18851 " # Created by anaconda\n"
18858 #: ../fish/guestfish.pod:67
18859 msgid "From shell scripts"
18863 #: ../fish/guestfish.pod:69
18864 msgid "Create a new C</etc/motd> file in a guest or disk image:"
18868 #: ../fish/guestfish.pod:71
18871 " guestfish <<_EOF_\n"
18874 " mount /dev/vg_guest/lv_root /\n"
18875 " write /etc/motd \"Welcome, new users\"\n"
18881 #: ../fish/guestfish.pod:78
18882 msgid "List the LVM logical volumes in a disk image:"
18886 #: ../fish/guestfish.pod:80
18889 " guestfish -a disk.img --ro <<_EOF_\n"
18897 #: ../fish/guestfish.pod:85
18898 msgid "List all the filesystems in a disk image:"
18902 #: ../fish/guestfish.pod:87
18905 " guestfish -a disk.img --ro <<_EOF_\n"
18907 " list-filesystems\n"
18913 #: ../fish/guestfish.pod:92
18914 msgid "On one command line"
18918 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
18919 msgid "Update C</etc/resolv.conf> in a guest:"
18923 #: ../fish/guestfish.pod:96
18927 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
18928 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
18933 #: ../fish/guestfish.pod:100
18934 msgid "Edit C</boot/grub/grub.conf> interactively:"
18938 #: ../fish/guestfish.pod:102
18941 " guestfish --rw --add disk.img \\\n"
18942 " --mount /dev/vg_guest/lv_root \\\n"
18943 " --mount /dev/sda1:/boot \\\n"
18944 " edit /boot/grub/grub.conf\n"
18949 #: ../fish/guestfish.pod:107
18950 msgid "Mount disks automatically"
18954 #: ../fish/guestfish.pod:109
18956 "Use the I<-i> option to automatically mount the disks from a virtual "
18961 #: ../fish/guestfish.pod:112
18964 " guestfish --ro -a disk.img -i cat /etc/group\n"
18969 #: ../fish/guestfish.pod:114
18972 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
18977 #: ../fish/guestfish.pod:116
18978 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
18982 #: ../fish/guestfish.pod:118
18985 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
18990 #: ../fish/guestfish.pod:120
18991 msgid "As a script interpreter"
18995 #: ../fish/guestfish.pod:122
18996 msgid "Create a 100MB disk containing an ext2-formatted partition:"
19000 #: ../fish/guestfish.pod:124
19003 " #!/usr/bin/guestfish -f\n"
19004 " sparse test1.img 100M\n"
19006 " part-disk /dev/sda mbr\n"
19007 " mkfs ext2 /dev/sda1\n"
19012 #: ../fish/guestfish.pod:130
19013 msgid "Start with a prepared disk"
19017 #: ../fish/guestfish.pod:132
19019 "An alternate way to create a 100MB disk called C<test1.img> containing a "
19020 "single ext2-formatted partition:"
19024 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2243
19027 " guestfish -N fs\n"
19032 #: ../fish/guestfish.pod:137
19033 msgid "To list what is available do:"
19037 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
19040 " guestfish -N help | less\n"
19045 #: ../fish/guestfish.pod:141
19046 msgid "Remote control"
19050 #: ../fish/guestfish.pod:143
19053 " eval \"`guestfish --listen`\"\n"
19054 " guestfish --remote add-ro disk.img\n"
19055 " guestfish --remote run\n"
19056 " guestfish --remote lvs\n"
19061 #: ../fish/guestfish.pod:154
19062 msgid "Displays general help on options."
19066 #: ../fish/guestfish.pod:158
19067 msgid "B<--cmd-help>"
19071 #: ../fish/guestfish.pod:160
19072 msgid "Lists all available guestfish commands."
19076 #: ../fish/guestfish.pod:162
19081 #: ../fish/guestfish.pod:164
19082 msgid "B<--cmd-help cmd>"
19086 #: ../fish/guestfish.pod:166
19087 msgid "Displays detailed help on a single command C<cmd>."
19091 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
19092 msgid "B<-a image>"
19096 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
19097 msgid "B<--add image>"
19101 #: ../fish/guestfish.pod:172
19102 msgid "Add a block device or virtual machine image to the shell."
19106 #: ../fish/guestfish.pod:177
19108 "Using this flag is mostly equivalent to using the C<add> command, with "
19109 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
19110 "the I<--format=...> flag was given."
19114 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
19116 "When used in conjunction with the I<-d> option, this specifies the libvirt "
19117 "URI to use. The default is to use the default libvirt connection."
19121 #: ../fish/guestfish.pod:189
19126 #: ../fish/guestfish.pod:191
19128 "If using the I<--listen> option and a csh-like shell, use this option. See "
19129 "section L</REMOTE CONTROL AND CSH> below."
19133 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
19134 msgid "B<-d libvirt-domain>"
19138 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
19139 msgid "B<--domain libvirt-domain>"
19143 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
19145 "Add disks from the named libvirt domain. If the I<--ro> option is also "
19146 "used, then any libvirt domain can be used. However in write mode, only "
19147 "libvirt domains which are shut down can be named here."
19151 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
19152 msgid "Domain UUIDs can be used instead of names."
19156 #: ../fish/guestfish.pod:204
19158 "Using this flag is mostly equivalent to using the C<add-domain> command, "
19159 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
19160 "if the I<--format:...> flag was given."
19164 #: ../fish/guestfish.pod:208
19169 #: ../fish/guestfish.pod:210
19170 msgid "B<--no-dest-paths>"
19174 #: ../fish/guestfish.pod:212
19176 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
19177 "to hit the tab key to complete paths on the guest filesystem, but this "
19178 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
19179 "allow this feature to be disabled."
19183 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
19185 "When prompting for keys and passphrases, guestfish normally turns echoing "
19186 "off so you cannot see what you are typing. If you are not worried about "
19187 "Tempest attacks and there is no one else in the room you can specify this "
19188 "flag to see what you are typing."
19192 #: ../fish/guestfish.pod:224
19197 #: ../fish/guestfish.pod:226
19198 msgid "B<--file file>"
19202 #: ../fish/guestfish.pod:228
19203 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
19207 #: ../fish/guestfish.pod:231
19210 " #!/usr/bin/guestfish -f\n"
19215 #: ../fish/guestfish.pod:244
19218 " guestfish --format=raw -a disk.img\n"
19223 #: ../fish/guestfish.pod:248
19226 " guestfish --format=raw -a disk.img --format -a another.img\n"
19231 #: ../fish/guestfish.pod:253
19233 "If you have untrusted raw-format guest disk images, you should use this "
19234 "option to specify the disk format. This avoids a possible security problem "
19235 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
19239 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
19240 msgid "B<--inspector>"
19244 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
19246 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
19247 "system and mount filesystems as they would be mounted on the real virtual "
19252 #: ../fish/guestfish.pod:266
19253 msgid "Typical usage is either:"
19257 #: ../fish/guestfish.pod:268
19260 " guestfish -d myguest -i\n"
19265 #: ../fish/guestfish.pod:270
19266 msgid "(for an inactive libvirt domain called I<myguest>), or:"
19270 #: ../fish/guestfish.pod:272
19273 " guestfish --ro -d myguest -i\n"
19278 #: ../fish/guestfish.pod:274
19279 msgid "(for active domains, readonly), or specify the block device directly:"
19283 #: ../fish/guestfish.pod:276
19286 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
19291 #: ../fish/guestfish.pod:278
19293 "Note that the command line syntax changed slightly over older versions of "
19294 "guestfish. You can still use the old syntax:"
19298 #: ../fish/guestfish.pod:281
19301 " guestfish [--ro] -i disk.img\n"
19306 #: ../fish/guestfish.pod:283
19309 " guestfish [--ro] -i libvirt-domain\n"
19314 #: ../fish/guestfish.pod:285
19316 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
19317 "then using other commands to mount the filesystems that were found."
19321 #: ../fish/guestfish.pod:294
19322 msgid "B<--listen>"
19326 #: ../fish/guestfish.pod:296
19328 "Fork into the background and listen for remote commands. See section "
19329 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
19333 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
19338 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
19340 "Connect to a live virtual machine. (Experimental, see "
19341 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
19345 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
19346 msgid "B<-m dev[:mountpoint[:options]]>"
19350 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
19351 msgid "B<--mount dev[:mountpoint[:options]]>"
19355 #: ../fish/guestfish.pod:308
19356 msgid "Mount the named partition or logical volume on the given mountpoint."
19360 #: ../fish/guestfish.pod:310
19361 msgid "If the mountpoint is omitted, it defaults to C</>."
19365 #: ../fish/guestfish.pod:312
19366 msgid "You have to mount something on C</> before most commands will work."
19370 #: ../fish/guestfish.pod:314
19372 "If any I<-m> or I<--mount> options are given, the guest is automatically "
19377 #: ../fish/guestfish.pod:317
19379 "If you don't know what filesystems a disk image contains, you can either run "
19380 "guestfish without this option, then list the partitions, filesystems and LVs "
19381 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
19382 "commands), or you can use the L<virt-filesystems(1)> program."
19386 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
19388 "The third (and rarely used) part of the mount parameter is the list of mount "
19389 "options used to mount the underlying filesystem. If this is not given, then "
19390 "the mount options are either the empty string or C<ro> (the latter if the "
19391 "I<--ro> flag is used). By specifying the mount options, you override this "
19392 "default choice. Probably the only time you would use this is to enable ACLs "
19393 "and/or extended attributes if the filesystem can support them:"
19397 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
19400 " -m /dev/sda1:/:acl,user_xattr\n"
19405 #: ../fish/guestfish.pod:333
19406 msgid "Using this flag is equivalent to using the C<mount-options> command."
19410 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202 ../resize/virt-resize.pod:441
19415 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
19416 msgid "B<--no-sync>"
19420 #: ../fish/guestfish.pod:339
19422 "Disable autosync. This is enabled by default. See the discussion of "
19423 "autosync in the L<guestfs(3)> manpage."
19427 #: ../fish/guestfish.pod:342
19432 #: ../fish/guestfish.pod:344
19433 msgid "B<--new type>"
19437 #: ../fish/guestfish.pod:346
19442 #: ../fish/guestfish.pod:348
19444 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
19445 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
19446 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
19451 #: ../fish/guestfish.pod:353
19452 msgid "B<--progress-bars>"
19456 #: ../fish/guestfish.pod:355
19457 msgid "Enable progress bars, even when guestfish is used non-interactively."
19461 #: ../fish/guestfish.pod:357
19463 "Progress bars are enabled by default when guestfish is used as an "
19464 "interactive shell."
19468 #: ../fish/guestfish.pod:360
19469 msgid "B<--no-progress-bars>"
19473 #: ../fish/guestfish.pod:362
19474 msgid "Disable progress bars."
19478 #: ../fish/guestfish.pod:364
19479 msgid "B<--remote[=pid]>"
19483 #: ../fish/guestfish.pod:366
19485 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
19486 "CONTROL GUESTFISH OVER A SOCKET> below."
19490 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248 ../rescue/virt-rescue.pod:189
19495 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250 ../rescue/virt-rescue.pod:191
19500 #: ../fish/guestfish.pod:373
19502 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
19503 "mounts are done read-only."
19507 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:195
19509 "The option must always be used if the disk image or virtual machine might be "
19510 "running, and is generally recommended in cases where you don't need write "
19511 "access to the disk."
19515 #: ../fish/guestfish.pod:380
19517 "Note that prepared disk images created with I<-N> are not affected by this "
19518 "option. Also commands like C<add> are not affected - you have to specify "
19519 "the C<readonly:true> option explicitly if you need it."
19523 #: ../fish/guestfish.pod:384
19524 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
19528 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262 ../rescue/virt-rescue.pod:201
19529 msgid "B<--selinux>"
19533 #: ../fish/guestfish.pod:388
19534 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
19538 #: ../fish/guestfish.pod:394
19540 "Enable very verbose messages. This is particularly useful if you find a "
19545 #: ../fish/guestfish.pod:401
19546 msgid "Display the guestfish / libguestfs version number and exit."
19550 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278 ../rescue/virt-rescue.pod:231
19555 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280 ../rescue/virt-rescue.pod:233
19560 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
19562 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
19563 "mounts are done read-write."
19567 #: ../fish/guestfish.pod:410
19568 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
19572 #: ../fish/guestfish.pod:414
19573 msgid "Echo each command before executing it."
19577 #: ../fish/guestfish.pod:418
19578 msgid "COMMANDS ON COMMAND LINE"
19582 #: ../fish/guestfish.pod:420
19583 msgid "Any additional (non-option) arguments are treated as commands to execute."
19587 #: ../fish/guestfish.pod:423
19589 "Commands to execute should be separated by a colon (C<:>), where the colon "
19590 "is a separate parameter. Thus:"
19594 #: ../fish/guestfish.pod:426
19597 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
19602 #: ../fish/guestfish.pod:428
19604 "If there are no additional arguments, then we enter a shell, either an "
19605 "interactive shell with a prompt (if the input is a terminal) or a "
19606 "non-interactive shell."
19610 #: ../fish/guestfish.pod:432
19612 "In either command line mode or non-interactive shell, the first command that "
19613 "gives an error causes the whole shell to exit. In interactive mode (with a "
19614 "prompt) if a command fails, you can continue to enter commands."
19618 #: ../fish/guestfish.pod:437
19619 msgid "USING launch (OR run)"
19623 #: ../fish/guestfish.pod:439
19625 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
19626 "then launch it, then mount any disks you need, and finally issue "
19627 "actions/commands. So the general order of the day is:"
19631 #: ../fish/guestfish.pod:447
19632 msgid "add or -a/--add"
19636 #: ../fish/guestfish.pod:451
19637 msgid "launch (aka run)"
19641 #: ../fish/guestfish.pod:455
19642 msgid "mount or -m/--mount"
19646 #: ../fish/guestfish.pod:459
19647 msgid "any other commands"
19651 #: ../fish/guestfish.pod:463
19653 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
19654 "guest before mounting or performing any other commands."
19658 #: ../fish/guestfish.pod:466
19660 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
19661 "I<--new> options were given then C<run> is done automatically, simply "
19662 "because guestfish can't perform the action you asked for without doing this."
19666 #: ../fish/guestfish.pod:471
19667 msgid "OPENING DISKS FOR READ AND WRITE"
19671 #: ../fish/guestfish.pod:473
19673 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
19674 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
19675 "I<-i> and I<-m> open disk images read-only or for writing."
19679 #: ../fish/guestfish.pod:478
19681 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
19682 "opening disk images supplied on the command line for write. To open a disk "
19683 "image read-only you have to do I<-a image --ro>."
19687 #: ../fish/guestfish.pod:482
19689 "This matters: If you accidentally open a live VM disk image writable then "
19690 "you will cause irreversible disk corruption."
19694 #: ../fish/guestfish.pod:485
19696 "In a future libguestfs we intend to change the default the other way. Disk "
19697 "images will be opened read-only. You will have to either specify "
19698 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
19699 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
19700 "access for disk images specified by those other command line options."
19704 #: ../fish/guestfish.pod:492
19706 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
19707 "which does nothing (it is already the default). However it is highly "
19708 "recommended that you use this option to indicate that you need write access, "
19709 "and prepare your scripts for the day when this option will be required for "
19714 #: ../fish/guestfish.pod:498
19716 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
19717 "other libguestfs program apart from guestfish and guestmount."
19721 #: ../fish/guestfish.pod:501
19726 #: ../fish/guestfish.pod:503
19728 "You can quote ordinary parameters using either single or double quotes. For "
19733 #: ../fish/guestfish.pod:506
19736 " add \"file with a space.img\"\n"
19741 #: ../fish/guestfish.pod:508
19744 " rm '/file name'\n"
19749 #: ../fish/guestfish.pod:510
19757 #: ../fish/guestfish.pod:512
19759 "A few commands require a list of strings to be passed. For these, use a "
19760 "whitespace-separated list, enclosed in quotes. Strings containing "
19761 "whitespace to be passed through must be enclosed in single quotes. A "
19762 "literal single quote must be escaped with a backslash."
19766 #: ../fish/guestfish.pod:517
19769 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
19770 " command \"/bin/echo 'foo bar'\"\n"
19771 " command \"/bin/echo \\'foo\\'\"\n"
19776 #: ../fish/guestfish.pod:521
19777 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
19781 #: ../fish/guestfish.pod:523
19783 "In double-quoted arguments (only) use backslash to insert special "
19788 #: ../fish/guestfish.pod:528
19793 #: ../fish/guestfish.pod:530
19794 msgid "Alert (bell) character."
19798 #: ../fish/guestfish.pod:532
19803 #: ../fish/guestfish.pod:534
19804 msgid "Backspace character."
19808 #: ../fish/guestfish.pod:536
19813 #: ../fish/guestfish.pod:538
19814 msgid "Form feed character."
19818 #: ../fish/guestfish.pod:540
19823 #: ../fish/guestfish.pod:542
19824 msgid "Newline character."
19828 #: ../fish/guestfish.pod:544
19833 #: ../fish/guestfish.pod:546
19834 msgid "Carriage return character."
19838 #: ../fish/guestfish.pod:548
19843 #: ../fish/guestfish.pod:550
19844 msgid "Horizontal tab character."
19848 #: ../fish/guestfish.pod:552
19853 #: ../fish/guestfish.pod:554
19854 msgid "Vertical tab character."
19858 #: ../fish/guestfish.pod:556
19863 #: ../fish/guestfish.pod:558
19864 msgid "A literal double quote character."
19868 #: ../fish/guestfish.pod:560
19873 #: ../fish/guestfish.pod:562
19875 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
19880 #: ../fish/guestfish.pod:565
19885 #: ../fish/guestfish.pod:567
19886 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
19890 #: ../fish/guestfish.pod:570
19892 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
19897 #: ../fish/guestfish.pod:573
19902 #: ../fish/guestfish.pod:575
19903 msgid "A literal backslash character."
19907 #: ../fish/guestfish.pod:579
19908 msgid "OPTIONAL ARGUMENTS"
19912 #: ../fish/guestfish.pod:581
19914 "Some commands take optional arguments. These arguments appear in this "
19915 "documentation as C<[argname:..]>. You can use them as in these examples:"
19919 #: ../fish/guestfish.pod:585
19922 " add-drive-opts filename\n"
19927 #: ../fish/guestfish.pod:587
19930 " add-drive-opts filename readonly:true\n"
19935 #: ../fish/guestfish.pod:589
19938 " add-drive-opts filename format:qcow2 readonly:false\n"
19943 #: ../fish/guestfish.pod:591
19945 "Each optional argument can appear at most once. All optional arguments must "
19946 "appear after the required ones."
19950 #: ../fish/guestfish.pod:594
19955 #: ../fish/guestfish.pod:596
19956 msgid "This section applies to all commands which can take integers as parameters."
19960 #: ../fish/guestfish.pod:599
19961 msgid "SIZE SUFFIX"
19965 #: ../fish/guestfish.pod:601
19967 "When the command takes a parameter measured in bytes, you can use one of the "
19968 "following suffixes to specify kilobytes, megabytes and larger sizes:"
19972 #: ../fish/guestfish.pod:607
19973 msgid "B<k> or B<K> or B<KiB>"
19977 #: ../fish/guestfish.pod:609
19978 msgid "The size in kilobytes (multiplied by 1024)."
19982 #: ../fish/guestfish.pod:611
19987 #: ../fish/guestfish.pod:613
19988 msgid "The size in SI 1000 byte units."
19992 #: ../fish/guestfish.pod:615
19993 msgid "B<M> or B<MiB>"
19997 #: ../fish/guestfish.pod:617
19998 msgid "The size in megabytes (multiplied by 1048576)."
20002 #: ../fish/guestfish.pod:619
20007 #: ../fish/guestfish.pod:621
20008 msgid "The size in SI 1000000 byte units."
20012 #: ../fish/guestfish.pod:623
20013 msgid "B<G> or B<GiB>"
20017 #: ../fish/guestfish.pod:625
20018 msgid "The size in gigabytes (multiplied by 2**30)."
20022 #: ../fish/guestfish.pod:627
20027 #: ../fish/guestfish.pod:629
20028 msgid "The size in SI 10**9 byte units."
20032 #: ../fish/guestfish.pod:631
20033 msgid "B<T> or B<TiB>"
20037 #: ../fish/guestfish.pod:633
20038 msgid "The size in terabytes (multiplied by 2**40)."
20042 #: ../fish/guestfish.pod:635
20047 #: ../fish/guestfish.pod:637
20048 msgid "The size in SI 10**12 byte units."
20052 #: ../fish/guestfish.pod:639
20053 msgid "B<P> or B<PiB>"
20057 #: ../fish/guestfish.pod:641
20058 msgid "The size in petabytes (multiplied by 2**50)."
20062 #: ../fish/guestfish.pod:643
20067 #: ../fish/guestfish.pod:645
20068 msgid "The size in SI 10**15 byte units."
20072 #: ../fish/guestfish.pod:647
20073 msgid "B<E> or B<EiB>"
20077 #: ../fish/guestfish.pod:649
20078 msgid "The size in exabytes (multiplied by 2**60)."
20082 #: ../fish/guestfish.pod:651
20087 #: ../fish/guestfish.pod:653
20088 msgid "The size in SI 10**18 byte units."
20092 #: ../fish/guestfish.pod:655
20093 msgid "B<Z> or B<ZiB>"
20097 #: ../fish/guestfish.pod:657
20098 msgid "The size in zettabytes (multiplied by 2**70)."
20102 #: ../fish/guestfish.pod:659
20107 #: ../fish/guestfish.pod:661
20108 msgid "The size in SI 10**21 byte units."
20112 #: ../fish/guestfish.pod:663
20113 msgid "B<Y> or B<YiB>"
20117 #: ../fish/guestfish.pod:665
20118 msgid "The size in yottabytes (multiplied by 2**80)."
20122 #: ../fish/guestfish.pod:667
20127 #: ../fish/guestfish.pod:669
20128 msgid "The size in SI 10**24 byte units."
20132 #: ../fish/guestfish.pod:675
20135 " truncate-size /file 1G\n"
20140 #: ../fish/guestfish.pod:677
20141 msgid "would truncate the file to 1 gigabyte."
20145 #: ../fish/guestfish.pod:679
20147 "Be careful because a few commands take sizes in kilobytes or megabytes "
20148 "(eg. the parameter to L</memsize> is specified in megabytes already). "
20149 "Adding a suffix will probably not do what you expect."
20153 #: ../fish/guestfish.pod:683
20154 msgid "OCTAL AND HEXADECIMAL NUMBERS"
20158 #: ../fish/guestfish.pod:685
20160 "For specifying the radix (base) use the C convention: C<0> to prefix an "
20161 "octal number or C<0x> to prefix a hexadecimal number. For example:"
20165 #: ../fish/guestfish.pod:688
20168 " 1234 decimal number 1234\n"
20169 " 02322 octal number, equivalent to decimal 1234\n"
20170 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
20175 #: ../fish/guestfish.pod:692
20177 "When using the C<chmod> command, you almost always want to specify an octal "
20178 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
20179 "L<chmod(1)> program):"
20183 #: ../fish/guestfish.pod:696
20186 " chmod 0777 /public # OK\n"
20187 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
20192 #: ../fish/guestfish.pod:699
20194 "Commands that return numbers usually print them in decimal, but some "
20195 "commands print numbers in other radices (eg. C<umask> prints the mode in "
20196 "octal, preceeded by C<0>)."
20200 #: ../fish/guestfish.pod:703
20201 msgid "WILDCARDS AND GLOBBING"
20205 #: ../fish/guestfish.pod:705
20207 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
20208 "(globbing) by default. So for example the following will not do what you "
20213 #: ../fish/guestfish.pod:709
20221 #: ../fish/guestfish.pod:711
20223 "Assuming you don't have a directory called literally C</home/*> then the "
20224 "above command will return an error."
20228 #: ../fish/guestfish.pod:714
20229 msgid "To perform wildcard expansion, use the C<glob> command."
20233 #: ../fish/guestfish.pod:716
20236 " glob rm-rf /home/*\n"
20241 #: ../fish/guestfish.pod:718
20243 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
20244 "many times), equivalent to:"
20248 #: ../fish/guestfish.pod:721
20251 " rm-rf /home/jim\n"
20252 " rm-rf /home/joe\n"
20253 " rm-rf /home/mary\n"
20258 #: ../fish/guestfish.pod:725
20259 msgid "C<glob> only works on simple guest paths and not on device names."
20263 #: ../fish/guestfish.pod:727
20265 "If you have several parameters, each containing a wildcard, then glob will "
20266 "perform a Cartesian product."
20270 #: ../fish/guestfish.pod:730
20275 #: ../fish/guestfish.pod:732
20277 "Any line which starts with a I<#> character is treated as a comment and "
20278 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
20279 "a command. For example:"
20283 #: ../fish/guestfish.pod:736
20286 " # this is a comment\n"
20287 " # this is a comment\n"
20288 " foo # NOT a comment\n"
20293 #: ../fish/guestfish.pod:740
20294 msgid "Blank lines are also ignored."
20298 #: ../fish/guestfish.pod:742
20299 msgid "RUNNING COMMANDS LOCALLY"
20303 #: ../fish/guestfish.pod:744
20305 "Any line which starts with a I<!> character is treated as a command sent to "
20306 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
20310 #: ../fish/guestfish.pod:748
20314 " tgz-out /remote local/remote-data.tar.gz\n"
20319 #: ../fish/guestfish.pod:751
20321 "will create a directory C<local> on the host, and then export the contents "
20322 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
20323 "(See C<tgz-out>)."
20327 #: ../fish/guestfish.pod:755
20329 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
20330 "effect, due to the way that subprocesses work in Unix."
20334 #: ../fish/guestfish.pod:758
20335 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
20339 #: ../fish/guestfish.pod:760
20341 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
20342 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
20343 "and executed as guestfish commands."
20347 #: ../fish/guestfish.pod:764
20349 "Thus you can use shell script to construct arbitrary guestfish commands "
20350 "which are then parsed by guestfish."
20354 #: ../fish/guestfish.pod:767
20356 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
20357 "through C</foo.100>) using guestfish commands alone. However this is simple "
20358 "if we use a shell script to create the guestfish commands for us:"
20362 #: ../fish/guestfish.pod:772
20365 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
20370 #: ../fish/guestfish.pod:774
20371 msgid "or with names like C</foo.001>:"
20375 #: ../fish/guestfish.pod:776
20378 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
20383 #: ../fish/guestfish.pod:778
20385 "When using guestfish interactively it can be helpful to just run the shell "
20386 "script first (ie. remove the initial C<E<lt>> character so it is just an "
20387 "ordinary I<!> local command), see what guestfish commands it would run, and "
20388 "when you are happy with those prepend the C<E<lt>> character to run the "
20389 "guestfish commands for real."
20393 #: ../fish/guestfish.pod:784
20398 #: ../fish/guestfish.pod:786
20400 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
20401 "command (a guestfish command) to the second command (any host command). For "
20406 #: ../fish/guestfish.pod:790
20409 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
20414 #: ../fish/guestfish.pod:792
20416 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
20417 "program). The above command would list all accounts in the guest filesystem "
20418 "which have UID 0, ie. root accounts including backdoors. Other examples:"
20422 #: ../fish/guestfish.pod:797
20425 " hexdump /bin/ls | head\n"
20426 " list-devices | tail -1\n"
20427 " tgz-out / - | tar ztf -\n"
20432 #: ../fish/guestfish.pod:801
20434 "The space before the pipe symbol is required, any space after the pipe "
20435 "symbol is optional. Everything after the pipe symbol is just passed "
20436 "straight to the host shell, so it can contain redirections, globs and "
20437 "anything else that makes sense on the host side."
20441 #: ../fish/guestfish.pod:806
20443 "To use a literal argument which begins with a pipe symbol, you have to quote "
20448 #: ../fish/guestfish.pod:809
20456 #: ../fish/guestfish.pod:811
20457 msgid "HOME DIRECTORIES"
20461 #: ../fish/guestfish.pod:813
20463 "If a parameter starts with the character C<~> then the tilde may be expanded "
20464 "as a home directory path (either C<~> for the current user's home directory, "
20465 "or C<~user> for another user)."
20469 #: ../fish/guestfish.pod:817
20471 "Note that home directory expansion happens for users known I<on the host>, "
20472 "not in the guest filesystem."
20476 #: ../fish/guestfish.pod:820
20478 "To use a literal argument which begins with a tilde, you have to quote it, "
20483 #: ../fish/guestfish.pod:823
20491 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:534
20492 msgid "ENCRYPTED DISKS"
20496 #: ../fish/guestfish.pod:827
20498 "Libguestfs has some support for Linux guests encrypted according to the "
20499 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
20500 "disk encryption systems used by modern Linux guests. Currently only "
20501 "LVM-on-LUKS is supported."
20505 #: ../fish/guestfish.pod:832
20506 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
20510 #: ../fish/guestfish.pod:834
20513 " ><fs> vfs-type /dev/sda2\n"
20519 #: ../fish/guestfish.pod:837
20521 "Then open those devices using L</luks-open>. This creates a device-mapper "
20522 "device called C</dev/mapper/luksdev>."
20526 #: ../fish/guestfish.pod:840
20529 " ><fs> luks-open /dev/sda2 luksdev\n"
20530 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
20535 #: ../fish/guestfish.pod:843
20537 "Finally you have to tell LVM to scan for volume groups on the newly created "
20542 #: ../fish/guestfish.pod:846
20546 " vg-activate-all true\n"
20551 #: ../fish/guestfish.pod:849
20552 msgid "The logical volume(s) can now be mounted in the usual way."
20556 #: ../fish/guestfish.pod:851
20558 "Before closing a LUKS device you must unmount any logical volumes on it and "
20559 "deactivate the volume groups by calling C<vg-activate false VG> on each "
20560 "one. Then you can close the mapper device:"
20564 #: ../fish/guestfish.pod:855
20567 " vg-activate false /dev/VG\n"
20568 " luks-close /dev/mapper/luksdev\n"
20573 #: ../fish/guestfish.pod:860
20575 "If a path is prefixed with C<win:> then you can use Windows-style drive "
20576 "letters and paths (with some limitations). The following commands are "
20581 #: ../fish/guestfish.pod:864
20584 " file /WINDOWS/system32/config/system.LOG\n"
20589 #: ../fish/guestfish.pod:866
20592 " file win:\\windows\\system32\\config\\system.log\n"
20597 #: ../fish/guestfish.pod:868
20600 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
20605 #: ../fish/guestfish.pod:870
20607 "The parameter is rewritten \"behind the scenes\" by looking up the position "
20608 "where the drive is mounted, prepending that to the path, changing all "
20609 "backslash characters to forward slash, then resolving the result using "
20610 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
20611 "then the parameter might be rewritten like this:"
20615 #: ../fish/guestfish.pod:876
20618 " win:e:\\foo\\bar => /e/FOO/bar\n"
20623 #: ../fish/guestfish.pod:878
20624 msgid "This only works in argument positions that expect a path."
20628 #: ../fish/guestfish.pod:880
20629 msgid "UPLOADING AND DOWNLOADING FILES"
20633 #: ../fish/guestfish.pod:882
20635 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
20636 "others which upload from or download to a local file, you can use the "
20637 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
20641 #: ../fish/guestfish.pod:886
20649 #: ../fish/guestfish.pod:888
20650 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
20654 #: ../fish/guestfish.pod:891
20657 " tar-out /etc - | tar tf -\n"
20662 #: ../fish/guestfish.pod:893
20664 "writes the tarball to stdout and then pipes that into the external \"tar\" "
20665 "command (see L</PIPES>)."
20669 #: ../fish/guestfish.pod:896
20671 "When using C<-> to read from stdin, the input is read up to the end of "
20672 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
20673 "some arbitrary end marker:"
20677 #: ../fish/guestfish.pod:900
20680 " upload -<<END /foo\n"
20689 #: ../fish/guestfish.pod:906
20691 "Any string of characters can be used instead of C<END>. The end marker must "
20692 "appear on a line of its own, without any preceeding or following characters "
20693 "(not even spaces)."
20697 #: ../fish/guestfish.pod:910
20699 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
20700 "upload local files (so-called \"FileIn\" parameters in the generator)."
20704 #: ../fish/guestfish.pod:913
20705 msgid "EXIT ON ERROR BEHAVIOUR"
20709 #: ../fish/guestfish.pod:915
20711 "By default, guestfish will ignore any errors when in interactive mode "
20712 "(ie. taking commands from a human over a tty), and will exit on the first "
20713 "error in non-interactive mode (scripts, commands given on the command line)."
20717 #: ../fish/guestfish.pod:920
20719 "If you prefix a command with a I<-> character, then that command will not "
20720 "cause guestfish to exit, even if that (one) command returns an error."
20724 #: ../fish/guestfish.pod:924
20725 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
20729 #: ../fish/guestfish.pod:926
20731 "Guestfish can be remote-controlled over a socket. This is useful "
20732 "particularly in shell scripts where you want to make several different "
20733 "changes to a filesystem, but you don't want the overhead of starting up a "
20734 "guestfish process each time."
20738 #: ../fish/guestfish.pod:931
20739 msgid "Start a guestfish server process using:"
20743 #: ../fish/guestfish.pod:933
20746 " eval \"`guestfish --listen`\"\n"
20751 #: ../fish/guestfish.pod:935
20752 msgid "and then send it commands by doing:"
20756 #: ../fish/guestfish.pod:937
20759 " guestfish --remote cmd [...]\n"
20764 #: ../fish/guestfish.pod:939
20765 msgid "To cause the server to exit, send it the exit command:"
20769 #: ../fish/guestfish.pod:943
20771 "Note that the server will normally exit if there is an error in a command. "
20772 "You can change this in the usual way. See section L</EXIT ON ERROR "
20777 #: ../fish/guestfish.pod:947
20778 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
20782 #: ../fish/guestfish.pod:949
20784 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
20785 "is how the I<--remote> option knows where to send the commands. You can "
20786 "have several guestfish listener processes running using:"
20790 #: ../fish/guestfish.pod:953
20793 " eval \"`guestfish --listen`\"\n"
20794 " pid1=$GUESTFISH_PID\n"
20795 " eval \"`guestfish --listen`\"\n"
20796 " pid2=$GUESTFISH_PID\n"
20798 " guestfish --remote=$pid1 cmd\n"
20799 " guestfish --remote=$pid2 cmd\n"
20804 #: ../fish/guestfish.pod:961
20805 msgid "REMOTE CONTROL AND CSH"
20809 #: ../fish/guestfish.pod:963
20811 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
20816 #: ../fish/guestfish.pod:966
20819 " eval \"`guestfish --listen --csh`\"\n"
20824 #: ../fish/guestfish.pod:968
20825 msgid "REMOTE CONTROL DETAILS"
20829 #: ../fish/guestfish.pod:970
20831 "Remote control happens over a Unix domain socket called "
20832 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
20833 "of the process, and C<$PID> is the process ID of the server."
20837 #: ../fish/guestfish.pod:974
20838 msgid "Guestfish client and server versions must match exactly."
20842 #: ../fish/guestfish.pod:976
20843 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
20847 #: ../fish/guestfish.pod:978
20849 "From Bash, you can use the following code which creates a guestfish "
20850 "instance, correctly quotes the command line, handles failure to start, and "
20851 "cleans up guestfish when the script exits:"
20855 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:980
20863 #: ../fish/guestfish.pod:986
20866 " guestfish[0]=\"guestfish\"\n"
20867 " guestfish[1]=\"--listen\"\n"
20868 " guestfish[2]=\"--ro\"\n"
20869 " guestfish[3]=\"-a\"\n"
20870 " guestfish[4]=\"disk.img\"\n"
20875 #: ../fish/guestfish.pod:992
20878 " GUESTFISH_PID=\n"
20879 " eval $(\"${guestfish[@]}\")\n"
20880 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
20881 " echo \"error: guestfish didn't start up, see error messages above\"\n"
20888 #: ../fish/guestfish.pod:999
20891 " cleanup_guestfish ()\n"
20893 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
20895 " trap cleanup_guestfish EXIT ERR\n"
20900 #: ../fish/guestfish.pod:1005
20903 " guestfish --remote -- run\n"
20908 #: ../fish/guestfish.pod:1007
20916 #: ../fish/guestfish.pod:1009
20917 msgid "REMOTE CONTROL RUN COMMAND HANGING"
20921 #: ../fish/guestfish.pod:1011
20923 "Using the C<run> (or C<launch>) command remotely in a command substitution "
20924 "context hangs, ie. don't do (note the backquotes):"
20928 #: ../fish/guestfish.pod:1014
20931 " a=`guestfish --remote run`\n"
20936 #: ../fish/guestfish.pod:1016
20938 "Since the C<run> command produces no output on stdout, this is not useful "
20939 "anyway. For further information see "
20940 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
20944 #: ../fish/guestfish.pod:1020
20945 msgid "PREPARED DISK IMAGES"
20949 #: ../fish/guestfish.pod:1022
20951 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
20952 "preformatted disk images that guestfish can make for you to save typing. "
20953 "This is particularly useful for testing purposes. This option is used "
20954 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
20955 "can be mixed with I<-a>)."
20959 #: ../fish/guestfish.pod:1028
20961 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
20962 "the second and so on. Existing files in the current directory are "
20967 #: ../fish/guestfish.pod:1032
20969 "The type briefly describes how the disk should be sized, partitioned, how "
20970 "filesystem(s) should be created, and how content should be added. "
20971 "Optionally the type can be followed by extra parameters, separated by C<:> "
20972 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
20973 "sparsely-allocated disk, containing a single partition, with the partition "
20974 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
20975 "on a 1GB disk instead."
20979 #: ../fish/guestfish.pod:1040
20980 msgid "To list the available types and any extra parameters they take, run:"
20984 #: ../fish/guestfish.pod:1044
20986 "Note that the prepared filesystem is not mounted. You would usually have to "
20987 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
20991 #: ../fish/guestfish.pod:1048
20993 "If any I<-N> or I<--new> options are given, the guest is automatically "
20998 #: ../fish/guestfish.pod:1053
20999 msgid "Create a 100MB disk with an ext4-formatted partition:"
21003 #: ../fish/guestfish.pod:1055
21006 " guestfish -N fs:ext4\n"
21011 #: ../fish/guestfish.pod:1057
21012 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
21016 #: ../fish/guestfish.pod:1059
21019 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
21024 #: ../fish/guestfish.pod:1061
21025 msgid "Create a blank 200MB disk:"
21029 #: ../fish/guestfish.pod:1063
21032 " guestfish -N disk:200M\n"
21037 #: ../fish/guestfish.pod:1065
21038 msgid "PROGRESS BARS"
21042 #: ../fish/guestfish.pod:1067
21044 "Some (not all) long-running commands send progress notification messages as "
21045 "they are running. Guestfish turns these messages into progress bars."
21049 #: ../fish/guestfish.pod:1071
21051 "When a command that supports progress bars takes longer than two seconds to "
21052 "run, and if progress bars are enabled, then you will see one appearing below "
21057 #: ../fish/guestfish.pod:1075
21060 " ><fs> copy-size /large-file /another-file 2048M\n"
21061 " / 10% [#####-----------------------------------------] 00:30\n"
21066 #: ../fish/guestfish.pod:1078
21068 "The spinner on the left hand side moves round once for every progress "
21069 "notification received from the backend. This is a (reasonably) golden "
21070 "assurance that the command is \"doing something\" even if the progress bar "
21071 "is not moving, because the command is able to send the progress "
21072 "notifications. When the bar reaches 100% and the command finishes, the "
21073 "spinner disappears."
21077 #: ../fish/guestfish.pod:1085
21079 "Progress bars are enabled by default when guestfish is used interactively. "
21080 "You can enable them even for non-interactive modes using I<--progress-bars>, "
21081 "and you can disable them completely using I<--no-progress-bars>."
21085 #: ../fish/guestfish.pod:1090
21086 msgid "GUESTFISH COMMANDS"
21090 #: ../fish/guestfish.pod:1092
21092 "The commands in this section are guestfish convenience commands, in other "
21093 "words, they are not part of the L<guestfs(3)> API."
21097 #: ../fish/guestfish.pod:1095
21102 #: ../fish/guestfish.pod:1097
21111 #: ../fish/guestfish.pod:1100
21112 msgid "Without any parameter, this provides general help."
21116 #: ../fish/guestfish.pod:1102
21117 msgid "With a C<cmd> parameter, this displays detailed help for that command."
21121 #: ../fish/guestfish.pod:1104
21122 msgid "quit | exit"
21126 #: ../fish/guestfish.pod:1106
21127 msgid "This exits guestfish. You can also use C<^D> key."
21131 #: ../fish/guestfish.pod:1108
21132 msgid "@FISH_COMMANDS@"
21136 #: ../fish/guestfish.pod:1110
21141 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1520
21146 #: ../fish/guestfish.pod:1116
21148 "guestfish returns 0 if the commands completed without error, or 1 if there "
21153 #: ../fish/guestfish.pod:1123
21158 #: ../fish/guestfish.pod:1125
21160 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
21165 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3199
21166 msgid "FEBOOTSTRAP_KERNEL"
21170 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3201
21171 msgid "FEBOOTSTRAP_MODULES"
21175 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3203
21177 "These two environment variables allow the kernel that libguestfs uses in the "
21178 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
21179 "most recent host kernel is chosen. For more information about kernel "
21180 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
21181 "available in febootstrap E<ge> 3.8."
21185 #: ../fish/guestfish.pod:1138
21186 msgid "GUESTFISH_DISPLAY_IMAGE"
21190 #: ../fish/guestfish.pod:1140
21192 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
21193 "If not set, it uses L<display(1)>."
21197 #: ../fish/guestfish.pod:1143
21198 msgid "GUESTFISH_PID"
21202 #: ../fish/guestfish.pod:1145
21204 "Used with the I<--remote> option to specify the remote guestfish process to "
21205 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
21209 #: ../fish/guestfish.pod:1149
21214 #: ../fish/guestfish.pod:1151
21216 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
21217 "not specified, the external L<hexedit(1)> program is used."
21221 #: ../fish/guestfish.pod:1155
21226 #: ../fish/guestfish.pod:1157
21228 "If compiled with GNU readline support, various files in the home directory "
21229 "can be used. See L</FILES>."
21233 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3209
21234 msgid "LIBGUESTFS_APPEND"
21238 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3211
21239 msgid "Pass additional options to the guest kernel."
21243 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3213
21244 msgid "LIBGUESTFS_DEBUG"
21248 #: ../fish/guestfish.pod:1166
21250 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
21251 "effect as using the B<-v> option."
21255 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3218
21256 msgid "LIBGUESTFS_MEMSIZE"
21260 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3220
21261 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
21265 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3223
21268 " LIBGUESTFS_MEMSIZE=700\n"
21273 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3225
21274 msgid "LIBGUESTFS_PATH"
21278 #: ../fish/guestfish.pod:1178
21280 "Set the path that guestfish uses to search for kernel and initrd.img. See "
21281 "the discussion of paths in L<guestfs(3)>."
21285 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3230
21286 msgid "LIBGUESTFS_QEMU"
21290 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3232
21292 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
21293 "which was found at compile time by the configure script is used."
21297 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3238
21298 msgid "LIBGUESTFS_TRACE"
21302 #: ../fish/guestfish.pod:1189
21303 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
21307 #: ../fish/guestfish.pod:1191
21312 #: ../fish/guestfish.pod:1193
21314 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
21319 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:260 ../src/guestfs.pod:3243
21324 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3245
21326 "Location of temporary directory, defaults to C</tmp> except for the cached "
21327 "supermin appliance which defaults to C</var/tmp>."
21331 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3248
21333 "If libguestfs was compiled to use the supermin appliance then the real "
21334 "appliance is cached in this directory, shared between all handles belonging "
21335 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
21336 "use in case C</var/tmp> is not large enough."
21340 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297 ../rescue/virt-rescue.pod:310
21345 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301 ../rescue/virt-rescue.pod:314
21346 msgid "$HOME/.libguestfs-tools.rc"
21350 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303 ../rescue/virt-rescue.pod:316
21351 msgid "/etc/libguestfs-tools.conf"
21355 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305 ../rescue/virt-rescue.pod:318
21357 "This configuration file controls the default read-only or read-write mode "
21358 "(I<--ro> or I<--rw>)."
21362 #: ../fish/guestfish.pod:1220
21363 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
21367 #: ../fish/guestfish.pod:1222
21368 msgid "$HOME/.guestfish"
21372 #: ../fish/guestfish.pod:1224
21374 "If compiled with GNU readline support, then the command history is saved in "
21379 #: ../fish/guestfish.pod:1227
21380 msgid "$HOME/.inputrc"
21384 #: ../fish/guestfish.pod:1229
21385 msgid "/etc/inputrc"
21389 #: ../fish/guestfish.pod:1231
21391 "If compiled with GNU readline support, then these files can be used to "
21392 "configure readline. For further information, please see "
21393 "L<readline(3)/INITIALIZATION FILE>."
21397 #: ../fish/guestfish.pod:1235
21398 msgid "To write rules which only apply to guestfish, use:"
21402 #: ../fish/guestfish.pod:1237
21412 #: ../fish/guestfish.pod:1241
21414 "Variables that you can set in inputrc that change the behaviour of guestfish "
21415 "in useful ways include:"
21419 #: ../fish/guestfish.pod:1246
21420 msgid "completion-ignore-case (default: on)"
21424 #: ../fish/guestfish.pod:1248
21426 "By default, guestfish will ignore case when tab-completing paths on the "
21431 #: ../fish/guestfish.pod:1251
21434 " set completion-ignore-case off\n"
21439 #: ../fish/guestfish.pod:1253
21440 msgid "to make guestfish case sensitive."
21444 #: ../fish/guestfish.pod:1257
21449 #: ../fish/guestfish.pod:1259
21450 msgid "test2.img (etc)"
21454 #: ../fish/guestfish.pod:1261
21456 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
21457 "will be created in the file C<test1.img> in the current directory. The "
21458 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
21459 "the same name will be overwritten."
21463 #: ../fish/guestfish.pod:1270
21465 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, "
21466 "L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, "
21467 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, "
21468 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
21469 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
21470 "L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
21471 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
21472 "L<febootstrap-supermin-helper(8)>."
21476 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3341 ../test-tool/libguestfs-test-tool.pod:112
21477 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
21481 #: ../fish/virt-copy-in.pod:5
21482 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
21486 #: ../fish/virt-copy-in.pod:9
21489 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
21494 #: ../fish/virt-copy-in.pod:11
21497 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
21502 #: ../fish/virt-copy-in.pod:15
21504 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
21505 "causing disk corruption. The virtual machine must be shut down before you "
21506 "use this command."
21510 #: ../fish/virt-copy-in.pod:21
21512 "C<virt-copy-in> copies files and directories from the local disk into a "
21513 "virtual machine disk image or named libvirt domain."
21517 #: ../fish/virt-copy-in.pod:24
21519 "You can give one of more filenames and directories on the command line. "
21520 "Directories are copied in recursively. The final parameter must be the "
21521 "destination directory in the disk image which must be an absolute path "
21522 "starting with a C</> character."
21526 #: ../fish/virt-copy-in.pod:33
21529 " virt-copy-in -d MyGuest resolv.conf /etc\n"
21534 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
21535 msgid "Upload a home directory to a guest:"
21539 #: ../fish/virt-copy-in.pod:37
21542 " virt-copy-in -d MyGuest skel /home\n"
21547 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
21548 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
21552 #: ../fish/virt-copy-in.pod:41
21554 "This command is just a simple shell script wrapper around the "
21555 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
21556 "trivial copy, you are probably better off using guestfish directly."
21560 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
21562 "Since the shell script just passes options straight to guestfish, read "
21563 "L<guestfish(1)> to see the full list of options."
21567 #: ../fish/virt-copy-in.pod:52
21569 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
21570 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
21574 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
21575 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
21579 #: ../fish/virt-copy-out.pod:5
21581 "virt-copy-out - Copy files and directories out of a virtual machine disk "
21586 #: ../fish/virt-copy-out.pod:9
21589 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
21594 #: ../fish/virt-copy-out.pod:11
21597 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
21602 #: ../fish/virt-copy-out.pod:15
21604 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
21605 "image or named libvirt domain."
21609 #: ../fish/virt-copy-out.pod:18
21611 "You can give one of more filenames and directories on the command line. "
21612 "Directories are copied out recursively."
21616 #: ../fish/virt-copy-out.pod:23
21617 msgid "Download the home directories from a virtual machine:"
21621 #: ../fish/virt-copy-out.pod:25
21625 " virt-copy-out -d MyGuest /home homes\n"
21630 #: ../fish/virt-copy-out.pod:30
21632 "This command is just a simple shell script wrapper around the "
21633 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
21634 "trivial copy, you are probably better off using guestfish directly."
21638 #: ../fish/virt-copy-out.pod:41
21640 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
21641 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
21645 #: ../fish/virt-tar-in.pod:5
21646 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
21650 #: ../fish/virt-tar-in.pod:9
21653 " virt-tar-in -a disk.img data.tar /destination\n"
21658 #: ../fish/virt-tar-in.pod:11
21661 " virt-tar-in -d domain data.tar /destination\n"
21666 #: ../fish/virt-tar-in.pod:13
21669 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
21674 #: ../fish/virt-tar-in.pod:17
21676 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
21677 "causing disk corruption. The virtual machine must be shut down before you "
21678 "use this command."
21682 #: ../fish/virt-tar-in.pod:23
21684 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
21685 "image or named libvirt domain."
21689 #: ../fish/virt-tar-in.pod:26
21691 "The first parameter is the tar file. Use C<-> to read the tar file from "
21692 "standard input. The second parameter is the absolute target directory to "
21697 #: ../fish/virt-tar-in.pod:34
21700 " virt-tar-in -d MyGuest homes.tar /home\n"
21705 #: ../fish/virt-tar-in.pod:38
21707 "This command is just a simple shell script wrapper around the "
21708 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
21709 "copy, you are probably better off using guestfish directly."
21713 #: ../fish/virt-tar-in.pod:49
21715 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
21716 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
21717 "L<http://libguestfs.org/>."
21721 #: ../fish/virt-tar-out.pod:5
21722 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
21726 #: ../fish/virt-tar-out.pod:9
21729 " virt-tar-out -a disk.img /dir files.tar\n"
21734 #: ../fish/virt-tar-out.pod:11
21737 " virt-tar-out -d domain /dir files.tar\n"
21742 #: ../fish/virt-tar-out.pod:13
21745 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
21750 #: ../fish/virt-tar-out.pod:17
21751 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
21755 #: ../fish/virt-tar-out.pod:20
21757 "The first parameter is the absolute path of the virtual machine directory. "
21758 "The second parameter is the tar file to write. Use C<-> to write to "
21763 #: ../fish/virt-tar-out.pod:26
21764 msgid "Download the home directories from a guest:"
21768 #: ../fish/virt-tar-out.pod:28
21771 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
21776 #: ../fish/virt-tar-out.pod:32
21778 "This command is just a simple shell script wrapper around the "
21779 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
21780 "trivial copy, you are probably better off using guestfish directly."
21784 #: ../fish/virt-tar-out.pod:43
21786 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
21787 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
21791 #: ../fuse/guestmount.pod:5
21792 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
21796 #: ../fuse/guestmount.pod:9
21799 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
21804 #: ../fuse/guestmount.pod:11
21807 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
21812 #: ../fuse/guestmount.pod:13
21815 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
21820 #: ../fuse/guestmount.pod:17
21822 "You must I<not> use C<guestmount> in read-write mode on live virtual "
21823 "machines. If you do this, you risk disk corruption in the VM."
21827 #: ../fuse/guestmount.pod:22
21829 "The guestmount program can be used to mount virtual machine filesystems and "
21830 "other disk images on the host. It uses libguestfs for access to the guest "
21831 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
21832 "a mountable device."
21836 #: ../fuse/guestmount.pod:27
21838 "Along with other options, you have to give at least one device (I<-a> "
21839 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
21840 "option) or use the I<-i> inspection option or the I<--live> option. How "
21841 "this works is better explained in the L<guestfish(1)> manual page, or by "
21842 "looking at the examples below."
21846 #: ../fuse/guestmount.pod:33
21848 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
21849 "by you, and the filesystem will not be visible to any other users unless you "
21850 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
21851 "the filesystem, use the C<fusermount -u> command."
21855 #: ../fuse/guestmount.pod:41
21857 "For a typical Windows guest which has its main filesystem on the first "
21862 #: ../fuse/guestmount.pod:44
21865 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
21870 #: ../fuse/guestmount.pod:46
21872 "For a typical Linux guest which has a /boot filesystem on the first "
21873 "partition, and the root filesystem on a logical volume:"
21877 #: ../fuse/guestmount.pod:49
21880 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
21885 #: ../fuse/guestmount.pod:51
21886 msgid "To get libguestfs to detect guest mountpoints for you:"
21890 #: ../fuse/guestmount.pod:53
21893 " guestmount -a guest.img -i --ro /mnt\n"
21898 #: ../fuse/guestmount.pod:55
21899 msgid "For a libvirt guest called \"Guest\" you could do:"
21903 #: ../fuse/guestmount.pod:57
21906 " guestmount -d Guest -i --ro /mnt\n"
21911 #: ../fuse/guestmount.pod:59
21913 "If you don't know what filesystems are contained in a guest or disk image, "
21914 "use L<virt-filesystems(1)> first:"
21918 #: ../fuse/guestmount.pod:62
21921 " virt-filesystems MyGuest\n"
21926 #: ../fuse/guestmount.pod:64
21928 "If you want to trace the libguestfs calls but without excessive debugging "
21929 "information, we recommend:"
21933 #: ../fuse/guestmount.pod:67
21936 " guestmount [...] --trace /mnt\n"
21941 #: ../fuse/guestmount.pod:69
21942 msgid "If you want to debug the program, we recommend:"
21946 #: ../fuse/guestmount.pod:71
21949 " guestmount [...] --trace --verbose /mnt\n"
21954 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:96 ../resize/virt-resize.pod:627
21959 #: ../fuse/guestmount.pod:75
21960 msgid "Other users cannot see the filesystem by default"
21964 #: ../fuse/guestmount.pod:77
21966 "If you mount a filesystem as one user (eg. root), then other users will not "
21967 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
21968 "option when mounting:"
21972 #: ../fuse/guestmount.pod:81
21975 " sudo guestmount [...] -o allow_other /mnt\n"
21980 #: ../fuse/guestmount.pod:83
21981 msgid "Enabling FUSE"
21985 #: ../fuse/guestmount.pod:85
21987 "On some distros, you may need to add yourself to a special group "
21988 "(eg. C<fuse>) before you can use any FUSE filesystem. This is necessary on "
21989 "Debian and derivatives."
21993 #: ../fuse/guestmount.pod:89
21995 "On other distros, no special group is required. It is not necessary on "
21996 "Fedora or Red Hat Enterprise Linux."
22000 #: ../fuse/guestmount.pod:100
22001 msgid "Add a block device or virtual machine image."
22005 #: ../fuse/guestmount.pod:123
22006 msgid "B<--dir-cache-timeout N>"
22010 #: ../fuse/guestmount.pod:125
22012 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
22013 "seconds. The readdir cache [actually, there are several semi-independent "
22014 "caches] is populated after a readdir(2) call with the stat and extended "
22015 "attributes of the files in the directory, in anticipation that they will be "
22016 "requested soon after."
22020 #: ../fuse/guestmount.pod:131
22022 "There is also a different attribute cache implemented by FUSE (see the FUSE "
22023 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
22024 "requests, only cache existing ones."
22028 #: ../fuse/guestmount.pod:151
22030 "If you have untrusted raw-format guest disk images, you should use this "
22031 "option to specify the disk format. This avoids a possible security problem "
22032 "with malicious guests (CVE-2010-3851). See also "
22033 "L<guestfs(3)/guestfs_add_drive_opts>."
22037 #: ../fuse/guestmount.pod:156
22038 msgid "B<--fuse-help>"
22042 #: ../fuse/guestmount.pod:158
22043 msgid "Display help on special FUSE options (see I<-o> below)."
22047 #: ../fuse/guestmount.pod:162
22048 msgid "Display brief help and exit."
22052 #: ../fuse/guestmount.pod:186
22054 "Mount the named partition or logical volume on the given mountpoint B<in the "
22055 "guest> (this has nothing to do with mountpoints in the host)."
22059 #: ../fuse/guestmount.pod:189
22061 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
22062 "something on C</>."
22066 #: ../fuse/guestmount.pod:206
22068 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
22069 "unmounted. If you specify this option, then we don't attempt to sync the "
22070 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
22074 #: ../fuse/guestmount.pod:211
22075 msgid "B<-o option>"
22079 #: ../fuse/guestmount.pod:213
22080 msgid "B<--option option>"
22084 #: ../fuse/guestmount.pod:215
22085 msgid "Pass extra options to FUSE."
22089 #: ../fuse/guestmount.pod:217
22091 "To get a list of all the extra options supported by FUSE, use the command "
22092 "below. Note that only the FUSE I<-o> options can be passed, and only some "
22093 "of them are a good idea."
22097 #: ../fuse/guestmount.pod:221
22100 " guestmount --fuse-help\n"
22105 #: ../fuse/guestmount.pod:223
22106 msgid "Some potentially useful FUSE options:"
22110 #: ../fuse/guestmount.pod:227
22111 msgid "B<-o allow_other>"
22115 #: ../fuse/guestmount.pod:229
22116 msgid "Allow other users to see the filesystem."
22120 #: ../fuse/guestmount.pod:231
22121 msgid "B<-o attr_timeout=N>"
22125 #: ../fuse/guestmount.pod:233
22126 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
22130 #: ../fuse/guestmount.pod:235
22131 msgid "B<-o kernel_cache>"
22135 #: ../fuse/guestmount.pod:237
22137 "Allow the kernel to cache files (reduces the number of reads that have to go "
22138 "through the L<guestfs(3)> API). This is generally a good idea if you can "
22139 "afford the extra memory usage."
22143 #: ../fuse/guestmount.pod:241
22144 msgid "B<-o uid=N> B<-o gid=N>"
22148 #: ../fuse/guestmount.pod:243
22150 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
22151 "the chosen values."
22155 #: ../fuse/guestmount.pod:252
22157 "Add devices and mount everything read-only. Also disallow writes and make "
22158 "the disk appear read-only to FUSE."
22162 #: ../fuse/guestmount.pod:255
22164 "This is highly recommended if you are not going to edit the guest disk. If "
22165 "the guest is running and this option is I<not> supplied, then there is a "
22166 "strong risk of disk corruption in the guest. We try to prevent this from "
22167 "happening, but it is not always possible."
22171 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:199
22172 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
22176 #: ../fuse/guestmount.pod:264
22177 msgid "Enable SELinux support for the guest."
22181 #: ../fuse/guestmount.pod:270
22182 msgid "Enable verbose messages from underlying libguestfs."
22186 #: ../fuse/guestmount.pod:276
22187 msgid "Display the program version and exit."
22191 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308 ../rescue/virt-rescue.pod:238 ../rescue/virt-rescue.pod:321
22192 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
22196 #: ../fuse/guestmount.pod:289
22201 #: ../fuse/guestmount.pod:291
22202 msgid "Trace libguestfs calls and entry into each FUSE function."
22206 #: ../fuse/guestmount.pod:293
22207 msgid "This also stops the daemon from forking into the background."
22211 #: ../fuse/guestmount.pod:319
22213 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
22214 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
22215 "L<http://fuse.sf.net/>."
22219 #: ../fuse/guestmount.pod:334
22220 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
22224 #: ../inspector/virt-inspector.pod:5
22226 "virt-inspector - Display operating system version and other information "
22227 "about a virtual machine"
22231 #: ../inspector/virt-inspector.pod:9
22234 " virt-inspector [--options] -d domname\n"
22239 #: ../inspector/virt-inspector.pod:11
22242 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
22247 #: ../inspector/virt-inspector.pod:15
22250 " virt-inspector domname\n"
22255 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:148
22258 " virt-inspector disk.img [disk.img ...]\n"
22263 #: ../inspector/virt-inspector.pod:21
22265 "B<virt-inspector> examines a virtual machine or disk image and tries to "
22266 "determine the version of the operating system and other information about "
22267 "the virtual machine."
22271 #: ../inspector/virt-inspector.pod:25
22272 msgid "Virt-inspector produces XML output for feeding into other programs."
22276 #: ../inspector/virt-inspector.pod:27
22278 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
22279 "the libvirt domain (see: C<virsh list --all>)."
22283 #: ../inspector/virt-inspector.pod:30
22285 "You can also run virt-inspector directly on disk images from a single "
22286 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
22287 "has several block devices, in which case you should list several I<-a> "
22288 "options one after another, with the first corresponding to the guest's "
22289 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
22293 #: ../inspector/virt-inspector.pod:37
22295 "You can also run virt-inspector on install disks, live CDs, bootable USB "
22296 "keys and similar."
22300 #: ../inspector/virt-inspector.pod:40
22302 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
22303 "inspect several virtual machines, you have to run virt-inspector several "
22304 "times (for example, from a shell script for-loop)."
22308 #: ../inspector/virt-inspector.pod:45
22310 "Because virt-inspector needs direct access to guest images, it won't "
22311 "normally work over remote libvirt connections."
22315 #: ../inspector/virt-inspector.pod:48
22317 "All of the information available from virt-inspector is also available "
22318 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
22319 "The same information can also be fetched using guestfish or via libguestfs "
22320 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
22321 "WITH OTHER PROGRAMMING LANGUAGES>)."
22325 #: ../inspector/virt-inspector.pod:81
22327 "Libvirt is only used if you specify a C<domname> on the command line. If "
22328 "you specify guest block devices directly (I<-a>), then libvirt is not used "
22333 #: ../inspector/virt-inspector.pod:94
22335 "When prompting for keys and passphrases, virt-inspector normally turns "
22336 "echoing off so you cannot see what you are typing. If you are not worried "
22337 "about Tempest attacks and there is no one else in the room you can specify "
22338 "this flag to see what you are typing."
22342 #: ../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
22344 "Specify the format of disk images given on the command line. If this is "
22345 "omitted then the format is autodetected from the content of the disk image."
22349 #: ../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
22351 "If disk images are requested from libvirt, then this program asks libvirt "
22352 "for this information. In this case, the value of the format parameter is "
22357 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:397 ../resize/virt-resize.pod:489 ../sparsify/virt-sparsify.pod:144 ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102 ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
22359 "If working with untrusted raw-format guest disk images, you should ensure "
22360 "the format is always specified."
22364 #: ../inspector/virt-inspector.pod:135
22365 msgid "B<--xpath> query"
22369 #: ../inspector/virt-inspector.pod:137
22371 "Perform an XPath query on the XML on stdin, and print the result on stdout. "
22372 "In this mode virt-inspector simply runs an XPath query; all other inspection "
22373 "functions are disabled. See L</XPATH QUERIES> below for some examples."
22377 #: ../inspector/virt-inspector.pod:146
22378 msgid "Previous versions of virt-inspector allowed you to write either:"
22382 #: ../inspector/virt-inspector.pod:152
22385 " virt-inspector guestname\n"
22390 #: ../inspector/virt-inspector.pod:160
22395 #: ../inspector/virt-inspector.pod:162
22397 "The virt-inspector XML is described precisely in a RELAX NG schema file "
22398 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
22399 "just an overview."
22403 #: ../inspector/virt-inspector.pod:166
22405 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
22406 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
22407 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
22408 "which is vanishingly rare in real world VMs."
22412 #: ../inspector/virt-inspector.pod:171
22413 msgid "E<lt>operatingsystemE<gt>"
22417 #: ../inspector/virt-inspector.pod:173
22419 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
22420 "describe the operating system, its architecture, the descriptive \"product "
22421 "name\" string, the type of OS and so on, as in this example:"
22425 #: ../inspector/virt-inspector.pod:177
22428 " <operatingsystems>\n"
22429 " <operatingsystem>\n"
22430 " <root>/dev/sda2</root>\n"
22431 " <name>windows</name>\n"
22432 " <arch>i386</arch>\n"
22433 " <distro>windows</distro>\n"
22434 " <product_name>Windows 7 Enterprise</product_name>\n"
22435 " <product_variant>Client</product_variant>\n"
22436 " <major_version>6</major_version>\n"
22437 " <minor_version>1</minor_version>\n"
22438 " <windows_systemroot>/Windows</windows_systemroot>\n"
22439 " <format>installed</format>\n"
22444 #: ../inspector/virt-inspector.pod:190
22446 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
22447 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
22448 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
22449 "architecture. The other fields are fairly self-explanatory, but because "
22450 "these fields are taken directly from the libguestfs inspection API you can "
22451 "find precise information from L<guestfs(3)/INSPECTION>."
22455 #: ../inspector/virt-inspector.pod:198
22457 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
22458 "of view of libguestfs (block devices may have completely different names "
22459 "inside the VM itself)."
22463 #: ../inspector/virt-inspector.pod:202
22464 msgid "E<lt>mountpointsE<gt>"
22468 #: ../inspector/virt-inspector.pod:204
22470 "Un*x-like guests typically have multiple filesystems which are mounted at "
22471 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
22472 "element which looks like this:"
22476 #: ../inspector/virt-inspector.pod:208
22479 " <operatingsystems>\n"
22480 " <operatingsystem>\n"
22483 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
22484 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
22485 " </mountpoints>\n"
22490 #: ../inspector/virt-inspector.pod:216
22492 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
22493 "and may have completely different names inside the guest. Only mountable "
22494 "filesystems appear in this list, not things like swap devices."
22498 #: ../inspector/virt-inspector.pod:221
22499 msgid "E<lt>filesystemsE<gt>"
22503 #: ../inspector/virt-inspector.pod:223
22505 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
22506 "filesystems belonging to the guest, including swap and empty partitions. "
22507 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
22508 "this OS or shared with this OS and other OSes)."
22512 #: ../inspector/virt-inspector.pod:229
22513 msgid "You might see something like this:"
22517 #: ../inspector/virt-inspector.pod:231
22520 " <operatingsystems>\n"
22521 " <operatingsystem>\n"
22524 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
22525 " <type>ext4</type>\n"
22526 " <label>Fedora-13-x86_64</label>\n"
22527 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
22533 #: ../inspector/virt-inspector.pod:241
22535 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
22536 "the label, and the UUID."
22540 #: ../inspector/virt-inspector.pod:244
22541 msgid "E<lt>applicationsE<gt>"
22545 #: ../inspector/virt-inspector.pod:246
22547 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
22548 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
22553 #: ../inspector/virt-inspector.pod:250
22555 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
22556 "Typical values would be C<rpm> and C<deb>."
22560 #: ../inspector/virt-inspector.pod:253
22562 "E<lt>package_managementE<gt>, if present, describes the package manager. "
22563 "Typical values include C<yum>, C<up2date> and C<apt>"
22567 #: ../inspector/virt-inspector.pod:256
22568 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
22572 #: ../inspector/virt-inspector.pod:259
22575 " <operatingsystems>\n"
22576 " <operatingsystem>\n"
22578 " <applications>\n"
22580 " <name>coreutils</name>\n"
22581 " <version>8.5</version>\n"
22582 " <release>1</release>\n"
22583 " </application>\n"
22588 #: ../inspector/virt-inspector.pod:269
22590 "The version and release fields may not be available for some types guests. "
22591 "Other fields are possible, see "
22592 "L<guestfs(3)/guestfs_inspect_list_applications>."
22596 #: ../inspector/virt-inspector.pod:273
22597 msgid "E<lt>drive_mappingsE<gt>"
22601 #: ../inspector/virt-inspector.pod:275
22603 "For operating systems like Windows which use drive letters, virt-inspector "
22604 "is able to find out how drive letters map to filesystems."
22608 #: ../inspector/virt-inspector.pod:279
22611 " <operatingsystems>\n"
22612 " <operatingsystem>\n"
22614 " <drive_mappings>\n"
22615 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
22616 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
22617 " </drive_mappings>\n"
22622 #: ../inspector/virt-inspector.pod:287
22624 "In the example above, drive C maps to the filesystem on the second partition "
22625 "on the first disk, and drive E maps to the filesystem on the first partition "
22626 "on the second disk."
22630 #: ../inspector/virt-inspector.pod:291
22632 "Note that this only covers permanent local filesystem mappings, not things "
22633 "like network shares. Furthermore NTFS volume mount points may not be listed "
22638 #: ../inspector/virt-inspector.pod:295
22639 msgid "E<lt>iconE<gt>"
22643 #: ../inspector/virt-inspector.pod:297
22645 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
22646 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
22647 "very large and high quality."
22651 #: ../inspector/virt-inspector.pod:301
22654 " <operatingsystems>\n"
22655 " <operatingsystem>\n"
22658 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
22659 " [... many lines of base64 data ...]\n"
22665 #: ../inspector/virt-inspector.pod:309
22667 "To display the icon, you have to extract it and convert the base64 data back "
22668 "to a binary file. Use an XPath query or simply an editor to extract the "
22669 "data, then use the coreutils L<base64(1)> program to do the conversion back "
22674 #: ../inspector/virt-inspector.pod:314
22677 " base64 -i -d < icon.data > icon.png\n"
22682 #: ../inspector/virt-inspector.pod:316
22683 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
22687 #: ../inspector/virt-inspector.pod:318
22689 "Virt-inspector can detect some operating system installers on install disks, "
22690 "live CDs, bootable USB keys and more."
22694 #: ../inspector/virt-inspector.pod:321
22696 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
22697 "fields may be present to indicate a live CD, network installer, or one part "
22698 "of a multipart CD. For example:"
22702 #: ../inspector/virt-inspector.pod:325
22705 " <operatingsystems>\n"
22706 " <operatingsystem>\n"
22707 " <root>/dev/sda</root>\n"
22708 " <name>linux</name>\n"
22709 " <arch>i386</arch>\n"
22710 " <distro>ubuntu</distro>\n"
22711 " <product_name>Ubuntu 10.10 "Maverick "
22712 "Meerkat"</product_name>\n"
22713 " <major_version>10</major_version>\n"
22714 " <minor_version>10</minor_version>\n"
22715 " <format>installer</format>\n"
22721 #: ../inspector/virt-inspector.pod:337
22722 msgid "XPATH QUERIES"
22726 #: ../inspector/virt-inspector.pod:339
22728 "Virt-inspector includes built in support for running XPath queries. The "
22729 "reason for including XPath support directly in virt-inspector is simply that "
22730 "there are no good and widely available command line programs that can do "
22731 "XPath queries. The only good one is L<xmlstarlet(1)> and that is not "
22732 "available on Red Hat Enterprise Linux."
22736 #: ../inspector/virt-inspector.pod:346
22738 "To perform an XPath query, use the I<--xpath> option. Note that in this "
22739 "mode, virt-inspector simply reads XML from stdin and outputs the query "
22740 "result on stdout. All other inspection features are disabled in this mode."
22744 #: ../inspector/virt-inspector.pod:353
22747 " $ virt-inspector -d Guest | virt-inspector --xpath '//filesystems'\n"
22749 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
22750 " <type>ext4</type>\n"
22756 #: ../inspector/virt-inspector.pod:359
22759 " $ virt-inspector -d Guest | \\\n"
22760 " virt-inspector --xpath "
22761 "\"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
22767 #: ../inspector/virt-inspector.pod:363
22770 " $ virt-inspector -d Guest | \\\n"
22771 " virt-inspector --xpath 'string(//icon)' | base64 -i -d | display -\n"
22772 " [displays the guest icon, if there is one]\n"
22777 #: ../inspector/virt-inspector.pod:374
22778 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
22782 #: ../inspector/virt-inspector.pod:376
22784 "Early versions of libguestfs shipped with a different virt-inspector program "
22785 "written in Perl (the current version is written in C). The XML output of "
22786 "the Perl virt-inspector was different and it could also output in other "
22787 "formats like text."
22791 #: ../inspector/virt-inspector.pod:381
22792 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
22796 #: ../inspector/virt-inspector.pod:384
22798 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
22799 "versions of virt-inspector with different names:"
22803 #: ../inspector/virt-inspector.pod:387
22806 " virt-inspector Old Perl version.\n"
22807 " virt-inspector2 New C version.\n"
22812 #: ../inspector/virt-inspector.pod:397
22814 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
22815 "L<base64(1)>, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
22819 #: ../inspector/virt-inspector.pod:414
22820 msgid "Matthew Booth L<mbooth@redhat.com>"
22824 #: ../java/examples/guestfs-java.pod:5
22825 msgid "guestfs-java - How to use libguestfs from Java"
22829 #: ../java/examples/guestfs-java.pod:9
22832 " import com.redhat.et.libguestfs.*;\n"
22837 #: ../java/examples/guestfs-java.pod:11
22840 " GuestFS g = new GuestFS ();\n"
22841 " g.add_drive_opts (\"disk.img\", null);\n"
22847 #: ../java/examples/guestfs-java.pod:17
22849 "This manual page documents how to call libguestfs from the Java programming "
22850 "language. This page just documents the differences from the C API and gives "
22851 "some examples. If you are not familiar with using libguestfs, you also need "
22852 "to read L<guestfs(3)>."
22856 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
22857 msgid "CLOSING THE HANDLE"
22861 #: ../java/examples/guestfs-java.pod:24
22863 "The handle is closed when it is reaped by the garbage collector. Because "
22864 "libguestfs handles include a lot of state, it is also possible to close (and "
22865 "hence free) them explicitly by calling the C<close> method."
22869 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
22874 #: ../java/examples/guestfs-java.pod:31
22876 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
22877 "exception. This has a single parameter which is the error message (a "
22882 #: ../java/examples/guestfs-java.pod:35
22883 msgid "Calling any method on a closed handle raises the same exception."
22887 #: ../java/examples/guestfs-java.pod:47
22889 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
22890 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
22891 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
22892 "L<http://caml.inria.fr/>."
22896 #: ../ocaml/examples/guestfs-ocaml.pod:5
22897 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
22901 #: ../ocaml/examples/guestfs-ocaml.pod:9
22902 msgid "Module style:"
22906 #: ../ocaml/examples/guestfs-ocaml.pod:11
22909 " let g = Guestfs.create () in\n"
22910 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
22911 " Guestfs.launch g;\n"
22916 #: ../ocaml/examples/guestfs-ocaml.pod:15
22917 msgid "Object-oriented style:"
22921 #: ../ocaml/examples/guestfs-ocaml.pod:17
22924 " let g = new Guestfs.guestfs () in\n"
22925 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
22931 #: ../ocaml/examples/guestfs-ocaml.pod:21
22934 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
22936 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
22941 #: ../ocaml/examples/guestfs-ocaml.pod:27
22943 "This manual page documents how to call libguestfs from the OCaml programming "
22944 "language. This page just documents the differences from the C API and gives "
22945 "some examples. If you are not familiar with using libguestfs, you also need "
22946 "to read L<guestfs(3)>."
22950 #: ../ocaml/examples/guestfs-ocaml.pod:32
22951 msgid "PROGRAMMING STYLES"
22955 #: ../ocaml/examples/guestfs-ocaml.pod:34
22957 "There are two different programming styles supported by the OCaml bindings. "
22958 "You can use a module style, with each C function mapped to an OCaml "
22963 #: ../ocaml/examples/guestfs-ocaml.pod:38
22966 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
22971 #: ../ocaml/examples/guestfs-ocaml.pod:40
22976 #: ../ocaml/examples/guestfs-ocaml.pod:42
22979 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
22984 #: ../ocaml/examples/guestfs-ocaml.pod:44
22986 "Alternately you can use an object-oriented style, calling methods on the "
22987 "class C<Guestfs.guestfs>:"
22991 #: ../ocaml/examples/guestfs-ocaml.pod:47
22994 " method set_verbose : bool -> unit\n"
22999 #: ../ocaml/examples/guestfs-ocaml.pod:49
23001 "The object-oriented style is usually briefer, and the minor performance "
23002 "penalty isn't noticable in the general overhead of performing libguestfs "
23007 #: ../ocaml/examples/guestfs-ocaml.pod:55
23009 "The handle is closed when it is reaped by the garbage collector. Because "
23010 "libguestfs handles include a lot of state, it is also possible to close (and "
23011 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
23016 #: ../ocaml/examples/guestfs-ocaml.pod:62
23018 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
23019 "exception. This has a single parameter which is the error message (a "
23024 #: ../ocaml/examples/guestfs-ocaml.pod:66
23026 "Calling any function/method on a closed handle raises "
23027 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
23032 #: ../ocaml/examples/guestfs-ocaml.pod:80
23034 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
23035 "L<guestfs-java(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
23036 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
23037 "L<http://caml.inria.fr/>."
23041 #: ../perl/examples/guestfs-perl.pod:5
23042 msgid "guestfs-perl - How to use libguestfs from Perl"
23046 #: ../perl/examples/guestfs-perl.pod:9
23049 " use Sys::Guestfs;\n"
23054 #: ../perl/examples/guestfs-perl.pod:11
23057 " my $h = Sys::Guestfs->new ();\n"
23058 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
23059 " $h->launch ();\n"
23060 " $h->mount_options ('', '/dev/sda1', '/');\n"
23061 " $h->touch ('/hello');\n"
23067 #: ../perl/examples/guestfs-perl.pod:20
23069 "This manual page documents how to call libguestfs from the Perl programming "
23070 "language. This page just documents the differences from the C API and gives "
23071 "some examples. If you are not familiar with using libguestfs, you also need "
23072 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
23076 #: ../perl/examples/guestfs-perl.pod:26
23081 #: ../perl/examples/guestfs-perl.pod:28
23083 "Errors from libguestfs functions turn into calls to C<croak> (see "
23088 #: ../perl/examples/guestfs-perl.pod:41
23090 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
23091 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
23092 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
23093 "L<http://libguestfs.org/>."
23097 #: ../python/examples/guestfs-python.pod:5
23098 msgid "guestfs-python - How to use libguestfs from Python"
23102 #: ../python/examples/guestfs-python.pod:9
23105 " import guestfs\n"
23106 " g = guestfs.GuestFS ()\n"
23107 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
23113 #: ../python/examples/guestfs-python.pod:16
23115 "This manual page documents how to call libguestfs from the Python "
23116 "programming language. This page just documents the differences from the C "
23117 "API and gives some examples. If you are not familiar with using libguestfs, "
23118 "you also need to read L<guestfs(3)>."
23122 #: ../python/examples/guestfs-python.pod:23
23124 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
23125 "single string argument which is the error message."
23129 #: ../python/examples/guestfs-python.pod:26
23130 msgid "MORE DOCUMENTATION"
23134 #: ../python/examples/guestfs-python.pod:28
23139 #: ../python/examples/guestfs-python.pod:30
23143 " >>> import guestfs\n"
23144 " >>> help (guestfs)\n"
23149 #: ../python/examples/guestfs-python.pod:44
23151 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
23152 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
23153 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
23157 #: ../rescue/virt-rescue.pod:5
23158 msgid "virt-rescue - Run a rescue shell on a virtual machine"
23162 #: ../rescue/virt-rescue.pod:9
23165 " virt-rescue [--options] -d domname\n"
23170 #: ../rescue/virt-rescue.pod:11
23173 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
23178 #: ../rescue/virt-rescue.pod:13
23181 " virt-rescue --suggest (-d domname | -a disk.img ...)\n"
23186 #: ../rescue/virt-rescue.pod:17
23189 " virt-rescue [--options] domname\n"
23194 #: ../rescue/virt-rescue.pod:19
23197 " virt-rescue [--options] disk.img [disk.img ...]\n"
23202 #: ../rescue/virt-rescue.pod:23
23204 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
23205 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
23206 "you from doing this, but doesn't catch all cases."
23210 #: ../rescue/virt-rescue.pod:27
23212 "However if you use the I<--ro> (read only) option, then you can attach a "
23213 "shell to a live virtual machine. The results might be strange or "
23214 "inconsistent at times but you won't get disk corruption."
23218 #: ../rescue/virt-rescue.pod:33
23220 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
23221 "need for a CD. virt-rescue gives you a rescue shell and some simple "
23222 "recovery tools which you can use to examine or rescue a virtual machine or "
23227 #: ../rescue/virt-rescue.pod:38
23229 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
23230 "on disk image(s):"
23234 #: ../rescue/virt-rescue.pod:41
23237 " virt-rescue -d GuestName\n"
23242 #: ../rescue/virt-rescue.pod:43
23245 " virt-rescue --ro -a /path/to/disk.img\n"
23250 #: ../rescue/virt-rescue.pod:45
23253 " virt-rescue -a /dev/sdc\n"
23258 #: ../rescue/virt-rescue.pod:47
23259 msgid "For live VMs you I<must> use the --ro option."
23263 #: ../rescue/virt-rescue.pod:49
23265 "When you run virt-rescue on a virtual machine or disk image, you are placed "
23266 "in an interactive bash shell where you can use many ordinary Linux "
23267 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
23268 "appliance. You must mount the virtual machine's filesystems by hand. There "
23269 "is an empty directory called C</sysroot> where you can mount filesystems."
23273 #: ../rescue/virt-rescue.pod:56
23275 "You can get virt-rescue to suggest mount commands for you by using the "
23276 "I<--suggest> option (in another terminal):"
23280 #: ../rescue/virt-rescue.pod:59
23283 " $ virt-rescue --suggest -d Fedora15\n"
23284 " Inspecting the virtual machine or disk image ...\n"
23289 #: ../rescue/virt-rescue.pod:62
23292 " This disk contains one or more operating systems. You can use these\n"
23293 " mount commands in virt-rescue (at the ><rescue> prompt) to mount the\n"
23299 #: ../rescue/virt-rescue.pod:66
23302 " # /dev/vg_f15x32/lv_root is the root of a linux operating system\n"
23303 " # type: linux, distro: fedora, version: 15.0\n"
23304 " # Fedora release 15 (Lovelock)\n"
23309 #: ../rescue/virt-rescue.pod:70
23312 " mount /dev/vg_f15x32/lv_root /sysroot/\n"
23313 " mount /dev/vda1 /sysroot/boot\n"
23314 " mount --bind /dev /sysroot/dev\n"
23315 " mount --bind /dev/pts /sysroot/dev/pts\n"
23316 " mount --bind /proc /sysroot/proc\n"
23317 " mount --bind /sys /sysroot/sys\n"
23322 #: ../rescue/virt-rescue.pod:77
23324 "Another way is to list the logical volumes (with L<lvs(8)>) and partitions "
23325 "(with L<parted(8)>) and mount them by hand:"
23329 #: ../rescue/virt-rescue.pod:80
23333 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
23334 " lv_root vg_f15x32 -wi-a- 8.83G\n"
23335 " lv_swap vg_f15x32 -wi-a- 992.00M\n"
23336 " ><rescue> mount /dev/vg_f15x32/lv_root /sysroot\n"
23337 " ><rescue> mount /dev/vda1 /sysroot/boot\n"
23338 " ><rescue> ls /sysroot\n"
23343 #: ../rescue/virt-rescue.pod:88
23344 msgid "Another command to list available filesystems is L<virt-filesystems(1)>."
23348 #: ../rescue/virt-rescue.pod:91
23350 "To run commands in a Linux guest (for example, grub), you should chroot into "
23351 "the /sysroot directory first:"
23355 #: ../rescue/virt-rescue.pod:94
23358 " ><rescue> chroot /sysroot\n"
23363 #: ../rescue/virt-rescue.pod:98
23365 "Virt-rescue can be used on I<any> disk image file or device, not just a "
23366 "virtual machine. For example you can use it on a blank file if you want to "
23367 "partition that file (although we would recommend using L<guestfish(1)> "
23368 "instead as it is more suitable for this purpose). You can even use "
23369 "virt-rescue on things like SD cards."
23373 #: ../rescue/virt-rescue.pod:104
23375 "Virt-rescue does not require root. You only need to run it as root if you "
23376 "need root to open the disk image."
23380 #: ../rescue/virt-rescue.pod:107
23382 "This tool is just designed for quick interactive hacking on a virtual "
23383 "machine. For more structured access to a virtual machine disk image, you "
23384 "should use L<guestfs(3)>. To get a structured shell that you can use to "
23385 "make scripted changes to guests, use L<guestfish(1)>."
23389 #: ../rescue/virt-rescue.pod:131
23390 msgid "B<--append kernelopts>"
23394 #: ../rescue/virt-rescue.pod:133
23395 msgid "Pass additional options to the rescue kernel."
23399 #: ../rescue/virt-rescue.pod:163
23402 " virt-rescue --format=raw -a disk.img\n"
23407 #: ../rescue/virt-rescue.pod:167
23410 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
23415 #: ../rescue/virt-rescue.pod:176
23420 #: ../rescue/virt-rescue.pod:178
23421 msgid "B<--memsize MB>"
23425 #: ../rescue/virt-rescue.pod:180
23427 "Change the amount of memory allocated to the rescue system. The default is "
23428 "set by libguestfs and is small but adequate for running system tools. The "
23429 "occasional program might need more memory. The parameter is specified in "
23434 #: ../rescue/virt-rescue.pod:185
23435 msgid "B<--network>"
23439 #: ../rescue/virt-rescue.pod:187
23440 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
23444 #: ../rescue/virt-rescue.pod:193
23445 msgid "Open the image read-only."
23449 #: ../rescue/virt-rescue.pod:203
23451 "Enable SELinux in the rescue appliance. You should read "
23452 "L<guestfs(3)/SELINUX> before using this option."
23456 #: ../rescue/virt-rescue.pod:206
23461 #: ../rescue/virt-rescue.pod:208
23462 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
23466 #: ../rescue/virt-rescue.pod:210
23467 msgid "B<--suggest>"
23471 #: ../rescue/virt-rescue.pod:212
23473 "Inspect the disk image and suggest what mount commands should be used to "
23474 "mount the disks. You should use the I<--suggest> option in a second "
23475 "terminal, then paste the commands into another virt-rescue."
23479 #: ../rescue/virt-rescue.pod:216
23481 "This option implies I<--ro> and is safe to use even if the guest is up or if "
23482 "another virt-rescue is running."
23486 #: ../rescue/virt-rescue.pod:235
23488 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
23489 "are done read-write."
23493 #: ../rescue/virt-rescue.pod:248
23494 msgid "Previous versions of virt-rescue allowed you to write either:"
23498 #: ../rescue/virt-rescue.pod:250
23501 " virt-rescue disk.img [disk.img ...]\n"
23506 #: ../rescue/virt-rescue.pod:254
23509 " virt-rescue guestname\n"
23514 #: ../rescue/virt-rescue.pod:262
23519 #: ../rescue/virt-rescue.pod:264
23521 "Adding the I<--network> option enables QEMU user networking in the rescue "
23522 "appliance. There are some differences between user networking and ordinary "
23527 #: ../rescue/virt-rescue.pod:270
23528 msgid "ping does not work"
23532 #: ../rescue/virt-rescue.pod:272
23534 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
23535 "send the ping packets, and because virt-rescue must be able to run as "
23536 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
23537 "command. The ping command will appear to resolve addresses but will not be "
23538 "able to send or receive any packets. This does not mean that the network is "
23543 #: ../rescue/virt-rescue.pod:279
23544 msgid "cannot receive connections"
23548 #: ../rescue/virt-rescue.pod:281
23549 msgid "QEMU user networking cannot receive incoming connections."
23553 #: ../rescue/virt-rescue.pod:283
23554 msgid "making TCP connections"
23558 #: ../rescue/virt-rescue.pod:285
23560 "The virt-rescue appliance needs to be small and so does not include many "
23561 "network tools. In particular there is no L<telnet(1)> command. You can "
23562 "make TCP connections from the shell using the magical "
23563 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
23567 #: ../rescue/virt-rescue.pod:290
23570 " exec 3<>/dev/tcp/redhat.com/80\n"
23571 " echo \"GET /\" >&3\n"
23577 #: ../rescue/virt-rescue.pod:294
23578 msgid "See L<bash(1)> for more details."
23582 #: ../rescue/virt-rescue.pod:300
23584 "Several environment variables affect virt-rescue. See "
23585 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
23589 #: ../rescue/virt-rescue.pod:327
23591 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
23592 "L<virt-filesystems(1)>, L<http://libguestfs.org/>."
23596 #: ../resize/virt-resize.pod:5
23597 msgid "virt-resize - Resize a virtual machine disk"
23601 #: ../resize/virt-resize.pod:9
23604 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
23605 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
23606 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
23611 #: ../resize/virt-resize.pod:15
23613 "Virt-resize is a tool which can resize a virtual machine disk, making it "
23614 "larger or smaller overall, and resizing or deleting any partitions contained "
23619 #: ../resize/virt-resize.pod:19
23621 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
23622 "not> be used on live virtual machines - for consistent results, shut the "
23623 "virtual machine down before resizing it."
23627 #: ../resize/virt-resize.pod:23
23629 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
23630 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
23634 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:603 ../sparsify/virt-sparsify.pod:227 ../src/guestfs.pod:484 ../src/guestfs.pod:1302 ../src/guestfs.pod:1441 ../src/guestfs.pod:2690
23639 #: ../resize/virt-resize.pod:33
23641 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
23642 "fill the extra 5GB of space."
23646 #: ../resize/virt-resize.pod:36
23649 " virt-filesystems --long -h --all -a olddisk\n"
23654 #: ../resize/virt-resize.pod:38
23657 " truncate -r olddisk newdisk\n"
23658 " truncate -s +5G newdisk\n"
23663 #: ../resize/virt-resize.pod:41
23666 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
23667 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
23672 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:610 ../sparsify/virt-sparsify.pod:234 ../src/guestfs.pod:490 ../src/guestfs.pod:1306 ../src/guestfs.pod:1445 ../src/guestfs.pod:2715
23677 #: ../resize/virt-resize.pod:46
23679 "As above, but make the /boot partition 200MB bigger, while giving the "
23680 "remaining space to /dev/sda2:"
23684 #: ../resize/virt-resize.pod:49
23687 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
23688 " olddisk newdisk\n"
23693 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:616 ../sparsify/virt-sparsify.pod:240 ../src/guestfs.pod:501 ../src/guestfs.pod:1451
23698 #: ../resize/virt-resize.pod:54
23700 "As in the first example, but expand a logical volume as the final step. "
23701 "This is what you would typically use for Linux guests that use LVM:"
23705 #: ../resize/virt-resize.pod:58
23708 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
23709 " olddisk newdisk\n"
23714 #: ../resize/virt-resize.pod:61
23719 #: ../resize/virt-resize.pod:63
23721 "As in the first example, but the output format will be qcow2 instead of a "
23726 #: ../resize/virt-resize.pod:66
23729 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
23730 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
23735 #: ../resize/virt-resize.pod:71
23736 msgid "DETAILED USAGE"
23740 #: ../resize/virt-resize.pod:73
23741 msgid "EXPANDING A VIRTUAL MACHINE DISK"
23745 #: ../resize/virt-resize.pod:77
23746 msgid "1. Shut down the virtual machine"
23750 #: ../resize/virt-resize.pod:79
23751 msgid "2. Locate input disk image"
23755 #: ../resize/virt-resize.pod:81
23757 "Locate the input disk image (ie. the file or device on the host containing "
23758 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
23759 "dumpxml> like this to find the disk image name:"
23763 #: ../resize/virt-resize.pod:85
23766 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
23767 " Found 1 nodes:\n"
23769 " <source dev=\"/dev/vg/lv_guest\" />\n"
23774 #: ../resize/virt-resize.pod:90
23775 msgid "3. Look at current sizing"
23779 #: ../resize/virt-resize.pod:92
23780 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
23784 #: ../resize/virt-resize.pod:95
23787 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
23788 " Name Type Size Parent\n"
23789 " /dev/sda1 partition 101M /dev/sda\n"
23790 " /dev/sda2 partition 7.9G /dev/sda\n"
23791 " /dev/sda device 8.0G -\n"
23796 #: ../resize/virt-resize.pod:101
23798 "(This example is a virtual machine with an 8 GB disk which we would like to "
23799 "expand up to 10 GB)."
23803 #: ../resize/virt-resize.pod:104
23804 msgid "4. Create output disk"
23808 #: ../resize/virt-resize.pod:106
23810 "Virt-resize cannot do in-place disk modifications. You have to have space "
23811 "to store the resized output disk."
23815 #: ../resize/virt-resize.pod:109
23816 msgid "To store the resized disk image in a file, create a file of a suitable size:"
23820 #: ../resize/virt-resize.pod:112
23823 " # rm -f outdisk\n"
23824 " # truncate -s 10G outdisk\n"
23829 #: ../resize/virt-resize.pod:115
23830 msgid "Or use L<lvcreate(1)> to create a logical volume:"
23834 #: ../resize/virt-resize.pod:117
23837 " # lvcreate -L 10G -n lv_name vg_name\n"
23842 #: ../resize/virt-resize.pod:119
23843 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
23847 #: ../resize/virt-resize.pod:121
23850 " # virsh pool-list\n"
23851 " # virsh vol-create-as poolname newvol 10G\n"
23856 #: ../resize/virt-resize.pod:124
23861 #: ../resize/virt-resize.pod:126
23863 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
23864 "file) and the output disk. The output disk is the one created in the "
23869 #: ../resize/virt-resize.pod:130
23872 " # virt-resize indisk outdisk\n"
23877 #: ../resize/virt-resize.pod:132
23879 "This command just copies disk image C<indisk> to disk image C<outdisk> "
23880 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
23881 "larger, then an extra, empty partition is created at the end of the disk "
23882 "covering the extra space. If C<outdisk> is smaller, then it will give an "
23887 #: ../resize/virt-resize.pod:138
23889 "More realistically you'd want to expand existing partitions in the disk "
23890 "image by passing extra options (for the full list see the L</OPTIONS> "
23895 #: ../resize/virt-resize.pod:142
23897 "L</--expand> is the most useful option. It expands the named partition "
23898 "within the disk to fill any extra space:"
23902 #: ../resize/virt-resize.pod:145
23905 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
23910 #: ../resize/virt-resize.pod:147
23912 "(In this case, an extra partition is I<not> created at the end of the disk, "
23913 "because there will be no unused space)."
23917 #: ../resize/virt-resize.pod:150
23919 "L</--resize> is the other commonly used option. The following would "
23920 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
23921 "rest of the available space:"
23925 #: ../resize/virt-resize.pod:154
23928 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
23929 " indisk outdisk\n"
23934 #: ../resize/virt-resize.pod:157
23936 "If the expanded partition in the image contains a filesystem or LVM PV, then "
23937 "if virt-resize knows how, it will resize the contents, the equivalent of "
23938 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
23939 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
23940 "filesystems, so you would have to online resize them after booting the "
23945 #: ../resize/virt-resize.pod:164
23946 msgid "Other options are covered below."
23950 #: ../resize/virt-resize.pod:166
23955 #: ../resize/virt-resize.pod:168
23956 msgid "Thoroughly test the new disk image I<before> discarding the old one."
23960 #: ../resize/virt-resize.pod:170
23961 msgid "If you are using libvirt, edit the XML to point at the new disk:"
23965 #: ../resize/virt-resize.pod:172
23968 " # virsh edit guestname\n"
23973 #: ../resize/virt-resize.pod:174
23975 "Change E<lt>source ...E<gt>, see "
23976 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
23980 #: ../resize/virt-resize.pod:177
23981 msgid "Then start up the domain with the new, resized disk:"
23985 #: ../resize/virt-resize.pod:179
23988 " # virsh start guestname\n"
23993 #: ../resize/virt-resize.pod:181
23995 "and check that it still works. See also the L</NOTES> section below for "
23996 "additional information."
24000 #: ../resize/virt-resize.pod:184
24001 msgid "7. Resize LVs etc inside the guest"
24005 #: ../resize/virt-resize.pod:186
24006 msgid "(This can also be done offline using L<guestfish(1)>)"
24010 #: ../resize/virt-resize.pod:188
24012 "Once the guest has booted you should see the new space available, at least "
24013 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
24014 "may need to resize LVs inside PVs, and also resize filesystem types that "
24015 "virt-resize does not know how to expand."
24019 #: ../resize/virt-resize.pod:195
24020 msgid "SHRINKING A VIRTUAL MACHINE DISK"
24024 #: ../resize/virt-resize.pod:197
24026 "Shrinking is somewhat more complex than expanding, and only an overview is "
24031 #: ../resize/virt-resize.pod:200
24033 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
24034 "filesystems). The user has to shrink content before passing the disk image "
24035 "to virt-resize, and virt-resize will check that the content has been shrunk "
24040 #: ../resize/virt-resize.pod:205
24041 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
24045 #: ../resize/virt-resize.pod:207
24047 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
24048 "steps 3 and 4 above to allocate a new disk image."
24052 #: ../resize/virt-resize.pod:210
24053 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
24057 #: ../resize/virt-resize.pod:213
24058 msgid "IGNORING OR DELETING PARTITIONS"
24062 #: ../resize/virt-resize.pod:215
24064 "virt-resize also gives a convenient way to ignore or delete partitions when "
24065 "copying from the input disk to the output disk. Ignoring a partition speeds "
24066 "up the copy where you don't care about the existing contents of a "
24067 "partition. Deleting a partition removes it completely, but note that it "
24068 "also renumbers any partitions after the one which is deleted, which can "
24069 "leave some guests unbootable."
24073 #: ../resize/virt-resize.pod:222
24074 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
24078 #: ../resize/virt-resize.pod:224
24080 "If the input disk is in qcow2 format, then you may prefer that the output is "
24081 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
24082 "the fly. The output format is simply determined by the format of the empty "
24083 "output container that you provide. Thus to create qcow2 output, use:"
24087 #: ../resize/virt-resize.pod:230
24090 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
24095 #: ../resize/virt-resize.pod:232
24096 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
24100 #: ../resize/virt-resize.pod:234
24101 msgid "Similarly, to get non-sparse raw output use:"
24105 #: ../resize/virt-resize.pod:236
24108 " fallocate -l size outdisk\n"
24113 #: ../resize/virt-resize.pod:238
24115 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
24116 "if=/dev/zero of=outdisk bs=1M count=..>)"
24120 #: ../resize/virt-resize.pod:241
24121 msgid "LOGICAL PARTITIONS"
24125 #: ../resize/virt-resize.pod:243
24127 "Logical partitions (a.k.a. C</dev/sda5+> on disks using DOS partition "
24128 "tables) cannot be resized."
24132 #: ../resize/virt-resize.pod:246
24134 "To understand what is going on, firstly one of the four partitions "
24135 "C</dev/sda1-4> will have MBR partition type C<05> or C<0f>. This is called "
24136 "the B<extended partition>. Use L<virt-filesystems(1)> to see the MBR "
24141 #: ../resize/virt-resize.pod:251
24142 msgid "Logical partitions live inside the extended partition."
24146 #: ../resize/virt-resize.pod:253
24148 "The extended partition can be expanded, but not shrunk (unless you force it, "
24149 "which is not advisable). When the extended partition is copied across, all "
24150 "the logical partitions contained inside are copied over implicitly. "
24151 "Virt-resize does not look inside the extended partition, so it copies the "
24152 "logical partitions blindly."
24156 #: ../resize/virt-resize.pod:259
24158 "You cannot specify a logical partition (C</dev/sda5+>) at all on the command "
24159 "line. Doing so will give an error."
24163 #: ../resize/virt-resize.pod:268 ../sparsify/virt-sparsify.pod:105
24164 msgid "Display help."
24168 #: ../resize/virt-resize.pod:270
24169 msgid "B<--align-first auto>"
24173 #: ../resize/virt-resize.pod:272
24174 msgid "B<--align-first never>"
24178 #: ../resize/virt-resize.pod:274
24179 msgid "B<--align-first always>"
24183 #: ../resize/virt-resize.pod:276
24185 "Align the first partition for improved performance (see also the "
24186 "I<--alignment> option)."
24190 #: ../resize/virt-resize.pod:279
24192 "The default is I<--align-first auto> which only aligns the first partition "
24193 "if it is safe to do so. That is, only when we know how to fix the "
24194 "bootloader automatically, and at the moment that can only be done for "
24199 #: ../resize/virt-resize.pod:284
24201 "I<--align-first never> means we never move the first partition. This is the "
24202 "safest option. Try this if the guest does not boot after resizing."
24206 #: ../resize/virt-resize.pod:288
24208 "I<--align-first always> means we always align the first partition (if it "
24209 "needs to be aligned). For some guests this will break the bootloader, "
24210 "making the guest unbootable."
24214 #: ../resize/virt-resize.pod:292
24215 msgid "B<--alignment N>"
24219 #: ../resize/virt-resize.pod:294
24221 "Set the alignment of partitions to C<N> sectors. The default in virt-resize "
24222 "E<lt> 1.13.19 was 64 sectors, and after that is 128 sectors."
24226 #: ../resize/virt-resize.pod:298
24228 "Assuming 512 byte sector size inside the guest, here are some suitable "
24233 #: ../resize/virt-resize.pod:303
24234 msgid "I<--alignment 1> (512 bytes)"
24238 #: ../resize/virt-resize.pod:305
24240 "The partitions would be packed together as closely as possible, but would be "
24241 "completely unaligned. In some cases this can cause very poor performance. "
24242 "See L<virt-alignment-scan(1)> for further details."
24246 #: ../resize/virt-resize.pod:309
24247 msgid "I<--alignment 8> (4K)"
24251 #: ../resize/virt-resize.pod:311
24253 "This would be the minimum acceptable alignment for reasonable performance on "
24258 #: ../resize/virt-resize.pod:314
24259 msgid "I<--alignment 128> (64K)"
24263 #: ../resize/virt-resize.pod:316
24265 "This alignment provides good performance when the host is using high end "
24270 #: ../resize/virt-resize.pod:319
24271 msgid "I<--alignment 2048> (1M)"
24275 #: ../resize/virt-resize.pod:321
24277 "This is the standard alignment used by all newly installed guests since "
24282 #: ../resize/virt-resize.pod:326
24287 #: ../resize/virt-resize.pod:328 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
24292 #: ../resize/virt-resize.pod:330 ../tools/virt-win-reg.pl:122
24293 msgid "Enable debugging messages."
24297 #: ../resize/virt-resize.pod:332 ../sparsify/virt-sparsify.pod:131
24298 msgid "B<--debug-gc>"
24302 #: ../resize/virt-resize.pod:334
24304 "Debug garbage collection and memory allocation. This is only useful when "
24305 "debugging memory problems in virt-resize or the OCaml libguestfs bindings."
24309 #: ../resize/virt-resize.pod:338
24310 msgid "B<--delete part>"
24314 #: ../resize/virt-resize.pod:340
24316 "Delete the named partition. It would be more accurate to describe this as "
24317 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
24318 "the original disk image is left intact."
24322 #: ../resize/virt-resize.pod:344
24324 "Note that when you delete a partition, then anything contained in the "
24325 "partition is also deleted. Furthermore, this causes any partitions that "
24326 "come after to be I<renumbered>, which can easily make your guest unbootable."
24330 #: ../resize/virt-resize.pod:349 ../resize/virt-resize.pod:410 ../resize/virt-resize.pod:537 ../sparsify/virt-sparsify.pod:157
24331 msgid "You can give this option multiple times."
24335 #: ../resize/virt-resize.pod:351
24336 msgid "B<--expand part>"
24340 #: ../resize/virt-resize.pod:353
24342 "Expand the named partition so it uses up all extra space (space left over "
24343 "after any other resize changes that you request have been done)."
24347 #: ../resize/virt-resize.pod:356
24349 "If virt-resize knows how, it will expand the direct content of the "
24350 "partition. For example, if the partition is an LVM PV, it will expand the "
24351 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
24352 "content it doesn't know about alone."
24356 #: ../resize/virt-resize.pod:361
24357 msgid "Currently virt-resize can resize:"
24361 #: ../resize/virt-resize.pod:367
24362 msgid "ext2, ext3 and ext4 filesystems."
24366 #: ../resize/virt-resize.pod:371
24367 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
24371 #: ../resize/virt-resize.pod:373
24373 "The filesystem must have been shut down consistently last time it was used. "
24374 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
24375 "consistency check, so at the first boot after resizing Windows will check "
24380 #: ../resize/virt-resize.pod:380
24382 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
24383 "inside the PV, but see the I<--LV-expand> option. The user could also "
24384 "resize LVs as desired after boot."
24388 #: ../resize/virt-resize.pod:386
24389 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
24393 #: ../resize/virt-resize.pod:390 ../resize/virt-resize.pod:565
24394 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
24398 #: ../resize/virt-resize.pod:392 ../sparsify/virt-sparsify.pod:137 ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92 ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
24399 msgid "B<--format> raw"
24403 #: ../resize/virt-resize.pod:394 ../sparsify/virt-sparsify.pod:141
24405 "Specify the format of the input disk image. If this flag is not given then "
24406 "it is auto-detected from the image itself."
24410 #: ../resize/virt-resize.pod:400
24412 "Note that this option I<does not> affect the output format. See L</QCOW2 "
24413 "AND NON-SPARSE RAW FORMATS>."
24417 #: ../resize/virt-resize.pod:403
24418 msgid "B<--ignore part>"
24422 #: ../resize/virt-resize.pod:405
24424 "Ignore the named partition. Effectively this means the partition is "
24425 "allocated on the destination disk, but the content is not copied across from "
24426 "the source disk. The content of the partition will be blank (all zero "
24431 #: ../resize/virt-resize.pod:412
24432 msgid "B<--LV-expand logvol>"
24436 #: ../resize/virt-resize.pod:414
24438 "This takes the logical volume and, as a final step, expands it to fill all "
24439 "the space available in its volume group. A typical usage, assuming a Linux "
24440 "guest with a single PV C</dev/sda2> and a root device called "
24441 "C</dev/vg_guest/lv_root> would be:"
24445 #: ../resize/virt-resize.pod:419
24448 " virt-resize indisk outdisk \\\n"
24449 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
24454 #: ../resize/virt-resize.pod:422
24456 "This would first expand the partition (and PV), and then expand the root "
24457 "device to fill the extra space in the PV."
24461 #: ../resize/virt-resize.pod:425
24463 "The contents of the LV are also resized if virt-resize knows how to do "
24464 "that. You can stop virt-resize from trying to expand the content by using "
24465 "the option I<--no-expand-content>."
24469 #: ../resize/virt-resize.pod:429
24470 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
24474 #: ../resize/virt-resize.pod:431
24476 "You can give this option multiple times, I<but> it doesn't make sense to do "
24477 "this unless the logical volumes you specify are all in different volume "
24482 #: ../resize/virt-resize.pod:435 ../sparsify/virt-sparsify.pod:159
24483 msgid "B<--machine-readable>"
24487 #: ../resize/virt-resize.pod:437 ../sparsify/virt-sparsify.pod:161
24489 "This option is used to make the output more machine friendly when being "
24490 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
24494 #: ../resize/virt-resize.pod:443
24495 msgid "B<--dryrun>"
24499 #: ../resize/virt-resize.pod:445
24500 msgid "Print a summary of what would be done, but don't do anything."
24504 #: ../resize/virt-resize.pod:447
24505 msgid "B<--no-copy-boot-loader>"
24509 #: ../resize/virt-resize.pod:449
24511 "By default, virt-resize copies over some sectors at the start of the disk "
24512 "(up to the beginning of the first partition). Commonly these sectors "
24513 "contain the Master Boot Record (MBR) and the boot loader, and are required "
24514 "in order for the guest to boot correctly."
24518 #: ../resize/virt-resize.pod:454
24520 "If you specify this flag, then this initial copy is not done. You may need "
24521 "to reinstall the boot loader in this case."
24525 #: ../resize/virt-resize.pod:457
24526 msgid "B<--no-extra-partition>"
24530 #: ../resize/virt-resize.pod:459
24532 "By default, virt-resize creates an extra partition if there is any extra, "
24533 "unused space after all resizing has happened. Use this option to prevent "
24534 "the extra partition from being created. If you do this then the extra space "
24535 "will be inaccessible until you run fdisk, parted, or some other partitioning "
24536 "tool in the guest."
24540 #: ../resize/virt-resize.pod:465
24542 "Note that if the surplus space is smaller than 10 MB, no extra partition "
24547 #: ../resize/virt-resize.pod:468
24548 msgid "B<--no-expand-content>"
24552 #: ../resize/virt-resize.pod:470
24554 "By default, virt-resize will try to expand the direct contents of "
24555 "partitions, if it knows how (see I<--expand> option above)."
24559 #: ../resize/virt-resize.pod:473
24561 "If you give the I<--no-expand-content> option then virt-resize will not "
24566 #: ../resize/virt-resize.pod:476
24567 msgid "B<--ntfsresize-force>"
24571 #: ../resize/virt-resize.pod:478
24573 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
24574 "the NTFS disk is marked as needing a consistency check. You have to use "
24575 "this option if you want to resize a Windows guest multiple times without "
24576 "booting into Windows between each resize."
24580 #: ../resize/virt-resize.pod:484
24581 msgid "B<--output-format> raw"
24585 #: ../resize/virt-resize.pod:486
24587 "Specify the format of the output disk image. If this flag is not given then "
24588 "it is auto-detected from the image itself."
24592 #: ../resize/virt-resize.pod:492
24594 "Note that this option I<does not create> the output format. This option "
24595 "just tells libguestfs what it is so it doesn't try to guess it. You still "
24596 "need to create the output disk with the right format. See L</QCOW2 AND "
24597 "NON-SPARSE RAW FORMATS>."
24601 #: ../resize/virt-resize.pod:501
24602 msgid "Don't print the summary."
24606 #: ../resize/virt-resize.pod:503
24607 msgid "B<--resize part=size>"
24611 #: ../resize/virt-resize.pod:505
24613 "Resize the named partition (expanding or shrinking it) so that it has the "
24618 #: ../resize/virt-resize.pod:508
24620 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
24621 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
24622 "size; or as a relative number or percentage. For example:"
24626 #: ../resize/virt-resize.pod:514
24629 " --resize /dev/sda2=10G\n"
24634 #: ../resize/virt-resize.pod:516
24637 " --resize /dev/sda4=90%\n"
24642 #: ../resize/virt-resize.pod:518
24645 " --resize /dev/sda2=+1G\n"
24650 #: ../resize/virt-resize.pod:520
24653 " --resize /dev/sda2=-200M\n"
24658 #: ../resize/virt-resize.pod:522
24661 " --resize /dev/sda1=+128K\n"
24666 #: ../resize/virt-resize.pod:524
24669 " --resize /dev/sda1=+10%\n"
24674 #: ../resize/virt-resize.pod:526
24677 " --resize /dev/sda1=-10%\n"
24682 #: ../resize/virt-resize.pod:528
24684 "You can increase the size of any partition. Virt-resize will expand the "
24685 "direct content of the partition if it knows how (see I<--expand> below)."
24689 #: ../resize/virt-resize.pod:532
24691 "You can only I<decrease> the size of partitions that contain filesystems or "
24692 "PVs which have already been shrunk. Virt-resize will check this has been "
24693 "done before proceeding, or else will print an error (see also "
24694 "I<--resize-force>)."
24698 #: ../resize/virt-resize.pod:539
24699 msgid "B<--resize-force part=size>"
24703 #: ../resize/virt-resize.pod:541
24705 "This is the same as I<--resize> except that it will let you decrease the "
24706 "size of any partition. Generally this means you will lose any data which "
24707 "was at the end of the partition you shrink, but you may not care about that "
24708 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
24709 "as a swap partition)."
24713 #: ../resize/virt-resize.pod:547
24714 msgid "See also the I<--ignore> option."
24718 #: ../resize/virt-resize.pod:549
24719 msgid "B<--shrink part>"
24723 #: ../resize/virt-resize.pod:551
24725 "Shrink the named partition until the overall disk image fits in the "
24726 "destination. The named partition B<must> contain a filesystem or PV which "
24727 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
24728 "online tools). Virt-resize will check this and give an error if it has not "
24733 #: ../resize/virt-resize.pod:557
24735 "The amount by which the overall disk must be shrunk (after carrying out all "
24736 "other operations requested by the user) is called the \"deficit\". For "
24737 "example, a straight copy (assume no other operations) from a 5GB disk image "
24738 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
24739 "would give an error unless the user specified a partition to shrink and that "
24740 "partition had more than a gigabyte of free space."
24744 #: ../resize/virt-resize.pod:575 ../sparsify/virt-sparsify.pod:201
24745 msgid "MACHINE READABLE OUTPUT"
24749 #: ../resize/virt-resize.pod:577
24751 "The I<--machine-readable> option can be used to make the output more machine "
24752 "friendly, which is useful when calling virt-resize from other programs, GUIs "
24757 #: ../resize/virt-resize.pod:581 ../sparsify/virt-sparsify.pod:207
24758 msgid "There are two ways to use this option."
24762 #: ../resize/virt-resize.pod:583
24764 "Firstly use the option on its own to query the capabilities of the "
24765 "virt-resize binary. Typical output looks like this:"
24769 #: ../resize/virt-resize.pod:586
24772 " $ virt-resize --machine-readable\n"
24774 " ntfsresize-force\n"
24782 #: ../resize/virt-resize.pod:593 ../sparsify/virt-sparsify.pod:217
24784 "A list of features is printed, one per line, and the program exits with "
24789 #: ../resize/virt-resize.pod:596 ../sparsify/virt-sparsify.pod:220
24791 "Secondly use the option in conjunction with other options to make the "
24792 "regular program output more machine friendly."
24796 #: ../resize/virt-resize.pod:599 ../sparsify/virt-sparsify.pod:223
24797 msgid "At the moment this means:"
24801 #: ../resize/virt-resize.pod:605 ../sparsify/virt-sparsify.pod:229
24803 "Progress bar messages can be parsed from stdout by looking for this regular "
24808 #: ../resize/virt-resize.pod:608 ../sparsify/virt-sparsify.pod:232
24811 " ^[0-9]+/[0-9]+$\n"
24816 #: ../resize/virt-resize.pod:612 ../sparsify/virt-sparsify.pod:236
24818 "The calling program should treat messages sent to stdout (except for "
24819 "progress bar messages) as status messages. They can be logged and/or "
24820 "displayed to the user."
24824 #: ../resize/virt-resize.pod:618
24826 "The calling program should treat messages sent to stderr as error messages. "
24827 "In addition, virt-resize exits with a non-zero status code if there was a "
24832 #: ../resize/virt-resize.pod:624
24834 "Versions of the program prior to 1.13.9 did not support the "
24835 "I<--machine-readable> option and will return an error."
24839 #: ../resize/virt-resize.pod:629
24840 msgid "\"Partition 1 does not end on cylinder boundary.\""
24844 #: ../resize/virt-resize.pod:631
24846 "Virt-resize aligns partitions to multiples of 128 sectors (see the "
24847 "I<--alignment> parameter). Usually this means the partitions will not be "
24848 "aligned to the ancient CHS geometry. However CHS geometry is meaningless "
24849 "for disks manufactured since the early 1990s, and doubly so for virtual hard "
24850 "drives. Alignment of partitions to cylinders is not required by any modern "
24851 "operating system."
24855 #: ../resize/virt-resize.pod:638
24856 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
24860 #: ../resize/virt-resize.pod:640
24862 "In Windows Vista and later versions, Microsoft switched to using a separate "
24863 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
24864 "and C</dev/sda2> is the main (C:) drive. Resizing the first (boot) "
24865 "partition causes the bootloader to fail with C<0xC0000225> error. Resizing "
24866 "the second partition (ie. C: drive) should work."
24870 #: ../resize/virt-resize.pod:647
24872 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
24873 "NTFS partitions have been expanded. This is just a safety check and (unless "
24874 "it find errors) is nothing to worry about."
24878 #: ../resize/virt-resize.pod:651
24879 msgid "GUEST BOOT STUCK AT \"GRUB\""
24883 #: ../resize/virt-resize.pod:653
24885 "If a Linux guest does not boot after resizing, and the boot is stuck after "
24886 "printing C<GRUB> on the console, try reinstalling grub."
24890 #: ../resize/virt-resize.pod:656
24893 " guestfish -i -a newdisk\n"
24894 " ><fs> cat /boot/grub/device.map\n"
24895 " # check the contents of this file are sensible or\n"
24896 " # edit the file if necessary\n"
24897 " ><fs> grub-install / /dev/vda\n"
24903 #: ../resize/virt-resize.pod:663
24905 "For more flexible guest reconfiguration, including if you need to specify "
24906 "other parameters to grub-install, use L<virt-rescue(1)>."
24910 #: ../resize/virt-resize.pod:666
24911 msgid "ALTERNATIVE TOOLS"
24915 #: ../resize/virt-resize.pod:668
24917 "There are several proprietary tools for resizing partitions. We won't "
24918 "mention any here."
24922 #: ../resize/virt-resize.pod:671
24924 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
24925 "operations on disk images. They can resize and move partitions, but I don't "
24926 "think they can do anything with the contents, and they certainly don't "
24931 #: ../resize/virt-resize.pod:676
24933 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
24934 "but at a much lower level. You will probably end up hand-calculating sector "
24935 "offsets, which is something that virt-resize was designed to avoid. If you "
24936 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
24941 #: ../resize/virt-resize.pod:696
24943 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
24944 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
24945 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
24946 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
24947 "L<virt-sparsify(1)>, L<virt-alignment-scan(1)>, L<http://libguestfs.org/>."
24951 #: ../ruby/examples/guestfs-ruby.pod:5
24952 msgid "guestfs-ruby - How to use libguestfs from Ruby"
24956 #: ../ruby/examples/guestfs-ruby.pod:9
24959 " require 'guestfs'\n"
24960 " g = Guestfs::Guestfs.new()\n"
24961 " g.add_drive_opts(\"disk.img\",\n"
24962 " :readonly => 1, :format => \"raw\")\n"
24968 #: ../ruby/examples/guestfs-ruby.pod:17
24970 "This manual page documents how to call libguestfs from the Ruby programming "
24971 "language. This page just documents the differences from the C API and gives "
24972 "some examples. If you are not familiar with using libguestfs, you also need "
24973 "to read L<guestfs(3)>."
24977 #: ../ruby/examples/guestfs-ruby.pod:24
24979 "Errors from libguestfs functions are mapped into the C<Error> exception. "
24980 "This has a single parameter which is the error message (a string)."
24984 #: ../ruby/examples/guestfs-ruby.pod:38
24986 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
24987 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
24988 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
24992 #: ../sparsify/virt-sparsify.pod:5
24993 msgid "virt-sparsify - Make a virtual machine disk sparse"
24997 #: ../sparsify/virt-sparsify.pod:9
25000 " virt-sparsify [--options] indisk outdisk\n"
25005 #: ../sparsify/virt-sparsify.pod:13
25007 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
25008 "image) sparse a.k.a. thin-provisioned. This means that free space within "
25009 "the disk image can be converted back to free space on the host."
25013 #: ../sparsify/virt-sparsify.pod:18
25015 "Virt-sparsify can locate and sparsify free space in most filesystems "
25016 "(eg. ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
25020 #: ../sparsify/virt-sparsify.pod:21
25022 "Virt-sparsify can also convert between some disk formats, for example "
25023 "converting a raw disk image to a thin-provisioned qcow2 image."
25027 #: ../sparsify/virt-sparsify.pod:24
25029 "Virt-sparsify can operate on any disk image, not just ones from virtual "
25030 "machines. If a virtual machine has more than one attached disk, you must "
25031 "sparsify each one separately."
25035 #: ../sparsify/virt-sparsify.pod:28
25036 msgid "IMPORTANT LIMITATIONS"
25040 #: ../sparsify/virt-sparsify.pod:34
25042 "Virt-sparsify does not do in-place modifications. It copies from a source "
25043 "image to a destination image, leaving the source unchanged. I<Check that "
25044 "the sparsification was successful before deleting the source image>."
25048 #: ../sparsify/virt-sparsify.pod:41
25049 msgid "The virtual machine I<must be shut down> before using this tool."
25053 #: ../sparsify/virt-sparsify.pod:45
25055 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
25056 "(1 temporary copy + 1 destination image). This is in the worst case and "
25057 "usually much less space is required."
25061 #: ../sparsify/virt-sparsify.pod:51
25062 msgid "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
25066 #: ../sparsify/virt-sparsify.pod:56
25067 msgid "Virt-sparsify cannot handle encrypted disks."
25071 #: ../sparsify/virt-sparsify.pod:60
25073 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
25074 "this space is often used for critical items like bootloaders so it's not "
25079 #: ../sparsify/virt-sparsify.pod:66
25081 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
25082 "to do this unless we can be sure there is no hibernation data, so at the "
25083 "moment swap partitions are ignored."
25087 #: ../sparsify/virt-sparsify.pod:72
25089 "You may also want to read the manual pages for the associated tools "
25090 "L<virt-filesystems(1)> and L<virt-df(1)> before starting."
25094 #: ../sparsify/virt-sparsify.pod:77
25095 msgid "Typical usage is:"
25099 #: ../sparsify/virt-sparsify.pod:79
25102 " virt-sparsify indisk outdisk\n"
25107 #: ../sparsify/virt-sparsify.pod:81
25109 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
25110 "is created, or overwritten if it already exists. The format of the input "
25111 "disk is detected (eg. qcow2) and the same format is used for the output "
25116 #: ../sparsify/virt-sparsify.pod:86
25117 msgid "To convert between formats, use the I<--convert> option:"
25121 #: ../sparsify/virt-sparsify.pod:88
25124 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
25129 #: ../sparsify/virt-sparsify.pod:90
25131 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
25132 "can find within the source disk image. You can get it to ignore (don't zero "
25133 "free space on) certain filesystems by doing:"
25137 #: ../sparsify/virt-sparsify.pod:94
25140 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
25145 #: ../sparsify/virt-sparsify.pod:96
25146 msgid "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
25150 #: ../sparsify/virt-sparsify.pod:107
25151 msgid "B<--compress>"
25155 #: ../sparsify/virt-sparsify.pod:109
25157 "Compress the output file. This I<only> works if the output format is "
25162 #: ../sparsify/virt-sparsify.pod:112
25163 msgid "B<--convert> raw"
25167 #: ../sparsify/virt-sparsify.pod:114
25168 msgid "B<--convert> qcow2"
25172 #: ../sparsify/virt-sparsify.pod:116
25173 msgid "B<--convert> [other formats]"
25177 #: ../sparsify/virt-sparsify.pod:118
25179 "Use C<output-format> as the format for the destination image. If this is "
25180 "not specified, then the input format is used."
25184 #: ../sparsify/virt-sparsify.pod:121
25185 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>, C<vdi>."
25189 #: ../sparsify/virt-sparsify.pod:123
25191 "You can also use any format supported by the L<qemu-img(1)> program, "
25192 "eg. C<vmdk>, but support for other formats is reliant on qemu."
25196 #: ../sparsify/virt-sparsify.pod:126
25198 "Specifying the I<--convert> option is usually a good idea, because then "
25199 "virt-sparsify doesn't need to try to guess the input format."
25203 #: ../sparsify/virt-sparsify.pod:129
25204 msgid "For fine-tuning the output format, see: I<--compress>, I<-o>."
25208 #: ../sparsify/virt-sparsify.pod:133
25210 "Debug garbage collection and memory allocation. This is only useful when "
25211 "debugging memory problems in virt-sparsify or the OCaml libguestfs bindings."
25215 #: ../sparsify/virt-sparsify.pod:139
25216 msgid "B<--format> qcow2"
25220 #: ../sparsify/virt-sparsify.pod:147
25221 msgid "B<--ignore> filesystem"
25225 #: ../sparsify/virt-sparsify.pod:149
25226 msgid "B<--ignore> volgroup"
25230 #: ../sparsify/virt-sparsify.pod:151
25232 "Ignore the named filesystem. Free space on the filesystem will not be "
25233 "zeroed, but existing blocks of zeroes will still be sparsified."
25237 #: ../sparsify/virt-sparsify.pod:154
25239 "In the second form, this ignores the named volume group. Use the volume "
25240 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
25244 #: ../sparsify/virt-sparsify.pod:165
25245 msgid "B<-o> option[,option,...]"
25249 #: ../sparsify/virt-sparsify.pod:167
25251 "Pass I<-o> option(s) to the L<qemu-img(1)> command to fine-tune the output "
25252 "format. Options available depend on the output format (see I<--convert>) "
25253 "and the installed version of the qemu-img program."
25257 #: ../sparsify/virt-sparsify.pod:171
25259 "You should use I<-o> at most once. To pass multiple options, separate them "
25264 #: ../sparsify/virt-sparsify.pod:174
25267 " virt-sparsify --convert qcow2 \\\n"
25268 " -o cluster_size=512,preallocation=metadata ...\n"
25273 #: ../sparsify/virt-sparsify.pod:181
25274 msgid "This disables progress bars and other unnecessary output."
25278 #: ../sparsify/virt-sparsify.pod:203
25280 "The I<--machine-readable> option can be used to make the output more machine "
25281 "friendly, which is useful when calling virt-sparsify from other programs, "
25286 #: ../sparsify/virt-sparsify.pod:209
25288 "Firstly use the option on its own to query the capabilities of the "
25289 "virt-sparsify binary. Typical output looks like this:"
25293 #: ../sparsify/virt-sparsify.pod:212
25296 " $ virt-sparsify --machine-readable\n"
25304 #: ../sparsify/virt-sparsify.pod:242
25306 "The calling program should treat messages sent to stderr as error messages. "
25307 "In addition, virt-sparsify exits with a non-zero status code if there was a "
25312 #: ../sparsify/virt-sparsify.pod:248
25314 "All versions of virt-sparsify have supported the I<--machine-readable> "
25319 #: ../sparsify/virt-sparsify.pod:262
25321 "Location of the temporary directory used for the potentially large temporary "
25326 #: ../sparsify/virt-sparsify.pod:265
25328 "You should ensure there is enough free space in the worst case for a full "
25329 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
25330 "to another directory that has enough space."
25334 #: ../sparsify/virt-sparsify.pod:269
25335 msgid "This defaults to C</tmp>."
25339 #: ../sparsify/virt-sparsify.pod:273
25340 msgid "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
25344 #: ../sparsify/virt-sparsify.pod:277
25346 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
25347 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, "
25348 "L<qemu-img(1)>, L<http://libguestfs.org/>."
25352 #: ../src/guestfs-actions.pod:1
25353 msgid "guestfs_add_cdrom"
25357 #: ../src/guestfs-actions.pod:3
25361 " guestfs_add_cdrom (guestfs_h *g,\n"
25362 " const char *filename);\n"
25367 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:302 ../src/guestfs-actions.pod:323
25369 "I<This function is deprecated.> In new code, use the "
25370 "L</guestfs_add_drive_opts> call instead."
25374 #: ../src/guestfs-actions.pod:24
25376 "This call checks for the existence of C<filename>. This stops you from "
25377 "specifying other types of drive which are supported by qemu such as C<nbd:> "
25378 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
25383 #: ../src/guestfs-actions.pod:31
25385 "If you just want to add an ISO file (often you use this as an efficient way "
25386 "to transfer large files into the guest), then you should probably use "
25387 "C<guestfs_add_drive_ro> instead."
25391 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:187 ../src/guestfs-actions.pod:254 ../src/guestfs-actions.pod:291 ../src/guestfs-actions.pod:312 ../src/guestfs-actions.pod:333 ../src/guestfs-actions.pod:346 ../src/guestfs-actions.pod:360 ../src/guestfs-actions.pod:480 ../src/guestfs-actions.pod:500 ../src/guestfs-actions.pod:514 ../src/guestfs-actions.pod:559 ../src/guestfs-actions.pod:587 ../src/guestfs-actions.pod:605 ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:705 ../src/guestfs-actions.pod:719 ../src/guestfs-actions.pod:773 ../src/guestfs-actions.pod:872 ../src/guestfs-actions.pod:890 ../src/guestfs-actions.pod:904 ../src/guestfs-actions.pod:918 ../src/guestfs-actions.pod:955 ../src/guestfs-actions.pod:1138 ../src/guestfs-actions.pod:1158 ../src/guestfs-actions.pod:1176 ../src/guestfs-actions.pod:1266 ../src/guestfs-actions.pod:1325 ../src/guestfs-actions.pod:1371 ../src/guestfs-actions.pod:1411 ../src/guestfs-actions.pod:1464 ../src/guestfs-actions.pod:1517 ../src/guestfs-actions.pod:1575 ../src/guestfs-actions.pod:1629 ../src/guestfs-actions.pod:1648 ../src/guestfs-actions.pod:1662 ../src/guestfs-actions.pod:1690 ../src/guestfs-actions.pod:1760 ../src/guestfs-actions.pod:1791 ../src/guestfs-actions.pod:1816 ../src/guestfs-actions.pod:1858 ../src/guestfs-actions.pod:1971 ../src/guestfs-actions.pod:1998 ../src/guestfs-actions.pod:2213 ../src/guestfs-actions.pod:2235 ../src/guestfs-actions.pod:2322 ../src/guestfs-actions.pod:2830 ../src/guestfs-actions.pod:2974 ../src/guestfs-actions.pod:3035 ../src/guestfs-actions.pod:3070 ../src/guestfs-actions.pod:4131 ../src/guestfs-actions.pod:4146 ../src/guestfs-actions.pod:4171 ../src/guestfs-actions.pod:4373 ../src/guestfs-actions.pod:4387 ../src/guestfs-actions.pod:4400 ../src/guestfs-actions.pod:4414 ../src/guestfs-actions.pod:4429 ../src/guestfs-actions.pod:4465 ../src/guestfs-actions.pod:4537 ../src/guestfs-actions.pod:4557 ../src/guestfs-actions.pod:4574 ../src/guestfs-actions.pod:4594 ../src/guestfs-actions.pod:4614 ../src/guestfs-actions.pod:4649 ../src/guestfs-actions.pod:4668 ../src/guestfs-actions.pod:4687 ../src/guestfs-actions.pod:4722 ../src/guestfs-actions.pod:4734 ../src/guestfs-actions.pod:4767 ../src/guestfs-actions.pod:4783 ../src/guestfs-actions.pod:4796 ../src/guestfs-actions.pod:4811 ../src/guestfs-actions.pod:4828 ../src/guestfs-actions.pod:4986 ../src/guestfs-actions.pod:5060 ../src/guestfs-actions.pod:5070 ../src/guestfs-actions.pod:5090 ../src/guestfs-actions.pod:5103 ../src/guestfs-actions.pod:5154 ../src/guestfs-actions.pod:5172 ../src/guestfs-actions.pod:5190 ../src/guestfs-actions.pod:5206 ../src/guestfs-actions.pod:5220 ../src/guestfs-actions.pod:5234 ../src/guestfs-actions.pod:5251 ../src/guestfs-actions.pod:5266 ../src/guestfs-actions.pod:5293 ../src/guestfs-actions.pod:5356 ../src/guestfs-actions.pod:5429 ../src/guestfs-actions.pod:5460 ../src/guestfs-actions.pod:5479 ../src/guestfs-actions.pod:5498 ../src/guestfs-actions.pod:5510 ../src/guestfs-actions.pod:5527 ../src/guestfs-actions.pod:5540 ../src/guestfs-actions.pod:5555 ../src/guestfs-actions.pod:5570 ../src/guestfs-actions.pod:5602 ../src/guestfs-actions.pod:5628 ../src/guestfs-actions.pod:5667 ../src/guestfs-actions.pod:5687 ../src/guestfs-actions.pod:5701 ../src/guestfs-actions.pod:5718 ../src/guestfs-actions.pod:5767 ../src/guestfs-actions.pod:5820 ../src/guestfs-actions.pod:5867 ../src/guestfs-actions.pod:5910 ../src/guestfs-actions.pod:5938 ../src/guestfs-actions.pod:5955 ../src/guestfs-actions.pod:5973 ../src/guestfs-actions.pod:6110 ../src/guestfs-actions.pod:6167 ../src/guestfs-actions.pod:6189 ../src/guestfs-actions.pod:6207 ../src/guestfs-actions.pod:6259 ../src/guestfs-actions.pod:6325 ../src/guestfs-actions.pod:6342 ../src/guestfs-actions.pod:6355 ../src/guestfs-actions.pod:6369 ../src/guestfs-actions.pod:6658 ../src/guestfs-actions.pod:6677 ../src/guestfs-actions.pod:6696 ../src/guestfs-actions.pod:6710 ../src/guestfs-actions.pod:6722 ../src/guestfs-actions.pod:6736 ../src/guestfs-actions.pod:6748 ../src/guestfs-actions.pod:6762 ../src/guestfs-actions.pod:6778 ../src/guestfs-actions.pod:6796 ../src/guestfs-actions.pod:6815 ../src/guestfs-actions.pod:6834 ../src/guestfs-actions.pod:6864 ../src/guestfs-actions.pod:6882 ../src/guestfs-actions.pod:6905 ../src/guestfs-actions.pod:6923 ../src/guestfs-actions.pod:6942 ../src/guestfs-actions.pod:6963 ../src/guestfs-actions.pod:6982 ../src/guestfs-actions.pod:6999 ../src/guestfs-actions.pod:7018 ../src/guestfs-actions.pod:7046 ../src/guestfs-actions.pod:7070 ../src/guestfs-actions.pod:7089 ../src/guestfs-actions.pod:7105 ../src/guestfs-actions.pod:7129 ../src/guestfs-actions.pod:7148 ../src/guestfs-actions.pod:7163 ../src/guestfs-actions.pod:7182 ../src/guestfs-actions.pod:7226 ../src/guestfs-actions.pod:7253 ../src/guestfs-actions.pod:7283 ../src/guestfs-actions.pod:7395 ../src/guestfs-actions.pod:7516 ../src/guestfs-actions.pod:7528 ../src/guestfs-actions.pod:7541 ../src/guestfs-actions.pod:7554 ../src/guestfs-actions.pod:7576 ../src/guestfs-actions.pod:7589 ../src/guestfs-actions.pod:7602 ../src/guestfs-actions.pod:7615 ../src/guestfs-actions.pod:7630 ../src/guestfs-actions.pod:7689 ../src/guestfs-actions.pod:7706 ../src/guestfs-actions.pod:7722 ../src/guestfs-actions.pod:7738 ../src/guestfs-actions.pod:7755 ../src/guestfs-actions.pod:7768 ../src/guestfs-actions.pod:7788 ../src/guestfs-actions.pod:7888 ../src/guestfs-actions.pod:7946 ../src/guestfs-actions.pod:7960 ../src/guestfs-actions.pod:8001 ../src/guestfs-actions.pod:8014 ../src/guestfs-actions.pod:8032 ../src/guestfs-actions.pod:8066 ../src/guestfs-actions.pod:8102 ../src/guestfs-actions.pod:8218 ../src/guestfs-actions.pod:8233 ../src/guestfs-actions.pod:8247 ../src/guestfs-actions.pod:8302 ../src/guestfs-actions.pod:8315 ../src/guestfs-actions.pod:8360 ../src/guestfs-actions.pod:8400 ../src/guestfs-actions.pod:8456 ../src/guestfs-actions.pod:8476 ../src/guestfs-actions.pod:8509 ../src/guestfs-actions.pod:8573 ../src/guestfs-actions.pod:8596 ../src/guestfs-actions.pod:8622
25392 msgid "This function returns 0 on success or -1 on error."
25396 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:189 ../src/guestfs-actions.pod:1373 ../src/guestfs-actions.pod:2436 ../src/guestfs-actions.pod:2534 ../src/guestfs-actions.pod:2659 ../src/guestfs-actions.pod:4133 ../src/guestfs-actions.pod:4153 ../src/guestfs-actions.pod:5604 ../src/guestfs-actions.pod:6884 ../src/guestfs-actions.pod:7001 ../src/guestfs-actions.pod:7150 ../src/guestfs-actions.pod:7632 ../src/guestfs-actions.pod:7757 ../src/guestfs-actions.pod:8402
25397 msgid "(Added in 0.3)"
25401 #: ../src/guestfs-actions.pod:41
25402 msgid "guestfs_add_domain"
25406 #: ../src/guestfs-actions.pod:43
25410 " guestfs_add_domain (guestfs_h *g,\n"
25411 " const char *dom,\n"
25417 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:198 ../src/guestfs-actions.pod:929 ../src/guestfs-actions.pod:1253 ../src/guestfs-actions.pod:1305 ../src/guestfs-actions.pod:1383 ../src/guestfs-actions.pod:1452 ../src/guestfs-actions.pod:1505 ../src/guestfs-actions.pod:1558 ../src/guestfs-actions.pod:3327 ../src/guestfs-actions.pod:4921 ../src/guestfs-actions.pod:5305 ../src/guestfs-actions.pod:5614 ../src/guestfs-actions.pod:5831 ../src/guestfs-actions.pod:7799
25419 "You may supply a list of optional arguments to this call. Use zero or more "
25420 "of the following pairs of parameters, and terminate the list with C<-1> on "
25421 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
25425 #: ../src/guestfs-actions.pod:53
25428 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
25429 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
25430 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
25431 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
25432 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
25433 " GUESTFS_ADD_DOMAIN_READONLYDISK, const char *readonlydisk,\n"
25438 #: ../src/guestfs-actions.pod:60
25440 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
25441 "It works by connecting to libvirt, requesting the domain and domain XML from "
25442 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
25447 #: ../src/guestfs-actions.pod:141
25449 "The other optional parameters are passed directly through to "
25450 "C<guestfs_add_drive_opts>."
25454 #: ../src/guestfs-actions.pod:144 ../src/guestfs-actions.pod:403 ../src/guestfs-actions.pod:573 ../src/guestfs-actions.pod:790 ../src/guestfs-actions.pod:821 ../src/guestfs-actions.pod:839 ../src/guestfs-actions.pod:858 ../src/guestfs-actions.pod:1836 ../src/guestfs-actions.pod:2192 ../src/guestfs-actions.pod:2395 ../src/guestfs-actions.pod:2506 ../src/guestfs-actions.pod:2557 ../src/guestfs-actions.pod:2609 ../src/guestfs-actions.pod:2623 ../src/guestfs-actions.pod:2646 ../src/guestfs-actions.pod:2961 ../src/guestfs-actions.pod:3445 ../src/guestfs-actions.pod:3463 ../src/guestfs-actions.pod:5790 ../src/guestfs-actions.pod:6007 ../src/guestfs-actions.pod:6245 ../src/guestfs-actions.pod:6439 ../src/guestfs-actions.pod:6465 ../src/guestfs-actions.pod:7987 ../src/guestfs-actions.pod:8413 ../src/guestfs-actions.pod:8426 ../src/guestfs-actions.pod:8439
25455 msgid "On error this function returns -1."
25459 #: ../src/guestfs-actions.pod:146
25460 msgid "(Added in 1.7.4)"
25464 #: ../src/guestfs-actions.pod:148
25465 msgid "guestfs_add_domain_va"
25469 #: ../src/guestfs-actions.pod:150
25473 " guestfs_add_domain_va (guestfs_h *g,\n"
25474 " const char *dom,\n"
25475 " va_list args);\n"
25480 #: ../src/guestfs-actions.pod:155
25481 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
25485 #: ../src/guestfs-actions.pod:157 ../src/guestfs-actions.pod:168 ../src/guestfs-actions.pod:267 ../src/guestfs-actions.pod:278 ../src/guestfs-actions.pod:968 ../src/guestfs-actions.pod:979 ../src/guestfs-actions.pod:1281 ../src/guestfs-actions.pod:1294 ../src/guestfs-actions.pod:1340 ../src/guestfs-actions.pod:1353 ../src/guestfs-actions.pod:1430 ../src/guestfs-actions.pod:1442 ../src/guestfs-actions.pod:1483 ../src/guestfs-actions.pod:1495 ../src/guestfs-actions.pod:1536 ../src/guestfs-actions.pod:1548 ../src/guestfs-actions.pod:1594 ../src/guestfs-actions.pod:1606 ../src/guestfs-actions.pod:3411 ../src/guestfs-actions.pod:3423 ../src/guestfs-actions.pod:4998 ../src/guestfs-actions.pod:5010 ../src/guestfs-actions.pod:5370 ../src/guestfs-actions.pod:5382 ../src/guestfs-actions.pod:5642 ../src/guestfs-actions.pod:5654 ../src/guestfs-actions.pod:5880 ../src/guestfs-actions.pod:5891 ../src/guestfs-actions.pod:7901 ../src/guestfs-actions.pod:7912
25486 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
25490 #: ../src/guestfs-actions.pod:159
25491 msgid "guestfs_add_domain_argv"
25495 #: ../src/guestfs-actions.pod:161
25499 " guestfs_add_domain_argv (guestfs_h *g,\n"
25500 " const char *dom,\n"
25501 " const struct guestfs_add_domain_argv *optargs);\n"
25506 #: ../src/guestfs-actions.pod:166
25507 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
25511 #: ../src/guestfs-actions.pod:170
25512 msgid "guestfs_add_drive"
25516 #: ../src/guestfs-actions.pod:172
25520 " guestfs_add_drive (guestfs_h *g,\n"
25521 " const char *filename);\n"
25526 #: ../src/guestfs-actions.pod:176
25528 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
25529 "optional parameters, so the disk is added writable, with the format being "
25530 "detected automatically."
25534 #: ../src/guestfs-actions.pod:180
25536 "Automatic detection of the format opens you up to a potential security hole "
25537 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
25538 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
25539 "you should think about replacing calls to this function with calls to "
25540 "C<guestfs_add_drive_opts>, and specifying the format."
25544 #: ../src/guestfs-actions.pod:191
25545 msgid "guestfs_add_drive_opts"
25549 #: ../src/guestfs-actions.pod:193
25553 " guestfs_add_drive_opts (guestfs_h *g,\n"
25554 " const char *filename,\n"
25560 #: ../src/guestfs-actions.pod:203
25563 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
25564 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
25565 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
25566 " GUESTFS_ADD_DRIVE_OPTS_NAME, const char *name,\n"
25571 #: ../src/guestfs-actions.pod:233
25573 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
25574 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
25575 "Possible formats include C<raw> and C<qcow2>."
25579 #: ../src/guestfs-actions.pod:244
25581 "This rarely-used option lets you emulate the behaviour of the deprecated "
25582 "C<guestfs_add_drive_with_if> call (q.v.)"
25586 #: ../src/guestfs-actions.pod:256
25587 msgid "(Added in 1.5.23)"
25591 #: ../src/guestfs-actions.pod:258
25592 msgid "guestfs_add_drive_opts_va"
25596 #: ../src/guestfs-actions.pod:260
25600 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
25601 " const char *filename,\n"
25602 " va_list args);\n"
25607 #: ../src/guestfs-actions.pod:265
25608 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
25612 #: ../src/guestfs-actions.pod:269
25613 msgid "guestfs_add_drive_opts_argv"
25617 #: ../src/guestfs-actions.pod:271
25621 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
25622 " const char *filename,\n"
25623 " const struct guestfs_add_drive_opts_argv "
25629 #: ../src/guestfs-actions.pod:276
25630 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
25634 #: ../src/guestfs-actions.pod:280
25635 msgid "guestfs_add_drive_ro"
25639 #: ../src/guestfs-actions.pod:282
25643 " guestfs_add_drive_ro (guestfs_h *g,\n"
25644 " const char *filename);\n"
25649 #: ../src/guestfs-actions.pod:286
25651 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
25652 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
25653 "disk is added read-only, with the format being detected automatically."
25657 #: ../src/guestfs-actions.pod:293
25658 msgid "(Added in 1.0.38)"
25662 #: ../src/guestfs-actions.pod:295
25663 msgid "guestfs_add_drive_ro_with_if"
25667 #: ../src/guestfs-actions.pod:297
25671 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
25672 " const char *filename,\n"
25673 " const char *iface);\n"
25678 #: ../src/guestfs-actions.pod:309
25680 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
25681 "QEMU interface emulation to use at run time."
25685 #: ../src/guestfs-actions.pod:314 ../src/guestfs-actions.pod:335 ../src/guestfs-actions.pod:2920
25686 msgid "(Added in 1.0.84)"
25690 #: ../src/guestfs-actions.pod:316
25691 msgid "guestfs_add_drive_with_if"
25695 #: ../src/guestfs-actions.pod:318
25699 " guestfs_add_drive_with_if (guestfs_h *g,\n"
25700 " const char *filename,\n"
25701 " const char *iface);\n"
25706 #: ../src/guestfs-actions.pod:330
25708 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
25709 "QEMU interface emulation to use at run time."
25713 #: ../src/guestfs-actions.pod:337
25714 msgid "guestfs_aug_clear"
25718 #: ../src/guestfs-actions.pod:339
25722 " guestfs_aug_clear (guestfs_h *g,\n"
25723 " const char *augpath);\n"
25728 #: ../src/guestfs-actions.pod:348 ../src/guestfs-actions.pod:2648
25729 msgid "(Added in 1.3.4)"
25733 #: ../src/guestfs-actions.pod:350
25734 msgid "guestfs_aug_close"
25738 #: ../src/guestfs-actions.pod:352
25742 " guestfs_aug_close (guestfs_h *g);\n"
25747 #: ../src/guestfs-actions.pod:355
25749 "Close the current Augeas handle and free up any resources used by it. After "
25750 "calling this, you have to call C<guestfs_aug_init> again before you can use "
25751 "any other Augeas functions."
25755 #: ../src/guestfs-actions.pod:362 ../src/guestfs-actions.pod:387 ../src/guestfs-actions.pod:405 ../src/guestfs-actions.pod:419 ../src/guestfs-actions.pod:482 ../src/guestfs-actions.pod:502 ../src/guestfs-actions.pod:516 ../src/guestfs-actions.pod:547 ../src/guestfs-actions.pod:561 ../src/guestfs-actions.pod:575 ../src/guestfs-actions.pod:589 ../src/guestfs-actions.pod:607 ../src/guestfs-actions.pod:6516
25756 msgid "(Added in 0.7)"
25760 #: ../src/guestfs-actions.pod:364
25761 msgid "guestfs_aug_defnode"
25765 #: ../src/guestfs-actions.pod:366
25768 " struct guestfs_int_bool *\n"
25769 " guestfs_aug_defnode (guestfs_h *g,\n"
25770 " const char *name,\n"
25771 " const char *expr,\n"
25772 " const char *val);\n"
25777 #: ../src/guestfs-actions.pod:375
25779 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
25780 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
25781 "containing that single node."
25785 #: ../src/guestfs-actions.pod:383
25787 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
25788 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
25792 #: ../src/guestfs-actions.pod:389
25793 msgid "guestfs_aug_defvar"
25797 #: ../src/guestfs-actions.pod:391
25801 " guestfs_aug_defvar (guestfs_h *g,\n"
25802 " const char *name,\n"
25803 " const char *expr);\n"
25808 #: ../src/guestfs-actions.pod:407
25809 msgid "guestfs_aug_get"
25813 #: ../src/guestfs-actions.pod:409
25817 " guestfs_aug_get (guestfs_h *g,\n"
25818 " const char *augpath);\n"
25823 #: ../src/guestfs-actions.pod:416 ../src/guestfs-actions.pod:1019 ../src/guestfs-actions.pod:1037 ../src/guestfs-actions.pod:1097 ../src/guestfs-actions.pod:1113 ../src/guestfs-actions.pod:1216 ../src/guestfs-actions.pod:1705 ../src/guestfs-actions.pod:1722 ../src/guestfs-actions.pod:1741 ../src/guestfs-actions.pod:1875 ../src/guestfs-actions.pod:2063 ../src/guestfs-actions.pod:2175 ../src/guestfs-actions.pod:2338 ../src/guestfs-actions.pod:2355 ../src/guestfs-actions.pod:2422 ../src/guestfs-actions.pod:2465 ../src/guestfs-actions.pod:2486 ../src/guestfs-actions.pod:2671 ../src/guestfs-actions.pod:2885 ../src/guestfs-actions.pod:3089 ../src/guestfs-actions.pod:3191 ../src/guestfs-actions.pod:3295 ../src/guestfs-actions.pod:3314 ../src/guestfs-actions.pod:3529 ../src/guestfs-actions.pod:3557 ../src/guestfs-actions.pod:3578 ../src/guestfs-actions.pod:3612 ../src/guestfs-actions.pod:3679 ../src/guestfs-actions.pod:3699 ../src/guestfs-actions.pod:3719 ../src/guestfs-actions.pod:4359 ../src/guestfs-actions.pod:4706 ../src/guestfs-actions.pod:4873 ../src/guestfs-actions.pod:5132 ../src/guestfs-actions.pod:6025 ../src/guestfs-actions.pod:6226 ../src/guestfs-actions.pod:6414 ../src/guestfs-actions.pod:6592 ../src/guestfs-actions.pod:6641 ../src/guestfs-actions.pod:7301 ../src/guestfs-actions.pod:7317 ../src/guestfs-actions.pod:7341 ../src/guestfs-actions.pod:7365 ../src/guestfs-actions.pod:8161 ../src/guestfs-actions.pod:8180 ../src/guestfs-actions.pod:8198 ../src/guestfs-actions.pod:8372 ../src/guestfs-actions.pod:8686
25825 "This function returns a string, or NULL on error. I<The caller must free "
25826 "the returned string after use>."
25830 #: ../src/guestfs-actions.pod:421
25831 msgid "guestfs_aug_init"
25835 #: ../src/guestfs-actions.pod:423
25839 " guestfs_aug_init (guestfs_h *g,\n"
25840 " const char *root,\n"
25846 #: ../src/guestfs-actions.pod:432
25847 msgid "You must call this before using any other C<guestfs_aug_*> commands."
25851 #: ../src/guestfs-actions.pod:457
25853 "This option is only useful when debugging Augeas lenses. Use of this option "
25854 "may require additional memory for the libguestfs appliance. You may need to "
25855 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
25856 "C<guestfs_set_memsize>."
25860 #: ../src/guestfs-actions.pod:472
25861 msgid "Do not load the tree in C<guestfs_aug_init>."
25865 #: ../src/guestfs-actions.pod:476
25866 msgid "To close the handle, you can call C<guestfs_aug_close>."
25870 #: ../src/guestfs-actions.pod:484
25871 msgid "guestfs_aug_insert"
25875 #: ../src/guestfs-actions.pod:486
25879 " guestfs_aug_insert (guestfs_h *g,\n"
25880 " const char *augpath,\n"
25881 " const char *label,\n"
25887 #: ../src/guestfs-actions.pod:504
25888 msgid "guestfs_aug_load"
25892 #: ../src/guestfs-actions.pod:506
25896 " guestfs_aug_load (guestfs_h *g);\n"
25901 #: ../src/guestfs-actions.pod:518
25902 msgid "guestfs_aug_ls"
25906 #: ../src/guestfs-actions.pod:520
25910 " guestfs_aug_ls (guestfs_h *g,\n"
25911 " const char *augpath);\n"
25916 #: ../src/guestfs-actions.pod:524
25918 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
25919 "sorting the resulting nodes into alphabetical order."
25923 #: ../src/guestfs-actions.pod:527 ../src/guestfs-actions.pod:543 ../src/guestfs-actions.pod:689 ../src/guestfs-actions.pod:1235 ../src/guestfs-actions.pod:1890 ../src/guestfs-actions.pod:1909 ../src/guestfs-actions.pod:2012 ../src/guestfs-actions.pod:2031 ../src/guestfs-actions.pod:2277 ../src/guestfs-actions.pod:2743 ../src/guestfs-actions.pod:2759 ../src/guestfs-actions.pod:2778 ../src/guestfs-actions.pod:2843 ../src/guestfs-actions.pod:2867 ../src/guestfs-actions.pod:2938 ../src/guestfs-actions.pod:2987 ../src/guestfs-actions.pod:3256 ../src/guestfs-actions.pod:3631 ../src/guestfs-actions.pod:3915 ../src/guestfs-actions.pod:4229 ../src/guestfs-actions.pod:4246 ../src/guestfs-actions.pod:4266 ../src/guestfs-actions.pod:4321 ../src/guestfs-actions.pod:4341 ../src/guestfs-actions.pod:4446 ../src/guestfs-actions.pod:4845 ../src/guestfs-actions.pod:5751 ../src/guestfs-actions.pod:6386 ../src/guestfs-actions.pod:6512 ../src/guestfs-actions.pod:6626 ../src/guestfs-actions.pod:7381 ../src/guestfs-actions.pod:7442 ../src/guestfs-actions.pod:7497 ../src/guestfs-actions.pod:7643 ../src/guestfs-actions.pod:7667 ../src/guestfs-actions.pod:8265 ../src/guestfs-actions.pod:8285 ../src/guestfs-actions.pod:8332 ../src/guestfs-actions.pod:8526 ../src/guestfs-actions.pod:8545 ../src/guestfs-actions.pod:8636 ../src/guestfs-actions.pod:8655 ../src/guestfs-actions.pod:8701 ../src/guestfs-actions.pod:8720
25925 "This function returns a NULL-terminated array of strings (like "
25926 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
25927 "strings and the array after use>."
25931 #: ../src/guestfs-actions.pod:531 ../src/guestfs-actions.pod:1160 ../src/guestfs-actions.pod:1178 ../src/guestfs-actions.pod:1947 ../src/guestfs-actions.pod:3993 ../src/guestfs-actions.pod:4024 ../src/guestfs-actions.pod:4689 ../src/guestfs-actions.pod:4736 ../src/guestfs-actions.pod:5072 ../src/guestfs-actions.pod:5105 ../src/guestfs-actions.pod:5268 ../src/guestfs-actions.pod:5755 ../src/guestfs-actions.pod:6327 ../src/guestfs-actions.pod:6724 ../src/guestfs-actions.pod:6738 ../src/guestfs-actions.pod:6750 ../src/guestfs-actions.pod:7228 ../src/guestfs-actions.pod:8003 ../src/guestfs-actions.pod:8016 ../src/guestfs-actions.pod:8249 ../src/guestfs-actions.pod:8514
25932 msgid "(Added in 0.8)"
25936 #: ../src/guestfs-actions.pod:533
25937 msgid "guestfs_aug_match"
25941 #: ../src/guestfs-actions.pod:535
25945 " guestfs_aug_match (guestfs_h *g,\n"
25946 " const char *augpath);\n"
25951 #: ../src/guestfs-actions.pod:549
25952 msgid "guestfs_aug_mv"
25956 #: ../src/guestfs-actions.pod:551
25960 " guestfs_aug_mv (guestfs_h *g,\n"
25961 " const char *src,\n"
25962 " const char *dest);\n"
25967 #: ../src/guestfs-actions.pod:563
25968 msgid "guestfs_aug_rm"
25972 #: ../src/guestfs-actions.pod:565
25976 " guestfs_aug_rm (guestfs_h *g,\n"
25977 " const char *augpath);\n"
25982 #: ../src/guestfs-actions.pod:577
25983 msgid "guestfs_aug_save"
25987 #: ../src/guestfs-actions.pod:579
25991 " guestfs_aug_save (guestfs_h *g);\n"
25996 #: ../src/guestfs-actions.pod:584
25998 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
26003 #: ../src/guestfs-actions.pod:591
26004 msgid "guestfs_aug_set"
26008 #: ../src/guestfs-actions.pod:593
26012 " guestfs_aug_set (guestfs_h *g,\n"
26013 " const char *augpath,\n"
26014 " const char *val);\n"
26019 #: ../src/guestfs-actions.pod:600
26021 "In the Augeas API, it is possible to clear a node by setting the value to "
26022 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
26023 "this call. Instead you must use the C<guestfs_aug_clear> call."
26027 #: ../src/guestfs-actions.pod:609
26028 msgid "guestfs_available"
26032 #: ../src/guestfs-actions.pod:611
26036 " guestfs_available (guestfs_h *g,\n"
26037 " char *const *groups);\n"
26042 #: ../src/guestfs-actions.pod:619
26044 "The libguestfs groups, and the functions that those groups correspond to, "
26045 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
26046 "runtime by calling C<guestfs_available_all_groups>."
26050 #: ../src/guestfs-actions.pod:643
26051 msgid "You must call C<guestfs_launch> before calling this function."
26055 #: ../src/guestfs-actions.pod:665
26057 "This call was added in version C<1.0.80>. In previous versions of "
26058 "libguestfs all you could do would be to speculatively execute a command to "
26059 "find out if the daemon implemented it. See also C<guestfs_version>."
26063 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:1692
26064 msgid "(Added in 1.0.80)"
26068 #: ../src/guestfs-actions.pod:676
26069 msgid "guestfs_available_all_groups"
26073 #: ../src/guestfs-actions.pod:678
26077 " guestfs_available_all_groups (guestfs_h *g);\n"
26082 #: ../src/guestfs-actions.pod:681
26084 "This command returns a list of all optional groups that this daemon knows "
26085 "about. Note this returns both supported and unsupported groups. To find "
26086 "out which ones the daemon can actually support you have to call "
26087 "C<guestfs_available> on each member of the returned list."
26091 #: ../src/guestfs-actions.pod:687
26092 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
26096 #: ../src/guestfs-actions.pod:693
26097 msgid "(Added in 1.3.15)"
26101 #: ../src/guestfs-actions.pod:695
26102 msgid "guestfs_base64_in"
26106 #: ../src/guestfs-actions.pod:697
26110 " guestfs_base64_in (guestfs_h *g,\n"
26111 " const char *base64file,\n"
26112 " const char *filename);\n"
26117 #: ../src/guestfs-actions.pod:707 ../src/guestfs-actions.pod:721
26118 msgid "(Added in 1.3.5)"
26122 #: ../src/guestfs-actions.pod:709
26123 msgid "guestfs_base64_out"
26127 #: ../src/guestfs-actions.pod:711
26131 " guestfs_base64_out (guestfs_h *g,\n"
26132 " const char *filename,\n"
26133 " const char *base64file);\n"
26138 #: ../src/guestfs-actions.pod:723
26139 msgid "guestfs_blkid"
26143 #: ../src/guestfs-actions.pod:725
26147 " guestfs_blkid (guestfs_h *g,\n"
26148 " const char *device);\n"
26153 #: ../src/guestfs-actions.pod:756 ../src/guestfs-actions.pod:3231 ../src/guestfs-actions.pod:3499 ../src/guestfs-actions.pod:4306 ../src/guestfs-actions.pod:5045 ../src/guestfs-actions.pod:5731 ../src/guestfs-actions.pod:7928
26155 "This function returns a NULL-terminated array of strings, or NULL if there "
26156 "was an error. The array of strings will always have length C<2n+1>, where "
26157 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
26158 "caller must free the strings and the array after use>."
26162 #: ../src/guestfs-actions.pod:762
26163 msgid "guestfs_blockdev_flushbufs"
26167 #: ../src/guestfs-actions.pod:764
26171 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
26172 " const char *device);\n"
26177 #: ../src/guestfs-actions.pod:775 ../src/guestfs-actions.pod:792 ../src/guestfs-actions.pod:807 ../src/guestfs-actions.pod:823 ../src/guestfs-actions.pod:841 ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:874 ../src/guestfs-actions.pod:892 ../src/guestfs-actions.pod:906 ../src/guestfs-actions.pod:920
26178 msgid "(Added in 0.9.3)"
26182 #: ../src/guestfs-actions.pod:777
26183 msgid "guestfs_blockdev_getbsz"
26187 #: ../src/guestfs-actions.pod:779
26191 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
26192 " const char *device);\n"
26197 #: ../src/guestfs-actions.pod:794
26198 msgid "guestfs_blockdev_getro"
26202 #: ../src/guestfs-actions.pod:796
26206 " guestfs_blockdev_getro (guestfs_h *g,\n"
26207 " const char *device);\n"
26212 #: ../src/guestfs-actions.pod:805 ../src/guestfs-actions.pod:1930 ../src/guestfs-actions.pod:1945 ../src/guestfs-actions.pod:2434 ../src/guestfs-actions.pod:2445 ../src/guestfs-actions.pod:2517 ../src/guestfs-actions.pod:2543 ../src/guestfs-actions.pod:2583 ../src/guestfs-actions.pod:2598 ../src/guestfs-actions.pod:2634 ../src/guestfs-actions.pod:2657 ../src/guestfs-actions.pod:3736 ../src/guestfs-actions.pod:3752 ../src/guestfs-actions.pod:3770 ../src/guestfs-actions.pod:3932 ../src/guestfs-actions.pod:3946 ../src/guestfs-actions.pod:3961 ../src/guestfs-actions.pod:3975 ../src/guestfs-actions.pod:3991 ../src/guestfs-actions.pod:4006 ../src/guestfs-actions.pod:4022 ../src/guestfs-actions.pod:4036 ../src/guestfs-actions.pod:4049 ../src/guestfs-actions.pod:4063 ../src/guestfs-actions.pod:4078 ../src/guestfs-actions.pod:4093 ../src/guestfs-actions.pod:4106 ../src/guestfs-actions.pod:4120 ../src/guestfs-actions.pod:5989
26213 msgid "This function returns a C truth value on success or -1 on error."
26217 #: ../src/guestfs-actions.pod:809
26218 msgid "guestfs_blockdev_getsize64"
26222 #: ../src/guestfs-actions.pod:811
26226 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
26227 " const char *device);\n"
26232 #: ../src/guestfs-actions.pod:817
26233 msgid "See also C<guestfs_blockdev_getsz>."
26237 #: ../src/guestfs-actions.pod:825
26238 msgid "guestfs_blockdev_getss"
26242 #: ../src/guestfs-actions.pod:827
26246 " guestfs_blockdev_getss (guestfs_h *g,\n"
26247 " const char *device);\n"
26252 #: ../src/guestfs-actions.pod:834
26254 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
26259 #: ../src/guestfs-actions.pod:843
26260 msgid "guestfs_blockdev_getsz"
26264 #: ../src/guestfs-actions.pod:845
26268 " guestfs_blockdev_getsz (guestfs_h *g,\n"
26269 " const char *device);\n"
26274 #: ../src/guestfs-actions.pod:852
26276 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
26277 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
26281 #: ../src/guestfs-actions.pod:862
26282 msgid "guestfs_blockdev_rereadpt"
26286 #: ../src/guestfs-actions.pod:864
26290 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
26291 " const char *device);\n"
26296 #: ../src/guestfs-actions.pod:876
26297 msgid "guestfs_blockdev_setbsz"
26301 #: ../src/guestfs-actions.pod:878
26305 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
26306 " const char *device,\n"
26307 " int blocksize);\n"
26312 #: ../src/guestfs-actions.pod:894
26313 msgid "guestfs_blockdev_setro"
26317 #: ../src/guestfs-actions.pod:896
26321 " guestfs_blockdev_setro (guestfs_h *g,\n"
26322 " const char *device);\n"
26327 #: ../src/guestfs-actions.pod:908
26328 msgid "guestfs_blockdev_setrw"
26332 #: ../src/guestfs-actions.pod:910
26336 " guestfs_blockdev_setrw (guestfs_h *g,\n"
26337 " const char *device);\n"
26342 #: ../src/guestfs-actions.pod:922
26343 msgid "guestfs_btrfs_filesystem_resize"
26347 #: ../src/guestfs-actions.pod:924
26351 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
26352 " const char *mountpoint,\n"
26358 #: ../src/guestfs-actions.pod:934
26361 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
26366 #: ../src/guestfs-actions.pod:957
26367 msgid "(Added in 1.11.17)"
26371 #: ../src/guestfs-actions.pod:959
26372 msgid "guestfs_btrfs_filesystem_resize_va"
26376 #: ../src/guestfs-actions.pod:961
26380 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
26381 " const char *mountpoint,\n"
26382 " va_list args);\n"
26387 #: ../src/guestfs-actions.pod:966
26388 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
26392 #: ../src/guestfs-actions.pod:970
26393 msgid "guestfs_btrfs_filesystem_resize_argv"
26397 #: ../src/guestfs-actions.pod:972
26401 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
26402 " const char *mountpoint,\n"
26404 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
26409 #: ../src/guestfs-actions.pod:977
26410 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
26414 #: ../src/guestfs-actions.pod:981
26415 msgid "guestfs_case_sensitive_path"
26419 #: ../src/guestfs-actions.pod:983
26423 " guestfs_case_sensitive_path (guestfs_h *g,\n"
26424 " const char *path);\n"
26429 #: ../src/guestfs-actions.pod:1009
26431 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
26432 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
26433 "how the directories were originally created under Windows)."
26437 #: ../src/guestfs-actions.pod:1017
26438 msgid "See also C<guestfs_realpath>."
26442 #: ../src/guestfs-actions.pod:1022 ../src/guestfs-actions.pod:8183
26443 msgid "(Added in 1.0.75)"
26447 #: ../src/guestfs-actions.pod:1024
26448 msgid "guestfs_cat"
26452 #: ../src/guestfs-actions.pod:1026
26456 " guestfs_cat (guestfs_h *g,\n"
26457 " const char *path);\n"
26462 #: ../src/guestfs-actions.pod:1032
26464 "Note that this function cannot correctly handle binary files (specifically, "
26465 "files containing C<\\0> character which is treated as end of string). For "
26466 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
26467 "functions which have a more complex interface."
26471 #: ../src/guestfs-actions.pod:1043 ../src/guestfs-actions.pod:4250 ../src/guestfs-actions.pod:4345 ../src/guestfs-actions.pod:4362 ../src/guestfs-actions.pod:4450 ../src/guestfs-actions.pod:4849 ../src/guestfs-actions.pod:4863 ../src/guestfs-actions.pod:6390 ../src/guestfs-actions.pod:6404 ../src/guestfs-actions.pod:8336 ../src/guestfs-actions.pod:8350
26472 msgid "(Added in 0.4)"
26476 #: ../src/guestfs-actions.pod:1045
26477 msgid "guestfs_checksum"
26481 #: ../src/guestfs-actions.pod:1047
26485 " guestfs_checksum (guestfs_h *g,\n"
26486 " const char *csumtype,\n"
26487 " const char *path);\n"
26492 #: ../src/guestfs-actions.pod:1093
26493 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
26497 #: ../src/guestfs-actions.pod:1095
26498 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
26502 #: ../src/guestfs-actions.pod:1100 ../src/guestfs-actions.pod:1767 ../src/guestfs-actions.pod:2625 ../src/guestfs-actions.pod:3948 ../src/guestfs-actions.pod:3977 ../src/guestfs-actions.pod:4038 ../src/guestfs-actions.pod:4065 ../src/guestfs-actions.pod:8039
26503 msgid "(Added in 1.0.2)"
26507 #: ../src/guestfs-actions.pod:1102
26508 msgid "guestfs_checksum_device"
26512 #: ../src/guestfs-actions.pod:1104
26516 " guestfs_checksum_device (guestfs_h *g,\n"
26517 " const char *csumtype,\n"
26518 " const char *device);\n"
26523 #: ../src/guestfs-actions.pod:1109
26525 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
26526 "device named C<device>. For the types of checksums supported see the "
26527 "C<guestfs_checksum> command."
26531 #: ../src/guestfs-actions.pod:1116 ../src/guestfs-actions.pod:5822 ../src/guestfs-actions.pod:5957 ../src/guestfs-actions.pod:5991 ../src/guestfs-actions.pod:6009 ../src/guestfs-actions.pod:6191 ../src/guestfs-actions.pod:7948 ../src/guestfs-actions.pod:7962 ../src/guestfs-actions.pod:8362
26532 msgid "(Added in 1.3.2)"
26536 #: ../src/guestfs-actions.pod:1118
26537 msgid "guestfs_checksums_out"
26541 #: ../src/guestfs-actions.pod:1120
26545 " guestfs_checksums_out (guestfs_h *g,\n"
26546 " const char *csumtype,\n"
26547 " const char *directory,\n"
26548 " const char *sumsfile);\n"
26553 #: ../src/guestfs-actions.pod:1140
26554 msgid "(Added in 1.3.7)"
26558 #: ../src/guestfs-actions.pod:1142
26559 msgid "guestfs_chmod"
26563 #: ../src/guestfs-actions.pod:1144
26567 " guestfs_chmod (guestfs_h *g,\n"
26569 " const char *path);\n"
26574 #: ../src/guestfs-actions.pod:1162
26575 msgid "guestfs_chown"
26579 #: ../src/guestfs-actions.pod:1164
26583 " guestfs_chown (guestfs_h *g,\n"
26586 " const char *path);\n"
26591 #: ../src/guestfs-actions.pod:1180
26592 msgid "guestfs_command"
26596 #: ../src/guestfs-actions.pod:1182
26600 " guestfs_command (guestfs_h *g,\n"
26601 " char *const *arguments);\n"
26606 #: ../src/guestfs-actions.pod:1191
26608 "The single parameter is an argv-style list of arguments. The first element "
26609 "is the name of the program to run. Subsequent elements are parameters. The "
26610 "list must be non-empty (ie. must contain a program name). Note that the "
26611 "command runs directly, and is I<not> invoked via the shell (see "
26616 #: ../src/guestfs-actions.pod:1222 ../src/guestfs-actions.pod:1242 ../src/guestfs-actions.pod:2066
26617 msgid "(Added in 0.9.1)"
26621 #: ../src/guestfs-actions.pod:1224
26622 msgid "guestfs_command_lines"
26626 #: ../src/guestfs-actions.pod:1226
26630 " guestfs_command_lines (guestfs_h *g,\n"
26631 " char *const *arguments);\n"
26636 #: ../src/guestfs-actions.pod:1230
26638 "This is the same as C<guestfs_command>, but splits the result into a list of "
26643 #: ../src/guestfs-actions.pod:1233
26644 msgid "See also: C<guestfs_sh_lines>"
26648 #: ../src/guestfs-actions.pod:1244
26649 msgid "guestfs_compress_device_out"
26653 #: ../src/guestfs-actions.pod:1246
26657 " guestfs_compress_device_out (guestfs_h *g,\n"
26658 " const char *ctype,\n"
26659 " const char *device,\n"
26660 " const char *zdevice,\n"
26666 #: ../src/guestfs-actions.pod:1258
26669 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
26674 #: ../src/guestfs-actions.pod:1263
26676 "The C<ctype> and optional C<level> parameters have the same meaning as in "
26677 "C<guestfs_compress_out>."
26681 #: ../src/guestfs-actions.pod:1268 ../src/guestfs-actions.pod:1327 ../src/guestfs-actions.pod:2611 ../src/guestfs-actions.pod:7107
26682 msgid "(Added in 1.13.15)"
26686 #: ../src/guestfs-actions.pod:1270
26687 msgid "guestfs_compress_device_out_va"
26691 #: ../src/guestfs-actions.pod:1272
26695 " guestfs_compress_device_out_va (guestfs_h *g,\n"
26696 " const char *ctype,\n"
26697 " const char *device,\n"
26698 " const char *zdevice,\n"
26699 " va_list args);\n"
26704 #: ../src/guestfs-actions.pod:1279
26705 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
26709 #: ../src/guestfs-actions.pod:1283
26710 msgid "guestfs_compress_device_out_argv"
26714 #: ../src/guestfs-actions.pod:1285
26718 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
26719 " const char *ctype,\n"
26720 " const char *device,\n"
26721 " const char *zdevice,\n"
26723 "guestfs_compress_device_out_argv *optargs);\n"
26728 #: ../src/guestfs-actions.pod:1292
26729 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
26733 #: ../src/guestfs-actions.pod:1296
26734 msgid "guestfs_compress_out"
26738 #: ../src/guestfs-actions.pod:1298
26742 " guestfs_compress_out (guestfs_h *g,\n"
26743 " const char *ctype,\n"
26744 " const char *file,\n"
26745 " const char *zfile,\n"
26751 #: ../src/guestfs-actions.pod:1310
26754 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
26759 #: ../src/guestfs-actions.pod:1329
26760 msgid "guestfs_compress_out_va"
26764 #: ../src/guestfs-actions.pod:1331
26768 " guestfs_compress_out_va (guestfs_h *g,\n"
26769 " const char *ctype,\n"
26770 " const char *file,\n"
26771 " const char *zfile,\n"
26772 " va_list args);\n"
26777 #: ../src/guestfs-actions.pod:1338
26778 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
26782 #: ../src/guestfs-actions.pod:1342
26783 msgid "guestfs_compress_out_argv"
26787 #: ../src/guestfs-actions.pod:1344
26791 " guestfs_compress_out_argv (guestfs_h *g,\n"
26792 " const char *ctype,\n"
26793 " const char *file,\n"
26794 " const char *zfile,\n"
26795 " const struct guestfs_compress_out_argv "
26801 #: ../src/guestfs-actions.pod:1351
26802 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
26806 #: ../src/guestfs-actions.pod:1355
26807 msgid "guestfs_config"
26811 #: ../src/guestfs-actions.pod:1357
26815 " guestfs_config (guestfs_h *g,\n"
26816 " const char *qemuparam,\n"
26817 " const char *qemuvalue);\n"
26822 #: ../src/guestfs-actions.pod:1375
26823 msgid "guestfs_copy_device_to_device"
26827 #: ../src/guestfs-actions.pod:1377
26831 " guestfs_copy_device_to_device (guestfs_h *g,\n"
26832 " const char *src,\n"
26833 " const char *dest,\n"
26839 #: ../src/guestfs-actions.pod:1388
26842 " GUESTFS_COPY_DEVICE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
26843 " GUESTFS_COPY_DEVICE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
26844 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, int64_t size,\n"
26849 #: ../src/guestfs-actions.pod:1392
26851 "The four calls C<guestfs_copy_device_to_device>, "
26852 "C<guestfs_copy_device_to_file>, C<guestfs_copy_file_to_device>, and "
26853 "C<guestfs_copy_file_to_file> let you copy from a source (device|file) to a "
26854 "destination (device|file)."
26858 #: ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1466 ../src/guestfs-actions.pod:1519 ../src/guestfs-actions.pod:1577 ../src/guestfs-actions.pod:1631 ../src/guestfs-actions.pod:1762 ../src/guestfs-actions.pod:1793 ../src/guestfs-actions.pod:1838 ../src/guestfs-actions.pod:2215 ../src/guestfs-actions.pod:2237 ../src/guestfs-actions.pod:4148 ../src/guestfs-actions.pod:8034 ../src/guestfs-actions.pod:8068 ../src/guestfs-actions.pod:8575 ../src/guestfs-actions.pod:8598
26860 "This long-running command can generate progress notification messages so "
26861 "that the caller can display a progress bar or indicator. To receive these "
26862 "messages, the caller must register a progress event callback. See "
26863 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
26867 #: ../src/guestfs-actions.pod:1418 ../src/guestfs-actions.pod:1471 ../src/guestfs-actions.pod:1524 ../src/guestfs-actions.pod:1582 ../src/guestfs-actions.pod:6247
26868 msgid "(Added in 1.13.25)"
26872 #: ../src/guestfs-actions.pod:1420
26873 msgid "guestfs_copy_device_to_device_va"
26877 #: ../src/guestfs-actions.pod:1422
26881 " guestfs_copy_device_to_device_va (guestfs_h *g,\n"
26882 " const char *src,\n"
26883 " const char *dest,\n"
26884 " va_list args);\n"
26889 #: ../src/guestfs-actions.pod:1428
26890 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_device>."
26894 #: ../src/guestfs-actions.pod:1432
26895 msgid "guestfs_copy_device_to_device_argv"
26899 #: ../src/guestfs-actions.pod:1434
26903 " guestfs_copy_device_to_device_argv (guestfs_h *g,\n"
26904 " const char *src,\n"
26905 " const char *dest,\n"
26907 "guestfs_copy_device_to_device_argv *optargs);\n"
26912 #: ../src/guestfs-actions.pod:1440
26913 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_device>."
26917 #: ../src/guestfs-actions.pod:1444
26918 msgid "guestfs_copy_device_to_file"
26922 #: ../src/guestfs-actions.pod:1446
26926 " guestfs_copy_device_to_file (guestfs_h *g,\n"
26927 " const char *src,\n"
26928 " const char *dest,\n"
26934 #: ../src/guestfs-actions.pod:1457
26937 " GUESTFS_COPY_DEVICE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
26938 " GUESTFS_COPY_DEVICE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
26939 " GUESTFS_COPY_DEVICE_TO_FILE_SIZE, int64_t size,\n"
26944 #: ../src/guestfs-actions.pod:1461 ../src/guestfs-actions.pod:1514 ../src/guestfs-actions.pod:1567
26945 msgid "See C<guestfs_copy_device_to_device> for a general overview of this call."
26949 #: ../src/guestfs-actions.pod:1473
26950 msgid "guestfs_copy_device_to_file_va"
26954 #: ../src/guestfs-actions.pod:1475
26958 " guestfs_copy_device_to_file_va (guestfs_h *g,\n"
26959 " const char *src,\n"
26960 " const char *dest,\n"
26961 " va_list args);\n"
26966 #: ../src/guestfs-actions.pod:1481
26967 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_file>."
26971 #: ../src/guestfs-actions.pod:1485
26972 msgid "guestfs_copy_device_to_file_argv"
26976 #: ../src/guestfs-actions.pod:1487
26980 " guestfs_copy_device_to_file_argv (guestfs_h *g,\n"
26981 " const char *src,\n"
26982 " const char *dest,\n"
26984 "guestfs_copy_device_to_file_argv *optargs);\n"
26989 #: ../src/guestfs-actions.pod:1493
26990 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_file>."
26994 #: ../src/guestfs-actions.pod:1497
26995 msgid "guestfs_copy_file_to_device"
26999 #: ../src/guestfs-actions.pod:1499
27003 " guestfs_copy_file_to_device (guestfs_h *g,\n"
27004 " const char *src,\n"
27005 " const char *dest,\n"
27011 #: ../src/guestfs-actions.pod:1510
27014 " GUESTFS_COPY_FILE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
27015 " GUESTFS_COPY_FILE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
27016 " GUESTFS_COPY_FILE_TO_DEVICE_SIZE, int64_t size,\n"
27021 #: ../src/guestfs-actions.pod:1526
27022 msgid "guestfs_copy_file_to_device_va"
27026 #: ../src/guestfs-actions.pod:1528
27030 " guestfs_copy_file_to_device_va (guestfs_h *g,\n"
27031 " const char *src,\n"
27032 " const char *dest,\n"
27033 " va_list args);\n"
27038 #: ../src/guestfs-actions.pod:1534
27039 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_device>."
27043 #: ../src/guestfs-actions.pod:1538
27044 msgid "guestfs_copy_file_to_device_argv"
27048 #: ../src/guestfs-actions.pod:1540
27052 " guestfs_copy_file_to_device_argv (guestfs_h *g,\n"
27053 " const char *src,\n"
27054 " const char *dest,\n"
27056 "guestfs_copy_file_to_device_argv *optargs);\n"
27061 #: ../src/guestfs-actions.pod:1546
27062 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_device>."
27066 #: ../src/guestfs-actions.pod:1550
27067 msgid "guestfs_copy_file_to_file"
27071 #: ../src/guestfs-actions.pod:1552
27075 " guestfs_copy_file_to_file (guestfs_h *g,\n"
27076 " const char *src,\n"
27077 " const char *dest,\n"
27083 #: ../src/guestfs-actions.pod:1563
27086 " GUESTFS_COPY_FILE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
27087 " GUESTFS_COPY_FILE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
27088 " GUESTFS_COPY_FILE_TO_FILE_SIZE, int64_t size,\n"
27093 #: ../src/guestfs-actions.pod:1570
27095 "This is B<not> the function you want for copying files. This is for copying "
27096 "blocks within existing files. See C<guestfs_cp>, C<guestfs_cp_a> and "
27097 "C<guestfs_mv> for general file copying and moving functions."
27101 #: ../src/guestfs-actions.pod:1584
27102 msgid "guestfs_copy_file_to_file_va"
27106 #: ../src/guestfs-actions.pod:1586
27110 " guestfs_copy_file_to_file_va (guestfs_h *g,\n"
27111 " const char *src,\n"
27112 " const char *dest,\n"
27113 " va_list args);\n"
27118 #: ../src/guestfs-actions.pod:1592
27119 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_file>."
27123 #: ../src/guestfs-actions.pod:1596
27124 msgid "guestfs_copy_file_to_file_argv"
27128 #: ../src/guestfs-actions.pod:1598
27132 " guestfs_copy_file_to_file_argv (guestfs_h *g,\n"
27133 " const char *src,\n"
27134 " const char *dest,\n"
27135 " const struct guestfs_copy_file_to_file_argv "
27141 #: ../src/guestfs-actions.pod:1604
27142 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_file>."
27146 #: ../src/guestfs-actions.pod:1608
27147 msgid "guestfs_copy_size"
27151 #: ../src/guestfs-actions.pod:1610
27155 " guestfs_copy_size (guestfs_h *g,\n"
27156 " const char *src,\n"
27157 " const char *dest,\n"
27158 " int64_t size);\n"
27163 #: ../src/guestfs-actions.pod:1616 ../src/guestfs-actions.pod:1673
27165 "I<This function is deprecated.> In new code, use the "
27166 "L</guestfs_copy_device_to_device> call instead."
27170 #: ../src/guestfs-actions.pod:1636 ../src/guestfs-actions.pod:4876 ../src/guestfs-actions.pod:6417 ../src/guestfs-actions.pod:8269 ../src/guestfs-actions.pod:8289 ../src/guestfs-actions.pod:8375
27171 msgid "(Added in 1.0.87)"
27175 #: ../src/guestfs-actions.pod:1638
27180 #: ../src/guestfs-actions.pod:1640
27184 " guestfs_cp (guestfs_h *g,\n"
27185 " const char *src,\n"
27186 " const char *dest);\n"
27191 #: ../src/guestfs-actions.pod:1650 ../src/guestfs-actions.pod:1664 ../src/guestfs-actions.pod:1744 ../src/guestfs-actions.pod:1818 ../src/guestfs-actions.pod:1932 ../src/guestfs-actions.pod:5769 ../src/guestfs-actions.pod:6261
27192 msgid "(Added in 1.0.18)"
27196 #: ../src/guestfs-actions.pod:1652
27197 msgid "guestfs_cp_a"
27201 #: ../src/guestfs-actions.pod:1654
27205 " guestfs_cp_a (guestfs_h *g,\n"
27206 " const char *src,\n"
27207 " const char *dest);\n"
27212 #: ../src/guestfs-actions.pod:1666
27217 #: ../src/guestfs-actions.pod:1668
27221 " guestfs_dd (guestfs_h *g,\n"
27222 " const char *src,\n"
27223 " const char *dest);\n"
27228 #: ../src/guestfs-actions.pod:1685
27230 "If the destination is a device, it must be as large or larger than the "
27231 "source file or device, otherwise the copy will fail. This command cannot do "
27232 "partial copies (see C<guestfs_copy_device_to_device>)."
27236 #: ../src/guestfs-actions.pod:1694
27241 #: ../src/guestfs-actions.pod:1696
27245 " guestfs_df (guestfs_h *g);\n"
27250 #: ../src/guestfs-actions.pod:1701 ../src/guestfs-actions.pod:1718
27252 "This command is mostly useful for interactive sessions. It is I<not> "
27253 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
27258 #: ../src/guestfs-actions.pod:1708 ../src/guestfs-actions.pod:1725 ../src/guestfs-actions.pod:1843 ../src/guestfs-actions.pod:2850 ../src/guestfs-actions.pod:2874 ../src/guestfs-actions.pod:2942 ../src/guestfs-actions.pod:5135 ../src/guestfs-actions.pod:5669 ../src/guestfs-actions.pod:7650 ../src/guestfs-actions.pod:7674 ../src/guestfs-actions.pod:8415 ../src/guestfs-actions.pod:8428 ../src/guestfs-actions.pod:8441
27259 msgid "(Added in 1.0.54)"
27263 #: ../src/guestfs-actions.pod:1710
27264 msgid "guestfs_df_h"
27268 #: ../src/guestfs-actions.pod:1712
27272 " guestfs_df_h (guestfs_h *g);\n"
27277 #: ../src/guestfs-actions.pod:1727
27278 msgid "guestfs_dmesg"
27282 #: ../src/guestfs-actions.pod:1729
27286 " guestfs_dmesg (guestfs_h *g);\n"
27291 #: ../src/guestfs-actions.pod:1736
27293 "Another way to get the same information is to enable verbose messages with "
27294 "C<guestfs_set_verbose> or by setting the environment variable "
27295 "C<LIBGUESTFS_DEBUG=1> before running the program."
27299 #: ../src/guestfs-actions.pod:1746
27300 msgid "guestfs_download"
27304 #: ../src/guestfs-actions.pod:1748
27308 " guestfs_download (guestfs_h *g,\n"
27309 " const char *remotefilename,\n"
27310 " const char *filename);\n"
27315 #: ../src/guestfs-actions.pod:1758
27316 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
27320 #: ../src/guestfs-actions.pod:1769
27321 msgid "guestfs_download_offset"
27325 #: ../src/guestfs-actions.pod:1771
27329 " guestfs_download_offset (guestfs_h *g,\n"
27330 " const char *remotefilename,\n"
27331 " const char *filename,\n"
27332 " int64_t offset,\n"
27333 " int64_t size);\n"
27338 #: ../src/guestfs-actions.pod:1784
27340 "Note that there is no limit on the amount of data that can be downloaded "
27341 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
27342 "full amount unless an error occurs."
27346 #: ../src/guestfs-actions.pod:1789
27347 msgid "See also C<guestfs_download>, C<guestfs_pread>."
27351 #: ../src/guestfs-actions.pod:1798 ../src/guestfs-actions.pod:8073
27352 msgid "(Added in 1.5.17)"
27356 #: ../src/guestfs-actions.pod:1800
27357 msgid "guestfs_drop_caches"
27361 #: ../src/guestfs-actions.pod:1802
27365 " guestfs_drop_caches (guestfs_h *g,\n"
27366 " int whattodrop);\n"
27371 #: ../src/guestfs-actions.pod:1820
27376 #: ../src/guestfs-actions.pod:1822
27380 " guestfs_du (guestfs_h *g,\n"
27381 " const char *path);\n"
27386 #: ../src/guestfs-actions.pod:1845
27387 msgid "guestfs_e2fsck_f"
27391 #: ../src/guestfs-actions.pod:1847
27395 " guestfs_e2fsck_f (guestfs_h *g,\n"
27396 " const char *device);\n"
27401 #: ../src/guestfs-actions.pod:1855
27403 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
27404 "Normally you should use C<guestfs_fsck>."
27408 #: ../src/guestfs-actions.pod:1860
27409 msgid "(Added in 1.0.29)"
27413 #: ../src/guestfs-actions.pod:1862
27414 msgid "guestfs_echo_daemon"
27418 #: ../src/guestfs-actions.pod:1864
27422 " guestfs_echo_daemon (guestfs_h *g,\n"
27423 " char *const *words);\n"
27428 #: ../src/guestfs-actions.pod:1873
27429 msgid "See also C<guestfs_ping_daemon>."
27433 #: ../src/guestfs-actions.pod:1878 ../src/guestfs-actions.pod:2636 ../src/guestfs-actions.pod:7131
27434 msgid "(Added in 1.0.69)"
27438 #: ../src/guestfs-actions.pod:1880
27439 msgid "guestfs_egrep"
27443 #: ../src/guestfs-actions.pod:1882
27447 " guestfs_egrep (guestfs_h *g,\n"
27448 " const char *regex,\n"
27449 " const char *path);\n"
27454 #: ../src/guestfs-actions.pod:1897 ../src/guestfs-actions.pod:1916 ../src/guestfs-actions.pod:1973 ../src/guestfs-actions.pod:2019 ../src/guestfs-actions.pod:2038 ../src/guestfs-actions.pod:2766 ../src/guestfs-actions.pod:2785 ../src/guestfs-actions.pod:2963 ../src/guestfs-actions.pod:2976 ../src/guestfs-actions.pod:2991 ../src/guestfs-actions.pod:3037 ../src/guestfs-actions.pod:3059 ../src/guestfs-actions.pod:3072 ../src/guestfs-actions.pod:4375 ../src/guestfs-actions.pod:4389 ../src/guestfs-actions.pod:4402 ../src/guestfs-actions.pod:4416 ../src/guestfs-actions.pod:5557 ../src/guestfs-actions.pod:6595 ../src/guestfs-actions.pod:6644 ../src/guestfs-actions.pod:7518 ../src/guestfs-actions.pod:7530 ../src/guestfs-actions.pod:7543 ../src/guestfs-actions.pod:7556 ../src/guestfs-actions.pod:7578 ../src/guestfs-actions.pod:7591 ../src/guestfs-actions.pod:7604 ../src/guestfs-actions.pod:7617 ../src/guestfs-actions.pod:8533 ../src/guestfs-actions.pod:8552 ../src/guestfs-actions.pod:8643 ../src/guestfs-actions.pod:8662 ../src/guestfs-actions.pod:8708 ../src/guestfs-actions.pod:8727
27455 msgid "(Added in 1.0.66)"
27459 #: ../src/guestfs-actions.pod:1899
27460 msgid "guestfs_egrepi"
27464 #: ../src/guestfs-actions.pod:1901
27468 " guestfs_egrepi (guestfs_h *g,\n"
27469 " const char *regex,\n"
27470 " const char *path);\n"
27475 #: ../src/guestfs-actions.pod:1918
27476 msgid "guestfs_equal"
27480 #: ../src/guestfs-actions.pod:1920
27484 " guestfs_equal (guestfs_h *g,\n"
27485 " const char *file1,\n"
27486 " const char *file2);\n"
27491 #: ../src/guestfs-actions.pod:1934
27492 msgid "guestfs_exists"
27496 #: ../src/guestfs-actions.pod:1936
27500 " guestfs_exists (guestfs_h *g,\n"
27501 " const char *path);\n"
27506 #: ../src/guestfs-actions.pod:1943
27507 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
27511 #: ../src/guestfs-actions.pod:1949
27512 msgid "guestfs_fallocate"
27516 #: ../src/guestfs-actions.pod:1951
27520 " guestfs_fallocate (guestfs_h *g,\n"
27521 " const char *path,\n"
27527 #: ../src/guestfs-actions.pod:1956
27529 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
27534 #: ../src/guestfs-actions.pod:1975
27535 msgid "guestfs_fallocate64"
27539 #: ../src/guestfs-actions.pod:1977
27543 " guestfs_fallocate64 (guestfs_h *g,\n"
27544 " const char *path,\n"
27550 #: ../src/guestfs-actions.pod:1986
27552 "Note that this call allocates disk blocks for the file. To create a sparse "
27553 "file use C<guestfs_truncate_size> instead."
27557 #: ../src/guestfs-actions.pod:1989
27559 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
27560 "oversight it only allowed 30 bit lengths to be specified, effectively "
27561 "limiting the maximum size of files created through that call to 1GB."
27565 #: ../src/guestfs-actions.pod:2000
27566 msgid "(Added in 1.3.17)"
27570 #: ../src/guestfs-actions.pod:2002
27571 msgid "guestfs_fgrep"
27575 #: ../src/guestfs-actions.pod:2004
27579 " guestfs_fgrep (guestfs_h *g,\n"
27580 " const char *pattern,\n"
27581 " const char *path);\n"
27586 #: ../src/guestfs-actions.pod:2021
27587 msgid "guestfs_fgrepi"
27591 #: ../src/guestfs-actions.pod:2023
27595 " guestfs_fgrepi (guestfs_h *g,\n"
27596 " const char *pattern,\n"
27597 " const char *path);\n"
27602 #: ../src/guestfs-actions.pod:2040
27603 msgid "guestfs_file"
27607 #: ../src/guestfs-actions.pod:2042
27611 " guestfs_file (guestfs_h *g,\n"
27612 " const char *path);\n"
27617 #: ../src/guestfs-actions.pod:2060
27619 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
27620 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
27624 #: ../src/guestfs-actions.pod:2068
27625 msgid "guestfs_file_architecture"
27629 #: ../src/guestfs-actions.pod:2070
27633 " guestfs_file_architecture (guestfs_h *g,\n"
27634 " const char *filename);\n"
27639 #: ../src/guestfs-actions.pod:2178 ../src/guestfs-actions.pod:2341 ../src/guestfs-actions.pod:2358 ../src/guestfs-actions.pod:3092 ../src/guestfs-actions.pod:3194 ../src/guestfs-actions.pod:3260 ../src/guestfs-actions.pod:3447 ../src/guestfs-actions.pod:3465 ../src/guestfs-actions.pod:3505 ../src/guestfs-actions.pod:3581 ../src/guestfs-actions.pod:3682 ../src/guestfs-actions.pod:3919 ../src/guestfs-actions.pod:4051
27640 msgid "(Added in 1.5.3)"
27644 #: ../src/guestfs-actions.pod:2180
27645 msgid "guestfs_filesize"
27649 #: ../src/guestfs-actions.pod:2182
27653 " guestfs_filesize (guestfs_h *g,\n"
27654 " const char *file);\n"
27659 #: ../src/guestfs-actions.pod:2188
27661 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
27662 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
27663 "devices, use C<guestfs_blockdev_getsize64>."
27667 #: ../src/guestfs-actions.pod:2194
27668 msgid "(Added in 1.0.82)"
27672 #: ../src/guestfs-actions.pod:2196
27673 msgid "guestfs_fill"
27677 #: ../src/guestfs-actions.pod:2198
27681 " guestfs_fill (guestfs_h *g,\n"
27684 " const char *path);\n"
27689 #: ../src/guestfs-actions.pod:2208
27691 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
27692 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
27693 "bytes use C<guestfs_fill_pattern>."
27697 #: ../src/guestfs-actions.pod:2220
27698 msgid "(Added in 1.0.79)"
27702 #: ../src/guestfs-actions.pod:2222
27703 msgid "guestfs_fill_pattern"
27707 #: ../src/guestfs-actions.pod:2224
27711 " guestfs_fill_pattern (guestfs_h *g,\n"
27712 " const char *pattern,\n"
27714 " const char *path);\n"
27719 #: ../src/guestfs-actions.pod:2230
27721 "This function is like C<guestfs_fill> except that it creates a new file of "
27722 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
27723 "pattern is truncated if necessary to ensure the length of the file is "
27724 "exactly C<len> bytes."
27728 #: ../src/guestfs-actions.pod:2242
27729 msgid "(Added in 1.3.12)"
27733 #: ../src/guestfs-actions.pod:2244
27734 msgid "guestfs_find"
27738 #: ../src/guestfs-actions.pod:2246
27742 " guestfs_find (guestfs_h *g,\n"
27743 " const char *directory);\n"
27748 #: ../src/guestfs-actions.pod:2262
27749 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
27753 #: ../src/guestfs-actions.pod:2275
27754 msgid "See also C<guestfs_find0>."
27758 #: ../src/guestfs-actions.pod:2284 ../src/guestfs-actions.pod:4813 ../src/guestfs-actions.pod:6679
27759 msgid "(Added in 1.0.27)"
27763 #: ../src/guestfs-actions.pod:2286
27764 msgid "guestfs_find0"
27768 #: ../src/guestfs-actions.pod:2288
27772 " guestfs_find0 (guestfs_h *g,\n"
27773 " const char *directory,\n"
27774 " const char *files);\n"
27779 #: ../src/guestfs-actions.pod:2297
27781 "This command works the same way as C<guestfs_find> with the following "
27786 #: ../src/guestfs-actions.pod:2324
27787 msgid "(Added in 1.0.74)"
27791 #: ../src/guestfs-actions.pod:2326
27792 msgid "guestfs_findfs_label"
27796 #: ../src/guestfs-actions.pod:2328
27800 " guestfs_findfs_label (guestfs_h *g,\n"
27801 " const char *label);\n"
27806 #: ../src/guestfs-actions.pod:2336
27807 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
27811 #: ../src/guestfs-actions.pod:2343
27812 msgid "guestfs_findfs_uuid"
27816 #: ../src/guestfs-actions.pod:2345
27820 " guestfs_findfs_uuid (guestfs_h *g,\n"
27821 " const char *uuid);\n"
27826 #: ../src/guestfs-actions.pod:2353
27827 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
27831 #: ../src/guestfs-actions.pod:2360
27832 msgid "guestfs_fsck"
27836 #: ../src/guestfs-actions.pod:2362
27840 " guestfs_fsck (guestfs_h *g,\n"
27841 " const char *fstype,\n"
27842 " const char *device);\n"
27847 #: ../src/guestfs-actions.pod:2397 ../src/guestfs-actions.pod:8580
27848 msgid "(Added in 1.0.16)"
27852 #: ../src/guestfs-actions.pod:2399
27853 msgid "guestfs_get_append"
27857 #: ../src/guestfs-actions.pod:2401
27861 " guestfs_get_append (guestfs_h *g);\n"
27866 #: ../src/guestfs-actions.pod:2409
27868 "This function returns a string which may be NULL. There is no way to return "
27869 "an error from this function. The string is owned by the guest handle and "
27870 "must I<not> be freed."
27874 #: ../src/guestfs-actions.pod:2413 ../src/guestfs-actions.pod:6357 ../src/guestfs-actions.pod:6836 ../src/guestfs-actions.pod:7285 ../src/guestfs-actions.pod:7304 ../src/guestfs-actions.pod:7320 ../src/guestfs-actions.pod:7344 ../src/guestfs-actions.pod:8220 ../src/guestfs-actions.pod:8235 ../src/guestfs-actions.pod:8624
27875 msgid "(Added in 1.0.26)"
27879 #: ../src/guestfs-actions.pod:2415
27880 msgid "guestfs_get_attach_method"
27884 #: ../src/guestfs-actions.pod:2417
27888 " guestfs_get_attach_method (guestfs_h *g);\n"
27893 #: ../src/guestfs-actions.pod:2420
27894 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
27898 #: ../src/guestfs-actions.pod:2425 ../src/guestfs-actions.pod:6866
27899 msgid "(Added in 1.9.8)"
27903 #: ../src/guestfs-actions.pod:2427
27904 msgid "guestfs_get_autosync"
27908 #: ../src/guestfs-actions.pod:2429
27912 " guestfs_get_autosync (guestfs_h *g);\n"
27917 #: ../src/guestfs-actions.pod:2438
27918 msgid "guestfs_get_direct"
27922 #: ../src/guestfs-actions.pod:2440
27926 " guestfs_get_direct (guestfs_h *g);\n"
27931 #: ../src/guestfs-actions.pod:2447 ../src/guestfs-actions.pod:6907
27932 msgid "(Added in 1.0.72)"
27936 #: ../src/guestfs-actions.pod:2449
27937 msgid "guestfs_get_e2label"
27941 #: ../src/guestfs-actions.pod:2451
27945 " guestfs_get_e2label (guestfs_h *g,\n"
27946 " const char *device);\n"
27951 #: ../src/guestfs-actions.pod:2455
27953 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
27958 #: ../src/guestfs-actions.pod:2468 ../src/guestfs-actions.pod:2489 ../src/guestfs-actions.pod:6925 ../src/guestfs-actions.pod:6944
27959 msgid "(Added in 1.0.15)"
27963 #: ../src/guestfs-actions.pod:2470
27964 msgid "guestfs_get_e2uuid"
27968 #: ../src/guestfs-actions.pod:2472
27972 " guestfs_get_e2uuid (guestfs_h *g,\n"
27973 " const char *device);\n"
27978 #: ../src/guestfs-actions.pod:2476
27980 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
27985 #: ../src/guestfs-actions.pod:2491
27986 msgid "guestfs_get_memsize"
27990 #: ../src/guestfs-actions.pod:2493
27994 " guestfs_get_memsize (guestfs_h *g);\n"
27999 #: ../src/guestfs-actions.pod:2499
28001 "If C<guestfs_set_memsize> was not called on this handle, and if "
28002 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
28003 "value for memsize."
28007 #: ../src/guestfs-actions.pod:2508 ../src/guestfs-actions.pod:5253 ../src/guestfs-actions.pod:5462 ../src/guestfs-actions.pod:5481 ../src/guestfs-actions.pod:5500 ../src/guestfs-actions.pod:5512 ../src/guestfs-actions.pod:5529 ../src/guestfs-actions.pod:5542 ../src/guestfs-actions.pod:6582 ../src/guestfs-actions.pod:6965 ../src/guestfs-actions.pod:7255 ../src/guestfs-actions.pod:7989
28008 msgid "(Added in 1.0.55)"
28012 #: ../src/guestfs-actions.pod:2510
28013 msgid "guestfs_get_network"
28017 #: ../src/guestfs-actions.pod:2512
28021 " guestfs_get_network (guestfs_h *g);\n"
28026 #: ../src/guestfs-actions.pod:2519 ../src/guestfs-actions.pod:6984
28027 msgid "(Added in 1.5.4)"
28031 #: ../src/guestfs-actions.pod:2521
28032 msgid "guestfs_get_path"
28036 #: ../src/guestfs-actions.pod:2523
28040 " guestfs_get_path (guestfs_h *g);\n"
28045 #: ../src/guestfs-actions.pod:2531 ../src/guestfs-actions.pod:2571
28047 "This function returns a string, or NULL on error. The string is owned by "
28048 "the guest handle and must I<not> be freed."
28052 #: ../src/guestfs-actions.pod:2536
28053 msgid "guestfs_get_pgroup"
28057 #: ../src/guestfs-actions.pod:2538
28061 " guestfs_get_pgroup (guestfs_h *g);\n"
28066 #: ../src/guestfs-actions.pod:2545 ../src/guestfs-actions.pod:7020 ../src/guestfs-actions.pod:8481
28067 msgid "(Added in 1.11.18)"
28071 #: ../src/guestfs-actions.pod:2547
28072 msgid "guestfs_get_pid"
28076 #: ../src/guestfs-actions.pod:2549
28080 " guestfs_get_pid (guestfs_h *g);\n"
28085 #: ../src/guestfs-actions.pod:2559
28086 msgid "(Added in 1.0.56)"
28090 #: ../src/guestfs-actions.pod:2561
28091 msgid "guestfs_get_qemu"
28095 #: ../src/guestfs-actions.pod:2563
28099 " guestfs_get_qemu (guestfs_h *g);\n"
28104 #: ../src/guestfs-actions.pod:2574 ../src/guestfs-actions.pod:7048
28105 msgid "(Added in 1.0.6)"
28109 #: ../src/guestfs-actions.pod:2576
28110 msgid "guestfs_get_recovery_proc"
28114 #: ../src/guestfs-actions.pod:2578
28118 " guestfs_get_recovery_proc (guestfs_h *g);\n"
28123 #: ../src/guestfs-actions.pod:2585 ../src/guestfs-actions.pod:4173 ../src/guestfs-actions.pod:4517 ../src/guestfs-actions.pod:4911 ../src/guestfs-actions.pod:5092 ../src/guestfs-actions.pod:6287 ../src/guestfs-actions.pod:6630 ../src/guestfs-actions.pod:7072 ../src/guestfs-actions.pod:7770 ../src/guestfs-actions.pod:7790 ../src/guestfs-actions.pod:8104
28124 msgid "(Added in 1.0.77)"
28128 #: ../src/guestfs-actions.pod:2587
28129 msgid "guestfs_get_selinux"
28133 #: ../src/guestfs-actions.pod:2589
28137 " guestfs_get_selinux (guestfs_h *g);\n"
28142 #: ../src/guestfs-actions.pod:2592
28144 "This returns the current setting of the selinux flag which is passed to the "
28145 "appliance at boot time. See C<guestfs_set_selinux>."
28149 #: ../src/guestfs-actions.pod:2600 ../src/guestfs-actions.pod:2674 ../src/guestfs-actions.pod:7091 ../src/guestfs-actions.pod:7165
28150 msgid "(Added in 1.0.67)"
28154 #: ../src/guestfs-actions.pod:2602
28155 msgid "guestfs_get_smp"
28159 #: ../src/guestfs-actions.pod:2604
28163 " guestfs_get_smp (guestfs_h *g);\n"
28168 #: ../src/guestfs-actions.pod:2613
28169 msgid "guestfs_get_state"
28173 #: ../src/guestfs-actions.pod:2615
28177 " guestfs_get_state (guestfs_h *g);\n"
28182 #: ../src/guestfs-actions.pod:2627
28183 msgid "guestfs_get_trace"
28187 #: ../src/guestfs-actions.pod:2629
28191 " guestfs_get_trace (guestfs_h *g);\n"
28196 #: ../src/guestfs-actions.pod:2638
28197 msgid "guestfs_get_umask"
28201 #: ../src/guestfs-actions.pod:2640
28205 " guestfs_get_umask (guestfs_h *g);\n"
28210 #: ../src/guestfs-actions.pod:2643
28212 "Return the current umask. By default the umask is C<022> unless it has been "
28213 "set by calling C<guestfs_umask>."
28217 #: ../src/guestfs-actions.pod:2650
28218 msgid "guestfs_get_verbose"
28222 #: ../src/guestfs-actions.pod:2652
28226 " guestfs_get_verbose (guestfs_h *g);\n"
28231 #: ../src/guestfs-actions.pod:2661
28232 msgid "guestfs_getcon"
28236 #: ../src/guestfs-actions.pod:2663
28240 " guestfs_getcon (guestfs_h *g);\n"
28245 #: ../src/guestfs-actions.pod:2668
28246 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
28250 #: ../src/guestfs-actions.pod:2676
28251 msgid "guestfs_getxattr"
28255 #: ../src/guestfs-actions.pod:2678
28259 " guestfs_getxattr (guestfs_h *g,\n"
28260 " const char *path,\n"
28261 " const char *name,\n"
28262 " size_t *size_r);\n"
28267 #: ../src/guestfs-actions.pod:2684
28269 "Get a single extended attribute from file C<path> named C<name>. This call "
28270 "follows symlinks. If you want to lookup an extended attribute for the "
28271 "symlink itself, use C<guestfs_lgetxattr>."
28275 #: ../src/guestfs-actions.pod:2688 ../src/guestfs-actions.pod:4187
28277 "Normally it is better to get all extended attributes from a file in one go "
28278 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
28279 "implementations are buggy and do not provide a way to list out attributes. "
28280 "For these filesystems (notably ntfs-3g) you have to know the names of the "
28281 "extended attributes you want in advance and call this function."
28285 #: ../src/guestfs-actions.pod:2698
28286 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
28290 #: ../src/guestfs-actions.pod:2700 ../src/guestfs-actions.pod:2913 ../src/guestfs-actions.pod:3395 ../src/guestfs-actions.pod:4199 ../src/guestfs-actions.pod:6280 ../src/guestfs-actions.pod:6306 ../src/guestfs-actions.pod:6487
28292 "This function returns a buffer, or NULL on error. The size of the returned "
28293 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
28298 #: ../src/guestfs-actions.pod:2704 ../src/guestfs-actions.pod:4203
28299 msgid "(Added in 1.7.24)"
28303 #: ../src/guestfs-actions.pod:2706
28304 msgid "guestfs_getxattrs"
28308 #: ../src/guestfs-actions.pod:2708
28311 " struct guestfs_xattr_list *\n"
28312 " guestfs_getxattrs (guestfs_h *g,\n"
28313 " const char *path);\n"
28318 #: ../src/guestfs-actions.pod:2718
28319 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
28323 #: ../src/guestfs-actions.pod:2720 ../src/guestfs-actions.pod:4215 ../src/guestfs-actions.pod:4907
28325 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
28326 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
28330 #: ../src/guestfs-actions.pod:2724 ../src/guestfs-actions.pod:4219 ../src/guestfs-actions.pod:4431 ../src/guestfs-actions.pod:4467 ../src/guestfs-actions.pod:6660 ../src/guestfs-actions.pod:7184 ../src/guestfs-actions.pod:8689
28331 msgid "(Added in 1.0.59)"
28335 #: ../src/guestfs-actions.pod:2726
28336 msgid "guestfs_glob_expand"
28340 #: ../src/guestfs-actions.pod:2728
28344 " guestfs_glob_expand (guestfs_h *g,\n"
28345 " const char *pattern);\n"
28350 #: ../src/guestfs-actions.pod:2747 ../src/guestfs-actions.pod:7368 ../src/guestfs-actions.pod:7385
28351 msgid "(Added in 1.0.50)"
28355 #: ../src/guestfs-actions.pod:2749
28356 msgid "guestfs_grep"
28360 #: ../src/guestfs-actions.pod:2751
28364 " guestfs_grep (guestfs_h *g,\n"
28365 " const char *regex,\n"
28366 " const char *path);\n"
28371 #: ../src/guestfs-actions.pod:2768
28372 msgid "guestfs_grepi"
28376 #: ../src/guestfs-actions.pod:2770
28380 " guestfs_grepi (guestfs_h *g,\n"
28381 " const char *regex,\n"
28382 " const char *path);\n"
28387 #: ../src/guestfs-actions.pod:2787
28388 msgid "guestfs_grub_install"
28392 #: ../src/guestfs-actions.pod:2789
28396 " guestfs_grub_install (guestfs_h *g,\n"
28397 " const char *root,\n"
28398 " const char *device);\n"
28403 #: ../src/guestfs-actions.pod:2832
28404 msgid "(Added in 1.0.17)"
28408 #: ../src/guestfs-actions.pod:2834
28409 msgid "guestfs_head"
28413 #: ../src/guestfs-actions.pod:2836
28417 " guestfs_head (guestfs_h *g,\n"
28418 " const char *path);\n"
28423 #: ../src/guestfs-actions.pod:2852
28424 msgid "guestfs_head_n"
28428 #: ../src/guestfs-actions.pod:2854
28432 " guestfs_head_n (guestfs_h *g,\n"
28434 " const char *path);\n"
28439 #: ../src/guestfs-actions.pod:2876
28440 msgid "guestfs_hexdump"
28444 #: ../src/guestfs-actions.pod:2878
28448 " guestfs_hexdump (guestfs_h *g,\n"
28449 " const char *path);\n"
28454 #: ../src/guestfs-actions.pod:2891 ../src/guestfs-actions.pod:7449 ../src/guestfs-actions.pod:7504
28455 msgid "(Added in 1.0.22)"
28459 #: ../src/guestfs-actions.pod:2893
28460 msgid "guestfs_initrd_cat"
28464 #: ../src/guestfs-actions.pod:2895
28468 " guestfs_initrd_cat (guestfs_h *g,\n"
28469 " const char *initrdpath,\n"
28470 " const char *filename,\n"
28471 " size_t *size_r);\n"
28476 #: ../src/guestfs-actions.pod:2911
28477 msgid "See also C<guestfs_initrd_list>."
28481 #: ../src/guestfs-actions.pod:2922
28482 msgid "guestfs_initrd_list"
28486 #: ../src/guestfs-actions.pod:2924
28490 " guestfs_initrd_list (guestfs_h *g,\n"
28491 " const char *path);\n"
28496 #: ../src/guestfs-actions.pod:2944
28497 msgid "guestfs_inotify_add_watch"
28501 #: ../src/guestfs-actions.pod:2946
28505 " guestfs_inotify_add_watch (guestfs_h *g,\n"
28506 " const char *path,\n"
28512 #: ../src/guestfs-actions.pod:2965
28513 msgid "guestfs_inotify_close"
28517 #: ../src/guestfs-actions.pod:2967
28521 " guestfs_inotify_close (guestfs_h *g);\n"
28526 #: ../src/guestfs-actions.pod:2978
28527 msgid "guestfs_inotify_files"
28531 #: ../src/guestfs-actions.pod:2980
28535 " guestfs_inotify_files (guestfs_h *g);\n"
28540 #: ../src/guestfs-actions.pod:2983
28542 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
28543 "returns a list of pathnames of objects that were touched. The returned "
28544 "pathnames are sorted and deduplicated."
28548 #: ../src/guestfs-actions.pod:2993
28549 msgid "guestfs_inotify_init"
28553 #: ../src/guestfs-actions.pod:2995
28557 " guestfs_inotify_init (guestfs_h *g,\n"
28558 " int maxevents);\n"
28563 #: ../src/guestfs-actions.pod:3003
28565 "C<maxevents> is the maximum number of events which will be queued up between "
28566 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
28567 "passed as C<0>, then the kernel (or previously set) default is used. For "
28568 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
28569 "throws away events, but records the fact that it threw them away by setting "
28570 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
28571 "C<guestfs_inotify_read>)."
28575 #: ../src/guestfs-actions.pod:3013
28577 "Before any events are generated, you have to add some watches to the "
28578 "internal watch list. See: C<guestfs_inotify_add_watch>, "
28579 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
28583 #: ../src/guestfs-actions.pod:3019
28585 "Queued up events should be read periodically by calling "
28586 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
28587 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
28588 "often enough then you risk the internal queue overflowing."
28592 #: ../src/guestfs-actions.pod:3026
28594 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
28595 "This also removes any watches automatically."
28599 #: ../src/guestfs-actions.pod:3039
28600 msgid "guestfs_inotify_read"
28604 #: ../src/guestfs-actions.pod:3041
28607 " struct guestfs_inotify_event_list *\n"
28608 " guestfs_inotify_read (guestfs_h *g);\n"
28613 #: ../src/guestfs-actions.pod:3055
28615 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
28616 "there was an error. I<The caller must call "
28617 "C<guestfs_free_inotify_event_list> after use>."
28621 #: ../src/guestfs-actions.pod:3061
28622 msgid "guestfs_inotify_rm_watch"
28626 #: ../src/guestfs-actions.pod:3063
28630 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
28636 #: ../src/guestfs-actions.pod:3067
28638 "Remove a previously defined inotify watch. See "
28639 "C<guestfs_inotify_add_watch>."
28643 #: ../src/guestfs-actions.pod:3074
28644 msgid "guestfs_inspect_get_arch"
28648 #: ../src/guestfs-actions.pod:3076
28652 " guestfs_inspect_get_arch (guestfs_h *g,\n"
28653 " const char *root);\n"
28658 #: ../src/guestfs-actions.pod:3080
28660 "This returns the architecture of the inspected operating system. The "
28661 "possible return values are listed under C<guestfs_file_architecture>."
28665 #: ../src/guestfs-actions.pod:3094
28666 msgid "guestfs_inspect_get_distro"
28670 #: ../src/guestfs-actions.pod:3096
28674 " guestfs_inspect_get_distro (guestfs_h *g,\n"
28675 " const char *root);\n"
28680 #: ../src/guestfs-actions.pod:3196
28681 msgid "guestfs_inspect_get_drive_mappings"
28685 #: ../src/guestfs-actions.pod:3198
28689 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
28690 " const char *root);\n"
28695 #: ../src/guestfs-actions.pod:3227
28697 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28698 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
28702 #: ../src/guestfs-actions.pod:3237 ../src/guestfs-actions.pod:3702
28703 msgid "(Added in 1.9.17)"
28707 #: ../src/guestfs-actions.pod:3239
28708 msgid "guestfs_inspect_get_filesystems"
28712 #: ../src/guestfs-actions.pod:3241
28716 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
28717 " const char *root);\n"
28722 #: ../src/guestfs-actions.pod:3253
28724 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28725 "C<guestfs_inspect_get_mountpoints>."
28729 #: ../src/guestfs-actions.pod:3262
28730 msgid "guestfs_inspect_get_format"
28734 #: ../src/guestfs-actions.pod:3264
28738 " guestfs_inspect_get_format (guestfs_h *g,\n"
28739 " const char *root);\n"
28744 #: ../src/guestfs-actions.pod:3298 ../src/guestfs-actions.pod:3738 ../src/guestfs-actions.pod:3754 ../src/guestfs-actions.pod:3772 ../src/guestfs-actions.pod:6698
28745 msgid "(Added in 1.9.4)"
28749 #: ../src/guestfs-actions.pod:3300
28750 msgid "guestfs_inspect_get_hostname"
28754 #: ../src/guestfs-actions.pod:3302
28758 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
28759 " const char *root);\n"
28764 #: ../src/guestfs-actions.pod:3317
28765 msgid "(Added in 1.7.9)"
28769 #: ../src/guestfs-actions.pod:3319
28770 msgid "guestfs_inspect_get_icon"
28774 #: ../src/guestfs-actions.pod:3321
28778 " guestfs_inspect_get_icon (guestfs_h *g,\n"
28779 " const char *root,\n"
28780 " size_t *size_r,\n"
28786 #: ../src/guestfs-actions.pod:3332
28789 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
28790 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
28795 #: ../src/guestfs-actions.pod:3399 ../src/guestfs-actions.pod:4233 ../src/guestfs-actions.pod:5630
28796 msgid "(Added in 1.11.12)"
28800 #: ../src/guestfs-actions.pod:3401
28801 msgid "guestfs_inspect_get_icon_va"
28805 #: ../src/guestfs-actions.pod:3403
28809 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
28810 " const char *root,\n"
28811 " size_t *size_r,\n"
28812 " va_list args);\n"
28817 #: ../src/guestfs-actions.pod:3409
28818 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
28822 #: ../src/guestfs-actions.pod:3413
28823 msgid "guestfs_inspect_get_icon_argv"
28827 #: ../src/guestfs-actions.pod:3415
28831 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
28832 " const char *root,\n"
28833 " size_t *size_r,\n"
28834 " const struct guestfs_inspect_get_icon_argv "
28840 #: ../src/guestfs-actions.pod:3421
28841 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
28845 #: ../src/guestfs-actions.pod:3425
28846 msgid "guestfs_inspect_get_major_version"
28850 #: ../src/guestfs-actions.pod:3427
28854 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
28855 " const char *root);\n"
28860 #: ../src/guestfs-actions.pod:3449
28861 msgid "guestfs_inspect_get_minor_version"
28865 #: ../src/guestfs-actions.pod:3451
28869 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
28870 " const char *root);\n"
28875 #: ../src/guestfs-actions.pod:3460
28877 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28878 "C<guestfs_inspect_get_major_version>."
28882 #: ../src/guestfs-actions.pod:3467
28883 msgid "guestfs_inspect_get_mountpoints"
28887 #: ../src/guestfs-actions.pod:3469
28891 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
28892 " const char *root);\n"
28897 #: ../src/guestfs-actions.pod:3490
28899 "For operating systems like Windows which still use drive letters, this call "
28900 "will only return an entry for the first drive \"mounted on\" C</>. For "
28901 "information about the mapping of drive letters to partitions, see "
28902 "C<guestfs_inspect_get_drive_mappings>."
28906 #: ../src/guestfs-actions.pod:3496
28908 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28909 "C<guestfs_inspect_get_filesystems>."
28913 #: ../src/guestfs-actions.pod:3507
28914 msgid "guestfs_inspect_get_package_format"
28918 #: ../src/guestfs-actions.pod:3509
28922 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
28923 " const char *root);\n"
28928 #: ../src/guestfs-actions.pod:3513
28930 "This function and C<guestfs_inspect_get_package_management> return the "
28931 "package format and package management tool used by the inspected operating "
28932 "system. For example for Fedora these functions would return C<rpm> (package "
28933 "format) and C<yum> (package management)."
28937 #: ../src/guestfs-actions.pod:3532 ../src/guestfs-actions.pod:3560
28938 msgid "(Added in 1.7.5)"
28942 #: ../src/guestfs-actions.pod:3534
28943 msgid "guestfs_inspect_get_package_management"
28947 #: ../src/guestfs-actions.pod:3536
28951 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
28952 " const char *root);\n"
28957 #: ../src/guestfs-actions.pod:3540
28959 "C<guestfs_inspect_get_package_format> and this function return the package "
28960 "format and package management tool used by the inspected operating system. "
28961 "For example for Fedora these functions would return C<rpm> (package format) "
28962 "and C<yum> (package management)."
28966 #: ../src/guestfs-actions.pod:3562
28967 msgid "guestfs_inspect_get_product_name"
28971 #: ../src/guestfs-actions.pod:3564
28975 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
28976 " const char *root);\n"
28981 #: ../src/guestfs-actions.pod:3583
28982 msgid "guestfs_inspect_get_product_variant"
28986 #: ../src/guestfs-actions.pod:3585
28990 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
28991 " const char *root);\n"
28996 #: ../src/guestfs-actions.pod:3608
28998 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28999 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
29003 #: ../src/guestfs-actions.pod:3615
29004 msgid "(Added in 1.9.13)"
29008 #: ../src/guestfs-actions.pod:3617
29009 msgid "guestfs_inspect_get_roots"
29013 #: ../src/guestfs-actions.pod:3619
29017 " guestfs_inspect_get_roots (guestfs_h *g);\n"
29022 #: ../src/guestfs-actions.pod:3622
29024 "This function is a convenient way to get the list of root devices, as "
29025 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
29026 "the whole inspection process."
29030 #: ../src/guestfs-actions.pod:3626
29032 "This returns an empty list if either no root devices were found or the "
29033 "caller has not called C<guestfs_inspect_os>."
29037 #: ../src/guestfs-actions.pod:3635
29038 msgid "(Added in 1.7.3)"
29042 #: ../src/guestfs-actions.pod:3637
29043 msgid "guestfs_inspect_get_type"
29047 #: ../src/guestfs-actions.pod:3639
29051 " guestfs_inspect_get_type (guestfs_h *g,\n"
29052 " const char *root);\n"
29057 #: ../src/guestfs-actions.pod:3684
29058 msgid "guestfs_inspect_get_windows_current_control_set"
29062 #: ../src/guestfs-actions.pod:3686
29066 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
29067 " const char *root);\n"
29072 #: ../src/guestfs-actions.pod:3704
29073 msgid "guestfs_inspect_get_windows_systemroot"
29077 #: ../src/guestfs-actions.pod:3706
29081 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
29082 " const char *root);\n"
29087 #: ../src/guestfs-actions.pod:3722
29088 msgid "(Added in 1.5.25)"
29092 #: ../src/guestfs-actions.pod:3724
29093 msgid "guestfs_inspect_is_live"
29097 #: ../src/guestfs-actions.pod:3726
29101 " guestfs_inspect_is_live (guestfs_h *g,\n"
29102 " const char *root);\n"
29107 #: ../src/guestfs-actions.pod:3730
29109 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
29110 "disk), then this returns true if a live image was detected on the disk."
29114 #: ../src/guestfs-actions.pod:3740
29115 msgid "guestfs_inspect_is_multipart"
29119 #: ../src/guestfs-actions.pod:3742
29123 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
29124 " const char *root);\n"
29129 #: ../src/guestfs-actions.pod:3746
29131 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
29132 "disk), then this returns true if the disk is part of a set."
29136 #: ../src/guestfs-actions.pod:3756
29137 msgid "guestfs_inspect_is_netinst"
29141 #: ../src/guestfs-actions.pod:3758
29145 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
29146 " const char *root);\n"
29151 #: ../src/guestfs-actions.pod:3762
29153 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
29154 "disk), then this returns true if the disk is a network installer, ie. not a "
29155 "self-contained install CD but one which is likely to require network access "
29156 "to complete the install."
29160 #: ../src/guestfs-actions.pod:3774
29161 msgid "guestfs_inspect_list_applications"
29165 #: ../src/guestfs-actions.pod:3776
29168 " struct guestfs_application_list *\n"
29169 " guestfs_inspect_list_applications (guestfs_h *g,\n"
29170 " const char *root);\n"
29175 #: ../src/guestfs-actions.pod:3782
29177 "I<Note:> This call works differently from other parts of the inspection "
29178 "API. You have to call C<guestfs_inspect_os>, then "
29179 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
29180 "this. Listing applications is a significantly more difficult operation "
29181 "which requires access to the full filesystem. Also note that unlike the "
29182 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
29183 "the libguestfs handle, this call actually reads parts of the mounted "
29184 "filesystems during the call."
29188 #: ../src/guestfs-actions.pod:3872
29190 "This function returns a C<struct guestfs_application_list *>, or NULL if "
29191 "there was an error. I<The caller must call C<guestfs_free_application_list> "
29196 #: ../src/guestfs-actions.pod:3876
29197 msgid "(Added in 1.7.8)"
29201 #: ../src/guestfs-actions.pod:3878
29202 msgid "guestfs_inspect_os"
29206 #: ../src/guestfs-actions.pod:3880
29210 " guestfs_inspect_os (guestfs_h *g);\n"
29215 #: ../src/guestfs-actions.pod:3896
29217 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
29218 "functions in order to query further information about each operating system, "
29219 "such as the name and version."
29223 #: ../src/guestfs-actions.pod:3901
29225 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
29226 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
29227 "the contents. This should be called with no disks currently mounted. The "
29228 "function may also use Augeas, so any existing Augeas handle will be closed."
29232 #: ../src/guestfs-actions.pod:3913 ../src/guestfs-actions.pod:4244 ../src/guestfs-actions.pod:4339
29233 msgid "See also C<guestfs_list_filesystems>."
29237 #: ../src/guestfs-actions.pod:3921
29238 msgid "guestfs_is_blockdev"
29242 #: ../src/guestfs-actions.pod:3923
29246 " guestfs_is_blockdev (guestfs_h *g,\n"
29247 " const char *path);\n"
29252 #: ../src/guestfs-actions.pod:3930 ../src/guestfs-actions.pod:3959 ../src/guestfs-actions.pod:3989 ../src/guestfs-actions.pod:4004 ../src/guestfs-actions.pod:4020 ../src/guestfs-actions.pod:4076 ../src/guestfs-actions.pod:4091
29253 msgid "See also C<guestfs_stat>."
29257 #: ../src/guestfs-actions.pod:3934 ../src/guestfs-actions.pod:3963 ../src/guestfs-actions.pod:4008 ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4095
29258 msgid "(Added in 1.5.10)"
29262 #: ../src/guestfs-actions.pod:3936
29263 msgid "guestfs_is_busy"
29267 #: ../src/guestfs-actions.pod:3938
29271 " guestfs_is_busy (guestfs_h *g);\n"
29276 #: ../src/guestfs-actions.pod:3950
29277 msgid "guestfs_is_chardev"
29281 #: ../src/guestfs-actions.pod:3952
29285 " guestfs_is_chardev (guestfs_h *g,\n"
29286 " const char *path);\n"
29291 #: ../src/guestfs-actions.pod:3965
29292 msgid "guestfs_is_config"
29296 #: ../src/guestfs-actions.pod:3967
29300 " guestfs_is_config (guestfs_h *g);\n"
29305 #: ../src/guestfs-actions.pod:3979
29306 msgid "guestfs_is_dir"
29310 #: ../src/guestfs-actions.pod:3981
29314 " guestfs_is_dir (guestfs_h *g,\n"
29315 " const char *path);\n"
29320 #: ../src/guestfs-actions.pod:3995
29321 msgid "guestfs_is_fifo"
29325 #: ../src/guestfs-actions.pod:3997
29329 " guestfs_is_fifo (guestfs_h *g,\n"
29330 " const char *path);\n"
29335 #: ../src/guestfs-actions.pod:4010
29336 msgid "guestfs_is_file"
29340 #: ../src/guestfs-actions.pod:4012
29344 " guestfs_is_file (guestfs_h *g,\n"
29345 " const char *path);\n"
29350 #: ../src/guestfs-actions.pod:4026
29351 msgid "guestfs_is_launching"
29355 #: ../src/guestfs-actions.pod:4028
29359 " guestfs_is_launching (guestfs_h *g);\n"
29364 #: ../src/guestfs-actions.pod:4040
29365 msgid "guestfs_is_lv"
29369 #: ../src/guestfs-actions.pod:4042
29373 " guestfs_is_lv (guestfs_h *g,\n"
29374 " const char *device);\n"
29379 #: ../src/guestfs-actions.pod:4053
29380 msgid "guestfs_is_ready"
29384 #: ../src/guestfs-actions.pod:4055
29388 " guestfs_is_ready (guestfs_h *g);\n"
29393 #: ../src/guestfs-actions.pod:4067
29394 msgid "guestfs_is_socket"
29398 #: ../src/guestfs-actions.pod:4069
29402 " guestfs_is_socket (guestfs_h *g,\n"
29403 " const char *path);\n"
29408 #: ../src/guestfs-actions.pod:4082
29409 msgid "guestfs_is_symlink"
29413 #: ../src/guestfs-actions.pod:4084
29417 " guestfs_is_symlink (guestfs_h *g,\n"
29418 " const char *path);\n"
29423 #: ../src/guestfs-actions.pod:4097
29424 msgid "guestfs_is_zero"
29428 #: ../src/guestfs-actions.pod:4099
29432 " guestfs_is_zero (guestfs_h *g,\n"
29433 " const char *path);\n"
29438 #: ../src/guestfs-actions.pod:4108 ../src/guestfs-actions.pod:4122
29439 msgid "(Added in 1.11.8)"
29443 #: ../src/guestfs-actions.pod:4110
29444 msgid "guestfs_is_zero_device"
29448 #: ../src/guestfs-actions.pod:4112
29452 " guestfs_is_zero_device (guestfs_h *g,\n"
29453 " const char *device);\n"
29458 #: ../src/guestfs-actions.pod:4124
29459 msgid "guestfs_kill_subprocess"
29463 #: ../src/guestfs-actions.pod:4126
29467 " guestfs_kill_subprocess (guestfs_h *g);\n"
29472 #: ../src/guestfs-actions.pod:4135
29473 msgid "guestfs_launch"
29477 #: ../src/guestfs-actions.pod:4137
29481 " guestfs_launch (guestfs_h *g);\n"
29486 #: ../src/guestfs-actions.pod:4155
29487 msgid "guestfs_lchown"
29491 #: ../src/guestfs-actions.pod:4157
29495 " guestfs_lchown (guestfs_h *g,\n"
29498 " const char *path);\n"
29503 #: ../src/guestfs-actions.pod:4163
29505 "Change the file owner to C<owner> and group to C<group>. This is like "
29506 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
29507 "changed, not the target."
29511 #: ../src/guestfs-actions.pod:4175
29512 msgid "guestfs_lgetxattr"
29516 #: ../src/guestfs-actions.pod:4177
29520 " guestfs_lgetxattr (guestfs_h *g,\n"
29521 " const char *path,\n"
29522 " const char *name,\n"
29523 " size_t *size_r);\n"
29528 #: ../src/guestfs-actions.pod:4197
29529 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
29533 #: ../src/guestfs-actions.pod:4205
29534 msgid "guestfs_lgetxattrs"
29538 #: ../src/guestfs-actions.pod:4207
29541 " struct guestfs_xattr_list *\n"
29542 " guestfs_lgetxattrs (guestfs_h *g,\n"
29543 " const char *path);\n"
29548 #: ../src/guestfs-actions.pod:4211
29550 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
29551 "then it returns the extended attributes of the link itself."
29555 #: ../src/guestfs-actions.pod:4221
29556 msgid "guestfs_list_9p"
29560 #: ../src/guestfs-actions.pod:4223
29564 " guestfs_list_9p (guestfs_h *g);\n"
29569 #: ../src/guestfs-actions.pod:4235
29570 msgid "guestfs_list_devices"
29574 #: ../src/guestfs-actions.pod:4237
29578 " guestfs_list_devices (guestfs_h *g);\n"
29583 #: ../src/guestfs-actions.pod:4252
29584 msgid "guestfs_list_dm_devices"
29588 #: ../src/guestfs-actions.pod:4254
29592 " guestfs_list_dm_devices (guestfs_h *g);\n"
29597 #: ../src/guestfs-actions.pod:4259
29599 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
29600 "previous call to C<guestfs_luks_open>."
29604 #: ../src/guestfs-actions.pod:4262
29606 "Device mapper devices which correspond to logical volumes are I<not> "
29607 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
29612 #: ../src/guestfs-actions.pod:4270 ../src/guestfs-actions.pod:5869
29613 msgid "(Added in 1.11.15)"
29617 #: ../src/guestfs-actions.pod:4272
29618 msgid "guestfs_list_filesystems"
29622 #: ../src/guestfs-actions.pod:4274
29626 " guestfs_list_filesystems (guestfs_h *g);\n"
29631 #: ../src/guestfs-actions.pod:4294
29633 "This command runs other libguestfs commands, which might include "
29634 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
29635 "soon after launch and only when nothing is mounted."
29639 #: ../src/guestfs-actions.pod:4298
29641 "Not all of the filesystems returned will be mountable. In particular, swap "
29642 "partitions are returned in the list. Also this command does not check that "
29643 "each filesystem found is valid and mountable, and some filesystems might be "
29644 "mountable but require special options. Filesystems may not all belong to a "
29645 "single logical operating system (use C<guestfs_inspect_os> to look for "
29650 #: ../src/guestfs-actions.pod:4312 ../src/guestfs-actions.pod:6229
29651 msgid "(Added in 1.5.15)"
29655 #: ../src/guestfs-actions.pod:4314
29656 msgid "guestfs_list_md_devices"
29660 #: ../src/guestfs-actions.pod:4316
29664 " guestfs_list_md_devices (guestfs_h *g);\n"
29669 #: ../src/guestfs-actions.pod:4325 ../src/guestfs-actions.pod:7890
29670 msgid "(Added in 1.15.4)"
29674 #: ../src/guestfs-actions.pod:4327
29675 msgid "guestfs_list_partitions"
29679 #: ../src/guestfs-actions.pod:4329
29683 " guestfs_list_partitions (guestfs_h *g);\n"
29688 #: ../src/guestfs-actions.pod:4336
29690 "This does not return logical volumes. For that you will need to call "
29695 #: ../src/guestfs-actions.pod:4347
29700 #: ../src/guestfs-actions.pod:4349
29704 " guestfs_ll (guestfs_h *g,\n"
29705 " const char *directory);\n"
29710 #: ../src/guestfs-actions.pod:4364
29715 #: ../src/guestfs-actions.pod:4366
29719 " guestfs_ln (guestfs_h *g,\n"
29720 " const char *target,\n"
29721 " const char *linkname);\n"
29726 #: ../src/guestfs-actions.pod:4377
29727 msgid "guestfs_ln_f"
29731 #: ../src/guestfs-actions.pod:4379
29735 " guestfs_ln_f (guestfs_h *g,\n"
29736 " const char *target,\n"
29737 " const char *linkname);\n"
29742 #: ../src/guestfs-actions.pod:4391
29743 msgid "guestfs_ln_s"
29747 #: ../src/guestfs-actions.pod:4393
29751 " guestfs_ln_s (guestfs_h *g,\n"
29752 " const char *target,\n"
29753 " const char *linkname);\n"
29758 #: ../src/guestfs-actions.pod:4404
29759 msgid "guestfs_ln_sf"
29763 #: ../src/guestfs-actions.pod:4406
29767 " guestfs_ln_sf (guestfs_h *g,\n"
29768 " const char *target,\n"
29769 " const char *linkname);\n"
29774 #: ../src/guestfs-actions.pod:4418
29775 msgid "guestfs_lremovexattr"
29779 #: ../src/guestfs-actions.pod:4420
29783 " guestfs_lremovexattr (guestfs_h *g,\n"
29784 " const char *xattr,\n"
29785 " const char *path);\n"
29790 #: ../src/guestfs-actions.pod:4425
29792 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
29793 "link, then it removes an extended attribute of the link itself."
29797 #: ../src/guestfs-actions.pod:4433
29802 #: ../src/guestfs-actions.pod:4435
29806 " guestfs_ls (guestfs_h *g,\n"
29807 " const char *directory);\n"
29812 #: ../src/guestfs-actions.pod:4443
29814 "This command is mostly useful for interactive sessions. Programs should "
29815 "probably use C<guestfs_readdir> instead."
29819 #: ../src/guestfs-actions.pod:4452
29820 msgid "guestfs_lsetxattr"
29824 #: ../src/guestfs-actions.pod:4454
29828 " guestfs_lsetxattr (guestfs_h *g,\n"
29829 " const char *xattr,\n"
29830 " const char *val,\n"
29832 " const char *path);\n"
29837 #: ../src/guestfs-actions.pod:4461
29839 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
29840 "then it sets an extended attribute of the link itself."
29844 #: ../src/guestfs-actions.pod:4469
29845 msgid "guestfs_lstat"
29849 #: ../src/guestfs-actions.pod:4471
29852 " struct guestfs_stat *\n"
29853 " guestfs_lstat (guestfs_h *g,\n"
29854 " const char *path);\n"
29859 #: ../src/guestfs-actions.pod:4477
29861 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
29862 "link, then the link is stat-ed, not the file it refers to."
29866 #: ../src/guestfs-actions.pod:4483 ../src/guestfs-actions.pod:7409
29868 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
29869 "error. I<The caller must call C<guestfs_free_stat> after use>."
29873 #: ../src/guestfs-actions.pod:4487 ../src/guestfs-actions.pod:7413 ../src/guestfs-actions.pod:7431 ../src/guestfs-actions.pod:7934
29874 msgid "(Added in 0.9.2)"
29878 #: ../src/guestfs-actions.pod:4489
29879 msgid "guestfs_lstatlist"
29883 #: ../src/guestfs-actions.pod:4491
29886 " struct guestfs_stat_list *\n"
29887 " guestfs_lstatlist (guestfs_h *g,\n"
29888 " const char *path,\n"
29889 " char *const *names);\n"
29894 #: ../src/guestfs-actions.pod:4496
29896 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
29897 "files, where all files are in the directory C<path>. C<names> is the list "
29898 "of files from this directory."
29902 #: ../src/guestfs-actions.pod:4505
29904 "This call is intended for programs that want to efficiently list a directory "
29905 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
29906 "for a similarly efficient call for getting extended attributes. Very long "
29907 "directory listings might cause the protocol message size to be exceeded, "
29908 "causing this call to fail. The caller must split up such requests into "
29909 "smaller groups of names."
29913 #: ../src/guestfs-actions.pod:4513
29915 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
29916 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
29920 #: ../src/guestfs-actions.pod:4519
29921 msgid "guestfs_luks_add_key"
29925 #: ../src/guestfs-actions.pod:4521
29929 " guestfs_luks_add_key (guestfs_h *g,\n"
29930 " const char *device,\n"
29931 " const char *key,\n"
29932 " const char *newkey,\n"
29938 #: ../src/guestfs-actions.pod:4533
29940 "Note that if C<keyslot> already contains a key, then this command will "
29941 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
29945 #: ../src/guestfs-actions.pod:4539 ../src/guestfs-actions.pod:4576 ../src/guestfs-actions.pod:4596 ../src/guestfs-actions.pod:4616 ../src/guestfs-actions.pod:4651 ../src/guestfs-actions.pod:4670
29947 "This function takes a key or passphrase parameter which could contain "
29948 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
29953 #: ../src/guestfs-actions.pod:4543 ../src/guestfs-actions.pod:4580 ../src/guestfs-actions.pod:4600 ../src/guestfs-actions.pod:4620
29954 msgid "(Added in 1.5.2)"
29958 #: ../src/guestfs-actions.pod:4545
29959 msgid "guestfs_luks_close"
29963 #: ../src/guestfs-actions.pod:4547
29967 " guestfs_luks_close (guestfs_h *g,\n"
29968 " const char *device);\n"
29973 #: ../src/guestfs-actions.pod:4551
29975 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
29976 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
29977 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
29978 "underlying block device."
29982 #: ../src/guestfs-actions.pod:4559 ../src/guestfs-actions.pod:4655 ../src/guestfs-actions.pod:4674 ../src/guestfs-actions.pod:4724 ../src/guestfs-actions.pod:4769
29983 msgid "(Added in 1.5.1)"
29987 #: ../src/guestfs-actions.pod:4561
29988 msgid "guestfs_luks_format"
29992 #: ../src/guestfs-actions.pod:4563
29996 " guestfs_luks_format (guestfs_h *g,\n"
29997 " const char *device,\n"
29998 " const char *key,\n"
30004 #: ../src/guestfs-actions.pod:4582
30005 msgid "guestfs_luks_format_cipher"
30009 #: ../src/guestfs-actions.pod:4584
30013 " guestfs_luks_format_cipher (guestfs_h *g,\n"
30014 " const char *device,\n"
30015 " const char *key,\n"
30017 " const char *cipher);\n"
30022 #: ../src/guestfs-actions.pod:4591
30024 "This command is the same as C<guestfs_luks_format> but it also allows you to "
30025 "set the C<cipher> used."
30029 #: ../src/guestfs-actions.pod:4602
30030 msgid "guestfs_luks_kill_slot"
30034 #: ../src/guestfs-actions.pod:4604
30038 " guestfs_luks_kill_slot (guestfs_h *g,\n"
30039 " const char *device,\n"
30040 " const char *key,\n"
30046 #: ../src/guestfs-actions.pod:4622
30047 msgid "guestfs_luks_open"
30051 #: ../src/guestfs-actions.pod:4624
30055 " guestfs_luks_open (guestfs_h *g,\n"
30056 " const char *device,\n"
30057 " const char *key,\n"
30058 " const char *mapname);\n"
30063 #: ../src/guestfs-actions.pod:4642
30065 "If this block device contains LVM volume groups, then calling "
30066 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
30071 #: ../src/guestfs-actions.pod:4646
30072 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
30076 #: ../src/guestfs-actions.pod:4657
30077 msgid "guestfs_luks_open_ro"
30081 #: ../src/guestfs-actions.pod:4659
30085 " guestfs_luks_open_ro (guestfs_h *g,\n"
30086 " const char *device,\n"
30087 " const char *key,\n"
30088 " const char *mapname);\n"
30093 #: ../src/guestfs-actions.pod:4665
30095 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
30100 #: ../src/guestfs-actions.pod:4676
30101 msgid "guestfs_lvcreate"
30105 #: ../src/guestfs-actions.pod:4678
30109 " guestfs_lvcreate (guestfs_h *g,\n"
30110 " const char *logvol,\n"
30111 " const char *volgroup,\n"
30117 #: ../src/guestfs-actions.pod:4691
30118 msgid "guestfs_lvm_canonical_lv_name"
30122 #: ../src/guestfs-actions.pod:4693
30126 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
30127 " const char *lvname);\n"
30132 #: ../src/guestfs-actions.pod:4704
30133 msgid "See also C<guestfs_is_lv>."
30137 #: ../src/guestfs-actions.pod:4709
30138 msgid "(Added in 1.5.24)"
30142 #: ../src/guestfs-actions.pod:4711
30143 msgid "guestfs_lvm_clear_filter"
30147 #: ../src/guestfs-actions.pod:4713
30151 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
30156 #: ../src/guestfs-actions.pod:4716
30158 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
30159 "see every block device."
30163 #: ../src/guestfs-actions.pod:4726
30164 msgid "guestfs_lvm_remove_all"
30168 #: ../src/guestfs-actions.pod:4728
30172 " guestfs_lvm_remove_all (guestfs_h *g);\n"
30177 #: ../src/guestfs-actions.pod:4738
30178 msgid "guestfs_lvm_set_filter"
30182 #: ../src/guestfs-actions.pod:4740
30186 " guestfs_lvm_set_filter (guestfs_h *g,\n"
30187 " char *const *devices);\n"
30192 #: ../src/guestfs-actions.pod:4771
30193 msgid "guestfs_lvremove"
30197 #: ../src/guestfs-actions.pod:4773
30201 " guestfs_lvremove (guestfs_h *g,\n"
30202 " const char *device);\n"
30207 #: ../src/guestfs-actions.pod:4785 ../src/guestfs-actions.pod:6344 ../src/guestfs-actions.pod:8304
30208 msgid "(Added in 1.0.13)"
30212 #: ../src/guestfs-actions.pod:4787
30213 msgid "guestfs_lvrename"
30217 #: ../src/guestfs-actions.pod:4789
30221 " guestfs_lvrename (guestfs_h *g,\n"
30222 " const char *logvol,\n"
30223 " const char *newlogvol);\n"
30228 #: ../src/guestfs-actions.pod:4798 ../src/guestfs-actions.pod:8317
30229 msgid "(Added in 1.0.83)"
30233 #: ../src/guestfs-actions.pod:4800
30234 msgid "guestfs_lvresize"
30238 #: ../src/guestfs-actions.pod:4802
30242 " guestfs_lvresize (guestfs_h *g,\n"
30243 " const char *device,\n"
30249 #: ../src/guestfs-actions.pod:4815
30250 msgid "guestfs_lvresize_free"
30254 #: ../src/guestfs-actions.pod:4817
30258 " guestfs_lvresize_free (guestfs_h *g,\n"
30259 " const char *lv,\n"
30265 #: ../src/guestfs-actions.pod:4830
30266 msgid "(Added in 1.3.3)"
30270 #: ../src/guestfs-actions.pod:4832
30271 msgid "guestfs_lvs"
30275 #: ../src/guestfs-actions.pod:4834
30279 " guestfs_lvs (guestfs_h *g);\n"
30284 #: ../src/guestfs-actions.pod:4843
30285 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
30289 #: ../src/guestfs-actions.pod:4851
30290 msgid "guestfs_lvs_full"
30294 #: ../src/guestfs-actions.pod:4853
30297 " struct guestfs_lvm_lv_list *\n"
30298 " guestfs_lvs_full (guestfs_h *g);\n"
30303 #: ../src/guestfs-actions.pod:4859
30305 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
30306 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
30311 #: ../src/guestfs-actions.pod:4865
30312 msgid "guestfs_lvuuid"
30316 #: ../src/guestfs-actions.pod:4867
30320 " guestfs_lvuuid (guestfs_h *g,\n"
30321 " const char *device);\n"
30326 #: ../src/guestfs-actions.pod:4878
30327 msgid "guestfs_lxattrlist"
30331 #: ../src/guestfs-actions.pod:4880
30334 " struct guestfs_xattr_list *\n"
30335 " guestfs_lxattrlist (guestfs_h *g,\n"
30336 " const char *path,\n"
30337 " char *const *names);\n"
30342 #: ../src/guestfs-actions.pod:4899
30344 "This call is intended for programs that want to efficiently list a directory "
30345 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
30346 "a similarly efficient call for getting standard stats. Very long directory "
30347 "listings might cause the protocol message size to be exceeded, causing this "
30348 "call to fail. The caller must split up such requests into smaller groups of "
30353 #: ../src/guestfs-actions.pod:4913
30354 msgid "guestfs_md_create"
30358 #: ../src/guestfs-actions.pod:4915
30362 " guestfs_md_create (guestfs_h *g,\n"
30363 " const char *name,\n"
30364 " char *const *devices,\n"
30370 #: ../src/guestfs-actions.pod:4926
30373 " GUESTFS_MD_CREATE_MISSINGBITMAP, int64_t missingbitmap,\n"
30374 " GUESTFS_MD_CREATE_NRDEVICES, int nrdevices,\n"
30375 " GUESTFS_MD_CREATE_SPARE, int spare,\n"
30376 " GUESTFS_MD_CREATE_CHUNK, int64_t chunk,\n"
30377 " GUESTFS_MD_CREATE_LEVEL, const char *level,\n"
30382 #: ../src/guestfs-actions.pod:4988
30383 msgid "guestfs_md_create_va"
30387 #: ../src/guestfs-actions.pod:4990
30391 " guestfs_md_create_va (guestfs_h *g,\n"
30392 " const char *name,\n"
30393 " char *const *devices,\n"
30394 " va_list args);\n"
30399 #: ../src/guestfs-actions.pod:4996
30400 msgid "This is the \"va_list variant\" of L</guestfs_md_create>."
30404 #: ../src/guestfs-actions.pod:5000
30405 msgid "guestfs_md_create_argv"
30409 #: ../src/guestfs-actions.pod:5002
30413 " guestfs_md_create_argv (guestfs_h *g,\n"
30414 " const char *name,\n"
30415 " char *const *devices,\n"
30416 " const struct guestfs_md_create_argv *optargs);\n"
30421 #: ../src/guestfs-actions.pod:5008
30422 msgid "This is the \"argv variant\" of L</guestfs_md_create>."
30426 #: ../src/guestfs-actions.pod:5012
30427 msgid "guestfs_md_detail"
30431 #: ../src/guestfs-actions.pod:5014
30435 " guestfs_md_detail (guestfs_h *g,\n"
30436 " const char *md);\n"
30441 #: ../src/guestfs-actions.pod:5051
30442 msgid "guestfs_md_stop"
30446 #: ../src/guestfs-actions.pod:5053
30450 " guestfs_md_stop (guestfs_h *g,\n"
30451 " const char *md);\n"
30456 #: ../src/guestfs-actions.pod:5062
30457 msgid "guestfs_mkdir"
30461 #: ../src/guestfs-actions.pod:5064
30465 " guestfs_mkdir (guestfs_h *g,\n"
30466 " const char *path);\n"
30471 #: ../src/guestfs-actions.pod:5074
30472 msgid "guestfs_mkdir_mode"
30476 #: ../src/guestfs-actions.pod:5076
30480 " guestfs_mkdir_mode (guestfs_h *g,\n"
30481 " const char *path,\n"
30487 #: ../src/guestfs-actions.pod:5088
30488 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
30492 #: ../src/guestfs-actions.pod:5094
30493 msgid "guestfs_mkdir_p"
30497 #: ../src/guestfs-actions.pod:5096
30501 " guestfs_mkdir_p (guestfs_h *g,\n"
30502 " const char *path);\n"
30507 #: ../src/guestfs-actions.pod:5107
30508 msgid "guestfs_mkdtemp"
30512 #: ../src/guestfs-actions.pod:5109
30516 " guestfs_mkdtemp (guestfs_h *g,\n"
30517 " const char *template);\n"
30522 #: ../src/guestfs-actions.pod:5137
30523 msgid "guestfs_mke2fs_J"
30527 #: ../src/guestfs-actions.pod:5139
30531 " guestfs_mke2fs_J (guestfs_h *g,\n"
30532 " const char *fstype,\n"
30533 " int blocksize,\n"
30534 " const char *device,\n"
30535 " const char *journal);\n"
30540 #: ../src/guestfs-actions.pod:5152
30541 msgid "See also C<guestfs_mke2journal>."
30545 #: ../src/guestfs-actions.pod:5156 ../src/guestfs-actions.pod:5174 ../src/guestfs-actions.pod:5192 ../src/guestfs-actions.pod:5208 ../src/guestfs-actions.pod:5222 ../src/guestfs-actions.pod:5236 ../src/guestfs-actions.pod:5295 ../src/guestfs-actions.pod:5572
30546 msgid "(Added in 1.0.68)"
30550 #: ../src/guestfs-actions.pod:5158
30551 msgid "guestfs_mke2fs_JL"
30555 #: ../src/guestfs-actions.pod:5160
30559 " guestfs_mke2fs_JL (guestfs_h *g,\n"
30560 " const char *fstype,\n"
30561 " int blocksize,\n"
30562 " const char *device,\n"
30563 " const char *label);\n"
30568 #: ../src/guestfs-actions.pod:5170
30569 msgid "See also C<guestfs_mke2journal_L>."
30573 #: ../src/guestfs-actions.pod:5176
30574 msgid "guestfs_mke2fs_JU"
30578 #: ../src/guestfs-actions.pod:5178
30582 " guestfs_mke2fs_JU (guestfs_h *g,\n"
30583 " const char *fstype,\n"
30584 " int blocksize,\n"
30585 " const char *device,\n"
30586 " const char *uuid);\n"
30591 #: ../src/guestfs-actions.pod:5188
30592 msgid "See also C<guestfs_mke2journal_U>."
30596 #: ../src/guestfs-actions.pod:5194
30597 msgid "guestfs_mke2journal"
30601 #: ../src/guestfs-actions.pod:5196
30605 " guestfs_mke2journal (guestfs_h *g,\n"
30606 " int blocksize,\n"
30607 " const char *device);\n"
30612 #: ../src/guestfs-actions.pod:5210
30613 msgid "guestfs_mke2journal_L"
30617 #: ../src/guestfs-actions.pod:5212
30621 " guestfs_mke2journal_L (guestfs_h *g,\n"
30622 " int blocksize,\n"
30623 " const char *label,\n"
30624 " const char *device);\n"
30629 #: ../src/guestfs-actions.pod:5224
30630 msgid "guestfs_mke2journal_U"
30634 #: ../src/guestfs-actions.pod:5226
30638 " guestfs_mke2journal_U (guestfs_h *g,\n"
30639 " int blocksize,\n"
30640 " const char *uuid,\n"
30641 " const char *device);\n"
30646 #: ../src/guestfs-actions.pod:5238
30647 msgid "guestfs_mkfifo"
30651 #: ../src/guestfs-actions.pod:5240
30655 " guestfs_mkfifo (guestfs_h *g,\n"
30657 " const char *path);\n"
30662 #: ../src/guestfs-actions.pod:5245
30664 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
30665 "is just a convenient wrapper around C<guestfs_mknod>."
30669 #: ../src/guestfs-actions.pod:5255
30670 msgid "guestfs_mkfs"
30674 #: ../src/guestfs-actions.pod:5257
30678 " guestfs_mkfs (guestfs_h *g,\n"
30679 " const char *fstype,\n"
30680 " const char *device);\n"
30685 #: ../src/guestfs-actions.pod:5270
30686 msgid "guestfs_mkfs_b"
30690 #: ../src/guestfs-actions.pod:5272
30694 " guestfs_mkfs_b (guestfs_h *g,\n"
30695 " const char *fstype,\n"
30696 " int blocksize,\n"
30697 " const char *device);\n"
30702 #: ../src/guestfs-actions.pod:5278
30704 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
30709 #: ../src/guestfs-actions.pod:5285
30711 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
30712 "block size of the resulting filesystem. Supported block sizes depend on the "
30713 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
30717 #: ../src/guestfs-actions.pod:5297
30718 msgid "guestfs_mkfs_opts"
30722 #: ../src/guestfs-actions.pod:5299
30726 " guestfs_mkfs_opts (guestfs_h *g,\n"
30727 " const char *fstype,\n"
30728 " const char *device,\n"
30734 #: ../src/guestfs-actions.pod:5310
30737 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
30738 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
30739 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
30740 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
30745 #: ../src/guestfs-actions.pod:5358
30746 msgid "(Added in 1.7.19)"
30750 #: ../src/guestfs-actions.pod:5360
30751 msgid "guestfs_mkfs_opts_va"
30755 #: ../src/guestfs-actions.pod:5362
30759 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
30760 " const char *fstype,\n"
30761 " const char *device,\n"
30762 " va_list args);\n"
30767 #: ../src/guestfs-actions.pod:5368
30768 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
30772 #: ../src/guestfs-actions.pod:5372
30773 msgid "guestfs_mkfs_opts_argv"
30777 #: ../src/guestfs-actions.pod:5374
30781 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
30782 " const char *fstype,\n"
30783 " const char *device,\n"
30784 " const struct guestfs_mkfs_opts_argv *optargs);\n"
30789 #: ../src/guestfs-actions.pod:5380
30790 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
30794 #: ../src/guestfs-actions.pod:5384
30795 msgid "guestfs_mkmountpoint"
30799 #: ../src/guestfs-actions.pod:5386
30803 " guestfs_mkmountpoint (guestfs_h *g,\n"
30804 " const char *exemptpath);\n"
30809 #: ../src/guestfs-actions.pod:5390
30811 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
30812 "that can be used to create extra mountpoints before mounting the first "
30817 #: ../src/guestfs-actions.pod:5414
30819 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
30820 "may get unexpected errors if you try to mix these calls. It is safest to "
30821 "manually unmount filesystems and remove mountpoints after use."
30825 #: ../src/guestfs-actions.pod:5418
30827 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
30828 "first, so for this to work for manual mountpoints, you must ensure that the "
30829 "innermost mountpoints have the longest pathnames, as in the example code "
30834 #: ../src/guestfs-actions.pod:5425
30836 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
30837 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
30838 "can also trigger these issues."
30842 #: ../src/guestfs-actions.pod:5431 ../src/guestfs-actions.pod:5737 ../src/guestfs-actions.pod:6764
30843 msgid "(Added in 1.0.62)"
30847 #: ../src/guestfs-actions.pod:5433
30848 msgid "guestfs_mknod"
30852 #: ../src/guestfs-actions.pod:5435
30856 " guestfs_mknod (guestfs_h *g,\n"
30860 " const char *path);\n"
30865 #: ../src/guestfs-actions.pod:5450
30867 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
30868 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
30869 "regular file). These constants are available in the standard Linux header "
30870 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
30871 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
30872 "the appropriate constant for you."
30876 #: ../src/guestfs-actions.pod:5464
30877 msgid "guestfs_mknod_b"
30881 #: ../src/guestfs-actions.pod:5466
30885 " guestfs_mknod_b (guestfs_h *g,\n"
30889 " const char *path);\n"
30894 #: ../src/guestfs-actions.pod:5473
30896 "This call creates a block device node called C<path> with mode C<mode> and "
30897 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
30898 "wrapper around C<guestfs_mknod>."
30902 #: ../src/guestfs-actions.pod:5483
30903 msgid "guestfs_mknod_c"
30907 #: ../src/guestfs-actions.pod:5485
30911 " guestfs_mknod_c (guestfs_h *g,\n"
30915 " const char *path);\n"
30920 #: ../src/guestfs-actions.pod:5492
30922 "This call creates a char device node called C<path> with mode C<mode> and "
30923 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
30924 "wrapper around C<guestfs_mknod>."
30928 #: ../src/guestfs-actions.pod:5502
30929 msgid "guestfs_mkswap"
30933 #: ../src/guestfs-actions.pod:5504
30937 " guestfs_mkswap (guestfs_h *g,\n"
30938 " const char *device);\n"
30943 #: ../src/guestfs-actions.pod:5514
30944 msgid "guestfs_mkswap_L"
30948 #: ../src/guestfs-actions.pod:5516
30952 " guestfs_mkswap_L (guestfs_h *g,\n"
30953 " const char *label,\n"
30954 " const char *device);\n"
30959 #: ../src/guestfs-actions.pod:5531
30960 msgid "guestfs_mkswap_U"
30964 #: ../src/guestfs-actions.pod:5533
30968 " guestfs_mkswap_U (guestfs_h *g,\n"
30969 " const char *uuid,\n"
30970 " const char *device);\n"
30975 #: ../src/guestfs-actions.pod:5544
30976 msgid "guestfs_mkswap_file"
30980 #: ../src/guestfs-actions.pod:5546
30984 " guestfs_mkswap_file (guestfs_h *g,\n"
30985 " const char *path);\n"
30990 #: ../src/guestfs-actions.pod:5552
30992 "This command just writes a swap file signature to an existing file. To "
30993 "create the file itself, use something like C<guestfs_fallocate>."
30997 #: ../src/guestfs-actions.pod:5559
30998 msgid "guestfs_modprobe"
31002 #: ../src/guestfs-actions.pod:5561
31006 " guestfs_modprobe (guestfs_h *g,\n"
31007 " const char *modulename);\n"
31012 #: ../src/guestfs-actions.pod:5574
31013 msgid "guestfs_mount"
31017 #: ../src/guestfs-actions.pod:5576
31021 " guestfs_mount (guestfs_h *g,\n"
31022 " const char *device,\n"
31023 " const char *mountpoint);\n"
31028 #: ../src/guestfs-actions.pod:5595
31030 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
31031 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
31032 "problems for users. If your program might need to work with older versions "
31033 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
31034 "for the first parameter if you don't want any options)."
31038 #: ../src/guestfs-actions.pod:5606
31039 msgid "guestfs_mount_9p"
31043 #: ../src/guestfs-actions.pod:5608
31047 " guestfs_mount_9p (guestfs_h *g,\n"
31048 " const char *mounttag,\n"
31049 " const char *mountpoint,\n"
31055 #: ../src/guestfs-actions.pod:5619
31058 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
31063 #: ../src/guestfs-actions.pod:5632
31064 msgid "guestfs_mount_9p_va"
31068 #: ../src/guestfs-actions.pod:5634
31072 " guestfs_mount_9p_va (guestfs_h *g,\n"
31073 " const char *mounttag,\n"
31074 " const char *mountpoint,\n"
31075 " va_list args);\n"
31080 #: ../src/guestfs-actions.pod:5640
31081 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
31085 #: ../src/guestfs-actions.pod:5644
31086 msgid "guestfs_mount_9p_argv"
31090 #: ../src/guestfs-actions.pod:5646
31094 " guestfs_mount_9p_argv (guestfs_h *g,\n"
31095 " const char *mounttag,\n"
31096 " const char *mountpoint,\n"
31097 " const struct guestfs_mount_9p_argv *optargs);\n"
31102 #: ../src/guestfs-actions.pod:5652
31103 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
31107 #: ../src/guestfs-actions.pod:5656
31108 msgid "guestfs_mount_loop"
31112 #: ../src/guestfs-actions.pod:5658
31116 " guestfs_mount_loop (guestfs_h *g,\n"
31117 " const char *file,\n"
31118 " const char *mountpoint);\n"
31123 #: ../src/guestfs-actions.pod:5671
31124 msgid "guestfs_mount_options"
31128 #: ../src/guestfs-actions.pod:5673
31132 " guestfs_mount_options (guestfs_h *g,\n"
31133 " const char *options,\n"
31134 " const char *device,\n"
31135 " const char *mountpoint);\n"
31140 #: ../src/guestfs-actions.pod:5679
31142 "This is the same as the C<guestfs_mount> command, but it allows you to set "
31143 "the mount options as for the L<mount(8)> I<-o> flag."
31147 #: ../src/guestfs-actions.pod:5689 ../src/guestfs-actions.pod:5703 ../src/guestfs-actions.pod:5720
31148 msgid "(Added in 1.0.10)"
31152 #: ../src/guestfs-actions.pod:5691
31153 msgid "guestfs_mount_ro"
31157 #: ../src/guestfs-actions.pod:5693
31161 " guestfs_mount_ro (guestfs_h *g,\n"
31162 " const char *device,\n"
31163 " const char *mountpoint);\n"
31168 #: ../src/guestfs-actions.pod:5698
31170 "This is the same as the C<guestfs_mount> command, but it mounts the "
31171 "filesystem with the read-only (I<-o ro>) flag."
31175 #: ../src/guestfs-actions.pod:5705
31176 msgid "guestfs_mount_vfs"
31180 #: ../src/guestfs-actions.pod:5707
31184 " guestfs_mount_vfs (guestfs_h *g,\n"
31185 " const char *options,\n"
31186 " const char *vfstype,\n"
31187 " const char *device,\n"
31188 " const char *mountpoint);\n"
31193 #: ../src/guestfs-actions.pod:5714
31195 "This is the same as the C<guestfs_mount> command, but it allows you to set "
31196 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
31201 #: ../src/guestfs-actions.pod:5722
31202 msgid "guestfs_mountpoints"
31206 #: ../src/guestfs-actions.pod:5724
31210 " guestfs_mountpoints (guestfs_h *g);\n"
31215 #: ../src/guestfs-actions.pod:5727
31217 "This call is similar to C<guestfs_mounts>. That call returns a list of "
31218 "devices. This one returns a hash table (map) of device name to directory "
31219 "where the device is mounted."
31223 #: ../src/guestfs-actions.pod:5739
31224 msgid "guestfs_mounts"
31228 #: ../src/guestfs-actions.pod:5741
31232 " guestfs_mounts (guestfs_h *g);\n"
31237 #: ../src/guestfs-actions.pod:5749
31238 msgid "See also: C<guestfs_mountpoints>"
31242 #: ../src/guestfs-actions.pod:5757
31247 #: ../src/guestfs-actions.pod:5759
31251 " guestfs_mv (guestfs_h *g,\n"
31252 " const char *src,\n"
31253 " const char *dest);\n"
31258 #: ../src/guestfs-actions.pod:5771
31259 msgid "guestfs_ntfs_3g_probe"
31263 #: ../src/guestfs-actions.pod:5773
31267 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
31269 " const char *device);\n"
31274 #: ../src/guestfs-actions.pod:5792
31275 msgid "(Added in 1.0.43)"
31279 #: ../src/guestfs-actions.pod:5794
31280 msgid "guestfs_ntfsresize"
31284 #: ../src/guestfs-actions.pod:5796
31288 " guestfs_ntfsresize (guestfs_h *g,\n"
31289 " const char *device);\n"
31294 #: ../src/guestfs-actions.pod:5800 ../src/guestfs-actions.pod:5900
31296 "I<This function is deprecated.> In new code, use the "
31297 "L</guestfs_ntfsresize_opts> call instead."
31301 #: ../src/guestfs-actions.pod:5824
31302 msgid "guestfs_ntfsresize_opts"
31306 #: ../src/guestfs-actions.pod:5826
31310 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
31311 " const char *device,\n"
31317 #: ../src/guestfs-actions.pod:5836
31320 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
31321 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
31326 #: ../src/guestfs-actions.pod:5856
31328 "After the resize operation, the filesystem is always marked as requiring a "
31329 "consistency check (for safety). You have to boot into Windows to perform "
31330 "this check and clear this condition. If you I<don't> set the C<force> "
31331 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
31332 "times on a single filesystem without booting into Windows between each "
31337 #: ../src/guestfs-actions.pod:5871
31338 msgid "guestfs_ntfsresize_opts_va"
31342 #: ../src/guestfs-actions.pod:5873
31346 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
31347 " const char *device,\n"
31348 " va_list args);\n"
31353 #: ../src/guestfs-actions.pod:5878
31354 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
31358 #: ../src/guestfs-actions.pod:5882
31359 msgid "guestfs_ntfsresize_opts_argv"
31363 #: ../src/guestfs-actions.pod:5884
31367 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
31368 " const char *device,\n"
31369 " const struct guestfs_ntfsresize_opts_argv "
31375 #: ../src/guestfs-actions.pod:5889
31376 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
31380 #: ../src/guestfs-actions.pod:5893
31381 msgid "guestfs_ntfsresize_size"
31385 #: ../src/guestfs-actions.pod:5895
31389 " guestfs_ntfsresize_size (guestfs_h *g,\n"
31390 " const char *device,\n"
31391 " int64_t size);\n"
31396 #: ../src/guestfs-actions.pod:5907
31398 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
31399 "to specify the new size (in bytes) explicitly."
31403 #: ../src/guestfs-actions.pod:5912 ../src/guestfs-actions.pod:6371 ../src/guestfs-actions.pod:6444 ../src/guestfs-actions.pod:6712 ../src/guestfs-actions.pod:8461
31404 msgid "(Added in 1.3.14)"
31408 #: ../src/guestfs-actions.pod:5914
31409 msgid "guestfs_part_add"
31413 #: ../src/guestfs-actions.pod:5916
31417 " guestfs_part_add (guestfs_h *g,\n"
31418 " const char *device,\n"
31419 " const char *prlogex,\n"
31420 " int64_t startsect,\n"
31421 " int64_t endsect);\n"
31426 #: ../src/guestfs-actions.pod:5923
31428 "This command adds a partition to C<device>. If there is no partition table "
31429 "on the device, call C<guestfs_part_init> first."
31433 #: ../src/guestfs-actions.pod:5935
31435 "Creating a partition which covers the whole disk is not so easy. Use "
31436 "C<guestfs_part_disk> to do that."
31440 #: ../src/guestfs-actions.pod:5940 ../src/guestfs-actions.pod:5975 ../src/guestfs-actions.pod:6028 ../src/guestfs-actions.pod:6112 ../src/guestfs-actions.pod:6150 ../src/guestfs-actions.pod:6169 ../src/guestfs-actions.pod:6209
31441 msgid "(Added in 1.0.78)"
31445 #: ../src/guestfs-actions.pod:5942
31446 msgid "guestfs_part_del"
31450 #: ../src/guestfs-actions.pod:5944
31454 " guestfs_part_del (guestfs_h *g,\n"
31455 " const char *device,\n"
31461 #: ../src/guestfs-actions.pod:5959
31462 msgid "guestfs_part_disk"
31466 #: ../src/guestfs-actions.pod:5961
31470 " guestfs_part_disk (guestfs_h *g,\n"
31471 " const char *device,\n"
31472 " const char *parttype);\n"
31477 #: ../src/guestfs-actions.pod:5966
31479 "This command is simply a combination of C<guestfs_part_init> followed by "
31480 "C<guestfs_part_add> to create a single primary partition covering the whole "
31485 #: ../src/guestfs-actions.pod:5970
31487 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
31488 "possible values are described in C<guestfs_part_init>."
31492 #: ../src/guestfs-actions.pod:5977
31493 msgid "guestfs_part_get_bootable"
31497 #: ../src/guestfs-actions.pod:5979
31501 " guestfs_part_get_bootable (guestfs_h *g,\n"
31502 " const char *device,\n"
31508 #: ../src/guestfs-actions.pod:5987
31509 msgid "See also C<guestfs_part_set_bootable>."
31513 #: ../src/guestfs-actions.pod:5993
31514 msgid "guestfs_part_get_mbr_id"
31518 #: ../src/guestfs-actions.pod:5995
31522 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
31523 " const char *device,\n"
31529 #: ../src/guestfs-actions.pod:6003 ../src/guestfs-actions.pod:6185
31531 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
31532 "undefined results for other partition table types (see "
31533 "C<guestfs_part_get_parttype>)."
31537 #: ../src/guestfs-actions.pod:6011
31538 msgid "guestfs_part_get_parttype"
31542 #: ../src/guestfs-actions.pod:6013
31546 " guestfs_part_get_parttype (guestfs_h *g,\n"
31547 " const char *device);\n"
31552 #: ../src/guestfs-actions.pod:6020
31554 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
31555 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
31556 "possible, although unusual. See C<guestfs_part_init> for a full list."
31560 #: ../src/guestfs-actions.pod:6030
31561 msgid "guestfs_part_init"
31565 #: ../src/guestfs-actions.pod:6032
31569 " guestfs_part_init (guestfs_h *g,\n"
31570 " const char *device,\n"
31571 " const char *parttype);\n"
31576 #: ../src/guestfs-actions.pod:6041
31578 "Initially there are no partitions. Following this, you should call "
31579 "C<guestfs_part_add> for each partition required."
31583 #: ../src/guestfs-actions.pod:6114
31584 msgid "guestfs_part_list"
31588 #: ../src/guestfs-actions.pod:6116
31591 " struct guestfs_partition_list *\n"
31592 " guestfs_part_list (guestfs_h *g,\n"
31593 " const char *device);\n"
31598 #: ../src/guestfs-actions.pod:6133
31600 "Start of the partition I<in bytes>. To get sectors you have to divide by "
31601 "the device's sector size, see C<guestfs_blockdev_getss>."
31605 #: ../src/guestfs-actions.pod:6146
31607 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
31608 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
31613 #: ../src/guestfs-actions.pod:6152
31614 msgid "guestfs_part_set_bootable"
31618 #: ../src/guestfs-actions.pod:6154
31622 " guestfs_part_set_bootable (guestfs_h *g,\n"
31623 " const char *device,\n"
31625 " int bootable);\n"
31630 #: ../src/guestfs-actions.pod:6171
31631 msgid "guestfs_part_set_mbr_id"
31635 #: ../src/guestfs-actions.pod:6173
31639 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
31640 " const char *device,\n"
31647 #: ../src/guestfs-actions.pod:6193
31648 msgid "guestfs_part_set_name"
31652 #: ../src/guestfs-actions.pod:6195
31656 " guestfs_part_set_name (guestfs_h *g,\n"
31657 " const char *device,\n"
31659 " const char *name);\n"
31664 #: ../src/guestfs-actions.pod:6211
31665 msgid "guestfs_part_to_dev"
31669 #: ../src/guestfs-actions.pod:6213
31673 " guestfs_part_to_dev (guestfs_h *g,\n"
31674 " const char *partition);\n"
31679 #: ../src/guestfs-actions.pod:6221 ../src/guestfs-actions.pod:6240
31681 "The named partition must exist, for example as a string returned from "
31682 "C<guestfs_list_partitions>."
31686 #: ../src/guestfs-actions.pod:6224
31687 msgid "See also C<guestfs_part_to_partnum>."
31691 #: ../src/guestfs-actions.pod:6231
31692 msgid "guestfs_part_to_partnum"
31696 #: ../src/guestfs-actions.pod:6233
31700 " guestfs_part_to_partnum (guestfs_h *g,\n"
31701 " const char *partition);\n"
31706 #: ../src/guestfs-actions.pod:6243
31707 msgid "See also C<guestfs_part_to_dev>."
31711 #: ../src/guestfs-actions.pod:6249
31712 msgid "guestfs_ping_daemon"
31716 #: ../src/guestfs-actions.pod:6251
31720 " guestfs_ping_daemon (guestfs_h *g);\n"
31725 #: ../src/guestfs-actions.pod:6263
31726 msgid "guestfs_pread"
31730 #: ../src/guestfs-actions.pod:6265
31734 " guestfs_pread (guestfs_h *g,\n"
31735 " const char *path,\n"
31737 " int64_t offset,\n"
31738 " size_t *size_r);\n"
31743 #: ../src/guestfs-actions.pod:6278
31744 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
31748 #: ../src/guestfs-actions.pod:6289
31749 msgid "guestfs_pread_device"
31753 #: ../src/guestfs-actions.pod:6291
31757 " guestfs_pread_device (guestfs_h *g,\n"
31758 " const char *device,\n"
31760 " int64_t offset,\n"
31761 " size_t *size_r);\n"
31766 #: ../src/guestfs-actions.pod:6304
31767 msgid "See also C<guestfs_pread>."
31771 #: ../src/guestfs-actions.pod:6313
31772 msgid "(Added in 1.5.21)"
31776 #: ../src/guestfs-actions.pod:6315
31777 msgid "guestfs_pvcreate"
31781 #: ../src/guestfs-actions.pod:6317
31785 " guestfs_pvcreate (guestfs_h *g,\n"
31786 " const char *device);\n"
31791 #: ../src/guestfs-actions.pod:6329
31792 msgid "guestfs_pvremove"
31796 #: ../src/guestfs-actions.pod:6331
31800 " guestfs_pvremove (guestfs_h *g,\n"
31801 " const char *device);\n"
31806 #: ../src/guestfs-actions.pod:6346
31807 msgid "guestfs_pvresize"
31811 #: ../src/guestfs-actions.pod:6348
31815 " guestfs_pvresize (guestfs_h *g,\n"
31816 " const char *device);\n"
31821 #: ../src/guestfs-actions.pod:6359
31822 msgid "guestfs_pvresize_size"
31826 #: ../src/guestfs-actions.pod:6361
31830 " guestfs_pvresize_size (guestfs_h *g,\n"
31831 " const char *device,\n"
31832 " int64_t size);\n"
31837 #: ../src/guestfs-actions.pod:6366
31839 "This command is the same as C<guestfs_pvresize> except that it allows you to "
31840 "specify the new size (in bytes) explicitly."
31844 #: ../src/guestfs-actions.pod:6373
31845 msgid "guestfs_pvs"
31849 #: ../src/guestfs-actions.pod:6375
31853 " guestfs_pvs (guestfs_h *g);\n"
31858 #: ../src/guestfs-actions.pod:6384
31859 msgid "See also C<guestfs_pvs_full>."
31863 #: ../src/guestfs-actions.pod:6392
31864 msgid "guestfs_pvs_full"
31868 #: ../src/guestfs-actions.pod:6394
31871 " struct guestfs_lvm_pv_list *\n"
31872 " guestfs_pvs_full (guestfs_h *g);\n"
31877 #: ../src/guestfs-actions.pod:6400
31879 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
31880 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
31885 #: ../src/guestfs-actions.pod:6406
31886 msgid "guestfs_pvuuid"
31890 #: ../src/guestfs-actions.pod:6408
31894 " guestfs_pvuuid (guestfs_h *g,\n"
31895 " const char *device);\n"
31900 #: ../src/guestfs-actions.pod:6419
31901 msgid "guestfs_pwrite"
31905 #: ../src/guestfs-actions.pod:6421
31909 " guestfs_pwrite (guestfs_h *g,\n"
31910 " const char *path,\n"
31911 " const char *content,\n"
31912 " size_t content_size,\n"
31913 " int64_t offset);\n"
31918 #: ../src/guestfs-actions.pod:6437
31919 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
31923 #: ../src/guestfs-actions.pod:6446
31924 msgid "guestfs_pwrite_device"
31928 #: ../src/guestfs-actions.pod:6448
31932 " guestfs_pwrite_device (guestfs_h *g,\n"
31933 " const char *device,\n"
31934 " const char *content,\n"
31935 " size_t content_size,\n"
31936 " int64_t offset);\n"
31941 #: ../src/guestfs-actions.pod:6463
31942 msgid "See also C<guestfs_pwrite>."
31946 #: ../src/guestfs-actions.pod:6470
31947 msgid "(Added in 1.5.20)"
31951 #: ../src/guestfs-actions.pod:6472
31952 msgid "guestfs_read_file"
31956 #: ../src/guestfs-actions.pod:6474
31960 " guestfs_read_file (guestfs_h *g,\n"
31961 " const char *path,\n"
31962 " size_t *size_r);\n"
31967 #: ../src/guestfs-actions.pod:6482
31969 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
31970 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
31971 "function is limited in the total size of file that can be handled."
31975 #: ../src/guestfs-actions.pod:6494
31976 msgid "(Added in 1.0.63)"
31980 #: ../src/guestfs-actions.pod:6496
31981 msgid "guestfs_read_lines"
31985 #: ../src/guestfs-actions.pod:6498
31989 " guestfs_read_lines (guestfs_h *g,\n"
31990 " const char *path);\n"
31995 #: ../src/guestfs-actions.pod:6507
31997 "Note that this function cannot correctly handle binary files (specifically, "
31998 "files containing C<\\0> character which is treated as end of line). For "
31999 "those you need to use the C<guestfs_read_file> function which has a more "
32000 "complex interface."
32004 #: ../src/guestfs-actions.pod:6518
32005 msgid "guestfs_readdir"
32009 #: ../src/guestfs-actions.pod:6520
32012 " struct guestfs_dirent_list *\n"
32013 " guestfs_readdir (guestfs_h *g,\n"
32014 " const char *dir);\n"
32019 #: ../src/guestfs-actions.pod:6574
32021 "This function is primarily intended for use by programs. To get a simple "
32022 "list of names, use C<guestfs_ls>. To get a printable directory for human "
32023 "consumption, use C<guestfs_ll>."
32027 #: ../src/guestfs-actions.pod:6578
32029 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
32030 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
32035 #: ../src/guestfs-actions.pod:6584
32036 msgid "guestfs_readlink"
32040 #: ../src/guestfs-actions.pod:6586
32044 " guestfs_readlink (guestfs_h *g,\n"
32045 " const char *path);\n"
32050 #: ../src/guestfs-actions.pod:6597
32051 msgid "guestfs_readlinklist"
32055 #: ../src/guestfs-actions.pod:6599
32059 " guestfs_readlinklist (guestfs_h *g,\n"
32060 " const char *path,\n"
32061 " char *const *names);\n"
32066 #: ../src/guestfs-actions.pod:6632
32067 msgid "guestfs_realpath"
32071 #: ../src/guestfs-actions.pod:6634
32075 " guestfs_realpath (guestfs_h *g,\n"
32076 " const char *path);\n"
32081 #: ../src/guestfs-actions.pod:6646
32082 msgid "guestfs_removexattr"
32086 #: ../src/guestfs-actions.pod:6648
32090 " guestfs_removexattr (guestfs_h *g,\n"
32091 " const char *xattr,\n"
32092 " const char *path);\n"
32097 #: ../src/guestfs-actions.pod:6656
32098 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
32102 #: ../src/guestfs-actions.pod:6662
32103 msgid "guestfs_resize2fs"
32107 #: ../src/guestfs-actions.pod:6664
32111 " guestfs_resize2fs (guestfs_h *g,\n"
32112 " const char *device);\n"
32117 #: ../src/guestfs-actions.pod:6671
32119 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
32120 "C<device> before calling this command. For unknown reasons C<resize2fs> "
32121 "sometimes gives an error about this and sometimes not. In any case, it is "
32122 "always safe to call C<guestfs_e2fsck_f> before calling this function."
32126 #: ../src/guestfs-actions.pod:6681
32127 msgid "guestfs_resize2fs_M"
32131 #: ../src/guestfs-actions.pod:6683
32135 " guestfs_resize2fs_M (guestfs_h *g,\n"
32136 " const char *device);\n"
32141 #: ../src/guestfs-actions.pod:6687
32143 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
32144 "resized to its minimum size. This works like the I<-M> option to the "
32145 "C<resize2fs> command."
32149 #: ../src/guestfs-actions.pod:6691
32151 "To get the resulting size of the filesystem you should call "
32152 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
32153 "These two numbers, multiplied together, give the resulting size of the "
32154 "minimal filesystem in bytes."
32158 #: ../src/guestfs-actions.pod:6700
32159 msgid "guestfs_resize2fs_size"
32163 #: ../src/guestfs-actions.pod:6702
32167 " guestfs_resize2fs_size (guestfs_h *g,\n"
32168 " const char *device,\n"
32169 " int64_t size);\n"
32174 #: ../src/guestfs-actions.pod:6707
32176 "This command is the same as C<guestfs_resize2fs> except that it allows you "
32177 "to specify the new size (in bytes) explicitly."
32181 #: ../src/guestfs-actions.pod:6714
32186 #: ../src/guestfs-actions.pod:6716
32190 " guestfs_rm (guestfs_h *g,\n"
32191 " const char *path);\n"
32196 #: ../src/guestfs-actions.pod:6726
32197 msgid "guestfs_rm_rf"
32201 #: ../src/guestfs-actions.pod:6728
32205 " guestfs_rm_rf (guestfs_h *g,\n"
32206 " const char *path);\n"
32211 #: ../src/guestfs-actions.pod:6740
32212 msgid "guestfs_rmdir"
32216 #: ../src/guestfs-actions.pod:6742
32220 " guestfs_rmdir (guestfs_h *g,\n"
32221 " const char *path);\n"
32226 #: ../src/guestfs-actions.pod:6752
32227 msgid "guestfs_rmmountpoint"
32231 #: ../src/guestfs-actions.pod:6754
32235 " guestfs_rmmountpoint (guestfs_h *g,\n"
32236 " const char *exemptpath);\n"
32241 #: ../src/guestfs-actions.pod:6758
32243 "This calls removes a mountpoint that was previously created with "
32244 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
32248 #: ../src/guestfs-actions.pod:6766
32249 msgid "guestfs_scrub_device"
32253 #: ../src/guestfs-actions.pod:6768
32257 " guestfs_scrub_device (guestfs_h *g,\n"
32258 " const char *device);\n"
32263 #: ../src/guestfs-actions.pod:6780 ../src/guestfs-actions.pod:6798 ../src/guestfs-actions.pod:6817
32264 msgid "(Added in 1.0.52)"
32268 #: ../src/guestfs-actions.pod:6782
32269 msgid "guestfs_scrub_file"
32273 #: ../src/guestfs-actions.pod:6784
32277 " guestfs_scrub_file (guestfs_h *g,\n"
32278 " const char *file);\n"
32283 #: ../src/guestfs-actions.pod:6800
32284 msgid "guestfs_scrub_freespace"
32288 #: ../src/guestfs-actions.pod:6802
32292 " guestfs_scrub_freespace (guestfs_h *g,\n"
32293 " const char *dir);\n"
32298 #: ../src/guestfs-actions.pod:6806
32300 "This command creates the directory C<dir> and then fills it with files until "
32301 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
32302 "and deletes them. The intention is to scrub any free space on the partition "
32303 "containing C<dir>."
32307 #: ../src/guestfs-actions.pod:6819
32308 msgid "guestfs_set_append"
32312 #: ../src/guestfs-actions.pod:6821
32316 " guestfs_set_append (guestfs_h *g,\n"
32317 " const char *append);\n"
32322 #: ../src/guestfs-actions.pod:6838
32323 msgid "guestfs_set_attach_method"
32327 #: ../src/guestfs-actions.pod:6840
32331 " guestfs_set_attach_method (guestfs_h *g,\n"
32332 " const char *attachmethod);\n"
32337 #: ../src/guestfs-actions.pod:6868
32338 msgid "guestfs_set_autosync"
32342 #: ../src/guestfs-actions.pod:6870
32346 " guestfs_set_autosync (guestfs_h *g,\n"
32347 " int autosync);\n"
32352 #: ../src/guestfs-actions.pod:6886
32353 msgid "guestfs_set_direct"
32357 #: ../src/guestfs-actions.pod:6888
32361 " guestfs_set_direct (guestfs_h *g,\n"
32367 #: ../src/guestfs-actions.pod:6896
32369 "One consequence of this is that log messages aren't caught by the library "
32370 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
32375 #: ../src/guestfs-actions.pod:6909
32376 msgid "guestfs_set_e2label"
32380 #: ../src/guestfs-actions.pod:6911
32384 " guestfs_set_e2label (guestfs_h *g,\n"
32385 " const char *device,\n"
32386 " const char *label);\n"
32391 #: ../src/guestfs-actions.pod:6920
32393 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
32394 "the existing label on a filesystem."
32398 #: ../src/guestfs-actions.pod:6927
32399 msgid "guestfs_set_e2uuid"
32403 #: ../src/guestfs-actions.pod:6929
32407 " guestfs_set_e2uuid (guestfs_h *g,\n"
32408 " const char *device,\n"
32409 " const char *uuid);\n"
32414 #: ../src/guestfs-actions.pod:6939
32416 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
32417 "the existing UUID of a filesystem."
32421 #: ../src/guestfs-actions.pod:6946
32422 msgid "guestfs_set_memsize"
32426 #: ../src/guestfs-actions.pod:6948
32430 " guestfs_set_memsize (guestfs_h *g,\n"
32436 #: ../src/guestfs-actions.pod:6952
32438 "This sets the memory size in megabytes allocated to the qemu subprocess. "
32439 "This only has any effect if called before C<guestfs_launch>."
32443 #: ../src/guestfs-actions.pod:6967
32444 msgid "guestfs_set_network"
32448 #: ../src/guestfs-actions.pod:6969
32452 " guestfs_set_network (guestfs_h *g,\n"
32458 #: ../src/guestfs-actions.pod:6979
32460 "You must call this before calling C<guestfs_launch>, otherwise it has no "
32465 #: ../src/guestfs-actions.pod:6986
32466 msgid "guestfs_set_path"
32470 #: ../src/guestfs-actions.pod:6988
32474 " guestfs_set_path (guestfs_h *g,\n"
32475 " const char *searchpath);\n"
32480 #: ../src/guestfs-actions.pod:7003
32481 msgid "guestfs_set_pgroup"
32485 #: ../src/guestfs-actions.pod:7005
32489 " guestfs_set_pgroup (guestfs_h *g,\n"
32495 #: ../src/guestfs-actions.pod:7022
32496 msgid "guestfs_set_qemu"
32500 #: ../src/guestfs-actions.pod:7024
32504 " guestfs_set_qemu (guestfs_h *g,\n"
32505 " const char *qemu);\n"
32510 #: ../src/guestfs-actions.pod:7050
32511 msgid "guestfs_set_recovery_proc"
32515 #: ../src/guestfs-actions.pod:7052
32519 " guestfs_set_recovery_proc (guestfs_h *g,\n"
32520 " int recoveryproc);\n"
32525 #: ../src/guestfs-actions.pod:7056
32527 "If this is called with the parameter C<false> then C<guestfs_launch> does "
32528 "not create a recovery process. The purpose of the recovery process is to "
32529 "stop runaway qemu processes in the case where the main program aborts "
32534 #: ../src/guestfs-actions.pod:7061
32536 "This only has any effect if called before C<guestfs_launch>, and the default "
32541 #: ../src/guestfs-actions.pod:7074
32542 msgid "guestfs_set_selinux"
32546 #: ../src/guestfs-actions.pod:7076
32550 " guestfs_set_selinux (guestfs_h *g,\n"
32556 #: ../src/guestfs-actions.pod:7093
32557 msgid "guestfs_set_smp"
32561 #: ../src/guestfs-actions.pod:7095
32565 " guestfs_set_smp (guestfs_h *g,\n"
32571 #: ../src/guestfs-actions.pod:7103
32572 msgid "This function must be called before C<guestfs_launch>."
32576 #: ../src/guestfs-actions.pod:7109
32577 msgid "guestfs_set_trace"
32581 #: ../src/guestfs-actions.pod:7111
32585 " guestfs_set_trace (guestfs_h *g,\n"
32591 #: ../src/guestfs-actions.pod:7125
32593 "Trace messages are normally sent to C<stderr>, unless you register a "
32594 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
32598 #: ../src/guestfs-actions.pod:7133
32599 msgid "guestfs_set_verbose"
32603 #: ../src/guestfs-actions.pod:7135
32607 " guestfs_set_verbose (guestfs_h *g,\n"
32613 #: ../src/guestfs-actions.pod:7144
32615 "Verbose messages are normally sent to C<stderr>, unless you register a "
32616 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
32620 #: ../src/guestfs-actions.pod:7152
32621 msgid "guestfs_setcon"
32625 #: ../src/guestfs-actions.pod:7154
32629 " guestfs_setcon (guestfs_h *g,\n"
32630 " const char *context);\n"
32635 #: ../src/guestfs-actions.pod:7167
32636 msgid "guestfs_setxattr"
32640 #: ../src/guestfs-actions.pod:7169
32644 " guestfs_setxattr (guestfs_h *g,\n"
32645 " const char *xattr,\n"
32646 " const char *val,\n"
32648 " const char *path);\n"
32653 #: ../src/guestfs-actions.pod:7180
32654 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
32658 #: ../src/guestfs-actions.pod:7186
32659 msgid "guestfs_sfdisk"
32663 #: ../src/guestfs-actions.pod:7188
32667 " guestfs_sfdisk (guestfs_h *g,\n"
32668 " const char *device,\n"
32672 " char *const *lines);\n"
32677 #: ../src/guestfs-actions.pod:7196 ../src/guestfs-actions.pod:7237 ../src/guestfs-actions.pod:7268
32679 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
32684 #: ../src/guestfs-actions.pod:7223
32685 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
32689 #: ../src/guestfs-actions.pod:7230
32690 msgid "guestfs_sfdiskM"
32694 #: ../src/guestfs-actions.pod:7232
32698 " guestfs_sfdiskM (guestfs_h *g,\n"
32699 " const char *device,\n"
32700 " char *const *lines);\n"
32705 #: ../src/guestfs-actions.pod:7244
32707 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
32708 "partition sizes are specified in megabytes only (rounded to the nearest "
32709 "cylinder) and you don't need to specify the cyls, heads and sectors "
32710 "parameters which were rarely if ever used anyway."
32714 #: ../src/guestfs-actions.pod:7250
32716 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
32717 "C<guestfs_part_disk>"
32721 #: ../src/guestfs-actions.pod:7257
32722 msgid "guestfs_sfdisk_N"
32726 #: ../src/guestfs-actions.pod:7259
32730 " guestfs_sfdisk_N (guestfs_h *g,\n"
32731 " const char *device,\n"
32736 " const char *line);\n"
32741 #: ../src/guestfs-actions.pod:7278
32743 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
32744 "for the cyls/heads/sectors parameters."
32748 #: ../src/guestfs-actions.pod:7281
32749 msgid "See also: C<guestfs_part_add>"
32753 #: ../src/guestfs-actions.pod:7287
32754 msgid "guestfs_sfdisk_disk_geometry"
32758 #: ../src/guestfs-actions.pod:7289
32762 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
32763 " const char *device);\n"
32768 #: ../src/guestfs-actions.pod:7293
32770 "This displays the disk geometry of C<device> read from the partition table. "
32771 "Especially in the case where the underlying block device has been resized, "
32772 "this can be different from the kernel's idea of the geometry (see "
32773 "C<guestfs_sfdisk_kernel_geometry>)."
32777 #: ../src/guestfs-actions.pod:7306
32778 msgid "guestfs_sfdisk_kernel_geometry"
32782 #: ../src/guestfs-actions.pod:7308
32786 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
32787 " const char *device);\n"
32792 #: ../src/guestfs-actions.pod:7322
32793 msgid "guestfs_sfdisk_l"
32797 #: ../src/guestfs-actions.pod:7324
32801 " guestfs_sfdisk_l (guestfs_h *g,\n"
32802 " const char *device);\n"
32807 #: ../src/guestfs-actions.pod:7328
32809 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
32814 #: ../src/guestfs-actions.pod:7339
32815 msgid "See also: C<guestfs_part_list>"
32819 #: ../src/guestfs-actions.pod:7346
32824 #: ../src/guestfs-actions.pod:7348
32828 " guestfs_sh (guestfs_h *g,\n"
32829 " const char *command);\n"
32834 #: ../src/guestfs-actions.pod:7355
32835 msgid "This is like C<guestfs_command>, but passes the command to:"
32839 #: ../src/guestfs-actions.pod:7363
32840 msgid "All the provisos about C<guestfs_command> apply to this call."
32844 #: ../src/guestfs-actions.pod:7370
32845 msgid "guestfs_sh_lines"
32849 #: ../src/guestfs-actions.pod:7372
32853 " guestfs_sh_lines (guestfs_h *g,\n"
32854 " const char *command);\n"
32859 #: ../src/guestfs-actions.pod:7376
32861 "This is the same as C<guestfs_sh>, but splits the result into a list of "
32866 #: ../src/guestfs-actions.pod:7379
32867 msgid "See also: C<guestfs_command_lines>"
32871 #: ../src/guestfs-actions.pod:7387
32872 msgid "guestfs_sleep"
32876 #: ../src/guestfs-actions.pod:7389
32880 " guestfs_sleep (guestfs_h *g,\n"
32886 #: ../src/guestfs-actions.pod:7397
32887 msgid "(Added in 1.0.41)"
32891 #: ../src/guestfs-actions.pod:7399 ../src/guestfs-structs.pod:109
32892 msgid "guestfs_stat"
32896 #: ../src/guestfs-actions.pod:7401
32899 " struct guestfs_stat *\n"
32900 " guestfs_stat (guestfs_h *g,\n"
32901 " const char *path);\n"
32906 #: ../src/guestfs-actions.pod:7415 ../src/guestfs-structs.pod:135
32907 msgid "guestfs_statvfs"
32911 #: ../src/guestfs-actions.pod:7417
32914 " struct guestfs_statvfs *\n"
32915 " guestfs_statvfs (guestfs_h *g,\n"
32916 " const char *path);\n"
32921 #: ../src/guestfs-actions.pod:7427
32923 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
32924 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
32928 #: ../src/guestfs-actions.pod:7433
32929 msgid "guestfs_strings"
32933 #: ../src/guestfs-actions.pod:7435
32937 " guestfs_strings (guestfs_h *g,\n"
32938 " const char *path);\n"
32943 #: ../src/guestfs-actions.pod:7451
32944 msgid "guestfs_strings_e"
32948 #: ../src/guestfs-actions.pod:7453
32952 " guestfs_strings_e (guestfs_h *g,\n"
32953 " const char *encoding,\n"
32954 " const char *path);\n"
32959 #: ../src/guestfs-actions.pod:7458
32961 "This is like the C<guestfs_strings> command, but allows you to specify the "
32962 "encoding of strings that are looked for in the source file C<path>."
32966 #: ../src/guestfs-actions.pod:7468
32968 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
32969 "ISO-8859-X (this is what C<guestfs_strings> uses)."
32973 #: ../src/guestfs-actions.pod:7506
32974 msgid "guestfs_swapoff_device"
32978 #: ../src/guestfs-actions.pod:7508
32982 " guestfs_swapoff_device (guestfs_h *g,\n"
32983 " const char *device);\n"
32988 #: ../src/guestfs-actions.pod:7512
32990 "This command disables the libguestfs appliance swap device or partition "
32991 "named C<device>. See C<guestfs_swapon_device>."
32995 #: ../src/guestfs-actions.pod:7520
32996 msgid "guestfs_swapoff_file"
33000 #: ../src/guestfs-actions.pod:7522
33004 " guestfs_swapoff_file (guestfs_h *g,\n"
33005 " const char *file);\n"
33010 #: ../src/guestfs-actions.pod:7532
33011 msgid "guestfs_swapoff_label"
33015 #: ../src/guestfs-actions.pod:7534
33019 " guestfs_swapoff_label (guestfs_h *g,\n"
33020 " const char *label);\n"
33025 #: ../src/guestfs-actions.pod:7545
33026 msgid "guestfs_swapoff_uuid"
33030 #: ../src/guestfs-actions.pod:7547
33034 " guestfs_swapoff_uuid (guestfs_h *g,\n"
33035 " const char *uuid);\n"
33040 #: ../src/guestfs-actions.pod:7558
33041 msgid "guestfs_swapon_device"
33045 #: ../src/guestfs-actions.pod:7560
33049 " guestfs_swapon_device (guestfs_h *g,\n"
33050 " const char *device);\n"
33055 #: ../src/guestfs-actions.pod:7564
33057 "This command enables the libguestfs appliance to use the swap device or "
33058 "partition named C<device>. The increased memory is made available for all "
33059 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
33063 #: ../src/guestfs-actions.pod:7580
33064 msgid "guestfs_swapon_file"
33068 #: ../src/guestfs-actions.pod:7582
33072 " guestfs_swapon_file (guestfs_h *g,\n"
33073 " const char *file);\n"
33078 #: ../src/guestfs-actions.pod:7586
33080 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
33085 #: ../src/guestfs-actions.pod:7593
33086 msgid "guestfs_swapon_label"
33090 #: ../src/guestfs-actions.pod:7595
33094 " guestfs_swapon_label (guestfs_h *g,\n"
33095 " const char *label);\n"
33100 #: ../src/guestfs-actions.pod:7599
33102 "This command enables swap to a labeled swap partition. See "
33103 "C<guestfs_swapon_device> for other notes."
33107 #: ../src/guestfs-actions.pod:7606
33108 msgid "guestfs_swapon_uuid"
33112 #: ../src/guestfs-actions.pod:7608
33116 " guestfs_swapon_uuid (guestfs_h *g,\n"
33117 " const char *uuid);\n"
33122 #: ../src/guestfs-actions.pod:7612
33124 "This command enables swap to a swap partition with the given UUID. See "
33125 "C<guestfs_swapon_device> for other notes."
33129 #: ../src/guestfs-actions.pod:7619
33130 msgid "guestfs_sync"
33134 #: ../src/guestfs-actions.pod:7621
33138 " guestfs_sync (guestfs_h *g);\n"
33143 #: ../src/guestfs-actions.pod:7634
33144 msgid "guestfs_tail"
33148 #: ../src/guestfs-actions.pod:7636
33152 " guestfs_tail (guestfs_h *g,\n"
33153 " const char *path);\n"
33158 #: ../src/guestfs-actions.pod:7652
33159 msgid "guestfs_tail_n"
33163 #: ../src/guestfs-actions.pod:7654
33167 " guestfs_tail_n (guestfs_h *g,\n"
33169 " const char *path);\n"
33174 #: ../src/guestfs-actions.pod:7676
33175 msgid "guestfs_tar_in"
33179 #: ../src/guestfs-actions.pod:7678
33183 " guestfs_tar_in (guestfs_h *g,\n"
33184 " const char *tarfile,\n"
33185 " const char *directory);\n"
33190 #: ../src/guestfs-actions.pod:7686
33191 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
33195 #: ../src/guestfs-actions.pod:7691 ../src/guestfs-actions.pod:7708 ../src/guestfs-actions.pod:7724 ../src/guestfs-actions.pod:7740
33196 msgid "(Added in 1.0.3)"
33200 #: ../src/guestfs-actions.pod:7693
33201 msgid "guestfs_tar_out"
33205 #: ../src/guestfs-actions.pod:7695
33209 " guestfs_tar_out (guestfs_h *g,\n"
33210 " const char *directory,\n"
33211 " const char *tarfile);\n"
33216 #: ../src/guestfs-actions.pod:7703
33218 "To download a compressed tarball, use C<guestfs_tgz_out> or "
33219 "C<guestfs_txz_out>."
33223 #: ../src/guestfs-actions.pod:7710
33224 msgid "guestfs_tgz_in"
33228 #: ../src/guestfs-actions.pod:7712
33232 " guestfs_tgz_in (guestfs_h *g,\n"
33233 " const char *tarball,\n"
33234 " const char *directory);\n"
33239 #: ../src/guestfs-actions.pod:7720
33240 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
33244 #: ../src/guestfs-actions.pod:7726
33245 msgid "guestfs_tgz_out"
33249 #: ../src/guestfs-actions.pod:7728
33253 " guestfs_tgz_out (guestfs_h *g,\n"
33254 " const char *directory,\n"
33255 " const char *tarball);\n"
33260 #: ../src/guestfs-actions.pod:7736
33261 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
33265 #: ../src/guestfs-actions.pod:7742
33266 msgid "guestfs_touch"
33270 #: ../src/guestfs-actions.pod:7744
33274 " guestfs_touch (guestfs_h *g,\n"
33275 " const char *path);\n"
33280 #: ../src/guestfs-actions.pod:7759
33281 msgid "guestfs_truncate"
33285 #: ../src/guestfs-actions.pod:7761
33289 " guestfs_truncate (guestfs_h *g,\n"
33290 " const char *path);\n"
33295 #: ../src/guestfs-actions.pod:7772
33296 msgid "guestfs_truncate_size"
33300 #: ../src/guestfs-actions.pod:7774
33304 " guestfs_truncate_size (guestfs_h *g,\n"
33305 " const char *path,\n"
33306 " int64_t size);\n"
33311 #: ../src/guestfs-actions.pod:7782
33313 "If the current file size is less than C<size> then the file is extended to "
33314 "the required size with zero bytes. This creates a sparse file (ie. disk "
33315 "blocks are not allocated for the file until you write to it). To create a "
33316 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
33320 #: ../src/guestfs-actions.pod:7792
33321 msgid "guestfs_tune2fs"
33325 #: ../src/guestfs-actions.pod:7794
33329 " guestfs_tune2fs (guestfs_h *g,\n"
33330 " const char *device,\n"
33336 #: ../src/guestfs-actions.pod:7804
33339 " GUESTFS_TUNE2FS_FORCE, int force,\n"
33340 " GUESTFS_TUNE2FS_MAXMOUNTCOUNT, int maxmountcount,\n"
33341 " GUESTFS_TUNE2FS_MOUNTCOUNT, int mountcount,\n"
33342 " GUESTFS_TUNE2FS_ERRORBEHAVIOR, const char *errorbehavior,\n"
33343 " GUESTFS_TUNE2FS_GROUP, int64_t group,\n"
33344 " GUESTFS_TUNE2FS_INTERVALBETWEENCHECKS, int intervalbetweenchecks,\n"
33345 " GUESTFS_TUNE2FS_RESERVEDBLOCKSPERCENTAGE, int reservedblockspercentage,\n"
33346 " GUESTFS_TUNE2FS_LASTMOUNTEDDIRECTORY, const char *lastmounteddirectory,\n"
33347 " GUESTFS_TUNE2FS_RESERVEDBLOCKSCOUNT, int64_t reservedblockscount,\n"
33348 " GUESTFS_TUNE2FS_USER, int64_t user,\n"
33353 #: ../src/guestfs-actions.pod:7884
33355 "To get the current values of filesystem parameters, see "
33356 "C<guestfs_tune2fs_l>. For precise details of how tune2fs works, see the "
33357 "L<tune2fs(8)> man page."
33361 #: ../src/guestfs-actions.pod:7892
33362 msgid "guestfs_tune2fs_va"
33366 #: ../src/guestfs-actions.pod:7894
33370 " guestfs_tune2fs_va (guestfs_h *g,\n"
33371 " const char *device,\n"
33372 " va_list args);\n"
33377 #: ../src/guestfs-actions.pod:7899
33378 msgid "This is the \"va_list variant\" of L</guestfs_tune2fs>."
33382 #: ../src/guestfs-actions.pod:7903
33383 msgid "guestfs_tune2fs_argv"
33387 #: ../src/guestfs-actions.pod:7905
33391 " guestfs_tune2fs_argv (guestfs_h *g,\n"
33392 " const char *device,\n"
33393 " const struct guestfs_tune2fs_argv *optargs);\n"
33398 #: ../src/guestfs-actions.pod:7910
33399 msgid "This is the \"argv variant\" of L</guestfs_tune2fs>."
33403 #: ../src/guestfs-actions.pod:7914
33404 msgid "guestfs_tune2fs_l"
33408 #: ../src/guestfs-actions.pod:7916
33412 " guestfs_tune2fs_l (guestfs_h *g,\n"
33413 " const char *device);\n"
33418 #: ../src/guestfs-actions.pod:7936
33419 msgid "guestfs_txz_in"
33423 #: ../src/guestfs-actions.pod:7938
33427 " guestfs_txz_in (guestfs_h *g,\n"
33428 " const char *tarball,\n"
33429 " const char *directory);\n"
33434 #: ../src/guestfs-actions.pod:7950
33435 msgid "guestfs_txz_out"
33439 #: ../src/guestfs-actions.pod:7952
33443 " guestfs_txz_out (guestfs_h *g,\n"
33444 " const char *directory,\n"
33445 " const char *tarball);\n"
33450 #: ../src/guestfs-actions.pod:7964
33451 msgid "guestfs_umask"
33455 #: ../src/guestfs-actions.pod:7966
33459 " guestfs_umask (guestfs_h *g,\n"
33465 #: ../src/guestfs-actions.pod:7982
33467 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
33468 "C<guestfs_mkdir>."
33472 #: ../src/guestfs-actions.pod:7991
33473 msgid "guestfs_umount"
33477 #: ../src/guestfs-actions.pod:7993
33481 " guestfs_umount (guestfs_h *g,\n"
33482 " const char *pathordevice);\n"
33487 #: ../src/guestfs-actions.pod:8005
33488 msgid "guestfs_umount_all"
33492 #: ../src/guestfs-actions.pod:8007
33496 " guestfs_umount_all (guestfs_h *g);\n"
33501 #: ../src/guestfs-actions.pod:8018
33502 msgid "guestfs_upload"
33506 #: ../src/guestfs-actions.pod:8020
33510 " guestfs_upload (guestfs_h *g,\n"
33511 " const char *filename,\n"
33512 " const char *remotefilename);\n"
33517 #: ../src/guestfs-actions.pod:8030
33518 msgid "See also C<guestfs_download>."
33522 #: ../src/guestfs-actions.pod:8041
33523 msgid "guestfs_upload_offset"
33527 #: ../src/guestfs-actions.pod:8043
33531 " guestfs_upload_offset (guestfs_h *g,\n"
33532 " const char *filename,\n"
33533 " const char *remotefilename,\n"
33534 " int64_t offset);\n"
33539 #: ../src/guestfs-actions.pod:8059
33541 "Note that there is no limit on the amount of data that can be uploaded with "
33542 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
33543 "full amount unless an error occurs."
33547 #: ../src/guestfs-actions.pod:8064
33548 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
33552 #: ../src/guestfs-actions.pod:8075
33553 msgid "guestfs_utimens"
33557 #: ../src/guestfs-actions.pod:8077
33561 " guestfs_utimens (guestfs_h *g,\n"
33562 " const char *path,\n"
33563 " int64_t atsecs,\n"
33564 " int64_t atnsecs,\n"
33565 " int64_t mtsecs,\n"
33566 " int64_t mtnsecs);\n"
33571 #: ../src/guestfs-actions.pod:8106 ../src/guestfs-structs.pod:175
33572 msgid "guestfs_version"
33576 #: ../src/guestfs-actions.pod:8108
33579 " struct guestfs_version *\n"
33580 " guestfs_version (guestfs_h *g);\n"
33585 #: ../src/guestfs-actions.pod:8136
33587 "I<Note:> Don't use this call to test for availability of features. In "
33588 "enterprise distributions we backport features from later versions into "
33589 "earlier versions, making this an unreliable way to test for features. Use "
33590 "C<guestfs_available> instead."
33594 #: ../src/guestfs-actions.pod:8142
33596 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
33597 "error. I<The caller must call C<guestfs_free_version> after use>."
33601 #: ../src/guestfs-actions.pod:8146
33602 msgid "(Added in 1.0.58)"
33606 #: ../src/guestfs-actions.pod:8148
33607 msgid "guestfs_vfs_label"
33611 #: ../src/guestfs-actions.pod:8150
33615 " guestfs_vfs_label (guestfs_h *g,\n"
33616 " const char *device);\n"
33621 #: ../src/guestfs-actions.pod:8159
33622 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
33626 #: ../src/guestfs-actions.pod:8164 ../src/guestfs-actions.pod:8201
33627 msgid "(Added in 1.3.18)"
33631 #: ../src/guestfs-actions.pod:8166
33632 msgid "guestfs_vfs_type"
33636 #: ../src/guestfs-actions.pod:8168
33640 " guestfs_vfs_type (guestfs_h *g,\n"
33641 " const char *device);\n"
33646 #: ../src/guestfs-actions.pod:8185
33647 msgid "guestfs_vfs_uuid"
33651 #: ../src/guestfs-actions.pod:8187
33655 " guestfs_vfs_uuid (guestfs_h *g,\n"
33656 " const char *device);\n"
33661 #: ../src/guestfs-actions.pod:8196
33662 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
33666 #: ../src/guestfs-actions.pod:8203
33667 msgid "guestfs_vg_activate"
33671 #: ../src/guestfs-actions.pod:8205
33675 " guestfs_vg_activate (guestfs_h *g,\n"
33677 " char *const *volgroups);\n"
33682 #: ../src/guestfs-actions.pod:8222
33683 msgid "guestfs_vg_activate_all"
33687 #: ../src/guestfs-actions.pod:8224
33691 " guestfs_vg_activate_all (guestfs_h *g,\n"
33692 " int activate);\n"
33697 #: ../src/guestfs-actions.pod:8237
33698 msgid "guestfs_vgcreate"
33702 #: ../src/guestfs-actions.pod:8239
33706 " guestfs_vgcreate (guestfs_h *g,\n"
33707 " const char *volgroup,\n"
33708 " char *const *physvols);\n"
33713 #: ../src/guestfs-actions.pod:8251
33714 msgid "guestfs_vglvuuids"
33718 #: ../src/guestfs-actions.pod:8253
33722 " guestfs_vglvuuids (guestfs_h *g,\n"
33723 " const char *vgname);\n"
33728 #: ../src/guestfs-actions.pod:8260
33730 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
33731 "associate logical volumes and volume groups."
33735 #: ../src/guestfs-actions.pod:8263
33736 msgid "See also C<guestfs_vgpvuuids>."
33740 #: ../src/guestfs-actions.pod:8271
33741 msgid "guestfs_vgpvuuids"
33745 #: ../src/guestfs-actions.pod:8273
33749 " guestfs_vgpvuuids (guestfs_h *g,\n"
33750 " const char *vgname);\n"
33755 #: ../src/guestfs-actions.pod:8280
33757 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
33758 "associate physical volumes and volume groups."
33762 #: ../src/guestfs-actions.pod:8283
33763 msgid "See also C<guestfs_vglvuuids>."
33767 #: ../src/guestfs-actions.pod:8291
33768 msgid "guestfs_vgremove"
33772 #: ../src/guestfs-actions.pod:8293
33776 " guestfs_vgremove (guestfs_h *g,\n"
33777 " const char *vgname);\n"
33782 #: ../src/guestfs-actions.pod:8306
33783 msgid "guestfs_vgrename"
33787 #: ../src/guestfs-actions.pod:8308
33791 " guestfs_vgrename (guestfs_h *g,\n"
33792 " const char *volgroup,\n"
33793 " const char *newvolgroup);\n"
33798 #: ../src/guestfs-actions.pod:8319
33799 msgid "guestfs_vgs"
33803 #: ../src/guestfs-actions.pod:8321
33807 " guestfs_vgs (guestfs_h *g);\n"
33812 #: ../src/guestfs-actions.pod:8330
33813 msgid "See also C<guestfs_vgs_full>."
33817 #: ../src/guestfs-actions.pod:8338
33818 msgid "guestfs_vgs_full"
33822 #: ../src/guestfs-actions.pod:8340
33825 " struct guestfs_lvm_vg_list *\n"
33826 " guestfs_vgs_full (guestfs_h *g);\n"
33831 #: ../src/guestfs-actions.pod:8346
33833 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
33834 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
33839 #: ../src/guestfs-actions.pod:8352
33840 msgid "guestfs_vgscan"
33844 #: ../src/guestfs-actions.pod:8354
33848 " guestfs_vgscan (guestfs_h *g);\n"
33853 #: ../src/guestfs-actions.pod:8364
33854 msgid "guestfs_vguuid"
33858 #: ../src/guestfs-actions.pod:8366
33862 " guestfs_vguuid (guestfs_h *g,\n"
33863 " const char *vgname);\n"
33868 #: ../src/guestfs-actions.pod:8377
33869 msgid "guestfs_wait_ready"
33873 #: ../src/guestfs-actions.pod:8379
33877 " guestfs_wait_ready (guestfs_h *g);\n"
33882 #: ../src/guestfs-actions.pod:8382
33884 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
33889 #: ../src/guestfs-actions.pod:8389
33890 msgid "This function is a no op."
33894 #: ../src/guestfs-actions.pod:8391
33896 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
33897 "calling C<guestfs_launch> to wait for the launch to complete. However this "
33898 "is no longer necessary because C<guestfs_launch> now does the waiting."
33902 #: ../src/guestfs-actions.pod:8396
33904 "If you see any calls to this function in code then you can just remove them, "
33905 "unless you want to retain compatibility with older versions of the API."
33909 #: ../src/guestfs-actions.pod:8404
33910 msgid "guestfs_wc_c"
33914 #: ../src/guestfs-actions.pod:8406
33918 " guestfs_wc_c (guestfs_h *g,\n"
33919 " const char *path);\n"
33924 #: ../src/guestfs-actions.pod:8417
33925 msgid "guestfs_wc_l"
33929 #: ../src/guestfs-actions.pod:8419
33933 " guestfs_wc_l (guestfs_h *g,\n"
33934 " const char *path);\n"
33939 #: ../src/guestfs-actions.pod:8430
33940 msgid "guestfs_wc_w"
33944 #: ../src/guestfs-actions.pod:8432
33948 " guestfs_wc_w (guestfs_h *g,\n"
33949 " const char *path);\n"
33954 #: ../src/guestfs-actions.pod:8443
33955 msgid "guestfs_write"
33959 #: ../src/guestfs-actions.pod:8445
33963 " guestfs_write (guestfs_h *g,\n"
33964 " const char *path,\n"
33965 " const char *content,\n"
33966 " size_t content_size);\n"
33971 #: ../src/guestfs-actions.pod:8454
33972 msgid "See also C<guestfs_write_append>."
33976 #: ../src/guestfs-actions.pod:8463
33977 msgid "guestfs_write_append"
33981 #: ../src/guestfs-actions.pod:8465
33985 " guestfs_write_append (guestfs_h *g,\n"
33986 " const char *path,\n"
33987 " const char *content,\n"
33988 " size_t content_size);\n"
33993 #: ../src/guestfs-actions.pod:8474
33994 msgid "See also C<guestfs_write>."
33998 #: ../src/guestfs-actions.pod:8483
33999 msgid "guestfs_write_file"
34003 #: ../src/guestfs-actions.pod:8485
34007 " guestfs_write_file (guestfs_h *g,\n"
34008 " const char *path,\n"
34009 " const char *content,\n"
34015 #: ../src/guestfs-actions.pod:8491
34017 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
34022 #: ../src/guestfs-actions.pod:8516
34023 msgid "guestfs_zegrep"
34027 #: ../src/guestfs-actions.pod:8518
34031 " guestfs_zegrep (guestfs_h *g,\n"
34032 " const char *regex,\n"
34033 " const char *path);\n"
34038 #: ../src/guestfs-actions.pod:8535
34039 msgid "guestfs_zegrepi"
34043 #: ../src/guestfs-actions.pod:8537
34047 " guestfs_zegrepi (guestfs_h *g,\n"
34048 " const char *regex,\n"
34049 " const char *path);\n"
34054 #: ../src/guestfs-actions.pod:8554
34055 msgid "guestfs_zero"
34059 #: ../src/guestfs-actions.pod:8556
34063 " guestfs_zero (guestfs_h *g,\n"
34064 " const char *device);\n"
34069 #: ../src/guestfs-actions.pod:8570
34071 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
34072 "C<guestfs_is_zero_device>"
34076 #: ../src/guestfs-actions.pod:8582
34077 msgid "guestfs_zero_device"
34081 #: ../src/guestfs-actions.pod:8584
34085 " guestfs_zero_device (guestfs_h *g,\n"
34086 " const char *device);\n"
34091 #: ../src/guestfs-actions.pod:8588
34093 "This command writes zeroes over the entire C<device>. Compare with "
34094 "C<guestfs_zero> which just zeroes the first few blocks of a device."
34098 #: ../src/guestfs-actions.pod:8603
34099 msgid "(Added in 1.3.1)"
34103 #: ../src/guestfs-actions.pod:8605
34104 msgid "guestfs_zerofree"
34108 #: ../src/guestfs-actions.pod:8607
34112 " guestfs_zerofree (guestfs_h *g,\n"
34113 " const char *device);\n"
34118 #: ../src/guestfs-actions.pod:8626
34119 msgid "guestfs_zfgrep"
34123 #: ../src/guestfs-actions.pod:8628
34127 " guestfs_zfgrep (guestfs_h *g,\n"
34128 " const char *pattern,\n"
34129 " const char *path);\n"
34134 #: ../src/guestfs-actions.pod:8645
34135 msgid "guestfs_zfgrepi"
34139 #: ../src/guestfs-actions.pod:8647
34143 " guestfs_zfgrepi (guestfs_h *g,\n"
34144 " const char *pattern,\n"
34145 " const char *path);\n"
34150 #: ../src/guestfs-actions.pod:8664
34151 msgid "guestfs_zfile"
34155 #: ../src/guestfs-actions.pod:8666
34159 " guestfs_zfile (guestfs_h *g,\n"
34160 " const char *meth,\n"
34161 " const char *path);\n"
34166 #: ../src/guestfs-actions.pod:8671
34168 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
34173 #: ../src/guestfs-actions.pod:8683
34175 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
34180 #: ../src/guestfs-actions.pod:8691
34181 msgid "guestfs_zgrep"
34185 #: ../src/guestfs-actions.pod:8693
34189 " guestfs_zgrep (guestfs_h *g,\n"
34190 " const char *regex,\n"
34191 " const char *path);\n"
34196 #: ../src/guestfs-actions.pod:8710
34197 msgid "guestfs_zgrepi"
34201 #: ../src/guestfs-actions.pod:8712
34205 " guestfs_zgrepi (guestfs_h *g,\n"
34206 " const char *regex,\n"
34207 " const char *path);\n"
34212 #: ../src/guestfs-availability.pod:3
34217 #: ../src/guestfs-availability.pod:5
34219 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
34220 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
34221 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
34222 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
34223 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
34227 #: ../src/guestfs-availability.pod:21
34232 #: ../src/guestfs-availability.pod:23
34233 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
34237 #: ../src/guestfs-availability.pod:26
34242 #: ../src/guestfs-availability.pod:28
34243 msgid "The following functions: L</guestfs_grub_install>"
34247 #: ../src/guestfs-availability.pod:31
34252 #: ../src/guestfs-availability.pod:33
34254 "The following functions: L</guestfs_inotify_add_watch> "
34255 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
34256 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
34260 #: ../src/guestfs-availability.pod:41
34261 msgid "B<linuxfsuuid>"
34265 #: ../src/guestfs-availability.pod:43
34267 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
34268 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
34272 #: ../src/guestfs-availability.pod:50
34273 msgid "B<linuxmodules>"
34277 #: ../src/guestfs-availability.pod:52
34278 msgid "The following functions: L</guestfs_modprobe>"
34282 #: ../src/guestfs-availability.pod:55
34283 msgid "B<linuxxattrs>"
34287 #: ../src/guestfs-availability.pod:57
34289 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
34290 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
34291 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
34292 "L</guestfs_setxattr>"
34296 #: ../src/guestfs-availability.pod:68
34301 #: ../src/guestfs-availability.pod:70
34303 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
34304 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
34305 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
34309 #: ../src/guestfs-availability.pod:79
34314 #: ../src/guestfs-availability.pod:81
34316 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
34317 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
34318 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
34319 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
34320 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
34321 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
34322 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
34323 "L</guestfs_vgs_full>"
34327 #: ../src/guestfs-availability.pod:104
34332 #: ../src/guestfs-availability.pod:106
34334 "The following functions: L</guestfs_md_create> L</guestfs_md_detail> "
34335 "L</guestfs_md_stop>"
34339 #: ../src/guestfs-availability.pod:111
34344 #: ../src/guestfs-availability.pod:113
34346 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
34347 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
34351 #: ../src/guestfs-availability.pod:119
34356 #: ../src/guestfs-availability.pod:121
34357 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
34361 #: ../src/guestfs-availability.pod:124
34362 msgid "B<ntfsprogs>"
34366 #: ../src/guestfs-availability.pod:126
34368 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
34369 "L</guestfs_ntfsresize_size>"
34373 #: ../src/guestfs-availability.pod:131
34374 msgid "B<realpath>"
34378 #: ../src/guestfs-availability.pod:133
34379 msgid "The following functions: L</guestfs_realpath>"
34383 #: ../src/guestfs-availability.pod:136
34388 #: ../src/guestfs-availability.pod:138
34390 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
34391 "L</guestfs_scrub_freespace>"
34395 #: ../src/guestfs-availability.pod:143
34400 #: ../src/guestfs-availability.pod:145
34401 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
34405 #: ../src/guestfs-availability.pod:149
34410 #: ../src/guestfs-availability.pod:151
34411 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
34415 #: ../src/guestfs-availability.pod:155
34416 msgid "B<zerofree>"
34420 #: ../src/guestfs-availability.pod:157
34421 msgid "The following functions: L</guestfs_zerofree>"
34425 #: ../src/guestfs-structs.pod:1
34426 msgid "guestfs_int_bool"
34430 #: ../src/guestfs-structs.pod:3
34433 " struct guestfs_int_bool {\n"
34441 #: ../src/guestfs-structs.pod:8
34444 " struct guestfs_int_bool_list {\n"
34445 " uint32_t len; /* Number of elements in list. */\n"
34446 " struct guestfs_int_bool *val; /* Elements. */\n"
34452 #: ../src/guestfs-structs.pod:13
34455 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
34456 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
34461 #: ../src/guestfs-structs.pod:16
34462 msgid "guestfs_lvm_pv"
34466 #: ../src/guestfs-structs.pod:18
34469 " struct guestfs_lvm_pv {\n"
34470 " char *pv_name;\n"
34471 " /* The next field is NOT nul-terminated, be careful when printing it: "
34473 " char pv_uuid[32];\n"
34475 " uint64_t pv_size;\n"
34476 " uint64_t dev_size;\n"
34477 " uint64_t pv_free;\n"
34478 " uint64_t pv_used;\n"
34479 " char *pv_attr;\n"
34480 " int64_t pv_pe_count;\n"
34481 " int64_t pv_pe_alloc_count;\n"
34482 " char *pv_tags;\n"
34483 " uint64_t pe_start;\n"
34484 " int64_t pv_mda_count;\n"
34485 " uint64_t pv_mda_free;\n"
34491 #: ../src/guestfs-structs.pod:36
34494 " struct guestfs_lvm_pv_list {\n"
34495 " uint32_t len; /* Number of elements in list. */\n"
34496 " struct guestfs_lvm_pv *val; /* Elements. */\n"
34502 #: ../src/guestfs-structs.pod:41
34505 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
34506 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
34511 #: ../src/guestfs-structs.pod:44
34512 msgid "guestfs_lvm_vg"
34516 #: ../src/guestfs-structs.pod:46
34519 " struct guestfs_lvm_vg {\n"
34520 " char *vg_name;\n"
34521 " /* The next field is NOT nul-terminated, be careful when printing it: "
34523 " char vg_uuid[32];\n"
34525 " char *vg_attr;\n"
34526 " uint64_t vg_size;\n"
34527 " uint64_t vg_free;\n"
34528 " char *vg_sysid;\n"
34529 " uint64_t vg_extent_size;\n"
34530 " int64_t vg_extent_count;\n"
34531 " int64_t vg_free_count;\n"
34532 " int64_t max_lv;\n"
34533 " int64_t max_pv;\n"
34534 " int64_t pv_count;\n"
34535 " int64_t lv_count;\n"
34536 " int64_t snap_count;\n"
34537 " int64_t vg_seqno;\n"
34538 " char *vg_tags;\n"
34539 " int64_t vg_mda_count;\n"
34540 " uint64_t vg_mda_free;\n"
34546 #: ../src/guestfs-structs.pod:69
34549 " struct guestfs_lvm_vg_list {\n"
34550 " uint32_t len; /* Number of elements in list. */\n"
34551 " struct guestfs_lvm_vg *val; /* Elements. */\n"
34557 #: ../src/guestfs-structs.pod:74
34560 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
34561 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
34566 #: ../src/guestfs-structs.pod:77
34567 msgid "guestfs_lvm_lv"
34571 #: ../src/guestfs-structs.pod:79
34574 " struct guestfs_lvm_lv {\n"
34575 " char *lv_name;\n"
34576 " /* The next field is NOT nul-terminated, be careful when printing it: "
34578 " char lv_uuid[32];\n"
34579 " char *lv_attr;\n"
34580 " int64_t lv_major;\n"
34581 " int64_t lv_minor;\n"
34582 " int64_t lv_kernel_major;\n"
34583 " int64_t lv_kernel_minor;\n"
34584 " uint64_t lv_size;\n"
34585 " int64_t seg_count;\n"
34587 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
34588 " float snap_percent;\n"
34589 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
34590 " float copy_percent;\n"
34591 " char *move_pv;\n"
34592 " char *lv_tags;\n"
34593 " char *mirror_log;\n"
34594 " char *modules;\n"
34600 #: ../src/guestfs-structs.pod:101
34603 " struct guestfs_lvm_lv_list {\n"
34604 " uint32_t len; /* Number of elements in list. */\n"
34605 " struct guestfs_lvm_lv *val; /* Elements. */\n"
34611 #: ../src/guestfs-structs.pod:106
34614 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
34615 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
34620 #: ../src/guestfs-structs.pod:111
34623 " struct guestfs_stat {\n"
34627 " int64_t nlink;\n"
34632 " int64_t blksize;\n"
34633 " int64_t blocks;\n"
34634 " int64_t atime;\n"
34635 " int64_t mtime;\n"
34636 " int64_t ctime;\n"
34642 #: ../src/guestfs-structs.pod:127
34645 " struct guestfs_stat_list {\n"
34646 " uint32_t len; /* Number of elements in list. */\n"
34647 " struct guestfs_stat *val; /* Elements. */\n"
34653 #: ../src/guestfs-structs.pod:132
34656 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
34657 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
34662 #: ../src/guestfs-structs.pod:137
34665 " struct guestfs_statvfs {\n"
34666 " int64_t bsize;\n"
34667 " int64_t frsize;\n"
34668 " int64_t blocks;\n"
34669 " int64_t bfree;\n"
34670 " int64_t bavail;\n"
34671 " int64_t files;\n"
34672 " int64_t ffree;\n"
34673 " int64_t favail;\n"
34676 " int64_t namemax;\n"
34682 #: ../src/guestfs-structs.pod:151
34685 " struct guestfs_statvfs_list {\n"
34686 " uint32_t len; /* Number of elements in list. */\n"
34687 " struct guestfs_statvfs *val; /* Elements. */\n"
34693 #: ../src/guestfs-structs.pod:156
34696 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
34697 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
34702 #: ../src/guestfs-structs.pod:159
34703 msgid "guestfs_dirent"
34707 #: ../src/guestfs-structs.pod:161
34710 " struct guestfs_dirent {\n"
34719 #: ../src/guestfs-structs.pod:167
34722 " struct guestfs_dirent_list {\n"
34723 " uint32_t len; /* Number of elements in list. */\n"
34724 " struct guestfs_dirent *val; /* Elements. */\n"
34730 #: ../src/guestfs-structs.pod:172
34733 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
34734 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
34739 #: ../src/guestfs-structs.pod:177
34742 " struct guestfs_version {\n"
34743 " int64_t major;\n"
34744 " int64_t minor;\n"
34745 " int64_t release;\n"
34752 #: ../src/guestfs-structs.pod:184
34755 " struct guestfs_version_list {\n"
34756 " uint32_t len; /* Number of elements in list. */\n"
34757 " struct guestfs_version *val; /* Elements. */\n"
34763 #: ../src/guestfs-structs.pod:189
34766 " void guestfs_free_version (struct guestfs_free_version *);\n"
34767 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
34772 #: ../src/guestfs-structs.pod:192
34773 msgid "guestfs_xattr"
34777 #: ../src/guestfs-structs.pod:194
34780 " struct guestfs_xattr {\n"
34781 " char *attrname;\n"
34782 " /* The next two fields describe a byte array. */\n"
34783 " uint32_t attrval_len;\n"
34784 " char *attrval;\n"
34790 #: ../src/guestfs-structs.pod:201
34793 " struct guestfs_xattr_list {\n"
34794 " uint32_t len; /* Number of elements in list. */\n"
34795 " struct guestfs_xattr *val; /* Elements. */\n"
34801 #: ../src/guestfs-structs.pod:206
34804 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
34805 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
34810 #: ../src/guestfs-structs.pod:209
34811 msgid "guestfs_inotify_event"
34815 #: ../src/guestfs-structs.pod:211
34818 " struct guestfs_inotify_event {\n"
34819 " int64_t in_wd;\n"
34820 " uint32_t in_mask;\n"
34821 " uint32_t in_cookie;\n"
34822 " char *in_name;\n"
34828 #: ../src/guestfs-structs.pod:218
34831 " struct guestfs_inotify_event_list {\n"
34832 " uint32_t len; /* Number of elements in list. */\n"
34833 " struct guestfs_inotify_event *val; /* Elements. */\n"
34839 #: ../src/guestfs-structs.pod:223
34842 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
34843 " void guestfs_free_inotify_event_list (struct "
34844 "guestfs_free_inotify_event_list *);\n"
34849 #: ../src/guestfs-structs.pod:226
34850 msgid "guestfs_partition"
34854 #: ../src/guestfs-structs.pod:228
34857 " struct guestfs_partition {\n"
34858 " int32_t part_num;\n"
34859 " uint64_t part_start;\n"
34860 " uint64_t part_end;\n"
34861 " uint64_t part_size;\n"
34867 #: ../src/guestfs-structs.pod:235
34870 " struct guestfs_partition_list {\n"
34871 " uint32_t len; /* Number of elements in list. */\n"
34872 " struct guestfs_partition *val; /* Elements. */\n"
34878 #: ../src/guestfs-structs.pod:240
34881 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
34882 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
34887 #: ../src/guestfs-structs.pod:243
34888 msgid "guestfs_application"
34892 #: ../src/guestfs-structs.pod:245
34895 " struct guestfs_application {\n"
34896 " char *app_name;\n"
34897 " char *app_display_name;\n"
34898 " int32_t app_epoch;\n"
34899 " char *app_version;\n"
34900 " char *app_release;\n"
34901 " char *app_install_path;\n"
34902 " char *app_trans_path;\n"
34903 " char *app_publisher;\n"
34904 " char *app_url;\n"
34905 " char *app_source_package;\n"
34906 " char *app_summary;\n"
34907 " char *app_description;\n"
34913 #: ../src/guestfs-structs.pod:260
34916 " struct guestfs_application_list {\n"
34917 " uint32_t len; /* Number of elements in list. */\n"
34918 " struct guestfs_application *val; /* Elements. */\n"
34924 #: ../src/guestfs-structs.pod:265
34927 " void guestfs_free_application (struct guestfs_free_application *);\n"
34928 " void guestfs_free_application_list (struct guestfs_free_application_list "
34934 #: ../src/guestfs.pod:5
34935 msgid "guestfs - Library for accessing and modifying virtual machine images"
34939 #: ../src/guestfs.pod:11
34942 " guestfs_h *g = guestfs_create ();\n"
34943 " guestfs_add_drive (g, \"guest.img\");\n"
34944 " guestfs_launch (g);\n"
34945 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
34946 " guestfs_touch (g, \"/hello\");\n"
34947 " guestfs_umount (g, \"/\");\n"
34948 " guestfs_close (g);\n"
34953 #: ../src/guestfs.pod:25
34955 "Libguestfs is a library for accessing and modifying guest disk images. "
34956 "Amongst the things this is good for: making batch configuration changes to "
34957 "guests, getting disk used/free statistics (see also: virt-df), migrating "
34958 "between virtualization systems (see also: virt-p2v), performing partial "
34959 "backups, performing partial guest clones, cloning guests and changing "
34960 "registry/UUID/hostname info, and much else besides."
34964 #: ../src/guestfs.pod:33
34966 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
34967 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
34968 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
34973 #: ../src/guestfs.pod:38
34975 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
34976 "what filesystem is in each LV, etc.). It can also run commands in the "
34977 "context of the guest. Also you can access filesystems over FUSE."
34981 #: ../src/guestfs.pod:43
34983 "Libguestfs is a library that can be linked with C and C++ management "
34984 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
34985 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
34990 #: ../src/guestfs.pod:48
34992 "You don't need to be root to use libguestfs, although obviously you do need "
34993 "enough permissions to access the disk images."
34997 #: ../src/guestfs.pod:51
34999 "Libguestfs is a large API because it can do many things. For a gentle "
35000 "introduction, please read the L</API OVERVIEW> section next."
35004 #: ../src/guestfs.pod:54
35006 "There are also some example programs in the L<guestfs-examples(3)> manual "
35011 #: ../src/guestfs.pod:57
35012 msgid "API OVERVIEW"
35016 #: ../src/guestfs.pod:59
35018 "This section provides a gentler overview of the libguestfs API. We also try "
35019 "to group API calls together, where that may not be obvious from reading "
35020 "about the individual calls in the main section of this manual."
35024 #: ../src/guestfs.pod:64
35029 #: ../src/guestfs.pod:66
35031 "Before you can use libguestfs calls, you have to create a handle. Then you "
35032 "must add at least one disk image to the handle, followed by launching the "
35033 "handle, then performing whatever operations you want, and finally closing "
35034 "the handle. By convention we use the single letter C<g> for the name of the "
35035 "handle variable, although of course you can use any name you want."
35039 #: ../src/guestfs.pod:73
35040 msgid "The general structure of all libguestfs-using programs looks like this:"
35044 #: ../src/guestfs.pod:76
35047 " guestfs_h *g = guestfs_create ();\n"
35052 #: ../src/guestfs.pod:78
35055 " /* Call guestfs_add_drive additional times if there are\n"
35056 " * multiple disk images.\n"
35058 " guestfs_add_drive (g, \"guest.img\");\n"
35063 #: ../src/guestfs.pod:83
35066 " /* Most manipulation calls won't work until you've launched\n"
35067 " * the handle 'g'. You have to do this _after_ adding drives\n"
35068 " * and _before_ other commands.\n"
35070 " guestfs_launch (g);\n"
35075 #: ../src/guestfs.pod:89
35078 " /* Now you can examine what partitions, LVs etc are available.\n"
35080 " char **partitions = guestfs_list_partitions (g);\n"
35081 " char **logvols = guestfs_lvs (g);\n"
35086 #: ../src/guestfs.pod:94
35089 " /* To access a filesystem in the image, you must mount it.\n"
35091 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
35096 #: ../src/guestfs.pod:98
35099 " /* Now you can perform filesystem actions on the guest\n"
35102 " guestfs_touch (g, \"/hello\");\n"
35107 #: ../src/guestfs.pod:103
35110 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
35111 " * it is done automatically when you close the handle. See\n"
35112 " * discussion of autosync in this page.\n"
35114 " guestfs_sync (g);\n"
35119 #: ../src/guestfs.pod:109
35122 " /* Close the handle 'g'. */\n"
35123 " guestfs_close (g);\n"
35128 #: ../src/guestfs.pod:112
35130 "The code above doesn't include any error checking. In real code you should "
35131 "check return values carefully for errors. In general all functions that "
35132 "return integers return C<-1> on error, and all functions that return "
35133 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
35134 "how to handle errors, and consult the documentation for each function call "
35135 "below to see precisely how they return error indications. See "
35136 "L<guestfs-examples(3)> for fully worked examples."
35140 #: ../src/guestfs.pod:121
35141 msgid "DISK IMAGES"
35145 #: ../src/guestfs.pod:123
35147 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
35148 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
35149 "actual block device, or simply an empty file of zeroes that you have created "
35150 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
35155 #: ../src/guestfs.pod:129
35157 "The call you should use in modern code for adding drives is "
35158 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
35159 "specifying that the format is raw, do:"
35163 #: ../src/guestfs.pod:133
35166 " guestfs_add_drive_opts (g, filename,\n"
35167 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
35173 #: ../src/guestfs.pod:137
35174 msgid "You can add a disk read-only using:"
35178 #: ../src/guestfs.pod:139
35181 " guestfs_add_drive_opts (g, filename,\n"
35182 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
35183 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
35189 #: ../src/guestfs.pod:144
35191 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
35192 "libguestfs won't modify the file."
35196 #: ../src/guestfs.pod:147
35198 "Be extremely cautious if the disk image is in use, eg. if it is being used "
35199 "by a virtual machine. Adding it read-write will almost certainly cause disk "
35200 "corruption, but adding it read-only is safe."
35204 #: ../src/guestfs.pod:151
35206 "You must add at least one disk image, and you may add multiple disk images. "
35207 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
35208 "first one you added), C</dev/sdb> (for the second one you added), etc."
35212 #: ../src/guestfs.pod:156
35214 "Once L</guestfs_launch> has been called you cannot add any more images. You "
35215 "can call L</guestfs_list_devices> to get a list of the device names, in the "
35216 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
35220 #: ../src/guestfs.pod:161
35225 #: ../src/guestfs.pod:163
35227 "Before you can read or write files, create directories and so on in a disk "
35228 "image that contains filesystems, you have to mount those filesystems using "
35229 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
35230 "a disk image contains (for example) one partition with a filesystem on that "
35231 "partition, then you can mount it directly:"
35235 #: ../src/guestfs.pod:170
35238 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
35243 #: ../src/guestfs.pod:172
35245 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
35246 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
35247 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
35248 "that these are libguestfs virtual devices, and are nothing to do with host "
35253 #: ../src/guestfs.pod:178
35255 "If you are given a disk image and you don't know what it contains then you "
35256 "have to find out. Libguestfs can do that too: use "
35257 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
35258 "and LVs, and either try mounting each to see what is mountable, or else "
35259 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
35260 "filesystems, use L</guestfs_list_filesystems>."
35264 #: ../src/guestfs.pod:186
35266 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
35267 "L</INSPECTION> below). But you might find it easier to look at higher level "
35268 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
35272 #: ../src/guestfs.pod:191
35274 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
35275 "several other variations of the C<guestfs_mount_*> call."
35279 #: ../src/guestfs.pod:194
35280 msgid "FILESYSTEM ACCESS AND MODIFICATION"
35284 #: ../src/guestfs.pod:196
35286 "The majority of the libguestfs API consists of fairly low-level calls for "
35287 "accessing and modifying the files, directories, symlinks etc on mounted "
35288 "filesystems. There are over a hundred such calls which you can find listed "
35289 "in detail below in this man page, and we don't even pretend to cover them "
35290 "all in this overview."
35294 #: ../src/guestfs.pod:202
35296 "Specify filenames as full paths, starting with C<\"/\"> and including the "
35301 #: ../src/guestfs.pod:205
35303 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
35304 "the file called C<\"etc/passwd\"> then you could do:"
35308 #: ../src/guestfs.pod:208
35311 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
35316 #: ../src/guestfs.pod:210
35318 "This would return C<data> as a newly allocated buffer containing the full "
35319 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
35320 "or C<NULL> if there was an error."
35324 #: ../src/guestfs.pod:214
35326 "As another example, to create a top-level directory on that filesystem "
35327 "called C<\"var\"> you would do:"
35331 #: ../src/guestfs.pod:217
35334 " guestfs_mkdir (g, \"/var\");\n"
35339 #: ../src/guestfs.pod:219
35340 msgid "To create a symlink you could do:"
35344 #: ../src/guestfs.pod:221
35347 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
35348 " \"/etc/rc3.d/S30portmap\");\n"
35353 #: ../src/guestfs.pod:224
35355 "Libguestfs will reject attempts to use relative paths and there is no "
35356 "concept of a current working directory."
35360 #: ../src/guestfs.pod:227
35362 "Libguestfs can return errors in many situations: for example if the "
35363 "filesystem isn't writable, or if a file or directory that you requested "
35364 "doesn't exist. If you are using the C API (documented here) you have to "
35365 "check for those error conditions after each call. (Other language bindings "
35366 "turn these errors into exceptions)."
35370 #: ../src/guestfs.pod:233
35372 "File writes are affected by the per-handle umask, set by calling "
35373 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
35377 #: ../src/guestfs.pod:236
35378 msgid "PARTITIONING"
35382 #: ../src/guestfs.pod:238
35384 "Libguestfs contains API calls to read, create and modify partition tables on "
35389 #: ../src/guestfs.pod:241
35391 "In the common case where you want to create a single partition covering the "
35392 "whole disk, you should use the L</guestfs_part_disk> call:"
35396 #: ../src/guestfs.pod:245
35399 " const char *parttype = \"mbr\";\n"
35400 " if (disk_is_larger_than_2TB)\n"
35401 " parttype = \"gpt\";\n"
35402 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
35407 #: ../src/guestfs.pod:250
35409 "Obviously this effectively wipes anything that was on that disk image "
35414 #: ../src/guestfs.pod:253
35419 #: ../src/guestfs.pod:255
35421 "Libguestfs provides access to a large part of the LVM2 API, such as "
35422 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
35423 "unless you familiarize yourself with the concepts of physical volumes, "
35424 "volume groups and logical volumes."
35428 #: ../src/guestfs.pod:260
35430 "This author strongly recommends reading the LVM HOWTO, online at "
35431 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
35435 #: ../src/guestfs.pod:263
35436 msgid "DOWNLOADING"
35440 #: ../src/guestfs.pod:265
35442 "Use L</guestfs_cat> to download small, text only files. This call is "
35443 "limited to files which are less than 2 MB and which cannot contain any ASCII "
35444 "NUL (C<\\0>) characters. However the API is very simple to use."
35448 #: ../src/guestfs.pod:269
35450 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
35451 "bit data, since it returns a (pointer, size) pair. However it is still "
35452 "limited to \"small\" files, less than 2 MB."
35456 #: ../src/guestfs.pod:273
35458 "L</guestfs_download> can be used to download any file, with no limits on "
35459 "content or size (even files larger than 4 GB)."
35463 #: ../src/guestfs.pod:276
35464 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
35468 #: ../src/guestfs.pod:279
35473 #: ../src/guestfs.pod:281
35475 "It's often the case that you want to write a file or files to the disk "
35480 #: ../src/guestfs.pod:284
35482 "To write a small file with fixed content, use L</guestfs_write>. To create "
35483 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
35484 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
35485 "variety of other functions for creating test files, for example "
35486 "L</guestfs_fill> and L</guestfs_fill_pattern>."
35490 #: ../src/guestfs.pod:290
35492 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
35493 "file content or size (even files larger than 4 GB)."
35497 #: ../src/guestfs.pod:293
35498 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
35502 #: ../src/guestfs.pod:295
35504 "However the fastest way to upload I<large numbers of arbitrary files> is to "
35505 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
35506 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
35507 "the drive in a predictable way (eg. adding it last after all other drives) "
35508 "then you can get the device name from L</guestfs_list_devices> and mount it "
35509 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
35510 "sometimes non-portable between kernel versions, and they don't support "
35511 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
35512 "using a label or UUID, use an ISO image instead."
35516 #: ../src/guestfs.pod:306
35521 #: ../src/guestfs.pod:308
35523 "There are various different commands for copying between files and devices "
35524 "and in and out of the guest filesystem. These are summarised in the table "
35529 #: ../src/guestfs.pod:314
35530 msgid "B<file> to B<file>"
35534 #: ../src/guestfs.pod:316
35536 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
35537 "directories recursively."
35541 #: ../src/guestfs.pod:319
35542 msgid "To copy part of a file (offset and size) use L</guestfs_copy_file_to_file>."
35546 #: ../src/guestfs.pod:322
35547 msgid "B<file> to B<device>"
35551 #: ../src/guestfs.pod:324
35552 msgid "B<device> to B<file>"
35556 #: ../src/guestfs.pod:326
35557 msgid "B<device> to B<device>"
35561 #: ../src/guestfs.pod:328
35563 "Use L</guestfs_copy_file_to_device>, L</guestfs_copy_device_to_file>, or "
35564 "L</guestfs_copy_device_to_device>."
35568 #: ../src/guestfs.pod:331
35569 msgid "Example: duplicate the contents of an LV:"
35573 #: ../src/guestfs.pod:333
35576 " guestfs_copy_device_to_device (g,\n"
35577 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
35578 " /* -1 marks the end of the list of optional parameters */\n"
35584 #: ../src/guestfs.pod:338
35586 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
35587 "(C</dev/VG/Original>). To copy less than the whole source device, use the "
35588 "optional C<size> parameter:"
35592 #: ../src/guestfs.pod:342
35595 " guestfs_copy_device_to_device (g,\n"
35596 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
35597 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, 10000,\n"
35603 #: ../src/guestfs.pod:347
35604 msgid "B<file on the host> to B<file or device>"
35608 #: ../src/guestfs.pod:349
35609 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
35613 #: ../src/guestfs.pod:351
35614 msgid "B<file or device> to B<file on the host>"
35618 #: ../src/guestfs.pod:353
35619 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
35623 #: ../src/guestfs.pod:357
35624 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
35628 #: ../src/guestfs.pod:359
35630 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
35631 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
35632 "appears you can only upload and download to files. However many Un*x-like "
35633 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
35634 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
35635 "stderr, and arbitrary file descriptor N."
35639 #: ../src/guestfs.pod:367
35640 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
35644 #: ../src/guestfs.pod:370
35647 " guestfs_download (g, filename, \"/dev/stdout\");\n"
35652 #: ../src/guestfs.pod:372
35653 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
35657 #: ../src/guestfs.pod:374
35660 " char devfd[64];\n"
35661 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
35662 " guestfs_tar_out (g, \"/\", devfd);\n"
35667 #: ../src/guestfs.pod:378
35668 msgid "LISTING FILES"
35672 #: ../src/guestfs.pod:380
35674 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
35675 "L<guestfish(1)>-equivalent command C<ll>)."
35679 #: ../src/guestfs.pod:383
35681 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
35682 "programs, as a flat list of strings."
35686 #: ../src/guestfs.pod:386
35688 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
35689 "directory, plus additional information about each one. It is more "
35690 "equivalent to using the L<readdir(3)> call on a local filesystem."
35694 #: ../src/guestfs.pod:390
35696 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
35701 #: ../src/guestfs.pod:393
35702 msgid "RUNNING COMMANDS"
35706 #: ../src/guestfs.pod:395
35708 "Although libguestfs is primarily an API for manipulating files inside guest "
35709 "images, we also provide some limited facilities for running commands inside "
35714 #: ../src/guestfs.pod:399
35715 msgid "There are many limitations to this:"
35719 #: ../src/guestfs.pod:405
35721 "The kernel version that the command runs under will be different from what "
35726 #: ../src/guestfs.pod:410
35728 "If the command needs to communicate with daemons, then most likely they "
35729 "won't be running."
35733 #: ../src/guestfs.pod:415
35734 msgid "The command will be running in limited memory."
35738 #: ../src/guestfs.pod:419
35740 "The network may not be available unless you enable it (see "
35741 "L</guestfs_set_network>)."
35745 #: ../src/guestfs.pod:424
35746 msgid "Only supports Linux guests (not Windows, BSD, etc)."
35750 #: ../src/guestfs.pod:428
35751 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
35755 #: ../src/guestfs.pod:433
35757 "For SELinux guests, you may need to enable SELinux and load policy first. "
35758 "See L</SELINUX> in this manpage."
35762 #: ../src/guestfs.pod:438
35764 "I<Security:> It is not safe to run commands from untrusted, possibly "
35765 "malicious guests. These commands may attempt to exploit your program by "
35766 "sending unexpected output. They could also try to exploit the Linux kernel "
35767 "or qemu provided by the libguestfs appliance. They could use the network "
35768 "provided by the libguestfs appliance to bypass ordinary network partitions "
35769 "and firewalls. They could use the elevated privileges or different SELinux "
35770 "context of your program to their advantage."
35774 #: ../src/guestfs.pod:447
35776 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
35777 "(a script which runs when the guest next boots normally), and to have this "
35778 "script run the commands you want in the normal context of the running guest, "
35779 "network security and so on. For information about other security issues, "
35780 "see L</SECURITY>."
35784 #: ../src/guestfs.pod:455
35786 "The two main API calls to run commands are L</guestfs_command> and "
35787 "L</guestfs_sh> (there are also variations)."
35791 #: ../src/guestfs.pod:458
35793 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
35794 "shell globs, redirections, etc will work."
35798 #: ../src/guestfs.pod:461
35799 msgid "CONFIGURATION FILES"
35803 #: ../src/guestfs.pod:463
35805 "To read and write configuration files in Linux guest filesystems, we "
35806 "strongly recommend using Augeas. For example, Augeas understands how to "
35807 "read and write, say, a Linux shadow password file or X.org configuration "
35808 "file, and so avoids you having to write that code."
35812 #: ../src/guestfs.pod:468
35814 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
35815 "document Augeas itself here because there is excellent documentation on the "
35816 "L<http://augeas.net/> website."
35820 #: ../src/guestfs.pod:472
35822 "If you don't want to use Augeas (you fool!) then try calling "
35823 "L</guestfs_read_lines> to get the file as a list of lines which you can "
35828 #: ../src/guestfs.pod:476
35833 #: ../src/guestfs.pod:478
35835 "We support SELinux guests. To ensure that labeling happens correctly in "
35836 "SELinux guests, you need to enable SELinux and load the guest's policy:"
35840 #: ../src/guestfs.pod:486
35841 msgid "Before launching, do:"
35845 #: ../src/guestfs.pod:488
35848 " guestfs_set_selinux (g, 1);\n"
35853 #: ../src/guestfs.pod:492
35855 "After mounting the guest's filesystem(s), load the policy. This is best "
35856 "done by running the L<load_policy(8)> command in the guest itself:"
35860 #: ../src/guestfs.pod:496
35863 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
35868 #: ../src/guestfs.pod:498
35870 "(Older versions of C<load_policy> require you to specify the name of the "
35875 #: ../src/guestfs.pod:503
35877 "Optionally, set the security context for the API. The correct security "
35878 "context to use can only be known by inspecting the guest. As an example:"
35882 #: ../src/guestfs.pod:507
35885 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
35890 #: ../src/guestfs.pod:511
35891 msgid "This will work for running commands and editing existing files."
35895 #: ../src/guestfs.pod:513
35897 "When new files are created, you may need to label them explicitly, for "
35898 "example by running the external command C<restorecon pathname>."
35902 #: ../src/guestfs.pod:517
35907 #: ../src/guestfs.pod:519
35909 "Certain calls are affected by the current file mode creation mask (the "
35910 "\"umask\"). In particular ones which create files or directories, such as "
35911 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
35912 "either the default mode that the file is created with or modifies the mode "
35917 #: ../src/guestfs.pod:525
35919 "The default umask is C<022>, so files are created with modes such as C<0644> "
35920 "and directories with C<0755>."
35924 #: ../src/guestfs.pod:528
35926 "There are two ways to avoid being affected by umask. Either set umask to 0 "
35927 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
35928 "L</guestfs_chmod> after creating each file or directory."
35932 #: ../src/guestfs.pod:532
35933 msgid "For more information about umask, see L<umask(2)>."
35937 #: ../src/guestfs.pod:536
35939 "Libguestfs allows you to access Linux guests which have been encrypted using "
35940 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
35941 "standard. This includes nearly all whole disk encryption systems used by "
35942 "modern Linux guests."
35946 #: ../src/guestfs.pod:542
35948 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
35949 "returns the string C<crypto_LUKS>)."
35953 #: ../src/guestfs.pod:545
35955 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
35956 "will require the passphrase!"
35960 #: ../src/guestfs.pod:548
35962 "Opening a LUKS device creates a new device mapper device called "
35963 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
35964 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
35965 "decrypted from and encrypted to the underlying block device respectively."
35969 #: ../src/guestfs.pod:554
35971 "LVM volume groups on the device can be made visible by calling "
35972 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
35973 "volume(s) can now be mounted in the usual way."
35977 #: ../src/guestfs.pod:558
35979 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
35980 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
35981 "[\"/dev/VG\"])>. Then close the mapper device by calling "
35982 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
35983 "underlying encrypted block device)."
35987 #: ../src/guestfs.pod:565
35992 #: ../src/guestfs.pod:567
35994 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
35995 "contains operating systems, an install CD or a live CD. (These APIs used to "
35996 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
35997 "version 1.5.3 the most frequently used part of this library has been "
35998 "rewritten in C and moved into the core code)."
36002 #: ../src/guestfs.pod:574
36004 "Add all disks belonging to the unknown virtual machine and call "
36005 "L</guestfs_launch> in the usual way."
36009 #: ../src/guestfs.pod:577
36011 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
36012 "and certain heuristics, and returns a list of operating systems that were "
36013 "found. An empty list means none were found. A single element is the root "
36014 "filesystem of the operating system. For dual- or multi-boot guests, "
36015 "multiple roots can be returned, each one corresponding to a separate "
36016 "operating system. (Multi-boot virtual machines are extremely rare in the "
36017 "world of virtualization, but since this scenario can happen, we have built "
36018 "libguestfs to deal with it.)"
36022 #: ../src/guestfs.pod:586
36024 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
36025 "to get additional details about that operating system. For example, call "
36026 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
36027 "Windows and Linux-based operating systems respectively."
36031 #: ../src/guestfs.pod:592
36033 "Un*x-like and Linux-based operating systems usually consist of several "
36034 "filesystems which are mounted at boot time (for example, a separate boot "
36035 "partition mounted on C</boot>). The inspection rules are able to detect how "
36036 "filesystems correspond to mount points. Call "
36037 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
36038 "hash table like this example:"
36042 #: ../src/guestfs.pod:599
36045 " /boot => /dev/sda1\n"
36046 " / => /dev/vg_guest/lv_root\n"
36047 " /usr => /dev/vg_guest/lv_usr\n"
36052 #: ../src/guestfs.pod:603
36054 "The caller can then make calls to L</guestfs_mount_options> to mount the "
36055 "filesystems as suggested."
36059 #: ../src/guestfs.pod:606
36061 "Be careful to mount filesystems in the right order (eg. C</> before "
36062 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
36067 #: ../src/guestfs.pod:610
36069 "Inspection currently only works for some common operating systems. "
36070 "Contributors are welcome to send patches for other operating systems that we "
36071 "currently cannot detect."
36075 #: ../src/guestfs.pod:614
36077 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
36078 "for more details. The L</guestfs_inspect_os> function just ignores any "
36079 "encrypted devices."
36083 #: ../src/guestfs.pod:618
36085 "A note on the implementation: The call L</guestfs_inspect_os> performs "
36086 "inspection and caches the results in the guest handle. Subsequent calls to "
36087 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
36088 "re-read the disks. If you change the content of the guest disks, you can "
36089 "redo inspection by calling L</guestfs_inspect_os> again. "
36090 "(L</guestfs_inspect_list_applications> works a little differently from the "
36091 "other calls and does read the disks. See documentation for that function "
36096 #: ../src/guestfs.pod:627
36097 msgid "INSPECTING INSTALL DISKS"
36101 #: ../src/guestfs.pod:629
36103 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
36108 #: ../src/guestfs.pod:632
36110 "Call L</guestfs_inspect_get_format> to return the format of the operating "
36111 "system, which currently can be C<installed> (a regular operating system) or "
36112 "C<installer> (some sort of install disk)."
36116 #: ../src/guestfs.pod:636
36118 "Further information is available about the operating system that can be "
36119 "installed using the regular inspection APIs like "
36120 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
36125 #: ../src/guestfs.pod:641
36127 "Some additional information specific to installer disks is also available "
36128 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
36129 "L</guestfs_inspect_is_multipart> calls."
36133 #: ../src/guestfs.pod:646
36134 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
36138 #: ../src/guestfs.pod:648
36140 "Libguestfs can mount NTFS partitions. It does this using the "
36141 "L<http://www.ntfs-3g.org/> driver."
36145 #: ../src/guestfs.pod:651
36146 msgid "DRIVE LETTERS AND PATHS"
36150 #: ../src/guestfs.pod:653
36152 "DOS and Windows still use drive letters, and the filesystems are always "
36153 "treated as case insensitive by Windows itself, and therefore you might find "
36154 "a Windows configuration file referring to a path like "
36155 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
36156 "that directory might be referred to as C</WINDOWS/System32>."
36160 #: ../src/guestfs.pod:659
36162 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
36163 "L</guestfs_inspect_get_drive_mappings>)"
36167 #: ../src/guestfs.pod:662
36169 "Dealing with separator characters (backslash vs forward slash) is outside "
36170 "the scope of libguestfs, but usually a simple character replacement will "
36175 #: ../src/guestfs.pod:666
36177 "To resolve the case insensitivity of paths, call "
36178 "L</guestfs_case_sensitive_path>."
36182 #: ../src/guestfs.pod:669
36183 msgid "ACCESSING THE WINDOWS REGISTRY"
36187 #: ../src/guestfs.pod:671
36189 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
36190 "files, through the library C<hivex> which is part of the libguestfs project "
36191 "although ships as a separate tarball. You have to locate and download the "
36192 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
36193 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
36194 "L<virt-win-reg(1)> for more help on this issue."
36198 #: ../src/guestfs.pod:679
36199 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
36203 #: ../src/guestfs.pod:681
36205 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
36206 "provide something which looks like a Linux symlink. The way it tries to do "
36207 "the rewriting is described here:"
36211 #: ../src/guestfs.pod:685
36212 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
36216 #: ../src/guestfs.pod:687
36218 "The essential problem is that ntfs-3g simply does not have enough "
36219 "information to do a correct job. NTFS links can contain drive letters and "
36220 "references to external device GUIDs that ntfs-3g has no way of resolving. "
36221 "It is almost certainly the case that libguestfs callers should ignore what "
36222 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
36226 #: ../src/guestfs.pod:694
36228 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
36229 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
36230 "attribute, and read the raw reparse data from that (you can find the format "
36231 "documented in various places around the web)."
36235 #: ../src/guestfs.pod:699
36236 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
36240 #: ../src/guestfs.pod:701
36242 "There are other useful extended attributes that can be read from ntfs-3g "
36243 "filesystems (using L</guestfs_getxattr>). See:"
36247 #: ../src/guestfs.pod:704
36248 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
36252 #: ../src/guestfs.pod:706
36253 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
36257 #: ../src/guestfs.pod:708
36259 "Although we don't want to discourage you from using the C API, we will "
36260 "mention here that the same API is also available in other languages."
36264 #: ../src/guestfs.pod:711
36266 "The API is broadly identical in all supported languages. This means that "
36267 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
36268 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
36269 "OCaml. In other words, a straightforward, predictable isomorphism between "
36274 #: ../src/guestfs.pod:717
36276 "Error messages are automatically transformed into exceptions if the language "
36281 #: ../src/guestfs.pod:720
36283 "We don't try to \"object orientify\" parts of the API in OO languages, "
36284 "although contributors are welcome to write higher level APIs above what we "
36285 "provide in their favourite languages if they wish."
36289 #: ../src/guestfs.pod:726
36294 #: ../src/guestfs.pod:728
36296 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
36297 "identical to the C API. C++ classes and exceptions are not used."
36301 #: ../src/guestfs.pod:732
36306 #: ../src/guestfs.pod:734
36308 "The C# bindings are highly experimental. Please read the warnings at the "
36309 "top of C<csharp/Libguestfs.cs>."
36313 #: ../src/guestfs.pod:737
36318 #: ../src/guestfs.pod:739
36319 msgid "See L<guestfs-erlang(3)>."
36323 #: ../src/guestfs.pod:741
36328 #: ../src/guestfs.pod:743
36330 "This is the only language binding that is working but incomplete. Only "
36331 "calls which return simple integers have been bound in Haskell, and we are "
36332 "looking for help to complete this binding."
36336 #: ../src/guestfs.pod:747
36341 #: ../src/guestfs.pod:749
36343 "Full documentation is contained in the Javadoc which is distributed with "
36344 "libguestfs. For examples, see L<guestfs-java(3)>."
36348 #: ../src/guestfs.pod:752
36353 #: ../src/guestfs.pod:754
36354 msgid "See L<guestfs-ocaml(3)>."
36358 #: ../src/guestfs.pod:756
36363 #: ../src/guestfs.pod:758
36364 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
36368 #: ../src/guestfs.pod:760
36373 #: ../src/guestfs.pod:762
36375 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
36376 "the php-libguestfs package for your distribution."
36380 #: ../src/guestfs.pod:765
36381 msgid "The PHP binding only works correctly on 64 bit machines."
36385 #: ../src/guestfs.pod:767
36390 #: ../src/guestfs.pod:769
36391 msgid "See L<guestfs-python(3)>."
36395 #: ../src/guestfs.pod:771
36400 #: ../src/guestfs.pod:773
36401 msgid "See L<guestfs-ruby(3)>."
36405 #: ../src/guestfs.pod:775
36406 msgid "B<shell scripts>"
36410 #: ../src/guestfs.pod:777
36411 msgid "See L<guestfish(1)>."
36415 #: ../src/guestfs.pod:781
36416 msgid "LIBGUESTFS GOTCHAS"
36420 #: ../src/guestfs.pod:783
36422 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
36423 "system [...] that works in the way it is documented but is counterintuitive "
36424 "and almost invites mistakes.\""
36428 #: ../src/guestfs.pod:787
36430 "Since we developed libguestfs and the associated tools, there are several "
36431 "things we would have designed differently, but are now stuck with for "
36432 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
36433 "release, you can expect these to change. Beware of them."
36437 #: ../src/guestfs.pod:795
36438 msgid "Autosync / forgetting to sync."
36442 #: ../src/guestfs.pod:797
36444 "I<Update:> Autosync is enabled by default for all API users starting from "
36445 "libguestfs 1.5.24. This section only applies to older versions."
36449 #: ../src/guestfs.pod:800
36451 "When modifying a filesystem from C or another language, you B<must> unmount "
36452 "all filesystems and call L</guestfs_sync> explicitly before you close the "
36453 "libguestfs handle. You can also call:"
36457 #: ../src/guestfs.pod:804
36460 " guestfs_set_autosync (g, 1);\n"
36465 #: ../src/guestfs.pod:806
36467 "to have the unmount/sync done automatically for you when the handle 'g' is "
36468 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
36473 #: ../src/guestfs.pod:810
36475 "If you forget to do this, then it is entirely possible that your changes "
36476 "won't be written out, or will be partially written, or (very rarely) that "
36477 "you'll get disk corruption."
36481 #: ../src/guestfs.pod:814
36483 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
36484 "guestfish scripts that forget to sync will work just fine, which can make "
36485 "this very puzzling if you are trying to debug a problem."
36489 #: ../src/guestfs.pod:818
36490 msgid "Mount option C<-o sync> should not be the default."
36494 #: ../src/guestfs.pod:820
36496 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
36497 "libguestfs 1.13.16. This section only applies to older versions."
36501 #: ../src/guestfs.pod:823
36503 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
36504 "However C<-o sync> does not add any reliability benefit, but does have a "
36505 "very large performance impact."
36509 #: ../src/guestfs.pod:827
36511 "The work around is to use L</guestfs_mount_options> and set the mount "
36512 "options that you actually want to use."
36516 #: ../src/guestfs.pod:830
36517 msgid "Read-only should be the default."
36521 #: ../src/guestfs.pod:832
36523 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
36524 "specify I<--rw> if you want to make changes to the image."
36528 #: ../src/guestfs.pod:835
36529 msgid "This would reduce the potential to corrupt live VM images."
36533 #: ../src/guestfs.pod:837
36535 "Note that many filesystems change the disk when you just mount and unmount, "
36536 "even if you didn't perform any writes. You need to use "
36537 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
36541 #: ../src/guestfs.pod:841
36542 msgid "guestfish command line is hard to use."
36546 #: ../src/guestfs.pod:843
36548 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
36549 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
36550 "exist, so it fails. In earlier versions of guestfish the error message was "
36551 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
36552 "we should have used C<guestfish -c command> to run commands."
36556 #: ../src/guestfs.pod:850
36557 msgid "guestfish megabyte modifiers don't work right on all commands"
36561 #: ../src/guestfs.pod:852
36563 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
36564 "other modifiers). What guestfish actually does is to multiply the number "
36565 "part by the modifier part and pass the result to the C API. However this "
36566 "doesn't work for a few APIs which aren't expecting bytes, but are already "
36567 "expecting some other unit (eg. megabytes)."
36571 #: ../src/guestfs.pod:859
36572 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
36576 #: ../src/guestfs.pod:861
36579 " lvcreate LV VG 100M\n"
36584 #: ../src/guestfs.pod:863
36586 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
36587 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
36588 "megabytes * megabytes) logical volume. The error message you get from this "
36589 "is also a little obscure."
36593 #: ../src/guestfs.pod:868
36595 "This could be fixed in the generator by specially marking parameters and "
36596 "return values which take bytes or other units."
36600 #: ../src/guestfs.pod:871
36601 msgid "Ambiguity between devices and paths"
36605 #: ../src/guestfs.pod:873
36607 "There is a subtle ambiguity in the API between a device name "
36608 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
36609 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
36613 #: ../src/guestfs.pod:878
36615 "In the current API we usually resolve this ambiguity by having two separate "
36616 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
36617 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
36618 "detecting if the path supplied begins with C</dev/>."
36622 #: ../src/guestfs.pod:884
36624 "To avoid both the ambiguity and the need to duplicate some calls, we could "
36625 "make paths/devices into structured names. One way to do this would be to "
36626 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
36627 "aspect of grub. Another way would be to use a structured type, equivalent "
36628 "to this OCaml type:"
36632 #: ../src/guestfs.pod:890
36635 " type path = Path of string | Device of int | Partition of int * int\n"
36640 #: ../src/guestfs.pod:892
36641 msgid "which would allow you to pass arguments like:"
36645 #: ../src/guestfs.pod:894
36648 " Path \"/foo/bar\"\n"
36649 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
36650 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
36651 " Path \"/dev/sdb2\" (* not a device *)\n"
36656 #: ../src/guestfs.pod:899
36658 "As you can see there are still problems to resolve even with this "
36659 "representation. Also consider how it might work in guestfish."
36663 #: ../src/guestfs.pod:904
36664 msgid "KEYS AND PASSPHRASES"
36668 #: ../src/guestfs.pod:906
36670 "Certain libguestfs calls take a parameter that contains sensitive key "
36671 "material, passed in as a C string."
36675 #: ../src/guestfs.pod:909
36677 "In the future we would hope to change the libguestfs implementation so that "
36678 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
36679 "swap. However this is I<not> done at the moment, because of the complexity "
36680 "of such an implementation."
36684 #: ../src/guestfs.pod:914
36686 "Therefore you should be aware that any key parameter you pass to libguestfs "
36687 "might end up being written out to the swap partition. If this is a concern, "
36688 "scrub the swap partition or don't use libguestfs on encrypted devices."
36692 #: ../src/guestfs.pod:919
36693 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
36697 #: ../src/guestfs.pod:921
36699 "All high-level libguestfs actions are synchronous. If you want to use "
36700 "libguestfs asynchronously then you must create a thread."
36704 #: ../src/guestfs.pod:924
36706 "Only use the handle from a single thread. Either use the handle exclusively "
36707 "from one thread, or provide your own mutex so that two threads cannot issue "
36708 "calls on the same handle at the same time."
36712 #: ../src/guestfs.pod:928
36714 "See the graphical program guestfs-browser for one possible architecture for "
36715 "multithreaded programs using libvirt and libguestfs."
36719 #: ../src/guestfs.pod:931
36724 #: ../src/guestfs.pod:933
36726 "Libguestfs needs a supermin appliance, which it finds by looking along an "
36731 #: ../src/guestfs.pod:936
36733 "By default it looks for these in the directory C<$libdir/guestfs> "
36734 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
36738 #: ../src/guestfs.pod:939
36740 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
36741 "to change the directories that libguestfs will search in. The value is a "
36742 "colon-separated list of paths. The current directory is I<not> searched "
36743 "unless the path contains an empty element or C<.>. For example "
36744 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
36745 "then C</usr/lib/guestfs>."
36749 #: ../src/guestfs.pod:946
36750 msgid "QEMU WRAPPERS"
36754 #: ../src/guestfs.pod:948
36756 "If you want to compile your own qemu, run qemu from a non-standard location, "
36757 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
36762 #: ../src/guestfs.pod:952
36764 "There is one important rule to remember: you I<must C<exec qemu>> as the "
36765 "last command in the shell script (so that qemu replaces the shell and "
36766 "becomes the direct child of the libguestfs-using program). If you don't do "
36767 "this, then the qemu process won't be cleaned up correctly."
36771 #: ../src/guestfs.pod:957
36773 "Here is an example of a wrapper, where I have built my own copy of qemu from "
36778 #: ../src/guestfs.pod:960
36782 " qemudir=/home/rjones/d/qemu\n"
36783 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
36789 #: ../src/guestfs.pod:964
36791 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
36792 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
36797 #: ../src/guestfs.pod:968
36800 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
36805 #: ../src/guestfs.pod:970
36807 "Note that libguestfs also calls qemu with the -help and -version options in "
36808 "order to determine features."
36812 #: ../src/guestfs.pod:973
36814 "Wrappers can also be used to edit the options passed to qemu. In the "
36815 "following example, the C<-machine ...> option (C<-machine> and the following "
36816 "argument) are removed from the command line and replaced with C<-machine "
36817 "pc,accel=tcg>. The while loop iterates over the options until it finds the "
36818 "right one to remove, putting the remaining options into the C<args> array."
36822 #: ../src/guestfs.pod:982
36826 " while [ $# -gt 0 ]; do\n"
36827 " case \"$1\" in\n"
36831 " args[i]=\"$1\"\n"
36840 #: ../src/guestfs.pod:994
36843 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
36848 #: ../src/guestfs.pod:996
36849 msgid "ATTACHING TO RUNNING DAEMONS"
36853 #: ../src/guestfs.pod:998
36855 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
36856 "babies. Use with caution."
36860 #: ../src/guestfs.pod:1001
36862 "I<Note (2):> This section explains how to attach to a running daemon from a "
36863 "low level perspective. For most users, simply using virt tools such as "
36864 "L<guestfish(1)> with the I<--live> option will \"just work\"."
36868 #: ../src/guestfs.pod:1005
36869 msgid "Using guestfs_set_attach_method"
36873 #: ../src/guestfs.pod:1007
36875 "By calling L</guestfs_set_attach_method> you can change how the library "
36876 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
36877 "L</ARCHITECTURE> for some background)."
36881 #: ../src/guestfs.pod:1011
36883 "The normal attach method is C<appliance>, where a small appliance is created "
36884 "containing the daemon, and then the library connects to this."
36888 #: ../src/guestfs.pod:1014
36890 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
36891 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
36892 "daemon over the Unix domain socket."
36896 #: ../src/guestfs.pod:1018
36898 "The normal use for this is to connect to a running virtual machine that "
36899 "contains a C<guestfsd> daemon, and send commands so you can read and write "
36900 "files inside the live virtual machine."
36904 #: ../src/guestfs.pod:1022
36905 msgid "Using guestfs_add_domain with live flag"
36909 #: ../src/guestfs.pod:1024
36911 "L</guestfs_add_domain> provides some help for getting the correct attach "
36912 "method. If you pass the C<live> option to this function, then (if the "
36913 "virtual machine is running) it will examine the libvirt XML looking for a "
36914 "virtio-serial channel to connect to:"
36918 #: ../src/guestfs.pod:1030
36925 " <channel type='unix'>\n"
36926 " <source mode='bind' path='/path/to/socket'/>\n"
36927 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
36936 #: ../src/guestfs.pod:1042
36938 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
36939 "method to C<unix:/path/to/socket>."
36943 #: ../src/guestfs.pod:1045
36945 "Some of the libguestfs tools (including guestfish) support a I<--live> "
36946 "option which is passed through to L</guestfs_add_domain> thus allowing you "
36947 "to attach to and modify live virtual machines."
36951 #: ../src/guestfs.pod:1049
36953 "The virtual machine needs to have been set up beforehand so that it has the "
36954 "virtio-serial channel and so that guestfsd is running inside it."
36958 #: ../src/guestfs.pod:1053
36959 msgid "ABI GUARANTEE"
36963 #: ../src/guestfs.pod:1055
36965 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
36966 "actions as outlined in this section. Although we will deprecate some "
36967 "actions, for example if they get replaced by newer calls, we will keep the "
36968 "old actions forever. This allows you the developer to program in confidence "
36969 "against the libguestfs API."
36973 #: ../src/guestfs.pod:1061
36974 msgid "BLOCK DEVICE NAMING"
36978 #: ../src/guestfs.pod:1063
36980 "In the kernel there is now quite a profusion of schemata for naming block "
36981 "devices (in this context, by I<block device> I mean a physical or virtual "
36982 "hard drive). The original Linux IDE driver used names starting with "
36983 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
36984 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
36985 "replacement for the old IDE driver (particularly for SATA devices) those "
36986 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
36987 "machines with paravirtualized drivers. This has created several different "
36988 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
36993 #: ../src/guestfs.pod:1075
36995 "As discussed above, libguestfs uses a qemu appliance running an embedded "
36996 "Linux kernel to access block devices. We can run a variety of appliances "
36997 "based on a variety of Linux kernels."
37001 #: ../src/guestfs.pod:1079
37003 "This causes a problem for libguestfs because many API calls use device or "
37004 "partition names. Working scripts and the recipe (example) scripts that we "
37005 "make available over the internet could fail if the naming scheme changes."
37009 #: ../src/guestfs.pod:1084
37011 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
37012 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
37013 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
37014 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
37018 #: ../src/guestfs.pod:1090
37020 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
37021 "L</guestfs_list_partitions> and similar calls return the true names of the "
37022 "devices and partitions as known to the appliance."
37026 #: ../src/guestfs.pod:1095
37027 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
37031 #: ../src/guestfs.pod:1097
37033 "Usually this translation is transparent. However in some (very rare) cases "
37034 "you may need to know the exact algorithm. Such cases include where you use "
37035 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
37036 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
37041 #: ../src/guestfs.pod:1103
37043 "The algorithm is applied only to I<parameters> which are known to be either "
37044 "device or partition names. Return values from functions such as "
37045 "L</guestfs_list_devices> are never changed."
37049 #: ../src/guestfs.pod:1111
37050 msgid "Is the string a parameter which is a device or partition name?"
37054 #: ../src/guestfs.pod:1115
37055 msgid "Does the string begin with C</dev/sd>?"
37059 #: ../src/guestfs.pod:1119
37061 "Does the named device exist? If so, we use that device. However if I<not> "
37062 "then we continue with this algorithm."
37066 #: ../src/guestfs.pod:1124
37067 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
37071 #: ../src/guestfs.pod:1126
37072 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
37076 #: ../src/guestfs.pod:1128
37077 msgid "If that named device exists, use it. If not, continue."
37081 #: ../src/guestfs.pod:1132
37082 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
37086 #: ../src/guestfs.pod:1134
37087 msgid "If that named device exists, use it. If not, return an error."
37091 #: ../src/guestfs.pod:1138
37092 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
37096 #: ../src/guestfs.pod:1140
37098 "Although the standard naming scheme and automatic translation is useful for "
37099 "simple programs and guestfish scripts, for larger programs it is best not to "
37100 "rely on this mechanism."
37104 #: ../src/guestfs.pod:1144
37106 "Where possible for maximum future portability programs using libguestfs "
37107 "should use these future-proof techniques:"
37111 #: ../src/guestfs.pod:1151
37113 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
37114 "device names, and then use those names directly."
37118 #: ../src/guestfs.pod:1154
37119 msgid "Since those device names exist by definition, they will never be translated."
37123 #: ../src/guestfs.pod:1159
37125 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
37126 "filesystem labels."
37130 #: ../src/guestfs.pod:1166
37132 "This section discusses security implications of using libguestfs, "
37133 "particularly with untrusted or malicious guests or disk images."
37137 #: ../src/guestfs.pod:1169
37138 msgid "GENERAL SECURITY CONSIDERATIONS"
37142 #: ../src/guestfs.pod:1171
37144 "Be careful with any files or data that you download from a guest (by "
37145 "\"download\" we mean not just the L</guestfs_download> command but any "
37146 "command that reads files, filenames, directories or anything else from a "
37147 "disk image). An attacker could manipulate the data to fool your program "
37148 "into doing the wrong thing. Consider cases such as:"
37152 #: ../src/guestfs.pod:1181
37153 msgid "the data (file etc) not being present"
37157 #: ../src/guestfs.pod:1185
37158 msgid "being present but empty"
37162 #: ../src/guestfs.pod:1189
37163 msgid "being much larger than normal"
37167 #: ../src/guestfs.pod:1193
37168 msgid "containing arbitrary 8 bit data"
37172 #: ../src/guestfs.pod:1197
37173 msgid "being in an unexpected character encoding"
37177 #: ../src/guestfs.pod:1201
37178 msgid "containing homoglyphs."
37182 #: ../src/guestfs.pod:1205
37183 msgid "SECURITY OF MOUNTING FILESYSTEMS"
37187 #: ../src/guestfs.pod:1207
37189 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
37190 "(VFS) module can sometimes be escalated into exploits by deliberately "
37191 "creating a malicious, malformed filesystem. These exploits are very severe "
37192 "for two reasons. Firstly there are very many filesystem drivers in the "
37193 "kernel, and many of them are infrequently used and not much developer "
37194 "attention has been paid to the code. Linux userspace helps potential "
37195 "crackers by detecting the filesystem type and automatically choosing the "
37196 "right VFS driver, even if that filesystem type is obscure or unexpected for "
37197 "the administrator. Secondly, a kernel-level exploit is like a local root "
37198 "exploit (worse in some ways), giving immediate and total access to the "
37199 "system right down to the hardware level."
37203 #: ../src/guestfs.pod:1220
37205 "That explains why you should never mount a filesystem from an untrusted "
37206 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
37207 "inside a qemu virtual machine, usually running as a non-root user. The "
37208 "attacker would need to write a filesystem which first exploited the kernel, "
37209 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
37210 "the libguestfs protocol, and finally to be as serious as the host kernel "
37211 "exploit it would need to escalate its privileges to root. This multi-step "
37212 "escalation, performed by a static piece of data, is thought to be extremely "
37213 "hard to do, although we never say 'never' about security issues."
37217 #: ../src/guestfs.pod:1231
37219 "In any case callers can reduce the attack surface by forcing the filesystem "
37220 "type when mounting (use L</guestfs_mount_vfs>)."
37224 #: ../src/guestfs.pod:1234
37225 msgid "PROTOCOL SECURITY"
37229 #: ../src/guestfs.pod:1236
37231 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
37232 "defined upper message size. However a program that uses libguestfs must "
37233 "also take care - for example you can write a program that downloads a binary "
37234 "from a disk image and executes it locally, and no amount of protocol "
37235 "security will save you from the consequences."
37239 #: ../src/guestfs.pod:1242
37240 msgid "INSPECTION SECURITY"
37244 #: ../src/guestfs.pod:1244
37246 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
37247 "directly from the guest, and these could contain any 8 bit data. Callers "
37248 "should be careful to escape these before printing them to a structured file "
37249 "(for example, use HTML escaping if creating a web page)."
37253 #: ../src/guestfs.pod:1250
37255 "Guest configuration may be altered in unusual ways by the administrator of "
37256 "the virtual machine, and may not reflect reality (particularly for untrusted "
37257 "or actively malicious guests). For example we parse the hostname from "
37258 "configuration files like C</etc/sysconfig/network> that we find in the "
37259 "guest, but the guest administrator can easily manipulate these files to "
37260 "provide the wrong hostname."
37264 #: ../src/guestfs.pod:1258
37266 "The inspection API parses guest configuration using two external libraries: "
37267 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
37268 "designed to be robust in the face of malicious data, although denial of "
37269 "service attacks are still possible, for example with oversized configuration "
37274 #: ../src/guestfs.pod:1264
37275 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
37279 #: ../src/guestfs.pod:1266
37281 "Be very cautious about running commands from the guest. By running a "
37282 "command in the guest, you are giving CPU time to a binary that you do not "
37283 "control, under the same user account as the library, albeit wrapped in qemu "
37284 "virtualization. More information and alternatives can be found in the "
37285 "section L</RUNNING COMMANDS>."
37289 #: ../src/guestfs.pod:1272
37290 msgid "CVE-2010-3851"
37294 #: ../src/guestfs.pod:1274
37295 msgid "https://bugzilla.redhat.com/642934"
37299 #: ../src/guestfs.pod:1276
37301 "This security bug concerns the automatic disk format detection that qemu "
37302 "does on disk images."
37306 #: ../src/guestfs.pod:1279
37308 "A raw disk image is just the raw bytes, there is no header. Other disk "
37309 "images like qcow2 contain a special header. Qemu deals with this by looking "
37310 "for one of the known headers, and if none is found then assuming the disk "
37311 "image must be raw."
37315 #: ../src/guestfs.pod:1284
37317 "This allows a guest which has been given a raw disk image to write some "
37318 "other header. At next boot (or when the disk image is accessed by "
37319 "libguestfs) qemu would do autodetection and think the disk image format was, "
37320 "say, qcow2 based on the header written by the guest."
37324 #: ../src/guestfs.pod:1289
37326 "This in itself would not be a problem, but qcow2 offers many features, one "
37327 "of which is to allow a disk image to refer to another image (called the "
37328 "\"backing disk\"). It does this by placing the path to the backing disk "
37329 "into the qcow2 header. This path is not validated and could point to any "
37330 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
37331 "\"holes\" in the qcow2 disk image, which of course is completely under the "
37332 "control of the attacker."
37336 #: ../src/guestfs.pod:1297
37337 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
37341 #: ../src/guestfs.pod:1304
37342 msgid "You have enabled the network or have opened the disk in write mode."
37346 #: ../src/guestfs.pod:1308
37348 "You are also running untrusted code from the guest (see L</RUNNING "
37353 #: ../src/guestfs.pod:1313
37355 "The way to avoid this is to specify the expected disk format when adding "
37356 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
37357 "should always do this if the disk is raw format, and it's a good idea for "
37362 #: ../src/guestfs.pod:1318
37364 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
37365 "format is fetched from libvirt and passed through."
37369 #: ../src/guestfs.pod:1321
37371 "For libguestfs tools, use the I<--format> command line parameter as "
37376 #: ../src/guestfs.pod:1324
37377 msgid "CONNECTION MANAGEMENT"
37381 #: ../src/guestfs.pod:1326
37382 msgid "guestfs_h *"
37386 #: ../src/guestfs.pod:1328
37388 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
37389 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
37390 "handle and release all resources used."
37394 #: ../src/guestfs.pod:1332
37396 "For information on using multiple handles and threads, see the section "
37397 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
37401 #: ../src/guestfs.pod:1335
37402 msgid "guestfs_create"
37406 #: ../src/guestfs.pod:1337
37409 " guestfs_h *guestfs_create (void);\n"
37414 #: ../src/guestfs.pod:1339
37415 msgid "Create a connection handle."
37419 #: ../src/guestfs.pod:1341
37421 "On success this returns a non-NULL pointer to a handle. On error it returns "
37426 #: ../src/guestfs.pod:1344
37428 "You have to \"configure\" the handle after creating it. This includes "
37429 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
37430 "handle at least once."
37434 #: ../src/guestfs.pod:1348
37435 msgid "After configuring the handle, you have to call L</guestfs_launch>."
37439 #: ../src/guestfs.pod:1350
37441 "You may also want to configure error handling for the handle. See the "
37442 "L</ERROR HANDLING> section below."
37446 #: ../src/guestfs.pod:1353
37447 msgid "guestfs_close"
37451 #: ../src/guestfs.pod:1355
37454 " void guestfs_close (guestfs_h *g);\n"
37459 #: ../src/guestfs.pod:1357
37460 msgid "This closes the connection handle and frees up all resources used."
37464 #: ../src/guestfs.pod:1359
37466 "If autosync was set on the handle and the handle was launched, then this "
37467 "implicitly calls various functions to unmount filesystems and sync the "
37468 "disk. See L</guestfs_set_autosync> for more details."
37472 #: ../src/guestfs.pod:1363
37473 msgid "If a close callback was set on the handle, then it is called."
37477 #: ../src/guestfs.pod:1365
37478 msgid "ERROR HANDLING"
37482 #: ../src/guestfs.pod:1367
37484 "API functions can return errors. For example, almost all functions that "
37485 "return C<int> will return C<-1> to indicate an error."
37489 #: ../src/guestfs.pod:1370
37491 "Additional information is available for errors: an error message string and "
37492 "optionally an error number (errno) if the thing that failed was a system "
37497 #: ../src/guestfs.pod:1374
37499 "You can get at the additional information about the last error on the handle "
37500 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
37501 "up an error handler with L</guestfs_set_error_handler>."
37505 #: ../src/guestfs.pod:1379
37507 "When the handle is created, a default error handler is installed which "
37508 "prints the error message string to C<stderr>. For small short-running "
37509 "command line programs it is sufficient to do:"
37513 #: ../src/guestfs.pod:1383
37516 " if (guestfs_launch (g) == -1)\n"
37517 " exit (EXIT_FAILURE);\n"
37522 #: ../src/guestfs.pod:1386
37524 "since the default error handler will ensure that an error message has been "
37525 "printed to C<stderr> before the program exits."
37529 #: ../src/guestfs.pod:1389
37531 "For other programs the caller will almost certainly want to install an "
37532 "alternate error handler or do error handling in-line like this:"
37536 #: ../src/guestfs.pod:1392
37539 " /* This disables the default behaviour of printing errors\n"
37541 " guestfs_set_error_handler (g, NULL, NULL);\n"
37546 #: ../src/guestfs.pod:1396
37549 " if (guestfs_launch (g) == -1) {\n"
37550 " /* Examine the error message and print it etc. */\n"
37551 " char *msg = guestfs_last_error (g);\n"
37552 " int errnum = guestfs_last_errno (g);\n"
37553 " fprintf (stderr, \"%s\", msg);\n"
37554 " if (errnum != 0)\n"
37555 " fprintf (stderr, \": %s\", strerror (errnum));\n"
37556 " fprintf (stderr, \"\\n\");\n"
37563 #: ../src/guestfs.pod:1407
37565 "Out of memory errors are handled differently. The default action is to call "
37566 "L<abort(3)>. If this is undesirable, then you can set a handler using "
37567 "L</guestfs_set_out_of_memory_handler>."
37571 #: ../src/guestfs.pod:1411
37573 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
37574 "because there is no handle if this happens there is no way to get additional "
37575 "error information. However L</guestfs_create> is supposed to be a "
37576 "lightweight operation which can only fail because of insufficient memory (it "
37577 "returns NULL in this case)."
37581 #: ../src/guestfs.pod:1417
37582 msgid "guestfs_last_error"
37586 #: ../src/guestfs.pod:1419
37589 " const char *guestfs_last_error (guestfs_h *g);\n"
37594 #: ../src/guestfs.pod:1421
37596 "This returns the last error message that happened on C<g>. If there has not "
37597 "been an error since the handle was created, then this returns C<NULL>."
37601 #: ../src/guestfs.pod:1425
37603 "The lifetime of the returned string is until the next error occurs, or "
37604 "L</guestfs_close> is called."
37608 #: ../src/guestfs.pod:1428
37609 msgid "guestfs_last_errno"
37613 #: ../src/guestfs.pod:1430
37616 " int guestfs_last_errno (guestfs_h *g);\n"
37621 #: ../src/guestfs.pod:1432
37622 msgid "This returns the last error number (errno) that happened on C<g>."
37626 #: ../src/guestfs.pod:1434
37627 msgid "If successful, an errno integer not equal to zero is returned."
37631 #: ../src/guestfs.pod:1436
37632 msgid "If no error, this returns 0. This call can return 0 in three situations:"
37636 #: ../src/guestfs.pod:1443
37637 msgid "There has not been any error on the handle."
37641 #: ../src/guestfs.pod:1447
37643 "There has been an error but the errno was meaningless. This corresponds to "
37644 "the case where the error did not come from a failed system call, but for "
37645 "some other reason."
37649 #: ../src/guestfs.pod:1453
37651 "There was an error from a failed system call, but for some reason the errno "
37652 "was not captured and returned. This usually indicates a bug in libguestfs."
37656 #: ../src/guestfs.pod:1459
37658 "Libguestfs tries to convert the errno from inside the applicance into a "
37659 "corresponding errno for the caller (not entirely trivial: the appliance "
37660 "might be running a completely different operating system from the library "
37661 "and error numbers are not standardized across Un*xen). If this could not be "
37662 "done, then the error is translated to C<EINVAL>. In practice this should "
37663 "only happen in very rare circumstances."
37667 #: ../src/guestfs.pod:1467
37668 msgid "guestfs_set_error_handler"
37672 #: ../src/guestfs.pod:1469
37675 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
37677 " const char *msg);\n"
37678 " void guestfs_set_error_handler (guestfs_h *g,\n"
37679 " guestfs_error_handler_cb cb,\n"
37680 " void *opaque);\n"
37685 #: ../src/guestfs.pod:1476
37687 "The callback C<cb> will be called if there is an error. The parameters "
37688 "passed to the callback are an opaque data pointer and the error message "
37693 #: ../src/guestfs.pod:1480
37695 "C<errno> is not passed to the callback. To get that the callback must call "
37696 "L</guestfs_last_errno>."
37700 #: ../src/guestfs.pod:1483
37702 "Note that the message string C<msg> is freed as soon as the callback "
37703 "function returns, so if you want to stash it somewhere you must make your "
37708 #: ../src/guestfs.pod:1487
37709 msgid "The default handler prints messages on C<stderr>."
37713 #: ../src/guestfs.pod:1489
37714 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
37718 #: ../src/guestfs.pod:1491
37719 msgid "guestfs_get_error_handler"
37723 #: ../src/guestfs.pod:1493
37726 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
37727 " void **opaque_rtn);\n"
37732 #: ../src/guestfs.pod:1496
37733 msgid "Returns the current error handler callback."
37737 #: ../src/guestfs.pod:1498
37738 msgid "guestfs_set_out_of_memory_handler"
37742 #: ../src/guestfs.pod:1500
37745 " typedef void (*guestfs_abort_cb) (void);\n"
37746 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
37747 " guestfs_abort_cb);\n"
37752 #: ../src/guestfs.pod:1504
37754 "The callback C<cb> will be called if there is an out of memory situation. "
37755 "I<Note this callback must not return>."
37759 #: ../src/guestfs.pod:1507
37760 msgid "The default is to call L<abort(3)>."
37764 #: ../src/guestfs.pod:1509
37765 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
37769 #: ../src/guestfs.pod:1512
37770 msgid "guestfs_get_out_of_memory_handler"
37774 #: ../src/guestfs.pod:1514
37777 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
37782 #: ../src/guestfs.pod:1516
37783 msgid "This returns the current out of memory handler."
37787 #: ../src/guestfs.pod:1518
37792 #: ../src/guestfs.pod:1522
37797 #: ../src/guestfs.pod:1524
37802 #: ../src/guestfs.pod:1526
37803 msgid "AVAILABILITY"
37807 #: ../src/guestfs.pod:1528
37808 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
37812 #: ../src/guestfs.pod:1530
37814 "Using L</guestfs_available> you can test availability of the following "
37815 "groups of functions. This test queries the appliance to see if the "
37816 "appliance you are currently using supports the functionality."
37820 #: ../src/guestfs.pod:1535
37821 msgid "@AVAILABILITY@"
37825 #: ../src/guestfs.pod:1537
37826 msgid "GUESTFISH supported COMMAND"
37830 #: ../src/guestfs.pod:1539
37832 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
37833 "prints out the available groups and whether they are supported by this build "
37834 "of libguestfs. Note however that you have to do C<run> first."
37838 #: ../src/guestfs.pod:1544
37839 msgid "SINGLE CALLS AT COMPILE TIME"
37843 #: ../src/guestfs.pod:1546
37845 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
37846 "function, such as:"
37850 #: ../src/guestfs.pod:1549
37853 " #define LIBGUESTFS_HAVE_DD 1\n"
37858 #: ../src/guestfs.pod:1551
37859 msgid "if L</guestfs_dd> is available."
37863 #: ../src/guestfs.pod:1553
37865 "Before version 1.5.8, if you needed to test whether a single libguestfs "
37866 "function is available at compile time, we recommended using build tools such "
37867 "as autoconf or cmake. For example in autotools you could use:"
37871 #: ../src/guestfs.pod:1558
37874 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
37875 " AC_CHECK_FUNCS([guestfs_dd])\n"
37880 #: ../src/guestfs.pod:1561
37882 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
37887 #: ../src/guestfs.pod:1564
37888 msgid "SINGLE CALLS AT RUN TIME"
37892 #: ../src/guestfs.pod:1566
37894 "Testing at compile time doesn't guarantee that a function really exists in "
37895 "the library. The reason is that you might be dynamically linked against a "
37896 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
37897 "This situation unfortunately results in a segmentation fault, which is a "
37898 "shortcoming of the C dynamic linking system itself."
37902 #: ../src/guestfs.pod:1573
37904 "You can use L<dlopen(3)> to test if a function is available at run time, as "
37905 "in this example program (note that you still need the compile time check as "
37910 #: ../src/guestfs.pod:1577
37913 " #include <stdio.h>\n"
37914 " #include <stdlib.h>\n"
37915 " #include <unistd.h>\n"
37916 " #include <dlfcn.h>\n"
37917 " #include <guestfs.h>\n"
37922 #: ../src/guestfs.pod:1583
37927 " #ifdef LIBGUESTFS_HAVE_DD\n"
37929 " int has_function;\n"
37934 #: ../src/guestfs.pod:1589
37937 " /* Test if the function guestfs_dd is really available. */\n"
37938 " dl = dlopen (NULL, RTLD_LAZY);\n"
37940 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
37941 " exit (EXIT_FAILURE);\n"
37943 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
37949 #: ../src/guestfs.pod:1598
37952 " if (!has_function)\n"
37953 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
37955 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
37956 " /* Now it's safe to call\n"
37957 " guestfs_dd (g, \"foo\", \"bar\");\n"
37961 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
37968 #: ../src/guestfs.pod:1611
37970 "You may think the above is an awful lot of hassle, and it is. There are "
37971 "other ways outside of the C linking system to ensure that this kind of "
37972 "incompatibility never arises, such as using package versioning:"
37976 #: ../src/guestfs.pod:1616
37979 " Requires: libguestfs >= 1.0.80\n"
37984 #: ../src/guestfs.pod:1618
37985 msgid "CALLS WITH OPTIONAL ARGUMENTS"
37989 #: ../src/guestfs.pod:1620
37991 "A recent feature of the API is the introduction of calls which take optional "
37992 "arguments. In C these are declared 3 ways. The main way is as a call which "
37993 "takes variable arguments (ie. C<...>), as in this example:"
37997 #: ../src/guestfs.pod:1625
38000 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
38005 #: ../src/guestfs.pod:1627
38007 "Call this with a list of optional arguments, terminated by C<-1>. So to "
38008 "call with no optional arguments specified:"
38012 #: ../src/guestfs.pod:1630
38015 " guestfs_add_drive_opts (g, filename, -1);\n"
38020 #: ../src/guestfs.pod:1632
38021 msgid "With a single optional argument:"
38025 #: ../src/guestfs.pod:1634
38028 " guestfs_add_drive_opts (g, filename,\n"
38029 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
38035 #: ../src/guestfs.pod:1638
38040 #: ../src/guestfs.pod:1640
38043 " guestfs_add_drive_opts (g, filename,\n"
38044 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
38045 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
38051 #: ../src/guestfs.pod:1645
38053 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
38058 #: ../src/guestfs.pod:1648
38059 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
38063 #: ../src/guestfs.pod:1650
38065 "The second variant has the same name with the suffix C<_va>, which works the "
38066 "same way but takes a C<va_list>. See the C manual for details. For the "
38067 "example function, this is declared:"
38071 #: ../src/guestfs.pod:1654
38074 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
38075 " va_list args);\n"
38080 #: ../src/guestfs.pod:1657
38081 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
38085 #: ../src/guestfs.pod:1659
38087 "The third variant is useful where you need to construct these calls. You "
38088 "pass in a structure where you fill in the optional fields. The structure "
38089 "has a bitmask as the first element which you must set to indicate which "
38090 "fields you have filled in. For our example function the structure and call "
38095 #: ../src/guestfs.pod:1665
38098 " struct guestfs_add_drive_opts_argv {\n"
38099 " uint64_t bitmask;\n"
38101 " const char *format;\n"
38104 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
38105 " const struct guestfs_add_drive_opts_argv *optargs);\n"
38110 #: ../src/guestfs.pod:1674
38111 msgid "You could call it like this:"
38115 #: ../src/guestfs.pod:1676
38118 " struct guestfs_add_drive_opts_argv optargs = {\n"
38119 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
38120 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
38121 " .readonly = 1,\n"
38122 " .format = \"qcow2\"\n"
38128 #: ../src/guestfs.pod:1683
38131 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
38136 #: ../src/guestfs.pod:1691
38137 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
38141 #: ../src/guestfs.pod:1696
38142 msgid "You do not need to fill in all fields of the structure."
38146 #: ../src/guestfs.pod:1700
38148 "There must be a one-to-one correspondence between fields of the structure "
38149 "that are filled in, and bits set in the bitmask."
38153 #: ../src/guestfs.pod:1705
38154 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
38158 #: ../src/guestfs.pod:1707
38160 "In other languages, optional arguments are expressed in the way that is "
38161 "natural for that language. We refer you to the language-specific "
38162 "documentation for more details on that."
38166 #: ../src/guestfs.pod:1711
38167 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
38171 #: ../src/guestfs.pod:1713
38172 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
38176 #: ../src/guestfs.pod:1715
38178 "B<Note:> This section documents the generic event mechanism introduced in "
38179 "libguestfs 1.10, which you should use in new code if possible. The old "
38180 "functions C<guestfs_set_log_message_callback>, "
38181 "C<guestfs_set_subprocess_quit_callback>, "
38182 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
38183 "C<guestfs_set_progress_callback> are no longer documented in this manual "
38184 "page. Because of the ABI guarantee, the old functions continue to work."
38188 #: ../src/guestfs.pod:1724
38190 "Handles generate events when certain things happen, such as log messages "
38191 "being generated, progress messages during long-running operations, or the "
38192 "handle being closed. The API calls described below let you register a "
38193 "callback to be called when events happen. You can register multiple "
38194 "callbacks (for the same, different or overlapping sets of events), and "
38195 "individually remove callbacks. If callbacks are not removed, then they "
38196 "remain in force until the handle is closed."
38200 #: ../src/guestfs.pod:1732
38202 "In the current implementation, events are only generated synchronously: that "
38203 "means that events (and hence callbacks) can only happen while you are in the "
38204 "middle of making another libguestfs call. The callback is called in the "
38209 #: ../src/guestfs.pod:1737
38211 "Events may contain a payload, usually nothing (void), an array of 64 bit "
38212 "unsigned integers, or a message buffer. Payloads are discussed later on."
38216 #: ../src/guestfs.pod:1741
38217 msgid "CLASSES OF EVENTS"
38221 #: ../src/guestfs.pod:1745
38222 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
38226 #: ../src/guestfs.pod:1748
38228 "The callback function will be called while the handle is being closed "
38229 "(synchronously from L</guestfs_close>)."
38233 #: ../src/guestfs.pod:1751
38235 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
38236 "handles that are open when the program exits. This means that this callback "
38237 "might be called indirectly from L<exit(3)>, which can cause unexpected "
38238 "problems in higher-level languages (eg. if your HLL interpreter has already "
38239 "been cleaned up by the time this is called, and if your callback then jumps "
38240 "into some HLL function)."
38244 #: ../src/guestfs.pod:1758
38246 "If no callback is registered: the handle is closed without any callback "
38251 #: ../src/guestfs.pod:1761
38252 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
38256 #: ../src/guestfs.pod:1764
38258 "The callback function will be called when the child process quits, either "
38259 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
38260 "corresponds to a transition from any state to the CONFIG state)."
38264 #: ../src/guestfs.pod:1768 ../src/guestfs.pod:1777 ../src/guestfs.pod:1894
38265 msgid "If no callback is registered: the event is ignored."
38269 #: ../src/guestfs.pod:1770
38270 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
38274 #: ../src/guestfs.pod:1773
38276 "The callback function will be called when the child process becomes ready "
38277 "first time after it has been launched. (This corresponds to a transition "
38278 "from LAUNCHING to the READY state)."
38282 #: ../src/guestfs.pod:1779
38283 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
38287 #: ../src/guestfs.pod:1782
38289 "Some long-running operations can generate progress messages. If this "
38290 "callback is registered, then it will be called each time a progress message "
38291 "is generated (usually two seconds after the operation started, and three "
38292 "times per second thereafter until it completes, although the frequency may "
38293 "change in future versions)."
38297 #: ../src/guestfs.pod:1788
38299 "The callback receives in the payload four unsigned 64 bit numbers which are "
38300 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
38304 #: ../src/guestfs.pod:1791
38306 "The units of C<total> are not defined, although for some operations C<total> "
38307 "may relate in some way to the amount of data to be transferred (eg. in bytes "
38308 "or megabytes), and C<position> may be the portion which has been "
38313 #: ../src/guestfs.pod:1796
38314 msgid "The only defined and stable parts of the API are:"
38318 #: ../src/guestfs.pod:1802
38320 "The callback can display to the user some type of progress bar or indicator "
38321 "which shows the ratio of C<position>:C<total>."
38325 #: ../src/guestfs.pod:1807
38326 msgid "0 E<lt>= C<position> E<lt>= C<total>"
38330 #: ../src/guestfs.pod:1811
38332 "If any progress notification is sent during a call, then a final progress "
38333 "notification is always sent when C<position> = C<total> (I<unless> the call "
38334 "fails with an error)."
38338 #: ../src/guestfs.pod:1815
38340 "This is to simplify caller code, so callers can easily set the progress "
38341 "indicator to \"100%\" at the end of the operation, without requiring special "
38342 "code to detect this case."
38346 #: ../src/guestfs.pod:1821
38348 "For some calls we are unable to estimate the progress of the call, but we "
38349 "can still generate progress messages to indicate activity. This is known as "
38350 "\"pulse mode\", and is directly supported by certain progress bar "
38351 "implementations (eg. GtkProgressBar)."
38355 #: ../src/guestfs.pod:1826
38357 "For these calls, zero or more progress messages are generated with "
38358 "C<position = 0> and C<total = 1>, followed by a final message with "
38359 "C<position = total = 1>."
38363 #: ../src/guestfs.pod:1830
38365 "As noted above, if the call fails with an error then the final message may "
38366 "not be generated."
38370 #: ../src/guestfs.pod:1835
38372 "The callback also receives the procedure number (C<proc_nr>) and serial "
38373 "number (C<serial>) of the call. These are only useful for debugging "
38374 "protocol issues, and the callback can normally ignore them. The callback "
38375 "may want to print these numbers in error messages or debugging messages."
38379 #: ../src/guestfs.pod:1841
38380 msgid "If no callback is registered: progress messages are discarded."
38384 #: ../src/guestfs.pod:1843
38385 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
38389 #: ../src/guestfs.pod:1846
38391 "The callback function is called whenever a log message is generated by qemu, "
38392 "the appliance kernel, guestfsd (daemon), or utility programs."
38396 #: ../src/guestfs.pod:1849
38398 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
38399 "(L</guestfs_launch>) then additional debug messages are generated."
38403 #: ../src/guestfs.pod:1852 ../src/guestfs.pod:1866
38405 "If no callback is registered: the messages are discarded unless the verbose "
38406 "flag is set in which case they are sent to stderr. You can override the "
38407 "printing of verbose messages to stderr by setting up a callback."
38411 #: ../src/guestfs.pod:1857
38412 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
38416 #: ../src/guestfs.pod:1860
38418 "The callback function is called whenever a log message is generated by the "
38419 "library part of libguestfs."
38423 #: ../src/guestfs.pod:1863
38425 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
38426 "messages are generated."
38430 #: ../src/guestfs.pod:1871
38431 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
38435 #: ../src/guestfs.pod:1874
38437 "The callback function is called whenever a trace message is generated. This "
38438 "only applies if the trace flag (L</guestfs_set_trace>) is set."
38442 #: ../src/guestfs.pod:1877
38444 "If no callback is registered: the messages are sent to stderr. You can "
38445 "override the printing of trace messages to stderr by setting up a callback."
38449 #: ../src/guestfs.pod:1881
38450 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
38454 #: ../src/guestfs.pod:1884
38455 msgid "The callback function is called whenever a libguestfs function is entered."
38459 #: ../src/guestfs.pod:1887
38461 "The payload is a string which contains the name of the function that we are "
38462 "entering (not including C<guestfs_> prefix)."
38466 #: ../src/guestfs.pod:1890
38468 "Note that libguestfs functions can call themselves, so you may see many "
38469 "events from a single call. A few libguestfs functions do not generate this "
38474 #: ../src/guestfs.pod:1898
38475 msgid "guestfs_set_event_callback"
38479 #: ../src/guestfs.pod:1900
38482 " int guestfs_set_event_callback (guestfs_h *g,\n"
38483 " guestfs_event_callback cb,\n"
38484 " uint64_t event_bitmask,\n"
38486 " void *opaque);\n"
38491 #: ../src/guestfs.pod:1906
38493 "This function registers a callback (C<cb>) for all event classes in the "
38494 "C<event_bitmask>."
38498 #: ../src/guestfs.pod:1909
38500 "For example, to register for all log message events, you could call this "
38501 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
38502 "To register a single callback for all possible classes of events, use "
38503 "C<GUESTFS_EVENT_ALL>."
38507 #: ../src/guestfs.pod:1915
38508 msgid "C<flags> should always be passed as 0."
38512 #: ../src/guestfs.pod:1917
38514 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
38515 "it for any purpose."
38519 #: ../src/guestfs.pod:1920
38521 "The return value is the event handle (an integer) which you can use to "
38522 "delete the callback (see below)."
38526 #: ../src/guestfs.pod:1923
38528 "If there is an error, this function returns C<-1>, and sets the error in the "
38529 "handle in the usual way (see L</guestfs_last_error> etc.)"
38533 #: ../src/guestfs.pod:1926
38535 "Callbacks remain in effect until they are deleted, or until the handle is "
38540 #: ../src/guestfs.pod:1929
38542 "In the case where multiple callbacks are registered for a particular event "
38543 "class, all of the callbacks are called. The order in which multiple "
38544 "callbacks are called is not defined."
38548 #: ../src/guestfs.pod:1933
38549 msgid "guestfs_delete_event_callback"
38553 #: ../src/guestfs.pod:1935
38556 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
38561 #: ../src/guestfs.pod:1937
38563 "Delete a callback that was previously registered. C<event_handle> should be "
38564 "the integer that was returned by a previous call to "
38565 "C<guestfs_set_event_callback> on the same handle."
38569 #: ../src/guestfs.pod:1941
38570 msgid "guestfs_event_callback"
38574 #: ../src/guestfs.pod:1943
38577 " typedef void (*guestfs_event_callback) (\n"
38580 " uint64_t event,\n"
38581 " int event_handle,\n"
38583 " const char *buf, size_t buf_len,\n"
38584 " const uint64_t *array, size_t array_len);\n"
38589 #: ../src/guestfs.pod:1952
38590 msgid "This is the type of the event callback function that you have to provide."
38594 #: ../src/guestfs.pod:1955
38596 "The basic parameters are: the handle (C<g>), the opaque user pointer "
38597 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
38598 "handle, and C<flags> which in the current API you should ignore."
38602 #: ../src/guestfs.pod:1959
38604 "The remaining parameters contain the event payload (if any). Each event may "
38605 "contain a payload, which usually relates to the event class, but for future "
38606 "proofing your code should be written to handle any payload for any event "
38611 #: ../src/guestfs.pod:1964
38613 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
38614 "there is no message buffer). Note that this message buffer can contain "
38615 "arbitrary 8 bit data, including NUL bytes."
38619 #: ../src/guestfs.pod:1968
38621 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
38622 "moment this is only used for progress messages."
38626 #: ../src/guestfs.pod:1971
38627 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
38631 #: ../src/guestfs.pod:1973
38633 "One motivation for the generic event API was to allow GUI programs to "
38634 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
38635 "unconditionally to C<stderr>."
38639 #: ../src/guestfs.pod:1977
38641 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
38642 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
38643 "messages are not events; you must capture error messages separately)."
38647 #: ../src/guestfs.pod:1982
38649 "Programs have to set up a callback to capture the classes of events of "
38654 #: ../src/guestfs.pod:1985
38658 " guestfs_set_event_callback\n"
38659 " (g, message_callback,\n"
38660 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
38661 " GUESTFS_EVENT_TRACE,\n"
38662 " 0, NULL) == -1)\n"
38663 " if (eh == -1) {\n"
38664 " // handle error in the usual way\n"
38670 #: ../src/guestfs.pod:1995
38672 "The callback can then direct messages to the appropriate place. In this "
38673 "example, messages are directed to syslog:"
38677 #: ../src/guestfs.pod:1998
38681 " message_callback (\n"
38684 " uint64_t event,\n"
38685 " int event_handle,\n"
38687 " const char *buf, size_t buf_len,\n"
38688 " const uint64_t *array, size_t array_len)\n"
38690 " const int priority = LOG_USER|LOG_INFO;\n"
38691 " if (buf_len > 0)\n"
38692 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
38698 #: ../src/guestfs.pod:2013
38699 msgid "CANCELLING LONG TRANSFERS"
38703 #: ../src/guestfs.pod:2015
38705 "Some operations can be cancelled by the caller while they are in progress. "
38706 "Currently only operations that involve uploading or downloading data can be "
38707 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
38708 "parameters in the generator)."
38712 #: ../src/guestfs.pod:2020
38713 msgid "guestfs_user_cancel"
38717 #: ../src/guestfs.pod:2022
38720 " void guestfs_user_cancel (guestfs_h *g);\n"
38725 #: ../src/guestfs.pod:2024
38726 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
38730 #: ../src/guestfs.pod:2027
38732 "Unlike most other libguestfs calls, this function is signal safe and thread "
38733 "safe. You can call it from a signal handler or from another thread, without "
38734 "needing to do any locking."
38738 #: ../src/guestfs.pod:2031
38740 "The transfer that was in progress (if there is one) will stop shortly "
38741 "afterwards, and will return an error. The errno (see "
38742 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
38743 "out if the operation was cancelled or failed because of another error."
38747 #: ../src/guestfs.pod:2037
38749 "No cleanup is performed: for example, if a file was being uploaded then "
38750 "after cancellation there may be a partially uploaded file. It is the "
38751 "caller's responsibility to clean up if necessary."
38755 #: ../src/guestfs.pod:2041
38756 msgid "There are two common places that you might call C<guestfs_user_cancel>."
38760 #: ../src/guestfs.pod:2043
38762 "In an interactive text-based program, you might call it from a C<SIGINT> "
38763 "signal handler so that pressing C<^C> cancels the current operation. (You "
38764 "also need to call L</guestfs_set_pgroup> so that child processes don't "
38765 "receive the C<^C> signal)."
38769 #: ../src/guestfs.pod:2048
38771 "In a graphical program, when the main thread is displaying a progress bar "
38772 "with a cancel button, wire up the cancel button to call this function."
38776 #: ../src/guestfs.pod:2052
38777 msgid "PRIVATE DATA AREA"
38781 #: ../src/guestfs.pod:2054
38783 "You can attach named pieces of private data to the libguestfs handle, fetch "
38784 "them by name, and walk over them, for the lifetime of the handle. This is "
38785 "called the private data area and is only available from the C API."
38789 #: ../src/guestfs.pod:2059
38790 msgid "To attach a named piece of data, use the following call:"
38794 #: ../src/guestfs.pod:2061
38797 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
38802 #: ../src/guestfs.pod:2063
38804 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
38805 "pointer (which can be C<NULL>). Any previous item with the same key is "
38810 #: ../src/guestfs.pod:2067
38812 "You can use any C<key> you want, but your key should I<not> start with an "
38813 "underscore character. Keys beginning with an underscore character are "
38814 "reserved for internal libguestfs purposes (eg. for implementing language "
38815 "bindings). It is recommended that you prefix the key with some unique "
38816 "string to avoid collisions with other users."
38820 #: ../src/guestfs.pod:2073
38821 msgid "To retrieve the pointer, use:"
38825 #: ../src/guestfs.pod:2075
38828 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
38833 #: ../src/guestfs.pod:2077
38835 "This function returns C<NULL> if either no data is found associated with "
38836 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
38841 #: ../src/guestfs.pod:2081
38843 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
38844 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
38845 "all. In particular, libguestfs does I<not> try to free the data when the "
38846 "handle is closed. If the data must be freed, then the caller must either "
38847 "free it before calling L</guestfs_close> or must set up a close callback to "
38848 "do it (see L</GUESTFS_EVENT_CLOSE>)."
38852 #: ../src/guestfs.pod:2088
38853 msgid "To walk over all entries, use these two functions:"
38857 #: ../src/guestfs.pod:2090
38860 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
38865 #: ../src/guestfs.pod:2092
38868 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
38873 #: ../src/guestfs.pod:2094
38875 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
38876 "not have any particular meaning -- keys are not returned in any defined "
38877 "order). A pointer to the key is returned in C<*key_rtn> and the "
38878 "corresponding data pointer is returned from the function. C<NULL> is "
38879 "returned if there are no keys stored in the handle."
38883 #: ../src/guestfs.pod:2100
38885 "C<guestfs_next_private> returns the next key, pointer pair. The return "
38886 "value of this function is also C<NULL> is there are no further entries to "
38891 #: ../src/guestfs.pod:2104
38892 msgid "Notes about walking over entries:"
38896 #: ../src/guestfs.pod:2110
38897 msgid "You must not call C<guestfs_set_private> while walking over the entries."
38901 #: ../src/guestfs.pod:2115
38903 "The handle maintains an internal iterator which is reset when you call "
38904 "C<guestfs_first_private>. This internal iterator is invalidated when you "
38905 "call C<guestfs_set_private>."
38909 #: ../src/guestfs.pod:2121
38910 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
38914 #: ../src/guestfs.pod:2123
38917 " guestfs_set_private (g, key, NULL);\n"
38922 #: ../src/guestfs.pod:2125
38923 msgid "then that C<key> is not returned when walking."
38927 #: ../src/guestfs.pod:2129
38929 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
38930 "C<guestfs_next_private> or C<guestfs_set_private>."
38934 #: ../src/guestfs.pod:2135
38936 "The following example code shows how to print all keys and data pointers "
38937 "that are associated with the handle C<g>:"
38941 #: ../src/guestfs.pod:2138
38944 " const char *key;\n"
38945 " void *data = guestfs_first_private (g, &key);\n"
38946 " while (data != NULL)\n"
38948 " printf (\"key = %s, data = %p\\n\", key, data);\n"
38949 " data = guestfs_next_private (g, &key);\n"
38955 #: ../src/guestfs.pod:2146
38957 "More commonly you are only interested in keys that begin with an "
38958 "application-specific prefix C<foo_>. Modify the loop like so:"
38962 #: ../src/guestfs.pod:2149
38965 " const char *key;\n"
38966 " void *data = guestfs_first_private (g, &key);\n"
38967 " while (data != NULL)\n"
38969 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
38970 " printf (\"key = %s, data = %p\\n\", key, data);\n"
38971 " data = guestfs_next_private (g, &key);\n"
38977 #: ../src/guestfs.pod:2158
38979 "If you need to modify keys while walking, then you have to jump back to the "
38980 "beginning of the loop. For example, to delete all keys prefixed with "
38985 #: ../src/guestfs.pod:2162
38988 " const char *key;\n"
38991 " data = guestfs_first_private (g, &key);\n"
38992 " while (data != NULL)\n"
38994 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
38996 " guestfs_set_private (g, key, NULL);\n"
38997 " /* note that 'key' pointer is now invalid, and so is\n"
38998 " the internal iterator */\n"
39001 " data = guestfs_next_private (g, &key);\n"
39007 #: ../src/guestfs.pod:2178
39009 "Note that the above loop is guaranteed to terminate because the keys are "
39010 "being deleted, but other manipulations of keys within the loop might not "
39011 "terminate unless you also maintain an indication of which keys have been "
39016 #: ../src/guestfs.pod:2183
39021 #: ../src/guestfs.pod:2185
39023 "The libguestfs C library can be probed using systemtap or DTrace. This is "
39024 "true of any library, not just libguestfs. However libguestfs also contains "
39025 "static markers to help in probing internal operations."
39029 #: ../src/guestfs.pod:2189
39030 msgid "You can list all the static markers by doing:"
39034 #: ../src/guestfs.pod:2191
39037 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
39038 " .provider(\"guestfs\").mark(\"*\")'\n"
39043 #: ../src/guestfs.pod:2194
39045 "B<Note:> These static markers are I<not> part of the stable API and may "
39046 "change in future versions."
39050 #: ../src/guestfs.pod:2197
39051 msgid "SYSTEMTAP SCRIPT EXAMPLE"
39055 #: ../src/guestfs.pod:2199
39057 "This script contains examples of displaying both the static markers and some "
39058 "ordinary C entry points:"
39062 #: ../src/guestfs.pod:2202
39070 #: ../src/guestfs.pod:2204
39073 " function display_time () {\n"
39074 " now = gettimeofday_us ();\n"
39077 " delta = now - last;\n"
39083 #: ../src/guestfs.pod:2211
39086 " printf (\"%d (+%d):\", now, delta);\n"
39092 #: ../src/guestfs.pod:2214
39097 " printf (\"ready\\n\");\n"
39103 #: ../src/guestfs.pod:2219
39106 " /* Display all calls to static markers. */\n"
39107 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
39108 " .provider(\"guestfs\").mark(\"*\") ? {\n"
39109 " display_time();\n"
39110 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
39116 #: ../src/guestfs.pod:2226
39119 " /* Display all calls to guestfs_mkfs* functions. */\n"
39120 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
39121 " .function(\"guestfs_mkfs*\") ? {\n"
39122 " display_time();\n"
39123 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
39129 #: ../src/guestfs.pod:2233
39131 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
39132 "program. Note that you either have to be root, or you have to add yourself "
39133 "to several special stap groups. Consult the systemtap documentation for "
39134 "more information."
39138 #: ../src/guestfs.pod:2238
39141 " # stap /tmp/test.stap\n"
39147 #: ../src/guestfs.pod:2241
39148 msgid "In another terminal, run a guestfish command such as this:"
39152 #: ../src/guestfs.pod:2245
39153 msgid "In the first terminal, stap trace output similar to this is shown:"
39157 #: ../src/guestfs.pod:2247
39160 " 1318248056692655 (+0):\tlaunch_start\n"
39161 " 1318248056692850 (+195): launch_build_appliance_start\n"
39162 " 1318248056818285 (+125435): launch_build_appliance_end\n"
39163 " 1318248056838059 (+19774): launch_run_qemu\n"
39164 " 1318248061071167 (+4233108): launch_end\n"
39165 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f "
39166 "device=0x1024e60\n"
39171 #: ../src/guestfs.pod:2254 ../src/guestfs.pod:2259
39176 #: ../src/guestfs.pod:2256
39178 "<!-- old anchor for the next section --> <a "
39179 "name=\"state_machine_and_low_level_event_api\"/>"
39183 #: ../src/guestfs.pod:2261
39184 msgid "ARCHITECTURE"
39188 #: ../src/guestfs.pod:2263
39190 "Internally, libguestfs is implemented by running an appliance (a special "
39191 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
39192 "process of the main program."
39196 #: ../src/guestfs.pod:2267
39199 " ___________________\n"
39201 " | main program |\n"
39203 " | | child process / appliance\n"
39204 " | | __________________________\n"
39206 " +-------------------+ RPC | +-----------------+ |\n"
39207 " | libguestfs <--------------------> guestfsd | |\n"
39208 " | | | +-----------------+ |\n"
39209 " \\___________________/ | | Linux kernel | |\n"
39210 " | +--^--------------+ |\n"
39211 " \\_________|________________/\n"
39213 " _______v______\n"
39216 " | disk image |\n"
39217 " \\______________/\n"
39222 #: ../src/guestfs.pod:2287
39224 "The library, linked to the main program, creates the child process and hence "
39225 "the appliance in the L</guestfs_launch> function."
39229 #: ../src/guestfs.pod:2290
39231 "Inside the appliance is a Linux kernel and a complete stack of userspace "
39232 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
39233 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
39234 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
39235 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
39236 "attached to the qemu process which translates device access by the "
39237 "appliance's Linux kernel into accesses to the image."
39241 #: ../src/guestfs.pod:2299
39243 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
39244 "Although the disk image you are attached to might also be used by some "
39245 "virtual machine, libguestfs doesn't know or care about this. (But you will "
39246 "care if both libguestfs's qemu process and your virtual machine are trying "
39247 "to update the disk image at the same time, since these usually results in "
39248 "massive disk corruption)."
39252 #: ../src/guestfs.pod:2306
39253 msgid "STATE MACHINE"
39257 #: ../src/guestfs.pod:2308
39258 msgid "libguestfs uses a state machine to model the child process:"
39262 #: ../src/guestfs.pod:2310
39266 " guestfs_create\n"
39274 " / | \\ \\ guestfs_launch\n"
39275 " / | _\\__V______\n"
39277 " / | | LAUNCHING |\n"
39278 " / | \\___________/\n"
39280 " / | guestfs_launch\n"
39282 " ______ / __|____V\n"
39283 " / \\ ------> / \\\n"
39284 " | BUSY | | READY |\n"
39285 " \\______/ <------ \\________/\n"
39290 #: ../src/guestfs.pod:2332
39292 "The normal transitions are (1) CONFIG (when the handle is created, but there "
39293 "is no child process), (2) LAUNCHING (when the child process is booting up), "
39294 "(3) alternating between READY and BUSY as commands are issued to, and "
39295 "carried out by, the child process."
39299 #: ../src/guestfs.pod:2337
39301 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
39302 "asynchronously at any time (eg. due to some internal error), and that causes "
39303 "the state to transition back to CONFIG."
39307 #: ../src/guestfs.pod:2341
39309 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
39310 "issued when in the CONFIG state."
39314 #: ../src/guestfs.pod:2344
39316 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
39317 "L</guestfs_launch> blocks until the child process is READY to accept "
39318 "commands (or until some failure or timeout). L</guestfs_launch> internally "
39319 "moves the state from CONFIG to LAUNCHING while it is running."
39323 #: ../src/guestfs.pod:2350
39325 "API actions such as L</guestfs_mount> can only be issued when in the READY "
39326 "state. These API calls block waiting for the command to be carried out "
39327 "(ie. the state to transition to BUSY and then back to READY). There are no "
39328 "non-blocking versions, and no way to issue more than one command per handle "
39329 "at the same time."
39333 #: ../src/guestfs.pod:2356
39335 "Finally, the child process sends asynchronous messages back to the main "
39336 "program, such as kernel log messages. You can register a callback to "
39337 "receive these messages."
39341 #: ../src/guestfs.pod:2360
39346 #: ../src/guestfs.pod:2362
39347 msgid "APPLIANCE BOOT PROCESS"
39351 #: ../src/guestfs.pod:2364
39353 "This process has evolved and continues to evolve. The description here "
39354 "corresponds only to the current version of libguestfs and is provided for "
39355 "information only."
39359 #: ../src/guestfs.pod:2368
39361 "In order to follow the stages involved below, enable libguestfs debugging "
39362 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
39366 #: ../src/guestfs.pod:2373
39367 msgid "Create the appliance"
39371 #: ../src/guestfs.pod:2375
39373 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
39374 "initrd and the appliance."
39378 #: ../src/guestfs.pod:2378
39380 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
39381 "directory if C<TMPDIR> is set)."
39385 #: ../src/guestfs.pod:2381
39387 "For a complete description of how the appliance is created and cached, read "
39388 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
39392 #: ../src/guestfs.pod:2385
39393 msgid "Start qemu and boot the kernel"
39397 #: ../src/guestfs.pod:2387
39398 msgid "qemu is invoked to boot the kernel."
39402 #: ../src/guestfs.pod:2389
39403 msgid "Run the initrd"
39407 #: ../src/guestfs.pod:2391
39409 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
39410 "appliance. The purpose of the initrd is to load enough kernel modules in "
39411 "order that the appliance itself can be mounted and started."
39415 #: ../src/guestfs.pod:2395
39417 "The initrd is a cpio archive called "
39418 "C</var/tmp/.guestfs-E<lt>UIDE<gt>/initrd>."
39422 #: ../src/guestfs.pod:2398
39424 "When the initrd has started you will see messages showing that kernel "
39425 "modules are being loaded, similar to this:"
39429 #: ../src/guestfs.pod:2401
39432 " febootstrap: ext2 mini initrd starting up\n"
39433 " febootstrap: mounting /sys\n"
39434 " febootstrap: internal insmod libcrc32c.ko\n"
39435 " febootstrap: internal insmod crc32c-intel.ko\n"
39440 #: ../src/guestfs.pod:2406
39441 msgid "Find and mount the appliance device"
39445 #: ../src/guestfs.pod:2408
39447 "The appliance is a sparse file containing an ext2 filesystem which contains "
39448 "a familiar (although reduced in size) Linux operating system. It would "
39449 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
39453 #: ../src/guestfs.pod:2412
39455 "The regular disks being inspected by libguestfs are the first devices "
39456 "exposed by qemu (eg. as C</dev/vda>)."
39460 #: ../src/guestfs.pod:2415
39462 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
39463 "there was only one regular disk)."
39467 #: ../src/guestfs.pod:2418
39469 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
39470 "and switch root into the appliance, and run C</init> from the appliance."
39474 #: ../src/guestfs.pod:2422
39475 msgid "If this works successfully you will see messages such as:"
39479 #: ../src/guestfs.pod:2424
39482 " febootstrap: picked /sys/block/vdb/dev as root device\n"
39483 " febootstrap: creating /dev/root as block special 252:16\n"
39484 " febootstrap: mounting new root on /root\n"
39485 " febootstrap: chroot\n"
39486 " Starting /init script ...\n"
39491 #: ../src/guestfs.pod:2430
39493 "Note that C<Starting /init script ...> indicates that the appliance's init "
39494 "script is now running."
39498 #: ../src/guestfs.pod:2433
39499 msgid "Initialize the appliance"
39503 #: ../src/guestfs.pod:2435
39505 "The appliance itself now initializes itself. This involves starting certain "
39506 "processes like C<udev>, possibly printing some debug information, and "
39507 "finally running the daemon (C<guestfsd>)."
39511 #: ../src/guestfs.pod:2439
39516 #: ../src/guestfs.pod:2441
39518 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
39523 #: ../src/guestfs.pod:2444
39526 " verbose daemon enabled\n"
39531 #: ../src/guestfs.pod:2446
39533 "The daemon expects to see a named virtio-serial port exposed by qemu and "
39534 "connected on the other end to the library."
39538 #: ../src/guestfs.pod:2449
39540 "The daemon connects to this port (and hence to the library) and sends a four "
39541 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
39542 "protocol (see below)."
39546 #: ../src/guestfs.pod:2455
39547 msgid "COMMUNICATION PROTOCOL"
39551 #: ../src/guestfs.pod:2457
39553 "Don't rely on using this protocol directly. This section documents how it "
39554 "currently works, but it may change at any time."
39558 #: ../src/guestfs.pod:2460
39560 "The protocol used to talk between the library and the daemon running inside "
39561 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
39562 "1014, RFC 1832, RFC 4506)."
39566 #: ../src/guestfs.pod:2464
39568 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
39569 "this file is automatically generated)."
39573 #: ../src/guestfs.pod:2467
39575 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
39576 "and C<FileOut> parameters, which are handled with very simple request/reply "
39577 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
39578 "parameters, which use the same request and reply messages, but they may also "
39579 "be followed by files sent using a chunked encoding."
39583 #: ../src/guestfs.pod:2474
39584 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
39588 #: ../src/guestfs.pod:2476
39589 msgid "For ordinary functions, the request message is:"
39593 #: ../src/guestfs.pod:2478
39596 " total length (header + arguments,\n"
39597 " but not including the length word itself)\n"
39598 " struct guestfs_message_header (encoded as XDR)\n"
39599 " struct guestfs_<foo>_args (encoded as XDR)\n"
39604 #: ../src/guestfs.pod:2483
39606 "The total length field allows the daemon to allocate a fixed size buffer "
39607 "into which it slurps the rest of the message. As a result, the total length "
39608 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
39609 "effective size of any request is limited to somewhere under this size."
39613 #: ../src/guestfs.pod:2489
39615 "Note also that many functions don't take any arguments, in which case the "
39616 "C<guestfs_I<foo>_args> is completely omitted."
39620 #: ../src/guestfs.pod:2492
39622 "The header contains the procedure number (C<guestfs_proc>) which is how the "
39623 "receiver knows what type of args structure to expect, or none at all."
39627 #: ../src/guestfs.pod:2496
39629 "For functions that take optional arguments, the optional arguments are "
39630 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
39631 "arguments. A bitmask in the header indicates which optional arguments are "
39632 "meaningful. The bitmask is also checked to see if it contains bits set "
39633 "which the daemon does not know about (eg. if more optional arguments were "
39634 "added in a later version of the library), and this causes the call to be "
39639 #: ../src/guestfs.pod:2504
39640 msgid "The reply message for ordinary functions is:"
39644 #: ../src/guestfs.pod:2506
39647 " total length (header + ret,\n"
39648 " but not including the length word itself)\n"
39649 " struct guestfs_message_header (encoded as XDR)\n"
39650 " struct guestfs_<foo>_ret (encoded as XDR)\n"
39655 #: ../src/guestfs.pod:2511
39657 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
39658 "functions that return no formal return values."
39662 #: ../src/guestfs.pod:2514
39663 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
39667 #: ../src/guestfs.pod:2517
39669 "In the case of an error, a flag is set in the header, and the reply message "
39670 "is slightly changed:"
39674 #: ../src/guestfs.pod:2520
39677 " total length (header + error,\n"
39678 " but not including the length word itself)\n"
39679 " struct guestfs_message_header (encoded as XDR)\n"
39680 " struct guestfs_message_error (encoded as XDR)\n"
39685 #: ../src/guestfs.pod:2525
39687 "The C<guestfs_message_error> structure contains the error message as a "
39692 #: ../src/guestfs.pod:2528
39693 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
39697 #: ../src/guestfs.pod:2530
39699 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
39700 "The normal request message is sent (see above). However this is followed by "
39701 "a sequence of file chunks."
39705 #: ../src/guestfs.pod:2534
39708 " total length (header + arguments,\n"
39709 " but not including the length word itself,\n"
39710 " and not including the chunks)\n"
39711 " struct guestfs_message_header (encoded as XDR)\n"
39712 " struct guestfs_<foo>_args (encoded as XDR)\n"
39713 " sequence of chunks for FileIn param #0\n"
39714 " sequence of chunks for FileIn param #1 etc.\n"
39719 #: ../src/guestfs.pod:2542
39720 msgid "The \"sequence of chunks\" is:"
39724 #: ../src/guestfs.pod:2544
39727 " length of chunk (not including length word itself)\n"
39728 " struct guestfs_chunk (encoded as XDR)\n"
39729 " length of chunk\n"
39730 " struct guestfs_chunk (encoded as XDR)\n"
39732 " length of chunk\n"
39733 " struct guestfs_chunk (with data.data_len == 0)\n"
39738 #: ../src/guestfs.pod:2552
39740 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
39741 "is set in the final chunk to indicate either successful completion or early "
39746 #: ../src/guestfs.pod:2556
39748 "At time of writing there are no functions that have more than one FileIn "
39749 "parameter. However this is (theoretically) supported, by sending the "
39750 "sequence of chunks for each FileIn parameter one after another (from left to "
39755 #: ../src/guestfs.pod:2561
39757 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
39758 "transfer. The library does this by sending a chunk with a special flag set "
39759 "to indicate cancellation. When the daemon sees this, it cancels the whole "
39760 "RPC, does I<not> send any reply, and goes back to reading the next request."
39764 #: ../src/guestfs.pod:2567
39766 "The daemon may also cancel. It does this by writing a special word "
39767 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
39768 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
39769 "cancel chunk). The special word is chosen so that even if cancellation "
39770 "happens right at the end of the transfer (after the library has finished "
39771 "writing and has started listening for the reply), the \"spurious\" cancel "
39772 "flag will not be confused with the reply message."
39776 #: ../src/guestfs.pod:2576
39778 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
39779 "limit), and also files where the size is not known in advance (eg. from "
39780 "pipes or sockets). However the chunks are rather small "
39781 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
39782 "to keep much in memory."
39786 #: ../src/guestfs.pod:2582
39787 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
39791 #: ../src/guestfs.pod:2584
39793 "The protocol for FileOut parameters is exactly the same as for FileIn "
39794 "parameters, but with the roles of daemon and library reversed."
39798 #: ../src/guestfs.pod:2587
39801 " total length (header + ret,\n"
39802 " but not including the length word itself,\n"
39803 " and not including the chunks)\n"
39804 " struct guestfs_message_header (encoded as XDR)\n"
39805 " struct guestfs_<foo>_ret (encoded as XDR)\n"
39806 " sequence of chunks for FileOut param #0\n"
39807 " sequence of chunks for FileOut param #1 etc.\n"
39812 #: ../src/guestfs.pod:2595
39813 msgid "INITIAL MESSAGE"
39817 #: ../src/guestfs.pod:2597
39819 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
39820 "which indicates that the guest and daemon is alive. This is what "
39821 "L</guestfs_launch> waits for."
39825 #: ../src/guestfs.pod:2601
39826 msgid "PROGRESS NOTIFICATION MESSAGES"
39830 #: ../src/guestfs.pod:2603
39832 "The daemon may send progress notification messages at any time. These are "
39833 "distinguished by the normal length word being replaced by "
39834 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
39838 #: ../src/guestfs.pod:2607
39840 "The library turns them into progress callbacks (see "
39841 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
39846 #: ../src/guestfs.pod:2611
39848 "The daemon self-limits the frequency of progress messages it sends (see "
39849 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
39854 #: ../src/guestfs.pod:2615
39855 msgid "LIBGUESTFS VERSION NUMBERS"
39859 #: ../src/guestfs.pod:2617
39861 "Since April 2010, libguestfs has started to make separate development and "
39862 "stable releases, along with corresponding branches in our git repository. "
39863 "These separate releases can be identified by version number:"
39867 #: ../src/guestfs.pod:2622
39870 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
39871 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
39877 " | `-------- sub-version\n"
39879 " `------ always '1' because we don't change the ABI\n"
39884 #: ../src/guestfs.pod:2633
39885 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
39889 #: ../src/guestfs.pod:2635
39891 "As time passes we cherry pick fixes from the development branch and backport "
39892 "those into the stable branch, the effect being that the stable branch should "
39893 "get more stable and less buggy over time. So the stable releases are ideal "
39894 "for people who don't need new features but would just like the software to "
39899 #: ../src/guestfs.pod:2641
39900 msgid "Our criteria for backporting changes are:"
39904 #: ../src/guestfs.pod:2647
39906 "Documentation changes which don't affect any code are backported unless the "
39907 "documentation refers to a future feature which is not in stable."
39911 #: ../src/guestfs.pod:2653
39913 "Bug fixes which are not controversial, fix obvious problems, and have been "
39914 "well tested are backported."
39918 #: ../src/guestfs.pod:2658
39920 "Simple rearrangements of code which shouldn't affect how it works get "
39921 "backported. This is so that the code in the two branches doesn't get too "
39922 "far out of step, allowing us to backport future fixes more easily."
39926 #: ../src/guestfs.pod:2664
39928 "We I<don't> backport new features, new APIs, new tools etc, except in one "
39929 "exceptional case: the new feature is required in order to implement an "
39930 "important bug fix."
39934 #: ../src/guestfs.pod:2670
39936 "A new stable branch starts when we think the new features in development are "
39937 "substantial and compelling enough over the current stable branch to warrant "
39938 "it. When that happens we create new stable and development versions 1.N.0 "
39939 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
39940 "stable at this point, but by backporting fixes from development, that branch "
39941 "will stabilize over time."
39945 #: ../src/guestfs.pod:2678
39946 msgid "EXTENDING LIBGUESTFS"
39950 #: ../src/guestfs.pod:2680
39951 msgid "ADDING A NEW API ACTION"
39955 #: ../src/guestfs.pod:2682
39957 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
39958 "documentation) are generated, and this makes it easy to extend the "
39963 #: ../src/guestfs.pod:2686
39964 msgid "To add a new API action there are two changes:"
39968 #: ../src/guestfs.pod:2692
39970 "You need to add a description of the call (name, parameters, return type, "
39971 "tests, documentation) to C<generator/generator_actions.ml>."
39975 #: ../src/guestfs.pod:2695
39977 "There are two sorts of API action, depending on whether the call goes "
39978 "through to the daemon in the appliance, or is serviced entirely by the "
39979 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
39980 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
39981 "an example of the latter, since a trace flag is maintained in the handle and "
39982 "all tracing is done on the library side."
39986 #: ../src/guestfs.pod:2703
39988 "Most new actions are of the first type, and get added to the "
39989 "C<daemon_functions> list. Each function has a unique procedure number used "
39990 "in the RPC protocol which is assigned to that action when we publish "
39991 "libguestfs and cannot be reused. Take the latest procedure number and "
39996 #: ../src/guestfs.pod:2709
39998 "For library-only actions of the second type, add to the "
39999 "C<non_daemon_functions> list. Since these functions are serviced by the "
40000 "library and do not travel over the RPC mechanism to the daemon, these "
40001 "functions do not need a procedure number, and so the procedure number is set "
40006 #: ../src/guestfs.pod:2717
40007 msgid "Implement the action (in C):"
40011 #: ../src/guestfs.pod:2719
40013 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
40014 "C<daemon/> directory."
40018 #: ../src/guestfs.pod:2722
40020 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
40021 "(note: double underscore) in the C<src/> directory."
40025 #: ../src/guestfs.pod:2725
40026 msgid "In either case, use another function as an example of what to do."
40030 #: ../src/guestfs.pod:2729
40031 msgid "After making these changes, use C<make> to compile."
40035 #: ../src/guestfs.pod:2731
40037 "Note that you don't need to implement the RPC, language bindings, manual "
40038 "pages or anything else. It's all automatically generated from the OCaml "
40043 #: ../src/guestfs.pod:2735
40044 msgid "ADDING TESTS FOR AN API ACTION"
40048 #: ../src/guestfs.pod:2737
40050 "You can supply zero or as many tests as you want per API call. The tests "
40051 "can either be added as part of the API description "
40052 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
40053 "drop a script into C<tests/*/>. Note that adding a script to C<tests/*/> is "
40054 "slower, so if possible use the first method."
40058 #: ../src/guestfs.pod:2744
40060 "The following describes the test environment used when you add an API test "
40061 "in C<generator_actions.ml>."
40065 #: ../src/guestfs.pod:2747
40066 msgid "The test environment has 4 block devices:"
40070 #: ../src/guestfs.pod:2751
40071 msgid "C</dev/sda> 500MB"
40075 #: ../src/guestfs.pod:2753
40076 msgid "General block device for testing."
40080 #: ../src/guestfs.pod:2755
40081 msgid "C</dev/sdb> 50MB"
40085 #: ../src/guestfs.pod:2757
40087 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
40092 #: ../src/guestfs.pod:2760
40093 msgid "C</dev/sdc> 10MB"
40097 #: ../src/guestfs.pod:2762
40098 msgid "Used in a few tests where two block devices are needed."
40102 #: ../src/guestfs.pod:2764
40103 msgid "C</dev/sdd>"
40107 #: ../src/guestfs.pod:2766
40108 msgid "ISO with fixed content (see C<images/test.iso>)."
40112 #: ../src/guestfs.pod:2770
40114 "To be able to run the tests in a reasonable amount of time, the libguestfs "
40115 "appliance and block devices are reused between tests. So don't try testing "
40116 "L</guestfs_kill_subprocess> :-x"
40120 #: ../src/guestfs.pod:2774
40122 "Each test starts with an initial scenario, selected using one of the "
40123 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
40124 "initialize the disks mentioned above in a particular way as documented in "
40125 "C<generator_types.ml>. You should not assume anything about the previous "
40126 "contents of other disks that are not initialized."
40130 #: ../src/guestfs.pod:2780
40132 "You can add a prerequisite clause to any individual test. This is a "
40133 "run-time check, which, if it fails, causes the test to be skipped. Useful "
40134 "if testing a command which might not work on all variations of libguestfs "
40135 "builds. A test that has prerequisite of C<Always> means to run "
40140 #: ../src/guestfs.pod:2786
40142 "In addition, packagers can skip individual tests by setting environment "
40143 "variables before running C<make check>."
40147 #: ../src/guestfs.pod:2789
40150 " SKIP_TEST_<CMD>_<NUM>=1\n"
40155 #: ../src/guestfs.pod:2791
40156 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
40160 #: ../src/guestfs.pod:2795
40163 " SKIP_TEST_<CMD>=1\n"
40168 #: ../src/guestfs.pod:2797
40169 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
40173 #: ../src/guestfs.pod:2799
40174 msgid "Packagers can run only certain tests by setting for example:"
40178 #: ../src/guestfs.pod:2801
40181 " TEST_ONLY=\"vfs_type zerofree\"\n"
40186 #: ../src/guestfs.pod:2803
40188 "See C<tests/c-api/tests.c> for more details of how these environment "
40193 #: ../src/guestfs.pod:2806
40194 msgid "DEBUGGING NEW API ACTIONS"
40198 #: ../src/guestfs.pod:2808
40199 msgid "Test new actions work before submitting them."
40203 #: ../src/guestfs.pod:2810
40204 msgid "You can use guestfish to try out new commands."
40208 #: ../src/guestfs.pod:2812
40210 "Debugging the daemon is a problem because it runs inside a minimal "
40211 "environment. However you can fprintf messages in the daemon to stderr, and "
40212 "they will show up if you use C<guestfish -v>."
40216 #: ../src/guestfs.pod:2816
40217 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
40221 #: ../src/guestfs.pod:2818
40223 "Our C source code generally adheres to some basic code-formatting "
40224 "conventions. The existing code base is not totally consistent on this "
40225 "front, but we do prefer that contributed code be formatted similarly. In "
40226 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
40227 "indentation level, and other than that, follow the K&R style."
40231 #: ../src/guestfs.pod:2824
40233 "If you use Emacs, add the following to one of one of your start-up files "
40234 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
40238 #: ../src/guestfs.pod:2827
40241 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
40242 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
40243 " (add-hook 'find-file-hook\n"
40244 " '(lambda () (if (and buffer-file-name\n"
40245 " (string-match \"/libguestfs\\\\>\"\n"
40246 " (buffer-file-name))\n"
40247 " (not (string-equal mode-name \"Change Log\"))\n"
40248 " (not (string-equal mode-name \"Makefile\")))\n"
40249 " (setq indent-tabs-mode nil))))\n"
40254 #: ../src/guestfs.pod:2837
40257 " ;;; When editing C sources in libguestfs, use this style.\n"
40258 " (defun libguestfs-c-mode ()\n"
40259 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
40261 " (c-set-style \"K&R\")\n"
40262 " (setq c-indent-level 2)\n"
40263 " (setq c-basic-offset 2))\n"
40264 " (add-hook 'c-mode-hook\n"
40265 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
40266 " (buffer-file-name))\n"
40267 " (libguestfs-c-mode))))\n"
40272 #: ../src/guestfs.pod:2849
40273 msgid "Enable warnings when compiling (and fix any problems this finds):"
40277 #: ../src/guestfs.pod:2852
40280 " ./configure --enable-gcc-warnings\n"
40285 #: ../src/guestfs.pod:2854
40286 msgid "Useful targets are:"
40290 #: ../src/guestfs.pod:2856
40293 " make syntax-check # checks the syntax of the C code\n"
40294 " make check # runs the test suite\n"
40299 #: ../src/guestfs.pod:2859
40300 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
40304 #: ../src/guestfs.pod:2861
40306 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
40307 "which are used to do shell quoting."
40311 #: ../src/guestfs.pod:2866
40316 #: ../src/guestfs.pod:2868
40318 "Simple shell quoted string. Any spaces or other shell characters are "
40323 #: ../src/guestfs.pod:2871
40328 #: ../src/guestfs.pod:2873
40330 "Same as C<%Q> except the string is treated as a path which is prefixed by "
40335 #: ../src/guestfs.pod:2880
40338 " asprintf (&cmd, \"cat %R\", path);\n"
40343 #: ../src/guestfs.pod:2882
40344 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
40348 #: ../src/guestfs.pod:2884
40350 "I<Note:> Do I<not> use these when you are passing parameters to the "
40351 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
40352 "because they are not passed via the shell (instead, straight to exec). You "
40353 "probably want to use the C<sysroot_path()> function however."
40357 #: ../src/guestfs.pod:2890
40358 msgid "SUBMITTING YOUR NEW API ACTIONS"
40362 #: ../src/guestfs.pod:2892
40364 "Submit patches to the mailing list: "
40365 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
40366 "L<rjones@redhat.com>."
40370 #: ../src/guestfs.pod:2896
40371 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
40375 #: ../src/guestfs.pod:2898
40376 msgid "We support i18n (gettext anyhow) in the library."
40380 #: ../src/guestfs.pod:2900
40382 "However many messages come from the daemon, and we don't translate those at "
40383 "the moment. One reason is that the appliance generally has all locale files "
40384 "removed from it, because they take up a lot of space. So we'd have to readd "
40385 "some of those, as well as copying our PO files into the appliance."
40389 #: ../src/guestfs.pod:2906
40391 "Debugging messages are never translated, since they are intended for the "
40396 #: ../src/guestfs.pod:2909
40397 msgid "SOURCE CODE SUBDIRECTORIES"
40401 #: ../src/guestfs.pod:2913
40406 #: ../src/guestfs.pod:2915
40407 msgid "L<virt-alignment-scan(1)> command and documentation."
40411 #: ../src/guestfs.pod:2919
40412 msgid "The libguestfs appliance, build scripts and so on."
40416 #: ../src/guestfs.pod:2921
40421 #: ../src/guestfs.pod:2923
40423 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
40428 #: ../src/guestfs.pod:2926
40433 #: ../src/guestfs.pod:2928
40435 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
40436 "command and documentation."
40440 #: ../src/guestfs.pod:2931
40445 #: ../src/guestfs.pod:2933
40446 msgid "Outside contributions, experimental parts."
40450 #: ../src/guestfs.pod:2935
40455 #: ../src/guestfs.pod:2937
40457 "The daemon that runs inside the libguestfs appliance and carries out "
40462 #: ../src/guestfs.pod:2940
40467 #: ../src/guestfs.pod:2942
40468 msgid "L<virt-df(1)> command and documentation."
40472 #: ../src/guestfs.pod:2944
40477 #: ../src/guestfs.pod:2946
40478 msgid "L<virt-edit(1)> command and documentation."
40482 #: ../src/guestfs.pod:2948
40483 msgid "C<examples>"
40487 #: ../src/guestfs.pod:2950
40488 msgid "C API example code."
40492 #: ../src/guestfs.pod:2952
40497 #: ../src/guestfs.pod:2954
40499 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
40500 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
40501 "L<virt-tar-out(1)>."
40505 #: ../src/guestfs.pod:2958
40510 #: ../src/guestfs.pod:2960
40511 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
40515 #: ../src/guestfs.pod:2962
40516 msgid "C<generator>"
40520 #: ../src/guestfs.pod:2964
40522 "The crucially important generator, used to automatically generate large "
40523 "amounts of boilerplate C code for things like RPC and bindings."
40527 #: ../src/guestfs.pod:2967
40528 msgid "C<inspector>"
40532 #: ../src/guestfs.pod:2969
40533 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
40537 #: ../src/guestfs.pod:2971
40542 #: ../src/guestfs.pod:2973
40543 msgid "Logo used on the website. The fish is called Arthur by the way."
40547 #: ../src/guestfs.pod:2975
40552 #: ../src/guestfs.pod:2977
40553 msgid "M4 macros used by autoconf."
40557 #: ../src/guestfs.pod:2979
40562 #: ../src/guestfs.pod:2981
40563 msgid "Translations of simple gettext strings."
40567 #: ../src/guestfs.pod:2983
40572 #: ../src/guestfs.pod:2985
40574 "The build infrastructure and PO files for translations of manpages and POD "
40575 "files. Eventually this will be combined with the C<po> directory, but that "
40576 "is rather complicated."
40580 #: ../src/guestfs.pod:2989
40585 #: ../src/guestfs.pod:2991
40586 msgid "L<virt-rescue(1)> command and documentation."
40590 #: ../src/guestfs.pod:2993
40595 #: ../src/guestfs.pod:2995
40596 msgid "L<virt-resize(1)> command and documentation."
40600 #: ../src/guestfs.pod:2997
40601 msgid "C<sparsify>"
40605 #: ../src/guestfs.pod:2999
40606 msgid "L<virt-sparsify(1)> command and documentation."
40610 #: ../src/guestfs.pod:3001
40615 #: ../src/guestfs.pod:3003
40616 msgid "Source code to the C library."
40620 #: ../src/guestfs.pod:3005
40621 msgid "C<test-tool>"
40625 #: ../src/guestfs.pod:3007
40627 "Test tool for end users to test if their qemu/kernel combination will work "
40632 #: ../src/guestfs.pod:3010
40637 #: ../src/guestfs.pod:3012
40642 #: ../src/guestfs.pod:3014
40647 #: ../src/guestfs.pod:3016
40648 msgid "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
40652 #: ../src/guestfs.pod:3018
40657 #: ../src/guestfs.pod:3020
40662 #: ../src/guestfs.pod:3022
40667 #: ../src/guestfs.pod:3024
40672 #: ../src/guestfs.pod:3026
40677 #: ../src/guestfs.pod:3028
40682 #: ../src/guestfs.pod:3030
40687 #: ../src/guestfs.pod:3032
40692 #: ../src/guestfs.pod:3034
40697 #: ../src/guestfs.pod:3036
40698 msgid "Language bindings."
40702 #: ../src/guestfs.pod:3040
40703 msgid "MAKING A STABLE RELEASE"
40707 #: ../src/guestfs.pod:3042
40709 "When we make a stable release, there are several steps documented here. See "
40710 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
40715 #: ../src/guestfs.pod:3050
40716 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
40720 #: ../src/guestfs.pod:3055
40721 msgid "Finalize RELEASE-NOTES."
40725 #: ../src/guestfs.pod:3059
40726 msgid "Update ROADMAP."
40730 #: ../src/guestfs.pod:3063
40731 msgid "Run C<src/api-support/update-from-tarballs.sh>."
40735 #: ../src/guestfs.pod:3067
40736 msgid "Push and pull from Transifex."
40740 #: ../src/guestfs.pod:3071
40748 #: ../src/guestfs.pod:3073
40749 msgid "to push the latest POT files to Transifex. Then run:"
40753 #: ../src/guestfs.pod:3075
40761 #: ../src/guestfs.pod:3077
40762 msgid "which is a wrapper to pull the latest translated C<*.po> files."
40766 #: ../src/guestfs.pod:3081
40768 "Create new stable and development directories under "
40769 "L<http://libguestfs.org/download>."
40773 #: ../src/guestfs.pod:3086
40774 msgid "Create the branch in git:"
40778 #: ../src/guestfs.pod:3088
40781 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
40782 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
40783 " git branch stable-1.XX\n"
40784 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
40789 #: ../src/guestfs.pod:3095
40794 #: ../src/guestfs.pod:3097
40795 msgid "PROTOCOL LIMITS"
40799 #: ../src/guestfs.pod:3099
40801 "Internally libguestfs uses a message-based protocol to pass API calls and "
40802 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
40803 "plenty more detail about this). The maximum message size used by the "
40804 "protocol is slightly less than 4 MB. For some API calls you may need to be "
40805 "aware of this limit. The API calls which may be affected are individually "
40806 "documented, with a link back to this section of the documentation."
40810 #: ../src/guestfs.pod:3107
40812 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
40813 "a simple string. Because this string is at some point internally encoded as "
40814 "a message, the maximum size that it can return is slightly under 4 MB. If "
40815 "the requested file is larger than this then you will get an error."
40819 #: ../src/guestfs.pod:3113
40821 "In order to transfer large files into and out of the guest filesystem, you "
40822 "need to use particular calls that support this. The sections L</UPLOADING> "
40823 "and L</DOWNLOADING> document how to do this."
40827 #: ../src/guestfs.pod:3117
40829 "You might also consider mounting the disk image using our FUSE filesystem "
40830 "support (L<guestmount(1)>)."
40834 #: ../src/guestfs.pod:3120
40835 msgid "MAXIMUM NUMBER OF DISKS"
40839 #: ../src/guestfs.pod:3122
40840 msgid "When using virtio disks (the default) the current limit is B<25> disks."
40844 #: ../src/guestfs.pod:3125
40846 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
40847 "slots. However febootstrap only understands disks with names C</dev/vda> "
40848 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
40853 #: ../src/guestfs.pod:3130
40855 "We are working to substantially raise this limit in future versions but it "
40856 "requires complex changes to qemu."
40860 #: ../src/guestfs.pod:3133
40862 "In future versions of libguestfs it should also be possible to \"hot plug\" "
40863 "disks (add and remove disks after calling L</guestfs_launch>). This also "
40864 "requires changes to qemu."
40868 #: ../src/guestfs.pod:3137
40869 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
40873 #: ../src/guestfs.pod:3139
40874 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
40878 #: ../src/guestfs.pod:3141
40880 "This is because it reserves 4 bits for the minor device number (thus "
40881 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
40885 #: ../src/guestfs.pod:3144
40887 "If you attach a disk with more than 15 partitions, the extra partitions are "
40888 "ignored by libguestfs."
40892 #: ../src/guestfs.pod:3147
40893 msgid "MAXIMUM SIZE OF A DISK"
40897 #: ../src/guestfs.pod:3149
40898 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
40902 #: ../src/guestfs.pod:3151
40904 "We have tested block devices up to 1 exabyte (2**60 or "
40905 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
40910 #: ../src/guestfs.pod:3155
40912 "Although libguestfs probably does not impose any limit, the underlying host "
40913 "storage will. If you store disk images on a host ext4 filesystem, then the "
40914 "maximum size will be limited by the maximum ext4 file size (currently 16 "
40915 "TB). If you store disk images as host logical volumes then you are limited "
40916 "by the maximum size of an LV."
40920 #: ../src/guestfs.pod:3161
40922 "For the hugest disk image files, we recommend using XFS on the host for "
40927 #: ../src/guestfs.pod:3164
40928 msgid "MAXIMUM SIZE OF A PARTITION"
40932 #: ../src/guestfs.pod:3166
40934 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
40935 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
40936 "address a partition located beyond 2 TB on the disk."
40940 #: ../src/guestfs.pod:3170
40942 "It is recommended that you use GPT partitions on disks which are larger than "
40943 "this size. GPT uses 64 bit sector numbers and so can address partitions "
40944 "which are theoretically larger than the largest disk we could support."
40948 #: ../src/guestfs.pod:3175
40949 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
40953 #: ../src/guestfs.pod:3177
40955 "This depends on the filesystem type. libguestfs itself does not impose any "
40956 "known limit. Consult Wikipedia or the filesystem documentation to find out "
40957 "what these limits are."
40961 #: ../src/guestfs.pod:3181
40962 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
40966 #: ../src/guestfs.pod:3183
40968 "The API functions L</guestfs_upload>, L</guestfs_download>, "
40969 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
40970 "uploads and downloads."
40974 #: ../src/guestfs.pod:3187
40975 msgid "INSPECTION LIMITS"
40979 #: ../src/guestfs.pod:3189
40981 "The inspection code has several arbitrary limits on things like the size of "
40982 "Windows Registry hive it will read, and the length of product name. These "
40983 "are intended to stop a malicious guest from consuming arbitrary amounts of "
40984 "memory and disk space on the host, and should not be reached in practice. "
40985 "See the source code for more information."
40989 #: ../src/guestfs.pod:3215
40991 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
40992 "effect as calling C<guestfs_set_verbose (g, 1)>."
40996 #: ../src/guestfs.pod:3227
40998 "Set the path that libguestfs uses to search for a supermin appliance. See "
40999 "the discussion of paths in section L</PATH> above."
41003 #: ../src/guestfs.pod:3236
41004 msgid "See also L</QEMU WRAPPERS> above."
41008 #: ../src/guestfs.pod:3240
41010 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
41011 "effect as calling C<guestfs_set_trace (g, 1)>."
41015 #: ../src/guestfs.pod:3258
41017 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
41018 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
41019 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, "
41020 "L<virt-alignment-scan(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
41021 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
41022 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
41023 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
41024 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, "
41025 "L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
41026 "L<virt-win-reg(1)>, L<guestfs-testing(1)>, L<qemu(1)>, L<febootstrap(1)>, "
41027 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)>, "
41028 "L<http://libguestfs.org/>."
41032 #: ../src/guestfs.pod:3295
41034 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
41035 "L<lvm(8)>, L<disktype(1)>."
41039 #: ../src/guestfs.pod:3302 ../tools/virt-make-fs.pl:571 ../tools/virt-win-reg.pl:772
41044 #: ../src/guestfs.pod:3304
41045 msgid "To get a list of bugs against libguestfs use this link:"
41049 #: ../src/guestfs.pod:3306
41050 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
41054 #: ../src/guestfs.pod:3308
41055 msgid "To report a new bug against libguestfs use this link:"
41059 #: ../src/guestfs.pod:3310
41060 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
41064 #: ../src/guestfs.pod:3312
41065 msgid "When reporting a bug, please check:"
41069 #: ../src/guestfs.pod:3318
41070 msgid "That the bug hasn't been reported already."
41074 #: ../src/guestfs.pod:3322
41075 msgid "That you are testing a recent version."
41079 #: ../src/guestfs.pod:3326
41080 msgid "Describe the bug accurately, and give a way to reproduce it."
41084 #: ../src/guestfs.pod:3330
41086 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
41091 #: ../test-tool/libguestfs-test-tool.pod:5
41092 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
41096 #: ../test-tool/libguestfs-test-tool.pod:9
41099 " libguestfs-test-tool [--options]\n"
41104 #: ../test-tool/libguestfs-test-tool.pod:13
41106 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
41107 "to check basic libguestfs functionality is working. This is needed because "
41108 "libguestfs occasionally breaks for reasons beyond our control: usually "
41109 "because of changes in the underlying qemu or kernel packages, or the host "
41114 #: ../test-tool/libguestfs-test-tool.pod:19
41115 msgid "If you suspect a problem in libguestfs, then just run:"
41119 #: ../test-tool/libguestfs-test-tool.pod:21
41122 " libguestfs-test-tool\n"
41127 #: ../test-tool/libguestfs-test-tool.pod:23
41128 msgid "It will print lots of diagnostic messages."
41132 #: ../test-tool/libguestfs-test-tool.pod:25
41133 msgid "If it runs to completion successfully, you will see this near the end:"
41137 #: ../test-tool/libguestfs-test-tool.pod:27
41140 " ===== TEST FINISHED OK =====\n"
41145 #: ../test-tool/libguestfs-test-tool.pod:29
41146 msgid "and the test tool will exit with code 0."
41150 #: ../test-tool/libguestfs-test-tool.pod:31
41152 "If it fails (and/or exits with non-zero error code), please paste the "
41153 "I<complete, unedited> output of the test tool into a bug report. More "
41154 "information about reporting bugs can be found on the "
41155 "L<http://libguestfs.org/> website."
41159 #: ../test-tool/libguestfs-test-tool.pod:42
41160 msgid "Display short usage information and exit."
41164 #: ../test-tool/libguestfs-test-tool.pod:44
41165 msgid "B<--qemu qemu_binary>"
41169 #: ../test-tool/libguestfs-test-tool.pod:46
41171 "If you have downloaded another qemu binary, point this option at the full "
41172 "path of the binary to try it."
41176 #: ../test-tool/libguestfs-test-tool.pod:49
41177 msgid "B<--qemudir qemu_source_dir>"
41181 #: ../test-tool/libguestfs-test-tool.pod:51
41183 "If you have compiled qemu from source, point this option at the source "
41184 "directory to try it."
41188 #: ../test-tool/libguestfs-test-tool.pod:54
41193 #: ../test-tool/libguestfs-test-tool.pod:56
41194 msgid "B<--timeout N>"
41198 #: ../test-tool/libguestfs-test-tool.pod:58
41200 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
41201 "minutes) which does not usually need to be adjusted."
41205 #: ../test-tool/libguestfs-test-tool.pod:63
41206 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
41210 #: ../test-tool/libguestfs-test-tool.pod:65
41212 "If you have compiled another version of qemu from source and would like to "
41213 "try that, then you can use the I<--qemudir> option to point to the qemu "
41214 "source directory."
41218 #: ../test-tool/libguestfs-test-tool.pod:69
41220 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
41221 "option to point to the binary."
41225 #: ../test-tool/libguestfs-test-tool.pod:72
41227 "Note when using these options, you can ignore the business of qemu wrapper "
41228 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
41229 "wrapper script for you if one is needed."
41233 #: ../test-tool/libguestfs-test-tool.pod:76
41234 msgid "TRYING OUT A DIFFERENT KERNEL"
41238 #: ../test-tool/libguestfs-test-tool.pod:78
41240 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
41241 "libguestfs tries. You do this by setting the environment variables "
41242 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
41246 #: ../test-tool/libguestfs-test-tool.pod:82
41248 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
41253 #: ../test-tool/libguestfs-test-tool.pod:85
41254 msgid "SELF-DIAGNOSIS"
41258 #: ../test-tool/libguestfs-test-tool.pod:87
41260 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
41261 "produced by libguestfs-test-tool and/or possible errors."
41265 #: ../test-tool/libguestfs-test-tool.pod:92
41267 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
41268 "I<1> if there was an error."
41272 #: ../test-tool/libguestfs-test-tool.pod:97
41274 "For the full list of environment variables which may affect libguestfs, "
41275 "please see the L<guestfs(3)> manual page."
41279 #: ../test-tool/libguestfs-test-tool.pod:102
41280 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
41284 #: ../tools/virt-list-filesystems.pl:32
41285 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
41289 #: ../tools/virt-list-filesystems.pl:36
41292 " virt-list-filesystems [--options] domname\n"
41297 #: ../tools/virt-list-filesystems.pl:38
41300 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
41305 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
41307 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
41312 #: ../tools/virt-list-filesystems.pl:45
41314 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
41315 "are contained in a virtual machine or disk image."
41319 #: ../tools/virt-list-filesystems.pl:49
41321 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
41322 "functionality. For more complex cases you should look at the "
41323 "L<guestfish(1)> tool."
41327 #: ../tools/virt-list-filesystems.pl:112
41329 "With this option, C<virt-list-filesystems> displays the type of each "
41330 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
41334 #: ../tools/virt-list-filesystems.pl:119
41339 #: ../tools/virt-list-filesystems.pl:123
41341 "Normally we only show mountable filesystems. If this option is given then "
41342 "swap devices are shown too."
41346 #: ../tools/virt-list-filesystems.pl:197
41348 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
41349 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
41350 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
41354 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
41355 msgid "Copyright (C) 2009 Red Hat Inc."
41359 #: ../tools/virt-list-partitions.pl:32
41360 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
41364 #: ../tools/virt-list-partitions.pl:36
41367 " virt-list-partitions [--options] domname\n"
41372 #: ../tools/virt-list-partitions.pl:38
41375 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
41380 #: ../tools/virt-list-partitions.pl:45
41382 "C<virt-list-partitions> is a command line tool to list the partitions that "
41383 "are contained in a virtual machine or disk image. It is mainly useful as a "
41384 "first step to using L<virt-resize(1)>."
41388 #: ../tools/virt-list-partitions.pl:50
41390 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
41391 "functionality. For more complex cases you should look at the "
41392 "L<guestfish(1)> tool."
41396 #: ../tools/virt-list-partitions.pl:113
41397 msgid "Show sizes in human-readable form (eg. \"1G\")."
41401 #: ../tools/virt-list-partitions.pl:123
41403 "With this option, C<virt-list-partitions> displays the type and size of each "
41404 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
41408 #: ../tools/virt-list-partitions.pl:130
41413 #: ../tools/virt-list-partitions.pl:132
41418 #: ../tools/virt-list-partitions.pl:134
41419 msgid "Display the total size of each block device (as a separate row or rows)."
41423 #: ../tools/virt-list-partitions.pl:267
41425 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
41426 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
41427 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
41431 #: ../tools/virt-list-partitions.pl:283
41432 msgid "Copyright (C) 2009-2010 Red Hat Inc."
41436 #: ../tools/virt-make-fs.pl:37
41437 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
41441 #: ../tools/virt-make-fs.pl:41
41444 " virt-make-fs [--options] input.tar output.img\n"
41449 #: ../tools/virt-make-fs.pl:43
41452 " virt-make-fs [--options] input.tar.gz output.img\n"
41457 #: ../tools/virt-make-fs.pl:45
41460 " virt-make-fs [--options] directory output.img\n"
41465 #: ../tools/virt-make-fs.pl:49
41467 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
41468 "archive or some files in a directory. It is similar to tools like "
41469 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
41470 "it can create common filesystem types like ext2/3 or NTFS, which can be "
41471 "useful if you want to attach these filesystems to existing virtual machines "
41472 "(eg. to import large amounts of read-only data to a VM)."
41476 #: ../tools/virt-make-fs.pl:57
41477 msgid "Basic usage is:"
41481 #: ../tools/virt-make-fs.pl:59
41484 " virt-make-fs input output.img\n"
41489 #: ../tools/virt-make-fs.pl:61
41491 "where C<input> is either a directory containing files that you want to add, "
41492 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
41493 "C<output.img> is a disk image. The input type is detected automatically. "
41494 "The output disk image defaults to a raw ext2 sparse image unless you specify "
41495 "extra flags (see L</OPTIONS> below)."
41499 #: ../tools/virt-make-fs.pl:67
41500 msgid "FILESYSTEM TYPE"
41504 #: ../tools/virt-make-fs.pl:69
41506 "The default filesystem type is C<ext2>. Just about any filesystem type that "
41507 "libguestfs supports can be used (but I<not> read-only formats like "
41508 "ISO9660). Here are some of the more common choices:"
41512 #: ../tools/virt-make-fs.pl:75
41517 #: ../tools/virt-make-fs.pl:77
41519 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
41520 "you are not going to use the filesystem in a way that requires the journal, "
41521 "then this is just wasted overhead."
41525 #: ../tools/virt-make-fs.pl:81
41526 msgid "I<ntfs> or I<vfat>"
41530 #: ../tools/virt-make-fs.pl:83
41531 msgid "Useful if exporting data to a Windows guest."
41535 #: ../tools/virt-make-fs.pl:85
41537 "I<Note for vfat>: The tar archive or local directory must only contain files "
41538 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
41539 "program running within libguestfs is unable to change the ownership of "
41540 "non-root files, since vfat itself does not support this."
41544 #: ../tools/virt-make-fs.pl:90
41549 #: ../tools/virt-make-fs.pl:92
41551 "Lower overhead than C<ext2>, but certain limitations on filename length and "
41552 "total filesystem size."
41556 #: ../tools/virt-make-fs.pl:97 ../tools/virt-make-fs.pl:116 ../tools/virt-make-fs.pl:149
41561 #: ../tools/virt-make-fs.pl:99
41564 " virt-make-fs --type=minix input minixfs.img\n"
41569 #: ../tools/virt-make-fs.pl:101
41570 msgid "TO PARTITION OR NOT TO PARTITION"
41574 #: ../tools/virt-make-fs.pl:103
41575 msgid "Optionally virt-make-fs can add a partition table to the output disk."
41579 #: ../tools/virt-make-fs.pl:105
41581 "Adding a partition can make the disk image more compatible with certain "
41582 "virtualized operating systems which don't expect to see a filesystem "
41583 "directly located on a block device (Linux doesn't care and will happily "
41584 "handle both types)."
41588 #: ../tools/virt-make-fs.pl:110
41590 "On the other hand, if you have a partition table then the output image is no "
41591 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
41592 "directly on a partitioned disk image. (However libguestfs tools such as "
41593 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
41597 #: ../tools/virt-make-fs.pl:118
41598 msgid "Add an MBR partition:"
41602 #: ../tools/virt-make-fs.pl:120
41605 " virt-make-fs --partition -- input disk.img\n"
41610 #: ../tools/virt-make-fs.pl:122
41612 "If the output disk image could be terabyte-sized or larger, it's better to "
41613 "use an EFI/GPT-compatible partition table:"
41617 #: ../tools/virt-make-fs.pl:125
41620 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
41625 #: ../tools/virt-make-fs.pl:127
41626 msgid "EXTRA SPACE"
41630 #: ../tools/virt-make-fs.pl:129
41632 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
41633 "the files that it contains, but might have extra space. Depending on how "
41634 "you are going to use the output, you might think this extra space is wasted "
41635 "and want to minimize it, or you might want to leave space so that more files "
41636 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
41637 "but you can use the I<--size> flag to leave space in the filesystem if you "
41642 #: ../tools/virt-make-fs.pl:137
41644 "An alternative way to leave extra space but not make the output image any "
41645 "bigger is to use an alternative disk image format (instead of the default "
41646 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
41647 "image format (check your hypervisor supports this before using it). This "
41648 "allows you to choose a large I<--size> but the extra space won't actually be "
41649 "allocated in the image until you try to store something in it."
41653 #: ../tools/virt-make-fs.pl:145
41655 "Don't forget that you can also use local commands including L<resize2fs(8)> "
41656 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
41657 "to build another image from scratch."
41661 #: ../tools/virt-make-fs.pl:151
41664 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
41669 #: ../tools/virt-make-fs.pl:179
41670 msgid "Enable debugging information."
41674 #: ../tools/virt-make-fs.pl:185
41675 msgid "B<--size=E<lt>NE<gt>>"
41679 #: ../tools/virt-make-fs.pl:187
41680 msgid "B<--size=+E<lt>NE<gt>>"
41684 #: ../tools/virt-make-fs.pl:189
41685 msgid "B<-s E<lt>NE<gt>>"
41689 #: ../tools/virt-make-fs.pl:191
41690 msgid "B<-s +E<lt>NE<gt>>"
41694 #: ../tools/virt-make-fs.pl:193
41695 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
41699 #: ../tools/virt-make-fs.pl:196
41701 "If this option is I<not> given, then the output image will be just large "
41702 "enough to contain all the files, with not much wasted space."
41706 #: ../tools/virt-make-fs.pl:199
41708 "To choose a fixed size output disk, specify an absolute number followed by "
41709 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
41710 "Petabytes or Exabytes. This must be large enough to contain all the input "
41711 "files, else you will get an error."
41715 #: ../tools/virt-make-fs.pl:204
41717 "To leave extra space, specify C<+> (plus sign) and a number followed by "
41718 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
41719 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
41720 "the input files, and (approximately) an extra 200 MB free space."
41724 #: ../tools/virt-make-fs.pl:210
41726 "Note that virt-make-fs estimates free space, and therefore will not produce "
41727 "filesystems containing precisely the free space requested. (It is much more "
41728 "expensive and time-consuming to produce a filesystem which has precisely the "
41729 "desired free space)."
41733 #: ../tools/virt-make-fs.pl:219
41734 msgid "B<--format=E<lt>fmtE<gt>>"
41738 #: ../tools/virt-make-fs.pl:221
41739 msgid "B<-F E<lt>fmtE<gt>>"
41743 #: ../tools/virt-make-fs.pl:223
41744 msgid "Choose the output disk image format."
41748 #: ../tools/virt-make-fs.pl:225
41749 msgid "The default is C<raw> (raw sparse disk image)."
41753 #: ../tools/virt-make-fs.pl:227
41755 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
41756 "that would really make sense here is C<qcow2>."
41760 #: ../tools/virt-make-fs.pl:234
41761 msgid "B<--type=E<lt>fsE<gt>>"
41765 #: ../tools/virt-make-fs.pl:236
41766 msgid "B<-t E<lt>fsE<gt>>"
41770 #: ../tools/virt-make-fs.pl:238
41771 msgid "Choose the output filesystem type."
41775 #: ../tools/virt-make-fs.pl:240
41776 msgid "The default is C<ext2>."
41780 #: ../tools/virt-make-fs.pl:242
41781 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
41785 #: ../tools/virt-make-fs.pl:249
41786 msgid "B<--partition>"
41790 #: ../tools/virt-make-fs.pl:251
41791 msgid "B<--partition=E<lt>parttypeE<gt>>"
41795 #: ../tools/virt-make-fs.pl:253
41797 "If specified, this flag adds an MBR partition table to the output disk "
41802 #: ../tools/virt-make-fs.pl:256
41804 "You can change the partition table type, eg. I<--partition=gpt> for large "
41809 #: ../tools/virt-make-fs.pl:259
41811 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
41812 "might consider the next parameter to be the partition type. For example:"
41816 #: ../tools/virt-make-fs.pl:263
41819 " virt-make-fs --partition input.tar output.img\n"
41824 #: ../tools/virt-make-fs.pl:265
41826 "would cause virt-make-fs to think you wanted to use a partition type of "
41827 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
41828 "dash) between options and the input and output arguments:"
41832 #: ../tools/virt-make-fs.pl:269
41835 " virt-make-fs --partition -- input.tar output.img\n"
41840 #: ../tools/virt-make-fs.pl:271
41841 msgid "For MBR, virt-make-fs sets the partition type byte automatically."
41845 #: ../tools/virt-make-fs.pl:559
41847 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
41848 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
41849 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
41853 #: ../tools/virt-make-fs.pl:573 ../tools/virt-win-reg.pl:774
41855 "When reporting bugs, please enable debugging and capture the I<complete> "
41860 #: ../tools/virt-make-fs.pl:576
41863 " export LIBGUESTFS_DEBUG=1\n"
41864 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
41869 #: ../tools/virt-make-fs.pl:579
41871 "Attach /tmp/virt-make-fs.log to a new bug report at "
41872 "L<https://bugzilla.redhat.com/>"
41876 #: ../tools/virt-tar.pl:33
41877 msgid "virt-tar - Extract or upload files to a virtual machine"
41881 #: ../tools/virt-tar.pl:37
41884 " virt-tar [--options] -x domname directory tarball\n"
41889 #: ../tools/virt-tar.pl:39
41892 " virt-tar [--options] -u domname tarball directory\n"
41897 #: ../tools/virt-tar.pl:41
41900 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
41905 #: ../tools/virt-tar.pl:43
41908 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
41913 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
41918 #: ../tools/virt-tar.pl:47
41920 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
41921 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
41925 #: ../tools/virt-tar.pl:52
41926 msgid "Download C</home> from the VM into a local tarball:"
41930 #: ../tools/virt-tar.pl:54
41933 " virt-tar -x domname /home home.tar\n"
41938 #: ../tools/virt-tar.pl:56
41941 " virt-tar -zx domname /home home.tar.gz\n"
41946 #: ../tools/virt-tar.pl:58
41947 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
41951 #: ../tools/virt-tar.pl:60
41954 " virt-tar -u domname uploadstuff.tar /tmp\n"
41959 #: ../tools/virt-tar.pl:62
41962 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
41967 #: ../tools/virt-tar.pl:66
41969 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
41970 "virtual machines. If you do this, you risk disk corruption in the VM. "
41971 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
41975 #: ../tools/virt-tar.pl:71
41977 "You can use I<-x> (extract) on live virtual machines, but you might get "
41978 "inconsistent results or errors if there is filesystem activity inside the "
41979 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
41980 "work, but the only way to guarantee consistent results is if the virtual "
41981 "machine is shut down."
41985 #: ../tools/virt-tar.pl:79
41987 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
41988 "parts of a guest filesystem. There are many possibilities: making backups, "
41989 "uploading data files, snooping on guest activity, fixing or customizing "
41994 #: ../tools/virt-tar.pl:84
41996 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
41997 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
41998 "should look at the L<guestfish(1)> tool."
42002 #: ../tools/virt-tar.pl:88
42004 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
42005 "its contents (recursively) from the virtual machine into a local tarball. "
42006 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
42007 "virtual machine. You cannot use these two options together."
42011 #: ../tools/virt-tar.pl:94
42013 "In addition, you may need to use the I<-z> (gZip) option to enable "
42014 "compression. When uploading, you have to specify I<-z> if the upload file "
42015 "is compressed because virt-tar won't detect this on its own."
42019 #: ../tools/virt-tar.pl:98
42021 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
42022 "example it cannot do PKZip files or bzip2 compression. If you want that "
42023 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
42024 "the L<libguestfs(3)> API)."
42028 #: ../tools/virt-tar.pl:160
42029 msgid "B<--extract>"
42033 #: ../tools/virt-tar.pl:162
42034 msgid "B<--download>"
42038 #: ../tools/virt-tar.pl:164
42043 #: ../tools/virt-tar.pl:166
42044 msgid "B<--upload>"
42048 #: ../tools/virt-tar.pl:168
42050 "Use I<-x> to extract (download) a directory from a virtual machine to a "
42055 #: ../tools/virt-tar.pl:171
42057 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
42058 "Please read the L</WARNING> section above before using this option."
42062 #: ../tools/virt-tar.pl:175
42063 msgid "You must specify exactly one of these options."
42067 #: ../tools/virt-tar.pl:181
42072 #: ../tools/virt-tar.pl:183
42077 #: ../tools/virt-tar.pl:185
42078 msgid "Specify that the input or output tarball is gzip-compressed."
42082 #: ../tools/virt-tar.pl:298
42084 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
42085 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
42086 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
42087 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
42091 #: ../tools/virt-win-reg.pl:37
42093 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
42098 #: ../tools/virt-win-reg.pl:41
42101 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
42106 #: ../tools/virt-win-reg.pl:43
42109 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
42114 #: ../tools/virt-win-reg.pl:45
42117 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
42122 #: ../tools/virt-win-reg.pl:47
42125 " virt-win-reg --merge domname [input.reg ...]\n"
42130 #: ../tools/virt-win-reg.pl:49
42133 " virt-win-reg [--options] disk.img ... # instead of domname\n"
42138 #: ../tools/virt-win-reg.pl:53
42140 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
42141 "virtual machines. If you do this, you I<will> get irreversible disk "
42142 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
42143 "but doesn't catch all cases."
42147 #: ../tools/virt-win-reg.pl:58
42149 "Modifying the Windows Registry is an inherently risky operation. The format "
42150 "is deliberately obscure and undocumented, and Registry changes can leave the "
42151 "system unbootable. Therefore when using the I<--merge> option, make sure "
42152 "you have a reliable backup first."
42156 #: ../tools/virt-win-reg.pl:65
42158 "This program can export and merge Windows Registry entries from a Windows "
42163 #: ../tools/virt-win-reg.pl:68
42165 "The first parameter is the libvirt guest name or the raw disk image of a "
42170 #: ../tools/virt-win-reg.pl:71
42172 "If I<--merge> is I<not> specified, then the chosen registry key is "
42173 "displayed/exported (recursively). For example:"
42177 #: ../tools/virt-win-reg.pl:74
42180 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
42185 #: ../tools/virt-win-reg.pl:76
42186 msgid "You can also display single values from within registry keys, for example:"
42190 #: ../tools/virt-win-reg.pl:79
42193 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
42194 " $ virt-win-reg Windows7 $cvkey ProductName\n"
42195 " Windows 7 Enterprise\n"
42200 #: ../tools/virt-win-reg.pl:83
42202 "With I<--merge>, you can merge a textual regedit file into the Windows "
42207 #: ../tools/virt-win-reg.pl:86
42210 " $ virt-win-reg --merge Windows7 changes.reg\n"
42215 #: ../tools/virt-win-reg.pl:90
42217 "This program is only meant for simple access to the registry. If you want "
42218 "to do complicated things with the registry, we suggest you download the "
42219 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
42220 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
42221 "L<hivexregedit(1)>."
42225 #: ../tools/virt-win-reg.pl:159
42230 #: ../tools/virt-win-reg.pl:161
42232 "In merge mode, this merges a textual regedit file into the Windows Registry "
42233 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
42234 "displays or exports Registry entries instead."
42238 #: ../tools/virt-win-reg.pl:165
42240 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
42241 "result in disk corruption. However exporting (without this flag) is always "
42246 #: ../tools/virt-win-reg.pl:173
42247 msgid "B<--encoding> UTF-16LE|ASCII"
42251 #: ../tools/virt-win-reg.pl:175
42253 "When merging (only), you may need to specify the encoding for strings to be "
42254 "used in the hive file. This is explained in detail in "
42255 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
42259 #: ../tools/virt-win-reg.pl:179
42261 "The default is to use UTF-16LE, which should work with recent versions of "
42266 #: ../tools/virt-win-reg.pl:186
42267 msgid "B<--unsafe-printable-strings>"
42271 #: ../tools/virt-win-reg.pl:188
42273 "When exporting (only), assume strings are UTF-16LE and print them as strings "
42274 "instead of hex sequences. Remove the final zero codepoint from strings if "
42279 #: ../tools/virt-win-reg.pl:192
42281 "This is unsafe and does not preserve the fidelity of strings in the original "
42282 "Registry for various reasons:"
42286 #: ../tools/virt-win-reg.pl:199
42288 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
42289 "other encodings will be corrupted by this transformation."
42293 #: ../tools/virt-win-reg.pl:204
42295 "Assumes that everything which has type 1 or 2 is really a string and that "
42296 "everything else is not a string, but the type field in real Registries is "
42301 #: ../tools/virt-win-reg.pl:210
42303 "Loses information about whether a zero codepoint followed the string in the "
42308 #: ../tools/virt-win-reg.pl:215
42310 "This all happens because the Registry itself contains no information about "
42311 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
42315 #: ../tools/virt-win-reg.pl:219
42317 "You should only use this option for quick hacking and debugging of the "
42318 "Registry contents, and I<never> use it if the output is going to be passed "
42319 "into another program or stored in another Registry."
42323 #: ../tools/virt-win-reg.pl:556
42324 msgid "SUPPORTED SYSTEMS"
42328 #: ../tools/virt-win-reg.pl:558
42330 "The program currently supports Windows NT-derived guests starting with "
42331 "Windows XP through to at least Windows 7."
42335 #: ../tools/virt-win-reg.pl:561
42336 msgid "The following Registry keys are supported:"
42340 #: ../tools/virt-win-reg.pl:565
42341 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
42345 #: ../tools/virt-win-reg.pl:567
42346 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
42350 #: ../tools/virt-win-reg.pl:569
42351 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
42355 #: ../tools/virt-win-reg.pl:571
42356 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
42360 #: ../tools/virt-win-reg.pl:573
42361 msgid "C<HKEY_USERS\\.DEFAULT>"
42365 #: ../tools/virt-win-reg.pl:575
42366 msgid "C<HKEY_USERS\\I<SID>>"
42370 #: ../tools/virt-win-reg.pl:577
42371 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
42375 #: ../tools/virt-win-reg.pl:579
42376 msgid "C<HKEY_USERS\\I<username>>"
42380 #: ../tools/virt-win-reg.pl:581
42381 msgid "where I<username> is a local user name (this is a libguestfs extension)."
42385 #: ../tools/virt-win-reg.pl:585
42387 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
42392 #: ../tools/virt-win-reg.pl:588
42394 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
42395 "supported (there is no \"current user\")."
42399 #: ../tools/virt-win-reg.pl:591
42404 #: ../tools/virt-win-reg.pl:593
42406 "C<virt-win-reg> expects that regedit files have already been reencoded in "
42407 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
42408 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
42409 "with Windows-style line endings, you may need to reencode the whole file "
42410 "before or after processing."
42414 #: ../tools/virt-win-reg.pl:599
42416 "To reencode a file from Windows format to Linux (before processing it with "
42417 "the I<--merge> option), you would do something like this:"
42421 #: ../tools/virt-win-reg.pl:602
42424 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
42429 #: ../tools/virt-win-reg.pl:604
42431 "To go in the opposite direction, after exporting and before sending the file "
42432 "to a Windows user, do something like this:"
42436 #: ../tools/virt-win-reg.pl:607
42439 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
42444 #: ../tools/virt-win-reg.pl:609
42445 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
42449 #: ../tools/virt-win-reg.pl:611
42451 "If you are unsure about the current encoding, use the L<file(1)> command. "
42452 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
42453 "Windows-style (CRLF) line endings, like this:"
42457 #: ../tools/virt-win-reg.pl:615
42460 " $ file software.reg\n"
42461 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
42462 " with CRLF line terminators\n"
42467 #: ../tools/virt-win-reg.pl:619
42468 msgid "This file would need conversion before you could I<--merge> it."
42472 #: ../tools/virt-win-reg.pl:621
42473 msgid "CurrentControlSet etc."
42477 #: ../tools/virt-win-reg.pl:623
42479 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
42480 "Registry at the level of the hive file, and therefore you cannot modify "
42485 #: ../tools/virt-win-reg.pl:627
42487 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
42488 "circumstances it might refer to another control set. The way to find out is "
42489 "to look at the C<HKLM\\SYSTEM\\Select> key:"
42493 #: ../tools/virt-win-reg.pl:631
42496 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
42497 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
42498 " \"Current\"=dword:00000001\n"
42499 " \"Default\"=dword:00000001\n"
42500 " \"Failed\"=dword:00000000\n"
42501 " \"LastKnownGood\"=dword:00000002\n"
42506 #: ../tools/virt-win-reg.pl:638
42507 msgid "\"Current\" is the one which Windows will choose when it boots."
42511 #: ../tools/virt-win-reg.pl:640
42512 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
42516 #: ../tools/virt-win-reg.pl:643
42517 msgid "DELETING REGISTRY KEYS AND VALUES"
42521 #: ../tools/virt-win-reg.pl:645
42522 msgid "To delete a whole registry key, use the syntax:"
42526 #: ../tools/virt-win-reg.pl:647
42529 " [-HKEY_LOCAL_MACHINE\\Foo]\n"
42534 #: ../tools/virt-win-reg.pl:649
42535 msgid "To delete a single value within a key, use the syntax:"
42539 #: ../tools/virt-win-reg.pl:651
42542 " [HKEY_LOCAL_MACHINE\\Foo]\n"
42548 #: ../tools/virt-win-reg.pl:654
42549 msgid "WINDOWS TIPS"
42553 #: ../tools/virt-win-reg.pl:656
42555 "Note that some of these tips modify the guest disk image. The guest I<must> "
42556 "be shut off, else you will get disk corruption."
42560 #: ../tools/virt-win-reg.pl:659
42561 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
42565 #: ../tools/virt-win-reg.pl:661
42567 "Prepare a DOS batch script, VBScript or executable. Upload this using "
42568 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
42569 "is uploaded into C<C:\\>:"
42573 #: ../tools/virt-win-reg.pl:665
42576 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
42581 #: ../tools/virt-win-reg.pl:667
42582 msgid "Prepare a regedit file containing the registry change:"
42586 #: ../tools/virt-win-reg.pl:669
42589 " cat > test.reg <<'EOF'\n"
42590 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
42591 " \"Test\"=\"c:\\\\test.bat\"\n"
42597 #: ../tools/virt-win-reg.pl:674
42599 "In this example we use the key C<RunOnce> which means that the script will "
42600 "run precisely once when the first user logs in. If you want it to run every "
42601 "time a user logs in, replace C<RunOnce> with C<Run>."
42605 #: ../tools/virt-win-reg.pl:678
42606 msgid "Now update the registry:"
42610 #: ../tools/virt-win-reg.pl:680
42613 " virt-win-reg --merge WindowsGuest test.reg\n"
42618 #: ../tools/virt-win-reg.pl:682
42619 msgid "INSTALLING A SERVICE"
42623 #: ../tools/virt-win-reg.pl:684
42625 "This section assumes you are familiar with Windows services, and you either "
42626 "have a program which handles the Windows Service Control Protocol directly "
42627 "or you want to run any program using a service wrapper like SrvAny or the "
42632 #: ../tools/virt-win-reg.pl:689
42634 "First upload the program and optionally the service wrapper. In this case "
42635 "the test program is called C<test.exe> and we are using the RHSrvAny "
42640 #: ../tools/virt-win-reg.pl:693
42643 " guestfish -i -d WindowsGuest <<EOF\n"
42644 " upload rhsrvany.exe /rhsrvany.exe\n"
42645 " upload test.exe /test.exe\n"
42651 #: ../tools/virt-win-reg.pl:698
42653 "Prepare a regedit file containing the registry changes. In this example, "
42654 "the first registry change is needed for the service itself or the service "
42655 "wrapper (if used). The second registry change is only needed because I am "
42656 "using the RHSrvAny service wrapper."
42660 #: ../tools/virt-win-reg.pl:703
42663 " cat > service.reg <<'EOF'\n"
42664 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
42665 " \"Type\"=dword:00000010\n"
42666 " \"Start\"=dword:00000002\n"
42667 " \"ErrorControl\"=dword:00000001\n"
42668 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
42669 " \"DisplayName\"=\"RHSrvAny\"\n"
42670 " \"ObjectName\"=\"NetworkService\"\n"
42675 #: ../tools/virt-win-reg.pl:712
42678 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
42679 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
42680 " \"PWD\"=\"c:\\\\Temp\"\n"
42686 #: ../tools/virt-win-reg.pl:723
42688 "For use of C<ControlSet001> see the section above in this manual page. You "
42689 "may need to adjust this according to the control set that is in use by the "
42694 #: ../tools/virt-win-reg.pl:729
42696 "C<\"ObjectName\"> controls the privileges that the service will have. An "
42697 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
42698 "privileged account."
42702 #: ../tools/virt-win-reg.pl:735
42704 "For the meaning of the magic numbers, see this Microsoft KB article: "
42705 "L<http://support.microsoft.com/kb/103000>."
42709 #: ../tools/virt-win-reg.pl:740
42710 msgid "Update the registry:"
42714 #: ../tools/virt-win-reg.pl:742
42717 " virt-win-reg --merge WindowsGuest service.reg\n"
42722 #: ../tools/virt-win-reg.pl:746
42724 "Be careful when passing parameters containing C<\\> (backslash) in the "
42725 "shell. Usually you will have to use 'single quotes' or double backslashes "
42726 "(but not both) to protect them from the shell."
42730 #: ../tools/virt-win-reg.pl:750
42731 msgid "Paths and value names are case-insensitive."
42735 #: ../tools/virt-win-reg.pl:759
42737 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
42738 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
42739 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
42740 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
42744 #: ../tools/virt-win-reg.pl:777
42747 " export LIBGUESTFS_DEBUG=1\n"
42748 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
42753 #: ../tools/virt-win-reg.pl:780
42755 "Attach /tmp/virt-win-reg.log to a new bug report at "
42756 "L<https://bugzilla.redhat.com/>"