1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: libguestfs 1.13.22\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-10-19 17:23+0200\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
21 #: ../align/virt-alignment-scan.pod:3 ../cat/virt-cat.pod:3 ../cat/virt-filesystems.pod:3 ../cat/virt-ls.pod:3 ../clone/virt-sysprep.pod:3 ../df/virt-df.pod:3 ../edit/virt-edit.pod:3 ../erlang/examples/guestfs-erlang.pod:3 ../examples/guestfs-examples.pod:3 ../examples/guestfs-recipes.pod:14 ../fish/guestfish.pod:3 ../fish/virt-copy-in.pod:3 ../fish/virt-copy-out.pod:3 ../fish/virt-tar-in.pod:3 ../fish/virt-tar-out.pod:3 ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pod:3 ../java/examples/guestfs-java.pod:3 ../ocaml/examples/guestfs-ocaml.pod:3 ../perl/examples/guestfs-perl.pod:3 ../python/examples/guestfs-python.pod:3 ../rescue/virt-rescue.pod:3 ../resize/virt-resize.pod:3 ../ruby/examples/guestfs-ruby.pod:3 ../sparsify/virt-sparsify.pod:3 ../src/guestfs.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30 ../tools/virt-make-fs.pl:35 ../tools/virt-tar.pl:31 ../tools/virt-win-reg.pl:35
26 #: ../align/virt-alignment-scan.pod:5
27 msgid "virt-alignment-scan - Check alignment of virtual machine partitions"
31 #: ../align/virt-alignment-scan.pod:7 ../cat/virt-cat.pod:7 ../cat/virt-filesystems.pod:7 ../cat/virt-ls.pod:7 ../clone/virt-sysprep.pod:7 ../df/virt-df.pod:7 ../edit/virt-edit.pod:7 ../erlang/examples/guestfs-erlang.pod:7 ../examples/guestfs-examples.pod:7 ../fish/guestfish.pod:7 ../fish/virt-copy-in.pod:7 ../fish/virt-copy-out.pod:7 ../fish/virt-tar-in.pod:7 ../fish/virt-tar-out.pod:7 ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pod:7 ../java/examples/guestfs-java.pod:7 ../ocaml/examples/guestfs-ocaml.pod:7 ../perl/examples/guestfs-perl.pod:7 ../python/examples/guestfs-python.pod:7 ../rescue/virt-rescue.pod:7 ../resize/virt-resize.pod:7 ../ruby/examples/guestfs-ruby.pod:7 ../sparsify/virt-sparsify.pod:7 ../src/guestfs.pod:7 ../test-tool/libguestfs-test-tool.pod:7 ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34 ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35 ../tools/virt-win-reg.pl:39
36 #: ../align/virt-alignment-scan.pod:9
39 " virt-alignment-scan [--options] -d domname\n"
44 #: ../align/virt-alignment-scan.pod:11
47 " virt-alignment-scan [--options] -a disk.img [-a disk.img ...]\n"
52 #: ../align/virt-alignment-scan.pod:13 ../cat/virt-cat.pod:19 ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19 ../clone/virt-sysprep.pod:13 ../df/virt-df.pod:21 ../edit/virt-edit.pod:27 ../erlang/examples/guestfs-erlang.pod:16 ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18 ../fish/guestfish.pod:30 ../fish/virt-copy-in.pod:19 ../fish/virt-copy-out.pod:13 ../fish/virt-tar-in.pod:21 ../fish/virt-tar-out.pod:15 ../fuse/guestmount.pod:20 ../inspector/virt-inspector.pod:19 ../java/examples/guestfs-java.pod:15 ../ocaml/examples/guestfs-ocaml.pod:25 ../perl/examples/guestfs-perl.pod:18 ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:29 ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15 ../sparsify/virt-sparsify.pod:11 ../src/guestfs.pod:23 ../test-tool/libguestfs-test-tool.pod:11 ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40 ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77 ../tools/virt-win-reg.pl:63
57 #: ../align/virt-alignment-scan.pod:15
59 "When older operating systems install themselves, the partitioning tools "
60 "place partitions at a sector misaligned with the underlying storage "
61 "(commonly the first partition starts on sector C<63>). Misaligned "
62 "partitions can result in an operating system issuing more I/O than should be "
67 #: ../align/virt-alignment-scan.pod:21
69 "The virt-alignment-scan tool checks the alignment of partitions in virtual "
70 "machines and disk images and warns you if there are alignment problems."
74 #: ../align/virt-alignment-scan.pod:25
76 "Currently there is no virt tool for fixing alignment problems. You can only "
77 "reinstall the guest operating system. The following NetApp document "
78 "summarises the problem and possible solutions: "
79 "L<http://media.netapp.com/documents/tr-3747.pdf>"
83 #: ../align/virt-alignment-scan.pod:30
88 #: ../align/virt-alignment-scan.pod:32
89 msgid "To run this tool on a disk image directly, use the I<-a> option:"
93 #: ../align/virt-alignment-scan.pod:34
96 " $ virt-alignment-scan -a winxp.img\n"
97 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
102 #: ../align/virt-alignment-scan.pod:37
105 " $ virt-alignment-scan -a fedora16.img\n"
106 " /dev/sda1 1048576 1024K ok\n"
107 " /dev/sda2 2097152 2048K ok\n"
108 " /dev/sda3 526385152 2048K ok\n"
113 #: ../align/virt-alignment-scan.pod:42
115 "To run the tool on a guest known to libvirt, use the I<-d> option and "
116 "possibly the I<-c> option:"
120 #: ../align/virt-alignment-scan.pod:45
123 " # virt-alignment-scan -d RHEL5\n"
124 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
125 " /dev/sda2 106928640 512 bad (alignment < 4K)\n"
130 #: ../align/virt-alignment-scan.pod:49
133 " $ virt-alignment-scan -c qemu:///system -d Win7TwoDisks\n"
134 " /dev/sda1 1048576 1024K ok\n"
135 " /dev/sda2 105906176 1024K ok\n"
136 " /dev/sdb1 65536 64K ok\n"
141 #: ../align/virt-alignment-scan.pod:54
143 "The output consists of 4 or more whitespace-separated columns. Only the "
144 "first 4 columns are signficant if you want to parse this from a program. "
149 #: ../align/virt-alignment-scan.pod:60
154 #: ../align/virt-alignment-scan.pod:62
156 "the device and partition name (eg. C</dev/sda1> meaning the first partition "
157 "on the first block device)"
161 #: ../align/virt-alignment-scan.pod:65
166 #: ../align/virt-alignment-scan.pod:67
167 msgid "the start of the partition in bytes"
171 #: ../align/virt-alignment-scan.pod:69
176 #: ../align/virt-alignment-scan.pod:71
177 msgid "the alignment in bytes or Kbytes (eg. C<512> or C<4K>)"
181 #: ../align/virt-alignment-scan.pod:73
186 #: ../align/virt-alignment-scan.pod:75
188 "C<ok> if the alignment is best for performance, or C<bad> if the alignment "
189 "can cause performance problems"
193 #: ../align/virt-alignment-scan.pod:78
198 #: ../align/virt-alignment-scan.pod:80
199 msgid "optional free-text explanation."
203 #: ../align/virt-alignment-scan.pod:84
205 "The exit code from the program changes depending on whether poorly aligned "
206 "partitions were found. See L</EXIT STATUS> below."
210 #: ../align/virt-alignment-scan.pod:87
211 msgid "If you just want the exit code with no output, use the I<-q> option."
215 #: ../align/virt-alignment-scan.pod:89 ../cat/virt-cat.pod:62 ../cat/virt-filesystems.pod:91 ../cat/virt-ls.pod:261 ../clone/virt-sysprep.pod:42 ../df/virt-df.pod:59 ../edit/virt-edit.pod:62 ../fish/guestfish.pod:148 ../fish/virt-copy-in.pod:45 ../fish/virt-copy-out.pod:34 ../fish/virt-tar-in.pod:42 ../fish/virt-tar-out.pod:36 ../fuse/guestmount.pod:92 ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:84 ../resize/virt-resize.pod:241 ../sparsify/virt-sparsify.pod:99 ../test-tool/libguestfs-test-tool.pod:36 ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54 ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103 ../tools/virt-win-reg.pl:96
220 #: ../align/virt-alignment-scan.pod:93 ../cat/virt-cat.pod:66 ../cat/virt-filesystems.pod:95 ../cat/virt-ls.pod:265 ../clone/virt-sysprep.pod:46 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66 ../fish/guestfish.pod:152 ../fuse/guestmount.pod:160 ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:88 ../resize/virt-resize.pod:245 ../sparsify/virt-sparsify.pod:103 ../test-tool/libguestfs-test-tool.pod:40 ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62 ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111 ../tools/virt-win-reg.pl:104
225 #: ../align/virt-alignment-scan.pod:95 ../cat/virt-cat.pod:68 ../cat/virt-filesystems.pod:97 ../cat/virt-ls.pod:267 ../clone/virt-sysprep.pod:48 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68 ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod:90 ../tools/virt-list-filesystems.pl:63 ../tools/virt-list-partitions.pl:64 ../tools/virt-make-fs.pl:163 ../tools/virt-tar.pl:113 ../tools/virt-win-reg.pl:106
226 msgid "Display brief help."
230 #: ../align/virt-alignment-scan.pod:97 ../cat/virt-cat.pod:70 ../cat/virt-filesystems.pod:99 ../cat/virt-ls.pod:269 ../clone/virt-sysprep.pod:50 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70 ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:92
235 #: ../align/virt-alignment-scan.pod:99 ../cat/virt-cat.pod:72 ../cat/virt-filesystems.pod:101 ../cat/virt-ls.pod:271 ../clone/virt-sysprep.pod:52 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72 ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:94
236 msgid "B<--add> file"
240 #: ../align/virt-alignment-scan.pod:101 ../clone/virt-sysprep.pod:54
241 msgid "Add I<file> which should be a disk image from a virtual machine."
245 #: ../align/virt-alignment-scan.pod:103 ../cat/virt-cat.pod:78 ../cat/virt-filesystems.pod:107 ../cat/virt-ls.pod:277 ../clone/virt-sysprep.pod:56 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78 ../fish/guestfish.pod:174 ../fuse/guestmount.pod:102 ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:100
247 "The format of the disk image is auto-detected. To override this and force a "
248 "particular format use the I<--format=..> option."
252 #: ../align/virt-alignment-scan.pod:106 ../cat/virt-cat.pod:81 ../cat/virt-filesystems.pod:125 ../cat/virt-ls.pod:291 ../clone/virt-sysprep.pod:59 ../df/virt-df.pod:78 ../rescue/virt-rescue.pod:107
257 #: ../align/virt-alignment-scan.pod:108 ../cat/virt-cat.pod:83 ../cat/virt-filesystems.pod:127 ../cat/virt-ls.pod:293 ../clone/virt-sysprep.pod:61 ../df/virt-df.pod:80 ../rescue/virt-rescue.pod:109
258 msgid "B<--connect> URI"
262 #: ../align/virt-alignment-scan.pod:110 ../cat/virt-cat.pod:85 ../cat/virt-filesystems.pod:129 ../cat/virt-ls.pod:295 ../clone/virt-sysprep.pod:63 ../df/virt-df.pod:82 ../edit/virt-edit.pod:99 ../inspector/virt-inspector.pod:78 ../rescue/virt-rescue.pod:111 ../tools/virt-list-filesystems.pl:81 ../tools/virt-list-partitions.pl:82 ../tools/virt-tar.pl:131 ../tools/virt-win-reg.pl:132
264 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
265 "to the default libvirt hypervisor."
269 #: ../align/virt-alignment-scan.pod:113 ../cat/virt-cat.pod:88 ../cat/virt-filesystems.pod:132 ../cat/virt-ls.pod:298 ../clone/virt-sysprep.pod:66 ../df/virt-df.pod:85 ../rescue/virt-rescue.pod:114
271 "If you specify guest block devices directly (I<-a>), then libvirt is not "
276 #: ../align/virt-alignment-scan.pod:116 ../cat/virt-cat.pod:91 ../cat/virt-filesystems.pod:141 ../cat/virt-ls.pod:307 ../clone/virt-sysprep.pod:69 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105 ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:117
281 #: ../align/virt-alignment-scan.pod:118 ../cat/virt-cat.pod:93 ../cat/virt-filesystems.pod:143 ../cat/virt-ls.pod:309 ../clone/virt-sysprep.pod:71 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107 ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:119
282 msgid "B<--domain> guest"
286 #: ../align/virt-alignment-scan.pod:120 ../cat/virt-cat.pod:95 ../cat/virt-filesystems.pod:145 ../cat/virt-ls.pod:311 ../clone/virt-sysprep.pod:73 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109 ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:121
288 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
293 #: ../align/virt-alignment-scan.pod:123 ../cat/virt-cat.pod:105 ../cat/virt-filesystems.pod:170 ../cat/virt-ls.pod:328 ../clone/virt-sysprep.pod:95 ../df/virt-df.pod:101 ../fish/guestfish.pod:233 ../fuse/guestmount.pod:142 ../inspector/virt-inspector.pod:99 ../rescue/virt-rescue.pod:124
294 msgid "B<--format=raw|qcow2|..>"
298 #: ../align/virt-alignment-scan.pod:125 ../cat/virt-cat.pod:107 ../cat/virt-filesystems.pod:172 ../cat/virt-ls.pod:330 ../clone/virt-sysprep.pod:97 ../df/virt-df.pod:103 ../edit/virt-edit.pod:134 ../fish/guestfish.pod:235 ../fuse/guestmount.pod:144 ../inspector/virt-inspector.pod:101 ../rescue/virt-rescue.pod:126
303 #: ../align/virt-alignment-scan.pod:127 ../cat/virt-cat.pod:109 ../cat/virt-filesystems.pod:174 ../cat/virt-ls.pod:332 ../clone/virt-sysprep.pod:99 ../df/virt-df.pod:105 ../edit/virt-edit.pod:136 ../fish/guestfish.pod:237 ../fuse/guestmount.pod:146 ../rescue/virt-rescue.pod:128
305 "The default for the I<-a> option is to auto-detect the format of the disk "
306 "image. Using this forces the disk format for I<-a> options which follow on "
307 "the command line. Using I<--format> with no argument switches back to "
308 "auto-detection for subsequent I<-a> options."
312 #: ../align/virt-alignment-scan.pod:132 ../cat/virt-cat.pod:114 ../cat/virt-filesystems.pod:179 ../cat/virt-ls.pod:337 ../clone/virt-sysprep.pod:104 ../df/virt-df.pod:110 ../edit/virt-edit.pod:141 ../fish/guestfish.pod:242 ../fish/guestfish.pod:673 ../inspector/virt-inspector.pod:336 ../rescue/virt-rescue.pod:133 ../src/guestfs.pod:2862
317 #: ../align/virt-alignment-scan.pod:134
320 " virt-alignment-scan --format=raw -a disk.img\n"
325 #: ../align/virt-alignment-scan.pod:136 ../cat/virt-cat.pod:118 ../cat/virt-filesystems.pod:183 ../cat/virt-ls.pod:341 ../clone/virt-sysprep.pod:108 ../df/virt-df.pod:114 ../edit/virt-edit.pod:145 ../fish/guestfish.pod:246 ../rescue/virt-rescue.pod:137
326 msgid "forces raw format (no auto-detection) for C<disk.img>."
330 #: ../align/virt-alignment-scan.pod:138
333 " virt-alignment-scan --format=raw -a disk.img --format -a another.img\n"
338 #: ../align/virt-alignment-scan.pod:140 ../cat/virt-cat.pod:122 ../cat/virt-filesystems.pod:187 ../cat/virt-ls.pod:345 ../clone/virt-sysprep.pod:112 ../df/virt-df.pod:118 ../edit/virt-edit.pod:149 ../fish/guestfish.pod:250 ../rescue/virt-rescue.pod:141
340 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
341 "auto-detection for C<another.img>."
345 #: ../align/virt-alignment-scan.pod:143 ../cat/virt-cat.pod:125 ../cat/virt-filesystems.pod:190 ../cat/virt-ls.pod:348 ../clone/virt-sysprep.pod:115 ../df/virt-df.pod:121 ../edit/virt-edit.pod:152 ../rescue/virt-rescue.pod:144
347 "If you have untrusted raw-format guest disk images, you should use this "
348 "option to specify the disk format. This avoids a possible security problem "
349 "with malicious guests (CVE-2010-3851)."
353 #: ../align/virt-alignment-scan.pod:147 ../resize/virt-resize.pod:414 ../sparsify/virt-sparsify.pod:153
358 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:416 ../sparsify/virt-sparsify.pod:155
363 #: ../align/virt-alignment-scan.pod:151
365 "Don't produce any output. Just set the exit code (see L</EXIT STATUS> "
370 #: ../align/virt-alignment-scan.pod:154 ../cat/virt-cat.pod:134 ../cat/virt-filesystems.pod:261 ../cat/virt-ls.pod:425 ../clone/virt-sysprep.pod:138 ../df/virt-df.pod:173 ../edit/virt-edit.pod:161 ../fish/guestfish.pod:390 ../fuse/guestmount.pod:266 ../inspector/virt-inspector.pod:119 ../rescue/virt-rescue.pod:182 ../sparsify/virt-sparsify.pod:159
375 #: ../align/virt-alignment-scan.pod:156 ../cat/virt-cat.pod:136 ../cat/virt-filesystems.pod:263 ../cat/virt-ls.pod:427 ../clone/virt-sysprep.pod:140 ../df/virt-df.pod:175 ../edit/virt-edit.pod:163 ../fish/guestfish.pod:392 ../fuse/guestmount.pod:268 ../inspector/virt-inspector.pod:121 ../rescue/virt-rescue.pod:184 ../sparsify/virt-sparsify.pod:161
380 #: ../align/virt-alignment-scan.pod:158 ../cat/virt-cat.pod:138 ../cat/virt-filesystems.pod:265 ../cat/virt-ls.pod:429 ../clone/virt-sysprep.pod:142 ../df/virt-df.pod:177 ../edit/virt-edit.pod:165 ../inspector/virt-inspector.pod:123 ../rescue/virt-rescue.pod:186 ../sparsify/virt-sparsify.pod:163
381 msgid "Enable verbose messages for debugging."
385 #: ../align/virt-alignment-scan.pod:160 ../cat/virt-cat.pod:140 ../cat/virt-filesystems.pod:267 ../cat/virt-ls.pod:431 ../clone/virt-sysprep.pod:144 ../df/virt-df.pod:179 ../edit/virt-edit.pod:167 ../fish/guestfish.pod:397 ../fuse/guestmount.pod:272 ../inspector/virt-inspector.pod:125 ../rescue/virt-rescue.pod:188 ../resize/virt-resize.pod:484 ../sparsify/virt-sparsify.pod:165
390 #: ../align/virt-alignment-scan.pod:162 ../cat/virt-cat.pod:142 ../cat/virt-filesystems.pod:269 ../cat/virt-ls.pod:433 ../clone/virt-sysprep.pod:146 ../df/virt-df.pod:181 ../edit/virt-edit.pod:169 ../fish/guestfish.pod:399 ../fuse/guestmount.pod:274 ../inspector/virt-inspector.pod:127 ../rescue/virt-rescue.pod:190 ../resize/virt-resize.pod:486 ../sparsify/virt-sparsify.pod:167 ../tools/virt-list-filesystems.pl:69 ../tools/virt-list-partitions.pl:70 ../tools/virt-make-fs.pl:169 ../tools/virt-tar.pl:119 ../tools/virt-win-reg.pl:112
395 #: ../align/virt-alignment-scan.pod:164 ../cat/virt-cat.pod:144 ../cat/virt-filesystems.pod:271 ../cat/virt-ls.pod:435 ../clone/virt-sysprep.pod:148 ../df/virt-df.pod:183 ../edit/virt-edit.pod:171 ../inspector/virt-inspector.pod:129 ../rescue/virt-rescue.pod:192 ../resize/virt-resize.pod:488 ../sparsify/virt-sparsify.pod:169 ../tools/virt-list-filesystems.pl:71 ../tools/virt-list-partitions.pl:72 ../tools/virt-make-fs.pl:171 ../tools/virt-tar.pl:121 ../tools/virt-win-reg.pl:114
396 msgid "Display version number and exit."
400 #: ../align/virt-alignment-scan.pod:166 ../cat/virt-cat.pod:146 ../cat/virt-filesystems.pod:281 ../cat/virt-ls.pod:437 ../clone/virt-sysprep.pod:150 ../df/virt-df.pod:185 ../edit/virt-edit.pod:173 ../fish/guestfish.pod:412 ../fuse/guestmount.pod:287 ../inspector/virt-inspector.pod:131 ../rescue/virt-rescue.pod:203 ../sparsify/virt-sparsify.pod:171 ../tools/virt-tar.pl:158
405 #: ../align/virt-alignment-scan.pod:168 ../cat/virt-cat.pod:148 ../cat/virt-filesystems.pod:283 ../cat/virt-ls.pod:439 ../clone/virt-sysprep.pod:152 ../df/virt-df.pod:187 ../edit/virt-edit.pod:175 ../inspector/virt-inspector.pod:133 ../rescue/virt-rescue.pod:205 ../sparsify/virt-sparsify.pod:173
406 msgid "Enable tracing of libguestfs API calls."
410 #: ../align/virt-alignment-scan.pod:172
411 msgid "RECOMMENDED ALIGNMENT"
415 #: ../align/virt-alignment-scan.pod:174
417 "Operating systems older than Windows 2008 and Linux before ca.2010 place the "
418 "first sector of the first partition at sector 63, with a 512 byte sector "
419 "size. This happens because of a historical accident. Drives have to report "
420 "a cylinder / head / sector (CHS) geometry to the BIOS. The geometry is "
421 "completely meaningless on modern drives, but it happens that the geometry "
422 "reported always has 63 sectors per track. The operating system therefore "
423 "places the first partition at the start of the second \"track\", at sector "
428 #: ../align/virt-alignment-scan.pod:183
430 "When the guest OS is virtualized, the host operating system and hypervisor "
431 "may prefer accesses aligned to one of:"
435 #: ../align/virt-alignment-scan.pod:188
440 #: ../align/virt-alignment-scan.pod:190
442 "if the host OS uses local storage directly on hard drive partitions, and the "
443 "hard drive has 512 byte physical sectors."
447 #: ../align/virt-alignment-scan.pod:193
452 #: ../align/virt-alignment-scan.pod:195
454 "for local storage on new hard drives with 4Kbyte physical sectors; for "
455 "file-backed storage on filesystems with 4Kbyte block size; or for some types "
456 "of network-attached storage."
460 #: ../align/virt-alignment-scan.pod:199
465 #: ../align/virt-alignment-scan.pod:201
467 "for high-end network-attached storage. This is the optimal block size for "
468 "some NetApp hardware."
472 #: ../align/virt-alignment-scan.pod:204
477 #: ../align/virt-alignment-scan.pod:206
478 msgid "see L</1 MB PARTITION ALIGNMENT> below."
482 #: ../align/virt-alignment-scan.pod:210
484 "Partitions which are not aligned correctly to the underlying storage cause "
485 "extra I/O. For example:"
489 #: ../align/virt-alignment-scan.pod:213
493 " +--------------------------+------\n"
495 " | filesystem block |\n"
496 " ---+------------------+------+-------------------+-----+---\n"
497 " | host block | host block |\n"
499 " ---+-------------------------+-------------------------+---\n"
504 #: ../align/virt-alignment-scan.pod:222
506 "In this example, each time a 4K guest block is read, two blocks on the host "
507 "must be accessed (so twice as much I/O is done). When a 4K guest block is "
508 "written, two host blocks must first be read, the old and new data combined, "
509 "and the two blocks written back (4x I/O)."
513 #: ../align/virt-alignment-scan.pod:227
514 msgid "LINUX HOST BLOCK AND I/O SIZE"
518 #: ../align/virt-alignment-scan.pod:229
520 "New versions of the Linux kernel expose the physical and logical block size, "
521 "and minimum and recommended I/O size."
525 #: ../align/virt-alignment-scan.pod:232
526 msgid "For a typical hard drive with 512 byte sectors:"
530 #: ../align/virt-alignment-scan.pod:234
533 " $ cat /sys/block/sda/queue/physical_block_size\n"
535 " $ cat /sys/block/sda/queue/logical_block_size\n"
537 " $ cat /sys/block/sda/queue/minimum_io_size\n"
539 " $ cat /sys/block/sda/queue/optimal_io_size\n"
545 #: ../align/virt-alignment-scan.pod:243
546 msgid "For a NetApp LUN:"
550 #: ../align/virt-alignment-scan.pod:245
553 " $ cat /sys/block/sdc/queue/logical_block_size\n"
555 " $ cat /sys/block/sdc/queue/physical_block_size\n"
557 " $ cat /sys/block/sdc/queue/minimum_io_size\n"
559 " $ cat /sys/block/sdc/queue/optimal_io_size\n"
565 #: ../align/virt-alignment-scan.pod:254
567 "The NetApp allows 512 byte accesses (but they will be very inefficient), "
568 "prefers a minimum 4K I/O size, but the optimal I/O size is 64K."
572 #: ../align/virt-alignment-scan.pod:258
574 "For detailed information about what these numbers mean, see "
575 "L<http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/newstorage-iolimits.html>"
579 #: ../align/virt-alignment-scan.pod:261
581 "[Thanks to Mike Snitzer for providing NetApp data and additional "
586 #: ../align/virt-alignment-scan.pod:264
587 msgid "1 MB PARTITION ALIGNMENT"
591 #: ../align/virt-alignment-scan.pod:266
593 "Microsoft picked 1 MB as the default alignment for all partitions starting "
594 "with Windows 2008 Server, and Linux has followed this."
598 #: ../align/virt-alignment-scan.pod:269
600 "Assuming 512 byte sectors in the guest, you will now see the first partition "
601 "starting at sector 2048, and subsequent partitions (if any) will start at a "
602 "multiple of 2048 sectors."
606 #: ../align/virt-alignment-scan.pod:273
608 "1 MB alignment is compatible with all current alignment requirements (4K, "
609 "64K) and provides room for future growth in physical block sizes."
613 #: ../align/virt-alignment-scan.pod:276
614 msgid "SETTING ALIGNMENT"
618 #: ../align/virt-alignment-scan.pod:278
620 "Currently there is no virt tool for fixing alignment problems in guests. "
621 "This is a difficult problem to fix because simply moving partitions around "
622 "breaks the bootloader, necessitating either manual reinstallation of the "
623 "bootloader using a rescue disk, or complex and error-prone hacks."
627 #: ../align/virt-alignment-scan.pod:284
629 "L<virt-resize(1)> does not change the alignment of the first partition, but "
630 "it does align the second and subsequent partitions to a multiple of 64 or "
631 "128 sectors (depending on the version of virt-resize, 128 in virt-resize "
632 "E<ge> 1.13.19). For operating systems that have a separate boot partition, "
633 "virt-resize could be used to align the main OS partition, so that the "
634 "majority of OS accesses except at boot will be aligned."
638 #: ../align/virt-alignment-scan.pod:292
640 "The easiest way to correct partition alignment problems is to reinstall your "
641 "guest operating systems. If you install operating systems from templates, "
642 "ensure these have correct partition alignment too."
646 #: ../align/virt-alignment-scan.pod:297
648 "For older versions of Windows, the following NetApp document contains useful "
649 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
653 #: ../align/virt-alignment-scan.pod:300
655 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
656 "an explicit C<%pre> section that creates aligned partitions using "
657 "L<parted(8)>. Do not use the Kickstart C<part> command. The NetApp "
658 "document above contains an example."
662 #: ../align/virt-alignment-scan.pod:305 ../cat/virt-cat.pod:191 ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:483 ../clone/virt-sysprep.pod:475 ../df/virt-df.pod:215 ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:352 ../rescue/virt-rescue.pod:266 ../resize/virt-resize.pod:601 ../tools/virt-list-filesystems.pl:188 ../tools/virt-list-partitions.pl:258 ../tools/virt-make-fs.pl:532 ../tools/virt-tar.pl:289 ../tools/virt-win-reg.pl:733
663 msgid "SHELL QUOTING"
667 #: ../align/virt-alignment-scan.pod:307 ../cat/virt-cat.pod:193 ../cat/virt-filesystems.pod:367 ../cat/virt-ls.pod:485 ../clone/virt-sysprep.pod:477 ../df/virt-df.pod:217 ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:354 ../rescue/virt-rescue.pod:268 ../resize/virt-resize.pod:603 ../tools/virt-list-filesystems.pl:190 ../tools/virt-list-partitions.pl:260 ../tools/virt-make-fs.pl:534 ../tools/virt-tar.pl:291 ../tools/virt-win-reg.pl:741
669 "Libvirt guest names can contain arbitrary characters, some of which have "
670 "meaning to the shell such as C<#> and space. You may need to quote or "
671 "escape these characters on the command line. See the shell manual page "
672 "L<sh(1)> for details."
676 #: ../align/virt-alignment-scan.pod:312 ../cat/virt-cat.pod:198 ../cat/virt-filesystems.pod:372 ../cat/virt-ls.pod:490 ../clone/virt-sysprep.pod:482 ../df/virt-df.pod:222 ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1114 ../fuse/guestmount.pod:312 ../inspector/virt-inspector.pod:375 ../resize/virt-resize.pod:608 ../sparsify/virt-sparsify.pod:227 ../test-tool/libguestfs-test-tool.pod:90
681 #: ../align/virt-alignment-scan.pod:314
682 msgid "This program returns:"
686 #: ../align/virt-alignment-scan.pod:318 ../align/virt-alignment-scan.pod:324 ../align/virt-alignment-scan.pod:330 ../align/virt-alignment-scan.pod:337 ../clone/virt-sysprep.pod:283 ../clone/virt-sysprep.pod:287 ../clone/virt-sysprep.pod:291 ../clone/virt-sysprep.pod:295 ../clone/virt-sysprep.pod:310 ../clone/virt-sysprep.pod:314 ../clone/virt-sysprep.pod:318 ../clone/virt-sysprep.pod:322 ../clone/virt-sysprep.pod:326 ../clone/virt-sysprep.pod:362 ../clone/virt-sysprep.pod:384 ../clone/virt-sysprep.pod:388 ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266 ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276 ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291 ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102 ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132 ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227 ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235 ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:395 ../fish/guestfish-actions.pod:403 ../fish/guestfish-actions.pod:410 ../fish/guestfish-actions.pod:417 ../fish/guestfish-actions.pod:1144 ../fish/guestfish-actions.pod:1148 ../fish/guestfish-actions.pod:1152 ../fish/guestfish-actions.pod:1156 ../fish/guestfish-actions.pod:1164 ../fish/guestfish-actions.pod:1168 ../fish/guestfish-actions.pod:1172 ../fish/guestfish-actions.pod:1182 ../fish/guestfish-actions.pod:1186 ../fish/guestfish-actions.pod:1190 ../fish/guestfish-actions.pod:1280 ../fish/guestfish-actions.pod:1284 ../fish/guestfish-actions.pod:1289 ../fish/guestfish-actions.pod:1294 ../fish/guestfish-actions.pod:1336 ../fish/guestfish-actions.pod:1340 ../fish/guestfish-actions.pod:1345 ../fish/guestfish-actions.pod:1601 ../fish/guestfish-actions.pod:1608 ../fish/guestfish-actions.pod:1615 ../fish/guestfish-actions.pod:2018 ../fish/guestfish-actions.pod:2024 ../fish/guestfish-actions.pod:2032 ../fish/guestfish-actions.pod:2039 ../fish/guestfish-actions.pod:2046 ../fish/guestfish.pod:445 ../fish/guestfish.pod:449 ../fish/guestfish.pod:453 ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:393 ../inspector/virt-inspector.pod:397 ../resize/virt-resize.pod:282 ../resize/virt-resize.pod:286 ../resize/virt-resize.pod:295 ../resize/virt-resize.pod:301 ../sparsify/virt-sparsify.pod:32 ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43 ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54 ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:594 ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:609 ../src/guestfs-actions.pod:616 ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:1788 ../src/guestfs-actions.pod:1792 ../src/guestfs-actions.pod:1796 ../src/guestfs-actions.pod:1804 ../src/guestfs-actions.pod:1808 ../src/guestfs-actions.pod:1812 ../src/guestfs-actions.pod:1822 ../src/guestfs-actions.pod:1826 ../src/guestfs-actions.pod:1830 ../src/guestfs-actions.pod:1968 ../src/guestfs-actions.pod:1972 ../src/guestfs-actions.pod:1977 ../src/guestfs-actions.pod:1982 ../src/guestfs-actions.pod:2043 ../src/guestfs-actions.pod:2047 ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:2467 ../src/guestfs-actions.pod:2474 ../src/guestfs-actions.pod:2481 ../src/guestfs-actions.pod:3026 ../src/guestfs-actions.pod:3032 ../src/guestfs-actions.pod:3040 ../src/guestfs-actions.pod:3047 ../src/guestfs-actions.pod:3054 ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398 ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411 ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1094 ../src/guestfs.pod:1098 ../src/guestfs.pod:1102 ../src/guestfs.pod:1107 ../src/guestfs.pod:1115 ../src/guestfs.pod:1134 ../src/guestfs.pod:1142 ../src/guestfs.pod:1164 ../src/guestfs.pod:1168 ../src/guestfs.pod:1172 ../src/guestfs.pod:1176 ../src/guestfs.pod:1180 ../src/guestfs.pod:1184 ../src/guestfs.pod:1674 ../src/guestfs.pod:1679 ../src/guestfs.pod:1683 ../src/guestfs.pod:1785 ../src/guestfs.pod:1790 ../src/guestfs.pod:1794 ../src/guestfs.pod:1804 ../src/guestfs.pod:2093 ../src/guestfs.pod:2098 ../src/guestfs.pod:2104 ../src/guestfs.pod:2112 ../src/guestfs.pod:2630 ../src/guestfs.pod:2636 ../src/guestfs.pod:2641 ../src/guestfs.pod:2647 ../src/guestfs.pod:3047 ../src/guestfs.pod:3052 ../src/guestfs.pod:3056 ../src/guestfs.pod:3060 ../src/guestfs.pod:3064 ../src/guestfs.pod:3078 ../src/guestfs.pod:3083 ../src/guestfs.pod:3314 ../src/guestfs.pod:3318 ../src/guestfs.pod:3322 ../src/guestfs.pod:3326 ../tools/virt-win-reg.pl:197 ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208 ../tools/virt-win-reg.pl:710 ../tools/virt-win-reg.pl:716 ../tools/virt-win-reg.pl:722
691 #: ../align/virt-alignment-scan.pod:320
696 #: ../align/virt-alignment-scan.pod:322
697 msgid "successful exit, all partitions are aligned E<ge> 64K for best performance"
701 #: ../align/virt-alignment-scan.pod:326
706 #: ../align/virt-alignment-scan.pod:328
707 msgid "an error scanning the disk image or guest"
711 #: ../align/virt-alignment-scan.pod:332
716 #: ../align/virt-alignment-scan.pod:334
718 "successful exit, some partitions have alignment E<lt> 64K which can result "
719 "in poor performance on high end network storage"
723 #: ../align/virt-alignment-scan.pod:339
728 #: ../align/virt-alignment-scan.pod:341
730 "successful exit, some partitions have alignment E<lt> 4K which can result in "
731 "poor performance on most hypervisors"
735 #: ../align/virt-alignment-scan.pod:346 ../cat/virt-cat.pod:203 ../cat/virt-filesystems.pod:377 ../cat/virt-ls.pod:495 ../clone/virt-sysprep.pod:486 ../df/virt-df.pod:227 ../edit/virt-edit.pod:354 ../erlang/examples/guestfs-erlang.pod:97 ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384 ../fish/guestfish.pod:1268 ../fish/virt-copy-in.pod:50 ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47 ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:317 ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:45 ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39 ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:288 ../resize/virt-resize.pod:613 ../ruby/examples/guestfs-ruby.pod:36 ../sparsify/virt-sparsify.pod:251 ../src/guestfs.pod:3255 ../test-tool/libguestfs-test-tool.pod:100 ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265 ../tools/virt-make-fs.pl:539 ../tools/virt-tar.pl:296 ../tools/virt-win-reg.pl:746
740 #: ../align/virt-alignment-scan.pod:348
742 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
743 "L<virt-resize(1)>, L<http://libguestfs.org/>."
747 #: ../align/virt-alignment-scan.pod:355 ../cat/virt-cat.pod:212 ../cat/virt-filesystems.pod:388 ../cat/virt-ls.pod:507 ../clone/virt-sysprep.pod:501 ../df/virt-df.pod:235 ../edit/virt-edit.pod:368 ../rescue/virt-rescue.pod:296 ../resize/virt-resize.pod:635 ../sparsify/virt-sparsify.pod:264 ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277 ../tools/virt-make-fs.pl:564 ../tools/virt-tar.pl:311 ../tools/virt-win-reg.pl:772
752 #: ../align/virt-alignment-scan.pod:357 ../cat/virt-cat.pod:214 ../cat/virt-filesystems.pod:390 ../cat/virt-ls.pod:509 ../clone/virt-sysprep.pod:503 ../df/virt-df.pod:237 ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:395 ../rescue/virt-rescue.pod:298 ../resize/virt-resize.pod:637 ../sparsify/virt-sparsify.pod:266 ../tools/virt-list-filesystems.pl:210 ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:566 ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:774
753 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
757 #: ../align/virt-alignment-scan.pod:359 ../cat/virt-cat.pod:216 ../cat/virt-filesystems.pod:392 ../cat/virt-ls.pod:511 ../clone/virt-sysprep.pod:505 ../df/virt-df.pod:239 ../edit/virt-edit.pod:372 ../erlang/examples/guestfs-erlang.pod:114 ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401 ../fish/guestfish.pod:1300 ../fish/virt-copy-in.pod:64 ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62 ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:332 ../inspector/virt-inspector.pod:403 ../java/examples/guestfs-java.pod:62 ../ocaml/examples/guestfs-ocaml.pod:95 ../perl/examples/guestfs-perl.pod:56 ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod:300 ../resize/virt-resize.pod:639 ../ruby/examples/guestfs-ruby.pod:52 ../sparsify/virt-sparsify.pod:268 ../src/guestfs.pod:3337 ../test-tool/libguestfs-test-tool.pod:110 ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281 ../tools/virt-make-fs.pl:568 ../tools/virt-tar.pl:315 ../tools/virt-win-reg.pl:776
762 #: ../align/virt-alignment-scan.pod:361 ../clone/virt-sysprep.pod:507 ../sparsify/virt-sparsify.pod:270
763 msgid "Copyright (C) 2011 Red Hat Inc."
767 #: ../align/virt-alignment-scan.pod:363 ../cat/virt-cat.pod:220 ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:515 ../clone/virt-sysprep.pod:509 ../df/virt-df.pod:243 ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1305 ../fish/virt-copy-in.pod:69 ../fish/virt-copy-out.pod:58 ../fish/virt-tar-in.pod:67 ../fish/virt-tar-out.pod:60 ../fuse/guestmount.pod:337 ../inspector/virt-inspector.pod:407 ../rescue/virt-rescue.pod:304 ../resize/virt-resize.pod:643 ../sparsify/virt-sparsify.pod:272 ../test-tool/libguestfs-test-tool.pod:115 ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285 ../tools/virt-make-fs.pl:572 ../tools/virt-tar.pl:319 ../tools/virt-win-reg.pl:780
769 "This program is free software; you can redistribute it and/or modify it "
770 "under the terms of the GNU General Public License as published by the Free "
771 "Software Foundation; either version 2 of the License, or (at your option) "
776 #: ../align/virt-alignment-scan.pod:368 ../cat/virt-cat.pod:225 ../cat/virt-filesystems.pod:401 ../cat/virt-ls.pod:520 ../clone/virt-sysprep.pod:514 ../df/virt-df.pod:248 ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1310 ../fish/virt-copy-in.pod:74 ../fish/virt-copy-out.pod:63 ../fish/virt-tar-in.pod:72 ../fish/virt-tar-out.pod:65 ../fuse/guestmount.pod:342 ../inspector/virt-inspector.pod:412 ../rescue/virt-rescue.pod:309 ../resize/virt-resize.pod:648 ../sparsify/virt-sparsify.pod:277 ../test-tool/libguestfs-test-tool.pod:120 ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290 ../tools/virt-make-fs.pl:577 ../tools/virt-tar.pl:324 ../tools/virt-win-reg.pl:785
778 "This program is distributed in the hope that it will be useful, but WITHOUT "
779 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
780 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
785 #: ../align/virt-alignment-scan.pod:373 ../cat/virt-cat.pod:230 ../cat/virt-filesystems.pod:406 ../cat/virt-ls.pod:525 ../clone/virt-sysprep.pod:519 ../df/virt-df.pod:253 ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1315 ../fish/virt-copy-in.pod:79 ../fish/virt-copy-out.pod:68 ../fish/virt-tar-in.pod:77 ../fish/virt-tar-out.pod:70 ../fuse/guestmount.pod:347 ../inspector/virt-inspector.pod:417 ../rescue/virt-rescue.pod:314 ../resize/virt-resize.pod:653 ../sparsify/virt-sparsify.pod:282 ../test-tool/libguestfs-test-tool.pod:125 ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295 ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:329 ../tools/virt-win-reg.pl:790
787 "You should have received a copy of the GNU General Public License along with "
788 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
789 "Ave, Cambridge, MA 02139, USA."
793 #: ../cat/virt-cat.pod:5
794 msgid "virt-cat - Display files in a virtual machine"
798 #: ../cat/virt-cat.pod:9
801 " virt-cat [--options] -d domname file [file ...]\n"
806 #: ../cat/virt-cat.pod:11
809 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
814 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15 ../inspector/virt-inspector.pod:13
819 #: ../cat/virt-cat.pod:15
822 " virt-cat domname file\n"
827 #: ../cat/virt-cat.pod:17
830 " virt-cat disk.img file\n"
835 #: ../cat/virt-cat.pod:21
837 "C<virt-cat> is a command line tool to display the contents of C<file> where "
838 "C<file> exists in the named virtual machine (or disk image)."
842 #: ../cat/virt-cat.pod:24
844 "Multiple filenames can be given, in which case they are concatenated "
845 "together. Each filename must be a full path, starting at the root directory "
846 "(starting with '/')."
850 #: ../cat/virt-cat.pod:28
852 "C<virt-cat> can be used to quickly view a file. To edit a file, use "
853 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
854 "tool (see L</USING GUESTFISH> below)."
858 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43 ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41 ../fish/guestfish.pod:1051 ../fish/virt-copy-in.pod:29 ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30 ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39 ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75 ../tools/virt-tar.pl:50
863 #: ../cat/virt-cat.pod:34
864 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
868 #: ../cat/virt-cat.pod:37
871 " virt-cat -d mydomain /etc/fstab\n"
876 #: ../cat/virt-cat.pod:39
877 msgid "List syslog messages from a VM disk image file:"
881 #: ../cat/virt-cat.pod:41
884 " virt-cat -a disk.img /var/log/messages | tail\n"
889 #: ../cat/virt-cat.pod:43
890 msgid "Find out what DHCP IP address a VM acquired:"
894 #: ../cat/virt-cat.pod:45
897 " virt-cat -d mydomain /var/log/messages | \\\n"
898 " grep 'dhclient: bound to' | tail\n"
903 #: ../cat/virt-cat.pod:48
904 msgid "Find out what packages were recently installed:"
908 #: ../cat/virt-cat.pod:50
911 " virt-cat -d mydomain /var/log/yum.log | tail\n"
916 #: ../cat/virt-cat.pod:52
917 msgid "Find out who is logged on inside a virtual machine:"
921 #: ../cat/virt-cat.pod:54
924 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
930 #: ../cat/virt-cat.pod:57
931 msgid "or who was logged on:"
935 #: ../cat/virt-cat.pod:59
938 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
939 " last -f /tmp/wtmp\n"
944 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103 ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74 ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
946 "Add I<file> which should be a disk image from a virtual machine. If the "
947 "virtual machine has multiple block devices, you must supply all of them with "
948 "separate I<-a> options."
952 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148 ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217 ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:92
953 msgid "B<--echo-keys>"
957 #: ../cat/virt-cat.pod:100
959 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
960 "so you cannot see what you are typing. If you are not worried about Tempest "
961 "attacks and there is no one else in the room you can specify this flag to "
962 "see what you are typing."
966 #: ../cat/virt-cat.pod:116
969 " virt-cat --format=raw -a disk.img file\n"
974 #: ../cat/virt-cat.pod:120
977 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
982 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200 ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289 ../fuse/guestmount.pod:172 ../inspector/virt-inspector.pod:114
983 msgid "B<--keys-from-stdin>"
987 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202 ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291 ../fuse/guestmount.pod:174 ../inspector/virt-inspector.pod:116
989 "Read key or passphrase parameters from stdin. The default is to try to read "
990 "passphrases from the user by opening C</dev/tty>."
994 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179 ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:209
995 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
999 #: ../cat/virt-cat.pod:154
1000 msgid "Previous versions of virt-cat allowed you to write either:"
1004 #: ../cat/virt-cat.pod:156
1007 " virt-cat disk.img [disk.img ...] file\n"
1012 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185 ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:215
1017 #: ../cat/virt-cat.pod:160
1020 " virt-cat guestname file\n"
1025 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189 ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:219
1027 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1028 "the confusing case where a disk image might have the same name as a guest."
1032 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193 ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:223
1033 msgid "For compatibility the old style is still supported."
1037 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
1038 msgid "USING GUESTFISH"
1042 #: ../cat/virt-cat.pod:170
1044 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1045 "C<virt-cat> doesn't work."
1049 #: ../cat/virt-cat.pod:173
1050 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1054 #: ../cat/virt-cat.pod:175
1057 " guestfish --ro -i -d domname download file -\n"
1062 #: ../cat/virt-cat.pod:177
1064 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1065 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1069 #: ../cat/virt-cat.pod:181
1071 "The command above uses libguestfs's guest inspection feature and so does not "
1072 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1073 "disk images that don't contain guests. To display a file from a disk image "
1078 #: ../cat/virt-cat.pod:186
1081 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1086 #: ../cat/virt-cat.pod:188
1088 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1089 "the disk image, and C<file> is the full path to the file."
1093 #: ../cat/virt-cat.pod:200 ../cat/virt-filesystems.pod:374 ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351 ../fuse/guestmount.pod:314 ../inspector/virt-inspector.pod:377 ../resize/virt-resize.pod:610 ../sparsify/virt-sparsify.pod:229
1094 msgid "This program returns 0 if successful, or non-zero if there was an error."
1098 #: ../cat/virt-cat.pod:205
1100 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
1101 "L<virt-tar-out(1)>, L<http://libguestfs.org/>."
1105 #: ../cat/virt-cat.pod:218 ../inspector/virt-inspector.pod:405 ../resize/virt-resize.pod:641
1106 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1110 #: ../cat/virt-filesystems.pod:5
1112 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1113 "virtual machine or disk image"
1117 #: ../cat/virt-filesystems.pod:9
1120 " virt-filesystems [--options] -d domname\n"
1125 #: ../cat/virt-filesystems.pod:11
1128 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1133 #: ../cat/virt-filesystems.pod:15
1135 "This tool allows you to discover filesystems, partitions, logical volumes, "
1136 "and their sizes in a disk image or virtual machine. It is a replacement for "
1137 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1141 #: ../cat/virt-filesystems.pod:20
1143 "One use for this tool is from shell scripts to iterate over all filesystems "
1144 "from a disk image:"
1148 #: ../cat/virt-filesystems.pod:23
1151 " for fs in $(virt-filesystems -a disk.img); do\n"
1158 #: ../cat/virt-filesystems.pod:27
1160 "Another use is to list partitions before using another tool to modify those "
1161 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1162 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1166 #: ../cat/virt-filesystems.pod:32
1168 "Various command line options control what this program displays. You need "
1169 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1170 "guest respectively. If you just specify that then the program shows "
1171 "filesystems found, one per line, like this:"
1175 #: ../cat/virt-filesystems.pod:37
1178 " $ virt-filesystems -a disk.img\n"
1180 " /dev/vg_guest/lv_root\n"
1185 #: ../cat/virt-filesystems.pod:41
1186 msgid "If you add I<-l> or I<--long> then the output includes extra information:"
1190 #: ../cat/virt-filesystems.pod:44
1193 " $ virt-filesystems -a disk.img -l\n"
1194 " Name Type VFS Label Size\n"
1195 " /dev/sda1 filesystem ext4 boot 524288000\n"
1196 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1201 #: ../cat/virt-filesystems.pod:49
1203 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1208 #: ../cat/virt-filesystems.pod:52
1211 " $ virt-filesystems -a disk.img --extra\n"
1213 " /dev/vg_guest/lv_root\n"
1214 " /dev/vg_guest/lv_swap\n"
1215 " /dev/vg_guest/lv_data\n"
1220 #: ../cat/virt-filesystems.pod:58
1221 msgid "If you add I<--partitions> then partitions are shown instead of filesystems:"
1225 #: ../cat/virt-filesystems.pod:60
1228 " $ virt-filesystems -a disk.img --partitions\n"
1235 #: ../cat/virt-filesystems.pod:64
1237 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, "
1238 "I<--physical-volumes>, I<--block-devices> to list those items."
1242 #: ../cat/virt-filesystems.pod:67
1244 "You can use these options in combination as well (if you want a combination "
1245 "including filesystems, you have to add I<--filesystems>). Notice that some "
1246 "items fall into several categories (eg. C</dev/sda1> might be both a "
1247 "partition and a filesystem). These items are listed several times. To get "
1248 "a list which includes absolutely everything that virt-filesystems knows "
1249 "about, use the I<--all> option."
1253 #: ../cat/virt-filesystems.pod:74
1255 "UUIDs (because they are quite long) are not shown by default. Add the "
1256 "I<--uuid> option to display device and filesystem UUIDs in the long output."
1260 #: ../cat/virt-filesystems.pod:78
1262 "I<--all --long --uuid> is a useful combination to display all possible "
1263 "information about everything."
1267 #: ../cat/virt-filesystems.pod:81
1270 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1271 " Name Type VFS Label Size Parent UUID\n"
1272 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1273 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1274 " /dev/sda1 partition - - 100M /dev/sda -\n"
1275 " /dev/sda2 partition - - 20G /dev/sda -\n"
1276 " /dev/sda device - - 20G - -\n"
1281 #: ../cat/virt-filesystems.pod:89
1282 msgid "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1286 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1291 #: ../cat/virt-filesystems.pod:112
1293 "Display everything. This is currently the same as specifying these options: "
1294 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, "
1295 "I<--logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may "
1296 "be added to this list in future)."
1300 #: ../cat/virt-filesystems.pod:117
1301 msgid "See also I<--long>."
1305 #: ../cat/virt-filesystems.pod:119
1306 msgid "B<--blkdevs>"
1310 #: ../cat/virt-filesystems.pod:121
1311 msgid "B<--block-devices>"
1315 #: ../cat/virt-filesystems.pod:123
1316 msgid "Display block devices."
1320 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1325 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1327 "Write out the results in CSV format (comma-separated values). This format "
1328 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1329 "ABOUT CSV FORMAT> below."
1333 #: ../cat/virt-filesystems.pod:150
1335 "When prompting for keys and passphrases, virt-filesystems normally turns "
1336 "echoing off so you cannot see what you are typing. If you are not worried "
1337 "about Tempest attacks and there is no one else in the room you can specify "
1338 "this flag to see what you are typing."
1342 #: ../cat/virt-filesystems.pod:155
1347 #: ../cat/virt-filesystems.pod:157
1349 "This causes filesystems that are not ordinary, mountable filesystems to be "
1350 "displayed. This category includes swapspace, and filesystems that are empty "
1351 "or contain unknown data."
1355 #: ../cat/virt-filesystems.pod:161
1356 msgid "This option implies I<--filesystems>."
1360 #: ../cat/virt-filesystems.pod:163
1361 msgid "B<--filesystems>"
1365 #: ../cat/virt-filesystems.pod:165
1367 "Display mountable filesystems. If no display option was selected then this "
1368 "option is implied."
1372 #: ../cat/virt-filesystems.pod:168
1373 msgid "With I<--extra>, non-mountable filesystems are shown too."
1377 #: ../cat/virt-filesystems.pod:181
1380 " virt-filesystems --format=raw -a disk.img\n"
1385 #: ../cat/virt-filesystems.pod:185
1388 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1393 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352 ../df/virt-df.pod:125 ../fish/guestfish.pod:156 ../tools/virt-list-partitions.pl:109
1398 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354 ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1399 msgid "B<--human-readable>"
1403 #: ../cat/virt-filesystems.pod:198
1404 msgid "In I<--long> mode, display sizes in human-readable format."
1408 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366 ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1413 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368 ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1418 #: ../cat/virt-filesystems.pod:209
1419 msgid "Display extra columns of data (\"long format\")."
1423 #: ../cat/virt-filesystems.pod:211
1424 msgid "A title row is added unless you also specify I<--no-title>."
1428 #: ../cat/virt-filesystems.pod:213
1430 "The extra columns displayed depend on what output you select, and the "
1431 "ordering of columns may change in future versions. Use the title row, "
1432 "I<--csv> output and/or L<csvtool(1)> to match columns to data in external "
1437 #: ../cat/virt-filesystems.pod:218
1439 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1440 "default is to show raw numbers of I<bytes>."
1444 #: ../cat/virt-filesystems.pod:221
1445 msgid "Use I<--uuid> to display UUIDs too."
1449 #: ../cat/virt-filesystems.pod:223
1454 #: ../cat/virt-filesystems.pod:225
1455 msgid "B<--logvols>"
1459 #: ../cat/virt-filesystems.pod:227
1460 msgid "B<--logical-volumes>"
1464 #: ../cat/virt-filesystems.pod:229
1466 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1467 "of whether the LVs contain filesystems."
1471 #: ../cat/virt-filesystems.pod:232
1472 msgid "B<--no-title>"
1476 #: ../cat/virt-filesystems.pod:234
1477 msgid "In I<--long> mode, don't add a title row."
1481 #: ../cat/virt-filesystems.pod:236
1483 "Note that the order of the columns is not fixed, and may change in future "
1484 "versions of virt-filesystems, so using this option may give you unexpected "
1489 #: ../cat/virt-filesystems.pod:240
1494 #: ../cat/virt-filesystems.pod:242
1495 msgid "B<--partitions>"
1499 #: ../cat/virt-filesystems.pod:244
1501 "Display partitions. In this mode, these are displayed irrespective of "
1502 "whether the partitions contain filesystems."
1506 #: ../cat/virt-filesystems.pod:247
1511 #: ../cat/virt-filesystems.pod:249
1512 msgid "B<--physvols>"
1516 #: ../cat/virt-filesystems.pod:251
1517 msgid "B<--physical-volumes>"
1521 #: ../cat/virt-filesystems.pod:253
1522 msgid "Display LVM physical volumes."
1526 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1531 #: ../cat/virt-filesystems.pod:257
1536 #: ../cat/virt-filesystems.pod:259
1537 msgid "In I<--long> mode, display UUIDs as well."
1541 #: ../cat/virt-filesystems.pod:273
1546 #: ../cat/virt-filesystems.pod:275
1547 msgid "B<--volgroups>"
1551 #: ../cat/virt-filesystems.pod:277
1552 msgid "B<--volume-groups>"
1556 #: ../cat/virt-filesystems.pod:279
1557 msgid "Display LVM volume groups."
1561 #: ../cat/virt-filesystems.pod:287
1566 #: ../cat/virt-filesystems.pod:289
1568 "Note that columns in the output are subject to reordering and change in "
1569 "future versions of this tool."
1573 #: ../cat/virt-filesystems.pod:294
1578 #: ../cat/virt-filesystems.pod:296
1579 msgid "The filesystem, partition, block device or LVM name."
1583 #: ../cat/virt-filesystems.pod:298
1585 "For device and partition names these are displayed as canonical libguestfs "
1586 "names, so that for example C</dev/sda2> is the second partition on the first "
1591 #: ../cat/virt-filesystems.pod:302
1593 "If the I<--long> option is B<not> specified, then only the name column is "
1594 "shown in the output."
1598 #: ../cat/virt-filesystems.pod:305
1603 #: ../cat/virt-filesystems.pod:307
1604 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1608 #: ../cat/virt-filesystems.pod:309
1613 #: ../cat/virt-filesystems.pod:311
1615 "If there is a filesystem, then this column displays the filesystem type if "
1616 "one could be detected, eg. C<ext4>."
1620 #: ../cat/virt-filesystems.pod:314
1625 #: ../cat/virt-filesystems.pod:316
1627 "If the object has a label (used for identifying and mounting filesystems) "
1628 "then this column contains the label."
1632 #: ../cat/virt-filesystems.pod:319
1637 #: ../cat/virt-filesystems.pod:321
1639 "The size of the object in bytes. If the I<--human> option is used then the "
1640 "size is displayed in a human-readable form."
1644 #: ../cat/virt-filesystems.pod:324
1649 #: ../cat/virt-filesystems.pod:326
1651 "The parent column records the parent relationship between objects. For "
1652 "example, if the object is a partition, then this column contains the name of "
1653 "the containing device. If the object is a logical volume, then this column "
1654 "is the name of the volume group."
1658 #: ../cat/virt-filesystems.pod:331
1663 #: ../cat/virt-filesystems.pod:333
1665 "If the object has a UUID (used for identifying and mounting filesystems and "
1666 "block devices) then this column contains the UUID as a string."
1670 #: ../cat/virt-filesystems.pod:337
1671 msgid "The UUID is only displayed if the I<--uuid> option is given."
1675 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459 ../df/virt-df.pod:191
1676 msgid "NOTE ABOUT CSV FORMAT"
1680 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461 ../df/virt-df.pod:193
1682 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1683 "should be easy to parse, but it is definitely not easy to parse."
1687 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464 ../df/virt-df.pod:196
1689 "Myth: Just split fields at commas. Reality: This does I<not> work "
1690 "reliably. This example has two columns:"
1694 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467 ../df/virt-df.pod:199
1697 " \"foo,bar\",baz\n"
1702 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469 ../df/virt-df.pod:201
1704 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1705 "reliably. This example has one row:"
1709 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472 ../df/virt-df.pod:204
1718 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475 ../df/virt-df.pod:207
1720 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1721 "packaged in major Linux distributions)."
1725 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478 ../df/virt-df.pod:210
1727 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1728 "or Python's built-in csv library)."
1732 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481 ../df/virt-df.pod:213
1733 msgid "Most spreadsheets and databases can import CSV directly."
1737 #: ../cat/virt-filesystems.pod:379
1739 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
1740 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, "
1741 "L<http://libguestfs.org/>."
1745 #: ../cat/virt-filesystems.pod:394 ../tools/virt-make-fs.pl:570 ../tools/virt-win-reg.pl:778
1746 msgid "Copyright (C) 2010 Red Hat Inc."
1750 #: ../cat/virt-ls.pod:5
1751 msgid "virt-ls - List files in a virtual machine"
1755 #: ../cat/virt-ls.pod:9
1758 " virt-ls [--options] -d domname directory [directory ...]\n"
1763 #: ../cat/virt-ls.pod:11
1766 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory "
1772 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
1777 #: ../cat/virt-ls.pod:15
1780 " virt-ls [--options] domname directory\n"
1785 #: ../cat/virt-ls.pod:17
1788 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1793 #: ../cat/virt-ls.pod:21
1795 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1796 "more from a virtual machine or disk image."
1800 #: ../cat/virt-ls.pod:24
1802 "Multiple directory names can be given, in which case the output from each is "
1807 #: ../cat/virt-ls.pod:27
1809 "To list directories from a libvirt guest use the I<-d> option to specify the "
1810 "name of the guest. For a disk image, use the I<-a> option."
1814 #: ../cat/virt-ls.pod:31
1816 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1817 "may need to use L<guestfish(1)>, or write a program directly to the "
1818 "L<guestfs(3)> API."
1822 #: ../cat/virt-ls.pod:37
1823 msgid "Get a list of all files and directories in a virtual machine:"
1827 #: ../cat/virt-ls.pod:39
1830 " virt-ls -R -d guest /\n"
1835 #: ../cat/virt-ls.pod:41
1836 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1840 #: ../cat/virt-ls.pod:43
1843 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1848 #: ../cat/virt-ls.pod:45
1849 msgid "List all public-writable directories in a Linux virtual machine:"
1853 #: ../cat/virt-ls.pod:47
1856 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1861 #: ../cat/virt-ls.pod:49
1862 msgid "List all Unix domain sockets in a Linux virtual machine:"
1866 #: ../cat/virt-ls.pod:51
1869 " virt-ls -lR -d guest / | grep '^s'\n"
1874 #: ../cat/virt-ls.pod:53
1875 msgid "List all regular files with filenames ending in '.png':"
1879 #: ../cat/virt-ls.pod:55
1882 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1887 #: ../cat/virt-ls.pod:57
1888 msgid "To display files larger than 10MB in home directories:"
1892 #: ../cat/virt-ls.pod:59
1895 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1900 #: ../cat/virt-ls.pod:61
1901 msgid "Find everything modified in the last 7 days:"
1905 #: ../cat/virt-ls.pod:63
1908 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1913 #: ../cat/virt-ls.pod:65
1914 msgid "Find regular files modified in the last 24 hours:"
1918 #: ../cat/virt-ls.pod:67
1921 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
1926 #: ../cat/virt-ls.pod:69
1927 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
1931 #: ../cat/virt-ls.pod:71
1933 "Find the differences between files in a guest and an earlier snapshot of the "
1938 #: ../cat/virt-ls.pod:74
1941 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
1942 " virt-ls -lR -a current.img / --uids --time-t > new\n"
1943 " diff -u old new | less\n"
1948 #: ../cat/virt-ls.pod:78
1950 "The commands above won't find files where the content has changed but the "
1951 "metadata (eg. file size and modification date) is the same. To do that, you "
1952 "need to add the I<--checksum> parameter to both C<virt-ls> commands. "
1953 "I<--checksum> can be quite slow since it has to read and compute a checksum "
1954 "of every regular file in the virtual machine."
1958 #: ../cat/virt-ls.pod:84
1959 msgid "OUTPUT MODES"
1963 #: ../cat/virt-ls.pod:86
1965 "C<virt-ls> has four output modes, controlled by different combinations of "
1966 "the I<-l> and I<-R> options."
1970 #: ../cat/virt-ls.pod:89
1971 msgid "SIMPLE LISTING"
1975 #: ../cat/virt-ls.pod:91
1976 msgid "A simple listing is like the ordinary L<ls(1)> command:"
1980 #: ../cat/virt-ls.pod:93
1983 " $ virt-ls -d guest /\n"
1991 #: ../cat/virt-ls.pod:98
1992 msgid "LONG LISTING"
1996 #: ../cat/virt-ls.pod:100
1998 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
1999 "(more specifically, like the C<guestfs_ll> function)."
2003 #: ../cat/virt-ls.pod:103
2006 " $ virt-ls -l -d guest /\n"
2008 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2009 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2015 #: ../cat/virt-ls.pod:109
2017 "Note that while this is useful for displaying a directory, do not try "
2018 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2023 #: ../cat/virt-ls.pod:113
2024 msgid "RECURSIVE LISTING"
2028 #: ../cat/virt-ls.pod:115
2030 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2031 "and directories recursively:"
2035 #: ../cat/virt-ls.pod:118
2038 " $ virt-ls -R -d guest /tmp\n"
2046 #: ../cat/virt-ls.pod:123
2048 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2049 "converts C<\\0> characters to C<\\n>."
2053 #: ../cat/virt-ls.pod:126
2054 msgid "RECURSIVE LONG LISTING"
2058 #: ../cat/virt-ls.pod:128
2060 "Using I<-lR> options together changes the output to display directories "
2061 "recursively, with file stats, and optionally other features such as "
2062 "checksums and extended attributes."
2066 #: ../cat/virt-ls.pod:132
2068 "Most of the interesting features of C<virt-ls> are only available when using "
2073 #: ../cat/virt-ls.pod:135
2075 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2076 "you cannot use the output in another program (because filenames can contain "
2077 "spaces and other unsafe characters). If the guest was untrusted and someone "
2078 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2079 "on you by creating filenames with embedded newline characters. To B<safely> "
2080 "parse the output in another program, use the I<--csv> (Comma-Separated "
2085 #: ../cat/virt-ls.pod:143
2087 "Note that this output format is completely unrelated to the C<ls -lR> "
2092 #: ../cat/virt-ls.pod:146
2095 " $ virt-ls -lR -d guest /bin\n"
2096 " d 0555 4096 /bin\n"
2097 " - 0755 123 /bin/alsaunmute\n"
2098 " - 0755 28328 /bin/arch\n"
2099 " l 0777 4 /bin/awk -> gawk\n"
2100 " - 0755 27216 /bin/basename\n"
2101 " - 0755 943360 /bin/bash\n"
2107 #: ../cat/virt-ls.pod:155
2108 msgid "These basic fields are always shown:"
2112 #: ../cat/virt-ls.pod:159
2117 #: ../cat/virt-ls.pod:161
2119 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2120 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2121 "link), C<s> (socket) or C<u> (unknown)."
2125 #: ../cat/virt-ls.pod:171
2130 #: ../cat/virt-ls.pod:173
2131 msgid "The Unix permissions, displayed as a 4 digit octal number."
2135 #: ../cat/virt-ls.pod:175
2140 #: ../cat/virt-ls.pod:177
2142 "The size of the file. This is shown in bytes unless I<-h> or "
2143 "I<--human-readable> option is given, in which case this is shown as a "
2144 "human-readable number."
2148 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4263
2153 #: ../cat/virt-ls.pod:183
2154 msgid "The full path of the file or directory."
2158 #: ../cat/virt-ls.pod:185
2163 #: ../cat/virt-ls.pod:187
2164 msgid "For symbolic links only, the link target."
2168 #: ../cat/virt-ls.pod:191
2170 "In I<-lR> mode, additional command line options enable the display of more "
2175 #: ../cat/virt-ls.pod:194
2177 "With the I<--uids> flag, these additional fields are displayed before the "
2182 #: ../cat/virt-ls.pod:199
2187 #: ../cat/virt-ls.pod:201
2192 #: ../cat/virt-ls.pod:203
2194 "The UID and GID of the owner of the file (displayed numerically). Note "
2195 "these only make sense in the context of a Unix-like guest."
2199 #: ../cat/virt-ls.pod:208
2200 msgid "With the I<--times> flag, these additional fields are displayed:"
2204 #: ../cat/virt-ls.pod:212
2209 #: ../cat/virt-ls.pod:214
2210 msgid "The time of last access."
2214 #: ../cat/virt-ls.pod:216
2219 #: ../cat/virt-ls.pod:218
2220 msgid "The time of last modification."
2224 #: ../cat/virt-ls.pod:220
2229 #: ../cat/virt-ls.pod:222
2230 msgid "The time of last status change."
2234 #: ../cat/virt-ls.pod:226
2236 "The time fields are displayed as string dates and times, unless one of the "
2237 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2241 #: ../cat/virt-ls.pod:229
2242 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2246 #: ../cat/virt-ls.pod:233
2251 #: ../cat/virt-ls.pod:235
2253 "The device containing the file (displayed as major:minor). This may not "
2254 "match devices as known to the guest."
2258 #: ../cat/virt-ls.pod:238
2263 #: ../cat/virt-ls.pod:240
2264 msgid "The inode number."
2268 #: ../cat/virt-ls.pod:242
2273 #: ../cat/virt-ls.pod:244
2274 msgid "The number of hard links."
2278 #: ../cat/virt-ls.pod:246
2283 #: ../cat/virt-ls.pod:248
2284 msgid "For block and char special files, the device (displayed as major:minor)."
2288 #: ../cat/virt-ls.pod:251
2293 #: ../cat/virt-ls.pod:253
2294 msgid "The number of 512 byte blocks allocated to the file."
2298 #: ../cat/virt-ls.pod:257
2300 "With the I<--checksum> flag, the checksum of the file contents is shown "
2301 "(only for regular files). Computing file checksums can take a considerable "
2306 #: ../cat/virt-ls.pod:280
2307 msgid "B<--checksum>"
2311 #: ../cat/virt-ls.pod:282
2312 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2316 #: ../cat/virt-ls.pod:284
2318 "Display checksum over file contents for regular files. With no argument, "
2319 "this defaults to using I<md5>. Using an argument, you can select the "
2320 "checksum type to use."
2324 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358 ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408 ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2326 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2331 #: ../cat/virt-ls.pod:316
2333 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2334 "so you cannot see what you are typing. If you are not worried about Tempest "
2335 "attacks and there is no one else in the room you can specify this flag to "
2336 "see what you are typing."
2340 #: ../cat/virt-ls.pod:321
2341 msgid "B<--extra-stats>"
2345 #: ../cat/virt-ls.pod:323
2346 msgid "Display extra stats."
2350 #: ../cat/virt-ls.pod:339
2353 " virt-ls --format=raw -a disk.img /dir\n"
2358 #: ../cat/virt-ls.pod:343
2361 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2366 #: ../cat/virt-ls.pod:356
2367 msgid "Display file sizes in human-readable format."
2371 #: ../cat/virt-ls.pod:370
2376 #: ../cat/virt-ls.pod:372
2377 msgid "B<--recursive>"
2381 #: ../cat/virt-ls.pod:374
2383 "Select the mode. With neither of these options, C<virt-ls> produces a "
2384 "simple, flat list of the files in the named directory. See L</SIMPLE "
2389 #: ../cat/virt-ls.pod:378
2391 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See "
2396 #: ../cat/virt-ls.pod:381
2398 "C<virt-ls -R> produces a recursive list of files starting at the named "
2399 "directory. See L</RECURSIVE LISTING>."
2403 #: ../cat/virt-ls.pod:384
2405 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2406 "parsed. See L</RECURSIVE LONG LISTING>."
2410 #: ../cat/virt-ls.pod:387
2415 #: ../cat/virt-ls.pod:389
2416 msgid "Display time fields."
2420 #: ../cat/virt-ls.pod:394
2421 msgid "B<--time-days>"
2425 #: ../cat/virt-ls.pod:396
2426 msgid "Display time fields as days before now (negative if in the future)."
2430 #: ../cat/virt-ls.pod:398
2432 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2433 "of the file is between 0 and 86399 seconds."
2437 #: ../cat/virt-ls.pod:404
2438 msgid "B<--time-relative>"
2442 #: ../cat/virt-ls.pod:406
2443 msgid "Display time fields as seconds before now (negative if in the future)."
2447 #: ../cat/virt-ls.pod:411
2452 #: ../cat/virt-ls.pod:413
2453 msgid "Display time fields as seconds since the Unix epoch."
2457 #: ../cat/virt-ls.pod:418
2462 #: ../cat/virt-ls.pod:420
2463 msgid "Display UID and GID fields."
2467 #: ../cat/virt-ls.pod:445
2468 msgid "Previous versions of virt-ls allowed you to write either:"
2472 #: ../cat/virt-ls.pod:447
2475 " virt-ls disk.img [disk.img ...] /dir\n"
2480 #: ../cat/virt-ls.pod:451
2483 " virt-ls guestname /dir\n"
2488 #: ../cat/virt-ls.pod:497
2490 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, "
2491 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
2492 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
2496 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374 ../rescue/virt-rescue.pod:302
2497 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2501 #: ../clone/virt-sysprep.pod:5
2502 msgid "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
2506 #: ../clone/virt-sysprep.pod:9
2509 " virt-sysprep [--options] -d domname\n"
2514 #: ../clone/virt-sysprep.pod:11
2517 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
2522 #: ../clone/virt-sysprep.pod:15
2524 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
2525 "can be made from it. Steps in this process include removing SSH host keys, "
2526 "removing persistent network MAC configuration, and removing user accounts. "
2527 "Each step can be enabled or disabled as required."
2531 #: ../clone/virt-sysprep.pod:21
2533 "Virt-sysprep is a simple shell script, allowing easy inspection or "
2534 "customization by the system administrator."
2538 #: ../clone/virt-sysprep.pod:24
2540 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
2541 "be shut down. If you want to preserve the existing contents of the guest, "
2542 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> "
2547 #: ../clone/virt-sysprep.pod:29
2549 "You do I<not> need to run virt-sysprep as root. In fact we'd generally "
2550 "recommend that you don't. The time you might want to run it as root is when "
2551 "you need root in order to access the disk image, but even in this case it "
2552 "would be better to change the permissions on the disk image to be writable "
2553 "as the non-root user running virt-sysprep."
2557 #: ../clone/virt-sysprep.pod:35
2559 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
2560 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
2561 "machines in preparation for cloning them. Having said that, virt-sysprep "
2562 "does I<not> currently work on Microsoft Windows guests. We plan to support "
2563 "Windows sysprepping in a future version, and we already have code to do it."
2567 #: ../clone/virt-sysprep.pod:76
2568 msgid "B<--enable=...>"
2572 #: ../clone/virt-sysprep.pod:78
2574 "Choose which sysprep operations to perform. Give a comma-separated list of "
2575 "operations, for example:"
2579 #: ../clone/virt-sysprep.pod:81
2582 " --enable=ssh-hostkeys,udev-persistent-net\n"
2587 #: ../clone/virt-sysprep.pod:83
2588 msgid "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
2592 #: ../clone/virt-sysprep.pod:85
2594 "If the I<--enable> option is not given, then we default to trying all "
2595 "possible sysprep operations. But some sysprep operations are skipped for "
2600 #: ../clone/virt-sysprep.pod:89
2602 "Use I<--list-operations> to list operations supported by a particular "
2603 "version of virt-sysprep."
2607 #: ../clone/virt-sysprep.pod:92
2608 msgid "See L</OPERATIONS> below for a list and an explanation of each operation."
2612 #: ../clone/virt-sysprep.pod:106
2615 " virt-sysprep --format=raw -a disk.img\n"
2620 #: ../clone/virt-sysprep.pod:110
2623 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
2628 #: ../clone/virt-sysprep.pod:119
2629 msgid "B<--hostname> newhostname"
2633 #: ../clone/virt-sysprep.pod:121
2635 "Change the hostname. See the L</hostname> operation below. If not given, "
2636 "defaults to C<localhost.localdomain>."
2640 #: ../clone/virt-sysprep.pod:124
2641 msgid "B<--list-operations>"
2645 #: ../clone/virt-sysprep.pod:126
2646 msgid "List the operations supported by the virt-sysprep program."
2650 #: ../clone/virt-sysprep.pod:128
2651 msgid "B<--selinux-relabel>"
2655 #: ../clone/virt-sysprep.pod:130
2656 msgid "B<--no-selinux-relabel>"
2660 #: ../clone/virt-sysprep.pod:132
2662 "I<--selinux-relabel> forces SELinux relabelling next time the guest boots. "
2663 "I<--no-selinux-relabel> disables relabelling."
2667 #: ../clone/virt-sysprep.pod:135
2669 "The default is to try to detect if SELinux relabelling is required. See "
2670 "L</SELINUX RELABELLING> below for more details."
2674 #: ../clone/virt-sysprep.pod:156
2679 #: ../clone/virt-sysprep.pod:158
2681 "If the I<--enable> option is I<not> given, then I<all sysprep operations are "
2682 "enabled>, although some are skipped depending on the type of guest."
2686 #: ../clone/virt-sysprep.pod:162
2688 "Operations can be individually enabled using the I<--enable> option. Use a "
2689 "comma-separated list, for example:"
2693 #: ../clone/virt-sysprep.pod:165
2696 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
2701 #: ../clone/virt-sysprep.pod:167
2703 "To list the operations supported by the current version of virt-sysprep, use "
2704 "I<--list-operations>."
2708 #: ../clone/virt-sysprep.pod:170
2710 "Future versions of virt-sysprep may add more operations. If you are using "
2711 "virt-sysprep and want predictable behaviour, specify only the operations "
2712 "that you want to have enabled."
2716 #: ../clone/virt-sysprep.pod:174
2721 #: ../clone/virt-sysprep.pod:176
2722 msgid "Remove user at-jobs and cron-jobs."
2726 #: ../clone/virt-sysprep.pod:178
2727 msgid "dhcp-client-state"
2731 #: ../clone/virt-sysprep.pod:180
2732 msgid "Remove DHCP client leases."
2736 #: ../clone/virt-sysprep.pod:182
2737 msgid "dhcp-server-state"
2741 #: ../clone/virt-sysprep.pod:184
2742 msgid "Remove DHCP server leases."
2746 #: ../clone/virt-sysprep.pod:186
2751 #: ../clone/virt-sysprep.pod:188
2753 "Changes the hostname of the guest to the value given in the I<--hostname> "
2758 #: ../clone/virt-sysprep.pod:191
2760 "If the I<--hostname> parameter is not given, then the hostname is changed to "
2761 "C<localhost.localdomain>."
2765 #: ../clone/virt-sysprep.pod:194
2770 #: ../clone/virt-sysprep.pod:196
2771 msgid "Remove many log files."
2775 #: ../clone/virt-sysprep.pod:198
2780 #: ../clone/virt-sysprep.pod:200
2781 msgid "Remove email from the local mail spool directory."
2785 #: ../clone/virt-sysprep.pod:202
2790 #: ../clone/virt-sysprep.pod:204
2792 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
2793 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
2797 #: ../clone/virt-sysprep.pod:207
2802 #: ../clone/virt-sysprep.pod:209
2804 "Write some random bytes from the host into the random seed file of the "
2809 #: ../clone/virt-sysprep.pod:212
2810 msgid "See L</RANDOM SEED> below."
2814 #: ../clone/virt-sysprep.pod:214
2815 msgid "rhn-systemid"
2819 #: ../clone/virt-sysprep.pod:216
2820 msgid "Remove the RHN system ID."
2824 #: ../clone/virt-sysprep.pod:218
2829 #: ../clone/virt-sysprep.pod:220
2830 msgid "Remove the Smolt hardware UUID."
2834 #: ../clone/virt-sysprep.pod:222
2835 msgid "ssh-hostkeys"
2839 #: ../clone/virt-sysprep.pod:224
2840 msgid "Remove the SSH host keys in the guest."
2844 #: ../clone/virt-sysprep.pod:226
2846 "The SSH host keys are regenerated (differently) next time the guest is "
2851 #: ../clone/virt-sysprep.pod:229
2853 "If, after cloning, the guest gets the same IP address, ssh will give you a "
2854 "stark warning about the host key changing:"
2858 #: ../clone/virt-sysprep.pod:232
2861 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2862 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
2863 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2864 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
2869 #: ../clone/virt-sysprep.pod:237
2870 msgid "udev-persistent-net"
2874 #: ../clone/virt-sysprep.pod:239
2876 "Remove udev persistent net rules which map the guest's existing MAC address "
2877 "to a fixed ethernet device (eg. eth0)."
2881 #: ../clone/virt-sysprep.pod:242
2883 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
2884 "address occupies the old name (eg. eth0), this means the fresh MAC address "
2885 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
2886 "Erasing the udev persistent net rules avoids this."
2890 #: ../clone/virt-sysprep.pod:247
2895 #: ../clone/virt-sysprep.pod:249
2896 msgid "Remove the utmp file."
2900 #: ../clone/virt-sysprep.pod:251
2902 "This records who is currently logged in on a machine. In modern Linux "
2903 "distros it is stored in a ramdisk and hence not part of the virtual "
2904 "machine's disk, but it was stored on disk in older distros."
2908 #: ../clone/virt-sysprep.pod:255
2913 #: ../clone/virt-sysprep.pod:257
2914 msgid "Remove the yum UUID."
2918 #: ../clone/virt-sysprep.pod:259
2920 "Yum creates a fresh UUID the next time it runs when it notices that the "
2921 "original UUID has been erased."
2925 #: ../clone/virt-sysprep.pod:262
2926 msgid "COPYING AND CLONING"
2930 #: ../clone/virt-sysprep.pod:264
2932 "Virt-sysprep can be used as part of a process of cloning guests, or to "
2933 "prepare a template from which guests can be cloned. There are many "
2934 "different ways to achieve this using the virt tools, and this section is "
2935 "just an introduction."
2939 #: ../clone/virt-sysprep.pod:269
2940 msgid "A virtual machine (when switched off) consists of two parts:"
2944 #: ../clone/virt-sysprep.pod:273
2945 msgid "I<configuration>"
2949 #: ../clone/virt-sysprep.pod:275
2951 "The configuration or description of the guest. eg. The libvirt XML (see "
2952 "C<virsh dumpxml>), the running configuration of the guest, or another "
2953 "external format like OVF."
2957 #: ../clone/virt-sysprep.pod:279
2958 msgid "Some configuration items that might need to be changed:"
2962 #: ../clone/virt-sysprep.pod:285
2967 #: ../clone/virt-sysprep.pod:289 ../clone/virt-sysprep.pod:316
2972 #: ../clone/virt-sysprep.pod:293
2973 msgid "path to block device(s)"
2977 #: ../clone/virt-sysprep.pod:297
2978 msgid "network card MAC address"
2982 #: ../clone/virt-sysprep.pod:301
2983 msgid "I<block device(s)>"
2987 #: ../clone/virt-sysprep.pod:303
2989 "One or more hard disk images, themselves containing files, directories, "
2990 "applications, kernels, configuration, etc."
2994 #: ../clone/virt-sysprep.pod:306
2995 msgid "Some things inside the block devices that might need to be changed:"
2999 #: ../clone/virt-sysprep.pod:312
3000 msgid "hostname and other net configuration"
3004 #: ../clone/virt-sysprep.pod:320
3005 msgid "SSH host keys"
3009 #: ../clone/virt-sysprep.pod:324
3010 msgid "Windows unique security ID (SID)"
3014 #: ../clone/virt-sysprep.pod:328
3015 msgid "Puppet registration"
3019 #: ../clone/virt-sysprep.pod:334
3020 msgid "COPYING THE BLOCK DEVICE"
3024 #: ../clone/virt-sysprep.pod:336
3026 "Starting with an original guest, you probably wish to copy the guest block "
3027 "device and its configuration to make a template. Then once you are happy "
3028 "with the template, you will want to make many clones from it."
3032 #: ../clone/virt-sysprep.pod:341
3038 " original guest --------> template ---------->\n"
3039 " \\------> cloned\n"
3040 " \\-----> guests\n"
3046 #: ../clone/virt-sysprep.pod:349
3048 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3053 #: ../clone/virt-sysprep.pod:352
3057 " original guest --------> template ---------->\n"
3058 " \\------> cloned\n"
3059 " \\-----> guests\n"
3065 #: ../clone/virt-sysprep.pod:358
3066 msgid "There are some smarter (and faster) ways too:"
3070 #: ../clone/virt-sysprep.pod:364
3074 " template ---------->\n"
3075 " \\------> cloned\n"
3076 " \\-----> guests\n"
3082 #: ../clone/virt-sysprep.pod:370
3084 "Use the block device as a backing file and create a snapshot on top for each "
3085 "guest. The advantage is that you don't need to copy the block device (very "
3086 "fast) and only changes are stored (less storage required)."
3090 #: ../clone/virt-sysprep.pod:375
3092 "Note that writing to the backing file once you have created guests on top of "
3093 "it is not possible: you will corrupt the guests."
3097 #: ../clone/virt-sysprep.pod:378
3099 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 "
3100 "-o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3101 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3102 "also create cheap snapshots from files or LUNs."
3106 #: ../clone/virt-sysprep.pod:386
3107 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3111 #: ../clone/virt-sysprep.pod:390
3112 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3116 #: ../clone/virt-sysprep.pod:394
3121 #: ../clone/virt-sysprep.pod:396
3123 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3124 "and/or modify the external libvirt configuration of a guest. It will reset "
3125 "the name, UUID and MAC address of the guest in the libvirt XML."
3129 #: ../clone/virt-sysprep.pod:401
3131 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3132 "image. This was the original motivation to write virt-sysprep."
3136 #: ../clone/virt-sysprep.pod:404
3141 #: ../clone/virt-sysprep.pod:406
3145 " original guest --------> template\n"
3150 #: ../clone/virt-sysprep.pod:409
3152 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3153 "it easier to compress and/or faster to copy."
3157 #: ../clone/virt-sysprep.pod:412
3159 "Notice that since virt-sparsify also copies the image, you can use it to "
3160 "make the initial copy (instead of C<dd>)."
3164 #: ../clone/virt-sysprep.pod:415
3169 #: ../clone/virt-sysprep.pod:417
3173 " template ---------->\n"
3174 " \\------> cloned\n"
3175 " \\-----> guests\n"
3181 #: ../clone/virt-sysprep.pod:423
3183 "If you want to give people cloned guests, but let them pick the size of the "
3184 "guest themselves (eg. depending on how much they are prepared to pay for "
3185 "disk space), then instead of copying the template, you can run "
3186 "L<virt-resize(1)>. Virt-resize performs a copy and resize, and thus is "
3187 "ideal for cloning guests from a template."
3191 #: ../clone/virt-sysprep.pod:429 ../src/guestfs.pod:1149
3196 #: ../clone/virt-sysprep.pod:431
3198 "Although virt-sysprep removes some sensitive information from the guest, it "
3199 "does not pretend to remove all of it. You should examine the L</OPERATIONS> "
3200 "above, and the implementation of the operations in the shell script. You "
3201 "should also examine the guest afterwards."
3205 #: ../clone/virt-sysprep.pod:436
3207 "Sensitive files are simply removed. The data they contained may still exist "
3208 "on the disk, easily recovered with a hex editor or undelete tool. Use "
3209 "L<virt-sparsify(1)> as one way to remove this content. See also the "
3210 "L<scrub(1)> command to get rid of deleted content in directory entries and "
3215 #: ../clone/virt-sysprep.pod:442
3220 #: ../clone/virt-sysprep.pod:444
3221 msgid "I<(This section applies to Linux guests only)>"
3225 #: ../clone/virt-sysprep.pod:446
3227 "The virt-sysprep C<random-seed> operation writes a few bytes of randomness "
3228 "from the host into the guest's random seed file."
3232 #: ../clone/virt-sysprep.pod:449
3234 "If this is just done once and the guest is cloned from the same template, "
3235 "then each guest will start with the same entropy, and things like SSH host "
3236 "keys and TCP sequence numbers may be predictable."
3240 #: ../clone/virt-sysprep.pod:453
3242 "Therefore you should arrange to add more randomness I<after> cloning from a "
3243 "template too, which can be done by just enabling the C<random-seed> "
3248 #: ../clone/virt-sysprep.pod:457
3251 " cp template.img newguest.img\n"
3252 " virt-sysprep --enable=random-seed -a newguest.img\n"
3257 #: ../clone/virt-sysprep.pod:460
3258 msgid "SELINUX RELABELLING"
3262 #: ../clone/virt-sysprep.pod:462
3263 msgid "I<(This section applies to Linux guests using SELinux only)>"
3267 #: ../clone/virt-sysprep.pod:464
3269 "If any new files are created by virt-sysprep, then virt-sysprep touches "
3270 "C</.autorelabel> so that these will be correctly labelled by SELinux the "
3271 "next time the guest is booted. This process interrupts boot and can take "
3276 #: ../clone/virt-sysprep.pod:469
3278 "You can force relabelling for all guests by supplying the "
3279 "I<--selinux-relabel> option."
3283 #: ../clone/virt-sysprep.pod:472
3285 "You can disable relabelling entirely by supplying the "
3286 "I<--no-selinux-relabel> option."
3290 #: ../clone/virt-sysprep.pod:484
3291 msgid "This program returns 0 on success, or 1 if there was an error."
3295 #: ../clone/virt-sysprep.pod:488
3297 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, "
3298 "L<virt-resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<lvcreate(8)>, "
3299 "L<qemu-img(1)>, L<scrub(1)>, L<http://libguestfs.org/>, "
3300 "L<http://libvirt.org/>."
3304 #: ../df/virt-df.pod:5
3305 msgid "virt-df - Display free space on virtual filesystems"
3309 #: ../df/virt-df.pod:9
3312 " virt-df [--options]\n"
3317 #: ../df/virt-df.pod:11
3320 " virt-df [--options] -d domname\n"
3325 #: ../df/virt-df.pod:13
3328 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3333 #: ../df/virt-df.pod:17
3336 " virt-df [--options] domname\n"
3341 #: ../df/virt-df.pod:19
3344 " virt-df [--options] disk.img [disk.img ...]\n"
3349 #: ../df/virt-df.pod:23
3351 "C<virt-df> is a command line tool to display free space on virtual machine "
3352 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3353 "allocated to a virtual machine, but can look inside disk images to see how "
3354 "much space is really being used."
3358 #: ../df/virt-df.pod:28
3360 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3361 "to get a list of all active and inactive guests, and performs a C<df>-type "
3362 "operation on each one in turn, printing out the results."
3366 #: ../df/virt-df.pod:32
3368 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a "
3369 "C<df>-type operation on either the single named libvirt domain, or on the "
3370 "disk image(s) listed on the command line (which must all belong to a single "
3371 "VM). In this mode (with arguments), C<virt-df> will I<only work for a "
3372 "single guest>. If you want to run on multiple guests, then you have to "
3373 "invoke C<virt-df> multiple times."
3377 #: ../df/virt-df.pod:39
3379 "Use the I<--csv> option to get a format which can be easily parsed by other "
3380 "programs. Other options are similar to the standard L<df(1)> command."
3384 #: ../df/virt-df.pod:45
3386 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3387 "output human-readable:"
3391 #: ../df/virt-df.pod:48
3394 " # virt-df -d F14x64 -h\n"
3395 " Filesystem Size Used Available Use%\n"
3396 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3397 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3402 #: ../df/virt-df.pod:53
3403 msgid "Show disk usage for a disk image file called C<test.img>:"
3407 #: ../df/virt-df.pod:55
3410 " $ virt-df -a test1.img\n"
3411 " Filesystem 1K-blocks Used Available Use%\n"
3412 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3417 #: ../df/virt-df.pod:112
3420 " virt-df --format=raw -a disk.img\n"
3425 #: ../df/virt-df.pod:116
3428 " virt-df --format=raw -a disk.img --format -a another.img\n"
3433 #: ../df/virt-df.pod:129
3434 msgid "Print sizes in human-readable format."
3438 #: ../df/virt-df.pod:131
3439 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3443 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:164
3448 #: ../df/virt-df.pod:135
3453 #: ../df/virt-df.pod:137
3454 msgid "Print inodes instead of blocks."
3458 #: ../df/virt-df.pod:139
3459 msgid "B<--one-per-guest>"
3463 #: ../df/virt-df.pod:141
3465 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3466 "disks from several guests to a single libguestfs appliance."
3470 #: ../df/virt-df.pod:144
3471 msgid "You might use this option in the following circumstances:"
3475 #: ../df/virt-df.pod:150
3477 "If you think an untrusted guest might actively try to exploit the libguestfs "
3478 "appliance kernel, then this prevents one guest from interfering with the "
3479 "stats printed for another guest."
3483 #: ../df/virt-df.pod:156
3485 "If the kernel has a bug which stops it from accessing a filesystem in one "
3486 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3487 "and report stats for further guests."
3491 #: ../df/virt-df.pod:165
3493 "Print UUIDs instead of names. This is useful for following a guest even "
3494 "when the guest is migrated or renamed, or when two guests happen to have the "
3499 #: ../df/virt-df.pod:169
3501 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3502 "images, we still print the disk image name even when this option is "
3507 #: ../df/virt-df.pod:229
3509 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
3510 "L<http://libguestfs.org/>."
3514 #: ../edit/virt-edit.pod:5
3515 msgid "virt-edit - Edit a file in a virtual machine"
3519 #: ../edit/virt-edit.pod:9
3522 " virt-edit [--options] -d domname file [file ...]\n"
3527 #: ../edit/virt-edit.pod:11
3530 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
3535 #: ../edit/virt-edit.pod:13
3538 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
3543 #: ../edit/virt-edit.pod:17
3546 " virt-edit domname file\n"
3551 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
3554 " virt-edit disk.img [disk.img ...] file\n"
3559 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23 ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15 ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19 ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
3564 #: ../edit/virt-edit.pod:23
3566 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
3567 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
3568 "doing this, but doesn't catch all cases."
3572 #: ../edit/virt-edit.pod:29
3574 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
3575 "exists in the named virtual machine (or disk image)."
3579 #: ../edit/virt-edit.pod:32
3581 "Multiple filenames can be given, in which case they are each edited in "
3582 "turn. Each filename must be a full path, starting at the root directory "
3583 "(starting with '/')."
3587 #: ../edit/virt-edit.pod:36
3588 msgid "If you want to just view a file, use L<virt-cat(1)>."
3592 #: ../edit/virt-edit.pod:38
3594 "For more complex cases you should look at the L<guestfish(1)> tool (see "
3595 "L</USING GUESTFISH> below)."
3599 #: ../edit/virt-edit.pod:41
3601 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
3602 "that and much more."
3606 #: ../edit/virt-edit.pod:46
3607 msgid "Edit the named files interactively:"
3611 #: ../edit/virt-edit.pod:48
3614 " virt-edit -d mydomain /boot/grub/grub.conf\n"
3619 #: ../edit/virt-edit.pod:50
3622 " virt-edit -d mydomain /etc/passwd\n"
3627 #: ../edit/virt-edit.pod:52
3628 msgid "For Windows guests, some Windows paths are understood:"
3632 #: ../edit/virt-edit.pod:54
3635 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
3640 #: ../edit/virt-edit.pod:56
3642 "If Perl is installed, you can also edit files non-interactively (see "
3643 "L</NON-INTERACTIVE EDITING> below). To change the init default level to 5:"
3647 #: ../edit/virt-edit.pod:60
3650 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
3655 #: ../edit/virt-edit.pod:81
3656 msgid "B<-b> extension"
3660 #: ../edit/virt-edit.pod:83
3661 msgid "B<--backup> extension"
3665 #: ../edit/virt-edit.pod:85
3667 "Create a backup of the original file I<in the guest disk image>. The backup "
3668 "has the original filename with C<extension> added."
3672 #: ../edit/virt-edit.pod:88
3674 "Usually the first character of C<extension> would be a dot C<.> so you would "
3679 #: ../edit/virt-edit.pod:91
3682 " virt-edit -b .orig [etc]\n"
3687 #: ../edit/virt-edit.pod:93
3688 msgid "By default, no backup file is made."
3692 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181 ../fuse/guestmount.pod:105 ../inspector/virt-inspector.pod:74 ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78 ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
3697 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183 ../fuse/guestmount.pod:107 ../inspector/virt-inspector.pod:76 ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80 ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
3698 msgid "B<--connect URI>"
3702 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84 ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134 ../tools/virt-win-reg.pl:135
3704 "If you specify guest block devices directly, then libvirt is not used at "
3709 #: ../edit/virt-edit.pod:114
3711 "When prompting for keys and passphrases, virt-edit normally turns echoing "
3712 "off so you cannot see what you are typing. If you are not worried about "
3713 "Tempest attacks and there is no one else in the room you can specify this "
3714 "flag to see what you are typing."
3718 #: ../edit/virt-edit.pod:119
3723 #: ../edit/virt-edit.pod:121
3724 msgid "B<--expr> EXPR"
3728 #: ../edit/virt-edit.pod:123
3730 "Instead of launching the external editor, non-interactively apply the Perl "
3731 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
3736 #: ../edit/virt-edit.pod:127
3738 "Be careful to properly quote the expression to prevent it from being altered "
3743 #: ../edit/virt-edit.pod:130
3744 msgid "Note that this option is only available when Perl 5 is installed."
3748 #: ../edit/virt-edit.pod:132
3749 msgid "B<--format> raw|qcow2|..."
3753 #: ../edit/virt-edit.pod:143
3756 " virt-edit --format=raw -a disk.img file\n"
3761 #: ../edit/virt-edit.pod:147
3764 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
3769 #: ../edit/virt-edit.pod:181
3770 msgid "Previous versions of virt-edit allowed you to write either:"
3774 #: ../edit/virt-edit.pod:187
3777 " virt-edit guestname file\n"
3782 #: ../edit/virt-edit.pod:195
3783 msgid "NON-INTERACTIVE EDITING"
3787 #: ../edit/virt-edit.pod:197
3789 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
3790 "administrator can interactively edit the file."
3794 #: ../edit/virt-edit.pod:200
3796 "There are two ways also to use C<virt-edit> from scripts in order to make "
3797 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
3798 "like this, it's less error-prone to write scripts directly using the "
3799 "libguestfs API and Augeas for configuration file editing.)"
3803 #: ../edit/virt-edit.pod:206
3805 "The first method is to temporarily set C<$EDITOR> to any script or program "
3806 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
3807 "update C<tmpfile> in place however it likes."
3811 #: ../edit/virt-edit.pod:210
3813 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
3814 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
3815 "instances of C<foo> with C<bar> in a file:"
3819 #: ../edit/virt-edit.pod:214
3822 " virt-edit -d domname filename -e 's/foo/bar/'\n"
3827 #: ../edit/virt-edit.pod:216
3829 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
3830 "For example to delete root's password you could do:"
3834 #: ../edit/virt-edit.pod:219
3837 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3842 #: ../edit/virt-edit.pod:221
3844 "What really happens is that the snippet is evaluated as a Perl expression "
3845 "for each line of the file. The line, including the final C<\\n>, is passed "
3846 "in C<$_> and the expression should update C<$_> or leave it unchanged."
3850 #: ../edit/virt-edit.pod:226
3852 "To delete a line, set C<$_> to the empty string. For example, to delete the "
3853 "C<apache> user account from the password file you can do:"
3857 #: ../edit/virt-edit.pod:229
3860 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
3865 #: ../edit/virt-edit.pod:231
3867 "To insert a line, prepend or append it to C<$_>. However appending lines to "
3868 "the end of the file is rather difficult this way since there is no concept "
3869 "of \"last line of the file\" - your expression just doesn't get called "
3870 "again. You might want to use the first method (setting C<$EDITOR>) if you "
3875 #: ../edit/virt-edit.pod:237
3877 "The variable C<$lineno> contains the current line number. As is "
3878 "traditional, the first line in the file is number C<1>."
3882 #: ../edit/virt-edit.pod:240
3884 "The return value from the expression is ignored, but the expression may call "
3885 "C<die> in order to abort the whole program, leaving the original file "
3890 #: ../edit/virt-edit.pod:244
3892 "Remember when matching the end of a line that C<$_> may contain the final "
3893 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
3894 "newline then neither of these. Thus to match or substitute some text at the "
3895 "end of a line, use this regular expression:"
3899 #: ../edit/virt-edit.pod:249
3902 " /some text(\\r?\\n)?$/\n"
3907 #: ../edit/virt-edit.pod:251
3909 "Alternately, use the perl C<chomp> function, being careful not to chomp "
3910 "C<$_> itself (since that would remove all newlines from the file):"
3914 #: ../edit/virt-edit.pod:255
3917 " my $m = $_; chomp $m; $m =~ /some text$/\n"
3922 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
3923 msgid "WINDOWS PATHS"
3927 #: ../edit/virt-edit.pod:259
3929 "C<virt-edit> has a limited ability to understand Windows drive letters and "
3930 "paths (eg. C<E:\\foo\\bar.txt>)."
3934 #: ../edit/virt-edit.pod:262
3935 msgid "If and only if the guest is running Windows then:"
3939 #: ../edit/virt-edit.pod:268
3941 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
3942 "to the correct filesystem."
3946 #: ../edit/virt-edit.pod:273
3948 "Any backslash (C<\\>) characters in the path are replaced with forward "
3949 "slashes so that libguestfs can process it."
3953 #: ../edit/virt-edit.pod:278
3955 "The path is resolved case insensitively to locate the file that should be "
3960 #: ../edit/virt-edit.pod:283
3961 msgid "There are some known shortcomings:"
3965 #: ../edit/virt-edit.pod:289
3966 msgid "Some NTFS symbolic links may not be followed correctly."
3970 #: ../edit/virt-edit.pod:293
3971 msgid "NTFS junction points that cross filesystems are not followed."
3975 #: ../edit/virt-edit.pod:299
3977 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
3978 "C<virt-edit> doesn't work."
3982 #: ../edit/virt-edit.pod:302
3983 msgid "Using C<virt-edit> is approximately equivalent to doing:"
3987 #: ../edit/virt-edit.pod:304
3990 " guestfish --rw -i -d domname edit /file\n"
3995 #: ../edit/virt-edit.pod:306
3997 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
4002 #: ../edit/virt-edit.pod:309
4004 "The command above uses libguestfs's guest inspection feature and so does not "
4005 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
4006 "disk images that don't contain guests. To edit a file on a disk image "
4011 #: ../edit/virt-edit.pod:314
4014 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4019 #: ../edit/virt-edit.pod:316
4021 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4022 "the disk image to edit, and C</file> is the full path to the file."
4026 #: ../edit/virt-edit.pod:320
4028 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4029 "C<write> or C<upload> instead:"
4033 #: ../edit/virt-edit.pod:323
4036 " guestfish --rw -i -d domname touch /newfile\n"
4041 #: ../edit/virt-edit.pod:325
4044 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4049 #: ../edit/virt-edit.pod:327
4052 " guestfish --rw -i -d domname upload localfile /newfile\n"
4057 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1119 ../rescue/virt-rescue.pod:261 ../sparsify/virt-sparsify.pod:232 ../src/guestfs.pod:3194 ../test-tool/libguestfs-test-tool.pod:95
4058 msgid "ENVIRONMENT VARIABLES"
4062 #: ../edit/virt-edit.pod:333
4067 #: ../edit/virt-edit.pod:335
4069 "If set, this string is used as the editor. It may contain arguments, "
4070 "eg. C<\"emacs -nw\">"
4074 #: ../edit/virt-edit.pod:338
4075 msgid "If not set, C<vi> is used."
4079 #: ../edit/virt-edit.pod:356
4081 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
4082 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
4083 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4087 #: ../erlang/examples/guestfs-erlang.pod:5
4088 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4092 #: ../erlang/examples/guestfs-erlang.pod:9
4095 " {ok, G} = guestfs:create(),\n"
4096 " ok = guestfs:add_drive_opts(G, Disk,\n"
4097 " [{format, \"raw\"}, {readonly, true}]),\n"
4098 " ok = guestfs:launch(G),\n"
4099 " [Device] = guestfs:list_devices(G),\n"
4100 " ok = guestfs:close(G).\n"
4105 #: ../erlang/examples/guestfs-erlang.pod:18
4107 "This manual page documents how to call libguestfs from the Erlang "
4108 "programming language. This page just documents the differences from the C "
4109 "API and gives some examples. If you are not familiar with using libguestfs, "
4110 "you also need to read L<guestfs(3)>."
4114 #: ../erlang/examples/guestfs-erlang.pod:23
4115 msgid "OPENING AND CLOSING THE HANDLE"
4119 #: ../erlang/examples/guestfs-erlang.pod:25
4121 "The Erlang bindings are implemented using an external program called "
4122 "C<erl-guestfs>. This program must be on the current PATH, or else you "
4123 "should specify the full path to the program:"
4127 #: ../erlang/examples/guestfs-erlang.pod:29
4130 " {ok, G} = guestfs:create().\n"
4135 #: ../erlang/examples/guestfs-erlang.pod:31
4138 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4143 #: ../erlang/examples/guestfs-erlang.pod:33
4144 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4148 #: ../erlang/examples/guestfs-erlang.pod:36
4149 msgid "To close the handle:"
4153 #: ../erlang/examples/guestfs-erlang.pod:38
4156 " ok = guestfs:close(G).\n"
4161 #: ../erlang/examples/guestfs-erlang.pod:40
4162 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4166 #: ../erlang/examples/guestfs-erlang.pod:42
4168 "For functions that take optional arguments, the first arguments are the "
4169 "non-optional ones. The last argument is a list of tuples supplying the "
4170 "remaining optional arguments."
4174 #: ../erlang/examples/guestfs-erlang.pod:46
4177 " ok = guestfs:add_drive_opts(G, Disk,\n"
4178 " [{format, \"raw\"}, {readonly, true}]).\n"
4183 #: ../erlang/examples/guestfs-erlang.pod:49
4184 msgid "If the last argument would be an empty list, you can also omit it:"
4188 #: ../erlang/examples/guestfs-erlang.pod:51
4191 " ok = guestfs:add_drive_opts(G, Disk).\n"
4196 #: ../erlang/examples/guestfs-erlang.pod:53
4197 msgid "RETURN VALUES AND ERRORS"
4201 #: ../erlang/examples/guestfs-erlang.pod:55
4203 "On success, most functions return a C<Result> term (which could be a list, "
4204 "string, tuple etc.). If there is nothing for the function to return, then "
4205 "the atom C<ok> is returned."
4209 #: ../erlang/examples/guestfs-erlang.pod:59
4210 msgid "On error, you would see one of the following tuples:"
4214 #: ../erlang/examples/guestfs-erlang.pod:63
4215 msgid "C<{error, Msg, Errno}>"
4219 #: ../erlang/examples/guestfs-erlang.pod:65
4220 msgid "This indicates an ordinary error from the function."
4224 #: ../erlang/examples/guestfs-erlang.pod:67
4226 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4231 #: ../erlang/examples/guestfs-erlang.pod:70
4232 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4236 #: ../erlang/examples/guestfs-erlang.pod:72
4237 msgid "C<{unknown, Function}>"
4241 #: ../erlang/examples/guestfs-erlang.pod:74
4243 "This indicates that the function you called is not known. Generally this "
4244 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4245 "which you should not do."
4249 #: ../erlang/examples/guestfs-erlang.pod:78
4250 msgid "C<Function> is the name of the unknown function."
4254 #: ../erlang/examples/guestfs-erlang.pod:80
4255 msgid "C<{unknownarg, Arg}>"
4259 #: ../erlang/examples/guestfs-erlang.pod:82
4261 "This indicates that you called a function with optional arguments, with an "
4262 "unknown argument name."
4266 #: ../erlang/examples/guestfs-erlang.pod:85
4267 msgid "C<Arg> is the name of the unknown argument."
4271 #: ../erlang/examples/guestfs-erlang.pod:89 ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37 ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31 ../python/examples/guestfs-python.pod:34 ../ruby/examples/guestfs-ruby.pod:28
4272 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4276 #: ../erlang/examples/guestfs-erlang.pod:91 ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39 ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33 ../python/examples/guestfs-python.pod:36 ../ruby/examples/guestfs-ruby.pod:30
4281 #: ../erlang/examples/guestfs-erlang.pod:93 ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41 ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35 ../python/examples/guestfs-python.pod:38 ../ruby/examples/guestfs-ruby.pod:32
4282 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4286 #: ../erlang/examples/guestfs-erlang.pod:95 ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43 ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37 ../python/examples/guestfs-python.pod:40 ../ruby/examples/guestfs-ruby.pod:34
4291 #: ../erlang/examples/guestfs-erlang.pod:99
4293 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
4294 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4295 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://www.erlang.org/>. "
4296 "L<http://libguestfs.org/>."
4300 #: ../erlang/examples/guestfs-erlang.pod:110 ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397 ../fish/guestfish.pod:1296 ../fish/virt-copy-in.pod:60 ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58 ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:328 ../inspector/virt-inspector.pod:389 ../java/examples/guestfs-java.pod:58 ../ocaml/examples/guestfs-ocaml.pod:91 ../perl/examples/guestfs-perl.pod:52 ../python/examples/guestfs-python.pod:54 ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3333 ../test-tool/libguestfs-test-tool.pod:106
4305 #: ../erlang/examples/guestfs-erlang.pod:112 ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399 ../fish/guestfish.pod:1298 ../fish/virt-copy-in.pod:62 ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60 ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:330 ../java/examples/guestfs-java.pod:60 ../ocaml/examples/guestfs-ocaml.pod:93 ../perl/examples/guestfs-perl.pod:54 ../python/examples/guestfs-python.pod:56 ../ruby/examples/guestfs-ruby.pod:50 ../src/guestfs.pod:3335 ../test-tool/libguestfs-test-tool.pod:108
4306 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4310 #: ../erlang/examples/guestfs-erlang.pod:116 ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4311 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4315 #: ../erlang/examples/guestfs-erlang.pod:118 ../examples/guestfs-examples.pod:53 ../examples/guestfs-recipes.pod:405 ../java/examples/guestfs-java.pod:66 ../ocaml/examples/guestfs-ocaml.pod:99 ../perl/examples/guestfs-perl.pod:60 ../python/examples/guestfs-python.pod:62 ../ruby/examples/guestfs-ruby.pod:56
4317 "The examples in this manual page may be freely copied, modified and "
4318 "distributed without any restrictions."
4322 #: ../erlang/examples/guestfs-erlang.pod:121 ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408 ../java/examples/guestfs-java.pod:69 ../ocaml/examples/guestfs-ocaml.pod:102 ../perl/examples/guestfs-perl.pod:63 ../python/examples/guestfs-python.pod:65 ../ruby/examples/guestfs-ruby.pod:59 ../src/guestfs.pod:3342
4324 "This library is free software; you can redistribute it and/or modify it "
4325 "under the terms of the GNU Lesser General Public License as published by the "
4326 "Free Software Foundation; either version 2 of the License, or (at your "
4327 "option) any later version."
4331 #: ../erlang/examples/guestfs-erlang.pod:126 ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413 ../java/examples/guestfs-java.pod:74 ../ocaml/examples/guestfs-ocaml.pod:107 ../perl/examples/guestfs-perl.pod:68 ../python/examples/guestfs-python.pod:70 ../ruby/examples/guestfs-ruby.pod:64 ../src/guestfs.pod:3347
4333 "This library is distributed in the hope that it will be useful, but WITHOUT "
4334 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4335 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4340 #: ../erlang/examples/guestfs-erlang.pod:131 ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418 ../java/examples/guestfs-java.pod:79 ../ocaml/examples/guestfs-ocaml.pod:112 ../perl/examples/guestfs-perl.pod:73 ../python/examples/guestfs-python.pod:75 ../ruby/examples/guestfs-ruby.pod:69 ../src/guestfs.pod:3352
4342 "You should have received a copy of the GNU Lesser General Public License "
4343 "along with this library; if not, write to the Free Software Foundation, "
4344 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4348 #: ../examples/guestfs-examples.pod:5
4349 msgid "guestfs-examples - Examples of using libguestfs from C"
4353 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4356 " #include <guestfs.h>\n"
4361 #: ../examples/guestfs-examples.pod:11
4364 " guestfs_h *g = guestfs_create ();\n"
4365 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4366 " guestfs_launch (g);\n"
4371 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4374 " cc prog.c -o prog -lguestfs\n"
4376 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4381 #: ../examples/guestfs-examples.pod:21
4383 "This manual page contains examples of calling libguestfs from the C "
4384 "programming language. If you are not familiar with using libguestfs, you "
4385 "also need to read L<guestfs(3)>."
4389 #: ../examples/guestfs-examples.pod:35
4391 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
4392 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4393 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4397 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97 ../python/examples/guestfs-python.pod:60 ../ruby/examples/guestfs-ruby.pod:54
4398 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4402 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4407 #: ../examples/guestfs-recipes.pod:5
4409 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4410 "here. The only way which works for both sorts of output is to just write "
4411 "the URL directly. Do NOT use L<...> for URLs."
4415 #: ../examples/guestfs-recipes.pod:9
4417 "We break with tradition here and don't use ALL CAPS for the section "
4418 "headings, as this makes them much easier to read."
4422 #: ../examples/guestfs-recipes.pod:16
4423 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4427 #: ../examples/guestfs-recipes.pod:20
4429 "This page contains recipes for and links to things you can do using "
4430 "libguestfs, L<guestfish(1)> and the virt tools."
4434 #: ../examples/guestfs-recipes.pod:23
4435 msgid "Audit a virtual machine for setuid files"
4439 #: ../examples/guestfs-recipes.pod:25
4441 "The link below contains a small program which can be used to audit a Linux "
4442 "virtual machine to see what setuid and setgid files it contains."
4446 #: ../examples/guestfs-recipes.pod:28
4447 msgid "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-files/#content"
4451 #: ../examples/guestfs-recipes.pod:30
4452 msgid "Change the background image in a Windows XP VM"
4456 #: ../examples/guestfs-recipes.pod:32
4458 "The links below explain how to use L<guestfish(1)> to change the background "
4459 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4460 "be substantially different for each version of Windows."
4464 #: ../examples/guestfs-recipes.pod:37
4466 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html "
4467 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4471 #: ../examples/guestfs-recipes.pod:40
4472 msgid "Cloning a virtual machine (Linux)"
4476 #: ../examples/guestfs-recipes.pod:42
4478 "The guestfish technique described in the link below works well for most "
4479 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4484 #: ../examples/guestfs-recipes.pod:46
4485 msgid "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/#content"
4489 #: ../examples/guestfs-recipes.pod:48
4491 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
4496 #: ../examples/guestfs-recipes.pod:51
4497 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4501 #: ../examples/guestfs-recipes.pod:53
4502 msgid "Cloning a virtual machine (Windows)"
4506 #: ../examples/guestfs-recipes.pod:55
4508 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
4509 "straightforward. Currently there is code in the Aeolus Oz project which "
4510 "does this (using libguestfs). As part of our review of the virt-clone tool, "
4511 "we may add sysprepping ability."
4515 #: ../examples/guestfs-recipes.pod:60
4517 "https://github.com/clalancette/oz "
4518 "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4522 #: ../examples/guestfs-recipes.pod:63
4523 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
4527 #: ../examples/guestfs-recipes.pod:65
4528 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
4532 #: ../examples/guestfs-recipes.pod:67
4535 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
4540 #: ../examples/guestfs-recipes.pod:69
4541 msgid "To export just a subdirectory, eg. C</files>, do:"
4545 #: ../examples/guestfs-recipes.pod:71
4548 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
4553 #: ../examples/guestfs-recipes.pod:73
4554 msgid "Create empty disk images"
4558 #: ../examples/guestfs-recipes.pod:75
4560 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
4561 "The useful guide below explains the options available."
4565 #: ../examples/guestfs-recipes.pod:78
4566 msgid "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/#content"
4570 #: ../examples/guestfs-recipes.pod:80
4571 msgid "Dump raw filesystem content from inside a disk image or VM"
4575 #: ../examples/guestfs-recipes.pod:82
4577 "You can use the L<guestfish(1)> C<download> command to extract the raw "
4578 "filesystem content from any filesystem in a disk image or a VM (even one "
4579 "which is encrypted or buried inside an LV):"
4583 #: ../examples/guestfs-recipes.pod:86
4586 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
4591 #: ../examples/guestfs-recipes.pod:88
4594 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
4599 #: ../examples/guestfs-recipes.pod:90
4600 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
4604 #: ../examples/guestfs-recipes.pod:92
4605 msgid "Edit grub configuration in a VM"
4609 #: ../examples/guestfs-recipes.pod:94
4610 msgid "You can use this to:"
4614 #: ../examples/guestfs-recipes.pod:100
4615 msgid "Fix a virtual machine that does not boot."
4619 #: ../examples/guestfs-recipes.pod:104
4620 msgid "Change which kernel is used to boot the VM."
4624 #: ../examples/guestfs-recipes.pod:108
4625 msgid "Change kernel command line options."
4629 #: ../examples/guestfs-recipes.pod:112
4630 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
4634 #: ../examples/guestfs-recipes.pod:114
4637 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
4642 #: ../examples/guestfs-recipes.pod:116
4644 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
4649 #: ../examples/guestfs-recipes.pod:119
4652 " virt-rescue -d BrokenGuest\n"
4657 #: ../examples/guestfs-recipes.pod:121
4658 msgid "Export any directory from a VM"
4662 #: ../examples/guestfs-recipes.pod:123
4663 msgid "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
4667 #: ../examples/guestfs-recipes.pod:126
4670 " virt-copy-out -d Guest /home .\n"
4675 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1332 ../fish/guestfish-actions.pod:1597 ../fish/guestfish-actions.pod:2014 ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:2039 ../src/guestfs-actions.pod:2463 ../src/guestfs-actions.pod:3022 ../src/guestfs.pod:1670 ../tools/virt-win-reg.pl:706
4680 #: ../examples/guestfs-recipes.pod:134
4682 "The final dot of the command is not a printing error. It means we want to "
4683 "copy out to the current directory."
4687 #: ../examples/guestfs-recipes.pod:139
4688 msgid "This creates a directory called C<home> under the current directory."
4692 #: ../examples/guestfs-recipes.pod:143
4694 "If the guest is a Windows guest then you can use drive letters and "
4695 "backslashes, but you must prefix the path with C<win:> and quote it to "
4696 "protect it from the shell, like this:"
4700 #: ../examples/guestfs-recipes.pod:147
4703 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
4708 #: ../examples/guestfs-recipes.pod:149
4709 msgid "To get the output as a compressed tarball, do:"
4713 #: ../examples/guestfs-recipes.pod:151
4716 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
4721 #: ../examples/guestfs-recipes.pod:153
4723 "Although it sounds tempting, this is usually not a reliable way to get a "
4724 "backup from a running guest. See the entry in the FAQ: "
4725 "http://libguestfs.org/FAQ.html#backup"
4729 #: ../examples/guestfs-recipes.pod:157
4730 msgid "Find out which user is using the most space"
4734 #: ../examples/guestfs-recipes.pod:159
4736 "This simple script examines a Linux guest to find out which user is using "
4737 "the most space in their home directory:"
4741 #: ../examples/guestfs-recipes.pod:162
4749 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
4757 #: ../examples/guestfs-recipes.pod:166
4766 #: ../examples/guestfs-recipes.pod:169
4769 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
4774 #: ../examples/guestfs-recipes.pod:171
4777 " for d in $(guestfish --remote ls \"$dir\"); do\n"
4778 " echo -n \"$dir/$d\"\n"
4780 " guestfish --remote du \"$dir/$d\";\n"
4781 " done | sort -nr -k 2\n"
4786 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
4789 " guestfish --remote exit\n"
4794 #: ../examples/guestfs-recipes.pod:179
4795 msgid "Get DHCP address from a VM"
4799 #: ../examples/guestfs-recipes.pod:181
4801 "The link below explains the many different possible techniques for getting "
4802 "the last assigned DHCP address of a virtual machine."
4806 #: ../examples/guestfs-recipes.pod:184
4807 msgid "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-a-virtual-machine-disk-image/#content"
4811 #: ../examples/guestfs-recipes.pod:186
4813 "In the libguestfs source examples directory you will find the latest version "
4814 "of the C<virt-dhcp-address.c> program."
4818 #: ../examples/guestfs-recipes.pod:189
4819 msgid "Get the operating system product name string"
4823 #: ../examples/guestfs-recipes.pod:191
4824 msgid "Save the following script into a file called C<product-name.sh>:"
4828 #: ../examples/guestfs-recipes.pod:193
4833 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4834 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4835 " guestfish --remote inspect-get-product-name \"$root\"\n"
4836 " guestfish --remote exit\n"
4841 #: ../examples/guestfs-recipes.pod:200
4842 msgid "Make the script executable and run it on a named guest:"
4846 #: ../examples/guestfs-recipes.pod:202
4849 " # product-name.sh RHEL60x64\n"
4850 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
4855 #: ../examples/guestfs-recipes.pod:205
4857 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
4858 "C<xpath> command line tool or from your favourite programming language:"
4862 #: ../examples/guestfs-recipes.pod:209
4865 " # virt-inspector RHEL60x64 > xml\n"
4866 " # xpath '//product_name' < xml\n"
4869 " <product_name>Red Hat Enterprise Linux Server release 6.0 "
4870 "(Santiago)</product_name>\n"
4875 #: ../examples/guestfs-recipes.pod:215
4876 msgid "Get the default boot kernel for a Linux VM"
4880 #: ../examples/guestfs-recipes.pod:217
4882 "The link below contains a program to print the default boot kernel for a "
4887 #: ../examples/guestfs-recipes.pod:220
4888 msgid "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-kernel-for-a-vm/#content"
4892 #: ../examples/guestfs-recipes.pod:222
4894 "It uses Augeas, and the technique is generally applicable for many different "
4899 #: ../examples/guestfs-recipes.pod:229
4900 msgid "listing the user accounts in the guest"
4904 #: ../examples/guestfs-recipes.pod:233
4905 msgid "what repositories is it configured to use"
4909 #: ../examples/guestfs-recipes.pod:237
4910 msgid "what NTP servers does it connect to"
4914 #: ../examples/guestfs-recipes.pod:241
4915 msgid "what were the boot messages last time it booted"
4919 #: ../examples/guestfs-recipes.pod:245
4920 msgid "listing who was logged in recently"
4924 #: ../examples/guestfs-recipes.pod:249
4925 msgid "http://augeas.net/"
4929 #: ../examples/guestfs-recipes.pod:251
4930 msgid "Install RPMs in a guest"
4934 #: ../examples/guestfs-recipes.pod:253
4936 "The link below contains a method to install RPMs in a guest. In fact the "
4937 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
4938 "installs them next time the guest is booted. You could use this technique "
4939 "to install vital security updates in an offline guest."
4943 #: ../examples/guestfs-recipes.pod:259
4944 msgid "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
4948 #: ../examples/guestfs-recipes.pod:261
4949 msgid "List applications installed in a VM"
4953 #: ../examples/guestfs-recipes.pod:263
4954 msgid "Save the following to a file C<list-apps.sh>:"
4958 #: ../examples/guestfs-recipes.pod:265
4963 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4964 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4965 " guestfish --remote inspect-list-applications \"$root\"\n"
4966 " guestfish --remote exit\n"
4971 #: ../examples/guestfs-recipes.pod:272
4973 "Make the file executable and then you can run it on any named virtual "
4978 #: ../examples/guestfs-recipes.pod:275
4981 " # list-apps.sh WinGuest\n"
4983 " app_name: Mozilla Firefox (3.6.12)\n"
4984 " app_display_name: Mozilla Firefox (3.6.12)\n"
4986 " app_version: 3.6.12 (en-GB)\n"
4988 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
4989 " app_trans_path:\n"
4990 " app_publisher: Mozilla\n"
4991 " app_url: http://www.mozilla.com/en-GB/\n"
4992 " app_source_package:\n"
4994 " app_description: Mozilla Firefox\n"
4997 " app_name: VLC media player\n"
4998 " app_display_name: VLC media player 1.1.5\n"
5000 " app_version: 1.1.5\n"
5002 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
5003 " app_trans_path:\n"
5004 " app_publisher: VideoLAN\n"
5005 " app_url: http://www.videolan.org/\n"
5006 " app_source_package:\n"
5008 " app_description:\n"
5014 #: ../examples/guestfs-recipes.pod:305
5016 "If you want to run the script on disk images (instead of libvirt virtual "
5017 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also "
5018 "L<virt-inspector(1)>."
5022 #: ../examples/guestfs-recipes.pod:309
5023 msgid "List files and directories in a VM"
5027 #: ../examples/guestfs-recipes.pod:311
5028 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5032 #: ../examples/guestfs-recipes.pod:313
5035 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5040 #: ../examples/guestfs-recipes.pod:315
5041 msgid "List services in a Windows VM"
5045 #: ../examples/guestfs-recipes.pod:317
5047 "The link below contains a script that can be used to list out the services "
5048 "from a Windows VM, and whether those services run at boot time or are loaded "
5053 #: ../examples/guestfs-recipes.pod:321
5054 msgid "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/#content"
5058 #: ../examples/guestfs-recipes.pod:323
5059 msgid "Make a disk image sparse"
5063 #: ../examples/guestfs-recipes.pod:325
5065 "The link below contains some guides for making a disk image sparse (or "
5066 "reintroducing sparseness)."
5070 #: ../examples/guestfs-recipes.pod:328
5071 msgid "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5075 #: ../examples/guestfs-recipes.pod:330
5076 msgid "Monitor disk usage over time"
5080 #: ../examples/guestfs-recipes.pod:332
5082 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5083 "The link below contains a guide."
5087 #: ../examples/guestfs-recipes.pod:335
5088 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5092 #: ../examples/guestfs-recipes.pod:337
5093 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5097 #: ../examples/guestfs-recipes.pod:339
5099 "L<guestfish(1)> plus the tools described in the link below can be used to "
5100 "read out the Windows Event Log from any virtual machine running Windows "
5101 "Vista or a later version."
5105 #: ../examples/guestfs-recipes.pod:343
5106 msgid "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-guestfish/#content"
5110 #: ../examples/guestfs-recipes.pod:345
5111 msgid "Remove root password (Linux)"
5115 #: ../examples/guestfs-recipes.pod:347
5117 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5118 "files. One use is to remove the root password from a Linux guest:"
5122 #: ../examples/guestfs-recipes.pod:350
5125 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5130 #: ../examples/guestfs-recipes.pod:352
5131 msgid "Remove Administrator password (Windows)"
5135 #: ../examples/guestfs-recipes.pod:354
5137 "The link below contains one technique for removing the Administrator "
5138 "password from a Windows VM, or to be more precise, it gives you a command "
5139 "prompt the next time you log in which you can use to bypass any security:"
5143 #: ../examples/guestfs-recipes.pod:359
5144 msgid "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-administrator-password-with-guestfish/"
5148 #: ../examples/guestfs-recipes.pod:361
5149 msgid "Unpack a live CD"
5153 #: ../examples/guestfs-recipes.pod:363
5155 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5156 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5157 "layers, as outlined in the guide below."
5161 #: ../examples/guestfs-recipes.pod:367
5162 msgid "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/#content"
5166 #: ../examples/guestfs-recipes.pod:369
5167 msgid "Uploading and downloading files"
5171 #: ../examples/guestfs-recipes.pod:371
5173 "The link below contains general tips on uploading (copying in) and "
5174 "downloading (copying out) files from VMs."
5178 #: ../examples/guestfs-recipes.pod:374
5179 msgid "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5183 #: ../examples/guestfs-recipes.pod:376
5184 msgid "Use libguestfs tools on VMware ESX guests"
5188 #: ../examples/guestfs-recipes.pod:378
5190 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5191 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5195 #: ../examples/guestfs-recipes.pod:382
5196 msgid "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/#content"
5200 #: ../examples/guestfs-recipes.pod:386
5202 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, "
5203 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
5204 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
5205 "L<http://libguestfs.org/>."
5209 #: ../examples/guestfs-recipes.pod:403
5210 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5214 #: ../fish/guestfish-actions.pod:1
5219 #: ../fish/guestfish-actions.pod:3
5222 " add-cdrom filename\n"
5227 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
5228 msgid "This function adds a virtual CD-ROM disk image to the guest."
5232 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
5233 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
5237 #: ../fish/guestfish-actions.pod:15
5239 "This call checks for the existence of C<filename>. This stops you from "
5240 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5241 "and C<http:> URLs. To specify those, use the general L</config> call "
5246 #: ../fish/guestfish-actions.pod:22
5248 "If you just want to add an ISO file (often you use this as an efficient way "
5249 "to transfer large files into the guest), then you should probably use "
5250 "L</add-drive-ro> instead."
5254 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:168 ../fish/guestfish-actions.pod:182
5256 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
5261 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:171 ../fish/guestfish-actions.pod:185 ../fish/guestfish-actions.pod:1031 ../fish/guestfish-actions.pod:1391 ../fish/guestfish-actions.pod:1405 ../fish/guestfish-actions.pod:3175 ../fish/guestfish-actions.pod:3486 ../fish/guestfish-actions.pod:3534 ../fish/guestfish-actions.pod:4447 ../fish/guestfish-actions.pod:4470 ../fish/guestfish-actions.pod:4492 ../fish/guestfish-actions.pod:4530 ../fish/guestfish-actions.pod:5179 ../fish/guestfish-actions.pod:5285 ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:258 ../src/guestfs-actions.pod:279 ../src/guestfs-actions.pod:1625 ../src/guestfs-actions.pod:2124 ../src/guestfs-actions.pod:2145 ../src/guestfs-actions.pod:4790 ../src/guestfs-actions.pod:5312 ../src/guestfs-actions.pod:5412 ../src/guestfs-actions.pod:6694 ../src/guestfs-actions.pod:6738 ../src/guestfs-actions.pod:6772 ../src/guestfs-actions.pod:6835 ../src/guestfs-actions.pod:7767 ../src/guestfs-actions.pod:7876 ../src/guestfs-actions.pod:8059
5263 "Deprecated functions will not be removed from the API, but the fact that "
5264 "they are deprecated indicates that there are problems with correct use of "
5269 #: ../fish/guestfish-actions.pod:35
5274 #: ../fish/guestfish-actions.pod:37
5279 #: ../fish/guestfish-actions.pod:39
5282 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] "
5288 #: ../fish/guestfish-actions.pod:41
5290 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5291 "It works by connecting to libvirt, requesting the domain and domain XML from "
5292 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
5296 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
5298 "The number of disks added is returned. This operation is atomic: if an "
5299 "error is returned, then no disks are added."
5303 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
5305 "This function does some minimal checks to make sure the libvirt domain is "
5306 "not running (unless C<readonly> is true). In a future version we will try "
5307 "to acquire the libvirt lock on each disk."
5311 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
5313 "Disks must be accessible locally. This often means that adding disks from a "
5314 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5315 "unless those disks are accessible via the same device path locally too."
5319 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
5321 "The optional C<libvirturi> parameter sets the libvirt URI (see "
5322 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
5323 "default libvirt URI (or one set through an environment variable, see the "
5324 "libvirt documentation for full details)."
5328 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
5330 "The optional C<live> flag controls whether this call will try to connect to "
5331 "a running virtual machine C<guestfsd> process if it sees a suitable "
5332 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5333 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5334 "DAEMONS> for more information."
5338 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
5340 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
5341 "passed instead of the domain name. The C<dom> string is treated as a UUID "
5342 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
5347 #: ../fish/guestfish-actions.pod:76
5349 "The other optional parameters are passed directly through to "
5350 "L</add-drive-opts>."
5354 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:148 ../fish/guestfish-actions.pod:578 ../fish/guestfish-actions.pod:789 ../fish/guestfish-actions.pod:810 ../fish/guestfish-actions.pod:2053 ../fish/guestfish-actions.pod:3224 ../fish/guestfish-actions.pod:3387 ../fish/guestfish-actions.pod:3522
5356 "This command has one or more optional arguments. See L</OPTIONAL "
5361 #: ../fish/guestfish-actions.pod:81
5366 #: ../fish/guestfish-actions.pod:83
5369 " add-drive filename\n"
5374 #: ../fish/guestfish-actions.pod:85
5376 "This function is the equivalent of calling L</add-drive-opts> with no "
5377 "optional parameters, so the disk is added writable, with the format being "
5378 "detected automatically."
5382 #: ../fish/guestfish-actions.pod:89
5384 "Automatic detection of the format opens you up to a potential security hole "
5385 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5386 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5387 "you should think about replacing calls to this function with calls to "
5388 "L</add-drive-opts>, and specifying the format."
5392 #: ../fish/guestfish-actions.pod:96
5393 msgid "add-drive-opts"
5397 #: ../fish/guestfish-actions.pod:98
5402 #: ../fish/guestfish-actions.pod:100
5405 " add-drive-opts filename [readonly:..] [format:..] [iface:..] [name:..]\n"
5410 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:161
5412 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5413 "The first time you call this function, the disk appears as C</dev/sda>, the "
5414 "second time as C</dev/sdb>, and so on."
5418 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:166
5420 "You don't necessarily need to be root when using libguestfs. However you "
5421 "obviously do need sufficient permissions to access the filename for whatever "
5422 "operations you want to perform (ie. read access if you just want to read the "
5423 "image or write access if you want to modify the image)."
5427 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:172
5428 msgid "This call checks that C<filename> exists."
5432 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3186 ../src/guestfs-actions.pod:174 ../src/guestfs-actions.pod:4827
5433 msgid "The optional arguments are:"
5437 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:178
5442 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:180
5444 "If true then the image is treated as read-only. Writes are still allowed, "
5445 "but they are stored in a temporary snapshot overlay which is discarded at "
5446 "the end. The disk that you add is not modified."
5450 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:184
5455 #: ../fish/guestfish-actions.pod:127
5457 "This forces the image format. If you omit this (or use L</add-drive> or "
5458 "L</add-drive-ro>) then the format is automatically detected. Possible "
5459 "formats include C<raw> and C<qcow2>."
5463 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:190
5465 "Automatic detection of the format opens you up to a potential security hole "
5466 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5467 "RHBZ#642934. Specifying the format closes this security hole."
5471 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:195
5476 #: ../fish/guestfish-actions.pod:138
5478 "This rarely-used option lets you emulate the behaviour of the deprecated "
5479 "L</add-drive-with-if> call (q.v.)"
5483 #: ../fish/guestfish-actions.pod:141 ../src/guestfs-actions.pod:200
5488 #: ../fish/guestfish-actions.pod:143 ../src/guestfs-actions.pod:202
5490 "The name the drive had in the original guest, e.g. /dev/sdb. This is used as "
5491 "a hint to the guest inspection process if it is available."
5495 #: ../fish/guestfish-actions.pod:150
5496 msgid "add-drive-ro"
5500 #: ../fish/guestfish-actions.pod:152
5505 #: ../fish/guestfish-actions.pod:154
5508 " add-drive-ro filename\n"
5513 #: ../fish/guestfish-actions.pod:156
5515 "This function is the equivalent of calling L</add-drive-opts> with the "
5516 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
5517 "is added read-only, with the format being detected automatically."
5521 #: ../fish/guestfish-actions.pod:161
5522 msgid "add-drive-ro-with-if"
5526 #: ../fish/guestfish-actions.pod:163
5529 " add-drive-ro-with-if filename iface\n"
5534 #: ../fish/guestfish-actions.pod:165
5536 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
5537 "interface emulation to use at run time."
5541 #: ../fish/guestfish-actions.pod:175
5542 msgid "add-drive-with-if"
5546 #: ../fish/guestfish-actions.pod:177
5549 " add-drive-with-if filename iface\n"
5554 #: ../fish/guestfish-actions.pod:179
5556 "This is the same as L</add-drive> but it allows you to specify the QEMU "
5557 "interface emulation to use at run time."
5561 #: ../fish/guestfish-actions.pod:189
5566 #: ../fish/guestfish-actions.pod:191
5569 " aug-clear augpath\n"
5574 #: ../fish/guestfish-actions.pod:193 ../src/guestfs-actions.pod:296
5576 "Set the value associated with C<path> to C<NULL>. This is the same as the "
5577 "L<augtool(1)> C<clear> command."
5581 #: ../fish/guestfish-actions.pod:196
5586 #: ../fish/guestfish-actions.pod:198
5594 #: ../fish/guestfish-actions.pod:200
5596 "Close the current Augeas handle and free up any resources used by it. After "
5597 "calling this, you have to call L</aug-init> again before you can use any "
5598 "other Augeas functions."
5602 #: ../fish/guestfish-actions.pod:205
5607 #: ../fish/guestfish-actions.pod:207
5610 " aug-defnode name expr val\n"
5615 #: ../fish/guestfish-actions.pod:209 ../src/guestfs-actions.pod:325
5616 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
5620 #: ../fish/guestfish-actions.pod:212
5622 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
5623 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
5624 "containing that single node."
5628 #: ../fish/guestfish-actions.pod:216 ../src/guestfs-actions.pod:332
5630 "On success this returns a pair containing the number of nodes in the "
5631 "nodeset, and a boolean flag if a node was created."
5635 #: ../fish/guestfish-actions.pod:220
5640 #: ../fish/guestfish-actions.pod:222
5643 " aug-defvar name expr\n"
5648 #: ../fish/guestfish-actions.pod:224 ../src/guestfs-actions.pod:349
5650 "Defines an Augeas variable C<name> whose value is the result of evaluating "
5651 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
5655 #: ../fish/guestfish-actions.pod:228 ../src/guestfs-actions.pod:353
5657 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
5658 "evaluates to something which is not a nodeset."
5662 #: ../fish/guestfish-actions.pod:231
5667 #: ../fish/guestfish-actions.pod:233
5670 " aug-get augpath\n"
5675 #: ../fish/guestfish-actions.pod:235 ../src/guestfs-actions.pod:366
5677 "Look up the value associated with C<path>. If C<path> matches exactly one "
5678 "node, the C<value> is returned."
5682 #: ../fish/guestfish-actions.pod:238
5687 #: ../fish/guestfish-actions.pod:240
5690 " aug-init root flags\n"
5695 #: ../fish/guestfish-actions.pod:242 ../src/guestfs-actions.pod:381
5697 "Create a new Augeas handle for editing configuration files. If there was "
5698 "any previous Augeas handle associated with this guestfs session, then it is "
5703 #: ../fish/guestfish-actions.pod:246
5704 msgid "You must call this before using any other L</aug-*> commands."
5708 #: ../fish/guestfish-actions.pod:249 ../src/guestfs-actions.pod:388
5709 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5713 #: ../fish/guestfish-actions.pod:252 ../src/guestfs-actions.pod:391
5715 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5716 "logical I<or> of the following integers:"
5720 #: ../fish/guestfish-actions.pod:258 ../src/guestfs-actions.pod:397
5721 msgid "C<AUG_SAVE_BACKUP> = 1"
5725 #: ../fish/guestfish-actions.pod:260 ../src/guestfs-actions.pod:399
5726 msgid "Keep the original file with a C<.augsave> extension."
5730 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:401
5731 msgid "C<AUG_SAVE_NEWFILE> = 2"
5735 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:403
5737 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5738 "original. Overrides C<AUG_SAVE_BACKUP>."
5742 #: ../fish/guestfish-actions.pod:267 ../src/guestfs-actions.pod:406
5743 msgid "C<AUG_TYPE_CHECK> = 4"
5747 #: ../fish/guestfish-actions.pod:269 ../src/guestfs-actions.pod:408
5748 msgid "Typecheck lenses."
5752 #: ../fish/guestfish-actions.pod:271
5754 "This option is only useful when debugging Augeas lenses. Use of this option "
5755 "may require additional memory for the libguestfs appliance. You may need to "
5756 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
5760 #: ../fish/guestfish-actions.pod:276 ../src/guestfs-actions.pod:415
5761 msgid "C<AUG_NO_STDINC> = 8"
5765 #: ../fish/guestfish-actions.pod:278 ../src/guestfs-actions.pod:417
5766 msgid "Do not use standard load path for modules."
5770 #: ../fish/guestfish-actions.pod:280 ../src/guestfs-actions.pod:419
5771 msgid "C<AUG_SAVE_NOOP> = 16"
5775 #: ../fish/guestfish-actions.pod:282 ../src/guestfs-actions.pod:421
5776 msgid "Make save a no-op, just record what would have been changed."
5780 #: ../fish/guestfish-actions.pod:284 ../src/guestfs-actions.pod:423
5781 msgid "C<AUG_NO_LOAD> = 32"
5785 #: ../fish/guestfish-actions.pod:286
5786 msgid "Do not load the tree in L</aug-init>."
5790 #: ../fish/guestfish-actions.pod:290
5791 msgid "To close the handle, you can call L</aug-close>."
5795 #: ../fish/guestfish-actions.pod:292 ../src/guestfs-actions.pod:431
5796 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5800 #: ../fish/guestfish-actions.pod:294
5805 #: ../fish/guestfish-actions.pod:296
5808 " aug-insert augpath label true|false\n"
5813 #: ../fish/guestfish-actions.pod:298 ../src/guestfs-actions.pod:445
5815 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5816 "or after C<path> (depending on the boolean flag C<before>)."
5820 #: ../fish/guestfish-actions.pod:302 ../src/guestfs-actions.pod:449
5822 "C<path> must match exactly one existing node in the tree, and C<label> must "
5823 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5827 #: ../fish/guestfish-actions.pod:306
5832 #: ../fish/guestfish-actions.pod:308
5840 #: ../fish/guestfish-actions.pod:310 ../src/guestfs-actions.pod:462
5841 msgid "Load files into the tree."
5845 #: ../fish/guestfish-actions.pod:312 ../src/guestfs-actions.pod:464
5846 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5850 #: ../fish/guestfish-actions.pod:315
5855 #: ../fish/guestfish-actions.pod:317
5863 #: ../fish/guestfish-actions.pod:319
5865 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
5866 "resulting nodes into alphabetical order."
5870 #: ../fish/guestfish-actions.pod:322
5875 #: ../fish/guestfish-actions.pod:324
5878 " aug-match augpath\n"
5883 #: ../fish/guestfish-actions.pod:326 ../src/guestfs-actions.pod:492
5885 "Returns a list of paths which match the path expression C<path>. The "
5886 "returned paths are sufficiently qualified so that they match exactly one "
5887 "node in the current tree."
5891 #: ../fish/guestfish-actions.pod:330
5896 #: ../fish/guestfish-actions.pod:332
5899 " aug-mv src dest\n"
5904 #: ../fish/guestfish-actions.pod:334 ../src/guestfs-actions.pod:509
5906 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5907 "C<dest> is overwritten if it exists."
5911 #: ../fish/guestfish-actions.pod:337
5916 #: ../fish/guestfish-actions.pod:339
5924 #: ../fish/guestfish-actions.pod:341 ../src/guestfs-actions.pod:522
5925 msgid "Remove C<path> and all of its children."
5929 #: ../fish/guestfish-actions.pod:343 ../src/guestfs-actions.pod:524
5930 msgid "On success this returns the number of entries which were removed."
5934 #: ../fish/guestfish-actions.pod:345
5939 #: ../fish/guestfish-actions.pod:347
5947 #: ../fish/guestfish-actions.pod:349 ../src/guestfs-actions.pod:535
5948 msgid "This writes all pending changes to disk."
5952 #: ../fish/guestfish-actions.pod:351
5954 "The flags which were passed to L</aug-init> affect exactly how files are "
5959 #: ../fish/guestfish-actions.pod:354
5964 #: ../fish/guestfish-actions.pod:356
5967 " aug-set augpath val\n"
5972 #: ../fish/guestfish-actions.pod:358 ../src/guestfs-actions.pod:551
5973 msgid "Set the value associated with C<path> to C<val>."
5977 #: ../fish/guestfish-actions.pod:360
5979 "In the Augeas API, it is possible to clear a node by setting the value to "
5980 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5981 "this call. Instead you must use the L</aug-clear> call."
5985 #: ../fish/guestfish-actions.pod:365
5990 #: ../fish/guestfish-actions.pod:367
5993 " available 'groups ...'\n"
5998 #: ../fish/guestfish-actions.pod:369 ../src/guestfs-actions.pod:568
6000 "This command is used to check the availability of some groups of "
6001 "functionality in the appliance, which not all builds of the libguestfs "
6002 "appliance will be able to provide."
6006 #: ../fish/guestfish-actions.pod:373
6008 "The libguestfs groups, and the functions that those groups correspond to, "
6009 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6010 "runtime by calling L</available-all-groups>."
6014 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:577
6016 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
6017 "\"augeas\"]> would check for the availability of the Linux inotify functions "
6018 "and Augeas (configuration file editing) functions."
6022 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:582
6023 msgid "The command returns no error if I<all> requested groups are available."
6027 #: ../fish/guestfish-actions.pod:385 ../src/guestfs-actions.pod:584
6029 "It fails with an error if one or more of the requested groups is unavailable "
6034 #: ../fish/guestfish-actions.pod:388 ../src/guestfs-actions.pod:587
6036 "If an unknown group name is included in the list of groups then an error is "
6041 #: ../fish/guestfish-actions.pod:391 ../src/guestfs-actions.pod:590
6046 #: ../fish/guestfish-actions.pod:397
6047 msgid "You must call L</launch> before calling this function."
6051 #: ../fish/guestfish-actions.pod:399 ../src/guestfs-actions.pod:598
6053 "The reason is because we don't know what groups are supported by the "
6054 "appliance/daemon until it is running and can be queried."
6058 #: ../fish/guestfish-actions.pod:405 ../src/guestfs-actions.pod:604
6060 "If a group of functions is available, this does not necessarily mean that "
6061 "they will work. You still have to check for errors when calling individual "
6062 "API functions even if they are available."
6066 #: ../fish/guestfish-actions.pod:412 ../src/guestfs-actions.pod:611
6068 "It is usually the job of distro packagers to build complete functionality "
6069 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6070 "with all requirements satisfied, will support everything."
6074 #: ../fish/guestfish-actions.pod:419
6076 "This call was added in version C<1.0.80>. In previous versions of "
6077 "libguestfs all you could do would be to speculatively execute a command to "
6078 "find out if the daemon implemented it. See also L</version>."
6082 #: ../fish/guestfish-actions.pod:426
6083 msgid "available-all-groups"
6087 #: ../fish/guestfish-actions.pod:428
6090 " available-all-groups\n"
6095 #: ../fish/guestfish-actions.pod:430
6097 "This command returns a list of all optional groups that this daemon knows "
6098 "about. Note this returns both supported and unsupported groups. To find "
6099 "out which ones the daemon can actually support you have to call "
6100 "L</available> on each member of the returned list."
6104 #: ../fish/guestfish-actions.pod:436
6105 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6109 #: ../fish/guestfish-actions.pod:438
6114 #: ../fish/guestfish-actions.pod:440
6117 " base64-in (base64file|-) filename\n"
6122 #: ../fish/guestfish-actions.pod:442 ../src/guestfs-actions.pod:655
6123 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
6127 #: ../fish/guestfish-actions.pod:445 ../fish/guestfish-actions.pod:454 ../fish/guestfish-actions.pod:703 ../fish/guestfish-actions.pod:787 ../fish/guestfish-actions.pod:808 ../fish/guestfish-actions.pod:907 ../fish/guestfish-actions.pod:926 ../fish/guestfish-actions.pod:1300 ../fish/guestfish-actions.pod:4750 ../fish/guestfish-actions.pod:4762 ../fish/guestfish-actions.pod:4773 ../fish/guestfish-actions.pod:4784 ../fish/guestfish-actions.pod:4836 ../fish/guestfish-actions.pod:4845 ../fish/guestfish-actions.pod:4899 ../fish/guestfish-actions.pod:4922
6128 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6132 #: ../fish/guestfish-actions.pod:447
6137 #: ../fish/guestfish-actions.pod:449
6140 " base64-out filename (base64file|-)\n"
6145 #: ../fish/guestfish-actions.pod:451 ../src/guestfs-actions.pod:669
6147 "This command downloads the contents of C<filename>, writing it out to local "
6148 "file C<base64file> encoded as base64."
6152 #: ../fish/guestfish-actions.pod:456
6153 msgid "blockdev-flushbufs"
6157 #: ../fish/guestfish-actions.pod:458
6160 " blockdev-flushbufs device\n"
6165 #: ../fish/guestfish-actions.pod:460 ../src/guestfs-actions.pod:682
6166 msgid "This tells the kernel to flush internal buffers associated with C<device>."
6170 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:474 ../fish/guestfish-actions.pod:483 ../fish/guestfish-actions.pod:493 ../fish/guestfish-actions.pod:505 ../fish/guestfish-actions.pod:518 ../fish/guestfish-actions.pod:526 ../fish/guestfish-actions.pod:537 ../fish/guestfish-actions.pod:545 ../fish/guestfish-actions.pod:553 ../src/guestfs-actions.pod:685 ../src/guestfs-actions.pod:702 ../src/guestfs-actions.pod:717 ../src/guestfs-actions.pod:733 ../src/guestfs-actions.pod:751 ../src/guestfs-actions.pod:770 ../src/guestfs-actions.pod:784 ../src/guestfs-actions.pod:802 ../src/guestfs-actions.pod:816 ../src/guestfs-actions.pod:830
6171 msgid "This uses the L<blockdev(8)> command."
6175 #: ../fish/guestfish-actions.pod:465
6176 msgid "blockdev-getbsz"
6180 #: ../fish/guestfish-actions.pod:467
6183 " blockdev-getbsz device\n"
6188 #: ../fish/guestfish-actions.pod:469 ../src/guestfs-actions.pod:697
6189 msgid "This returns the block size of a device."
6193 #: ../fish/guestfish-actions.pod:471 ../fish/guestfish-actions.pod:534 ../src/guestfs-actions.pod:699 ../src/guestfs-actions.pod:799
6195 "(Note this is different from both I<size in blocks> and I<filesystem block "
6200 #: ../fish/guestfish-actions.pod:476
6201 msgid "blockdev-getro"
6205 #: ../fish/guestfish-actions.pod:478
6208 " blockdev-getro device\n"
6213 #: ../fish/guestfish-actions.pod:480 ../src/guestfs-actions.pod:714
6215 "Returns a boolean indicating if the block device is read-only (true if "
6216 "read-only, false if not)."
6220 #: ../fish/guestfish-actions.pod:485
6221 msgid "blockdev-getsize64"
6225 #: ../fish/guestfish-actions.pod:487
6228 " blockdev-getsize64 device\n"
6233 #: ../fish/guestfish-actions.pod:489 ../src/guestfs-actions.pod:729
6234 msgid "This returns the size of the device in bytes."
6238 #: ../fish/guestfish-actions.pod:491
6239 msgid "See also L</blockdev-getsz>."
6243 #: ../fish/guestfish-actions.pod:495
6244 msgid "blockdev-getss"
6248 #: ../fish/guestfish-actions.pod:497
6251 " blockdev-getss device\n"
6256 #: ../fish/guestfish-actions.pod:499 ../src/guestfs-actions.pod:745
6258 "This returns the size of sectors on a block device. Usually 512, but can be "
6259 "larger for modern devices."
6263 #: ../fish/guestfish-actions.pod:502
6264 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
6268 #: ../fish/guestfish-actions.pod:507
6269 msgid "blockdev-getsz"
6273 #: ../fish/guestfish-actions.pod:509
6276 " blockdev-getsz device\n"
6281 #: ../fish/guestfish-actions.pod:511 ../src/guestfs-actions.pod:763
6283 "This returns the size of the device in units of 512-byte sectors (even if "
6284 "the sectorsize isn't 512 bytes ... weird)."
6288 #: ../fish/guestfish-actions.pod:514
6290 "See also L</blockdev-getss> for the real sector size of the device, and "
6291 "L</blockdev-getsize64> for the more useful I<size in bytes>."
6295 #: ../fish/guestfish-actions.pod:520
6296 msgid "blockdev-rereadpt"
6300 #: ../fish/guestfish-actions.pod:522
6303 " blockdev-rereadpt device\n"
6308 #: ../fish/guestfish-actions.pod:524 ../src/guestfs-actions.pod:782
6309 msgid "Reread the partition table on C<device>."
6313 #: ../fish/guestfish-actions.pod:528
6314 msgid "blockdev-setbsz"
6318 #: ../fish/guestfish-actions.pod:530
6321 " blockdev-setbsz device blocksize\n"
6326 #: ../fish/guestfish-actions.pod:532 ../src/guestfs-actions.pod:797
6327 msgid "This sets the block size of a device."
6331 #: ../fish/guestfish-actions.pod:539
6332 msgid "blockdev-setro"
6336 #: ../fish/guestfish-actions.pod:541
6339 " blockdev-setro device\n"
6344 #: ../fish/guestfish-actions.pod:543 ../src/guestfs-actions.pod:814
6345 msgid "Sets the block device named C<device> to read-only."
6349 #: ../fish/guestfish-actions.pod:547
6350 msgid "blockdev-setrw"
6354 #: ../fish/guestfish-actions.pod:549
6357 " blockdev-setrw device\n"
6362 #: ../fish/guestfish-actions.pod:551 ../src/guestfs-actions.pod:828
6363 msgid "Sets the block device named C<device> to read-write."
6367 #: ../fish/guestfish-actions.pod:555
6368 msgid "btrfs-filesystem-resize"
6372 #: ../fish/guestfish-actions.pod:557
6375 " btrfs-filesystem-resize mountpoint [size:..]\n"
6380 #: ../fish/guestfish-actions.pod:559 ../src/guestfs-actions.pod:850
6381 msgid "This command resizes a btrfs filesystem."
6385 #: ../fish/guestfish-actions.pod:561 ../src/guestfs-actions.pod:852
6387 "Note that unlike other resize calls, the filesystem has to be mounted and "
6388 "the parameter is the mountpoint not the device (this is a requirement of "
6393 #: ../fish/guestfish-actions.pod:565 ../fish/guestfish-actions.pod:3497 ../src/guestfs-actions.pod:856 ../src/guestfs-actions.pod:5351
6394 msgid "The optional parameters are:"
6398 #: ../fish/guestfish-actions.pod:569 ../fish/guestfish-actions.pod:3501 ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:5355
6403 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:862
6405 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
6406 "resized to the maximum size."
6410 #: ../fish/guestfish-actions.pod:576 ../src/guestfs-actions.pod:867
6411 msgid "See also L<btrfs(8)>."
6415 #: ../fish/guestfish-actions.pod:580
6416 msgid "case-sensitive-path"
6420 #: ../fish/guestfish-actions.pod:582
6423 " case-sensitive-path path\n"
6428 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:901
6430 "This can be used to resolve case insensitive paths on a filesystem which is "
6431 "case sensitive. The use case is to resolve paths which you have read from "
6432 "Windows configuration files or the Windows Registry, to the true path."
6436 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:906
6438 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6439 "(and probably others), which is that although the underlying filesystem is "
6440 "case-insensitive, the driver exports the filesystem to Linux as "
6445 #: ../fish/guestfish-actions.pod:594 ../src/guestfs-actions.pod:911
6447 "One consequence of this is that special directories such as C<c:\\windows> "
6448 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6449 "precise details of how they were created. In Windows itself this would not "
6454 #: ../fish/guestfish-actions.pod:600 ../src/guestfs-actions.pod:917
6456 "Bug or feature? You decide: "
6457 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
6461 #: ../fish/guestfish-actions.pod:603 ../src/guestfs-actions.pod:920
6463 "This function resolves the true case of each element in the path and returns "
6464 "the case-sensitive path."
6468 #: ../fish/guestfish-actions.pod:606
6470 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
6471 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
6472 "how the directories were originally created under Windows)."
6476 #: ../fish/guestfish-actions.pod:611 ../src/guestfs-actions.pod:928
6477 msgid "I<Note>: This function does not handle drive names, backslashes etc."
6481 #: ../fish/guestfish-actions.pod:614
6482 msgid "See also L</realpath>."
6486 #: ../fish/guestfish-actions.pod:616
6491 #: ../fish/guestfish-actions.pod:618
6499 #: ../fish/guestfish-actions.pod:620 ../fish/guestfish-actions.pod:3917 ../src/guestfs-actions.pod:944 ../src/guestfs-actions.pod:5994
6500 msgid "Return the contents of the file named C<path>."
6504 #: ../fish/guestfish-actions.pod:622
6506 "Note that this function cannot correctly handle binary files (specifically, "
6507 "files containing C<\\0> character which is treated as end of string). For "
6508 "those you need to use the L</read-file> or L</download> functions which have "
6509 "a more complex interface."
6513 #: ../fish/guestfish-actions.pod:627 ../fish/guestfish-actions.pod:762 ../fish/guestfish-actions.pod:774 ../fish/guestfish-actions.pod:985 ../fish/guestfish-actions.pod:995 ../fish/guestfish-actions.pod:1062 ../fish/guestfish-actions.pod:1072 ../fish/guestfish-actions.pod:1264 ../fish/guestfish-actions.pod:1577 ../fish/guestfish-actions.pod:1587 ../fish/guestfish-actions.pod:1637 ../fish/guestfish-actions.pod:1652 ../fish/guestfish-actions.pod:1662 ../fish/guestfish-actions.pod:1681 ../fish/guestfish-actions.pod:3787 ../fish/guestfish-actions.pod:3802 ../fish/guestfish-actions.pod:3878 ../fish/guestfish-actions.pod:3895 ../fish/guestfish-actions.pod:3910 ../fish/guestfish-actions.pod:4591 ../fish/guestfish-actions.pod:4637 ../fish/guestfish-actions.pod:4722 ../fish/guestfish-actions.pod:4737 ../fish/guestfish-actions.pod:5143 ../fish/guestfish-actions.pod:5155 ../fish/guestfish-actions.pod:5173 ../fish/guestfish-actions.pod:5190 ../fish/guestfish-actions.pod:5200 ../fish/guestfish-actions.pod:5257 ../fish/guestfish-actions.pod:5267 ../fish/guestfish-actions.pod:5296 ../fish/guestfish-actions.pod:5306 ../src/guestfs-actions.pod:954 ../src/guestfs-actions.pod:1133 ../src/guestfs-actions.pod:1153 ../src/guestfs-actions.pod:1560 ../src/guestfs-actions.pod:1579 ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1701 ../src/guestfs-actions.pod:1947 ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:2448 ../src/guestfs-actions.pod:2513 ../src/guestfs-actions.pod:2537 ../src/guestfs-actions.pod:2554 ../src/guestfs-actions.pod:2583 ../src/guestfs-actions.pod:5776 ../src/guestfs-actions.pod:5802 ../src/guestfs-actions.pod:5933 ../src/guestfs-actions.pod:5959 ../src/guestfs-actions.pod:5983 ../src/guestfs-actions.pod:6950 ../src/guestfs-actions.pod:7005 ../src/guestfs-actions.pod:7151 ../src/guestfs-actions.pod:7175 ../src/guestfs-actions.pod:7840 ../src/guestfs-actions.pod:7860 ../src/guestfs-actions.pod:7893 ../src/guestfs-actions.pod:7912 ../src/guestfs-actions.pod:7931 ../src/guestfs-actions.pod:8025 ../src/guestfs-actions.pod:8044 ../src/guestfs-actions.pod:8090 ../src/guestfs-actions.pod:8109
6515 "Because of the message protocol, there is a transfer limit of somewhere "
6516 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6520 #: ../fish/guestfish-actions.pod:630
6525 #: ../fish/guestfish-actions.pod:632
6528 " checksum csumtype path\n"
6533 #: ../fish/guestfish-actions.pod:634 ../src/guestfs-actions.pod:966
6534 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6538 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:969
6540 "The type of checksum to compute is given by the C<csumtype> parameter which "
6541 "must have one of the following values:"
6545 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:974
6550 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:976
6552 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6557 #: ../fish/guestfish-actions.pod:647 ../src/guestfs-actions.pod:979
6562 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:981
6563 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6567 #: ../fish/guestfish-actions.pod:651 ../src/guestfs-actions.pod:983
6572 #: ../fish/guestfish-actions.pod:653 ../src/guestfs-actions.pod:985
6573 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6577 #: ../fish/guestfish-actions.pod:655 ../src/guestfs-actions.pod:987
6582 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:989
6583 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6587 #: ../fish/guestfish-actions.pod:659 ../src/guestfs-actions.pod:991
6592 #: ../fish/guestfish-actions.pod:661 ../src/guestfs-actions.pod:993
6593 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6597 #: ../fish/guestfish-actions.pod:663 ../src/guestfs-actions.pod:995
6602 #: ../fish/guestfish-actions.pod:665 ../src/guestfs-actions.pod:997
6603 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6607 #: ../fish/guestfish-actions.pod:667 ../src/guestfs-actions.pod:999
6612 #: ../fish/guestfish-actions.pod:669 ../src/guestfs-actions.pod:1001
6613 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6617 #: ../fish/guestfish-actions.pod:673 ../src/guestfs-actions.pod:1005
6618 msgid "The checksum is returned as a printable string."
6622 #: ../fish/guestfish-actions.pod:675
6623 msgid "To get the checksum for a device, use L</checksum-device>."
6627 #: ../fish/guestfish-actions.pod:677
6628 msgid "To get the checksums for many files, use L</checksums-out>."
6632 #: ../fish/guestfish-actions.pod:679
6633 msgid "checksum-device"
6637 #: ../fish/guestfish-actions.pod:681
6640 " checksum-device csumtype device\n"
6645 #: ../fish/guestfish-actions.pod:683
6647 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6648 "device named C<device>. For the types of checksums supported see the "
6649 "L</checksum> command."
6653 #: ../fish/guestfish-actions.pod:687
6654 msgid "checksums-out"
6658 #: ../fish/guestfish-actions.pod:689
6661 " checksums-out csumtype directory (sumsfile|-)\n"
6666 #: ../fish/guestfish-actions.pod:691 ../src/guestfs-actions.pod:1040
6668 "This command computes the checksums of all regular files in C<directory> and "
6669 "then emits a list of those checksums to the local output file C<sumsfile>."
6673 #: ../fish/guestfish-actions.pod:695 ../src/guestfs-actions.pod:1044
6675 "This can be used for verifying the integrity of a virtual machine. However "
6676 "to be properly secure you should pay attention to the output of the checksum "
6677 "command (it uses the ones from GNU coreutils). In particular when the "
6678 "filename is not printable, coreutils uses a special backslash syntax. For "
6679 "more information, see the GNU coreutils info file."
6683 #: ../fish/guestfish-actions.pod:705
6688 #: ../fish/guestfish-actions.pod:707
6691 " chmod mode path\n"
6696 #: ../fish/guestfish-actions.pod:709 ../src/guestfs-actions.pod:1063
6698 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6703 #: ../fish/guestfish-actions.pod:712 ../src/guestfs-actions.pod:1066
6705 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6706 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6711 #: ../fish/guestfish-actions.pod:716 ../fish/guestfish-actions.pod:3150 ../fish/guestfish-actions.pod:3289 ../fish/guestfish-actions.pod:3299 ../fish/guestfish-actions.pod:3309 ../src/guestfs-actions.pod:1070 ../src/guestfs-actions.pod:4758 ../src/guestfs-actions.pod:4967 ../src/guestfs-actions.pod:4986 ../src/guestfs-actions.pod:5005
6712 msgid "The mode actually set is affected by the umask."
6716 #: ../fish/guestfish-actions.pod:718
6721 #: ../fish/guestfish-actions.pod:720
6724 " chown owner group path\n"
6729 #: ../fish/guestfish-actions.pod:722 ../src/guestfs-actions.pod:1084
6730 msgid "Change the file owner to C<owner> and group to C<group>."
6734 #: ../fish/guestfish-actions.pod:724 ../fish/guestfish-actions.pod:2585 ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:3829
6736 "Only numeric uid and gid are supported. If you want to use names, you will "
6737 "need to locate and parse the password file yourself (Augeas support makes "
6738 "this relatively easy)."
6742 #: ../fish/guestfish-actions.pod:728
6747 #: ../fish/guestfish-actions.pod:730
6750 " command 'arguments ...'\n"
6755 #: ../fish/guestfish-actions.pod:732 ../src/guestfs-actions.pod:1100
6757 "This call runs a command from the guest filesystem. The filesystem must be "
6758 "mounted, and must contain a compatible operating system (ie. something "
6759 "Linux, with the same or compatible processor architecture)."
6763 #: ../fish/guestfish-actions.pod:737
6765 "The single parameter is an argv-style list of arguments. The first element "
6766 "is the name of the program to run. Subsequent elements are parameters. The "
6767 "list must be non-empty (ie. must contain a program name). Note that the "
6768 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
6772 #: ../fish/guestfish-actions.pod:744 ../src/guestfs-actions.pod:1112
6773 msgid "The return value is anything printed to I<stdout> by the command."
6777 #: ../fish/guestfish-actions.pod:747 ../src/guestfs-actions.pod:1115
6779 "If the command returns a non-zero exit status, then this function returns an "
6780 "error message. The error message string is the content of I<stderr> from "
6785 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1119
6787 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
6788 "C</bin>. If you require a program from another location, you should provide "
6789 "the full path in the first parameter."
6793 #: ../fish/guestfish-actions.pod:756 ../src/guestfs-actions.pod:1124
6795 "Shared libraries and data files required by the program must be available on "
6796 "filesystems which are mounted in the correct places. It is the caller's "
6797 "responsibility to ensure all filesystems that are needed are mounted at the "
6802 #: ../fish/guestfish-actions.pod:765
6803 msgid "command-lines"
6807 #: ../fish/guestfish-actions.pod:767
6810 " command-lines 'arguments ...'\n"
6815 #: ../fish/guestfish-actions.pod:769
6816 msgid "This is the same as L</command>, but splits the result into a list of lines."
6820 #: ../fish/guestfish-actions.pod:772
6821 msgid "See also: L</sh-lines>"
6825 #: ../fish/guestfish-actions.pod:777
6826 msgid "compress-device-out"
6830 #: ../fish/guestfish-actions.pod:779
6833 " compress-device-out ctype device (zdevice|-) [level:..]\n"
6838 #: ../fish/guestfish-actions.pod:781 ../src/guestfs-actions.pod:1174
6840 "This command compresses C<device> and writes it out to the local file "
6845 #: ../fish/guestfish-actions.pod:784
6847 "The C<ctype> and optional C<level> parameters have the same meaning as in "
6852 #: ../fish/guestfish-actions.pod:791
6853 msgid "compress-out"
6857 #: ../fish/guestfish-actions.pod:793
6860 " compress-out ctype file (zfile|-) [level:..]\n"
6865 #: ../fish/guestfish-actions.pod:795 ../src/guestfs-actions.pod:1226
6867 "This command compresses C<file> and writes it out to the local file "
6872 #: ../fish/guestfish-actions.pod:798 ../src/guestfs-actions.pod:1229
6874 "The compression program used is controlled by the C<ctype> parameter. "
6875 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
6876 "Some compression types may not be supported by particular builds of "
6877 "libguestfs, in which case you will get an error containing the substring "
6878 "\"not supported\"."
6882 #: ../fish/guestfish-actions.pod:804 ../src/guestfs-actions.pod:1235
6884 "The optional C<level> parameter controls compression level. The meaning and "
6885 "default for this parameter depends on the compression program being used."
6889 #: ../fish/guestfish-actions.pod:812
6894 #: ../fish/guestfish-actions.pod:814
6897 " config qemuparam qemuvalue\n"
6902 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1276
6904 "This can be used to add arbitrary qemu command line parameters of the form "
6905 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
6906 "setting some parameters which would interfere with parameters that we use."
6910 #: ../fish/guestfish-actions.pod:821 ../src/guestfs-actions.pod:1281
6911 msgid "The first character of C<param> string must be a C<-> (dash)."
6915 #: ../fish/guestfish-actions.pod:823 ../src/guestfs-actions.pod:1283
6916 msgid "C<value> can be NULL."
6920 #: ../fish/guestfish-actions.pod:825
6925 #: ../fish/guestfish-actions.pod:827
6928 " copy-size src dest size\n"
6933 #: ../fish/guestfish-actions.pod:829 ../src/guestfs-actions.pod:1297
6935 "This command copies exactly C<size> bytes from one source device or file "
6936 "C<src> to another destination device or file C<dest>."
6940 #: ../fish/guestfish-actions.pod:832 ../src/guestfs-actions.pod:1300
6942 "Note this will fail if the source is too short or if the destination is not "
6947 #: ../fish/guestfish-actions.pod:835
6952 #: ../fish/guestfish-actions.pod:837
6960 #: ../fish/guestfish-actions.pod:839 ../src/guestfs-actions.pod:1319
6962 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6963 "destination filename or destination directory."
6967 #: ../fish/guestfish-actions.pod:842
6972 #: ../fish/guestfish-actions.pod:844
6980 #: ../fish/guestfish-actions.pod:846 ../src/guestfs-actions.pod:1333
6982 "This copies a file or directory from C<src> to C<dest> recursively using the "
6987 #: ../fish/guestfish-actions.pod:849
6992 #: ../fish/guestfish-actions.pod:851
7000 #: ../fish/guestfish-actions.pod:853 ../src/guestfs-actions.pod:1347
7002 "This command copies from one source device or file C<src> to another "
7003 "destination device or file C<dest>. Normally you would use this to copy to "
7004 "or from a device or partition, for example to duplicate a filesystem."
7008 #: ../fish/guestfish-actions.pod:858
7010 "If the destination is a device, it must be as large or larger than the "
7011 "source file or device, otherwise the copy will fail. This command cannot do "
7012 "partial copies (see L</copy-size>)."
7016 #: ../fish/guestfish-actions.pod:862
7021 #: ../fish/guestfish-actions.pod:864
7029 #: ../fish/guestfish-actions.pod:866 ../src/guestfs-actions.pod:1365
7030 msgid "This command runs the C<df> command to report disk space used."
7034 #: ../fish/guestfish-actions.pod:868 ../fish/guestfish-actions.pod:879
7036 "This command is mostly useful for interactive sessions. It is I<not> "
7037 "intended that you try to parse the output string. Use L</statvfs> from "
7042 #: ../fish/guestfish-actions.pod:872
7047 #: ../fish/guestfish-actions.pod:874
7055 #: ../fish/guestfish-actions.pod:876 ../src/guestfs-actions.pod:1381
7057 "This command runs the C<df -h> command to report disk space used in "
7058 "human-readable format."
7062 #: ../fish/guestfish-actions.pod:883
7067 #: ../fish/guestfish-actions.pod:885
7075 #: ../fish/guestfish-actions.pod:887 ../src/guestfs-actions.pod:1398
7077 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7078 "This is sometimes useful for extended debugging of problems."
7082 #: ../fish/guestfish-actions.pod:891
7084 "Another way to get the same information is to enable verbose messages with "
7085 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
7086 "before running the program."
7090 #: ../fish/guestfish-actions.pod:896
7095 #: ../fish/guestfish-actions.pod:898
7098 " download remotefilename (filename|-)\n"
7103 #: ../fish/guestfish-actions.pod:900 ../fish/guestfish-actions.pod:913 ../src/guestfs-actions.pod:1419 ../src/guestfs-actions.pod:1444
7105 "Download file C<remotefilename> and save it as C<filename> on the local "
7110 #: ../fish/guestfish-actions.pod:903 ../fish/guestfish-actions.pod:4895 ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:7410
7111 msgid "C<filename> can also be a named pipe."
7115 #: ../fish/guestfish-actions.pod:905
7116 msgid "See also L</upload>, L</cat>."
7120 #: ../fish/guestfish-actions.pod:909
7121 msgid "download-offset"
7125 #: ../fish/guestfish-actions.pod:911
7128 " download-offset remotefilename (filename|-) offset size\n"
7133 #: ../fish/guestfish-actions.pod:916 ../src/guestfs-actions.pod:1447
7135 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7136 "region must be within the file or device)."
7140 #: ../fish/guestfish-actions.pod:919
7142 "Note that there is no limit on the amount of data that can be downloaded "
7143 "with this call, unlike with L</pread>, and this call always reads the full "
7144 "amount unless an error occurs."
7148 #: ../fish/guestfish-actions.pod:924
7149 msgid "See also L</download>, L</pread>."
7153 #: ../fish/guestfish-actions.pod:928
7158 #: ../fish/guestfish-actions.pod:930
7161 " drop-caches whattodrop\n"
7166 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1472
7168 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7169 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7170 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7174 #: ../fish/guestfish-actions.pod:937 ../src/guestfs-actions.pod:1477
7175 msgid "Setting C<whattodrop> to 3 should drop everything."
7179 #: ../fish/guestfish-actions.pod:939 ../src/guestfs-actions.pod:1479
7181 "This automatically calls L<sync(2)> before the operation, so that the "
7182 "maximum guest memory is freed."
7186 #: ../fish/guestfish-actions.pod:942
7191 #: ../fish/guestfish-actions.pod:944
7199 #: ../fish/guestfish-actions.pod:946 ../src/guestfs-actions.pod:1492
7201 "This command runs the C<du -s> command to estimate file space usage for "
7206 #: ../fish/guestfish-actions.pod:949 ../src/guestfs-actions.pod:1495
7208 "C<path> can be a file or a directory. If C<path> is a directory then the "
7209 "estimate includes the contents of the directory and all subdirectories "
7214 #: ../fish/guestfish-actions.pod:953 ../src/guestfs-actions.pod:1499
7215 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7219 #: ../fish/guestfish-actions.pod:956
7224 #: ../fish/guestfish-actions.pod:958
7227 " e2fsck-f device\n"
7232 #: ../fish/guestfish-actions.pod:960 ../src/guestfs-actions.pod:1517
7234 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7235 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
7240 #: ../fish/guestfish-actions.pod:964
7242 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
7243 "should use L</fsck>."
7247 #: ../fish/guestfish-actions.pod:967
7252 #: ../fish/guestfish-actions.pod:969
7255 " echo-daemon 'words ...'\n"
7260 #: ../fish/guestfish-actions.pod:971 ../src/guestfs-actions.pod:1534
7262 "This command concatenates the list of C<words> passed with single spaces "
7263 "between them and returns the resulting string."
7267 #: ../fish/guestfish-actions.pod:974 ../src/guestfs-actions.pod:1537
7268 msgid "You can use this command to test the connection through to the daemon."
7272 #: ../fish/guestfish-actions.pod:976
7273 msgid "See also L</ping-daemon>."
7277 #: ../fish/guestfish-actions.pod:978
7282 #: ../fish/guestfish-actions.pod:980
7285 " egrep regex path\n"
7290 #: ../fish/guestfish-actions.pod:982 ../src/guestfs-actions.pod:1553
7291 msgid "This calls the external C<egrep> program and returns the matching lines."
7295 #: ../fish/guestfish-actions.pod:988
7300 #: ../fish/guestfish-actions.pod:990
7303 " egrepi regex path\n"
7308 #: ../fish/guestfish-actions.pod:992 ../src/guestfs-actions.pod:1572
7309 msgid "This calls the external C<egrep -i> program and returns the matching lines."
7313 #: ../fish/guestfish-actions.pod:998
7318 #: ../fish/guestfish-actions.pod:1000
7321 " equal file1 file2\n"
7326 #: ../fish/guestfish-actions.pod:1002 ../src/guestfs-actions.pod:1591
7328 "This compares the two files C<file1> and C<file2> and returns true if their "
7329 "content is exactly equal, or false otherwise."
7333 #: ../fish/guestfish-actions.pod:1005 ../src/guestfs-actions.pod:1594
7334 msgid "The external L<cmp(1)> program is used for the comparison."
7338 #: ../fish/guestfish-actions.pod:1007
7343 #: ../fish/guestfish-actions.pod:1009
7351 #: ../fish/guestfish-actions.pod:1011 ../src/guestfs-actions.pod:1606
7353 "This returns C<true> if and only if there is a file, directory (or anything) "
7354 "with the given C<path> name."
7358 #: ../fish/guestfish-actions.pod:1014
7359 msgid "See also L</is-file>, L</is-dir>, L</stat>."
7363 #: ../fish/guestfish-actions.pod:1016
7368 #: ../fish/guestfish-actions.pod:1018
7371 " fallocate path len\n"
7376 #: ../fish/guestfish-actions.pod:1020 ../fish/guestfish-actions.pod:1039 ../src/guestfs-actions.pod:1629 ../src/guestfs-actions.pod:1648
7378 "This command preallocates a file (containing zero bytes) named C<path> of "
7379 "size C<len> bytes. If the file exists already, it is overwritten."
7383 #: ../fish/guestfish-actions.pod:1024 ../src/guestfs-actions.pod:1633
7385 "Do not confuse this with the guestfish-specific C<alloc> command which "
7386 "allocates a file in the host and attaches it as a device."
7390 #: ../fish/guestfish-actions.pod:1028
7392 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
7397 #: ../fish/guestfish-actions.pod:1035
7402 #: ../fish/guestfish-actions.pod:1037
7405 " fallocate64 path len\n"
7410 #: ../fish/guestfish-actions.pod:1043
7412 "Note that this call allocates disk blocks for the file. To create a sparse "
7413 "file use L</truncate-size> instead."
7417 #: ../fish/guestfish-actions.pod:1046
7419 "The deprecated call L</fallocate> does the same, but owing to an oversight "
7420 "it only allowed 30 bit lengths to be specified, effectively limiting the "
7421 "maximum size of files created through that call to 1GB."
7425 #: ../fish/guestfish-actions.pod:1051 ../src/guestfs-actions.pod:1660
7427 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
7428 "commands which create a file in the host and attach it as a device."
7432 #: ../fish/guestfish-actions.pod:1055
7437 #: ../fish/guestfish-actions.pod:1057
7440 " fgrep pattern path\n"
7445 #: ../fish/guestfish-actions.pod:1059 ../src/guestfs-actions.pod:1675
7446 msgid "This calls the external C<fgrep> program and returns the matching lines."
7450 #: ../fish/guestfish-actions.pod:1065
7455 #: ../fish/guestfish-actions.pod:1067
7458 " fgrepi pattern path\n"
7463 #: ../fish/guestfish-actions.pod:1069 ../src/guestfs-actions.pod:1694
7464 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
7468 #: ../fish/guestfish-actions.pod:1075
7473 #: ../fish/guestfish-actions.pod:1077
7481 #: ../fish/guestfish-actions.pod:1079 ../src/guestfs-actions.pod:1712
7483 "This call uses the standard L<file(1)> command to determine the type or "
7484 "contents of the file."
7488 #: ../fish/guestfish-actions.pod:1082 ../src/guestfs-actions.pod:1715
7490 "This call will also transparently look inside various types of compressed "
7495 #: ../fish/guestfish-actions.pod:1085 ../src/guestfs-actions.pod:1718
7497 "The exact command which runs is C<file -zb path>. Note in particular that "
7498 "the filename is not prepended to the output (the I<-b> option)."
7502 #: ../fish/guestfish-actions.pod:1089 ../src/guestfs-actions.pod:1722
7504 "The output depends on the output of the underlying L<file(1)> command and it "
7505 "can change in future in ways beyond our control. In other words, the output "
7506 "is not guaranteed by the ABI."
7510 #: ../fish/guestfish-actions.pod:1093
7512 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
7513 "(etc), L</is-zero>."
7517 #: ../fish/guestfish-actions.pod:1096
7518 msgid "file-architecture"
7522 #: ../fish/guestfish-actions.pod:1098
7525 " file-architecture filename\n"
7530 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1740
7532 "This detects the architecture of the binary C<filename>, and returns it if "
7537 #: ../fish/guestfish-actions.pod:1103 ../src/guestfs-actions.pod:1743
7538 msgid "Currently defined architectures are:"
7542 #: ../fish/guestfish-actions.pod:1107 ../src/guestfs-actions.pod:1747
7547 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1749
7549 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7550 "irrespective of the precise processor requirements of the binary."
7554 #: ../fish/guestfish-actions.pod:1112 ../src/guestfs-actions.pod:1752
7559 #: ../fish/guestfish-actions.pod:1114 ../src/guestfs-actions.pod:1754
7560 msgid "64 bit x86-64."
7564 #: ../fish/guestfish-actions.pod:1116 ../src/guestfs-actions.pod:1756
7569 #: ../fish/guestfish-actions.pod:1118 ../src/guestfs-actions.pod:1758
7570 msgid "32 bit SPARC."
7574 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1760
7579 #: ../fish/guestfish-actions.pod:1122 ../src/guestfs-actions.pod:1762
7580 msgid "64 bit SPARC V9 and above."
7584 #: ../fish/guestfish-actions.pod:1124 ../src/guestfs-actions.pod:1764
7589 #: ../fish/guestfish-actions.pod:1126 ../src/guestfs-actions.pod:1766
7590 msgid "Intel Itanium."
7594 #: ../fish/guestfish-actions.pod:1128 ../src/guestfs-actions.pod:1768
7599 #: ../fish/guestfish-actions.pod:1130 ../src/guestfs-actions.pod:1770
7600 msgid "32 bit Power PC."
7604 #: ../fish/guestfish-actions.pod:1132 ../src/guestfs-actions.pod:1772
7609 #: ../fish/guestfish-actions.pod:1134 ../src/guestfs-actions.pod:1774
7610 msgid "64 bit Power PC."
7614 #: ../fish/guestfish-actions.pod:1138 ../src/guestfs-actions.pod:1778
7615 msgid "Libguestfs may return other architecture strings in future."
7619 #: ../fish/guestfish-actions.pod:1140 ../src/guestfs-actions.pod:1780
7620 msgid "The function works on at least the following types of files:"
7624 #: ../fish/guestfish-actions.pod:1146 ../src/guestfs-actions.pod:1786
7625 msgid "many types of Un*x and Linux binary"
7629 #: ../fish/guestfish-actions.pod:1150 ../src/guestfs-actions.pod:1790
7630 msgid "many types of Un*x and Linux shared library"
7634 #: ../fish/guestfish-actions.pod:1154 ../src/guestfs-actions.pod:1794
7635 msgid "Windows Win32 and Win64 binaries"
7639 #: ../fish/guestfish-actions.pod:1158 ../src/guestfs-actions.pod:1798
7640 msgid "Windows Win32 and Win64 DLLs"
7644 #: ../fish/guestfish-actions.pod:1160 ../src/guestfs-actions.pod:1800
7645 msgid "Win32 binaries and DLLs return C<i386>."
7649 #: ../fish/guestfish-actions.pod:1162 ../src/guestfs-actions.pod:1802
7650 msgid "Win64 binaries and DLLs return C<x86_64>."
7654 #: ../fish/guestfish-actions.pod:1166 ../src/guestfs-actions.pod:1806
7655 msgid "Linux kernel modules"
7659 #: ../fish/guestfish-actions.pod:1170 ../src/guestfs-actions.pod:1810
7660 msgid "Linux new-style initrd images"
7664 #: ../fish/guestfish-actions.pod:1174 ../src/guestfs-actions.pod:1814
7665 msgid "some non-x86 Linux vmlinuz kernels"
7669 #: ../fish/guestfish-actions.pod:1178 ../src/guestfs-actions.pod:1818
7670 msgid "What it can't do currently:"
7674 #: ../fish/guestfish-actions.pod:1184 ../src/guestfs-actions.pod:1824
7675 msgid "static libraries (libfoo.a)"
7679 #: ../fish/guestfish-actions.pod:1188 ../src/guestfs-actions.pod:1828
7680 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7684 #: ../fish/guestfish-actions.pod:1192 ../src/guestfs-actions.pod:1832
7685 msgid "x86 Linux vmlinuz kernels"
7689 #: ../fish/guestfish-actions.pod:1194 ../src/guestfs-actions.pod:1834
7691 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7692 "compressed code, and are horribly hard to unpack. If you want to find the "
7693 "architecture of a kernel, use the architecture of the associated initrd or "
7694 "kernel module(s) instead."
7698 #: ../fish/guestfish-actions.pod:1201
7703 #: ../fish/guestfish-actions.pod:1203
7711 #: ../fish/guestfish-actions.pod:1205 ../src/guestfs-actions.pod:1852
7712 msgid "This command returns the size of C<file> in bytes."
7716 #: ../fish/guestfish-actions.pod:1207
7718 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
7719 "L</is-file> etc. To get the size of block devices, use "
7720 "L</blockdev-getsize64>."
7724 #: ../fish/guestfish-actions.pod:1211
7729 #: ../fish/guestfish-actions.pod:1213
7732 " fill c len path\n"
7737 #: ../fish/guestfish-actions.pod:1215 ../src/guestfs-actions.pod:1870
7739 "This command creates a new file called C<path>. The initial content of the "
7740 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
7745 #: ../fish/guestfish-actions.pod:1219
7747 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7748 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
7753 #: ../fish/guestfish-actions.pod:1224
7754 msgid "fill-pattern"
7758 #: ../fish/guestfish-actions.pod:1226
7761 " fill-pattern pattern len path\n"
7766 #: ../fish/guestfish-actions.pod:1228
7768 "This function is like L</fill> except that it creates a new file of length "
7769 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
7770 "is truncated if necessary to ensure the length of the file is exactly C<len> "
7775 #: ../fish/guestfish-actions.pod:1233
7780 #: ../fish/guestfish-actions.pod:1235
7788 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1916
7790 "This command lists out all files and directories, recursively, starting at "
7791 "C<directory>. It is essentially equivalent to running the shell command "
7792 "C<find directory -print> but some post-processing happens on the output, "
7797 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:1921
7799 "This returns a list of strings I<without any prefix>. Thus if the directory "
7804 #: ../fish/guestfish-actions.pod:1245 ../src/guestfs-actions.pod:1924
7814 #: ../fish/guestfish-actions.pod:1249
7815 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
7819 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:1931
7830 #: ../fish/guestfish-actions.pod:1257 ../src/guestfs-actions.pod:1936
7831 msgid "If C<directory> is not a directory, then this command returns an error."
7835 #: ../fish/guestfish-actions.pod:1260 ../src/guestfs-actions.pod:1939
7836 msgid "The returned list is sorted."
7840 #: ../fish/guestfish-actions.pod:1262
7841 msgid "See also L</find0>."
7845 #: ../fish/guestfish-actions.pod:1267
7850 #: ../fish/guestfish-actions.pod:1269
7853 " find0 directory (files|-)\n"
7858 #: ../fish/guestfish-actions.pod:1271 ../src/guestfs-actions.pod:1959
7860 "This command lists out all files and directories, recursively, starting at "
7861 "C<directory>, placing the resulting list in the external file called "
7866 #: ../fish/guestfish-actions.pod:1275
7867 msgid "This command works the same way as L</find> with the following exceptions:"
7871 #: ../fish/guestfish-actions.pod:1282 ../src/guestfs-actions.pod:1970
7872 msgid "The resulting list is written to an external file."
7876 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1974
7878 "Items (filenames) in the result are separated by C<\\0> characters. See "
7879 "L<find(1)> option I<-print0>."
7883 #: ../fish/guestfish-actions.pod:1291 ../src/guestfs-actions.pod:1979
7884 msgid "This command is not limited in the number of names that it can return."
7888 #: ../fish/guestfish-actions.pod:1296 ../src/guestfs-actions.pod:1984
7889 msgid "The result list is not sorted."
7893 #: ../fish/guestfish-actions.pod:1302
7894 msgid "findfs-label"
7898 #: ../fish/guestfish-actions.pod:1304
7901 " findfs-label label\n"
7906 #: ../fish/guestfish-actions.pod:1306 ../src/guestfs-actions.pod:1998
7908 "This command searches the filesystems and returns the one which has the "
7909 "given label. An error is returned if no such filesystem can be found."
7913 #: ../fish/guestfish-actions.pod:1310
7914 msgid "To find the label of a filesystem, use L</vfs-label>."
7918 #: ../fish/guestfish-actions.pod:1312
7923 #: ../fish/guestfish-actions.pod:1314
7926 " findfs-uuid uuid\n"
7931 #: ../fish/guestfish-actions.pod:1316 ../src/guestfs-actions.pod:2015
7933 "This command searches the filesystems and returns the one which has the "
7934 "given UUID. An error is returned if no such filesystem can be found."
7938 #: ../fish/guestfish-actions.pod:1320
7939 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
7943 #: ../fish/guestfish-actions.pod:1322
7948 #: ../fish/guestfish-actions.pod:1324
7951 " fsck fstype device\n"
7956 #: ../fish/guestfish-actions.pod:1326 ../src/guestfs-actions.pod:2033
7958 "This runs the filesystem checker (fsck) on C<device> which should have "
7959 "filesystem type C<fstype>."
7963 #: ../fish/guestfish-actions.pod:1329 ../src/guestfs-actions.pod:2036
7965 "The returned integer is the status. See L<fsck(8)> for the list of status "
7966 "codes from C<fsck>."
7970 #: ../fish/guestfish-actions.pod:1338 ../src/guestfs-actions.pod:2045
7971 msgid "Multiple status codes can be summed together."
7975 #: ../fish/guestfish-actions.pod:1342 ../src/guestfs-actions.pod:2049
7977 "A non-zero return code can mean \"success\", for example if errors have been "
7978 "corrected on the filesystem."
7982 #: ../fish/guestfish-actions.pod:1347 ../src/guestfs-actions.pod:2054
7983 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7987 #: ../fish/guestfish-actions.pod:1352 ../src/guestfs-actions.pod:2059
7988 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7992 #: ../fish/guestfish-actions.pod:1354
7997 #: ../fish/guestfish-actions.pod:1356
8005 #: ../fish/guestfish-actions.pod:1358 ../src/guestfs-actions.pod:2070
8007 "Return the additional kernel options which are added to the guest kernel "
8012 #: ../fish/guestfish-actions.pod:1361 ../src/guestfs-actions.pod:2073
8013 msgid "If C<NULL> then no options are added."
8017 #: ../fish/guestfish-actions.pod:1363
8018 msgid "get-attach-method"
8022 #: ../fish/guestfish-actions.pod:1365
8025 " get-attach-method\n"
8030 #: ../fish/guestfish-actions.pod:1367
8031 msgid "Return the current attach method. See L</set-attach-method>."
8035 #: ../fish/guestfish-actions.pod:1369
8036 msgid "get-autosync"
8040 #: ../fish/guestfish-actions.pod:1371
8048 #: ../fish/guestfish-actions.pod:1373 ../src/guestfs-actions.pod:2098
8049 msgid "Get the autosync flag."
8053 #: ../fish/guestfish-actions.pod:1375
8058 #: ../fish/guestfish-actions.pod:1377
8066 #: ../fish/guestfish-actions.pod:1379 ../src/guestfs-actions.pod:2109
8067 msgid "Return the direct appliance mode flag."
8071 #: ../fish/guestfish-actions.pod:1381
8076 #: ../fish/guestfish-actions.pod:1383
8079 " get-e2label device\n"
8084 #: ../fish/guestfish-actions.pod:1385 ../src/guestfs-actions.pod:2128
8085 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8089 #: ../fish/guestfish-actions.pod:1388
8091 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
8096 #: ../fish/guestfish-actions.pod:1395
8101 #: ../fish/guestfish-actions.pod:1397
8104 " get-e2uuid device\n"
8109 #: ../fish/guestfish-actions.pod:1399 ../src/guestfs-actions.pod:2149
8110 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8114 #: ../fish/guestfish-actions.pod:1402
8116 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
8121 #: ../fish/guestfish-actions.pod:1409
8126 #: ../fish/guestfish-actions.pod:1411
8134 #: ../fish/guestfish-actions.pod:1413 ../src/guestfs-actions.pod:2162
8135 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
8139 #: ../fish/guestfish-actions.pod:1416
8141 "If L</set-memsize> was not called on this handle, and if "
8142 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8143 "value for memsize."
8147 #: ../fish/guestfish-actions.pod:1420 ../fish/guestfish-actions.pod:1477 ../fish/guestfish-actions.pod:4243 ../fish/guestfish-actions.pod:4345 ../src/guestfs-actions.pod:2169 ../src/guestfs-actions.pod:2261 ../src/guestfs-actions.pod:6455 ../src/guestfs-actions.pod:6581
8148 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8152 #: ../fish/guestfish-actions.pod:1423
8157 #: ../fish/guestfish-actions.pod:1425
8165 #: ../fish/guestfish-actions.pod:1427 ../src/guestfs-actions.pod:2181
8166 msgid "This returns the enable network flag."
8170 #: ../fish/guestfish-actions.pod:1429
8175 #: ../fish/guestfish-actions.pod:1431
8183 #: ../fish/guestfish-actions.pod:1433 ../src/guestfs-actions.pod:2192
8184 msgid "Return the current search path."
8188 #: ../fish/guestfish-actions.pod:1435 ../src/guestfs-actions.pod:2194
8190 "This is always non-NULL. If it wasn't set already, then this will return "
8195 #: ../fish/guestfish-actions.pod:1438
8200 #: ../fish/guestfish-actions.pod:1440
8208 #: ../fish/guestfish-actions.pod:1442 ../src/guestfs-actions.pod:2207
8209 msgid "This returns the process group flag."
8213 #: ../fish/guestfish-actions.pod:1444
8218 #: ../fish/guestfish-actions.pod:1446
8223 #: ../fish/guestfish-actions.pod:1448
8231 #: ../fish/guestfish-actions.pod:1450 ../src/guestfs-actions.pod:2218
8233 "Return the process ID of the qemu subprocess. If there is no qemu "
8234 "subprocess, then this will return an error."
8238 #: ../fish/guestfish-actions.pod:1453 ../src/guestfs-actions.pod:2221
8239 msgid "This is an internal call used for debugging and testing."
8243 #: ../fish/guestfish-actions.pod:1455
8248 #: ../fish/guestfish-actions.pod:1457
8256 #: ../fish/guestfish-actions.pod:1459 ../src/guestfs-actions.pod:2232
8257 msgid "Return the current qemu binary."
8261 #: ../fish/guestfish-actions.pod:1461 ../src/guestfs-actions.pod:2234
8263 "This is always non-NULL. If it wasn't set already, then this will return "
8264 "the default qemu binary name."
8268 #: ../fish/guestfish-actions.pod:1464
8269 msgid "get-recovery-proc"
8273 #: ../fish/guestfish-actions.pod:1466
8276 " get-recovery-proc\n"
8281 #: ../fish/guestfish-actions.pod:1468 ../src/guestfs-actions.pod:2247
8282 msgid "Return the recovery process enabled flag."
8286 #: ../fish/guestfish-actions.pod:1470
8291 #: ../fish/guestfish-actions.pod:1472
8299 #: ../fish/guestfish-actions.pod:1474
8301 "This returns the current setting of the selinux flag which is passed to the "
8302 "appliance at boot time. See L</set-selinux>."
8306 #: ../fish/guestfish-actions.pod:1480
8311 #: ../fish/guestfish-actions.pod:1482
8319 #: ../fish/guestfish-actions.pod:1484 ../src/guestfs-actions.pod:2273
8320 msgid "This returns the number of virtual CPUs assigned to the appliance."
8324 #: ../fish/guestfish-actions.pod:1486
8329 #: ../fish/guestfish-actions.pod:1488
8337 #: ../fish/guestfish-actions.pod:1490 ../src/guestfs-actions.pod:2284
8339 "This returns the current state as an opaque integer. This is only useful "
8340 "for printing debug and internal error messages."
8344 #: ../fish/guestfish-actions.pod:1493 ../fish/guestfish-actions.pod:2452 ../fish/guestfish-actions.pod:2470 ../fish/guestfish-actions.pod:2508 ../fish/guestfish-actions.pod:2524 ../src/guestfs-actions.pod:2287 ../src/guestfs-actions.pod:3606 ../src/guestfs-actions.pod:3635 ../src/guestfs-actions.pod:3696 ../src/guestfs-actions.pod:3723
8345 msgid "For more information on states, see L<guestfs(3)>."
8349 #: ../fish/guestfish-actions.pod:1495
8354 #: ../fish/guestfish-actions.pod:1497
8362 #: ../fish/guestfish-actions.pod:1499 ../src/guestfs-actions.pod:2298
8363 msgid "Return the command trace flag."
8367 #: ../fish/guestfish-actions.pod:1501
8372 #: ../fish/guestfish-actions.pod:1503
8380 #: ../fish/guestfish-actions.pod:1505
8382 "Return the current umask. By default the umask is C<022> unless it has been "
8383 "set by calling L</umask>."
8387 #: ../fish/guestfish-actions.pod:1508
8392 #: ../fish/guestfish-actions.pod:1510
8400 #: ../fish/guestfish-actions.pod:1512 ../src/guestfs-actions.pod:2321
8401 msgid "This returns the verbose messages flag."
8405 #: ../fish/guestfish-actions.pod:1514
8410 #: ../fish/guestfish-actions.pod:1516
8418 #: ../fish/guestfish-actions.pod:1518 ../src/guestfs-actions.pod:2332
8419 msgid "This gets the SELinux security context of the daemon."
8423 #: ../fish/guestfish-actions.pod:1520
8424 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
8428 #: ../fish/guestfish-actions.pod:1523
8433 #: ../fish/guestfish-actions.pod:1525
8436 " getxattr path name\n"
8441 #: ../fish/guestfish-actions.pod:1527
8443 "Get a single extended attribute from file C<path> named C<name>. This call "
8444 "follows symlinks. If you want to lookup an extended attribute for the "
8445 "symlink itself, use L</lgetxattr>."
8449 #: ../fish/guestfish-actions.pod:1531 ../fish/guestfish-actions.pod:2597
8451 "Normally it is better to get all extended attributes from a file in one go "
8452 "by calling L</getxattrs>. However some Linux filesystem implementations are "
8453 "buggy and do not provide a way to list out attributes. For these "
8454 "filesystems (notably ntfs-3g) you have to know the names of the extended "
8455 "attributes you want in advance and call this function."
8459 #: ../fish/guestfish-actions.pod:1538 ../fish/guestfish-actions.pod:2604 ../src/guestfs-actions.pod:2361 ../src/guestfs-actions.pod:3856
8461 "Extended attribute values are blobs of binary data. If there is no extended "
8462 "attribute named C<name>, this returns an error."
8466 #: ../fish/guestfish-actions.pod:1541
8467 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
8471 #: ../fish/guestfish-actions.pod:1543
8476 #: ../fish/guestfish-actions.pod:1545
8484 #: ../fish/guestfish-actions.pod:1547 ../src/guestfs-actions.pod:2378
8485 msgid "This call lists the extended attributes of the file or directory C<path>."
8489 #: ../fish/guestfish-actions.pod:1550 ../src/guestfs-actions.pod:2381
8491 "At the system call level, this is a combination of the L<listxattr(2)> and "
8492 "L<getxattr(2)> calls."
8496 #: ../fish/guestfish-actions.pod:1553
8497 msgid "See also: L</lgetxattrs>, L<attr(5)>."
8501 #: ../fish/guestfish-actions.pod:1555
8506 #: ../fish/guestfish-actions.pod:1557
8509 " glob-expand pattern\n"
8514 #: ../fish/guestfish-actions.pod:1559 ../src/guestfs-actions.pod:2398
8516 "This command searches for all the pathnames matching C<pattern> according to "
8517 "the wildcard expansion rules used by the shell."
8521 #: ../fish/guestfish-actions.pod:1563 ../src/guestfs-actions.pod:2402
8522 msgid "If no paths match, then this returns an empty list (note: not an error)."
8526 #: ../fish/guestfish-actions.pod:1566 ../src/guestfs-actions.pod:2405
8528 "It is just a wrapper around the C L<glob(3)> function with flags "
8529 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
8533 #: ../fish/guestfish-actions.pod:1570
8538 #: ../fish/guestfish-actions.pod:1572
8541 " grep regex path\n"
8546 #: ../fish/guestfish-actions.pod:1574 ../src/guestfs-actions.pod:2422
8547 msgid "This calls the external C<grep> program and returns the matching lines."
8551 #: ../fish/guestfish-actions.pod:1580
8556 #: ../fish/guestfish-actions.pod:1582
8559 " grepi regex path\n"
8564 #: ../fish/guestfish-actions.pod:1584 ../src/guestfs-actions.pod:2441
8565 msgid "This calls the external C<grep -i> program and returns the matching lines."
8569 #: ../fish/guestfish-actions.pod:1590
8570 msgid "grub-install"
8574 #: ../fish/guestfish-actions.pod:1592
8577 " grub-install root device\n"
8582 #: ../fish/guestfish-actions.pod:1594 ../src/guestfs-actions.pod:2460
8584 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
8585 "with the root directory being C<root>."
8589 #: ../fish/guestfish-actions.pod:1603 ../src/guestfs-actions.pod:2469
8591 "There is currently no way in the API to install grub2, which is used by most "
8592 "modern Linux guests. It is possible to run the grub2 command from the "
8593 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
8597 #: ../fish/guestfish-actions.pod:1610 ../src/guestfs-actions.pod:2476
8599 "This uses C<grub-install> from the host. Unfortunately grub is not always "
8600 "compatible with itself, so this only works in rather narrow circumstances. "
8601 "Careful testing with each guest version is advisable."
8605 #: ../fish/guestfish-actions.pod:1617 ../src/guestfs-actions.pod:2483
8607 "If grub-install reports the error \"No suitable drive was found in the "
8608 "generated device map.\" it may be that you need to create a "
8609 "C</boot/grub/device.map> file first that contains the mapping between grub "
8610 "device names and Linux device names. It is usually sufficient to create a "
8615 #: ../fish/guestfish-actions.pod:1624 ../src/guestfs-actions.pod:2490
8623 #: ../fish/guestfish-actions.pod:1626 ../src/guestfs-actions.pod:2492
8624 msgid "replacing C</dev/vda> with the name of the installation device."
8628 #: ../fish/guestfish-actions.pod:1630
8633 #: ../fish/guestfish-actions.pod:1632
8641 #: ../fish/guestfish-actions.pod:1634 ../src/guestfs-actions.pod:2506
8643 "This command returns up to the first 10 lines of a file as a list of "
8648 #: ../fish/guestfish-actions.pod:1640
8653 #: ../fish/guestfish-actions.pod:1642
8656 " head-n nrlines path\n"
8661 #: ../fish/guestfish-actions.pod:1644 ../src/guestfs-actions.pod:2525
8663 "If the parameter C<nrlines> is a positive number, this returns the first "
8664 "C<nrlines> lines of the file C<path>."
8668 #: ../fish/guestfish-actions.pod:1647 ../src/guestfs-actions.pod:2528
8670 "If the parameter C<nrlines> is a negative number, this returns lines from "
8671 "the file C<path>, excluding the last C<nrlines> lines."
8675 #: ../fish/guestfish-actions.pod:1650 ../fish/guestfish-actions.pod:4735 ../src/guestfs-actions.pod:2531 ../src/guestfs-actions.pod:7169
8676 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8680 #: ../fish/guestfish-actions.pod:1655
8685 #: ../fish/guestfish-actions.pod:1657
8693 #: ../fish/guestfish-actions.pod:1659 ../src/guestfs-actions.pod:2548
8695 "This runs C<hexdump -C> on the given C<path>. The result is the "
8696 "human-readable, canonical hex dump of the file."
8700 #: ../fish/guestfish-actions.pod:1665
8705 #: ../fish/guestfish-actions.pod:1667
8708 " initrd-cat initrdpath filename\n"
8713 #: ../fish/guestfish-actions.pod:1669 ../src/guestfs-actions.pod:2567
8715 "This command unpacks the file C<filename> from the initrd file called "
8716 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8721 #: ../fish/guestfish-actions.pod:1673 ../src/guestfs-actions.pod:2571
8723 "For example, in guestfish you could use the following command to examine the "
8724 "boot script (usually called C</init>) contained in a Linux initrd or "
8729 #: ../fish/guestfish-actions.pod:1677 ../src/guestfs-actions.pod:2575
8732 " initrd-cat /boot/initrd-<version>.img init\n"
8737 #: ../fish/guestfish-actions.pod:1679
8738 msgid "See also L</initrd-list>."
8742 #: ../fish/guestfish-actions.pod:1684
8747 #: ../fish/guestfish-actions.pod:1686
8750 " initrd-list path\n"
8755 #: ../fish/guestfish-actions.pod:1688 ../src/guestfs-actions.pod:2594
8756 msgid "This command lists out files contained in an initrd."
8760 #: ../fish/guestfish-actions.pod:1690 ../src/guestfs-actions.pod:2596
8762 "The files are listed without any initial C</> character. The files are "
8763 "listed in the order they appear (not necessarily alphabetical). Directory "
8764 "names are listed as separate items."
8768 #: ../fish/guestfish-actions.pod:1694 ../src/guestfs-actions.pod:2600
8770 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8771 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8776 #: ../fish/guestfish-actions.pod:1698
8777 msgid "inotify-add-watch"
8781 #: ../fish/guestfish-actions.pod:1700
8784 " inotify-add-watch path mask\n"
8789 #: ../fish/guestfish-actions.pod:1702 ../src/guestfs-actions.pod:2617
8790 msgid "Watch C<path> for the events listed in C<mask>."
8794 #: ../fish/guestfish-actions.pod:1704 ../src/guestfs-actions.pod:2619
8796 "Note that if C<path> is a directory then events within that directory are "
8797 "watched, but this does I<not> happen recursively (in subdirectories)."
8801 #: ../fish/guestfish-actions.pod:1708 ../src/guestfs-actions.pod:2623
8803 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8804 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8808 #: ../fish/guestfish-actions.pod:1712
8809 msgid "inotify-close"
8813 #: ../fish/guestfish-actions.pod:1714
8821 #: ../fish/guestfish-actions.pod:1716 ../src/guestfs-actions.pod:2636
8823 "This closes the inotify handle which was previously opened by inotify_init. "
8824 "It removes all watches, throws away any pending events, and deallocates all "
8829 #: ../fish/guestfish-actions.pod:1720
8830 msgid "inotify-files"
8834 #: ../fish/guestfish-actions.pod:1722
8842 #: ../fish/guestfish-actions.pod:1724
8844 "This function is a helpful wrapper around L</inotify-read> which just "
8845 "returns a list of pathnames of objects that were touched. The returned "
8846 "pathnames are sorted and deduplicated."
8850 #: ../fish/guestfish-actions.pod:1728
8851 msgid "inotify-init"
8855 #: ../fish/guestfish-actions.pod:1730
8858 " inotify-init maxevents\n"
8863 #: ../fish/guestfish-actions.pod:1732 ../src/guestfs-actions.pod:2665
8865 "This command creates a new inotify handle. The inotify subsystem can be "
8866 "used to notify events which happen to objects in the guest filesystem."
8870 #: ../fish/guestfish-actions.pod:1736
8872 "C<maxevents> is the maximum number of events which will be queued up between "
8873 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
8874 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
8875 "default was 16384 events. Beyond this limit, the kernel throws away events, "
8876 "but records the fact that it threw them away by setting a flag "
8877 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
8881 #: ../fish/guestfish-actions.pod:1746
8883 "Before any events are generated, you have to add some watches to the "
8884 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
8885 "L</inotify-watch-all>."
8889 #: ../fish/guestfish-actions.pod:1752
8891 "Queued up events should be read periodically by calling L</inotify-read> (or "
8892 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
8893 "If you don't read the events out often enough then you risk the internal "
8894 "queue overflowing."
8898 #: ../fish/guestfish-actions.pod:1759
8900 "The handle should be closed after use by calling L</inotify-close>. This "
8901 "also removes any watches automatically."
8905 #: ../fish/guestfish-actions.pod:1763 ../src/guestfs-actions.pod:2696
8907 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8908 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8909 "that there is one global inotify handle per libguestfs instance."
8913 #: ../fish/guestfish-actions.pod:1768
8914 msgid "inotify-read"
8918 #: ../fish/guestfish-actions.pod:1770
8926 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2710
8928 "Return the complete queue of events that have happened since the previous "
8933 #: ../fish/guestfish-actions.pod:1775 ../src/guestfs-actions.pod:2713
8934 msgid "If no events have happened, this returns an empty list."
8938 #: ../fish/guestfish-actions.pod:1777 ../src/guestfs-actions.pod:2715
8940 "I<Note>: In order to make sure that all events have been read, you must call "
8941 "this function repeatedly until it returns an empty list. The reason is that "
8942 "the call will read events up to the maximum appliance-to-host message size "
8943 "and leave remaining events in the queue."
8947 #: ../fish/guestfish-actions.pod:1783
8948 msgid "inotify-rm-watch"
8952 #: ../fish/guestfish-actions.pod:1785
8955 " inotify-rm-watch wd\n"
8960 #: ../fish/guestfish-actions.pod:1787
8961 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
8965 #: ../fish/guestfish-actions.pod:1790
8966 msgid "inspect-get-arch"
8970 #: ../fish/guestfish-actions.pod:1792
8973 " inspect-get-arch root\n"
8978 #: ../fish/guestfish-actions.pod:1794
8980 "This returns the architecture of the inspected operating system. The "
8981 "possible return values are listed under L</file-architecture>."
8985 #: ../fish/guestfish-actions.pod:1798 ../src/guestfs-actions.pod:2750
8987 "If the architecture could not be determined, then the string C<unknown> is "
8992 #: ../fish/guestfish-actions.pod:1801 ../fish/guestfish-actions.pod:1896 ../fish/guestfish-actions.pod:1975 ../fish/guestfish-actions.pod:1987 ../fish/guestfish-actions.pod:2071 ../fish/guestfish-actions.pod:2133 ../fish/guestfish-actions.pod:2154 ../fish/guestfish-actions.pod:2168 ../fish/guestfish-actions.pod:2208 ../fish/guestfish-actions.pod:2244 ../fish/guestfish-actions.pod:2257 ../fish/guestfish-actions.pod:2270 ../fish/guestfish-actions.pod:2280 ../fish/guestfish-actions.pod:2290 ../fish/guestfish-actions.pod:2302 ../fish/guestfish-actions.pod:2398 ../fish/guestfish-actions.pod:2432 ../src/guestfs-actions.pod:2753 ../src/guestfs-actions.pod:2855 ../src/guestfs-actions.pod:2959 ../src/guestfs-actions.pod:2978 ../src/guestfs-actions.pod:3109 ../src/guestfs-actions.pod:3193 ../src/guestfs-actions.pod:3221 ../src/guestfs-actions.pod:3242 ../src/guestfs-actions.pod:3295 ../src/guestfs-actions.pod:3339 ../src/guestfs-actions.pod:3359 ../src/guestfs-actions.pod:3379 ../src/guestfs-actions.pod:3396 ../src/guestfs-actions.pod:3412 ../src/guestfs-actions.pod:3430 ../src/guestfs-actions.pod:3532 ../src/guestfs-actions.pod:3573
8993 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8997 #: ../fish/guestfish-actions.pod:1803
8998 msgid "inspect-get-distro"
9002 #: ../fish/guestfish-actions.pod:1805
9005 " inspect-get-distro root\n"
9010 #: ../fish/guestfish-actions.pod:1807 ../src/guestfs-actions.pod:2766
9011 msgid "This returns the distro (distribution) of the inspected operating system."
9015 #: ../fish/guestfish-actions.pod:1810 ../src/guestfs-actions.pod:2769
9016 msgid "Currently defined distros are:"
9020 #: ../fish/guestfish-actions.pod:1814 ../src/guestfs-actions.pod:2773
9021 msgid "\"archlinux\""
9025 #: ../fish/guestfish-actions.pod:1816 ../src/guestfs-actions.pod:2775
9030 #: ../fish/guestfish-actions.pod:1818 ../src/guestfs-actions.pod:2777
9035 #: ../fish/guestfish-actions.pod:1820 ../src/guestfs-actions.pod:2779
9040 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2781
9045 #: ../fish/guestfish-actions.pod:1824 ../src/guestfs-actions.pod:2783
9050 #: ../fish/guestfish-actions.pod:1826 ../src/guestfs-actions.pod:2785
9055 #: ../fish/guestfish-actions.pod:1828 ../src/guestfs-actions.pod:2787
9060 #: ../fish/guestfish-actions.pod:1830 ../src/guestfs-actions.pod:2789
9065 #: ../fish/guestfish-actions.pod:1832 ../src/guestfs-actions.pod:2791
9070 #: ../fish/guestfish-actions.pod:1834 ../src/guestfs-actions.pod:2793
9071 msgid "\"linuxmint\""
9075 #: ../fish/guestfish-actions.pod:1836 ../src/guestfs-actions.pod:2795
9080 #: ../fish/guestfish-actions.pod:1838 ../src/guestfs-actions.pod:2797
9085 #: ../fish/guestfish-actions.pod:1840 ../src/guestfs-actions.pod:2799
9090 #: ../fish/guestfish-actions.pod:1842 ../src/guestfs-actions.pod:2801
9091 msgid "\"mandriva\""
9095 #: ../fish/guestfish-actions.pod:1844 ../src/guestfs-actions.pod:2803
9100 #: ../fish/guestfish-actions.pod:1846 ../src/guestfs-actions.pod:2805
9105 #: ../fish/guestfish-actions.pod:1848 ../src/guestfs-actions.pod:2807
9110 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2809
9111 msgid "\"opensuse\""
9115 #: ../fish/guestfish-actions.pod:1852 ../src/guestfs-actions.pod:2811
9120 #: ../fish/guestfish-actions.pod:1854 ../src/guestfs-actions.pod:2813
9125 #: ../fish/guestfish-actions.pod:1856 ../src/guestfs-actions.pod:2815
9130 #: ../fish/guestfish-actions.pod:1858 ../src/guestfs-actions.pod:2817
9131 msgid "\"redhat-based\""
9135 #: ../fish/guestfish-actions.pod:1860 ../src/guestfs-actions.pod:2819
9136 msgid "Some Red Hat-derived distro."
9140 #: ../fish/guestfish-actions.pod:1862 ../src/guestfs-actions.pod:2821
9145 #: ../fish/guestfish-actions.pod:1864 ../src/guestfs-actions.pod:2823
9146 msgid "Red Hat Enterprise Linux."
9150 #: ../fish/guestfish-actions.pod:1866 ../src/guestfs-actions.pod:2825
9151 msgid "\"scientificlinux\""
9155 #: ../fish/guestfish-actions.pod:1868 ../src/guestfs-actions.pod:2827
9156 msgid "Scientific Linux."
9160 #: ../fish/guestfish-actions.pod:1870 ../src/guestfs-actions.pod:2829
9161 msgid "\"slackware\""
9165 #: ../fish/guestfish-actions.pod:1872 ../src/guestfs-actions.pod:2831
9170 #: ../fish/guestfish-actions.pod:1874 ../src/guestfs-actions.pod:2833
9171 msgid "\"ttylinux\""
9175 #: ../fish/guestfish-actions.pod:1876 ../src/guestfs-actions.pod:2835
9180 #: ../fish/guestfish-actions.pod:1878 ../src/guestfs-actions.pod:2837
9185 #: ../fish/guestfish-actions.pod:1880 ../src/guestfs-actions.pod:2839
9190 #: ../fish/guestfish-actions.pod:1882 ../fish/guestfish-actions.pod:1966 ../fish/guestfish-actions.pod:2235 ../src/guestfs-actions.pod:2841 ../src/guestfs-actions.pod:2950 ../src/guestfs-actions.pod:3330
9195 #: ../fish/guestfish-actions.pod:1884 ../src/guestfs-actions.pod:2843
9196 msgid "The distro could not be determined."
9200 #: ../fish/guestfish-actions.pod:1886 ../fish/guestfish-actions.pod:2223 ../src/guestfs-actions.pod:2845 ../src/guestfs-actions.pod:3318
9205 #: ../fish/guestfish-actions.pod:1888 ../src/guestfs-actions.pod:2847
9207 "Windows does not have distributions. This string is returned if the OS type "
9212 #: ../fish/guestfish-actions.pod:1893 ../fish/guestfish-actions.pod:1972 ../fish/guestfish-actions.pod:2241 ../src/guestfs-actions.pod:2852 ../src/guestfs-actions.pod:2956 ../src/guestfs-actions.pod:3336
9214 "Future versions of libguestfs may return other strings here. The caller "
9215 "should be prepared to handle any string."
9219 #: ../fish/guestfish-actions.pod:1898
9220 msgid "inspect-get-drive-mappings"
9224 #: ../fish/guestfish-actions.pod:1900
9227 " inspect-get-drive-mappings root\n"
9232 #: ../fish/guestfish-actions.pod:1902 ../src/guestfs-actions.pod:2868
9234 "This call is useful for Windows which uses a primitive system of assigning "
9235 "drive letters (like \"C:\") to partitions. This inspection API examines the "
9236 "Windows Registry to find out how disks/partitions are mapped to drive "
9237 "letters, and returns a hash table as in the example below:"
9241 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:2874
9251 #: ../fish/guestfish-actions.pod:1912 ../src/guestfs-actions.pod:2878
9253 "Note that keys are drive letters. For Windows, the key is case insensitive "
9254 "and just contains the drive letter, without the customary colon separator "
9259 #: ../fish/guestfish-actions.pod:1916 ../src/guestfs-actions.pod:2882
9261 "In future we may support other operating systems that also used drive "
9262 "letters, but the keys for those might not be case insensitive and might be "
9263 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
9268 #: ../fish/guestfish-actions.pod:1921 ../src/guestfs-actions.pod:2887
9270 "For Windows guests, currently only hard drive mappings are returned. "
9271 "Removable disks (eg. DVD-ROMs) are ignored."
9275 #: ../fish/guestfish-actions.pod:1924 ../src/guestfs-actions.pod:2890
9277 "For guests that do not use drive mappings, or if the drive mappings could "
9278 "not be determined, this returns an empty hash table."
9282 #: ../fish/guestfish-actions.pod:1927
9284 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9285 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
9289 #: ../fish/guestfish-actions.pod:1931
9290 msgid "inspect-get-filesystems"
9294 #: ../fish/guestfish-actions.pod:1933
9297 " inspect-get-filesystems root\n"
9302 #: ../fish/guestfish-actions.pod:1935 ../src/guestfs-actions.pod:2911
9304 "This returns a list of all the filesystems that we think are associated with "
9305 "this operating system. This includes the root filesystem, other ordinary "
9306 "filesystems, and non-mounted devices like swap partitions."
9310 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:2916
9312 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9313 "to be shared between operating systems."
9317 #: ../fish/guestfish-actions.pod:1943
9319 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9320 "L</inspect-get-mountpoints>."
9324 #: ../fish/guestfish-actions.pod:1946
9325 msgid "inspect-get-format"
9329 #: ../fish/guestfish-actions.pod:1948
9332 " inspect-get-format root\n"
9337 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:2934
9339 "This returns the format of the inspected operating system. You can use it "
9340 "to detect install images, live CDs and similar."
9344 #: ../fish/guestfish-actions.pod:1953 ../src/guestfs-actions.pod:2937
9345 msgid "Currently defined formats are:"
9349 #: ../fish/guestfish-actions.pod:1957 ../src/guestfs-actions.pod:2941
9350 msgid "\"installed\""
9354 #: ../fish/guestfish-actions.pod:1959 ../src/guestfs-actions.pod:2943
9355 msgid "This is an installed operating system."
9359 #: ../fish/guestfish-actions.pod:1961 ../src/guestfs-actions.pod:2945
9360 msgid "\"installer\""
9364 #: ../fish/guestfish-actions.pod:1963 ../src/guestfs-actions.pod:2947
9366 "The disk image being inspected is not an installed operating system, but a "
9367 "I<bootable> install disk, live CD, or similar."
9371 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2952
9372 msgid "The format of this disk image is not known."
9376 #: ../fish/guestfish-actions.pod:1977
9377 msgid "inspect-get-hostname"
9381 #: ../fish/guestfish-actions.pod:1979
9384 " inspect-get-hostname root\n"
9389 #: ../fish/guestfish-actions.pod:1981 ../src/guestfs-actions.pod:2972
9391 "This function returns the hostname of the operating system as found by "
9392 "inspection of the guest's configuration files."
9396 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:2975
9398 "If the hostname could not be determined, then the string C<unknown> is "
9403 #: ../fish/guestfish-actions.pod:1989
9404 msgid "inspect-get-icon"
9408 #: ../fish/guestfish-actions.pod:1991
9411 " inspect-get-icon root [favicon:..] [highquality:..]\n"
9416 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:3001
9418 "This function returns an icon corresponding to the inspected operating "
9419 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
9420 "to PNG if necessary)."
9424 #: ../fish/guestfish-actions.pod:1997 ../src/guestfs-actions.pod:3005
9426 "If it was not possible to get an icon this function returns a zero-length "
9427 "(non-NULL) buffer. I<Callers must check for this case>."
9431 #: ../fish/guestfish-actions.pod:2000 ../src/guestfs-actions.pod:3008
9433 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
9434 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
9435 "this file will be returned. You can disable favicons by passing the "
9436 "optional C<favicon> boolean as false (default is true)."
9440 #: ../fish/guestfish-actions.pod:2006 ../src/guestfs-actions.pod:3014
9442 "If finding the favicon fails, then we look in other places in the guest for "
9447 #: ../fish/guestfish-actions.pod:2009 ../src/guestfs-actions.pod:3017
9449 "If the optional C<highquality> boolean is true then only high quality icons "
9450 "are returned, which means only icons of high resolution with an alpha "
9451 "channel. The default (false) is to return any icon we can, even if it is of "
9452 "substandard quality."
9456 #: ../fish/guestfish-actions.pod:2020 ../src/guestfs-actions.pod:3028
9458 "Unlike most other inspection API calls, the guest's disks must be mounted up "
9459 "before you call this, since it needs to read information from the guest "
9460 "filesystem during the call."
9464 #: ../fish/guestfish-actions.pod:2026 ../src/guestfs-actions.pod:3034
9466 "B<Security:> The icon data comes from the untrusted guest, and should be "
9467 "treated with caution. PNG files have been known to contain exploits. "
9468 "Ensure that libpng (or other relevant libraries) are fully up to date before "
9469 "trying to process or display the icon."
9473 #: ../fish/guestfish-actions.pod:2034 ../src/guestfs-actions.pod:3042
9475 "The PNG image returned can be any size. It might not be square. Libguestfs "
9476 "tries to return the largest, highest quality icon available. The "
9477 "application must scale the icon to the required size."
9481 #: ../fish/guestfish-actions.pod:2041 ../src/guestfs-actions.pod:3049
9483 "Extracting icons from Windows guests requires the external C<wrestool> "
9484 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
9485 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
9486 "installed separately."
9490 #: ../fish/guestfish-actions.pod:2048 ../src/guestfs-actions.pod:3056
9492 "Operating system icons are usually trademarks. Seek legal advice before "
9493 "using trademarks in applications."
9497 #: ../fish/guestfish-actions.pod:2055
9498 msgid "inspect-get-major-version"
9502 #: ../fish/guestfish-actions.pod:2057
9505 " inspect-get-major-version root\n"
9510 #: ../fish/guestfish-actions.pod:2059 ../src/guestfs-actions.pod:3097
9511 msgid "This returns the major version number of the inspected operating system."
9515 #: ../fish/guestfish-actions.pod:2062 ../src/guestfs-actions.pod:3100
9517 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9518 "popular public names used by the operating system. Notably the operating "
9519 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9520 "1). You can find out the real versions corresponding to releases of Windows "
9521 "by consulting Wikipedia or MSDN."
9525 #: ../fish/guestfish-actions.pod:2069 ../fish/guestfish-actions.pod:2080 ../src/guestfs-actions.pod:3107 ../src/guestfs-actions.pod:3124
9526 msgid "If the version could not be determined, then C<0> is returned."
9530 #: ../fish/guestfish-actions.pod:2073
9531 msgid "inspect-get-minor-version"
9535 #: ../fish/guestfish-actions.pod:2075
9538 " inspect-get-minor-version root\n"
9543 #: ../fish/guestfish-actions.pod:2077 ../src/guestfs-actions.pod:3121
9544 msgid "This returns the minor version number of the inspected operating system."
9548 #: ../fish/guestfish-actions.pod:2082
9550 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9551 "L</inspect-get-major-version>."
9555 #: ../fish/guestfish-actions.pod:2085
9556 msgid "inspect-get-mountpoints"
9560 #: ../fish/guestfish-actions.pod:2087
9563 " inspect-get-mountpoints root\n"
9568 #: ../fish/guestfish-actions.pod:2089 ../src/guestfs-actions.pod:3139
9570 "This returns a hash of where we think the filesystems associated with this "
9571 "operating system should be mounted. Callers should note that this is at "
9572 "best an educated guess made by reading configuration files such as "
9573 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
9574 "are non-existent or not mountable and callers should be prepared to handle "
9575 "or ignore failures if they try to mount them."
9579 #: ../fish/guestfish-actions.pod:2098 ../src/guestfs-actions.pod:3148
9581 "Each element in the returned hashtable has a key which is the path of the "
9582 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9583 "mounted there (eg. C</dev/sda1>)."
9587 #: ../fish/guestfish-actions.pod:2103 ../src/guestfs-actions.pod:3153
9588 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
9592 #: ../fish/guestfish-actions.pod:2106
9594 "For operating systems like Windows which still use drive letters, this call "
9595 "will only return an entry for the first drive \"mounted on\" C</>. For "
9596 "information about the mapping of drive letters to partitions, see "
9597 "L</inspect-get-drive-mappings>."
9601 #: ../fish/guestfish-actions.pod:2112
9603 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9604 "L</inspect-get-filesystems>."
9608 #: ../fish/guestfish-actions.pod:2115
9609 msgid "inspect-get-package-format"
9613 #: ../fish/guestfish-actions.pod:2117
9616 " inspect-get-package-format root\n"
9621 #: ../fish/guestfish-actions.pod:2119
9623 "This function and L</inspect-get-package-management> return the package "
9624 "format and package management tool used by the inspected operating system. "
9625 "For example for Fedora these functions would return C<rpm> (package format) "
9626 "and C<yum> (package management)."
9630 #: ../fish/guestfish-actions.pod:2125 ../src/guestfs-actions.pod:3185
9632 "This returns the string C<unknown> if we could not determine the package "
9633 "format I<or> if the operating system does not have a real packaging system "
9638 #: ../fish/guestfish-actions.pod:2129 ../src/guestfs-actions.pod:3189
9640 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
9641 "C<pkgsrc>. Future versions of libguestfs may return other strings."
9645 #: ../fish/guestfish-actions.pod:2135
9646 msgid "inspect-get-package-management"
9650 #: ../fish/guestfish-actions.pod:2137
9653 " inspect-get-package-management root\n"
9658 #: ../fish/guestfish-actions.pod:2139
9660 "L</inspect-get-package-format> and this function return the package format "
9661 "and package management tool used by the inspected operating system. For "
9662 "example for Fedora these functions would return C<rpm> (package format) and "
9663 "C<yum> (package management)."
9667 #: ../fish/guestfish-actions.pod:2145 ../src/guestfs-actions.pod:3212
9669 "This returns the string C<unknown> if we could not determine the package "
9670 "management tool I<or> if the operating system does not have a real packaging "
9671 "system (eg. Windows)."
9675 #: ../fish/guestfish-actions.pod:2149 ../src/guestfs-actions.pod:3216
9677 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9678 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
9679 "versions of libguestfs may return other strings."
9683 #: ../fish/guestfish-actions.pod:2156
9684 msgid "inspect-get-product-name"
9688 #: ../fish/guestfish-actions.pod:2158
9691 " inspect-get-product-name root\n"
9696 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3234
9698 "This returns the product name of the inspected operating system. The "
9699 "product name is generally some freeform string which can be displayed to the "
9700 "user, but should not be parsed by programs."
9704 #: ../fish/guestfish-actions.pod:2165 ../src/guestfs-actions.pod:3239
9706 "If the product name could not be determined, then the string C<unknown> is "
9711 #: ../fish/guestfish-actions.pod:2170
9712 msgid "inspect-get-product-variant"
9716 #: ../fish/guestfish-actions.pod:2172
9719 " inspect-get-product-variant root\n"
9724 #: ../fish/guestfish-actions.pod:2174 ../src/guestfs-actions.pod:3255
9725 msgid "This returns the product variant of the inspected operating system."
9729 #: ../fish/guestfish-actions.pod:2177 ../src/guestfs-actions.pod:3258
9731 "For Windows guests, this returns the contents of the Registry key "
9732 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
9733 "which is usually a string such as C<Client> or C<Server> (other values are "
9734 "possible). This can be used to distinguish consumer and enterprise versions "
9735 "of Windows that have the same version number (for example, Windows 7 and "
9736 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
9737 "the latter is C<Server>)."
9741 #: ../fish/guestfish-actions.pod:2186 ../src/guestfs-actions.pod:3267
9743 "For enterprise Linux guests, in future we intend this to return the product "
9744 "variant such as C<Desktop>, C<Server> and so on. But this is not "
9745 "implemented at present."
9749 #: ../fish/guestfish-actions.pod:2190 ../src/guestfs-actions.pod:3271
9751 "If the product variant could not be determined, then the string C<unknown> "
9756 #: ../fish/guestfish-actions.pod:2193
9758 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9759 "L</inspect-get-product-name>, L</inspect-get-major-version>."
9763 #: ../fish/guestfish-actions.pod:2197
9764 msgid "inspect-get-roots"
9768 #: ../fish/guestfish-actions.pod:2199
9771 " inspect-get-roots\n"
9776 #: ../fish/guestfish-actions.pod:2201
9778 "This function is a convenient way to get the list of root devices, as "
9779 "returned from a previous call to L</inspect-os>, but without redoing the "
9780 "whole inspection process."
9784 #: ../fish/guestfish-actions.pod:2205
9786 "This returns an empty list if either no root devices were found or the "
9787 "caller has not called L</inspect-os>."
9791 #: ../fish/guestfish-actions.pod:2210
9792 msgid "inspect-get-type"
9796 #: ../fish/guestfish-actions.pod:2212
9799 " inspect-get-type root\n"
9804 #: ../fish/guestfish-actions.pod:2214 ../src/guestfs-actions.pod:3309
9806 "This returns the type of the inspected operating system. Currently defined "
9811 #: ../fish/guestfish-actions.pod:2219 ../src/guestfs-actions.pod:3314
9816 #: ../fish/guestfish-actions.pod:2221 ../src/guestfs-actions.pod:3316
9817 msgid "Any Linux-based operating system."
9821 #: ../fish/guestfish-actions.pod:2225 ../src/guestfs-actions.pod:3320
9822 msgid "Any Microsoft Windows operating system."
9826 #: ../fish/guestfish-actions.pod:2227 ../src/guestfs-actions.pod:3322
9831 #: ../fish/guestfish-actions.pod:2229 ../src/guestfs-actions.pod:3324
9836 #: ../fish/guestfish-actions.pod:2231 ../src/guestfs-actions.pod:3326
9841 #: ../fish/guestfish-actions.pod:2233 ../src/guestfs-actions.pod:3328
9846 #: ../fish/guestfish-actions.pod:2237 ../src/guestfs-actions.pod:3332
9847 msgid "The operating system type could not be determined."
9851 #: ../fish/guestfish-actions.pod:2246
9852 msgid "inspect-get-windows-current-control-set"
9856 #: ../fish/guestfish-actions.pod:2248
9859 " inspect-get-windows-current-control-set root\n"
9864 #: ../fish/guestfish-actions.pod:2250 ../src/guestfs-actions.pod:3352
9866 "This returns the Windows CurrentControlSet of the inspected guest. The "
9867 "CurrentControlSet is a registry key name such as C<ControlSet001>."
9871 #: ../fish/guestfish-actions.pod:2253 ../src/guestfs-actions.pod:3355
9873 "This call assumes that the guest is Windows and that the Registry could be "
9874 "examined by inspection. If this is not the case then an error is returned."
9878 #: ../fish/guestfish-actions.pod:2259
9879 msgid "inspect-get-windows-systemroot"
9883 #: ../fish/guestfish-actions.pod:2261
9886 " inspect-get-windows-systemroot root\n"
9891 #: ../fish/guestfish-actions.pod:2263 ../src/guestfs-actions.pod:3372
9893 "This returns the Windows systemroot of the inspected guest. The systemroot "
9894 "is a directory path such as C</WINDOWS>."
9898 #: ../fish/guestfish-actions.pod:2266 ../src/guestfs-actions.pod:3375
9900 "This call assumes that the guest is Windows and that the systemroot could be "
9901 "determined by inspection. If this is not the case then an error is "
9906 #: ../fish/guestfish-actions.pod:2272
9907 msgid "inspect-is-live"
9911 #: ../fish/guestfish-actions.pod:2274
9914 " inspect-is-live root\n"
9919 #: ../fish/guestfish-actions.pod:2276
9921 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9922 "then this returns true if a live image was detected on the disk."
9926 #: ../fish/guestfish-actions.pod:2282
9927 msgid "inspect-is-multipart"
9931 #: ../fish/guestfish-actions.pod:2284
9934 " inspect-is-multipart root\n"
9939 #: ../fish/guestfish-actions.pod:2286
9941 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9942 "then this returns true if the disk is part of a set."
9946 #: ../fish/guestfish-actions.pod:2292
9947 msgid "inspect-is-netinst"
9951 #: ../fish/guestfish-actions.pod:2294
9954 " inspect-is-netinst root\n"
9959 #: ../fish/guestfish-actions.pod:2296
9961 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9962 "then this returns true if the disk is a network installer, ie. not a "
9963 "self-contained install CD but one which is likely to require network access "
9964 "to complete the install."
9968 #: ../fish/guestfish-actions.pod:2304
9969 msgid "inspect-list-applications"
9973 #: ../fish/guestfish-actions.pod:2306
9976 " inspect-list-applications root\n"
9981 #: ../fish/guestfish-actions.pod:2308 ../src/guestfs-actions.pod:3442
9982 msgid "Return the list of applications installed in the operating system."
9986 #: ../fish/guestfish-actions.pod:2310
9988 "I<Note:> This call works differently from other parts of the inspection "
9989 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
9990 "then mount up the disks, before calling this. Listing applications is a "
9991 "significantly more difficult operation which requires access to the full "
9992 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
9993 "are just returning data cached in the libguestfs handle, this call actually "
9994 "reads parts of the mounted filesystems during the call."
9998 #: ../fish/guestfish-actions.pod:2320 ../src/guestfs-actions.pod:3454
10000 "This returns an empty list if the inspection code was not able to determine "
10001 "the list of applications."
10005 #: ../fish/guestfish-actions.pod:2323 ../src/guestfs-actions.pod:3457
10006 msgid "The application structure contains the following fields:"
10010 #: ../fish/guestfish-actions.pod:2327 ../src/guestfs-actions.pod:3461
10011 msgid "C<app_name>"
10015 #: ../fish/guestfish-actions.pod:2329 ../src/guestfs-actions.pod:3463
10017 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10018 "guests, this is the package name."
10022 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3466
10023 msgid "C<app_display_name>"
10027 #: ../fish/guestfish-actions.pod:2334 ../src/guestfs-actions.pod:3468
10029 "The display name of the application, sometimes localized to the install "
10030 "language of the guest operating system."
10034 #: ../fish/guestfish-actions.pod:2337 ../src/guestfs-actions.pod:3471
10036 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10037 "to display something can use C<app_name> instead."
10041 #: ../fish/guestfish-actions.pod:2340 ../src/guestfs-actions.pod:3474
10042 msgid "C<app_epoch>"
10046 #: ../fish/guestfish-actions.pod:2342 ../src/guestfs-actions.pod:3476
10048 "For package managers which use epochs, this contains the epoch of the "
10049 "package (an integer). If unavailable, this is returned as C<0>."
10053 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3479
10054 msgid "C<app_version>"
10058 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3481
10060 "The version string of the application or package. If unavailable this is "
10061 "returned as an empty string C<\"\">."
10065 #: ../fish/guestfish-actions.pod:2350 ../src/guestfs-actions.pod:3484
10066 msgid "C<app_release>"
10070 #: ../fish/guestfish-actions.pod:2352 ../src/guestfs-actions.pod:3486
10072 "The release string of the application or package, for package managers that "
10073 "use this. If unavailable this is returned as an empty string C<\"\">."
10077 #: ../fish/guestfish-actions.pod:2356 ../src/guestfs-actions.pod:3490
10078 msgid "C<app_install_path>"
10082 #: ../fish/guestfish-actions.pod:2358 ../src/guestfs-actions.pod:3492
10084 "The installation path of the application (on operating systems such as "
10085 "Windows which use installation paths). This path is in the format used by "
10086 "the guest operating system, it is not a libguestfs path."
10090 #: ../fish/guestfish-actions.pod:2363 ../src/guestfs-actions.pod:3497
10091 msgid "If unavailable this is returned as an empty string C<\"\">."
10095 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3499
10096 msgid "C<app_trans_path>"
10100 #: ../fish/guestfish-actions.pod:2367 ../src/guestfs-actions.pod:3501
10102 "The install path translated into a libguestfs path. If unavailable this is "
10103 "returned as an empty string C<\"\">."
10107 #: ../fish/guestfish-actions.pod:2370 ../src/guestfs-actions.pod:3504
10108 msgid "C<app_publisher>"
10112 #: ../fish/guestfish-actions.pod:2372 ../src/guestfs-actions.pod:3506
10114 "The name of the publisher of the application, for package managers that use "
10115 "this. If unavailable this is returned as an empty string C<\"\">."
10119 #: ../fish/guestfish-actions.pod:2376 ../src/guestfs-actions.pod:3510
10124 #: ../fish/guestfish-actions.pod:2378 ../src/guestfs-actions.pod:3512
10126 "The URL (eg. upstream URL) of the application. If unavailable this is "
10127 "returned as an empty string C<\"\">."
10131 #: ../fish/guestfish-actions.pod:2381 ../src/guestfs-actions.pod:3515
10132 msgid "C<app_source_package>"
10136 #: ../fish/guestfish-actions.pod:2383 ../src/guestfs-actions.pod:3517
10138 "For packaging systems which support this, the name of the source package. "
10139 "If unavailable this is returned as an empty string C<\"\">."
10143 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3520
10144 msgid "C<app_summary>"
10148 #: ../fish/guestfish-actions.pod:2388 ../src/guestfs-actions.pod:3522
10150 "A short (usually one line) description of the application or package. If "
10151 "unavailable this is returned as an empty string C<\"\">."
10155 #: ../fish/guestfish-actions.pod:2391 ../src/guestfs-actions.pod:3525
10156 msgid "C<app_description>"
10160 #: ../fish/guestfish-actions.pod:2393 ../src/guestfs-actions.pod:3527
10162 "A longer description of the application or package. If unavailable this is "
10163 "returned as an empty string C<\"\">."
10167 #: ../fish/guestfish-actions.pod:2400
10172 #: ../fish/guestfish-actions.pod:2402
10180 #: ../fish/guestfish-actions.pod:2404 ../src/guestfs-actions.pod:3545
10182 "This function uses other libguestfs functions and certain heuristics to "
10183 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10184 "for operating systems."
10188 #: ../fish/guestfish-actions.pod:2408 ../src/guestfs-actions.pod:3549
10189 msgid "The list returned is empty if no operating systems were found."
10193 #: ../fish/guestfish-actions.pod:2410 ../src/guestfs-actions.pod:3551
10195 "If one operating system was found, then this returns a list with a single "
10196 "element, which is the name of the root filesystem of this operating system. "
10197 "It is also possible for this function to return a list containing more than "
10198 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10199 "element being the root filesystem of one of the operating systems."
10203 #: ../fish/guestfish-actions.pod:2417
10205 "You can pass the root string(s) returned to other L</inspect-get-*> "
10206 "functions in order to query further information about each operating system, "
10207 "such as the name and version."
10211 #: ../fish/guestfish-actions.pod:2422
10213 "This function uses other libguestfs features such as L</mount-ro> and "
10214 "L</umount-all> in order to mount and unmount filesystems and look at the "
10215 "contents. This should be called with no disks currently mounted. The "
10216 "function may also use Augeas, so any existing Augeas handle will be closed."
10220 #: ../fish/guestfish-actions.pod:2428 ../src/guestfs-actions.pod:3569
10222 "This function cannot decrypt encrypted disks. The caller must do that first "
10223 "(supplying the necessary keys) if the disk is encrypted."
10227 #: ../fish/guestfish-actions.pod:2434 ../fish/guestfish-actions.pod:2632 ../fish/guestfish-actions.pod:2691
10228 msgid "See also L</list-filesystems>."
10232 #: ../fish/guestfish-actions.pod:2436
10233 msgid "is-blockdev"
10237 #: ../fish/guestfish-actions.pod:2438
10240 " is-blockdev path\n"
10245 #: ../fish/guestfish-actions.pod:2440 ../src/guestfs-actions.pod:3589
10247 "This returns C<true> if and only if there is a block device with the given "
10252 #: ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2461 ../fish/guestfish-actions.pod:2480 ../fish/guestfish-actions.pod:2489 ../fish/guestfish-actions.pod:2499 ../fish/guestfish-actions.pod:2533 ../fish/guestfish-actions.pod:2542
10253 msgid "See also L</stat>."
10257 #: ../fish/guestfish-actions.pod:2445
10262 #: ../fish/guestfish-actions.pod:2447
10270 #: ../fish/guestfish-actions.pod:2449 ../src/guestfs-actions.pod:3603
10272 "This returns true iff this handle is busy processing a command (in the "
10277 #: ../fish/guestfish-actions.pod:2454
10282 #: ../fish/guestfish-actions.pod:2456
10285 " is-chardev path\n"
10290 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3618
10292 "This returns C<true> if and only if there is a character device with the "
10293 "given C<path> name."
10297 #: ../fish/guestfish-actions.pod:2463
10302 #: ../fish/guestfish-actions.pod:2465
10310 #: ../fish/guestfish-actions.pod:2467 ../src/guestfs-actions.pod:3632
10312 "This returns true iff this handle is being configured (in the C<CONFIG> "
10317 #: ../fish/guestfish-actions.pod:2472
10322 #: ../fish/guestfish-actions.pod:2474
10330 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3647
10332 "This returns C<true> if and only if there is a directory with the given "
10333 "C<path> name. Note that it returns false for other objects like files."
10337 #: ../fish/guestfish-actions.pod:2482
10342 #: ../fish/guestfish-actions.pod:2484
10350 #: ../fish/guestfish-actions.pod:2486 ../src/guestfs-actions.pod:3663
10352 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
10353 "given C<path> name."
10357 #: ../fish/guestfish-actions.pod:2491
10362 #: ../fish/guestfish-actions.pod:2493
10370 #: ../fish/guestfish-actions.pod:2495 ../src/guestfs-actions.pod:3678
10372 "This returns C<true> if and only if there is a regular file with the given "
10373 "C<path> name. Note that it returns false for other objects like "
10378 #: ../fish/guestfish-actions.pod:2501
10379 msgid "is-launching"
10383 #: ../fish/guestfish-actions.pod:2503
10391 #: ../fish/guestfish-actions.pod:2505 ../src/guestfs-actions.pod:3693
10393 "This returns true iff this handle is launching the subprocess (in the "
10394 "C<LAUNCHING> state)."
10398 #: ../fish/guestfish-actions.pod:2510
10403 #: ../fish/guestfish-actions.pod:2512
10411 #: ../fish/guestfish-actions.pod:2514 ../src/guestfs-actions.pod:3708
10413 "This command tests whether C<device> is a logical volume, and returns true "
10414 "iff this is the case."
10418 #: ../fish/guestfish-actions.pod:2517
10423 #: ../fish/guestfish-actions.pod:2519
10431 #: ../fish/guestfish-actions.pod:2521 ../src/guestfs-actions.pod:3720
10433 "This returns true iff this handle is ready to accept commands (in the "
10438 #: ../fish/guestfish-actions.pod:2526
10443 #: ../fish/guestfish-actions.pod:2528
10446 " is-socket path\n"
10451 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3735
10453 "This returns C<true> if and only if there is a Unix domain socket with the "
10454 "given C<path> name."
10458 #: ../fish/guestfish-actions.pod:2535
10463 #: ../fish/guestfish-actions.pod:2537
10466 " is-symlink path\n"
10471 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3750
10473 "This returns C<true> if and only if there is a symbolic link with the given "
10478 #: ../fish/guestfish-actions.pod:2544
10483 #: ../fish/guestfish-actions.pod:2546
10491 #: ../fish/guestfish-actions.pod:2548 ../src/guestfs-actions.pod:3765
10493 "This returns true iff the file exists and the file is empty or it contains "
10498 #: ../fish/guestfish-actions.pod:2551
10499 msgid "is-zero-device"
10503 #: ../fish/guestfish-actions.pod:2553
10506 " is-zero-device device\n"
10511 #: ../fish/guestfish-actions.pod:2555 ../src/guestfs-actions.pod:3778
10512 msgid "This returns true iff the device exists and contains all zero bytes."
10516 #: ../fish/guestfish-actions.pod:2557 ../src/guestfs-actions.pod:3780
10517 msgid "Note that for large devices this can take a long time to run."
10521 #: ../fish/guestfish-actions.pod:2559
10522 msgid "kill-subprocess"
10526 #: ../fish/guestfish-actions.pod:2561
10529 " kill-subprocess\n"
10534 #: ../fish/guestfish-actions.pod:2563 ../src/guestfs-actions.pod:3791
10535 msgid "This kills the qemu subprocess. You should never need to call this."
10539 #: ../fish/guestfish-actions.pod:2565
10544 #: ../fish/guestfish-actions.pod:2567
10549 #: ../fish/guestfish-actions.pod:2569
10557 #: ../fish/guestfish-actions.pod:2571 ../src/guestfs-actions.pod:3802
10559 "Internally libguestfs is implemented by running a virtual machine using "
10564 #: ../fish/guestfish-actions.pod:2574 ../src/guestfs-actions.pod:3805
10566 "You should call this after configuring the handle (eg. adding drives) but "
10567 "before performing any actions."
10571 #: ../fish/guestfish-actions.pod:2577
10576 #: ../fish/guestfish-actions.pod:2579
10579 " lchown owner group path\n"
10584 #: ../fish/guestfish-actions.pod:2581
10586 "Change the file owner to C<owner> and group to C<group>. This is like "
10587 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
10592 #: ../fish/guestfish-actions.pod:2589
10597 #: ../fish/guestfish-actions.pod:2591
10600 " lgetxattr path name\n"
10605 #: ../fish/guestfish-actions.pod:2593 ../src/guestfs-actions.pod:3845
10607 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10608 "is a symlink, then this call returns an extended attribute from the symlink."
10612 #: ../fish/guestfish-actions.pod:2607
10613 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
10617 #: ../fish/guestfish-actions.pod:2609
10622 #: ../fish/guestfish-actions.pod:2611
10625 " lgetxattrs path\n"
10630 #: ../fish/guestfish-actions.pod:2613
10632 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
10633 "it returns the extended attributes of the link itself."
10637 #: ../fish/guestfish-actions.pod:2617
10642 #: ../fish/guestfish-actions.pod:2619
10650 #: ../fish/guestfish-actions.pod:2621 ../src/guestfs-actions.pod:3888
10652 "List all 9p filesystems attached to the guest. A list of mount tags is "
10657 #: ../fish/guestfish-actions.pod:2624
10658 msgid "list-devices"
10662 #: ../fish/guestfish-actions.pod:2626
10670 #: ../fish/guestfish-actions.pod:2628 ../src/guestfs-actions.pod:3902
10671 msgid "List all the block devices."
10675 #: ../fish/guestfish-actions.pod:2630 ../src/guestfs-actions.pod:3904
10676 msgid "The full block device names are returned, eg. C</dev/sda>."
10680 #: ../fish/guestfish-actions.pod:2634
10681 msgid "list-dm-devices"
10685 #: ../fish/guestfish-actions.pod:2636
10688 " list-dm-devices\n"
10693 #: ../fish/guestfish-actions.pod:2638 ../src/guestfs-actions.pod:3919
10694 msgid "List all device mapper devices."
10698 #: ../fish/guestfish-actions.pod:2640
10700 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
10701 "previous call to L</luks-open>."
10705 #: ../fish/guestfish-actions.pod:2643
10707 "Device mapper devices which correspond to logical volumes are I<not> "
10708 "returned in this list. Call L</lvs> if you want to list logical volumes."
10712 #: ../fish/guestfish-actions.pod:2647
10713 msgid "list-filesystems"
10717 #: ../fish/guestfish-actions.pod:2649
10720 " list-filesystems\n"
10725 #: ../fish/guestfish-actions.pod:2651 ../src/guestfs-actions.pod:3939
10727 "This inspection command looks for filesystems on partitions, block devices "
10728 "and logical volumes, returning a list of devices containing filesystems and "
10733 #: ../fish/guestfish-actions.pod:2655 ../src/guestfs-actions.pod:3943
10735 "The return value is a hash, where the keys are the devices containing "
10736 "filesystems, and the values are the filesystem types. For example:"
10740 #: ../fish/guestfish-actions.pod:2659 ../src/guestfs-actions.pod:3947
10743 " \"/dev/sda1\" => \"ntfs\"\n"
10744 " \"/dev/sda2\" => \"ext2\"\n"
10745 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10746 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10751 #: ../fish/guestfish-actions.pod:2664 ../src/guestfs-actions.pod:3952
10753 "The value can have the special value \"unknown\", meaning the content of the "
10754 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10758 #: ../fish/guestfish-actions.pod:2668
10760 "This command runs other libguestfs commands, which might include L</mount> "
10761 "and L</umount>, and therefore you should use this soon after launch and only "
10762 "when nothing is mounted."
10766 #: ../fish/guestfish-actions.pod:2672
10768 "Not all of the filesystems returned will be mountable. In particular, swap "
10769 "partitions are returned in the list. Also this command does not check that "
10770 "each filesystem found is valid and mountable, and some filesystems might be "
10771 "mountable but require special options. Filesystems may not all belong to a "
10772 "single logical operating system (use L</inspect-os> to look for OSes)."
10776 #: ../fish/guestfish-actions.pod:2680
10777 msgid "list-partitions"
10781 #: ../fish/guestfish-actions.pod:2682
10784 " list-partitions\n"
10789 #: ../fish/guestfish-actions.pod:2684 ../src/guestfs-actions.pod:3981
10790 msgid "List all the partitions detected on all block devices."
10794 #: ../fish/guestfish-actions.pod:2686 ../src/guestfs-actions.pod:3983
10795 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10799 #: ../fish/guestfish-actions.pod:2688
10801 "This does not return logical volumes. For that you will need to call "
10806 #: ../fish/guestfish-actions.pod:2693
10811 #: ../fish/guestfish-actions.pod:2695
10819 #: ../fish/guestfish-actions.pod:2697 ../src/guestfs-actions.pod:4002
10821 "List the files in C<directory> (relative to the root directory, there is no "
10822 "cwd) in the format of 'ls -la'."
10826 #: ../fish/guestfish-actions.pod:2700 ../src/guestfs-actions.pod:4005
10828 "This command is mostly useful for interactive sessions. It is I<not> "
10829 "intended that you try to parse the output string."
10833 #: ../fish/guestfish-actions.pod:2703
10838 #: ../fish/guestfish-actions.pod:2705
10841 " ln target linkname\n"
10846 #: ../fish/guestfish-actions.pod:2707 ../src/guestfs-actions.pod:4020
10847 msgid "This command creates a hard link using the C<ln> command."
10851 #: ../fish/guestfish-actions.pod:2709
10856 #: ../fish/guestfish-actions.pod:2711
10859 " ln-f target linkname\n"
10864 #: ../fish/guestfish-actions.pod:2713 ../src/guestfs-actions.pod:4033
10866 "This command creates a hard link using the C<ln -f> command. The I<-f> "
10867 "option removes the link (C<linkname>) if it exists already."
10871 #: ../fish/guestfish-actions.pod:2716
10876 #: ../fish/guestfish-actions.pod:2718
10879 " ln-s target linkname\n"
10884 #: ../fish/guestfish-actions.pod:2720 ../src/guestfs-actions.pod:4047
10885 msgid "This command creates a symbolic link using the C<ln -s> command."
10889 #: ../fish/guestfish-actions.pod:2722
10894 #: ../fish/guestfish-actions.pod:2724
10897 " ln-sf target linkname\n"
10902 #: ../fish/guestfish-actions.pod:2726 ../src/guestfs-actions.pod:4060
10904 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
10905 "option removes the link (C<linkname>) if it exists already."
10909 #: ../fish/guestfish-actions.pod:2729
10910 msgid "lremovexattr"
10914 #: ../fish/guestfish-actions.pod:2731
10917 " lremovexattr xattr path\n"
10922 #: ../fish/guestfish-actions.pod:2733
10924 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
10925 "it removes an extended attribute of the link itself."
10929 #: ../fish/guestfish-actions.pod:2737
10934 #: ../fish/guestfish-actions.pod:2739
10942 #: ../fish/guestfish-actions.pod:2741 ../src/guestfs-actions.pod:4088
10944 "List the files in C<directory> (relative to the root directory, there is no "
10945 "cwd). The '.' and '..' entries are not returned, but hidden files are "
10950 #: ../fish/guestfish-actions.pod:2745
10952 "This command is mostly useful for interactive sessions. Programs should "
10953 "probably use L</readdir> instead."
10957 #: ../fish/guestfish-actions.pod:2748
10962 #: ../fish/guestfish-actions.pod:2750
10965 " lsetxattr xattr val vallen path\n"
10970 #: ../fish/guestfish-actions.pod:2752
10972 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
10973 "sets an extended attribute of the link itself."
10977 #: ../fish/guestfish-actions.pod:2756
10982 #: ../fish/guestfish-actions.pod:2758
10990 #: ../fish/guestfish-actions.pod:2760 ../fish/guestfish-actions.pod:4570 ../src/guestfs-actions.pod:4124 ../src/guestfs-actions.pod:6909
10991 msgid "Returns file information for the given C<path>."
10995 #: ../fish/guestfish-actions.pod:2762
10997 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
10998 "the link is stat-ed, not the file it refers to."
11002 #: ../fish/guestfish-actions.pod:2766 ../src/guestfs-actions.pod:4130
11003 msgid "This is the same as the C<lstat(2)> system call."
11007 #: ../fish/guestfish-actions.pod:2768
11012 #: ../fish/guestfish-actions.pod:2770
11015 " lstatlist path 'names ...'\n"
11020 #: ../fish/guestfish-actions.pod:2772
11022 "This call allows you to perform the L</lstat> operation on multiple files, "
11023 "where all files are in the directory C<path>. C<names> is the list of files "
11024 "from this directory."
11028 #: ../fish/guestfish-actions.pod:2776 ../src/guestfs-actions.pod:4149
11030 "On return you get a list of stat structs, with a one-to-one correspondence "
11031 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11032 "then the C<ino> field of that structure is set to C<-1>."
11036 #: ../fish/guestfish-actions.pod:2781
11038 "This call is intended for programs that want to efficiently list a directory "
11039 "contents without making many round-trips. See also L</lxattrlist> for a "
11040 "similarly efficient call for getting extended attributes. Very long "
11041 "directory listings might cause the protocol message size to be exceeded, "
11042 "causing this call to fail. The caller must split up such requests into "
11043 "smaller groups of names."
11047 #: ../fish/guestfish-actions.pod:2789
11048 msgid "luks-add-key"
11052 #: ../fish/guestfish-actions.pod:2791
11055 " luks-add-key device keyslot\n"
11060 #: ../fish/guestfish-actions.pod:2793 ../src/guestfs-actions.pod:4177
11062 "This command adds a new key on LUKS device C<device>. C<key> is any "
11063 "existing key, and is used to access the device. C<newkey> is the new key to "
11064 "add. C<keyslot> is the key slot that will be replaced."
11068 #: ../fish/guestfish-actions.pod:2798
11070 "Note that if C<keyslot> already contains a key, then this command will "
11071 "fail. You have to use L</luks-kill-slot> first to remove that key."
11075 #: ../fish/guestfish-actions.pod:2802 ../fish/guestfish-actions.pod:2824 ../fish/guestfish-actions.pod:2837 ../fish/guestfish-actions.pod:2851 ../fish/guestfish-actions.pod:2877 ../fish/guestfish-actions.pod:2887
11077 "This command has one or more key or passphrase parameters. Guestfish will "
11078 "prompt for these separately."
11082 #: ../fish/guestfish-actions.pod:2805
11087 #: ../fish/guestfish-actions.pod:2807
11090 " luks-close device\n"
11095 #: ../fish/guestfish-actions.pod:2809
11097 "This closes a LUKS device that was created earlier by L</luks-open> or "
11098 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
11099 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
11100 "underlying block device."
11104 #: ../fish/guestfish-actions.pod:2815
11105 msgid "luks-format"
11109 #: ../fish/guestfish-actions.pod:2817
11112 " luks-format device keyslot\n"
11117 #: ../fish/guestfish-actions.pod:2819 ../src/guestfs-actions.pod:4218
11119 "This command erases existing data on C<device> and formats the device as a "
11120 "LUKS encrypted device. C<key> is the initial key, which is added to key "
11121 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
11125 #: ../fish/guestfish-actions.pod:2827 ../fish/guestfish-actions.pod:2840 ../fish/guestfish-actions.pod:2927 ../fish/guestfish-actions.pod:3578 ../fish/guestfish-actions.pod:4104 ../fish/guestfish-actions.pod:4441 ../fish/guestfish-actions.pod:4464 ../fish/guestfish-actions.pod:4486 ../fish/guestfish-actions.pod:5232 ../src/guestfs-actions.pod:4225 ../src/guestfs-actions.pod:4248 ../src/guestfs-actions.pod:4391 ../src/guestfs-actions.pod:5484 ../src/guestfs-actions.pod:6272 ../src/guestfs-actions.pod:6723 ../src/guestfs-actions.pod:6753 ../src/guestfs-actions.pod:6786 ../src/guestfs-actions.pod:7985
11127 "B<This command is dangerous. Without careful use you can easily destroy all "
11132 #: ../fish/guestfish-actions.pod:2830
11133 msgid "luks-format-cipher"
11137 #: ../fish/guestfish-actions.pod:2832
11140 " luks-format-cipher device keyslot cipher\n"
11145 #: ../fish/guestfish-actions.pod:2834
11147 "This command is the same as L</luks-format> but it also allows you to set "
11148 "the C<cipher> used."
11152 #: ../fish/guestfish-actions.pod:2843
11153 msgid "luks-kill-slot"
11157 #: ../fish/guestfish-actions.pod:2845
11160 " luks-kill-slot device keyslot\n"
11165 #: ../fish/guestfish-actions.pod:2847 ../src/guestfs-actions.pod:4265
11167 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11168 "device C<device>. C<key> must be one of the I<other> keys."
11172 #: ../fish/guestfish-actions.pod:2854
11177 #: ../fish/guestfish-actions.pod:2856
11180 " luks-open device mapname\n"
11185 #: ../fish/guestfish-actions.pod:2858 ../src/guestfs-actions.pod:4285
11187 "This command opens a block device which has been encrypted according to the "
11188 "Linux Unified Key Setup (LUKS) standard."
11192 #: ../fish/guestfish-actions.pod:2861 ../src/guestfs-actions.pod:4288
11193 msgid "C<device> is the encrypted block device or partition."
11197 #: ../fish/guestfish-actions.pod:2863 ../src/guestfs-actions.pod:4290
11199 "The caller must supply one of the keys associated with the LUKS block "
11200 "device, in the C<key> parameter."
11204 #: ../fish/guestfish-actions.pod:2866 ../src/guestfs-actions.pod:4293
11206 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
11207 "writes to this block device are decrypted from and encrypted to the "
11208 "underlying C<device> respectively."
11212 #: ../fish/guestfish-actions.pod:2870
11214 "If this block device contains LVM volume groups, then calling L</vgscan> "
11215 "followed by L</vg-activate-all> will make them visible."
11219 #: ../fish/guestfish-actions.pod:2874
11220 msgid "Use L</list-dm-devices> to list all device mapper devices."
11224 #: ../fish/guestfish-actions.pod:2880
11225 msgid "luks-open-ro"
11229 #: ../fish/guestfish-actions.pod:2882
11232 " luks-open-ro device mapname\n"
11237 #: ../fish/guestfish-actions.pod:2884
11239 "This is the same as L</luks-open> except that a read-only mapping is "
11244 #: ../fish/guestfish-actions.pod:2890
11249 #: ../fish/guestfish-actions.pod:2892
11252 " lvcreate logvol volgroup mbytes\n"
11257 #: ../fish/guestfish-actions.pod:2894 ../src/guestfs-actions.pod:4339
11259 "This creates an LVM logical volume called C<logvol> on the volume group "
11260 "C<volgroup>, with C<size> megabytes."
11264 #: ../fish/guestfish-actions.pod:2897
11265 msgid "lvm-canonical-lv-name"
11269 #: ../fish/guestfish-actions.pod:2899
11272 " lvm-canonical-lv-name lvname\n"
11277 #: ../fish/guestfish-actions.pod:2901 ../src/guestfs-actions.pod:4352
11279 "This converts alternative naming schemes for LVs that you might find to the "
11280 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
11285 #: ../fish/guestfish-actions.pod:2905 ../src/guestfs-actions.pod:4356
11287 "This command returns an error if the C<lvname> parameter does not refer to a "
11292 #: ../fish/guestfish-actions.pod:2908
11293 msgid "See also L</is-lv>."
11297 #: ../fish/guestfish-actions.pod:2910
11298 msgid "lvm-clear-filter"
11302 #: ../fish/guestfish-actions.pod:2912
11305 " lvm-clear-filter\n"
11310 #: ../fish/guestfish-actions.pod:2914
11312 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
11317 #: ../fish/guestfish-actions.pod:2917 ../fish/guestfish-actions.pod:2948 ../src/guestfs-actions.pod:4374 ../src/guestfs-actions.pod:4416
11318 msgid "This command also clears the LVM cache and performs a volume group scan."
11322 #: ../fish/guestfish-actions.pod:2920
11323 msgid "lvm-remove-all"
11327 #: ../fish/guestfish-actions.pod:2922
11330 " lvm-remove-all\n"
11335 #: ../fish/guestfish-actions.pod:2924 ../src/guestfs-actions.pod:4386
11337 "This command removes all LVM logical volumes, volume groups and physical "
11342 #: ../fish/guestfish-actions.pod:2930
11343 msgid "lvm-set-filter"
11347 #: ../fish/guestfish-actions.pod:2932
11350 " lvm-set-filter 'devices ...'\n"
11355 #: ../fish/guestfish-actions.pod:2934 ../src/guestfs-actions.pod:4402
11357 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
11358 "block devices in the list C<devices>, and will ignore all other attached "
11363 #: ../fish/guestfish-actions.pod:2938 ../src/guestfs-actions.pod:4406
11365 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
11366 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
11367 "there are two types of duplication possible: either cloned PVs/VGs which "
11368 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
11369 "same name. In normal operation you cannot create this situation, but you "
11370 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
11371 "inside the LVM metadata."
11375 #: ../fish/guestfish-actions.pod:2951 ../src/guestfs-actions.pod:4419
11376 msgid "You can filter whole block devices or individual partitions."
11380 #: ../fish/guestfish-actions.pod:2953 ../src/guestfs-actions.pod:4421
11382 "You cannot use this if any VG is currently in use (eg. contains a mounted "
11383 "filesystem), even if you are not filtering out that VG."
11387 #: ../fish/guestfish-actions.pod:2957
11392 #: ../fish/guestfish-actions.pod:2959
11395 " lvremove device\n"
11400 #: ../fish/guestfish-actions.pod:2961 ../src/guestfs-actions.pod:4435
11402 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
11403 "LV, such as C</dev/VG/LV>."
11407 #: ../fish/guestfish-actions.pod:2964 ../src/guestfs-actions.pod:4438
11409 "You can also remove all LVs in a volume group by specifying the VG name, "
11414 #: ../fish/guestfish-actions.pod:2967
11419 #: ../fish/guestfish-actions.pod:2969
11422 " lvrename logvol newlogvol\n"
11427 #: ../fish/guestfish-actions.pod:2971 ../src/guestfs-actions.pod:4452
11428 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
11432 #: ../fish/guestfish-actions.pod:2973
11437 #: ../fish/guestfish-actions.pod:2975
11440 " lvresize device mbytes\n"
11445 #: ../fish/guestfish-actions.pod:2977 ../src/guestfs-actions.pod:4465
11447 "This resizes (expands or shrinks) an existing LVM logical volume to "
11448 "C<mbytes>. When reducing, data in the reduced part is lost."
11452 #: ../fish/guestfish-actions.pod:2981
11453 msgid "lvresize-free"
11457 #: ../fish/guestfish-actions.pod:2983
11460 " lvresize-free lv percent\n"
11465 #: ../fish/guestfish-actions.pod:2985 ../src/guestfs-actions.pod:4480
11467 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
11468 "remaining free space in the volume group. Commonly you would call this with "
11469 "pc = 100 which expands the logical volume as much as possible, using all "
11470 "remaining free space in the volume group."
11474 #: ../fish/guestfish-actions.pod:2991
11479 #: ../fish/guestfish-actions.pod:2993
11487 #: ../fish/guestfish-actions.pod:2995 ../src/guestfs-actions.pod:4495
11489 "List all the logical volumes detected. This is the equivalent of the "
11490 "L<lvs(8)> command."
11494 #: ../fish/guestfish-actions.pod:2998 ../src/guestfs-actions.pod:4498
11496 "This returns a list of the logical volume device names "
11497 "(eg. C</dev/VolGroup00/LogVol00>)."
11501 #: ../fish/guestfish-actions.pod:3001
11502 msgid "See also L</lvs-full>, L</list-filesystems>."
11506 #: ../fish/guestfish-actions.pod:3003
11511 #: ../fish/guestfish-actions.pod:3005
11519 #: ../fish/guestfish-actions.pod:3007 ../src/guestfs-actions.pod:4514
11521 "List all the logical volumes detected. This is the equivalent of the "
11522 "L<lvs(8)> command. The \"full\" version includes all fields."
11526 #: ../fish/guestfish-actions.pod:3010
11531 #: ../fish/guestfish-actions.pod:3012
11539 #: ../fish/guestfish-actions.pod:3014 ../src/guestfs-actions.pod:4529
11540 msgid "This command returns the UUID of the LVM LV C<device>."
11544 #: ../fish/guestfish-actions.pod:3016
11549 #: ../fish/guestfish-actions.pod:3018
11552 " lxattrlist path 'names ...'\n"
11557 #: ../fish/guestfish-actions.pod:3020 ../src/guestfs-actions.pod:4543
11559 "This call allows you to get the extended attributes of multiple files, where "
11560 "all files are in the directory C<path>. C<names> is the list of files from "
11565 #: ../fish/guestfish-actions.pod:3024 ../src/guestfs-actions.pod:4547
11567 "On return you get a flat list of xattr structs which must be interpreted "
11568 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11569 "C<attrval> in this struct is zero-length to indicate there was an error "
11570 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11571 "number (the number of following attributes for this file, which could be "
11572 "C<\"0\">). Then after the first xattr struct are the zero or more "
11573 "attributes for the first named file. This repeats for the second and "
11574 "subsequent files."
11578 #: ../fish/guestfish-actions.pod:3034
11580 "This call is intended for programs that want to efficiently list a directory "
11581 "contents without making many round-trips. See also L</lstatlist> for a "
11582 "similarly efficient call for getting standard stats. Very long directory "
11583 "listings might cause the protocol message size to be exceeded, causing this "
11584 "call to fail. The caller must split up such requests into smaller groups of "
11589 #: ../fish/guestfish-actions.pod:3042
11594 #: ../fish/guestfish-actions.pod:3044
11602 #: ../fish/guestfish-actions.pod:3046 ../src/guestfs-actions.pod:4577
11603 msgid "Create a directory named C<path>."
11607 #: ../fish/guestfish-actions.pod:3048
11612 #: ../fish/guestfish-actions.pod:3050
11615 " mkdir-mode path mode\n"
11620 #: ../fish/guestfish-actions.pod:3052 ../src/guestfs-actions.pod:4590
11622 "This command creates a directory, setting the initial permissions of the "
11623 "directory to C<mode>."
11627 #: ../fish/guestfish-actions.pod:3055 ../src/guestfs-actions.pod:4593
11629 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11630 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11635 #: ../fish/guestfish-actions.pod:3059
11636 msgid "See also L</mkdir>, L</umask>"
11640 #: ../fish/guestfish-actions.pod:3061
11645 #: ../fish/guestfish-actions.pod:3063
11653 #: ../fish/guestfish-actions.pod:3065 ../src/guestfs-actions.pod:4609
11655 "Create a directory named C<path>, creating any parent directories as "
11656 "necessary. This is like the C<mkdir -p> shell command."
11660 #: ../fish/guestfish-actions.pod:3068
11665 #: ../fish/guestfish-actions.pod:3070
11668 " mkdtemp template\n"
11673 #: ../fish/guestfish-actions.pod:3072 ../src/guestfs-actions.pod:4622
11675 "This command creates a temporary directory. The C<template> parameter "
11676 "should be a full pathname for the temporary directory name with the final "
11677 "six characters being \"XXXXXX\"."
11681 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4627
11683 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11684 "being suitable for Windows filesystems."
11688 #: ../fish/guestfish-actions.pod:3080 ../src/guestfs-actions.pod:4630
11689 msgid "The name of the temporary directory that was created is returned."
11693 #: ../fish/guestfish-actions.pod:3083 ../src/guestfs-actions.pod:4633
11694 msgid "The temporary directory is created with mode 0700 and is owned by root."
11698 #: ../fish/guestfish-actions.pod:3086 ../src/guestfs-actions.pod:4636
11700 "The caller is responsible for deleting the temporary directory and its "
11701 "contents after use."
11705 #: ../fish/guestfish-actions.pod:3089 ../src/guestfs-actions.pod:4639
11706 msgid "See also: L<mkdtemp(3)>"
11710 #: ../fish/guestfish-actions.pod:3091
11715 #: ../fish/guestfish-actions.pod:3093
11718 " mke2fs-J fstype blocksize device journal\n"
11723 #: ../fish/guestfish-actions.pod:3095 ../src/guestfs-actions.pod:4655
11725 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11726 "C<journal>. It is equivalent to the command:"
11730 #: ../fish/guestfish-actions.pod:3099 ../src/guestfs-actions.pod:4659
11733 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11738 #: ../fish/guestfish-actions.pod:3101
11739 msgid "See also L</mke2journal>."
11743 #: ../fish/guestfish-actions.pod:3103
11748 #: ../fish/guestfish-actions.pod:3105
11751 " mke2fs-JL fstype blocksize device label\n"
11756 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4676
11758 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11759 "the journal labeled C<label>."
11763 #: ../fish/guestfish-actions.pod:3110
11764 msgid "See also L</mke2journal-L>."
11768 #: ../fish/guestfish-actions.pod:3112
11773 #: ../fish/guestfish-actions.pod:3114
11776 " mke2fs-JU fstype blocksize device uuid\n"
11781 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4694
11783 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11784 "the journal with UUID C<uuid>."
11788 #: ../fish/guestfish-actions.pod:3119
11789 msgid "See also L</mke2journal-U>."
11793 #: ../fish/guestfish-actions.pod:3121
11794 msgid "mke2journal"
11798 #: ../fish/guestfish-actions.pod:3123
11801 " mke2journal blocksize device\n"
11806 #: ../fish/guestfish-actions.pod:3125 ../src/guestfs-actions.pod:4710
11808 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11813 #: ../fish/guestfish-actions.pod:3128 ../src/guestfs-actions.pod:4713
11816 " mke2fs -O journal_dev -b blocksize device\n"
11821 #: ../fish/guestfish-actions.pod:3130
11822 msgid "mke2journal-L"
11826 #: ../fish/guestfish-actions.pod:3132
11829 " mke2journal-L blocksize label device\n"
11834 #: ../fish/guestfish-actions.pod:3134 ../src/guestfs-actions.pod:4727
11835 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11839 #: ../fish/guestfish-actions.pod:3136
11840 msgid "mke2journal-U"
11844 #: ../fish/guestfish-actions.pod:3138
11847 " mke2journal-U blocksize uuid device\n"
11852 #: ../fish/guestfish-actions.pod:3140 ../src/guestfs-actions.pod:4741
11853 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11857 #: ../fish/guestfish-actions.pod:3142
11862 #: ../fish/guestfish-actions.pod:3144
11865 " mkfifo mode path\n"
11870 #: ../fish/guestfish-actions.pod:3146
11872 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11873 "is just a convenient wrapper around L</mknod>."
11877 #: ../fish/guestfish-actions.pod:3152
11882 #: ../fish/guestfish-actions.pod:3154
11885 " mkfs fstype device\n"
11890 #: ../fish/guestfish-actions.pod:3156 ../src/guestfs-actions.pod:4771
11892 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11893 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11897 #: ../fish/guestfish-actions.pod:3160
11902 #: ../fish/guestfish-actions.pod:3162
11905 " mkfs-b fstype blocksize device\n"
11910 #: ../fish/guestfish-actions.pod:3164
11912 "This call is similar to L</mkfs>, but it allows you to control the block "
11913 "size of the resulting filesystem. Supported block sizes depend on the "
11914 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11918 #: ../fish/guestfish-actions.pod:3169 ../fish/guestfish-actions.pod:3196 ../src/guestfs-actions.pod:4799 ../src/guestfs-actions.pod:4837
11920 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11925 #: ../fish/guestfish-actions.pod:3172
11927 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
11932 #: ../fish/guestfish-actions.pod:3179
11937 #: ../fish/guestfish-actions.pod:3181
11940 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] "
11941 "[sectorsize:..]\n"
11946 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4824
11948 "This function creates a filesystem on C<device>. The filesystem type is "
11949 "C<fstype>, for example C<ext3>."
11953 #: ../fish/guestfish-actions.pod:3190 ../src/guestfs-actions.pod:4831
11954 msgid "C<blocksize>"
11958 #: ../fish/guestfish-actions.pod:3192 ../src/guestfs-actions.pod:4833
11960 "The filesystem block size. Supported block sizes depend on the filesystem "
11961 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11966 #: ../fish/guestfish-actions.pod:3199 ../src/guestfs-actions.pod:4840
11967 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
11971 #: ../fish/guestfish-actions.pod:3201 ../src/guestfs-actions.pod:4842
11972 msgid "C<features>"
11976 #: ../fish/guestfish-actions.pod:3203 ../src/guestfs-actions.pod:4844
11977 msgid "This passes the I<-O> parameter to the external mkfs program."
11981 #: ../fish/guestfish-actions.pod:3205 ../src/guestfs-actions.pod:4846
11983 "For certain filesystem types, this allows extra filesystem features to be "
11984 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
11988 #: ../fish/guestfish-actions.pod:3209 ../src/guestfs-actions.pod:4850
11990 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
11995 #: ../fish/guestfish-actions.pod:3212 ../src/guestfs-actions.pod:4853
12000 #: ../fish/guestfish-actions.pod:3214 ../src/guestfs-actions.pod:4855
12002 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
12003 "sets the inode size (only for ext2/3/4 filesystems at present)."
12007 #: ../fish/guestfish-actions.pod:3217 ../src/guestfs-actions.pod:4858
12008 msgid "C<sectorsize>"
12012 #: ../fish/guestfish-actions.pod:3219 ../src/guestfs-actions.pod:4860
12014 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
12015 "sets sector size for ufs filesystem."
12019 #: ../fish/guestfish-actions.pod:3226
12020 msgid "mkmountpoint"
12024 #: ../fish/guestfish-actions.pod:3228
12027 " mkmountpoint exemptpath\n"
12032 #: ../fish/guestfish-actions.pod:3230
12034 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
12035 "to create extra mountpoints before mounting the first filesystem."
12039 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4903
12041 "These calls are I<only> necessary in some very limited circumstances, mainly "
12042 "the case where you want to mount a mix of unrelated and/or read-only "
12043 "filesystems together."
12047 #: ../fish/guestfish-actions.pod:3238 ../src/guestfs-actions.pod:4907
12049 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
12050 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
12051 "inside that. You can unpack this as follows in guestfish:"
12055 #: ../fish/guestfish-actions.pod:3243 ../src/guestfs-actions.pod:4912
12058 " add-ro Fedora-11-i686-Live.iso\n"
12060 " mkmountpoint /cd\n"
12061 " mkmountpoint /sqsh\n"
12062 " mkmountpoint /ext3fs\n"
12063 " mount /dev/sda /cd\n"
12064 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
12065 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
12070 #: ../fish/guestfish-actions.pod:3252 ../src/guestfs-actions.pod:4921
12071 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
12075 #: ../fish/guestfish-actions.pod:3254
12077 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
12078 "unexpected errors if you try to mix these calls. It is safest to manually "
12079 "unmount filesystems and remove mountpoints after use."
12083 #: ../fish/guestfish-actions.pod:3258
12085 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
12086 "for this to work for manual mountpoints, you must ensure that the innermost "
12087 "mountpoints have the longest pathnames, as in the example code above."
12091 #: ../fish/guestfish-actions.pod:3263 ../src/guestfs-actions.pod:4932
12092 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
12096 #: ../fish/guestfish-actions.pod:3265
12098 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
12099 "L</umount-all> to be called when the handle is closed which can also trigger "
12104 #: ../fish/guestfish-actions.pod:3269
12109 #: ../fish/guestfish-actions.pod:3271
12112 " mknod mode devmajor devminor path\n"
12117 #: ../fish/guestfish-actions.pod:3273 ../src/guestfs-actions.pod:4951
12119 "This call creates block or character special devices, or named pipes "
12124 #: ../fish/guestfish-actions.pod:3276 ../src/guestfs-actions.pod:4954
12126 "The C<mode> parameter should be the mode, using the standard constants. "
12127 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
12128 "used when creating block and character special devices."
12132 #: ../fish/guestfish-actions.pod:3281
12134 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
12135 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
12136 "regular file). These constants are available in the standard Linux header "
12137 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
12138 "wrappers around this command which bitwise OR in the appropriate constant "
12143 #: ../fish/guestfish-actions.pod:3291
12148 #: ../fish/guestfish-actions.pod:3293
12151 " mknod-b mode devmajor devminor path\n"
12156 #: ../fish/guestfish-actions.pod:3295
12158 "This call creates a block device node called C<path> with mode C<mode> and "
12159 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12160 "wrapper around L</mknod>."
12164 #: ../fish/guestfish-actions.pod:3301
12169 #: ../fish/guestfish-actions.pod:3303
12172 " mknod-c mode devmajor devminor path\n"
12177 #: ../fish/guestfish-actions.pod:3305
12179 "This call creates a char device node called C<path> with mode C<mode> and "
12180 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12181 "wrapper around L</mknod>."
12185 #: ../fish/guestfish-actions.pod:3311
12190 #: ../fish/guestfish-actions.pod:3313
12198 #: ../fish/guestfish-actions.pod:3315 ../src/guestfs-actions.pod:5017
12199 msgid "Create a swap partition on C<device>."
12203 #: ../fish/guestfish-actions.pod:3317
12208 #: ../fish/guestfish-actions.pod:3319
12211 " mkswap-L label device\n"
12216 #: ../fish/guestfish-actions.pod:3321 ../src/guestfs-actions.pod:5030
12217 msgid "Create a swap partition on C<device> with label C<label>."
12221 #: ../fish/guestfish-actions.pod:3323 ../src/guestfs-actions.pod:5032
12223 "Note that you cannot attach a swap label to a block device "
12224 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
12225 "the kernel or swap tools."
12229 #: ../fish/guestfish-actions.pod:3327
12234 #: ../fish/guestfish-actions.pod:3329
12237 " mkswap-U uuid device\n"
12242 #: ../fish/guestfish-actions.pod:3331 ../src/guestfs-actions.pod:5047
12243 msgid "Create a swap partition on C<device> with UUID C<uuid>."
12247 #: ../fish/guestfish-actions.pod:3333
12248 msgid "mkswap-file"
12252 #: ../fish/guestfish-actions.pod:3335
12255 " mkswap-file path\n"
12260 #: ../fish/guestfish-actions.pod:3337 ../src/guestfs-actions.pod:5059
12261 msgid "Create a swap file."
12265 #: ../fish/guestfish-actions.pod:3339
12267 "This command just writes a swap file signature to an existing file. To "
12268 "create the file itself, use something like L</fallocate>."
12272 #: ../fish/guestfish-actions.pod:3342
12277 #: ../fish/guestfish-actions.pod:3344
12280 " modprobe modulename\n"
12285 #: ../fish/guestfish-actions.pod:3346 ../src/guestfs-actions.pod:5074
12286 msgid "This loads a kernel module in the appliance."
12290 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5076
12292 "The kernel module must have been whitelisted when libguestfs was built (see "
12293 "C<appliance/kmod.whitelist.in> in the source)."
12297 #: ../fish/guestfish-actions.pod:3351
12302 #: ../fish/guestfish-actions.pod:3353
12305 " mount device mountpoint\n"
12310 #: ../fish/guestfish-actions.pod:3355 ../src/guestfs-actions.pod:5090
12312 "Mount a guest disk at a position in the filesystem. Block devices are named "
12313 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12314 "those block devices contain partitions, they will have the usual names "
12315 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12319 #: ../fish/guestfish-actions.pod:3361 ../src/guestfs-actions.pod:5096
12321 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12322 "mounted on C</> before others can be mounted. Other filesystems can only be "
12323 "mounted on directories which already exist."
12327 #: ../fish/guestfish-actions.pod:3366 ../src/guestfs-actions.pod:5101
12329 "The mounted filesystem is writable, if we have sufficient permissions on the "
12330 "underlying device."
12334 #: ../fish/guestfish-actions.pod:3369
12336 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
12337 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
12338 "problems for users. If your program might need to work with older versions "
12339 "of libguestfs, use L</mount-options> instead (using an empty string for the "
12340 "first parameter if you don't want any options)."
12344 #: ../fish/guestfish-actions.pod:3376
12349 #: ../fish/guestfish-actions.pod:3378
12352 " mount-9p mounttag mountpoint [options:..]\n"
12357 #: ../fish/guestfish-actions.pod:3380 ../src/guestfs-actions.pod:5130
12359 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
12364 #: ../fish/guestfish-actions.pod:3383 ../src/guestfs-actions.pod:5133
12366 "If required, C<trans=virtio> will be automatically added to the options. "
12367 "Any other options required can be passed in the optional C<options> "
12372 #: ../fish/guestfish-actions.pod:3389
12377 #: ../fish/guestfish-actions.pod:3391
12380 " mount-loop file mountpoint\n"
12385 #: ../fish/guestfish-actions.pod:3393 ../src/guestfs-actions.pod:5172
12387 "This command lets you mount C<file> (a filesystem image in a file) on a "
12388 "mount point. It is entirely equivalent to the command C<mount -o loop file "
12393 #: ../fish/guestfish-actions.pod:3397
12394 msgid "mount-options"
12398 #: ../fish/guestfish-actions.pod:3399
12401 " mount-options options device mountpoint\n"
12406 #: ../fish/guestfish-actions.pod:3401
12408 "This is the same as the L</mount> command, but it allows you to set the "
12409 "mount options as for the L<mount(8)> I<-o> flag."
12413 #: ../fish/guestfish-actions.pod:3405 ../src/guestfs-actions.pod:5192
12415 "If the C<options> parameter is an empty string, then no options are passed "
12416 "(all options default to whatever the filesystem uses)."
12420 #: ../fish/guestfish-actions.pod:3409
12425 #: ../fish/guestfish-actions.pod:3411
12428 " mount-ro device mountpoint\n"
12433 #: ../fish/guestfish-actions.pod:3413
12435 "This is the same as the L</mount> command, but it mounts the filesystem with "
12436 "the read-only (I<-o ro>) flag."
12440 #: ../fish/guestfish-actions.pod:3416
12445 #: ../fish/guestfish-actions.pod:3418
12448 " mount-vfs options vfstype device mountpoint\n"
12453 #: ../fish/guestfish-actions.pod:3420
12455 "This is the same as the L</mount> command, but it allows you to set both the "
12456 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
12460 #: ../fish/guestfish-actions.pod:3424
12461 msgid "mountpoints"
12465 #: ../fish/guestfish-actions.pod:3426
12473 #: ../fish/guestfish-actions.pod:3428
12475 "This call is similar to L</mounts>. That call returns a list of devices. "
12476 "This one returns a hash table (map) of device name to directory where the "
12477 "device is mounted."
12481 #: ../fish/guestfish-actions.pod:3432
12486 #: ../fish/guestfish-actions.pod:3434
12494 #: ../fish/guestfish-actions.pod:3436 ../src/guestfs-actions.pod:5253
12496 "This returns the list of currently mounted filesystems. It returns the list "
12497 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12501 #: ../fish/guestfish-actions.pod:3439 ../src/guestfs-actions.pod:5256
12502 msgid "Some internal mounts are not shown."
12506 #: ../fish/guestfish-actions.pod:3441
12507 msgid "See also: L</mountpoints>"
12511 #: ../fish/guestfish-actions.pod:3443
12516 #: ../fish/guestfish-actions.pod:3445
12524 #: ../fish/guestfish-actions.pod:3447 ../src/guestfs-actions.pod:5273
12526 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12527 "destination filename or destination directory."
12531 #: ../fish/guestfish-actions.pod:3450
12532 msgid "ntfs-3g-probe"
12536 #: ../fish/guestfish-actions.pod:3452
12539 " ntfs-3g-probe true|false device\n"
12544 #: ../fish/guestfish-actions.pod:3454 ../src/guestfs-actions.pod:5287
12546 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12547 "C<device> for mountability. (Not all NTFS volumes can be mounted "
12548 "read-write, and some cannot be mounted at all)."
12552 #: ../fish/guestfish-actions.pod:3458 ../src/guestfs-actions.pod:5291
12554 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12555 "can be mounted read-write. Set it to false if you want to test if the "
12556 "volume can be mounted read-only."
12560 #: ../fish/guestfish-actions.pod:3462 ../src/guestfs-actions.pod:5295
12562 "The return value is an integer which C<0> if the operation would succeed, or "
12563 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12567 #: ../fish/guestfish-actions.pod:3466
12572 #: ../fish/guestfish-actions.pod:3468
12575 " ntfsresize device\n"
12580 #: ../fish/guestfish-actions.pod:3470 ../fish/guestfish-actions.pod:3494 ../src/guestfs-actions.pod:5316 ../src/guestfs-actions.pod:5348
12582 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12583 "size of the underlying device."
12587 #: ../fish/guestfish-actions.pod:3473 ../src/guestfs-actions.pod:5319
12589 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
12590 "consistency check (for safety). You have to boot into Windows to perform "
12591 "this check and clear this condition. Furthermore, ntfsresize refuses to "
12592 "resize filesystems which have been marked in this way. So in effect it is "
12593 "not possible to call ntfsresize multiple times on a single filesystem "
12594 "without booting into Windows between each resize."
12598 #: ../fish/guestfish-actions.pod:3481 ../fish/guestfish-actions.pod:3520 ../src/guestfs-actions.pod:5327 ../src/guestfs-actions.pod:5374
12599 msgid "See also L<ntfsresize(8)>."
12603 #: ../fish/guestfish-actions.pod:3483 ../fish/guestfish-actions.pod:3531
12605 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
12610 #: ../fish/guestfish-actions.pod:3490
12611 msgid "ntfsresize-opts"
12615 #: ../fish/guestfish-actions.pod:3492
12618 " ntfsresize-opts device [size:..] [force:..]\n"
12623 #: ../fish/guestfish-actions.pod:3503 ../src/guestfs-actions.pod:5357
12625 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
12626 "resized to fit the container (eg. partition)."
12630 #: ../fish/guestfish-actions.pod:3506 ../src/guestfs-actions.pod:5360
12635 #: ../fish/guestfish-actions.pod:3508 ../src/guestfs-actions.pod:5362
12637 "If this option is true, then force the resize of the filesystem even if the "
12638 "filesystem is marked as requiring a consistency check."
12642 #: ../fish/guestfish-actions.pod:3511
12644 "After the resize operation, the filesystem is always marked as requiring a "
12645 "consistency check (for safety). You have to boot into Windows to perform "
12646 "this check and clear this condition. If you I<don't> set the C<force> "
12647 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
12648 "a single filesystem without booting into Windows between each resize."
12652 #: ../fish/guestfish-actions.pod:3524
12653 msgid "ntfsresize-size"
12657 #: ../fish/guestfish-actions.pod:3526
12660 " ntfsresize-size device size\n"
12665 #: ../fish/guestfish-actions.pod:3528
12667 "This command is the same as L</ntfsresize> except that it allows you to "
12668 "specify the new size (in bytes) explicitly."
12672 #: ../fish/guestfish-actions.pod:3538
12677 #: ../fish/guestfish-actions.pod:3540
12680 " part-add device prlogex startsect endsect\n"
12685 #: ../fish/guestfish-actions.pod:3542
12687 "This command adds a partition to C<device>. If there is no partition table "
12688 "on the device, call L</part-init> first."
12692 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5435
12694 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12695 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12696 "C<logical>) and C<e> (or C<extended>) partition types."
12700 #: ../fish/guestfish-actions.pod:3550 ../src/guestfs-actions.pod:5440
12702 "C<startsect> and C<endsect> are the start and end of the partition in "
12703 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12704 "from the end of the disk (C<-1> is the last sector)."
12708 #: ../fish/guestfish-actions.pod:3554
12710 "Creating a partition which covers the whole disk is not so easy. Use "
12711 "L</part-disk> to do that."
12715 #: ../fish/guestfish-actions.pod:3557
12720 #: ../fish/guestfish-actions.pod:3559
12723 " part-del device partnum\n"
12728 #: ../fish/guestfish-actions.pod:3561 ../src/guestfs-actions.pod:5458
12729 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12733 #: ../fish/guestfish-actions.pod:3563 ../src/guestfs-actions.pod:5460
12735 "Note that in the case of MBR partitioning, deleting an extended partition "
12736 "also deletes any logical partitions it contains."
12740 #: ../fish/guestfish-actions.pod:3567
12745 #: ../fish/guestfish-actions.pod:3569
12748 " part-disk device parttype\n"
12753 #: ../fish/guestfish-actions.pod:3571
12755 "This command is simply a combination of L</part-init> followed by "
12756 "L</part-add> to create a single primary partition covering the whole disk."
12760 #: ../fish/guestfish-actions.pod:3575
12762 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12763 "possible values are described in L</part-init>."
12767 #: ../fish/guestfish-actions.pod:3581
12768 msgid "part-get-bootable"
12772 #: ../fish/guestfish-actions.pod:3583
12775 " part-get-bootable device partnum\n"
12780 #: ../fish/guestfish-actions.pod:3585 ../src/guestfs-actions.pod:5496
12782 "This command returns true if the partition C<partnum> on C<device> has the "
12783 "bootable flag set."
12787 #: ../fish/guestfish-actions.pod:3588
12788 msgid "See also L</part-set-bootable>."
12792 #: ../fish/guestfish-actions.pod:3590
12793 msgid "part-get-mbr-id"
12797 #: ../fish/guestfish-actions.pod:3592
12800 " part-get-mbr-id device partnum\n"
12805 #: ../fish/guestfish-actions.pod:3594 ../src/guestfs-actions.pod:5512
12807 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12808 "partition C<partnum>."
12812 #: ../fish/guestfish-actions.pod:3597 ../fish/guestfish-actions.pod:3741
12814 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12815 "undefined results for other partition table types (see "
12816 "L</part-get-parttype>)."
12820 #: ../fish/guestfish-actions.pod:3601
12821 msgid "part-get-parttype"
12825 #: ../fish/guestfish-actions.pod:3603
12828 " part-get-parttype device\n"
12833 #: ../fish/guestfish-actions.pod:3605 ../src/guestfs-actions.pod:5529
12835 "This command examines the partition table on C<device> and returns the "
12836 "partition table type (format) being used."
12840 #: ../fish/guestfish-actions.pod:3608
12842 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12843 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12844 "possible, although unusual. See L</part-init> for a full list."
12848 #: ../fish/guestfish-actions.pod:3613
12853 #: ../fish/guestfish-actions.pod:3615
12856 " part-init device parttype\n"
12861 #: ../fish/guestfish-actions.pod:3617 ../src/guestfs-actions.pod:5549
12863 "This creates an empty partition table on C<device> of one of the partition "
12864 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12865 "(for large disks)."
12869 #: ../fish/guestfish-actions.pod:3621
12871 "Initially there are no partitions. Following this, you should call "
12872 "L</part-add> for each partition required."
12876 #: ../fish/guestfish-actions.pod:3624 ../src/guestfs-actions.pod:5556
12877 msgid "Possible values for C<parttype> are:"
12881 #: ../fish/guestfish-actions.pod:3628 ../src/guestfs-actions.pod:5560
12886 #: ../fish/guestfish-actions.pod:3630 ../src/guestfs-actions.pod:5562
12891 #: ../fish/guestfish-actions.pod:3632 ../src/guestfs-actions.pod:5564
12892 msgid "Intel EFI / GPT partition table."
12896 #: ../fish/guestfish-actions.pod:3634 ../src/guestfs-actions.pod:5566
12898 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12899 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12900 "the C<mbr> format."
12904 #: ../fish/guestfish-actions.pod:3638 ../src/guestfs-actions.pod:5570
12909 #: ../fish/guestfish-actions.pod:3640 ../src/guestfs-actions.pod:5572
12914 #: ../fish/guestfish-actions.pod:3642 ../src/guestfs-actions.pod:5574
12916 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12917 "Windows. This partition type will B<only> work for device sizes up to 2 "
12918 "TB. For large disks we recommend using C<gpt>."
12922 #: ../fish/guestfish-actions.pod:3649 ../src/guestfs-actions.pod:5581
12923 msgid "Other partition table types that may work but are not supported include:"
12927 #: ../fish/guestfish-actions.pod:3654 ../src/guestfs-actions.pod:5586
12932 #: ../fish/guestfish-actions.pod:3656 ../src/guestfs-actions.pod:5588
12933 msgid "AIX disk labels."
12937 #: ../fish/guestfish-actions.pod:3658 ../src/guestfs-actions.pod:5590
12942 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5592
12947 #: ../fish/guestfish-actions.pod:3662 ../src/guestfs-actions.pod:5594
12948 msgid "Amiga \"Rigid Disk Block\" format."
12952 #: ../fish/guestfish-actions.pod:3664 ../src/guestfs-actions.pod:5596
12957 #: ../fish/guestfish-actions.pod:3666 ../src/guestfs-actions.pod:5598
12958 msgid "BSD disk labels."
12962 #: ../fish/guestfish-actions.pod:3668 ../src/guestfs-actions.pod:5600
12967 #: ../fish/guestfish-actions.pod:3670 ../src/guestfs-actions.pod:5602
12968 msgid "DASD, used on IBM mainframes."
12972 #: ../fish/guestfish-actions.pod:3672 ../src/guestfs-actions.pod:5604
12977 #: ../fish/guestfish-actions.pod:3674 ../src/guestfs-actions.pod:5606
12978 msgid "MIPS/SGI volumes."
12982 #: ../fish/guestfish-actions.pod:3676 ../src/guestfs-actions.pod:5608
12987 #: ../fish/guestfish-actions.pod:3678 ../src/guestfs-actions.pod:5610
12988 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12992 #: ../fish/guestfish-actions.pod:3680 ../src/guestfs-actions.pod:5612
12997 #: ../fish/guestfish-actions.pod:3682 ../src/guestfs-actions.pod:5614
12998 msgid "NEC PC-98 format, common in Japan apparently."
13002 #: ../fish/guestfish-actions.pod:3684 ../src/guestfs-actions.pod:5616
13007 #: ../fish/guestfish-actions.pod:3686 ../src/guestfs-actions.pod:5618
13008 msgid "Sun disk labels."
13012 #: ../fish/guestfish-actions.pod:3690
13017 #: ../fish/guestfish-actions.pod:3692
13020 " part-list device\n"
13025 #: ../fish/guestfish-actions.pod:3694 ../src/guestfs-actions.pod:5632
13027 "This command parses the partition table on C<device> and returns the list of "
13028 "partitions found."
13032 #: ../fish/guestfish-actions.pod:3697 ../src/guestfs-actions.pod:5635
13033 msgid "The fields in the returned structure are:"
13037 #: ../fish/guestfish-actions.pod:3701 ../src/guestfs-actions.pod:5639
13038 msgid "B<part_num>"
13042 #: ../fish/guestfish-actions.pod:3703 ../src/guestfs-actions.pod:5641
13043 msgid "Partition number, counting from 1."
13047 #: ../fish/guestfish-actions.pod:3705 ../src/guestfs-actions.pod:5643
13048 msgid "B<part_start>"
13052 #: ../fish/guestfish-actions.pod:3707
13054 "Start of the partition I<in bytes>. To get sectors you have to divide by "
13055 "the device's sector size, see L</blockdev-getss>."
13059 #: ../fish/guestfish-actions.pod:3710 ../src/guestfs-actions.pod:5648
13060 msgid "B<part_end>"
13064 #: ../fish/guestfish-actions.pod:3712 ../src/guestfs-actions.pod:5650
13065 msgid "End of the partition in bytes."
13069 #: ../fish/guestfish-actions.pod:3714 ../src/guestfs-actions.pod:5652
13070 msgid "B<part_size>"
13074 #: ../fish/guestfish-actions.pod:3716 ../src/guestfs-actions.pod:5654
13075 msgid "Size of the partition in bytes."
13079 #: ../fish/guestfish-actions.pod:3720
13080 msgid "part-set-bootable"
13084 #: ../fish/guestfish-actions.pod:3722
13087 " part-set-bootable device partnum true|false\n"
13092 #: ../fish/guestfish-actions.pod:3724 ../src/guestfs-actions.pod:5672
13094 "This sets the bootable flag on partition numbered C<partnum> on device "
13095 "C<device>. Note that partitions are numbered from 1."
13099 #: ../fish/guestfish-actions.pod:3727 ../src/guestfs-actions.pod:5675
13101 "The bootable flag is used by some operating systems (notably Windows) to "
13102 "determine which partition to boot from. It is by no means universally "
13107 #: ../fish/guestfish-actions.pod:3731
13108 msgid "part-set-mbr-id"
13112 #: ../fish/guestfish-actions.pod:3733
13115 " part-set-mbr-id device partnum idbyte\n"
13120 #: ../fish/guestfish-actions.pod:3735 ../src/guestfs-actions.pod:5691
13122 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
13123 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
13124 "documentation are in fact hexadecimal numbers, but usually documented "
13125 "without any leading \"0x\" which might be confusing."
13129 #: ../fish/guestfish-actions.pod:3745
13130 msgid "part-set-name"
13134 #: ../fish/guestfish-actions.pod:3747
13137 " part-set-name device partnum name\n"
13142 #: ../fish/guestfish-actions.pod:3749 ../src/guestfs-actions.pod:5713
13144 "This sets the partition name on partition numbered C<partnum> on device "
13145 "C<device>. Note that partitions are numbered from 1."
13149 #: ../fish/guestfish-actions.pod:3752 ../src/guestfs-actions.pod:5716
13151 "The partition name can only be set on certain types of partition table. "
13152 "This works on C<gpt> but not on C<mbr> partitions."
13156 #: ../fish/guestfish-actions.pod:3755
13157 msgid "part-to-dev"
13161 #: ../fish/guestfish-actions.pod:3757
13164 " part-to-dev partition\n"
13169 #: ../fish/guestfish-actions.pod:3759 ../src/guestfs-actions.pod:5729
13171 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
13172 "partition number, returning the device name (eg. \"/dev/sdb\")."
13176 #: ../fish/guestfish-actions.pod:3763
13178 "The named partition must exist, for example as a string returned from "
13179 "L</list-partitions>."
13183 #: ../fish/guestfish-actions.pod:3766
13184 msgid "ping-daemon"
13188 #: ../fish/guestfish-actions.pod:3768
13196 #: ../fish/guestfish-actions.pod:3770 ../src/guestfs-actions.pod:5746
13198 "This is a test probe into the guestfs daemon running inside the qemu "
13199 "subprocess. Calling this function checks that the daemon responds to the "
13200 "ping message, without affecting the daemon or attached block device(s) in "
13205 #: ../fish/guestfish-actions.pod:3775
13210 #: ../fish/guestfish-actions.pod:3777
13213 " pread path count offset\n"
13218 #: ../fish/guestfish-actions.pod:3779 ../src/guestfs-actions.pod:5764
13220 "This command lets you read part of a file. It reads C<count> bytes of the "
13221 "file, starting at C<offset>, from file C<path>."
13225 #: ../fish/guestfish-actions.pod:3782 ../fish/guestfish-actions.pod:3797 ../src/guestfs-actions.pod:5767 ../src/guestfs-actions.pod:5793
13227 "This may read fewer bytes than requested. For further details see the "
13228 "L<pread(2)> system call."
13232 #: ../fish/guestfish-actions.pod:3785
13233 msgid "See also L</pwrite>, L</pread-device>."
13237 #: ../fish/guestfish-actions.pod:3790
13238 msgid "pread-device"
13242 #: ../fish/guestfish-actions.pod:3792
13245 " pread-device device count offset\n"
13250 #: ../fish/guestfish-actions.pod:3794 ../src/guestfs-actions.pod:5790
13252 "This command lets you read part of a file. It reads C<count> bytes of "
13253 "C<device>, starting at C<offset>."
13257 #: ../fish/guestfish-actions.pod:3800
13258 msgid "See also L</pread>."
13262 #: ../fish/guestfish-actions.pod:3805
13267 #: ../fish/guestfish-actions.pod:3807
13270 " pvcreate device\n"
13275 #: ../fish/guestfish-actions.pod:3809 ../src/guestfs-actions.pod:5813
13277 "This creates an LVM physical volume on the named C<device>, where C<device> "
13278 "should usually be a partition name such as C</dev/sda1>."
13282 #: ../fish/guestfish-actions.pod:3813
13287 #: ../fish/guestfish-actions.pod:3815
13290 " pvremove device\n"
13295 #: ../fish/guestfish-actions.pod:3817 ../src/guestfs-actions.pod:5827
13297 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13302 #: ../fish/guestfish-actions.pod:3820 ../src/guestfs-actions.pod:5830
13304 "The implementation uses the C<pvremove> command which refuses to wipe "
13305 "physical volumes that contain any volume groups, so you have to remove those "
13310 #: ../fish/guestfish-actions.pod:3824
13315 #: ../fish/guestfish-actions.pod:3826
13318 " pvresize device\n"
13323 #: ../fish/guestfish-actions.pod:3828 ../src/guestfs-actions.pod:5844
13325 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13326 "the new size of the underlying device."
13330 #: ../fish/guestfish-actions.pod:3831
13331 msgid "pvresize-size"
13335 #: ../fish/guestfish-actions.pod:3833
13338 " pvresize-size device size\n"
13343 #: ../fish/guestfish-actions.pod:3835
13345 "This command is the same as L</pvresize> except that it allows you to "
13346 "specify the new size (in bytes) explicitly."
13350 #: ../fish/guestfish-actions.pod:3838
13355 #: ../fish/guestfish-actions.pod:3840
13363 #: ../fish/guestfish-actions.pod:3842 ../src/guestfs-actions.pod:5870
13365 "List all the physical volumes detected. This is the equivalent of the "
13366 "L<pvs(8)> command."
13370 #: ../fish/guestfish-actions.pod:3845 ../src/guestfs-actions.pod:5873
13372 "This returns a list of just the device names that contain PVs "
13373 "(eg. C</dev/sda2>)."
13377 #: ../fish/guestfish-actions.pod:3848
13378 msgid "See also L</pvs-full>."
13382 #: ../fish/guestfish-actions.pod:3850
13387 #: ../fish/guestfish-actions.pod:3852
13395 #: ../fish/guestfish-actions.pod:3854 ../src/guestfs-actions.pod:5889
13397 "List all the physical volumes detected. This is the equivalent of the "
13398 "L<pvs(8)> command. The \"full\" version includes all fields."
13402 #: ../fish/guestfish-actions.pod:3857
13407 #: ../fish/guestfish-actions.pod:3859
13415 #: ../fish/guestfish-actions.pod:3861 ../src/guestfs-actions.pod:5904
13416 msgid "This command returns the UUID of the LVM PV C<device>."
13420 #: ../fish/guestfish-actions.pod:3863
13425 #: ../fish/guestfish-actions.pod:3865
13428 " pwrite path content offset\n"
13433 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:5920
13435 "This command writes to part of a file. It writes the data buffer C<content> "
13436 "to the file C<path> starting at offset C<offset>."
13440 #: ../fish/guestfish-actions.pod:3870 ../src/guestfs-actions.pod:5923
13442 "This command implements the L<pwrite(2)> system call, and like that system "
13443 "call it may not write the full data requested. The return value is the "
13444 "number of bytes that were actually written to the file. This could even be "
13445 "0, although short writes are unlikely for regular files in ordinary "
13450 #: ../fish/guestfish-actions.pod:3876
13451 msgid "See also L</pread>, L</pwrite-device>."
13455 #: ../fish/guestfish-actions.pod:3881
13456 msgid "pwrite-device"
13460 #: ../fish/guestfish-actions.pod:3883
13463 " pwrite-device device content offset\n"
13468 #: ../fish/guestfish-actions.pod:3885 ../src/guestfs-actions.pod:5947
13470 "This command writes to part of a device. It writes the data buffer "
13471 "C<content> to C<device> starting at offset C<offset>."
13475 #: ../fish/guestfish-actions.pod:3888 ../src/guestfs-actions.pod:5950
13477 "This command implements the L<pwrite(2)> system call, and like that system "
13478 "call it may not write the full data requested (although short writes to disk "
13479 "devices and partitions are probably impossible with standard Linux kernels)."
13483 #: ../fish/guestfish-actions.pod:3893
13484 msgid "See also L</pwrite>."
13488 #: ../fish/guestfish-actions.pod:3898
13493 #: ../fish/guestfish-actions.pod:3900
13496 " read-file path\n"
13501 #: ../fish/guestfish-actions.pod:3902 ../src/guestfs-actions.pod:5971
13502 msgid "This calls returns the contents of the file C<path> as a buffer."
13506 #: ../fish/guestfish-actions.pod:3905
13508 "Unlike L</cat>, this function can correctly handle files that contain "
13509 "embedded ASCII NUL characters. However unlike L</download>, this function "
13510 "is limited in the total size of file that can be handled."
13514 #: ../fish/guestfish-actions.pod:3913
13519 #: ../fish/guestfish-actions.pod:3915
13522 " read-lines path\n"
13527 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:5996
13529 "The file contents are returned as a list of lines. Trailing C<LF> and "
13530 "C<CRLF> character sequences are I<not> returned."
13534 #: ../fish/guestfish-actions.pod:3922
13536 "Note that this function cannot correctly handle binary files (specifically, "
13537 "files containing C<\\0> character which is treated as end of line). For "
13538 "those you need to use the L</read-file> function which has a more complex "
13543 #: ../fish/guestfish-actions.pod:3927
13548 #: ../fish/guestfish-actions.pod:3929
13556 #: ../fish/guestfish-actions.pod:3931 ../src/guestfs-actions.pod:6016
13557 msgid "This returns the list of directory entries in directory C<dir>."
13561 #: ../fish/guestfish-actions.pod:3933 ../src/guestfs-actions.pod:6018
13563 "All entries in the directory are returned, including C<.> and C<..>. The "
13564 "entries are I<not> sorted, but returned in the same order as the underlying "
13569 #: ../fish/guestfish-actions.pod:3937 ../src/guestfs-actions.pod:6022
13571 "Also this call returns basic file type information about each file. The "
13572 "C<ftyp> field will contain one of the following characters:"
13576 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:6027
13581 #: ../fish/guestfish-actions.pod:3944 ../src/guestfs-actions.pod:6029
13582 msgid "Block special"
13586 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:6031
13591 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:6033
13592 msgid "Char special"
13596 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:6035
13601 #: ../fish/guestfish-actions.pod:3952 ../src/guestfs-actions.pod:6037
13606 #: ../fish/guestfish-actions.pod:3954 ../src/guestfs-actions.pod:6039
13611 #: ../fish/guestfish-actions.pod:3956 ../src/guestfs-actions.pod:6041
13612 msgid "FIFO (named pipe)"
13616 #: ../fish/guestfish-actions.pod:3958 ../src/guestfs-actions.pod:6043
13621 #: ../fish/guestfish-actions.pod:3960 ../src/guestfs-actions.pod:6045
13622 msgid "Symbolic link"
13626 #: ../fish/guestfish-actions.pod:3962 ../src/guestfs-actions.pod:6047
13631 #: ../fish/guestfish-actions.pod:3964 ../src/guestfs-actions.pod:6049
13632 msgid "Regular file"
13636 #: ../fish/guestfish-actions.pod:3966 ../src/guestfs-actions.pod:6051
13641 #: ../fish/guestfish-actions.pod:3968 ../src/guestfs-actions.pod:6053
13646 #: ../fish/guestfish-actions.pod:3970 ../src/guestfs-actions.pod:6055
13651 #: ../fish/guestfish-actions.pod:3972 ../src/guestfs-actions.pod:6057
13652 msgid "Unknown file type"
13656 #: ../fish/guestfish-actions.pod:3974 ../src/guestfs-actions.pod:6059
13661 #: ../fish/guestfish-actions.pod:3976 ../src/guestfs-actions.pod:6061
13662 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13666 #: ../fish/guestfish-actions.pod:3981
13668 "This function is primarily intended for use by programs. To get a simple "
13669 "list of names, use L</ls>. To get a printable directory for human "
13670 "consumption, use L</ll>."
13674 #: ../fish/guestfish-actions.pod:3985
13679 #: ../fish/guestfish-actions.pod:3987
13687 #: ../fish/guestfish-actions.pod:3989 ../src/guestfs-actions.pod:6082
13688 msgid "This command reads the target of a symbolic link."
13692 #: ../fish/guestfish-actions.pod:3991
13693 msgid "readlinklist"
13697 #: ../fish/guestfish-actions.pod:3993
13700 " readlinklist path 'names ...'\n"
13705 #: ../fish/guestfish-actions.pod:3995 ../src/guestfs-actions.pod:6096
13707 "This call allows you to do a C<readlink> operation on multiple files, where "
13708 "all files are in the directory C<path>. C<names> is the list of files from "
13713 #: ../fish/guestfish-actions.pod:3999 ../src/guestfs-actions.pod:6100
13715 "On return you get a list of strings, with a one-to-one correspondence to the "
13716 "C<names> list. Each string is the value of the symbolic link."
13720 #: ../fish/guestfish-actions.pod:4003 ../src/guestfs-actions.pod:6104
13722 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13723 "result string is the empty string C<\"\">. However the whole operation is "
13724 "completed even if there were C<readlink(2)> errors, and so you can call this "
13725 "function with names where you don't know if they are symbolic links already "
13726 "(albeit slightly less efficient)."
13730 #: ../fish/guestfish-actions.pod:4010 ../src/guestfs-actions.pod:6111
13732 "This call is intended for programs that want to efficiently list a directory "
13733 "contents without making many round-trips. Very long directory listings "
13734 "might cause the protocol message size to be exceeded, causing this call to "
13735 "fail. The caller must split up such requests into smaller groups of names."
13739 #: ../fish/guestfish-actions.pod:4017
13744 #: ../fish/guestfish-actions.pod:4019
13752 #: ../fish/guestfish-actions.pod:4021 ../src/guestfs-actions.pod:6130
13754 "Return the canonicalized absolute pathname of C<path>. The returned path "
13755 "has no C<.>, C<..> or symbolic link path elements."
13759 #: ../fish/guestfish-actions.pod:4024
13760 msgid "removexattr"
13764 #: ../fish/guestfish-actions.pod:4026
13767 " removexattr xattr path\n"
13772 #: ../fish/guestfish-actions.pod:4028 ../src/guestfs-actions.pod:6145
13773 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
13777 #: ../fish/guestfish-actions.pod:4031
13778 msgid "See also: L</lremovexattr>, L<attr(5)>."
13782 #: ../fish/guestfish-actions.pod:4033
13787 #: ../fish/guestfish-actions.pod:4035
13790 " resize2fs device\n"
13795 #: ../fish/guestfish-actions.pod:4037 ../src/guestfs-actions.pod:6160
13797 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13798 "underlying device."
13802 #: ../fish/guestfish-actions.pod:4040
13804 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
13805 "before calling this command. For unknown reasons C<resize2fs> sometimes "
13806 "gives an error about this and sometimes not. In any case, it is always safe "
13807 "to call L</e2fsck-f> before calling this function."
13811 #: ../fish/guestfish-actions.pod:4046
13812 msgid "resize2fs-M"
13816 #: ../fish/guestfish-actions.pod:4048
13819 " resize2fs-M device\n"
13824 #: ../fish/guestfish-actions.pod:4050
13826 "This command is the same as L</resize2fs>, but the filesystem is resized to "
13827 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
13832 #: ../fish/guestfish-actions.pod:4054
13834 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
13835 "and read the C<Block size> and C<Block count> values. These two numbers, "
13836 "multiplied together, give the resulting size of the minimal filesystem in "
13841 #: ../fish/guestfish-actions.pod:4059
13842 msgid "resize2fs-size"
13846 #: ../fish/guestfish-actions.pod:4061
13849 " resize2fs-size device size\n"
13854 #: ../fish/guestfish-actions.pod:4063
13856 "This command is the same as L</resize2fs> except that it allows you to "
13857 "specify the new size (in bytes) explicitly."
13861 #: ../fish/guestfish-actions.pod:4066
13866 #: ../fish/guestfish-actions.pod:4068
13874 #: ../fish/guestfish-actions.pod:4070 ../src/guestfs-actions.pod:6212
13875 msgid "Remove the single file C<path>."
13879 #: ../fish/guestfish-actions.pod:4072
13884 #: ../fish/guestfish-actions.pod:4074
13892 #: ../fish/guestfish-actions.pod:4076 ../src/guestfs-actions.pod:6224
13894 "Remove the file or directory C<path>, recursively removing the contents if "
13895 "its a directory. This is like the C<rm -rf> shell command."
13899 #: ../fish/guestfish-actions.pod:4080
13904 #: ../fish/guestfish-actions.pod:4082
13912 #: ../fish/guestfish-actions.pod:4084 ../src/guestfs-actions.pod:6238
13913 msgid "Remove the single directory C<path>."
13917 #: ../fish/guestfish-actions.pod:4086
13918 msgid "rmmountpoint"
13922 #: ../fish/guestfish-actions.pod:4088
13925 " rmmountpoint exemptpath\n"
13930 #: ../fish/guestfish-actions.pod:4090
13932 "This calls removes a mountpoint that was previously created with "
13933 "L</mkmountpoint>. See L</mkmountpoint> for full details."
13937 #: ../fish/guestfish-actions.pod:4094
13938 msgid "scrub-device"
13942 #: ../fish/guestfish-actions.pod:4096
13945 " scrub-device device\n"
13950 #: ../fish/guestfish-actions.pod:4098 ../src/guestfs-actions.pod:6264
13952 "This command writes patterns over C<device> to make data retrieval more "
13957 #: ../fish/guestfish-actions.pod:4101 ../fish/guestfish-actions.pod:4116 ../fish/guestfish-actions.pod:4129 ../src/guestfs-actions.pod:6267 ../src/guestfs-actions.pod:6288 ../src/guestfs-actions.pod:6307
13959 "It is an interface to the L<scrub(1)> program. See that manual page for "
13964 #: ../fish/guestfish-actions.pod:4107
13969 #: ../fish/guestfish-actions.pod:4109
13972 " scrub-file file\n"
13977 #: ../fish/guestfish-actions.pod:4111 ../src/guestfs-actions.pod:6283
13979 "This command writes patterns over a file to make data retrieval more "
13984 #: ../fish/guestfish-actions.pod:4114 ../src/guestfs-actions.pod:6286
13985 msgid "The file is I<removed> after scrubbing."
13989 #: ../fish/guestfish-actions.pod:4119
13990 msgid "scrub-freespace"
13994 #: ../fish/guestfish-actions.pod:4121
13997 " scrub-freespace dir\n"
14002 #: ../fish/guestfish-actions.pod:4123
14004 "This command creates the directory C<dir> and then fills it with files until "
14005 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
14006 "deletes them. The intention is to scrub any free space on the partition "
14007 "containing C<dir>."
14011 #: ../fish/guestfish-actions.pod:4132
14016 #: ../fish/guestfish-actions.pod:4134
14021 #: ../fish/guestfish-actions.pod:4136
14024 " set-append append\n"
14029 #: ../fish/guestfish-actions.pod:4138 ../src/guestfs-actions.pod:6320
14031 "This function is used to add additional options to the guest kernel command "
14036 #: ../fish/guestfish-actions.pod:4141 ../src/guestfs-actions.pod:6323
14038 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
14039 "environment variable."
14043 #: ../fish/guestfish-actions.pod:4144 ../src/guestfs-actions.pod:6326
14045 "Setting C<append> to C<NULL> means I<no> additional options are passed "
14046 "(libguestfs always adds a few of its own)."
14050 #: ../fish/guestfish-actions.pod:4147
14051 msgid "set-attach-method"
14055 #: ../fish/guestfish-actions.pod:4149
14056 msgid "attach-method"
14060 #: ../fish/guestfish-actions.pod:4151
14063 " set-attach-method attachmethod\n"
14068 #: ../fish/guestfish-actions.pod:4153 ../src/guestfs-actions.pod:6339
14070 "Set the method that libguestfs uses to connect to the back end guestfsd "
14071 "daemon. Possible methods are:"
14075 #: ../fish/guestfish-actions.pod:4158 ../src/guestfs-actions.pod:6344 ../src/guestfs.pod:2901
14076 msgid "C<appliance>"
14080 #: ../fish/guestfish-actions.pod:4160 ../src/guestfs-actions.pod:6346
14082 "Launch an appliance and connect to it. This is the ordinary method and the "
14087 #: ../fish/guestfish-actions.pod:4163 ../src/guestfs-actions.pod:6349
14088 msgid "C<unix:I<path>>"
14092 #: ../fish/guestfish-actions.pod:4165 ../src/guestfs-actions.pod:6351
14093 msgid "Connect to the Unix domain socket I<path>."
14097 #: ../fish/guestfish-actions.pod:4167 ../src/guestfs-actions.pod:6353
14099 "This method lets you connect to an existing daemon or (using virtio-serial) "
14100 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
14101 "RUNNING DAEMONS>."
14105 #: ../fish/guestfish-actions.pod:4173
14106 msgid "set-autosync"
14110 #: ../fish/guestfish-actions.pod:4175
14115 #: ../fish/guestfish-actions.pod:4177
14118 " set-autosync true|false\n"
14123 #: ../fish/guestfish-actions.pod:4179 ../src/guestfs-actions.pod:6369
14125 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
14126 "effort attempt to make filesystems consistent and synchronized when the "
14127 "handle is closed (also if the program exits without closing handles)."
14131 #: ../fish/guestfish-actions.pod:4184 ../src/guestfs-actions.pod:6374
14133 "This is enabled by default (since libguestfs 1.5.24, previously it was "
14134 "disabled by default)."
14138 #: ../fish/guestfish-actions.pod:4187
14143 #: ../fish/guestfish-actions.pod:4189
14148 #: ../fish/guestfish-actions.pod:4191
14151 " set-direct true|false\n"
14156 #: ../fish/guestfish-actions.pod:4193 ../src/guestfs-actions.pod:6387
14158 "If the direct appliance mode flag is enabled, then stdin and stdout are "
14159 "passed directly through to the appliance once it is launched."
14163 #: ../fish/guestfish-actions.pod:4197
14165 "One consequence of this is that log messages aren't caught by the library "
14166 "and handled by L</set-log-message-callback>, but go straight to stdout."
14170 #: ../fish/guestfish-actions.pod:4201 ../src/guestfs-actions.pod:6395
14171 msgid "You probably don't want to use this unless you know what you are doing."
14175 #: ../fish/guestfish-actions.pod:4204 ../src/guestfs-actions.pod:6398
14176 msgid "The default is disabled."
14180 #: ../fish/guestfish-actions.pod:4206
14181 msgid "set-e2label"
14185 #: ../fish/guestfish-actions.pod:4208
14188 " set-e2label device label\n"
14193 #: ../fish/guestfish-actions.pod:4210 ../src/guestfs-actions.pod:6411
14195 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
14196 "C<label>. Filesystem labels are limited to 16 characters."
14200 #: ../fish/guestfish-actions.pod:4214
14202 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
14203 "label on a filesystem."
14207 #: ../fish/guestfish-actions.pod:4217
14212 #: ../fish/guestfish-actions.pod:4219
14215 " set-e2uuid device uuid\n"
14220 #: ../fish/guestfish-actions.pod:4221 ../src/guestfs-actions.pod:6429
14222 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
14223 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
14224 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
14228 #: ../fish/guestfish-actions.pod:4226
14230 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
14231 "UUID of a filesystem."
14235 #: ../fish/guestfish-actions.pod:4229
14236 msgid "set-memsize"
14240 #: ../fish/guestfish-actions.pod:4231
14245 #: ../fish/guestfish-actions.pod:4233
14248 " set-memsize memsize\n"
14253 #: ../fish/guestfish-actions.pod:4235
14255 "This sets the memory size in megabytes allocated to the qemu subprocess. "
14256 "This only has any effect if called before L</launch>."
14260 #: ../fish/guestfish-actions.pod:4239 ../src/guestfs-actions.pod:6451
14262 "You can also change this by setting the environment variable "
14263 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
14267 #: ../fish/guestfish-actions.pod:4246
14268 msgid "set-network"
14272 #: ../fish/guestfish-actions.pod:4248
14277 #: ../fish/guestfish-actions.pod:4250
14280 " set-network true|false\n"
14285 #: ../fish/guestfish-actions.pod:4252 ../src/guestfs-actions.pod:6468
14287 "If C<network> is true, then the network is enabled in the libguestfs "
14288 "appliance. The default is false."
14292 #: ../fish/guestfish-actions.pod:4255 ../src/guestfs-actions.pod:6471
14294 "This affects whether commands are able to access the network (see "
14295 "L<guestfs(3)/RUNNING COMMANDS>)."
14299 #: ../fish/guestfish-actions.pod:4258
14300 msgid "You must call this before calling L</launch>, otherwise it has no effect."
14304 #: ../fish/guestfish-actions.pod:4261
14309 #: ../fish/guestfish-actions.pod:4265
14312 " set-path searchpath\n"
14317 #: ../fish/guestfish-actions.pod:4267 ../src/guestfs-actions.pod:6487
14318 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14322 #: ../fish/guestfish-actions.pod:4269 ../src/guestfs-actions.pod:6489
14324 "The default is C<$libdir/guestfs> unless overridden by setting "
14325 "C<LIBGUESTFS_PATH> environment variable."
14329 #: ../fish/guestfish-actions.pod:4272 ../src/guestfs-actions.pod:6492
14330 msgid "Setting C<path> to C<NULL> restores the default path."
14334 #: ../fish/guestfish-actions.pod:4274
14339 #: ../fish/guestfish-actions.pod:4276
14344 #: ../fish/guestfish-actions.pod:4278
14347 " set-pgroup true|false\n"
14352 #: ../fish/guestfish-actions.pod:4280 ../src/guestfs-actions.pod:6504
14354 "If C<pgroup> is true, child processes are placed into their own process "
14359 #: ../fish/guestfish-actions.pod:4283 ../src/guestfs-actions.pod:6507
14361 "The practical upshot of this is that signals like C<SIGINT> (from users "
14362 "pressing C<^C>) won't be received by the child process."
14366 #: ../fish/guestfish-actions.pod:4286 ../src/guestfs-actions.pod:6510
14368 "The default for this flag is false, because usually you want C<^C> to kill "
14373 #: ../fish/guestfish-actions.pod:4289
14378 #: ../fish/guestfish-actions.pod:4291
14383 #: ../fish/guestfish-actions.pod:4293
14391 #: ../fish/guestfish-actions.pod:4295 ../src/guestfs-actions.pod:6523
14392 msgid "Set the qemu binary that we will use."
14396 #: ../fish/guestfish-actions.pod:4297 ../src/guestfs-actions.pod:6525
14397 msgid "The default is chosen when the library was compiled by the configure script."
14401 #: ../fish/guestfish-actions.pod:4300 ../src/guestfs-actions.pod:6528
14403 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
14408 #: ../fish/guestfish-actions.pod:4303 ../src/guestfs-actions.pod:6531
14409 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
14413 #: ../fish/guestfish-actions.pod:4305 ../src/guestfs-actions.pod:6533
14415 "Note that you should call this function as early as possible after creating "
14416 "the handle. This is because some pre-launch operations depend on testing "
14417 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
14418 "don't retest features, and so you might see inconsistent results. Using the "
14419 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
14420 "the qemu binary at the same time as the handle is created."
14424 #: ../fish/guestfish-actions.pod:4313
14425 msgid "set-recovery-proc"
14429 #: ../fish/guestfish-actions.pod:4315
14430 msgid "recovery-proc"
14434 #: ../fish/guestfish-actions.pod:4317
14437 " set-recovery-proc true|false\n"
14442 #: ../fish/guestfish-actions.pod:4319
14444 "If this is called with the parameter C<false> then L</launch> does not "
14445 "create a recovery process. The purpose of the recovery process is to stop "
14446 "runaway qemu processes in the case where the main program aborts abruptly."
14450 #: ../fish/guestfish-actions.pod:4324
14452 "This only has any effect if called before L</launch>, and the default is "
14457 #: ../fish/guestfish-actions.pod:4327 ../src/guestfs-actions.pod:6559
14459 "About the only time when you would want to disable this is if the main "
14460 "process will fork itself into the background (\"daemonize\" itself). In "
14461 "this case the recovery process thinks that the main program has disappeared "
14462 "and so kills qemu, which is not very helpful."
14466 #: ../fish/guestfish-actions.pod:4333
14467 msgid "set-selinux"
14471 #: ../fish/guestfish-actions.pod:4335
14476 #: ../fish/guestfish-actions.pod:4337
14479 " set-selinux true|false\n"
14484 #: ../fish/guestfish-actions.pod:4339 ../src/guestfs-actions.pod:6575
14486 "This sets the selinux flag that is passed to the appliance at boot time. "
14487 "The default is C<selinux=0> (disabled)."
14491 #: ../fish/guestfish-actions.pod:4342 ../src/guestfs-actions.pod:6578
14493 "Note that if SELinux is enabled, it is always in Permissive mode "
14494 "(C<enforcing=0>)."
14498 #: ../fish/guestfish-actions.pod:4348
14503 #: ../fish/guestfish-actions.pod:4350
14508 #: ../fish/guestfish-actions.pod:4352
14516 #: ../fish/guestfish-actions.pod:4354 ../src/guestfs-actions.pod:6594
14518 "Change the number of virtual CPUs assigned to the appliance. The default is "
14519 "C<1>. Increasing this may improve performance, though often it has no "
14524 #: ../fish/guestfish-actions.pod:4358
14525 msgid "This function must be called before L</launch>."
14529 #: ../fish/guestfish-actions.pod:4360
14534 #: ../fish/guestfish-actions.pod:4362
14539 #: ../fish/guestfish-actions.pod:4364
14542 " set-trace true|false\n"
14547 #: ../fish/guestfish-actions.pod:4366 ../src/guestfs-actions.pod:6610
14549 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
14550 "return values are traced."
14554 #: ../fish/guestfish-actions.pod:4369 ../src/guestfs-actions.pod:6613
14556 "If you want to trace C API calls into libguestfs (and other libraries) then "
14557 "possibly a better way is to use the external ltrace(1) command."
14561 #: ../fish/guestfish-actions.pod:4373 ../src/guestfs-actions.pod:6617
14563 "Command traces are disabled unless the environment variable "
14564 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14568 #: ../fish/guestfish-actions.pod:4376
14570 "Trace messages are normally sent to C<stderr>, unless you register a "
14571 "callback to send them somewhere else (see L</set-event-callback>)."
14575 #: ../fish/guestfish-actions.pod:4380
14576 msgid "set-verbose"
14580 #: ../fish/guestfish-actions.pod:4382
14585 #: ../fish/guestfish-actions.pod:4384
14588 " set-verbose true|false\n"
14593 #: ../fish/guestfish-actions.pod:4386 ../src/guestfs-actions.pod:6634
14594 msgid "If C<verbose> is true, this turns on verbose messages."
14598 #: ../fish/guestfish-actions.pod:4388 ../src/guestfs-actions.pod:6636
14600 "Verbose messages are disabled unless the environment variable "
14601 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14605 #: ../fish/guestfish-actions.pod:4391
14607 "Verbose messages are normally sent to C<stderr>, unless you register a "
14608 "callback to send them somewhere else (see L</set-event-callback>)."
14612 #: ../fish/guestfish-actions.pod:4395
14617 #: ../fish/guestfish-actions.pod:4397
14620 " setcon context\n"
14625 #: ../fish/guestfish-actions.pod:4399 ../src/guestfs-actions.pod:6653
14627 "This sets the SELinux security context of the daemon to the string "
14632 #: ../fish/guestfish-actions.pod:4402 ../src/guestfs-actions.pod:6656
14633 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14637 #: ../fish/guestfish-actions.pod:4404
14642 #: ../fish/guestfish-actions.pod:4406
14645 " setxattr xattr val vallen path\n"
14650 #: ../fish/guestfish-actions.pod:4408 ../src/guestfs-actions.pod:6671
14652 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14653 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14657 #: ../fish/guestfish-actions.pod:4412
14658 msgid "See also: L</lsetxattr>, L<attr(5)>."
14662 #: ../fish/guestfish-actions.pod:4414
14667 #: ../fish/guestfish-actions.pod:4416
14670 " sfdisk device cyls heads sectors 'lines ...'\n"
14675 #: ../fish/guestfish-actions.pod:4418 ../src/guestfs-actions.pod:6698
14677 "This is a direct interface to the L<sfdisk(8)> program for creating "
14678 "partitions on block devices."
14682 #: ../fish/guestfish-actions.pod:4421 ../src/guestfs-actions.pod:6701
14683 msgid "C<device> should be a block device, for example C</dev/sda>."
14687 #: ../fish/guestfish-actions.pod:4423 ../src/guestfs-actions.pod:6703
14689 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14690 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
14691 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14692 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14693 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14694 "the kernel) cannot work out the right geometry and you will need to tell it."
14698 #: ../fish/guestfish-actions.pod:4431 ../src/guestfs-actions.pod:6711
14700 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14701 "refer to the L<sfdisk(8)> manpage."
14705 #: ../fish/guestfish-actions.pod:4434 ../src/guestfs-actions.pod:6714
14707 "To create a single partition occupying the whole disk, you would pass "
14708 "C<lines> as a single element list, when the single element being the string "
14713 #: ../fish/guestfish-actions.pod:4438
14714 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
14718 #: ../fish/guestfish-actions.pod:4444 ../fish/guestfish-actions.pod:4467 ../fish/guestfish-actions.pod:4489
14720 "I<This function is deprecated.> In new code, use the L</part_add> call "
14725 #: ../fish/guestfish-actions.pod:4451
14730 #: ../fish/guestfish-actions.pod:4453
14733 " sfdiskM device 'lines ...'\n"
14738 #: ../fish/guestfish-actions.pod:4455
14740 "This is a simplified interface to the L</sfdisk> command, where partition "
14741 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
14742 "you don't need to specify the cyls, heads and sectors parameters which were "
14743 "rarely if ever used anyway."
14747 #: ../fish/guestfish-actions.pod:4461
14748 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
14752 #: ../fish/guestfish-actions.pod:4474
14757 #: ../fish/guestfish-actions.pod:4476
14760 " sfdisk-N device partnum cyls heads sectors line\n"
14765 #: ../fish/guestfish-actions.pod:4478 ../src/guestfs-actions.pod:6776
14767 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14768 "(note: C<n> counts from 1)."
14772 #: ../fish/guestfish-actions.pod:4481
14774 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
14775 "cyls/heads/sectors parameters."
14779 #: ../fish/guestfish-actions.pod:4484
14780 msgid "See also: L</part-add>"
14784 #: ../fish/guestfish-actions.pod:4496
14785 msgid "sfdisk-disk-geometry"
14789 #: ../fish/guestfish-actions.pod:4498
14792 " sfdisk-disk-geometry device\n"
14797 #: ../fish/guestfish-actions.pod:4500
14799 "This displays the disk geometry of C<device> read from the partition table. "
14800 "Especially in the case where the underlying block device has been resized, "
14801 "this can be different from the kernel's idea of the geometry (see "
14802 "L</sfdisk-kernel-geometry>)."
14806 #: ../fish/guestfish-actions.pod:4505 ../fish/guestfish-actions.pod:4514 ../src/guestfs-actions.pod:6802 ../src/guestfs-actions.pod:6818
14807 msgid "The result is in human-readable format, and not designed to be parsed."
14811 #: ../fish/guestfish-actions.pod:4508
14812 msgid "sfdisk-kernel-geometry"
14816 #: ../fish/guestfish-actions.pod:4510
14819 " sfdisk-kernel-geometry device\n"
14824 #: ../fish/guestfish-actions.pod:4512 ../src/guestfs-actions.pod:6816
14825 msgid "This displays the kernel's idea of the geometry of C<device>."
14829 #: ../fish/guestfish-actions.pod:4517
14834 #: ../fish/guestfish-actions.pod:4519
14837 " sfdisk-l device\n"
14842 #: ../fish/guestfish-actions.pod:4521 ../src/guestfs-actions.pod:6839
14844 "This displays the partition table on C<device>, in the human-readable output "
14845 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14849 #: ../fish/guestfish-actions.pod:4525
14850 msgid "See also: L</part-list>"
14854 #: ../fish/guestfish-actions.pod:4527
14856 "I<This function is deprecated.> In new code, use the L</part_list> call "
14861 #: ../fish/guestfish-actions.pod:4534
14866 #: ../fish/guestfish-actions.pod:4536
14874 #: ../fish/guestfish-actions.pod:4538 ../src/guestfs-actions.pod:6856
14876 "This call runs a command from the guest filesystem via the guest's "
14881 #: ../fish/guestfish-actions.pod:4541
14882 msgid "This is like L</command>, but passes the command to:"
14886 #: ../fish/guestfish-actions.pod:4543 ../src/guestfs-actions.pod:6861
14889 " /bin/sh -c \"command\"\n"
14894 #: ../fish/guestfish-actions.pod:4545 ../src/guestfs-actions.pod:6863
14896 "Depending on the guest's shell, this usually results in wildcards being "
14897 "expanded, shell expressions being interpolated and so on."
14901 #: ../fish/guestfish-actions.pod:4549
14902 msgid "All the provisos about L</command> apply to this call."
14906 #: ../fish/guestfish-actions.pod:4551
14911 #: ../fish/guestfish-actions.pod:4553
14914 " sh-lines command\n"
14919 #: ../fish/guestfish-actions.pod:4555
14920 msgid "This is the same as L</sh>, but splits the result into a list of lines."
14924 #: ../fish/guestfish-actions.pod:4558
14925 msgid "See also: L</command-lines>"
14929 #: ../fish/guestfish-actions.pod:4560
14934 #: ../fish/guestfish-actions.pod:4562
14942 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:6897
14943 msgid "Sleep for C<secs> seconds."
14947 #: ../fish/guestfish-actions.pod:4566
14952 #: ../fish/guestfish-actions.pod:4568
14960 #: ../fish/guestfish-actions.pod:4572 ../src/guestfs-actions.pod:6911
14961 msgid "This is the same as the C<stat(2)> system call."
14965 #: ../fish/guestfish-actions.pod:4574
14970 #: ../fish/guestfish-actions.pod:4576
14978 #: ../fish/guestfish-actions.pod:4578 ../src/guestfs-actions.pod:6925
14980 "Returns file system statistics for any mounted file system. C<path> should "
14981 "be a file or directory in the mounted file system (typically it is the mount "
14982 "point itself, but it doesn't need to be)."
14986 #: ../fish/guestfish-actions.pod:4582 ../src/guestfs-actions.pod:6929
14987 msgid "This is the same as the C<statvfs(2)> system call."
14991 #: ../fish/guestfish-actions.pod:4584
14996 #: ../fish/guestfish-actions.pod:4586
15004 #: ../fish/guestfish-actions.pod:4588 ../src/guestfs-actions.pod:6943
15006 "This runs the L<strings(1)> command on a file and returns the list of "
15007 "printable strings found."
15011 #: ../fish/guestfish-actions.pod:4594
15016 #: ../fish/guestfish-actions.pod:4596
15019 " strings-e encoding path\n"
15024 #: ../fish/guestfish-actions.pod:4598
15026 "This is like the L</strings> command, but allows you to specify the encoding "
15027 "of strings that are looked for in the source file C<path>."
15031 #: ../fish/guestfish-actions.pod:4602 ../src/guestfs-actions.pod:6966
15032 msgid "Allowed encodings are:"
15036 #: ../fish/guestfish-actions.pod:4606 ../src/guestfs-actions.pod:6970
15041 #: ../fish/guestfish-actions.pod:4608
15043 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
15044 "ISO-8859-X (this is what L</strings> uses)."
15048 #: ../fish/guestfish-actions.pod:4611 ../src/guestfs-actions.pod:6975
15053 #: ../fish/guestfish-actions.pod:4613 ../src/guestfs-actions.pod:6977
15054 msgid "Single 8-bit-byte characters."
15058 #: ../fish/guestfish-actions.pod:4615 ../src/guestfs-actions.pod:6979
15063 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6981
15064 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
15068 #: ../fish/guestfish-actions.pod:4620 ../src/guestfs-actions.pod:6984
15069 msgid "l (lower case letter L)"
15073 #: ../fish/guestfish-actions.pod:4622 ../src/guestfs-actions.pod:6986
15075 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
15076 "examining binaries in Windows guests."
15080 #: ../fish/guestfish-actions.pod:4625 ../src/guestfs-actions.pod:6989
15085 #: ../fish/guestfish-actions.pod:4627 ../src/guestfs-actions.pod:6991
15086 msgid "32-bit big endian such as UCS-4BE."
15090 #: ../fish/guestfish-actions.pod:4629 ../src/guestfs-actions.pod:6993
15095 #: ../fish/guestfish-actions.pod:4631 ../src/guestfs-actions.pod:6995
15096 msgid "32-bit little endian such as UCS-4LE."
15100 #: ../fish/guestfish-actions.pod:4635 ../src/guestfs-actions.pod:6999
15101 msgid "The returned strings are transcoded to UTF-8."
15105 #: ../fish/guestfish-actions.pod:4640
15106 msgid "swapoff-device"
15110 #: ../fish/guestfish-actions.pod:4642
15113 " swapoff-device device\n"
15118 #: ../fish/guestfish-actions.pod:4644
15120 "This command disables the libguestfs appliance swap device or partition "
15121 "named C<device>. See L</swapon-device>."
15125 #: ../fish/guestfish-actions.pod:4648
15126 msgid "swapoff-file"
15130 #: ../fish/guestfish-actions.pod:4650
15133 " swapoff-file file\n"
15138 #: ../fish/guestfish-actions.pod:4652 ../src/guestfs-actions.pod:7030
15139 msgid "This command disables the libguestfs appliance swap on file."
15143 #: ../fish/guestfish-actions.pod:4654
15144 msgid "swapoff-label"
15148 #: ../fish/guestfish-actions.pod:4656
15151 " swapoff-label label\n"
15156 #: ../fish/guestfish-actions.pod:4658 ../src/guestfs-actions.pod:7042
15158 "This command disables the libguestfs appliance swap on labeled swap "
15163 #: ../fish/guestfish-actions.pod:4661
15164 msgid "swapoff-uuid"
15168 #: ../fish/guestfish-actions.pod:4663
15171 " swapoff-uuid uuid\n"
15176 #: ../fish/guestfish-actions.pod:4665 ../src/guestfs-actions.pod:7055
15178 "This command disables the libguestfs appliance swap partition with the given "
15183 #: ../fish/guestfish-actions.pod:4668
15184 msgid "swapon-device"
15188 #: ../fish/guestfish-actions.pod:4670
15191 " swapon-device device\n"
15196 #: ../fish/guestfish-actions.pod:4672
15198 "This command enables the libguestfs appliance to use the swap device or "
15199 "partition named C<device>. The increased memory is made available for all "
15200 "commands, for example those run using L</command> or L</sh>."
15204 #: ../fish/guestfish-actions.pod:4677 ../src/guestfs-actions.pod:7073
15206 "Note that you should not swap to existing guest swap partitions unless you "
15207 "know what you are doing. They may contain hibernation information, or other "
15208 "information that the guest doesn't want you to trash. You also risk leaking "
15209 "information about the host to the guest this way. Instead, attach a new "
15210 "host device to the guest and swap on that."
15214 #: ../fish/guestfish-actions.pod:4684
15215 msgid "swapon-file"
15219 #: ../fish/guestfish-actions.pod:4686
15222 " swapon-file file\n"
15227 #: ../fish/guestfish-actions.pod:4688
15228 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
15232 #: ../fish/guestfish-actions.pod:4691
15233 msgid "swapon-label"
15237 #: ../fish/guestfish-actions.pod:4693
15240 " swapon-label label\n"
15245 #: ../fish/guestfish-actions.pod:4695
15247 "This command enables swap to a labeled swap partition. See "
15248 "L</swapon-device> for other notes."
15252 #: ../fish/guestfish-actions.pod:4698
15253 msgid "swapon-uuid"
15257 #: ../fish/guestfish-actions.pod:4700
15260 " swapon-uuid uuid\n"
15265 #: ../fish/guestfish-actions.pod:4702
15267 "This command enables swap to a swap partition with the given UUID. See "
15268 "L</swapon-device> for other notes."
15272 #: ../fish/guestfish-actions.pod:4705
15277 #: ../fish/guestfish-actions.pod:4707
15285 #: ../fish/guestfish-actions.pod:4709 ../src/guestfs-actions.pod:7128
15287 "This syncs the disk, so that any writes are flushed through to the "
15288 "underlying disk image."
15292 #: ../fish/guestfish-actions.pod:4712 ../src/guestfs-actions.pod:7131
15294 "You should always call this if you have modified a disk image, before "
15295 "closing the handle."
15299 #: ../fish/guestfish-actions.pod:4715
15304 #: ../fish/guestfish-actions.pod:4717
15312 #: ../fish/guestfish-actions.pod:4719 ../src/guestfs-actions.pod:7144
15313 msgid "This command returns up to the last 10 lines of a file as a list of strings."
15317 #: ../fish/guestfish-actions.pod:4725
15322 #: ../fish/guestfish-actions.pod:4727
15325 " tail-n nrlines path\n"
15330 #: ../fish/guestfish-actions.pod:4729 ../src/guestfs-actions.pod:7163
15332 "If the parameter C<nrlines> is a positive number, this returns the last "
15333 "C<nrlines> lines of the file C<path>."
15337 #: ../fish/guestfish-actions.pod:4732 ../src/guestfs-actions.pod:7166
15339 "If the parameter C<nrlines> is a negative number, this returns lines from "
15340 "the file C<path>, starting with the C<-nrlines>th line."
15344 #: ../fish/guestfish-actions.pod:4740
15349 #: ../fish/guestfish-actions.pod:4742
15352 " tar-in (tarfile|-) directory\n"
15357 #: ../fish/guestfish-actions.pod:4744 ../src/guestfs-actions.pod:7187
15359 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
15360 "tar file) into C<directory>."
15364 #: ../fish/guestfish-actions.pod:4747
15365 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
15369 #: ../fish/guestfish-actions.pod:4752
15374 #: ../fish/guestfish-actions.pod:4754
15377 " tar-out directory (tarfile|-)\n"
15382 #: ../fish/guestfish-actions.pod:4756 ../src/guestfs-actions.pod:7204
15384 "This command packs the contents of C<directory> and downloads it to local "
15389 #: ../fish/guestfish-actions.pod:4759
15390 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
15394 #: ../fish/guestfish-actions.pod:4764
15399 #: ../fish/guestfish-actions.pod:4766
15402 " tgz-in (tarball|-) directory\n"
15407 #: ../fish/guestfish-actions.pod:4768 ../src/guestfs-actions.pod:7221
15409 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
15410 "tar file) into C<directory>."
15414 #: ../fish/guestfish-actions.pod:4771
15415 msgid "To upload an uncompressed tarball, use L</tar-in>."
15419 #: ../fish/guestfish-actions.pod:4775
15424 #: ../fish/guestfish-actions.pod:4777
15427 " tgz-out directory (tarball|-)\n"
15432 #: ../fish/guestfish-actions.pod:4779 ../src/guestfs-actions.pod:7237
15434 "This command packs the contents of C<directory> and downloads it to local "
15439 #: ../fish/guestfish-actions.pod:4782
15440 msgid "To download an uncompressed tarball, use L</tar-out>."
15444 #: ../fish/guestfish-actions.pod:4786
15449 #: ../fish/guestfish-actions.pod:4788
15457 #: ../fish/guestfish-actions.pod:4790 ../src/guestfs-actions.pod:7252
15459 "Touch acts like the L<touch(1)> command. It can be used to update the "
15460 "timestamps on a file, or, if the file does not exist, to create a new "
15461 "zero-length file."
15465 #: ../fish/guestfish-actions.pod:4794 ../src/guestfs-actions.pod:7256
15467 "This command only works on regular files, and will fail on other file types "
15468 "such as directories, symbolic links, block special etc."
15472 #: ../fish/guestfish-actions.pod:4797
15477 #: ../fish/guestfish-actions.pod:4799
15485 #: ../fish/guestfish-actions.pod:4801 ../src/guestfs-actions.pod:7269
15487 "This command truncates C<path> to a zero-length file. The file must exist "
15492 #: ../fish/guestfish-actions.pod:4804
15493 msgid "truncate-size"
15497 #: ../fish/guestfish-actions.pod:4806
15500 " truncate-size path size\n"
15505 #: ../fish/guestfish-actions.pod:4808 ../src/guestfs-actions.pod:7283
15507 "This command truncates C<path> to size C<size> bytes. The file must exist "
15512 #: ../fish/guestfish-actions.pod:4811
15514 "If the current file size is less than C<size> then the file is extended to "
15515 "the required size with zero bytes. This creates a sparse file (ie. disk "
15516 "blocks are not allocated for the file until you write to it). To create a "
15517 "non-sparse file of zeroes, use L</fallocate64> instead."
15521 #: ../fish/guestfish-actions.pod:4817
15526 #: ../fish/guestfish-actions.pod:4819
15529 " tune2fs-l device\n"
15534 #: ../fish/guestfish-actions.pod:4821 ../src/guestfs-actions.pod:7302
15536 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15541 #: ../fish/guestfish-actions.pod:4824 ../src/guestfs-actions.pod:7305
15543 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15544 "for more details. The list of fields returned isn't clearly defined, and "
15545 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15546 "and the filesystem itself."
15550 #: ../fish/guestfish-actions.pod:4829
15555 #: ../fish/guestfish-actions.pod:4831
15558 " txz-in (tarball|-) directory\n"
15563 #: ../fish/guestfish-actions.pod:4833 ../src/guestfs-actions.pod:7325
15565 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15566 "tar file) into C<directory>."
15570 #: ../fish/guestfish-actions.pod:4838
15575 #: ../fish/guestfish-actions.pod:4840
15578 " txz-out directory (tarball|-)\n"
15583 #: ../fish/guestfish-actions.pod:4842 ../src/guestfs-actions.pod:7339
15585 "This command packs the contents of C<directory> and downloads it to local "
15586 "file C<tarball> (as an xz compressed tar archive)."
15590 #: ../fish/guestfish-actions.pod:4847
15595 #: ../fish/guestfish-actions.pod:4849
15603 #: ../fish/guestfish-actions.pod:4851 ../src/guestfs-actions.pod:7352
15605 "This function sets the mask used for creating new files and device nodes to "
15610 #: ../fish/guestfish-actions.pod:4854 ../src/guestfs-actions.pod:7355
15612 "Typical umask values would be C<022> which creates new files with "
15613 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15614 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15618 #: ../fish/guestfish-actions.pod:4859 ../src/guestfs-actions.pod:7360
15620 "The default umask is C<022>. This is important because it means that "
15621 "directories and device nodes will be created with C<0644> or C<0755> mode "
15622 "even if you specify C<0777>."
15626 #: ../fish/guestfish-actions.pod:4863
15627 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
15631 #: ../fish/guestfish-actions.pod:4866 ../src/guestfs-actions.pod:7367
15632 msgid "This call returns the previous umask."
15636 #: ../fish/guestfish-actions.pod:4868
15641 #: ../fish/guestfish-actions.pod:4870
15646 #: ../fish/guestfish-actions.pod:4872
15649 " umount pathordevice\n"
15654 #: ../fish/guestfish-actions.pod:4874 ../src/guestfs-actions.pod:7379
15656 "This unmounts the given filesystem. The filesystem may be specified either "
15657 "by its mountpoint (path) or the device which contains the filesystem."
15661 #: ../fish/guestfish-actions.pod:4878
15666 #: ../fish/guestfish-actions.pod:4880
15667 msgid "unmount-all"
15671 #: ../fish/guestfish-actions.pod:4882
15679 #: ../fish/guestfish-actions.pod:4884 ../src/guestfs-actions.pod:7392
15680 msgid "This unmounts all mounted filesystems."
15684 #: ../fish/guestfish-actions.pod:4886 ../src/guestfs-actions.pod:7394
15685 msgid "Some internal mounts are not unmounted by this call."
15689 #: ../fish/guestfish-actions.pod:4888
15694 #: ../fish/guestfish-actions.pod:4890
15697 " upload (filename|-) remotefilename\n"
15702 #: ../fish/guestfish-actions.pod:4892 ../fish/guestfish-actions.pod:4905 ../src/guestfs-actions.pod:7407 ../src/guestfs-actions.pod:7431
15703 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15707 #: ../fish/guestfish-actions.pod:4897
15708 msgid "See also L</download>."
15712 #: ../fish/guestfish-actions.pod:4901
15713 msgid "upload-offset"
15717 #: ../fish/guestfish-actions.pod:4903
15720 " upload-offset (filename|-) remotefilename offset\n"
15725 #: ../fish/guestfish-actions.pod:4908 ../src/guestfs-actions.pod:7434
15727 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15728 "The intention is to overwrite parts of existing files or devices, although "
15729 "if a non-existant file is specified then it is created with a \"hole\" "
15730 "before C<offset>. The size of the data written is implicit in the size of "
15731 "the source C<filename>."
15735 #: ../fish/guestfish-actions.pod:4915
15737 "Note that there is no limit on the amount of data that can be uploaded with "
15738 "this call, unlike with L</pwrite>, and this call always writes the full "
15739 "amount unless an error occurs."
15743 #: ../fish/guestfish-actions.pod:4920
15744 msgid "See also L</upload>, L</pwrite>."
15748 #: ../fish/guestfish-actions.pod:4924
15753 #: ../fish/guestfish-actions.pod:4926
15756 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
15761 #: ../fish/guestfish-actions.pod:4928 ../src/guestfs-actions.pod:7467
15762 msgid "This command sets the timestamps of a file with nanosecond precision."
15766 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7470
15768 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15773 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7473
15775 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15776 "nanoseconds from the epoch."
15780 #: ../fish/guestfish-actions.pod:4937 ../src/guestfs-actions.pod:7476
15782 "If the C<*nsecs> field contains the special value C<-1> then the "
15783 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15784 "ignored in this case)."
15788 #: ../fish/guestfish-actions.pod:4941 ../src/guestfs-actions.pod:7480
15790 "If the C<*nsecs> field contains the special value C<-2> then the "
15791 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15796 #: ../fish/guestfish-actions.pod:4945
15801 #: ../fish/guestfish-actions.pod:4947
15809 #: ../fish/guestfish-actions.pod:4949 ../src/guestfs-actions.pod:7493
15810 msgid "Return the libguestfs version number that the program is linked against."
15814 #: ../fish/guestfish-actions.pod:4952 ../src/guestfs-actions.pod:7496
15816 "Note that because of dynamic linking this is not necessarily the version of "
15817 "libguestfs that you compiled against. You can compile the program, and then "
15818 "at runtime dynamically link against a completely different C<libguestfs.so> "
15823 #: ../fish/guestfish-actions.pod:4957 ../src/guestfs-actions.pod:7501
15825 "This call was added in version C<1.0.58>. In previous versions of "
15826 "libguestfs there was no way to get the version number. From C code you can "
15827 "use dynamic linker functions to find out if this symbol exists (if it "
15828 "doesn't, then it's an earlier version)."
15832 #: ../fish/guestfish-actions.pod:4963 ../src/guestfs-actions.pod:7507
15834 "The call returns a structure with four elements. The first three (C<major>, "
15835 "C<minor> and C<release>) are numbers and correspond to the usual version "
15836 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15837 "but may be used for distro-specific information."
15841 #: ../fish/guestfish-actions.pod:4969 ../src/guestfs-actions.pod:7513
15842 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
15846 #: ../fish/guestfish-actions.pod:4972 ../src/guestfs-actions.pod:7516
15847 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15851 #: ../fish/guestfish-actions.pod:4974
15853 "I<Note:> Don't use this call to test for availability of features. In "
15854 "enterprise distributions we backport features from later versions into "
15855 "earlier versions, making this an unreliable way to test for features. Use "
15856 "L</available> instead."
15860 #: ../fish/guestfish-actions.pod:4980
15865 #: ../fish/guestfish-actions.pod:4982
15868 " vfs-label device\n"
15873 #: ../fish/guestfish-actions.pod:4984 ../src/guestfs-actions.pod:7536
15874 msgid "This returns the filesystem label of the filesystem on C<device>."
15878 #: ../fish/guestfish-actions.pod:4987 ../src/guestfs-actions.pod:7539
15879 msgid "If the filesystem is unlabeled, this returns the empty string."
15883 #: ../fish/guestfish-actions.pod:4989
15884 msgid "To find a filesystem from the label, use L</findfs-label>."
15888 #: ../fish/guestfish-actions.pod:4991
15893 #: ../fish/guestfish-actions.pod:4993
15896 " vfs-type device\n"
15901 #: ../fish/guestfish-actions.pod:4995 ../src/guestfs-actions.pod:7554
15903 "This command gets the filesystem type corresponding to the filesystem on "
15908 #: ../fish/guestfish-actions.pod:4998 ../src/guestfs-actions.pod:7557
15910 "For most filesystems, the result is the name of the Linux VFS module which "
15911 "would be used to mount this filesystem if you mounted it without specifying "
15912 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15916 #: ../fish/guestfish-actions.pod:5003
15921 #: ../fish/guestfish-actions.pod:5005
15924 " vfs-uuid device\n"
15929 #: ../fish/guestfish-actions.pod:5007 ../src/guestfs-actions.pod:7573
15930 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15934 #: ../fish/guestfish-actions.pod:5010 ../src/guestfs-actions.pod:7576
15935 msgid "If the filesystem does not have a UUID, this returns the empty string."
15939 #: ../fish/guestfish-actions.pod:5012
15940 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
15944 #: ../fish/guestfish-actions.pod:5014
15945 msgid "vg-activate"
15949 #: ../fish/guestfish-actions.pod:5016
15952 " vg-activate true|false 'volgroups ...'\n"
15957 #: ../fish/guestfish-actions.pod:5018 ../src/guestfs-actions.pod:7592
15959 "This command activates or (if C<activate> is false) deactivates all logical "
15960 "volumes in the listed volume groups C<volgroups>."
15964 #: ../fish/guestfish-actions.pod:5021 ../src/guestfs-actions.pod:7595
15965 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15969 #: ../fish/guestfish-actions.pod:5023 ../src/guestfs-actions.pod:7597
15971 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15972 "activated or deactivated."
15976 #: ../fish/guestfish-actions.pod:5026
15977 msgid "vg-activate-all"
15981 #: ../fish/guestfish-actions.pod:5028
15984 " vg-activate-all true|false\n"
15989 #: ../fish/guestfish-actions.pod:5030 ../src/guestfs-actions.pod:7610
15991 "This command activates or (if C<activate> is false) deactivates all logical "
15992 "volumes in all volume groups."
15996 #: ../fish/guestfish-actions.pod:5033 ../src/guestfs-actions.pod:7613
15997 msgid "This command is the same as running C<vgchange -a y|n>"
16001 #: ../fish/guestfish-actions.pod:5035
16006 #: ../fish/guestfish-actions.pod:5037
16009 " vgcreate volgroup 'physvols ...'\n"
16014 #: ../fish/guestfish-actions.pod:5039 ../src/guestfs-actions.pod:7626
16016 "This creates an LVM volume group called C<volgroup> from the non-empty list "
16017 "of physical volumes C<physvols>."
16021 #: ../fish/guestfish-actions.pod:5042
16026 #: ../fish/guestfish-actions.pod:5044
16029 " vglvuuids vgname\n"
16034 #: ../fish/guestfish-actions.pod:5046 ../src/guestfs-actions.pod:7639
16036 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
16037 "volumes created in this volume group."
16041 #: ../fish/guestfish-actions.pod:5049
16043 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
16044 "logical volumes and volume groups."
16048 #: ../fish/guestfish-actions.pod:5052
16049 msgid "See also L</vgpvuuids>."
16053 #: ../fish/guestfish-actions.pod:5054
16058 #: ../fish/guestfish-actions.pod:5056
16061 " vgpvuuids vgname\n"
16066 #: ../fish/guestfish-actions.pod:5058 ../src/guestfs-actions.pod:7659
16068 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
16069 "volumes that this volume group resides on."
16073 #: ../fish/guestfish-actions.pod:5061
16075 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
16076 "physical volumes and volume groups."
16080 #: ../fish/guestfish-actions.pod:5064
16081 msgid "See also L</vglvuuids>."
16085 #: ../fish/guestfish-actions.pod:5066
16090 #: ../fish/guestfish-actions.pod:5068
16093 " vgremove vgname\n"
16098 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7679
16099 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
16103 #: ../fish/guestfish-actions.pod:5072 ../src/guestfs-actions.pod:7681
16104 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
16108 #: ../fish/guestfish-actions.pod:5075
16113 #: ../fish/guestfish-actions.pod:5077
16116 " vgrename volgroup newvolgroup\n"
16121 #: ../fish/guestfish-actions.pod:5079 ../src/guestfs-actions.pod:7695
16122 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
16126 #: ../fish/guestfish-actions.pod:5081
16131 #: ../fish/guestfish-actions.pod:5083
16139 #: ../fish/guestfish-actions.pod:5085 ../src/guestfs-actions.pod:7706
16141 "List all the volumes groups detected. This is the equivalent of the "
16142 "L<vgs(8)> command."
16146 #: ../fish/guestfish-actions.pod:5088 ../src/guestfs-actions.pod:7709
16148 "This returns a list of just the volume group names that were detected "
16149 "(eg. C<VolGroup00>)."
16153 #: ../fish/guestfish-actions.pod:5091
16154 msgid "See also L</vgs-full>."
16158 #: ../fish/guestfish-actions.pod:5093
16163 #: ../fish/guestfish-actions.pod:5095
16171 #: ../fish/guestfish-actions.pod:5097 ../src/guestfs-actions.pod:7725
16173 "List all the volumes groups detected. This is the equivalent of the "
16174 "L<vgs(8)> command. The \"full\" version includes all fields."
16178 #: ../fish/guestfish-actions.pod:5100
16183 #: ../fish/guestfish-actions.pod:5102
16191 #: ../fish/guestfish-actions.pod:5104 ../src/guestfs-actions.pod:7739
16193 "This rescans all block devices and rebuilds the list of LVM physical "
16194 "volumes, volume groups and logical volumes."
16198 #: ../fish/guestfish-actions.pod:5107
16203 #: ../fish/guestfish-actions.pod:5109
16211 #: ../fish/guestfish-actions.pod:5111 ../src/guestfs-actions.pod:7752
16212 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16216 #: ../fish/guestfish-actions.pod:5113
16221 #: ../fish/guestfish-actions.pod:5115
16229 #: ../fish/guestfish-actions.pod:5117 ../src/guestfs-actions.pod:7792
16231 "This command counts the characters in a file, using the C<wc -c> external "
16236 #: ../fish/guestfish-actions.pod:5120
16241 #: ../fish/guestfish-actions.pod:5122
16249 #: ../fish/guestfish-actions.pod:5124 ../src/guestfs-actions.pod:7805
16251 "This command counts the lines in a file, using the C<wc -l> external "
16256 #: ../fish/guestfish-actions.pod:5127
16261 #: ../fish/guestfish-actions.pod:5129
16269 #: ../fish/guestfish-actions.pod:5131 ../src/guestfs-actions.pod:7818
16271 "This command counts the words in a file, using the C<wc -w> external "
16276 #: ../fish/guestfish-actions.pod:5134
16281 #: ../fish/guestfish-actions.pod:5136
16284 " write path content\n"
16289 #: ../fish/guestfish-actions.pod:5138 ../src/guestfs-actions.pod:7833
16291 "This call creates a file called C<path>. The content of the file is the "
16292 "string C<content> (which can contain any 8 bit data)."
16296 #: ../fish/guestfish-actions.pod:5141
16297 msgid "See also L</write-append>."
16301 #: ../fish/guestfish-actions.pod:5146
16302 msgid "write-append"
16306 #: ../fish/guestfish-actions.pod:5148
16309 " write-append path content\n"
16314 #: ../fish/guestfish-actions.pod:5150 ../src/guestfs-actions.pod:7853
16316 "This call appends C<content> to the end of file C<path>. If C<path> does "
16317 "not exist, then a new file is created."
16321 #: ../fish/guestfish-actions.pod:5153
16322 msgid "See also L</write>."
16326 #: ../fish/guestfish-actions.pod:5158
16331 #: ../fish/guestfish-actions.pod:5160
16334 " write-file path content size\n"
16339 #: ../fish/guestfish-actions.pod:5162 ../src/guestfs-actions.pod:7880
16341 "This call creates a file called C<path>. The contents of the file is the "
16342 "string C<content> (which can contain any 8 bit data), with length C<size>."
16346 #: ../fish/guestfish-actions.pod:5166 ../src/guestfs-actions.pod:7884
16348 "As a special case, if C<size> is C<0> then the length is calculated using "
16349 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16353 #: ../fish/guestfish-actions.pod:5170 ../src/guestfs-actions.pod:7888
16355 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16356 "I<not> work, even if the length is specified."
16360 #: ../fish/guestfish-actions.pod:5176
16361 msgid "I<This function is deprecated.> In new code, use the L</write> call instead."
16365 #: ../fish/guestfish-actions.pod:5183
16370 #: ../fish/guestfish-actions.pod:5185
16373 " zegrep regex path\n"
16378 #: ../fish/guestfish-actions.pod:5187 ../src/guestfs-actions.pod:7905
16379 msgid "This calls the external C<zegrep> program and returns the matching lines."
16383 #: ../fish/guestfish-actions.pod:5193
16388 #: ../fish/guestfish-actions.pod:5195
16391 " zegrepi regex path\n"
16396 #: ../fish/guestfish-actions.pod:5197 ../src/guestfs-actions.pod:7924
16397 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
16401 #: ../fish/guestfish-actions.pod:5203
16406 #: ../fish/guestfish-actions.pod:5205
16414 #: ../fish/guestfish-actions.pod:5207 ../src/guestfs-actions.pod:7942
16415 msgid "This command writes zeroes over the first few blocks of C<device>."
16419 #: ../fish/guestfish-actions.pod:5209 ../src/guestfs-actions.pod:7944
16421 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16422 "securely wipe the device). It should be sufficient to remove any partition "
16423 "tables, filesystem superblocks and so on."
16427 #: ../fish/guestfish-actions.pod:5213 ../fish/guestfish-actions.pod:5228 ../src/guestfs-actions.pod:7948 ../src/guestfs-actions.pod:7974
16429 "If blocks are already zero, then this command avoids writing zeroes. This "
16430 "prevents the underlying device from becoming non-sparse or growing "
16435 #: ../fish/guestfish-actions.pod:5217
16436 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
16440 #: ../fish/guestfish-actions.pod:5220
16441 msgid "zero-device"
16445 #: ../fish/guestfish-actions.pod:5222
16448 " zero-device device\n"
16453 #: ../fish/guestfish-actions.pod:5224
16455 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
16456 "which just zeroes the first few blocks of a device."
16460 #: ../fish/guestfish-actions.pod:5235
16465 #: ../fish/guestfish-actions.pod:5237
16468 " zerofree device\n"
16473 #: ../fish/guestfish-actions.pod:5239 ../src/guestfs-actions.pod:7996
16475 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16476 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16477 "possible to compress the filesystem more effectively."
16481 #: ../fish/guestfish-actions.pod:5244 ../src/guestfs-actions.pod:8001
16482 msgid "You should B<not> run this program if the filesystem is mounted."
16486 #: ../fish/guestfish-actions.pod:5247 ../src/guestfs-actions.pod:8004
16488 "It is possible that using this program can damage the filesystem or data on "
16493 #: ../fish/guestfish-actions.pod:5250
16498 #: ../fish/guestfish-actions.pod:5252
16501 " zfgrep pattern path\n"
16506 #: ../fish/guestfish-actions.pod:5254 ../src/guestfs-actions.pod:8018
16507 msgid "This calls the external C<zfgrep> program and returns the matching lines."
16511 #: ../fish/guestfish-actions.pod:5260
16516 #: ../fish/guestfish-actions.pod:5262
16519 " zfgrepi pattern path\n"
16524 #: ../fish/guestfish-actions.pod:5264 ../src/guestfs-actions.pod:8037
16525 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
16529 #: ../fish/guestfish-actions.pod:5270
16534 #: ../fish/guestfish-actions.pod:5272
16537 " zfile meth path\n"
16542 #: ../fish/guestfish-actions.pod:5274 ../src/guestfs-actions.pod:8063
16543 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
16547 #: ../fish/guestfish-actions.pod:5277 ../src/guestfs-actions.pod:8066
16548 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16552 #: ../fish/guestfish-actions.pod:5279
16553 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
16557 #: ../fish/guestfish-actions.pod:5282
16558 msgid "I<This function is deprecated.> In new code, use the L</file> call instead."
16562 #: ../fish/guestfish-actions.pod:5289
16567 #: ../fish/guestfish-actions.pod:5291
16570 " zgrep regex path\n"
16575 #: ../fish/guestfish-actions.pod:5293 ../src/guestfs-actions.pod:8083
16576 msgid "This calls the external C<zgrep> program and returns the matching lines."
16580 #: ../fish/guestfish-actions.pod:5299
16585 #: ../fish/guestfish-actions.pod:5301
16588 " zgrepi regex path\n"
16593 #: ../fish/guestfish-actions.pod:5303 ../src/guestfs-actions.pod:8102
16594 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
16598 #: ../fish/guestfish-commands.pod:1
16603 #: ../fish/guestfish-commands.pod:3
16608 #: ../fish/guestfish-commands.pod:5
16611 " alloc filename size\n"
16616 #: ../fish/guestfish-commands.pod:7
16618 "This creates an empty (zeroed) file of the given size, and then adds so it "
16619 "can be further examined."
16623 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
16624 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
16628 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
16629 msgid "Size can be specified using standard suffixes, eg. C<1M>."
16633 #: ../fish/guestfish-commands.pod:14
16635 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
16636 "image, see L</PREPARED DISK IMAGES>."
16640 #: ../fish/guestfish-commands.pod:17
16645 #: ../fish/guestfish-commands.pod:19
16648 " copy-in local [local ...] /remotedir\n"
16653 #: ../fish/guestfish-commands.pod:21
16655 "C<copy-in> copies local files or directories recursively into the disk "
16656 "image, placing them in the directory called C</remotedir> (which must "
16657 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
16658 "other commands as necessary."
16662 #: ../fish/guestfish-commands.pod:26
16664 "Multiple local files and directories can be specified, but the last "
16665 "parameter must always be a remote directory. Wildcards cannot be used."
16669 #: ../fish/guestfish-commands.pod:30
16674 #: ../fish/guestfish-commands.pod:32
16677 " copy-out remote [remote ...] localdir\n"
16682 #: ../fish/guestfish-commands.pod:34
16684 "C<copy-out> copies remote files or directories recursively out of the disk "
16685 "image, placing them on the host disk in a local directory called C<localdir> "
16686 "(which must exist). This guestfish meta-command turns into a sequence of "
16687 "L</download>, L</tar-out> and other commands as necessary."
16691 #: ../fish/guestfish-commands.pod:40
16693 "Multiple remote files and directories can be specified, but the last "
16694 "parameter must always be a local directory. To download to the current "
16695 "directory, use C<.> as in:"
16699 #: ../fish/guestfish-commands.pod:44
16702 " copy-out /home .\n"
16707 #: ../fish/guestfish-commands.pod:46
16709 "Wildcards cannot be used in the ordinary command, but you can use them with "
16710 "the help of L</glob> like this:"
16714 #: ../fish/guestfish-commands.pod:49
16717 " glob copy-out /home/* .\n"
16722 #: ../fish/guestfish-commands.pod:51
16727 #: ../fish/guestfish-commands.pod:53
16730 " display filename\n"
16735 #: ../fish/guestfish-commands.pod:55
16737 "Use C<display> (a graphical display program) to display an image file. It "
16738 "downloads the file, and runs C<display> on it."
16742 #: ../fish/guestfish-commands.pod:58
16744 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
16745 "environment variable. For example to use the GNOME display program:"
16749 #: ../fish/guestfish-commands.pod:61
16752 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
16757 #: ../fish/guestfish-commands.pod:63
16758 msgid "See also L<display(1)>."
16762 #: ../fish/guestfish-commands.pod:65
16767 #: ../fish/guestfish-commands.pod:67
16770 " echo [params ...]\n"
16775 #: ../fish/guestfish-commands.pod:69
16776 msgid "This echos the parameters to the terminal."
16780 #: ../fish/guestfish-commands.pod:71
16785 #: ../fish/guestfish-commands.pod:73
16790 #: ../fish/guestfish-commands.pod:75
16795 #: ../fish/guestfish-commands.pod:77
16803 #: ../fish/guestfish-commands.pod:79
16805 "This is used to edit a file. It downloads the file, edits it locally using "
16806 "your editor, then uploads the result."
16810 #: ../fish/guestfish-commands.pod:82
16812 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
16813 "or C<emacs> you will get those corresponding editors."
16817 #: ../fish/guestfish-commands.pod:86
16822 #: ../fish/guestfish-commands.pod:88
16825 " glob command args...\n"
16830 #: ../fish/guestfish-commands.pod:90
16832 "Expand wildcards in any paths in the args list, and run C<command> "
16833 "repeatedly on each matching path."
16837 #: ../fish/guestfish-commands.pod:93
16838 msgid "See L</WILDCARDS AND GLOBBING>."
16842 #: ../fish/guestfish-commands.pod:95
16847 #: ../fish/guestfish-commands.pod:97
16850 " hexedit <filename|device>\n"
16851 " hexedit <filename|device> <max>\n"
16852 " hexedit <filename|device> <start> <max>\n"
16857 #: ../fish/guestfish-commands.pod:101
16859 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
16864 #: ../fish/guestfish-commands.pod:104
16866 "This command works by downloading potentially the whole file or device, "
16867 "editing it locally, then uploading it. If the file or device is large, you "
16868 "have to specify which part you wish to edit by using C<max> and/or C<start> "
16869 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
16870 "usual modifiers allowed such as C<1M> (1 megabyte)."
16874 #: ../fish/guestfish-commands.pod:111
16875 msgid "For example to edit the first few sectors of a disk you might do:"
16879 #: ../fish/guestfish-commands.pod:114
16882 " hexedit /dev/sda 1M\n"
16887 #: ../fish/guestfish-commands.pod:116
16889 "which would allow you to edit anywhere within the first megabyte of the "
16894 #: ../fish/guestfish-commands.pod:119
16895 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
16899 #: ../fish/guestfish-commands.pod:121
16902 " hexedit /dev/sda1 0x400 0x400\n"
16907 #: ../fish/guestfish-commands.pod:123
16908 msgid "(assuming the superblock is in the standard location)."
16912 #: ../fish/guestfish-commands.pod:125
16914 "This command requires the external L<hexedit(1)> program. You can specify "
16915 "another program to use by setting the C<HEXEDITOR> environment variable."
16919 #: ../fish/guestfish-commands.pod:129
16920 msgid "See also L</hexdump>."
16924 #: ../fish/guestfish-commands.pod:131
16929 #: ../fish/guestfish-commands.pod:133
16937 #: ../fish/guestfish-commands.pod:135
16938 msgid "Change the local directory, ie. the current directory of guestfish itself."
16942 #: ../fish/guestfish-commands.pod:138
16943 msgid "Note that C<!cd> won't do what you might expect."
16947 #: ../fish/guestfish-commands.pod:140
16952 #: ../fish/guestfish-commands.pod:142
16957 #: ../fish/guestfish-commands.pod:144
16965 #: ../fish/guestfish-commands.pod:146
16966 msgid "Opens the manual page for guestfish."
16970 #: ../fish/guestfish-commands.pod:148
16975 #: ../fish/guestfish-commands.pod:150
16980 #: ../fish/guestfish-commands.pod:152
16988 #: ../fish/guestfish-commands.pod:154
16996 #: ../fish/guestfish-commands.pod:156
16997 msgid "This is used to view a file."
17001 #: ../fish/guestfish-commands.pod:158
17003 "The default viewer is C<$PAGER>. However if you use the alternate command "
17004 "C<less> you will get the C<less> command specifically."
17008 #: ../fish/guestfish-commands.pod:161
17013 #: ../fish/guestfish-commands.pod:163
17021 #: ../fish/guestfish-commands.pod:165
17023 "Close and reopen the libguestfs handle. It is not necessary to use this "
17024 "normally, because the handle is closed properly when guestfish exits. "
17025 "However this is occasionally useful for testing."
17029 #: ../fish/guestfish-commands.pod:169
17034 #: ../fish/guestfish-commands.pod:171
17037 " setenv VAR value\n"
17042 #: ../fish/guestfish-commands.pod:173
17043 msgid "Set the environment variable C<VAR> to the string C<value>."
17047 #: ../fish/guestfish-commands.pod:175
17048 msgid "To print the value of an environment variable use a shell command such as:"
17052 #: ../fish/guestfish-commands.pod:178
17060 #: ../fish/guestfish-commands.pod:180
17065 #: ../fish/guestfish-commands.pod:182
17068 " sparse filename size\n"
17073 #: ../fish/guestfish-commands.pod:184
17075 "This creates an empty sparse file of the given size, and then adds so it can "
17076 "be further examined."
17080 #: ../fish/guestfish-commands.pod:187
17082 "In all respects it works the same as the L</alloc> command, except that the "
17083 "image file is allocated sparsely, which means that disk blocks are not "
17084 "assigned to the file until they are needed. Sparse disk files only use "
17085 "space when written to, but they are slower and there is a danger you could "
17086 "run out of real disk space during a write operation."
17090 #: ../fish/guestfish-commands.pod:197
17095 #: ../fish/guestfish-commands.pod:199
17103 #: ../fish/guestfish-commands.pod:201
17105 "This command returns a list of the optional groups known to the daemon, and "
17106 "indicates which ones are supported by this build of the libguestfs "
17111 #: ../fish/guestfish-commands.pod:205
17112 msgid "See also L<guestfs(3)/AVAILABILITY>."
17116 #: ../fish/guestfish-commands.pod:207
17121 #: ../fish/guestfish-commands.pod:209
17124 " time command args...\n"
17129 #: ../fish/guestfish-commands.pod:211
17131 "Run the command as usual, but print the elapsed time afterwards. This can "
17132 "be useful for benchmarking operations."
17136 #: ../fish/guestfish-commands.pod:214
17141 #: ../fish/guestfish-commands.pod:216
17149 #: ../fish/guestfish-commands.pod:218
17150 msgid "Remove C<VAR> from the environment."
17154 #: ../fish/guestfish.pod:5
17155 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17159 #: ../fish/guestfish.pod:9
17162 " guestfish [--options] [commands]\n"
17167 #: ../fish/guestfish.pod:11
17175 #: ../fish/guestfish.pod:13
17178 " guestfish [--ro|--rw] -a disk.img\n"
17183 #: ../fish/guestfish.pod:15
17186 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17191 #: ../fish/guestfish.pod:17
17194 " guestfish -d libvirt-domain\n"
17199 #: ../fish/guestfish.pod:19
17202 " guestfish [--ro|--rw] -a disk.img -i\n"
17207 #: ../fish/guestfish.pod:21
17210 " guestfish -d libvirt-domain -i\n"
17215 #: ../fish/guestfish.pod:25
17217 "Using guestfish in read/write mode on live virtual machines can be "
17218 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17219 "option to use guestfish safely if the disk image or virtual machine might be "
17224 #: ../fish/guestfish.pod:32
17226 "Guestfish is a shell and command-line tool for examining and modifying "
17227 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17228 "functionality of the guestfs API, see L<guestfs(3)>."
17232 #: ../fish/guestfish.pod:36
17234 "Guestfish gives you structured access to the libguestfs API, from shell "
17235 "scripts or the command line or interactively. If you want to rescue a "
17236 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17241 #: ../fish/guestfish.pod:43
17242 msgid "As an interactive shell"
17246 #: ../fish/guestfish.pod:45
17254 #: ../fish/guestfish.pod:47
17257 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17258 " editing virtual machine filesystems.\n"
17263 #: ../fish/guestfish.pod:50
17266 " Type: 'help' for a list of commands\n"
17267 " 'man' to read the manual\n"
17268 " 'quit' to quit the shell\n"
17273 #: ../fish/guestfish.pod:54
17276 " ><fs> add-ro disk.img\n"
17278 " ><fs> list-filesystems\n"
17279 " /dev/sda1: ext4\n"
17280 " /dev/vg_guest/lv_root: ext4\n"
17281 " /dev/vg_guest/lv_swap: swap\n"
17282 " ><fs> mount /dev/vg_guest/lv_root /\n"
17283 " ><fs> cat /etc/fstab\n"
17285 " # Created by anaconda\n"
17292 #: ../fish/guestfish.pod:67
17293 msgid "From shell scripts"
17297 #: ../fish/guestfish.pod:69
17298 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17302 #: ../fish/guestfish.pod:71
17305 " guestfish <<_EOF_\n"
17308 " mount /dev/vg_guest/lv_root /\n"
17309 " write /etc/motd \"Welcome, new users\"\n"
17315 #: ../fish/guestfish.pod:78
17316 msgid "List the LVM logical volumes in a disk image:"
17320 #: ../fish/guestfish.pod:80
17323 " guestfish -a disk.img --ro <<_EOF_\n"
17331 #: ../fish/guestfish.pod:85
17332 msgid "List all the filesystems in a disk image:"
17336 #: ../fish/guestfish.pod:87
17339 " guestfish -a disk.img --ro <<_EOF_\n"
17341 " list-filesystems\n"
17347 #: ../fish/guestfish.pod:92
17348 msgid "On one command line"
17352 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
17353 msgid "Update C</etc/resolv.conf> in a guest:"
17357 #: ../fish/guestfish.pod:96
17361 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17362 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17367 #: ../fish/guestfish.pod:100
17368 msgid "Edit C</boot/grub/grub.conf> interactively:"
17372 #: ../fish/guestfish.pod:102
17375 " guestfish --rw --add disk.img \\\n"
17376 " --mount /dev/vg_guest/lv_root \\\n"
17377 " --mount /dev/sda1:/boot \\\n"
17378 " edit /boot/grub/grub.conf\n"
17383 #: ../fish/guestfish.pod:107
17384 msgid "Mount disks automatically"
17388 #: ../fish/guestfish.pod:109
17390 "Use the I<-i> option to automatically mount the disks from a virtual "
17395 #: ../fish/guestfish.pod:112
17398 " guestfish --ro -a disk.img -i cat /etc/group\n"
17403 #: ../fish/guestfish.pod:114
17406 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17411 #: ../fish/guestfish.pod:116
17412 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17416 #: ../fish/guestfish.pod:118
17419 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17424 #: ../fish/guestfish.pod:120
17425 msgid "As a script interpreter"
17429 #: ../fish/guestfish.pod:122
17430 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17434 #: ../fish/guestfish.pod:124
17437 " #!/usr/bin/guestfish -f\n"
17438 " sparse test1.img 100M\n"
17440 " part-disk /dev/sda mbr\n"
17441 " mkfs ext2 /dev/sda1\n"
17446 #: ../fish/guestfish.pod:130
17447 msgid "Start with a prepared disk"
17451 #: ../fish/guestfish.pod:132
17453 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17454 "single ext2-formatted partition:"
17458 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2228
17461 " guestfish -N fs\n"
17466 #: ../fish/guestfish.pod:137
17467 msgid "To list what is available do:"
17471 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
17474 " guestfish -N help | less\n"
17479 #: ../fish/guestfish.pod:141
17480 msgid "Remote control"
17484 #: ../fish/guestfish.pod:143
17487 " eval \"`guestfish --listen`\"\n"
17488 " guestfish --remote add-ro disk.img\n"
17489 " guestfish --remote run\n"
17490 " guestfish --remote lvs\n"
17495 #: ../fish/guestfish.pod:154
17496 msgid "Displays general help on options."
17500 #: ../fish/guestfish.pod:158
17501 msgid "B<--cmd-help>"
17505 #: ../fish/guestfish.pod:160
17506 msgid "Lists all available guestfish commands."
17510 #: ../fish/guestfish.pod:162
17515 #: ../fish/guestfish.pod:164
17516 msgid "B<--cmd-help cmd>"
17520 #: ../fish/guestfish.pod:166
17521 msgid "Displays detailed help on a single command C<cmd>."
17525 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
17526 msgid "B<-a image>"
17530 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
17531 msgid "B<--add image>"
17535 #: ../fish/guestfish.pod:172
17536 msgid "Add a block device or virtual machine image to the shell."
17540 #: ../fish/guestfish.pod:177
17542 "Using this flag is mostly equivalent to using the C<add> command, with "
17543 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17544 "the I<--format=...> flag was given."
17548 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
17550 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17551 "URI to use. The default is to use the default libvirt connection."
17555 #: ../fish/guestfish.pod:189
17560 #: ../fish/guestfish.pod:191
17562 "If using the I<--listen> option and a csh-like shell, use this option. See "
17563 "section L</REMOTE CONTROL AND CSH> below."
17567 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
17568 msgid "B<-d libvirt-domain>"
17572 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
17573 msgid "B<--domain libvirt-domain>"
17577 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
17579 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17580 "used, then any libvirt domain can be used. However in write mode, only "
17581 "libvirt domains which are shut down can be named here."
17585 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
17586 msgid "Domain UUIDs can be used instead of names."
17590 #: ../fish/guestfish.pod:204
17592 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17593 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17594 "if the I<--format:...> flag was given."
17598 #: ../fish/guestfish.pod:208
17603 #: ../fish/guestfish.pod:210
17604 msgid "B<--no-dest-paths>"
17608 #: ../fish/guestfish.pod:212
17610 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17611 "to hit the tab key to complete paths on the guest filesystem, but this "
17612 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17613 "allow this feature to be disabled."
17617 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
17619 "When prompting for keys and passphrases, guestfish normally turns echoing "
17620 "off so you cannot see what you are typing. If you are not worried about "
17621 "Tempest attacks and there is no one else in the room you can specify this "
17622 "flag to see what you are typing."
17626 #: ../fish/guestfish.pod:224
17631 #: ../fish/guestfish.pod:226
17632 msgid "B<--file file>"
17636 #: ../fish/guestfish.pod:228
17637 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17641 #: ../fish/guestfish.pod:231
17644 " #!/usr/bin/guestfish -f\n"
17649 #: ../fish/guestfish.pod:244
17652 " guestfish --format=raw -a disk.img\n"
17657 #: ../fish/guestfish.pod:248
17660 " guestfish --format=raw -a disk.img --format -a another.img\n"
17665 #: ../fish/guestfish.pod:253
17667 "If you have untrusted raw-format guest disk images, you should use this "
17668 "option to specify the disk format. This avoids a possible security problem "
17669 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17673 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
17674 msgid "B<--inspector>"
17678 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
17680 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17681 "system and mount filesystems as they would be mounted on the real virtual "
17686 #: ../fish/guestfish.pod:266
17687 msgid "Typical usage is either:"
17691 #: ../fish/guestfish.pod:268
17694 " guestfish -d myguest -i\n"
17699 #: ../fish/guestfish.pod:270
17700 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17704 #: ../fish/guestfish.pod:272
17707 " guestfish --ro -d myguest -i\n"
17712 #: ../fish/guestfish.pod:274
17713 msgid "(for active domains, readonly), or specify the block device directly:"
17717 #: ../fish/guestfish.pod:276
17720 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17725 #: ../fish/guestfish.pod:278
17727 "Note that the command line syntax changed slightly over older versions of "
17728 "guestfish. You can still use the old syntax:"
17732 #: ../fish/guestfish.pod:281
17735 " guestfish [--ro] -i disk.img\n"
17740 #: ../fish/guestfish.pod:283
17743 " guestfish [--ro] -i libvirt-domain\n"
17748 #: ../fish/guestfish.pod:285
17750 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
17751 "then using other commands to mount the filesystems that were found."
17755 #: ../fish/guestfish.pod:294
17756 msgid "B<--listen>"
17760 #: ../fish/guestfish.pod:296
17762 "Fork into the background and listen for remote commands. See section "
17763 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17767 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
17772 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
17774 "Connect to a live virtual machine. (Experimental, see "
17775 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
17779 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
17780 msgid "B<-m dev[:mountpoint[:options]]>"
17784 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
17785 msgid "B<--mount dev[:mountpoint[:options]]>"
17789 #: ../fish/guestfish.pod:308
17790 msgid "Mount the named partition or logical volume on the given mountpoint."
17794 #: ../fish/guestfish.pod:310
17795 msgid "If the mountpoint is omitted, it defaults to C</>."
17799 #: ../fish/guestfish.pod:312
17800 msgid "You have to mount something on C</> before most commands will work."
17804 #: ../fish/guestfish.pod:314
17806 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17811 #: ../fish/guestfish.pod:317
17813 "If you don't know what filesystems a disk image contains, you can either run "
17814 "guestfish without this option, then list the partitions, filesystems and LVs "
17815 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17816 "commands), or you can use the L<virt-filesystems(1)> program."
17820 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
17822 "The third (and rarely used) part of the mount parameter is the list of mount "
17823 "options used to mount the underlying filesystem. If this is not given, then "
17824 "the mount options are either the empty string or C<ro> (the latter if the "
17825 "I<--ro> flag is used). By specifying the mount options, you override this "
17826 "default choice. Probably the only time you would use this is to enable ACLs "
17827 "and/or extended attributes if the filesystem can support them:"
17831 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
17834 " -m /dev/sda1:/:acl,user_xattr\n"
17839 #: ../fish/guestfish.pod:333
17840 msgid "Using this flag is equivalent to using the C<mount-options> command."
17844 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202 ../resize/virt-resize.pod:358
17849 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
17850 msgid "B<--no-sync>"
17854 #: ../fish/guestfish.pod:339
17856 "Disable autosync. This is enabled by default. See the discussion of "
17857 "autosync in the L<guestfs(3)> manpage."
17861 #: ../fish/guestfish.pod:342
17866 #: ../fish/guestfish.pod:344
17867 msgid "B<--new type>"
17871 #: ../fish/guestfish.pod:346
17876 #: ../fish/guestfish.pod:348
17878 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17879 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17880 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17885 #: ../fish/guestfish.pod:353
17886 msgid "B<--progress-bars>"
17890 #: ../fish/guestfish.pod:355
17891 msgid "Enable progress bars, even when guestfish is used non-interactively."
17895 #: ../fish/guestfish.pod:357
17897 "Progress bars are enabled by default when guestfish is used as an "
17898 "interactive shell."
17902 #: ../fish/guestfish.pod:360
17903 msgid "B<--no-progress-bars>"
17907 #: ../fish/guestfish.pod:362
17908 msgid "Disable progress bars."
17912 #: ../fish/guestfish.pod:364
17913 msgid "B<--remote[=pid]>"
17917 #: ../fish/guestfish.pod:366
17919 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17920 "CONTROL GUESTFISH OVER A SOCKET> below."
17924 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248 ../rescue/virt-rescue.pod:161
17929 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250 ../rescue/virt-rescue.pod:163
17934 #: ../fish/guestfish.pod:373
17936 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17937 "mounts are done read-only."
17941 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
17943 "The option must always be used if the disk image or virtual machine might be "
17944 "running, and is generally recommended in cases where you don't need write "
17945 "access to the disk."
17949 #: ../fish/guestfish.pod:380
17951 "Note that prepared disk images created with I<-N> are not affected by this "
17952 "option. Also commands like C<add> are not affected - you have to specify "
17953 "the C<readonly:true> option explicitly if you need it."
17957 #: ../fish/guestfish.pod:384
17958 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17962 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262 ../rescue/virt-rescue.pod:173
17963 msgid "B<--selinux>"
17967 #: ../fish/guestfish.pod:388
17968 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17972 #: ../fish/guestfish.pod:394
17974 "Enable very verbose messages. This is particularly useful if you find a "
17979 #: ../fish/guestfish.pod:401
17980 msgid "Display the guestfish / libguestfs version number and exit."
17984 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278 ../rescue/virt-rescue.pod:194
17989 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280 ../rescue/virt-rescue.pod:196
17994 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
17996 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17997 "mounts are done read-write."
18001 #: ../fish/guestfish.pod:410
18002 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
18006 #: ../fish/guestfish.pod:414
18007 msgid "Echo each command before executing it."
18011 #: ../fish/guestfish.pod:418
18012 msgid "COMMANDS ON COMMAND LINE"
18016 #: ../fish/guestfish.pod:420
18017 msgid "Any additional (non-option) arguments are treated as commands to execute."
18021 #: ../fish/guestfish.pod:423
18023 "Commands to execute should be separated by a colon (C<:>), where the colon "
18024 "is a separate parameter. Thus:"
18028 #: ../fish/guestfish.pod:426
18031 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18036 #: ../fish/guestfish.pod:428
18038 "If there are no additional arguments, then we enter a shell, either an "
18039 "interactive shell with a prompt (if the input is a terminal) or a "
18040 "non-interactive shell."
18044 #: ../fish/guestfish.pod:432
18046 "In either command line mode or non-interactive shell, the first command that "
18047 "gives an error causes the whole shell to exit. In interactive mode (with a "
18048 "prompt) if a command fails, you can continue to enter commands."
18052 #: ../fish/guestfish.pod:437
18053 msgid "USING launch (OR run)"
18057 #: ../fish/guestfish.pod:439
18059 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18060 "then launch it, then mount any disks you need, and finally issue "
18061 "actions/commands. So the general order of the day is:"
18065 #: ../fish/guestfish.pod:447
18066 msgid "add or -a/--add"
18070 #: ../fish/guestfish.pod:451
18071 msgid "launch (aka run)"
18075 #: ../fish/guestfish.pod:455
18076 msgid "mount or -m/--mount"
18080 #: ../fish/guestfish.pod:459
18081 msgid "any other commands"
18085 #: ../fish/guestfish.pod:463
18087 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18088 "guest before mounting or performing any other commands."
18092 #: ../fish/guestfish.pod:466
18094 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18095 "I<--new> options were given then C<run> is done automatically, simply "
18096 "because guestfish can't perform the action you asked for without doing this."
18100 #: ../fish/guestfish.pod:471
18101 msgid "OPENING DISKS FOR READ AND WRITE"
18105 #: ../fish/guestfish.pod:473
18107 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
18108 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
18109 "I<-i> and I<-m> open disk images read-only or for writing."
18113 #: ../fish/guestfish.pod:478
18115 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
18116 "opening disk images supplied on the command line for write. To open a disk "
18117 "image read-only you have to do I<-a image --ro>."
18121 #: ../fish/guestfish.pod:482
18123 "This matters: If you accidentally open a live VM disk image writable then "
18124 "you will cause irreversible disk corruption."
18128 #: ../fish/guestfish.pod:485
18130 "In a future libguestfs we intend to change the default the other way. Disk "
18131 "images will be opened read-only. You will have to either specify "
18132 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
18133 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
18134 "access for disk images specified by those other command line options."
18138 #: ../fish/guestfish.pod:492
18140 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
18141 "which does nothing (it is already the default). However it is highly "
18142 "recommended that you use this option to indicate that you need write access, "
18143 "and prepare your scripts for the day when this option will be required for "
18148 #: ../fish/guestfish.pod:498
18150 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18151 "other libguestfs program apart from guestfish and guestmount."
18155 #: ../fish/guestfish.pod:501
18160 #: ../fish/guestfish.pod:503
18162 "You can quote ordinary parameters using either single or double quotes. For "
18167 #: ../fish/guestfish.pod:506
18170 " add \"file with a space.img\"\n"
18175 #: ../fish/guestfish.pod:508
18178 " rm '/file name'\n"
18183 #: ../fish/guestfish.pod:510
18191 #: ../fish/guestfish.pod:512
18193 "A few commands require a list of strings to be passed. For these, use a "
18194 "whitespace-separated list, enclosed in quotes. Strings containing "
18195 "whitespace to be passed through must be enclosed in single quotes. A "
18196 "literal single quote must be escaped with a backslash."
18200 #: ../fish/guestfish.pod:517
18203 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18204 " command \"/bin/echo 'foo bar'\"\n"
18205 " command \"/bin/echo \\'foo\\'\"\n"
18210 #: ../fish/guestfish.pod:521
18211 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
18215 #: ../fish/guestfish.pod:523
18217 "In double-quoted arguments (only) use backslash to insert special "
18222 #: ../fish/guestfish.pod:528
18227 #: ../fish/guestfish.pod:530
18228 msgid "Alert (bell) character."
18232 #: ../fish/guestfish.pod:532
18237 #: ../fish/guestfish.pod:534
18238 msgid "Backspace character."
18242 #: ../fish/guestfish.pod:536
18247 #: ../fish/guestfish.pod:538
18248 msgid "Form feed character."
18252 #: ../fish/guestfish.pod:540
18257 #: ../fish/guestfish.pod:542
18258 msgid "Newline character."
18262 #: ../fish/guestfish.pod:544
18267 #: ../fish/guestfish.pod:546
18268 msgid "Carriage return character."
18272 #: ../fish/guestfish.pod:548
18277 #: ../fish/guestfish.pod:550
18278 msgid "Horizontal tab character."
18282 #: ../fish/guestfish.pod:552
18287 #: ../fish/guestfish.pod:554
18288 msgid "Vertical tab character."
18292 #: ../fish/guestfish.pod:556
18297 #: ../fish/guestfish.pod:558
18298 msgid "A literal double quote character."
18302 #: ../fish/guestfish.pod:560
18307 #: ../fish/guestfish.pod:562
18309 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
18314 #: ../fish/guestfish.pod:565
18319 #: ../fish/guestfish.pod:567
18320 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
18324 #: ../fish/guestfish.pod:570
18326 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
18331 #: ../fish/guestfish.pod:573
18336 #: ../fish/guestfish.pod:575
18337 msgid "A literal backslash character."
18341 #: ../fish/guestfish.pod:579
18342 msgid "OPTIONAL ARGUMENTS"
18346 #: ../fish/guestfish.pod:581
18348 "Some commands take optional arguments. These arguments appear in this "
18349 "documentation as C<[argname:..]>. You can use them as in these examples:"
18353 #: ../fish/guestfish.pod:585
18356 " add-drive-opts filename\n"
18361 #: ../fish/guestfish.pod:587
18364 " add-drive-opts filename readonly:true\n"
18369 #: ../fish/guestfish.pod:589
18372 " add-drive-opts filename format:qcow2 readonly:false\n"
18377 #: ../fish/guestfish.pod:591
18379 "Each optional argument can appear at most once. All optional arguments must "
18380 "appear after the required ones."
18384 #: ../fish/guestfish.pod:594
18389 #: ../fish/guestfish.pod:596
18390 msgid "This section applies to all commands which can take integers as parameters."
18394 #: ../fish/guestfish.pod:599
18395 msgid "SIZE SUFFIX"
18399 #: ../fish/guestfish.pod:601
18401 "When the command takes a parameter measured in bytes, you can use one of the "
18402 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18406 #: ../fish/guestfish.pod:607
18407 msgid "B<k> or B<K> or B<KiB>"
18411 #: ../fish/guestfish.pod:609
18412 msgid "The size in kilobytes (multiplied by 1024)."
18416 #: ../fish/guestfish.pod:611
18421 #: ../fish/guestfish.pod:613
18422 msgid "The size in SI 1000 byte units."
18426 #: ../fish/guestfish.pod:615
18427 msgid "B<M> or B<MiB>"
18431 #: ../fish/guestfish.pod:617
18432 msgid "The size in megabytes (multiplied by 1048576)."
18436 #: ../fish/guestfish.pod:619
18441 #: ../fish/guestfish.pod:621
18442 msgid "The size in SI 1000000 byte units."
18446 #: ../fish/guestfish.pod:623
18447 msgid "B<G> or B<GiB>"
18451 #: ../fish/guestfish.pod:625
18452 msgid "The size in gigabytes (multiplied by 2**30)."
18456 #: ../fish/guestfish.pod:627
18461 #: ../fish/guestfish.pod:629
18462 msgid "The size in SI 10**9 byte units."
18466 #: ../fish/guestfish.pod:631
18467 msgid "B<T> or B<TiB>"
18471 #: ../fish/guestfish.pod:633
18472 msgid "The size in terabytes (multiplied by 2**40)."
18476 #: ../fish/guestfish.pod:635
18481 #: ../fish/guestfish.pod:637
18482 msgid "The size in SI 10**12 byte units."
18486 #: ../fish/guestfish.pod:639
18487 msgid "B<P> or B<PiB>"
18491 #: ../fish/guestfish.pod:641
18492 msgid "The size in petabytes (multiplied by 2**50)."
18496 #: ../fish/guestfish.pod:643
18501 #: ../fish/guestfish.pod:645
18502 msgid "The size in SI 10**15 byte units."
18506 #: ../fish/guestfish.pod:647
18507 msgid "B<E> or B<EiB>"
18511 #: ../fish/guestfish.pod:649
18512 msgid "The size in exabytes (multiplied by 2**60)."
18516 #: ../fish/guestfish.pod:651
18521 #: ../fish/guestfish.pod:653
18522 msgid "The size in SI 10**18 byte units."
18526 #: ../fish/guestfish.pod:655
18527 msgid "B<Z> or B<ZiB>"
18531 #: ../fish/guestfish.pod:657
18532 msgid "The size in zettabytes (multiplied by 2**70)."
18536 #: ../fish/guestfish.pod:659
18541 #: ../fish/guestfish.pod:661
18542 msgid "The size in SI 10**21 byte units."
18546 #: ../fish/guestfish.pod:663
18547 msgid "B<Y> or B<YiB>"
18551 #: ../fish/guestfish.pod:665
18552 msgid "The size in yottabytes (multiplied by 2**80)."
18556 #: ../fish/guestfish.pod:667
18561 #: ../fish/guestfish.pod:669
18562 msgid "The size in SI 10**24 byte units."
18566 #: ../fish/guestfish.pod:675
18569 " truncate-size /file 1G\n"
18574 #: ../fish/guestfish.pod:677
18575 msgid "would truncate the file to 1 gigabyte."
18579 #: ../fish/guestfish.pod:679
18581 "Be careful because a few commands take sizes in kilobytes or megabytes "
18582 "(eg. the parameter to L</memsize> is specified in megabytes already). "
18583 "Adding a suffix will probably not do what you expect."
18587 #: ../fish/guestfish.pod:683
18588 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18592 #: ../fish/guestfish.pod:685
18594 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18595 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18599 #: ../fish/guestfish.pod:688
18602 " 1234 decimal number 1234\n"
18603 " 02322 octal number, equivalent to decimal 1234\n"
18604 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18609 #: ../fish/guestfish.pod:692
18611 "When using the C<chmod> command, you almost always want to specify an octal "
18612 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18613 "L<chmod(1)> program):"
18617 #: ../fish/guestfish.pod:696
18620 " chmod 0777 /public # OK\n"
18621 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18626 #: ../fish/guestfish.pod:699
18628 "Commands that return numbers usually print them in decimal, but some "
18629 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18630 "octal, preceeded by C<0>)."
18634 #: ../fish/guestfish.pod:703
18635 msgid "WILDCARDS AND GLOBBING"
18639 #: ../fish/guestfish.pod:705
18641 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18642 "(globbing) by default. So for example the following will not do what you "
18647 #: ../fish/guestfish.pod:709
18655 #: ../fish/guestfish.pod:711
18657 "Assuming you don't have a directory called literally C</home/*> then the "
18658 "above command will return an error."
18662 #: ../fish/guestfish.pod:714
18663 msgid "To perform wildcard expansion, use the C<glob> command."
18667 #: ../fish/guestfish.pod:716
18670 " glob rm-rf /home/*\n"
18675 #: ../fish/guestfish.pod:718
18677 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18678 "many times), equivalent to:"
18682 #: ../fish/guestfish.pod:721
18685 " rm-rf /home/jim\n"
18686 " rm-rf /home/joe\n"
18687 " rm-rf /home/mary\n"
18692 #: ../fish/guestfish.pod:725
18693 msgid "C<glob> only works on simple guest paths and not on device names."
18697 #: ../fish/guestfish.pod:727
18699 "If you have several parameters, each containing a wildcard, then glob will "
18700 "perform a Cartesian product."
18704 #: ../fish/guestfish.pod:730
18709 #: ../fish/guestfish.pod:732
18711 "Any line which starts with a I<#> character is treated as a comment and "
18712 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18713 "a command. For example:"
18717 #: ../fish/guestfish.pod:736
18720 " # this is a comment\n"
18721 " # this is a comment\n"
18722 " foo # NOT a comment\n"
18727 #: ../fish/guestfish.pod:740
18728 msgid "Blank lines are also ignored."
18732 #: ../fish/guestfish.pod:742
18733 msgid "RUNNING COMMANDS LOCALLY"
18737 #: ../fish/guestfish.pod:744
18739 "Any line which starts with a I<!> character is treated as a command sent to "
18740 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18744 #: ../fish/guestfish.pod:748
18748 " tgz-out /remote local/remote-data.tar.gz\n"
18753 #: ../fish/guestfish.pod:751
18755 "will create a directory C<local> on the host, and then export the contents "
18756 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18757 "(See C<tgz-out>)."
18761 #: ../fish/guestfish.pod:755
18763 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18764 "effect, due to the way that subprocesses work in Unix."
18768 #: ../fish/guestfish.pod:758
18769 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
18773 #: ../fish/guestfish.pod:760
18775 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
18776 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
18777 "and executed as guestfish commands."
18781 #: ../fish/guestfish.pod:764
18783 "Thus you can use shell script to construct arbitrary guestfish commands "
18784 "which are then parsed by guestfish."
18788 #: ../fish/guestfish.pod:767
18790 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
18791 "through C</foo.100>) using guestfish commands alone. However this is simple "
18792 "if we use a shell script to create the guestfish commands for us:"
18796 #: ../fish/guestfish.pod:772
18799 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
18804 #: ../fish/guestfish.pod:774
18805 msgid "or with names like C</foo.001>:"
18809 #: ../fish/guestfish.pod:776
18812 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
18817 #: ../fish/guestfish.pod:778
18819 "When using guestfish interactively it can be helpful to just run the shell "
18820 "script first (ie. remove the initial C<E<lt>> character so it is just an "
18821 "ordinary I<!> local command), see what guestfish commands it would run, and "
18822 "when you are happy with those prepend the C<E<lt>> character to run the "
18823 "guestfish commands for real."
18827 #: ../fish/guestfish.pod:784
18832 #: ../fish/guestfish.pod:786
18834 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18835 "command (a guestfish command) to the second command (any host command). For "
18840 #: ../fish/guestfish.pod:790
18843 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18848 #: ../fish/guestfish.pod:792
18850 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18851 "program). The above command would list all accounts in the guest filesystem "
18852 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18856 #: ../fish/guestfish.pod:797
18859 " hexdump /bin/ls | head\n"
18860 " list-devices | tail -1\n"
18861 " tgz-out / - | tar ztf -\n"
18866 #: ../fish/guestfish.pod:801
18868 "The space before the pipe symbol is required, any space after the pipe "
18869 "symbol is optional. Everything after the pipe symbol is just passed "
18870 "straight to the host shell, so it can contain redirections, globs and "
18871 "anything else that makes sense on the host side."
18875 #: ../fish/guestfish.pod:806
18877 "To use a literal argument which begins with a pipe symbol, you have to quote "
18882 #: ../fish/guestfish.pod:809
18890 #: ../fish/guestfish.pod:811
18891 msgid "HOME DIRECTORIES"
18895 #: ../fish/guestfish.pod:813
18897 "If a parameter starts with the character C<~> then the tilde may be expanded "
18898 "as a home directory path (either C<~> for the current user's home directory, "
18899 "or C<~user> for another user)."
18903 #: ../fish/guestfish.pod:817
18905 "Note that home directory expansion happens for users known I<on the host>, "
18906 "not in the guest filesystem."
18910 #: ../fish/guestfish.pod:820
18912 "To use a literal argument which begins with a tilde, you have to quote it, "
18917 #: ../fish/guestfish.pod:823
18925 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
18926 msgid "ENCRYPTED DISKS"
18930 #: ../fish/guestfish.pod:827
18932 "Libguestfs has some support for Linux guests encrypted according to the "
18933 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18934 "disk encryption systems used by modern Linux guests. Currently only "
18935 "LVM-on-LUKS is supported."
18939 #: ../fish/guestfish.pod:832
18940 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18944 #: ../fish/guestfish.pod:834
18947 " ><fs> vfs-type /dev/sda2\n"
18953 #: ../fish/guestfish.pod:837
18955 "Then open those devices using L</luks-open>. This creates a device-mapper "
18956 "device called C</dev/mapper/luksdev>."
18960 #: ../fish/guestfish.pod:840
18963 " ><fs> luks-open /dev/sda2 luksdev\n"
18964 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18969 #: ../fish/guestfish.pod:843
18971 "Finally you have to tell LVM to scan for volume groups on the newly created "
18976 #: ../fish/guestfish.pod:846
18980 " vg-activate-all true\n"
18985 #: ../fish/guestfish.pod:849
18986 msgid "The logical volume(s) can now be mounted in the usual way."
18990 #: ../fish/guestfish.pod:851
18992 "Before closing a LUKS device you must unmount any logical volumes on it and "
18993 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18994 "one. Then you can close the mapper device:"
18998 #: ../fish/guestfish.pod:855
19001 " vg-activate false /dev/VG\n"
19002 " luks-close /dev/mapper/luksdev\n"
19007 #: ../fish/guestfish.pod:860
19009 "If a path is prefixed with C<win:> then you can use Windows-style drive "
19010 "letters and paths (with some limitations). The following commands are "
19015 #: ../fish/guestfish.pod:864
19018 " file /WINDOWS/system32/config/system.LOG\n"
19023 #: ../fish/guestfish.pod:866
19026 " file win:\\windows\\system32\\config\\system.log\n"
19031 #: ../fish/guestfish.pod:868
19034 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
19039 #: ../fish/guestfish.pod:870
19041 "The parameter is rewritten \"behind the scenes\" by looking up the position "
19042 "where the drive is mounted, prepending that to the path, changing all "
19043 "backslash characters to forward slash, then resolving the result using "
19044 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
19045 "then the parameter might be rewritten like this:"
19049 #: ../fish/guestfish.pod:876
19052 " win:e:\\foo\\bar => /e/FOO/bar\n"
19057 #: ../fish/guestfish.pod:878
19058 msgid "This only works in argument positions that expect a path."
19062 #: ../fish/guestfish.pod:880
19063 msgid "UPLOADING AND DOWNLOADING FILES"
19067 #: ../fish/guestfish.pod:882
19069 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19070 "others which upload from or download to a local file, you can use the "
19071 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19075 #: ../fish/guestfish.pod:886
19083 #: ../fish/guestfish.pod:888
19084 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
19088 #: ../fish/guestfish.pod:891
19091 " tar-out /etc - | tar tf -\n"
19096 #: ../fish/guestfish.pod:893
19098 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19099 "command (see L</PIPES>)."
19103 #: ../fish/guestfish.pod:896
19105 "When using C<-> to read from stdin, the input is read up to the end of "
19106 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19107 "some arbitrary end marker:"
19111 #: ../fish/guestfish.pod:900
19114 " upload -<<END /foo\n"
19123 #: ../fish/guestfish.pod:906
19125 "Any string of characters can be used instead of C<END>. The end marker must "
19126 "appear on a line of its own, without any preceeding or following characters "
19127 "(not even spaces)."
19131 #: ../fish/guestfish.pod:910
19133 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19134 "upload local files (so-called \"FileIn\" parameters in the generator)."
19138 #: ../fish/guestfish.pod:913
19139 msgid "EXIT ON ERROR BEHAVIOUR"
19143 #: ../fish/guestfish.pod:915
19145 "By default, guestfish will ignore any errors when in interactive mode "
19146 "(ie. taking commands from a human over a tty), and will exit on the first "
19147 "error in non-interactive mode (scripts, commands given on the command line)."
19151 #: ../fish/guestfish.pod:920
19153 "If you prefix a command with a I<-> character, then that command will not "
19154 "cause guestfish to exit, even if that (one) command returns an error."
19158 #: ../fish/guestfish.pod:924
19159 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19163 #: ../fish/guestfish.pod:926
19165 "Guestfish can be remote-controlled over a socket. This is useful "
19166 "particularly in shell scripts where you want to make several different "
19167 "changes to a filesystem, but you don't want the overhead of starting up a "
19168 "guestfish process each time."
19172 #: ../fish/guestfish.pod:931
19173 msgid "Start a guestfish server process using:"
19177 #: ../fish/guestfish.pod:933
19180 " eval \"`guestfish --listen`\"\n"
19185 #: ../fish/guestfish.pod:935
19186 msgid "and then send it commands by doing:"
19190 #: ../fish/guestfish.pod:937
19193 " guestfish --remote cmd [...]\n"
19198 #: ../fish/guestfish.pod:939
19199 msgid "To cause the server to exit, send it the exit command:"
19203 #: ../fish/guestfish.pod:943
19205 "Note that the server will normally exit if there is an error in a command. "
19206 "You can change this in the usual way. See section L</EXIT ON ERROR "
19211 #: ../fish/guestfish.pod:947
19212 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19216 #: ../fish/guestfish.pod:949
19218 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19219 "is how the I<--remote> option knows where to send the commands. You can "
19220 "have several guestfish listener processes running using:"
19224 #: ../fish/guestfish.pod:953
19227 " eval \"`guestfish --listen`\"\n"
19228 " pid1=$GUESTFISH_PID\n"
19229 " eval \"`guestfish --listen`\"\n"
19230 " pid2=$GUESTFISH_PID\n"
19232 " guestfish --remote=$pid1 cmd\n"
19233 " guestfish --remote=$pid2 cmd\n"
19238 #: ../fish/guestfish.pod:961
19239 msgid "REMOTE CONTROL AND CSH"
19243 #: ../fish/guestfish.pod:963
19245 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19250 #: ../fish/guestfish.pod:966
19253 " eval \"`guestfish --listen --csh`\"\n"
19258 #: ../fish/guestfish.pod:968
19259 msgid "REMOTE CONTROL DETAILS"
19263 #: ../fish/guestfish.pod:970
19265 "Remote control happens over a Unix domain socket called "
19266 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
19267 "of the process, and C<$PID> is the process ID of the server."
19271 #: ../fish/guestfish.pod:974
19272 msgid "Guestfish client and server versions must match exactly."
19276 #: ../fish/guestfish.pod:976
19277 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
19281 #: ../fish/guestfish.pod:978
19283 "From Bash, you can use the following code which creates a guestfish "
19284 "instance, correctly quotes the command line, handles failure to start, and "
19285 "cleans up guestfish when the script exits:"
19289 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:965
19297 #: ../fish/guestfish.pod:986
19300 " guestfish[0]=\"guestfish\"\n"
19301 " guestfish[1]=\"--listen\"\n"
19302 " guestfish[2]=\"--ro\"\n"
19303 " guestfish[3]=\"-a\"\n"
19304 " guestfish[4]=\"disk.img\"\n"
19309 #: ../fish/guestfish.pod:992
19312 " GUESTFISH_PID=\n"
19313 " eval $(\"${guestfish[@]}\")\n"
19314 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
19315 " echo \"error: guestfish didn't start up, see error messages above\"\n"
19322 #: ../fish/guestfish.pod:999
19325 " cleanup_guestfish ()\n"
19327 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
19329 " trap cleanup_guestfish EXIT ERR\n"
19334 #: ../fish/guestfish.pod:1005
19337 " guestfish --remote -- run\n"
19342 #: ../fish/guestfish.pod:1007
19350 #: ../fish/guestfish.pod:1009
19351 msgid "REMOTE CONTROL RUN COMMAND HANGING"
19355 #: ../fish/guestfish.pod:1011
19357 "Using the C<run> (or C<launch>) command remotely in a command substitution "
19358 "context hangs, ie. don't do (note the backquotes):"
19362 #: ../fish/guestfish.pod:1014
19365 " a=`guestfish --remote run`\n"
19370 #: ../fish/guestfish.pod:1016
19372 "Since the C<run> command produces no output on stdout, this is not useful "
19373 "anyway. For further information see "
19374 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
19378 #: ../fish/guestfish.pod:1020
19379 msgid "PREPARED DISK IMAGES"
19383 #: ../fish/guestfish.pod:1022
19385 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
19386 "preformatted disk images that guestfish can make for you to save typing. "
19387 "This is particularly useful for testing purposes. This option is used "
19388 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
19389 "can be mixed with I<-a>)."
19393 #: ../fish/guestfish.pod:1028
19395 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
19396 "the second and so on. Existing files in the current directory are "
19401 #: ../fish/guestfish.pod:1032
19403 "The type briefly describes how the disk should be sized, partitioned, how "
19404 "filesystem(s) should be created, and how content should be added. "
19405 "Optionally the type can be followed by extra parameters, separated by C<:> "
19406 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
19407 "sparsely-allocated disk, containing a single partition, with the partition "
19408 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
19409 "on a 1GB disk instead."
19413 #: ../fish/guestfish.pod:1040
19414 msgid "To list the available types and any extra parameters they take, run:"
19418 #: ../fish/guestfish.pod:1044
19420 "Note that the prepared filesystem is not mounted. You would usually have to "
19421 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
19425 #: ../fish/guestfish.pod:1048
19427 "If any I<-N> or I<--new> options are given, the guest is automatically "
19432 #: ../fish/guestfish.pod:1053
19433 msgid "Create a 100MB disk with an ext4-formatted partition:"
19437 #: ../fish/guestfish.pod:1055
19440 " guestfish -N fs:ext4\n"
19445 #: ../fish/guestfish.pod:1057
19446 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
19450 #: ../fish/guestfish.pod:1059
19453 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
19458 #: ../fish/guestfish.pod:1061
19459 msgid "Create a blank 200MB disk:"
19463 #: ../fish/guestfish.pod:1063
19466 " guestfish -N disk:200M\n"
19471 #: ../fish/guestfish.pod:1065
19472 msgid "PROGRESS BARS"
19476 #: ../fish/guestfish.pod:1067
19478 "Some (not all) long-running commands send progress notification messages as "
19479 "they are running. Guestfish turns these messages into progress bars."
19483 #: ../fish/guestfish.pod:1071
19485 "When a command that supports progress bars takes longer than two seconds to "
19486 "run, and if progress bars are enabled, then you will see one appearing below "
19491 #: ../fish/guestfish.pod:1075
19494 " ><fs> copy-size /large-file /another-file 2048M\n"
19495 " / 10% [#####-----------------------------------------] 00:30\n"
19500 #: ../fish/guestfish.pod:1078
19502 "The spinner on the left hand side moves round once for every progress "
19503 "notification received from the backend. This is a (reasonably) golden "
19504 "assurance that the command is \"doing something\" even if the progress bar "
19505 "is not moving, because the command is able to send the progress "
19506 "notifications. When the bar reaches 100% and the command finishes, the "
19507 "spinner disappears."
19511 #: ../fish/guestfish.pod:1085
19513 "Progress bars are enabled by default when guestfish is used interactively. "
19514 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19515 "and you can disable them completely using I<--no-progress-bars>."
19519 #: ../fish/guestfish.pod:1090
19520 msgid "GUESTFISH COMMANDS"
19524 #: ../fish/guestfish.pod:1092
19526 "The commands in this section are guestfish convenience commands, in other "
19527 "words, they are not part of the L<guestfs(3)> API."
19531 #: ../fish/guestfish.pod:1095
19536 #: ../fish/guestfish.pod:1097
19545 #: ../fish/guestfish.pod:1100
19546 msgid "Without any parameter, this provides general help."
19550 #: ../fish/guestfish.pod:1102
19551 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19555 #: ../fish/guestfish.pod:1104
19556 msgid "quit | exit"
19560 #: ../fish/guestfish.pod:1106
19561 msgid "This exits guestfish. You can also use C<^D> key."
19565 #: ../fish/guestfish.pod:1108
19566 msgid "@FISH_COMMANDS@"
19570 #: ../fish/guestfish.pod:1110
19575 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1505
19580 #: ../fish/guestfish.pod:1116
19582 "guestfish returns 0 if the commands completed without error, or 1 if there "
19587 #: ../fish/guestfish.pod:1123
19592 #: ../fish/guestfish.pod:1125
19594 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19599 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3198
19600 msgid "FEBOOTSTRAP_KERNEL"
19604 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3200
19605 msgid "FEBOOTSTRAP_MODULES"
19609 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3202
19611 "These two environment variables allow the kernel that libguestfs uses in the "
19612 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
19613 "most recent host kernel is chosen. For more information about kernel "
19614 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
19615 "available in febootstrap E<ge> 3.8."
19619 #: ../fish/guestfish.pod:1138
19620 msgid "GUESTFISH_DISPLAY_IMAGE"
19624 #: ../fish/guestfish.pod:1140
19626 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
19627 "If not set, it uses L<display(1)>."
19631 #: ../fish/guestfish.pod:1143
19632 msgid "GUESTFISH_PID"
19636 #: ../fish/guestfish.pod:1145
19638 "Used with the I<--remote> option to specify the remote guestfish process to "
19639 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19643 #: ../fish/guestfish.pod:1149
19648 #: ../fish/guestfish.pod:1151
19650 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19651 "not specified, the external L<hexedit(1)> program is used."
19655 #: ../fish/guestfish.pod:1155
19660 #: ../fish/guestfish.pod:1157
19662 "If compiled with GNU readline support, various files in the home directory "
19663 "can be used. See L</FILES>."
19667 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3208
19668 msgid "LIBGUESTFS_APPEND"
19672 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3210
19673 msgid "Pass additional options to the guest kernel."
19677 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3212
19678 msgid "LIBGUESTFS_DEBUG"
19682 #: ../fish/guestfish.pod:1166
19684 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19685 "effect as using the B<-v> option."
19689 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3217
19690 msgid "LIBGUESTFS_MEMSIZE"
19694 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3219
19695 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
19699 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3222
19702 " LIBGUESTFS_MEMSIZE=700\n"
19707 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3224
19708 msgid "LIBGUESTFS_PATH"
19712 #: ../fish/guestfish.pod:1178
19714 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19715 "the discussion of paths in L<guestfs(3)>."
19719 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3229
19720 msgid "LIBGUESTFS_QEMU"
19724 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3231
19726 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
19727 "which was found at compile time by the configure script is used."
19731 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3237
19732 msgid "LIBGUESTFS_TRACE"
19736 #: ../fish/guestfish.pod:1189
19737 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19741 #: ../fish/guestfish.pod:1191
19746 #: ../fish/guestfish.pod:1193
19748 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19753 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:236 ../src/guestfs.pod:3242
19758 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3244
19760 "Location of temporary directory, defaults to C</tmp> except for the cached "
19761 "supermin appliance which defaults to C</var/tmp>."
19765 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3247
19767 "If libguestfs was compiled to use the supermin appliance then the real "
19768 "appliance is cached in this directory, shared between all handles belonging "
19769 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
19770 "use in case C</var/tmp> is not large enough."
19774 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297 ../rescue/virt-rescue.pod:273
19779 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301 ../rescue/virt-rescue.pod:277
19780 msgid "$HOME/.libguestfs-tools.rc"
19784 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303 ../rescue/virt-rescue.pod:279
19785 msgid "/etc/libguestfs-tools.conf"
19789 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305 ../rescue/virt-rescue.pod:281
19791 "This configuration file controls the default read-only or read-write mode "
19792 "(I<--ro> or I<--rw>)."
19796 #: ../fish/guestfish.pod:1220
19797 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
19801 #: ../fish/guestfish.pod:1222
19802 msgid "$HOME/.guestfish"
19806 #: ../fish/guestfish.pod:1224
19808 "If compiled with GNU readline support, then the command history is saved in "
19813 #: ../fish/guestfish.pod:1227
19814 msgid "$HOME/.inputrc"
19818 #: ../fish/guestfish.pod:1229
19819 msgid "/etc/inputrc"
19823 #: ../fish/guestfish.pod:1231
19825 "If compiled with GNU readline support, then these files can be used to "
19826 "configure readline. For further information, please see "
19827 "L<readline(3)/INITIALIZATION FILE>."
19831 #: ../fish/guestfish.pod:1235
19832 msgid "To write rules which only apply to guestfish, use:"
19836 #: ../fish/guestfish.pod:1237
19846 #: ../fish/guestfish.pod:1241
19848 "Variables that you can set in inputrc that change the behaviour of guestfish "
19849 "in useful ways include:"
19853 #: ../fish/guestfish.pod:1246
19854 msgid "completion-ignore-case (default: on)"
19858 #: ../fish/guestfish.pod:1248
19860 "By default, guestfish will ignore case when tab-completing paths on the "
19865 #: ../fish/guestfish.pod:1251
19868 " set completion-ignore-case off\n"
19873 #: ../fish/guestfish.pod:1253
19874 msgid "to make guestfish case sensitive."
19878 #: ../fish/guestfish.pod:1257
19883 #: ../fish/guestfish.pod:1259
19884 msgid "test2.img (etc)"
19888 #: ../fish/guestfish.pod:1261
19890 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
19891 "will be created in the file C<test1.img> in the current directory. The "
19892 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
19893 "the same name will be overwritten."
19897 #: ../fish/guestfish.pod:1270
19899 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, "
19900 "L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, "
19901 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, "
19902 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
19903 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
19904 "L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
19905 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
19906 "L<febootstrap-supermin-helper(8)>."
19910 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3339 ../test-tool/libguestfs-test-tool.pod:112
19911 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
19915 #: ../fish/virt-copy-in.pod:5
19916 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
19920 #: ../fish/virt-copy-in.pod:9
19923 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
19928 #: ../fish/virt-copy-in.pod:11
19931 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
19936 #: ../fish/virt-copy-in.pod:15
19938 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
19939 "causing disk corruption. The virtual machine must be shut down before you "
19940 "use this command."
19944 #: ../fish/virt-copy-in.pod:21
19946 "C<virt-copy-in> copies files and directories from the local disk into a "
19947 "virtual machine disk image or named libvirt domain."
19951 #: ../fish/virt-copy-in.pod:24
19953 "You can give one of more filenames and directories on the command line. "
19954 "Directories are copied in recursively. The final parameter must be the "
19955 "destination directory in the disk image which must be an absolute path "
19956 "starting with a C</> character."
19960 #: ../fish/virt-copy-in.pod:33
19963 " virt-copy-in -d MyGuest resolv.conf /etc\n"
19968 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
19969 msgid "Upload a home directory to a guest:"
19973 #: ../fish/virt-copy-in.pod:37
19976 " virt-copy-in -d MyGuest skel /home\n"
19981 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
19982 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
19986 #: ../fish/virt-copy-in.pod:41
19988 "This command is just a simple shell script wrapper around the "
19989 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
19990 "trivial copy, you are probably better off using guestfish directly."
19994 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
19996 "Since the shell script just passes options straight to guestfish, read "
19997 "L<guestfish(1)> to see the full list of options."
20001 #: ../fish/virt-copy-in.pod:52
20003 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
20004 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20008 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
20009 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20013 #: ../fish/virt-copy-out.pod:5
20015 "virt-copy-out - Copy files and directories out of a virtual machine disk "
20020 #: ../fish/virt-copy-out.pod:9
20023 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
20028 #: ../fish/virt-copy-out.pod:11
20031 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
20036 #: ../fish/virt-copy-out.pod:15
20038 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
20039 "image or named libvirt domain."
20043 #: ../fish/virt-copy-out.pod:18
20045 "You can give one of more filenames and directories on the command line. "
20046 "Directories are copied out recursively."
20050 #: ../fish/virt-copy-out.pod:23
20051 msgid "Download the home directories from a virtual machine:"
20055 #: ../fish/virt-copy-out.pod:25
20059 " virt-copy-out -d MyGuest /home homes\n"
20064 #: ../fish/virt-copy-out.pod:30
20066 "This command is just a simple shell script wrapper around the "
20067 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
20068 "trivial copy, you are probably better off using guestfish directly."
20072 #: ../fish/virt-copy-out.pod:41
20074 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
20075 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20079 #: ../fish/virt-tar-in.pod:5
20080 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
20084 #: ../fish/virt-tar-in.pod:9
20087 " virt-tar-in -a disk.img data.tar /destination\n"
20092 #: ../fish/virt-tar-in.pod:11
20095 " virt-tar-in -d domain data.tar /destination\n"
20100 #: ../fish/virt-tar-in.pod:13
20103 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
20108 #: ../fish/virt-tar-in.pod:17
20110 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
20111 "causing disk corruption. The virtual machine must be shut down before you "
20112 "use this command."
20116 #: ../fish/virt-tar-in.pod:23
20118 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
20119 "image or named libvirt domain."
20123 #: ../fish/virt-tar-in.pod:26
20125 "The first parameter is the tar file. Use C<-> to read the tar file from "
20126 "standard input. The second parameter is the absolute target directory to "
20131 #: ../fish/virt-tar-in.pod:34
20134 " virt-tar-in -d MyGuest homes.tar /home\n"
20139 #: ../fish/virt-tar-in.pod:38
20141 "This command is just a simple shell script wrapper around the "
20142 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
20143 "copy, you are probably better off using guestfish directly."
20147 #: ../fish/virt-tar-in.pod:49
20149 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20150 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
20151 "L<http://libguestfs.org/>."
20155 #: ../fish/virt-tar-out.pod:5
20156 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
20160 #: ../fish/virt-tar-out.pod:9
20163 " virt-tar-out -a disk.img /dir files.tar\n"
20168 #: ../fish/virt-tar-out.pod:11
20171 " virt-tar-out -d domain /dir files.tar\n"
20176 #: ../fish/virt-tar-out.pod:13
20179 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
20184 #: ../fish/virt-tar-out.pod:17
20185 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
20189 #: ../fish/virt-tar-out.pod:20
20191 "The first parameter is the absolute path of the virtual machine directory. "
20192 "The second parameter is the tar file to write. Use C<-> to write to "
20197 #: ../fish/virt-tar-out.pod:26
20198 msgid "Download the home directories from a guest:"
20202 #: ../fish/virt-tar-out.pod:28
20205 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
20210 #: ../fish/virt-tar-out.pod:32
20212 "This command is just a simple shell script wrapper around the "
20213 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
20214 "trivial copy, you are probably better off using guestfish directly."
20218 #: ../fish/virt-tar-out.pod:43
20220 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20221 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
20225 #: ../fuse/guestmount.pod:5
20226 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
20230 #: ../fuse/guestmount.pod:9
20233 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
20238 #: ../fuse/guestmount.pod:11
20241 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
20246 #: ../fuse/guestmount.pod:13
20249 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
20254 #: ../fuse/guestmount.pod:17
20256 "You must I<not> use C<guestmount> in read-write mode on live virtual "
20257 "machines. If you do this, you risk disk corruption in the VM."
20261 #: ../fuse/guestmount.pod:22
20263 "The guestmount program can be used to mount virtual machine filesystems and "
20264 "other disk images on the host. It uses libguestfs for access to the guest "
20265 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
20266 "a mountable device."
20270 #: ../fuse/guestmount.pod:27
20272 "Along with other options, you have to give at least one device (I<-a> "
20273 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
20274 "option) or use the I<-i> inspection option. How this works is better "
20275 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
20280 #: ../fuse/guestmount.pod:33
20282 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
20283 "by you, and the filesystem will not be visible to any other users unless you "
20284 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
20285 "the filesystem, use the C<fusermount -u> command."
20289 #: ../fuse/guestmount.pod:41
20291 "For a typical Windows guest which has its main filesystem on the first "
20296 #: ../fuse/guestmount.pod:44
20299 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
20304 #: ../fuse/guestmount.pod:46
20306 "For a typical Linux guest which has a /boot filesystem on the first "
20307 "partition, and the root filesystem on a logical volume:"
20311 #: ../fuse/guestmount.pod:49
20314 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
20319 #: ../fuse/guestmount.pod:51
20320 msgid "To get libguestfs to detect guest mountpoints for you:"
20324 #: ../fuse/guestmount.pod:53
20327 " guestmount -a guest.img -i --ro /mnt\n"
20332 #: ../fuse/guestmount.pod:55
20333 msgid "For a libvirt guest called \"Guest\" you could do:"
20337 #: ../fuse/guestmount.pod:57
20340 " guestmount -d Guest -i --ro /mnt\n"
20345 #: ../fuse/guestmount.pod:59
20347 "If you don't know what filesystems are contained in a guest or disk image, "
20348 "use L<virt-filesystems(1)> first:"
20352 #: ../fuse/guestmount.pod:62
20355 " virt-filesystems MyGuest\n"
20360 #: ../fuse/guestmount.pod:64
20362 "If you want to trace the libguestfs calls but without excessive debugging "
20363 "information, we recommend:"
20367 #: ../fuse/guestmount.pod:67
20370 " guestmount [...] --trace /mnt\n"
20375 #: ../fuse/guestmount.pod:69
20376 msgid "If you want to debug the program, we recommend:"
20380 #: ../fuse/guestmount.pod:71
20383 " guestmount [...] --trace --verbose /mnt\n"
20388 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68 ../resize/virt-resize.pod:544
20393 #: ../fuse/guestmount.pod:75
20394 msgid "Other users cannot see the filesystem by default"
20398 #: ../fuse/guestmount.pod:77
20400 "If you mount a filesystem as one user (eg. root), then other users will not "
20401 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
20402 "option when mounting:"
20406 #: ../fuse/guestmount.pod:81
20409 " sudo guestmount [...] -o allow_other /mnt\n"
20414 #: ../fuse/guestmount.pod:83
20415 msgid "Enabling FUSE"
20419 #: ../fuse/guestmount.pod:85
20421 "On some distros, you may need to add yourself to a special group "
20422 "(eg. C<fuse>) before you can use any FUSE filesystem. This is necessary on "
20423 "Debian and derivatives."
20427 #: ../fuse/guestmount.pod:89
20429 "On other distros, no special group is required. It is not necessary on "
20430 "Fedora or Red Hat Enterprise Linux."
20434 #: ../fuse/guestmount.pod:100
20435 msgid "Add a block device or virtual machine image."
20439 #: ../fuse/guestmount.pod:123
20440 msgid "B<--dir-cache-timeout N>"
20444 #: ../fuse/guestmount.pod:125
20446 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
20447 "seconds. The readdir cache [actually, there are several semi-independent "
20448 "caches] is populated after a readdir(2) call with the stat and extended "
20449 "attributes of the files in the directory, in anticipation that they will be "
20450 "requested soon after."
20454 #: ../fuse/guestmount.pod:131
20456 "There is also a different attribute cache implemented by FUSE (see the FUSE "
20457 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
20458 "requests, only cache existing ones."
20462 #: ../fuse/guestmount.pod:151
20464 "If you have untrusted raw-format guest disk images, you should use this "
20465 "option to specify the disk format. This avoids a possible security problem "
20466 "with malicious guests (CVE-2010-3851). See also "
20467 "L<guestfs(3)/guestfs_add_drive_opts>."
20471 #: ../fuse/guestmount.pod:156
20472 msgid "B<--fuse-help>"
20476 #: ../fuse/guestmount.pod:158
20477 msgid "Display help on special FUSE options (see I<-o> below)."
20481 #: ../fuse/guestmount.pod:162
20482 msgid "Display brief help and exit."
20486 #: ../fuse/guestmount.pod:186
20488 "Mount the named partition or logical volume on the given mountpoint B<in the "
20489 "guest> (this has nothing to do with mountpoints in the host)."
20493 #: ../fuse/guestmount.pod:189
20495 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
20496 "something on C</>."
20500 #: ../fuse/guestmount.pod:206
20502 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
20503 "unmounted. If you specify this option, then we don't attempt to sync the "
20504 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
20508 #: ../fuse/guestmount.pod:211
20509 msgid "B<-o option>"
20513 #: ../fuse/guestmount.pod:213
20514 msgid "B<--option option>"
20518 #: ../fuse/guestmount.pod:215
20519 msgid "Pass extra options to FUSE."
20523 #: ../fuse/guestmount.pod:217
20525 "To get a list of all the extra options supported by FUSE, use the command "
20526 "below. Note that only the FUSE I<-o> options can be passed, and only some "
20527 "of them are a good idea."
20531 #: ../fuse/guestmount.pod:221
20534 " guestmount --fuse-help\n"
20539 #: ../fuse/guestmount.pod:223
20540 msgid "Some potentially useful FUSE options:"
20544 #: ../fuse/guestmount.pod:227
20545 msgid "B<-o allow_other>"
20549 #: ../fuse/guestmount.pod:229
20550 msgid "Allow other users to see the filesystem."
20554 #: ../fuse/guestmount.pod:231
20555 msgid "B<-o attr_timeout=N>"
20559 #: ../fuse/guestmount.pod:233
20560 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
20564 #: ../fuse/guestmount.pod:235
20565 msgid "B<-o kernel_cache>"
20569 #: ../fuse/guestmount.pod:237
20571 "Allow the kernel to cache files (reduces the number of reads that have to go "
20572 "through the L<guestfs(3)> API). This is generally a good idea if you can "
20573 "afford the extra memory usage."
20577 #: ../fuse/guestmount.pod:241
20578 msgid "B<-o uid=N> B<-o gid=N>"
20582 #: ../fuse/guestmount.pod:243
20584 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
20585 "the chosen values."
20589 #: ../fuse/guestmount.pod:252
20591 "Add devices and mount everything read-only. Also disallow writes and make "
20592 "the disk appear read-only to FUSE."
20596 #: ../fuse/guestmount.pod:255
20598 "This is highly recommended if you are not going to edit the guest disk. If "
20599 "the guest is running and this option is I<not> supplied, then there is a "
20600 "strong risk of disk corruption in the guest. We try to prevent this from "
20601 "happening, but it is not always possible."
20605 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:171
20606 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20610 #: ../fuse/guestmount.pod:264
20611 msgid "Enable SELinux support for the guest."
20615 #: ../fuse/guestmount.pod:270
20616 msgid "Enable verbose messages from underlying libguestfs."
20620 #: ../fuse/guestmount.pod:276
20621 msgid "Display the program version and exit."
20625 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308 ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
20626 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20630 #: ../fuse/guestmount.pod:289
20635 #: ../fuse/guestmount.pod:291
20636 msgid "Trace libguestfs calls and entry into each FUSE function."
20640 #: ../fuse/guestmount.pod:293
20641 msgid "This also stops the daemon from forking into the background."
20645 #: ../fuse/guestmount.pod:319
20647 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
20648 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
20649 "L<http://fuse.sf.net/>."
20653 #: ../fuse/guestmount.pod:334
20654 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
20658 #: ../inspector/virt-inspector.pod:5
20660 "virt-inspector - Display operating system version and other information "
20661 "about a virtual machine"
20665 #: ../inspector/virt-inspector.pod:9
20668 " virt-inspector [--options] -d domname\n"
20673 #: ../inspector/virt-inspector.pod:11
20676 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
20681 #: ../inspector/virt-inspector.pod:15
20684 " virt-inspector domname\n"
20689 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
20692 " virt-inspector disk.img [disk.img ...]\n"
20697 #: ../inspector/virt-inspector.pod:21
20699 "B<virt-inspector> examines a virtual machine or disk image and tries to "
20700 "determine the version of the operating system and other information about "
20701 "the virtual machine."
20705 #: ../inspector/virt-inspector.pod:25
20706 msgid "Virt-inspector produces XML output for feeding into other programs."
20710 #: ../inspector/virt-inspector.pod:27
20712 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
20713 "the libvirt domain (see: C<virsh list --all>)."
20717 #: ../inspector/virt-inspector.pod:30
20719 "You can also run virt-inspector directly on disk images from a single "
20720 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
20721 "has several block devices, in which case you should list several I<-a> "
20722 "options one after another, with the first corresponding to the guest's "
20723 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
20727 #: ../inspector/virt-inspector.pod:37
20729 "You can also run virt-inspector on install disks, live CDs, bootable USB "
20730 "keys and similar."
20734 #: ../inspector/virt-inspector.pod:40
20736 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
20737 "inspect several virtual machines, you have to run virt-inspector several "
20738 "times (for example, from a shell script for-loop)."
20742 #: ../inspector/virt-inspector.pod:45
20744 "Because virt-inspector needs direct access to guest images, it won't "
20745 "normally work over remote libvirt connections."
20749 #: ../inspector/virt-inspector.pod:48
20751 "All of the information available from virt-inspector is also available "
20752 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
20753 "The same information can also be fetched using guestfish or via libguestfs "
20754 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
20755 "WITH OTHER PROGRAMMING LANGUAGES>)."
20759 #: ../inspector/virt-inspector.pod:81
20761 "Libvirt is only used if you specify a C<domname> on the command line. If "
20762 "you specify guest block devices directly (I<-a>), then libvirt is not used "
20767 #: ../inspector/virt-inspector.pod:94
20769 "When prompting for keys and passphrases, virt-inspector normally turns "
20770 "echoing off so you cannot see what you are typing. If you are not worried "
20771 "about Tempest attacks and there is no one else in the room you can specify "
20772 "this flag to see what you are typing."
20776 #: ../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
20778 "Specify the format of disk images given on the command line. If this is "
20779 "omitted then the format is autodetected from the content of the disk image."
20783 #: ../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
20785 "If disk images are requested from libvirt, then this program asks libvirt "
20786 "for this information. In this case, the value of the format parameter is "
20791 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:314 ../resize/virt-resize.pod:406 ../sparsify/virt-sparsify.pod:132 ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102 ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
20793 "If working with untrusted raw-format guest disk images, you should ensure "
20794 "the format is always specified."
20798 #: ../inspector/virt-inspector.pod:139
20799 msgid "Previous versions of virt-inspector allowed you to write either:"
20803 #: ../inspector/virt-inspector.pod:145
20806 " virt-inspector guestname\n"
20811 #: ../inspector/virt-inspector.pod:153
20816 #: ../inspector/virt-inspector.pod:155
20818 "The virt-inspector XML is described precisely in a RELAX NG schema file "
20819 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
20820 "just an overview."
20824 #: ../inspector/virt-inspector.pod:159
20826 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
20827 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
20828 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
20829 "which is vanishingly rare in real world VMs."
20833 #: ../inspector/virt-inspector.pod:164
20834 msgid "E<lt>operatingsystemE<gt>"
20838 #: ../inspector/virt-inspector.pod:166
20840 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
20841 "describe the operating system, its architecture, the descriptive \"product "
20842 "name\" string, the type of OS and so on, as in this example:"
20846 #: ../inspector/virt-inspector.pod:170
20849 " <operatingsystems>\n"
20850 " <operatingsystem>\n"
20851 " <root>/dev/sda2</root>\n"
20852 " <name>windows</name>\n"
20853 " <arch>i386</arch>\n"
20854 " <distro>windows</distro>\n"
20855 " <product_name>Windows 7 Enterprise</product_name>\n"
20856 " <product_variant>Client</product_variant>\n"
20857 " <major_version>6</major_version>\n"
20858 " <minor_version>1</minor_version>\n"
20859 " <windows_systemroot>/Windows</windows_systemroot>\n"
20860 " <format>installed</format>\n"
20865 #: ../inspector/virt-inspector.pod:183
20867 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
20868 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
20869 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
20870 "architecture. The other fields are fairly self-explanatory, but because "
20871 "these fields are taken directly from the libguestfs inspection API you can "
20872 "find precise information from L<guestfs(3)/INSPECTION>."
20876 #: ../inspector/virt-inspector.pod:191
20878 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
20879 "of view of libguestfs (block devices may have completely different names "
20880 "inside the VM itself)."
20884 #: ../inspector/virt-inspector.pod:195
20885 msgid "E<lt>mountpointsE<gt>"
20889 #: ../inspector/virt-inspector.pod:197
20891 "Un*x-like guests typically have multiple filesystems which are mounted at "
20892 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
20893 "element which looks like this:"
20897 #: ../inspector/virt-inspector.pod:201
20900 " <operatingsystems>\n"
20901 " <operatingsystem>\n"
20904 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
20905 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
20906 " </mountpoints>\n"
20911 #: ../inspector/virt-inspector.pod:209
20913 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
20914 "and may have completely different names inside the guest. Only mountable "
20915 "filesystems appear in this list, not things like swap devices."
20919 #: ../inspector/virt-inspector.pod:214
20920 msgid "E<lt>filesystemsE<gt>"
20924 #: ../inspector/virt-inspector.pod:216
20926 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
20927 "filesystems belonging to the guest, including swap and empty partitions. "
20928 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
20929 "this OS or shared with this OS and other OSes)."
20933 #: ../inspector/virt-inspector.pod:222
20934 msgid "You might see something like this:"
20938 #: ../inspector/virt-inspector.pod:224
20941 " <operatingsystems>\n"
20942 " <operatingsystem>\n"
20945 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
20946 " <type>ext4</type>\n"
20947 " <label>Fedora-13-x86_64</label>\n"
20948 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
20954 #: ../inspector/virt-inspector.pod:234
20956 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
20957 "the label, and the UUID."
20961 #: ../inspector/virt-inspector.pod:237
20962 msgid "E<lt>applicationsE<gt>"
20966 #: ../inspector/virt-inspector.pod:239
20968 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
20969 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
20974 #: ../inspector/virt-inspector.pod:243
20976 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
20977 "Typical values would be C<rpm> and C<deb>."
20981 #: ../inspector/virt-inspector.pod:246
20983 "E<lt>package_managementE<gt>, if present, describes the package manager. "
20984 "Typical values include C<yum>, C<up2date> and C<apt>"
20988 #: ../inspector/virt-inspector.pod:249
20989 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
20993 #: ../inspector/virt-inspector.pod:252
20996 " <operatingsystems>\n"
20997 " <operatingsystem>\n"
20999 " <applications>\n"
21001 " <name>coreutils</name>\n"
21002 " <version>8.5</version>\n"
21003 " <release>1</release>\n"
21004 " </application>\n"
21009 #: ../inspector/virt-inspector.pod:262
21011 "The version and release fields may not be available for some types guests. "
21012 "Other fields are possible, see "
21013 "L<guestfs(3)/guestfs_inspect_list_applications>."
21017 #: ../inspector/virt-inspector.pod:266
21018 msgid "E<lt>drive_mappingsE<gt>"
21022 #: ../inspector/virt-inspector.pod:268
21024 "For operating systems like Windows which use drive letters, virt-inspector "
21025 "is able to find out how drive letters map to filesystems."
21029 #: ../inspector/virt-inspector.pod:272
21032 " <operatingsystems>\n"
21033 " <operatingsystem>\n"
21035 " <drive_mappings>\n"
21036 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
21037 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
21038 " </drive_mappings>\n"
21043 #: ../inspector/virt-inspector.pod:280
21045 "In the example above, drive C maps to the filesystem on the second partition "
21046 "on the first disk, and drive E maps to the filesystem on the first partition "
21047 "on the second disk."
21051 #: ../inspector/virt-inspector.pod:284
21053 "Note that this only covers permanent local filesystem mappings, not things "
21054 "like network shares. Furthermore NTFS volume mount points may not be listed "
21059 #: ../inspector/virt-inspector.pod:288
21060 msgid "E<lt>iconE<gt>"
21064 #: ../inspector/virt-inspector.pod:290
21066 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
21067 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
21068 "very large and high quality."
21072 #: ../inspector/virt-inspector.pod:294
21075 " <operatingsystems>\n"
21076 " <operatingsystem>\n"
21079 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
21080 " [... many lines of base64 data ...]\n"
21086 #: ../inspector/virt-inspector.pod:302
21088 "To display the icon, you have to extract it and convert the base64 data back "
21089 "to a binary file. Use an XPath query or simply an editor to extract the "
21090 "data, then use the coreutils L<base64(1)> program to do the conversion back "
21095 #: ../inspector/virt-inspector.pod:307
21098 " base64 -i -d < icon.data > icon.png\n"
21103 #: ../inspector/virt-inspector.pod:309
21104 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
21108 #: ../inspector/virt-inspector.pod:311
21110 "Virt-inspector can detect some operating system installers on install disks, "
21111 "live CDs, bootable USB keys and more."
21115 #: ../inspector/virt-inspector.pod:314
21117 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
21118 "fields may be present to indicate a live CD, network installer, or one part "
21119 "of a multipart CD. For example:"
21123 #: ../inspector/virt-inspector.pod:318
21126 " <operatingsystems>\n"
21127 " <operatingsystem>\n"
21128 " <root>/dev/sda</root>\n"
21129 " <name>linux</name>\n"
21130 " <arch>i386</arch>\n"
21131 " <distro>ubuntu</distro>\n"
21132 " <product_name>Ubuntu 10.10 "Maverick "
21133 "Meerkat"</product_name>\n"
21134 " <major_version>10</major_version>\n"
21135 " <minor_version>10</minor_version>\n"
21136 " <format>installer</format>\n"
21142 #: ../inspector/virt-inspector.pod:330
21143 msgid "USING XPATH"
21147 #: ../inspector/virt-inspector.pod:332
21149 "You can use the XPath query language to select parts of the XML. We "
21150 "recommend using C<xmlstarlet> to perform XPath queries from the command "
21155 #: ../inspector/virt-inspector.pod:338
21158 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
21160 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21161 " <type>ext4</type>\n"
21167 #: ../inspector/virt-inspector.pod:344
21170 " $ virt-inspector -d Guest | \\\n"
21171 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
21177 #: ../inspector/virt-inspector.pod:348
21180 " $ virt-inspector -d Guest | \\\n"
21181 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
21182 " [displays the guest icon, if there is one]\n"
21187 #: ../inspector/virt-inspector.pod:359
21188 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
21192 #: ../inspector/virt-inspector.pod:361
21194 "Early versions of libguestfs shipped with a different virt-inspector program "
21195 "written in Perl (the current version is written in C). The XML output of "
21196 "the Perl virt-inspector was different and it could also output in other "
21197 "formats like text."
21201 #: ../inspector/virt-inspector.pod:366
21202 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
21206 #: ../inspector/virt-inspector.pod:369
21208 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
21209 "versions of virt-inspector with different names:"
21213 #: ../inspector/virt-inspector.pod:372
21216 " virt-inspector Old Perl version.\n"
21217 " virt-inspector2 New C version.\n"
21222 #: ../inspector/virt-inspector.pod:382
21224 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
21225 "L<base64(1)>, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
21229 #: ../inspector/virt-inspector.pod:399
21230 msgid "Matthew Booth L<mbooth@redhat.com>"
21234 #: ../java/examples/guestfs-java.pod:5
21235 msgid "guestfs-java - How to use libguestfs from Java"
21239 #: ../java/examples/guestfs-java.pod:9
21242 " import com.redhat.et.libguestfs.*;\n"
21247 #: ../java/examples/guestfs-java.pod:11
21250 " GuestFS g = new GuestFS ();\n"
21251 " g.add_drive_opts (\"disk.img\", null);\n"
21257 #: ../java/examples/guestfs-java.pod:17
21259 "This manual page documents how to call libguestfs from the Java programming "
21260 "language. This page just documents the differences from the C API and gives "
21261 "some examples. If you are not familiar with using libguestfs, you also need "
21262 "to read L<guestfs(3)>."
21266 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
21267 msgid "CLOSING THE HANDLE"
21271 #: ../java/examples/guestfs-java.pod:24
21273 "The handle is closed when it is reaped by the garbage collector. Because "
21274 "libguestfs handles include a lot of state, it is also possible to close (and "
21275 "hence free) them explicitly by calling the C<close> method."
21279 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
21284 #: ../java/examples/guestfs-java.pod:31
21286 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
21287 "exception. This has a single parameter which is the error message (a "
21292 #: ../java/examples/guestfs-java.pod:35
21293 msgid "Calling any method on a closed handle raises the same exception."
21297 #: ../java/examples/guestfs-java.pod:47
21299 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21300 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21301 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21302 "L<http://caml.inria.fr/>."
21306 #: ../ocaml/examples/guestfs-ocaml.pod:5
21307 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
21311 #: ../ocaml/examples/guestfs-ocaml.pod:9
21312 msgid "Module style:"
21316 #: ../ocaml/examples/guestfs-ocaml.pod:11
21319 " let g = Guestfs.create () in\n"
21320 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21321 " Guestfs.launch g;\n"
21326 #: ../ocaml/examples/guestfs-ocaml.pod:15
21327 msgid "Object-oriented style:"
21331 #: ../ocaml/examples/guestfs-ocaml.pod:17
21334 " let g = new Guestfs.guestfs () in\n"
21335 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21341 #: ../ocaml/examples/guestfs-ocaml.pod:21
21344 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
21346 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
21351 #: ../ocaml/examples/guestfs-ocaml.pod:27
21353 "This manual page documents how to call libguestfs from the OCaml programming "
21354 "language. This page just documents the differences from the C API and gives "
21355 "some examples. If you are not familiar with using libguestfs, you also need "
21356 "to read L<guestfs(3)>."
21360 #: ../ocaml/examples/guestfs-ocaml.pod:32
21361 msgid "PROGRAMMING STYLES"
21365 #: ../ocaml/examples/guestfs-ocaml.pod:34
21367 "There are two different programming styles supported by the OCaml bindings. "
21368 "You can use a module style, with each C function mapped to an OCaml "
21373 #: ../ocaml/examples/guestfs-ocaml.pod:38
21376 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
21381 #: ../ocaml/examples/guestfs-ocaml.pod:40
21386 #: ../ocaml/examples/guestfs-ocaml.pod:42
21389 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
21394 #: ../ocaml/examples/guestfs-ocaml.pod:44
21396 "Alternately you can use an object-oriented style, calling methods on the "
21397 "class C<Guestfs.guestfs>:"
21401 #: ../ocaml/examples/guestfs-ocaml.pod:47
21404 " method set_verbose : bool -> unit\n"
21409 #: ../ocaml/examples/guestfs-ocaml.pod:49
21411 "The object-oriented style is usually briefer, and the minor performance "
21412 "penalty isn't noticable in the general overhead of performing libguestfs "
21417 #: ../ocaml/examples/guestfs-ocaml.pod:55
21419 "The handle is closed when it is reaped by the garbage collector. Because "
21420 "libguestfs handles include a lot of state, it is also possible to close (and "
21421 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
21426 #: ../ocaml/examples/guestfs-ocaml.pod:62
21428 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
21429 "exception. This has a single parameter which is the error message (a "
21434 #: ../ocaml/examples/guestfs-ocaml.pod:66
21436 "Calling any function/method on a closed handle raises "
21437 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
21442 #: ../ocaml/examples/guestfs-ocaml.pod:80
21444 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21445 "L<guestfs-java(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21446 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21447 "L<http://caml.inria.fr/>."
21451 #: ../perl/examples/guestfs-perl.pod:5
21452 msgid "guestfs-perl - How to use libguestfs from Perl"
21456 #: ../perl/examples/guestfs-perl.pod:9
21459 " use Sys::Guestfs;\n"
21464 #: ../perl/examples/guestfs-perl.pod:11
21467 " my $h = Sys::Guestfs->new ();\n"
21468 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
21469 " $h->launch ();\n"
21470 " $h->mount_options ('', '/dev/sda1', '/');\n"
21471 " $h->touch ('/hello');\n"
21477 #: ../perl/examples/guestfs-perl.pod:20
21479 "This manual page documents how to call libguestfs from the Perl programming "
21480 "language. This page just documents the differences from the C API and gives "
21481 "some examples. If you are not familiar with using libguestfs, you also need "
21482 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
21486 #: ../perl/examples/guestfs-perl.pod:26
21491 #: ../perl/examples/guestfs-perl.pod:28
21493 "Errors from libguestfs functions turn into calls to C<croak> (see "
21498 #: ../perl/examples/guestfs-perl.pod:41
21500 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
21501 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
21502 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
21503 "L<http://libguestfs.org/>."
21507 #: ../python/examples/guestfs-python.pod:5
21508 msgid "guestfs-python - How to use libguestfs from Python"
21512 #: ../python/examples/guestfs-python.pod:9
21515 " import guestfs\n"
21516 " g = guestfs.GuestFS ()\n"
21517 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
21523 #: ../python/examples/guestfs-python.pod:16
21525 "This manual page documents how to call libguestfs from the Python "
21526 "programming language. This page just documents the differences from the C "
21527 "API and gives some examples. If you are not familiar with using libguestfs, "
21528 "you also need to read L<guestfs(3)>."
21532 #: ../python/examples/guestfs-python.pod:23
21534 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
21535 "single string argument which is the error message."
21539 #: ../python/examples/guestfs-python.pod:26
21540 msgid "MORE DOCUMENTATION"
21544 #: ../python/examples/guestfs-python.pod:28
21549 #: ../python/examples/guestfs-python.pod:30
21553 " >>> import guestfs\n"
21554 " >>> help (guestfs)\n"
21559 #: ../python/examples/guestfs-python.pod:44
21561 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21562 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
21563 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
21567 #: ../rescue/virt-rescue.pod:5
21568 msgid "virt-rescue - Run a rescue shell on a virtual machine"
21572 #: ../rescue/virt-rescue.pod:9
21575 " virt-rescue [--options] -d domname\n"
21580 #: ../rescue/virt-rescue.pod:11
21583 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
21588 #: ../rescue/virt-rescue.pod:15
21591 " virt-rescue [--options] domname\n"
21596 #: ../rescue/virt-rescue.pod:17
21599 " virt-rescue [--options] disk.img [disk.img ...]\n"
21604 #: ../rescue/virt-rescue.pod:21
21606 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
21607 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
21608 "you from doing this, but doesn't catch all cases."
21612 #: ../rescue/virt-rescue.pod:25
21614 "However if you use the I<--ro> (read only) option, then you can attach a "
21615 "shell to a live virtual machine. The results might be strange or "
21616 "inconsistent at times but you won't get disk corruption."
21620 #: ../rescue/virt-rescue.pod:31
21622 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
21623 "need for a CD. virt-rescue gives you a rescue shell and some simple "
21624 "recovery tools which you can use to examine or rescue a virtual machine or "
21629 #: ../rescue/virt-rescue.pod:36
21631 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
21632 "on disk image(s):"
21636 #: ../rescue/virt-rescue.pod:39
21639 " virt-rescue -d GuestName\n"
21644 #: ../rescue/virt-rescue.pod:41
21647 " virt-rescue --ro -a /path/to/disk.img\n"
21652 #: ../rescue/virt-rescue.pod:43
21655 " virt-rescue -a /dev/sdc\n"
21660 #: ../rescue/virt-rescue.pod:45
21661 msgid "For live VMs you I<must> use the --ro option."
21665 #: ../rescue/virt-rescue.pod:47
21667 "When you run virt-rescue on a virtual machine or disk image, you are placed "
21668 "in an interactive bash shell where you can use many ordinary Linux "
21669 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
21670 "appliance. You must mount the virtual machine's filesystems by hand. There "
21671 "is an empty directory called C</sysroot> where you can mount filesystems."
21675 #: ../rescue/virt-rescue.pod:54
21677 "In the example below, we list logical volumes, then choose one to mount "
21678 "under C</sysroot>:"
21682 #: ../rescue/virt-rescue.pod:57
21686 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
21687 " lv_root vg_f11x64 -wi-a- 8.83G\n"
21688 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
21689 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
21690 " ><rescue> ls /sysroot\n"
21695 #: ../rescue/virt-rescue.pod:64
21697 "If you don't know what filesystems are available on the virtual machine then "
21698 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
21702 #: ../rescue/virt-rescue.pod:70
21704 "Virt-rescue can be used on I<any> disk image file or device, not just a "
21705 "virtual machine. For example you can use it on a blank file if you want to "
21706 "partition that file (although we would recommend using L<guestfish(1)> "
21707 "instead as it is more suitable for this purpose). You can even use "
21708 "virt-rescue on things like SD cards."
21712 #: ../rescue/virt-rescue.pod:76
21714 "Virt-rescue does not require root. You only need to run it as root if you "
21715 "need root to open the disk image."
21719 #: ../rescue/virt-rescue.pod:79
21721 "This tool is just designed for quick interactive hacking on a virtual "
21722 "machine. For more structured access to a virtual machine disk image, you "
21723 "should use L<guestfs(3)>. To get a structured shell that you can use to "
21724 "make scripted changes to guests, use L<guestfish(1)>."
21728 #: ../rescue/virt-rescue.pod:103
21729 msgid "B<--append kernelopts>"
21733 #: ../rescue/virt-rescue.pod:105
21734 msgid "Pass additional options to the rescue kernel."
21738 #: ../rescue/virt-rescue.pod:135
21741 " virt-rescue --format=raw -a disk.img\n"
21746 #: ../rescue/virt-rescue.pod:139
21749 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
21754 #: ../rescue/virt-rescue.pod:148
21759 #: ../rescue/virt-rescue.pod:150
21760 msgid "B<--memsize MB>"
21764 #: ../rescue/virt-rescue.pod:152
21766 "Change the amount of memory allocated to the rescue system. The default is "
21767 "set by libguestfs and is small but adequate for running system tools. The "
21768 "occasional program might need more memory. The parameter is specified in "
21773 #: ../rescue/virt-rescue.pod:157
21774 msgid "B<--network>"
21778 #: ../rescue/virt-rescue.pod:159
21779 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
21783 #: ../rescue/virt-rescue.pod:165
21784 msgid "Open the image read-only."
21788 #: ../rescue/virt-rescue.pod:175
21790 "Enable SELinux in the rescue appliance. You should read "
21791 "L<guestfs(3)/SELINUX> before using this option."
21795 #: ../rescue/virt-rescue.pod:178
21800 #: ../rescue/virt-rescue.pod:180
21801 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
21805 #: ../rescue/virt-rescue.pod:198
21807 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
21808 "are done read-write."
21812 #: ../rescue/virt-rescue.pod:211
21813 msgid "Previous versions of virt-rescue allowed you to write either:"
21817 #: ../rescue/virt-rescue.pod:213
21820 " virt-rescue disk.img [disk.img ...]\n"
21825 #: ../rescue/virt-rescue.pod:217
21828 " virt-rescue guestname\n"
21833 #: ../rescue/virt-rescue.pod:225
21838 #: ../rescue/virt-rescue.pod:227
21840 "Adding the I<--network> option enables QEMU user networking in the rescue "
21841 "appliance. There are some differences between user networking and ordinary "
21846 #: ../rescue/virt-rescue.pod:233
21847 msgid "ping does not work"
21851 #: ../rescue/virt-rescue.pod:235
21853 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
21854 "send the ping packets, and because virt-rescue must be able to run as "
21855 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
21856 "command. The ping command will appear to resolve addresses but will not be "
21857 "able to send or receive any packets. This does not mean that the network is "
21862 #: ../rescue/virt-rescue.pod:242
21863 msgid "cannot receive connections"
21867 #: ../rescue/virt-rescue.pod:244
21868 msgid "QEMU user networking cannot receive incoming connections."
21872 #: ../rescue/virt-rescue.pod:246
21873 msgid "making TCP connections"
21877 #: ../rescue/virt-rescue.pod:248
21879 "The virt-rescue appliance needs to be small and so does not include many "
21880 "network tools. In particular there is no L<telnet(1)> command. You can "
21881 "make TCP connections from the shell using the magical "
21882 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
21886 #: ../rescue/virt-rescue.pod:253
21889 " exec 3<>/dev/tcp/redhat.com/80\n"
21890 " echo \"GET /\" >&3\n"
21896 #: ../rescue/virt-rescue.pod:257
21897 msgid "See L<bash(1)> for more details."
21901 #: ../rescue/virt-rescue.pod:263
21903 "Several environment variables affect virt-rescue. See "
21904 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
21908 #: ../rescue/virt-rescue.pod:290
21910 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
21911 "L<http://libguestfs.org/>."
21915 #: ../resize/virt-resize.pod:5
21916 msgid "virt-resize - Resize a virtual machine disk"
21920 #: ../resize/virt-resize.pod:9
21923 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
21924 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
21925 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
21930 #: ../resize/virt-resize.pod:15
21932 "Virt-resize is a tool which can resize a virtual machine disk, making it "
21933 "larger or smaller overall, and resizing or deleting any partitions contained "
21938 #: ../resize/virt-resize.pod:19
21940 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
21941 "not> be used on live virtual machines - for consistent results, shut the "
21942 "virtual machine down before resizing it."
21946 #: ../resize/virt-resize.pod:23
21948 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
21949 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
21953 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:520 ../sparsify/virt-sparsify.pod:203 ../src/guestfs.pod:469 ../src/guestfs.pod:1287 ../src/guestfs.pod:1426 ../src/guestfs.pod:2675
21958 #: ../resize/virt-resize.pod:33
21960 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
21961 "fill the extra 5GB of space."
21965 #: ../resize/virt-resize.pod:36
21968 " virt-filesystems --long -h --all -a olddisk\n"
21973 #: ../resize/virt-resize.pod:38
21976 " truncate -r olddisk newdisk\n"
21977 " truncate -s +5G newdisk\n"
21982 #: ../resize/virt-resize.pod:41
21985 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
21986 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
21991 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:527 ../sparsify/virt-sparsify.pod:210 ../src/guestfs.pod:475 ../src/guestfs.pod:1291 ../src/guestfs.pod:1430 ../src/guestfs.pod:2700
21996 #: ../resize/virt-resize.pod:46
21998 "As above, but make the /boot partition 200MB bigger, while giving the "
21999 "remaining space to /dev/sda2:"
22003 #: ../resize/virt-resize.pod:49
22006 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22007 " olddisk newdisk\n"
22012 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:533 ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:486 ../src/guestfs.pod:1436
22017 #: ../resize/virt-resize.pod:54
22019 "As in the first example, but expand a logical volume as the final step. "
22020 "This is what you would typically use for Linux guests that use LVM:"
22024 #: ../resize/virt-resize.pod:58
22027 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
22028 " olddisk newdisk\n"
22033 #: ../resize/virt-resize.pod:61
22038 #: ../resize/virt-resize.pod:63
22040 "As in the first example, but the output format will be qcow2 instead of a "
22045 #: ../resize/virt-resize.pod:66
22048 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
22049 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
22054 #: ../resize/virt-resize.pod:71
22055 msgid "DETAILED USAGE"
22059 #: ../resize/virt-resize.pod:73
22060 msgid "EXPANDING A VIRTUAL MACHINE DISK"
22064 #: ../resize/virt-resize.pod:77
22065 msgid "1. Shut down the virtual machine"
22069 #: ../resize/virt-resize.pod:79
22070 msgid "2. Locate input disk image"
22074 #: ../resize/virt-resize.pod:81
22076 "Locate the input disk image (ie. the file or device on the host containing "
22077 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
22078 "dumpxml> like this to find the disk image name:"
22082 #: ../resize/virt-resize.pod:85
22085 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
22086 " Found 1 nodes:\n"
22088 " <source dev=\"/dev/vg/lv_guest\" />\n"
22093 #: ../resize/virt-resize.pod:90
22094 msgid "3. Look at current sizing"
22098 #: ../resize/virt-resize.pod:92
22099 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
22103 #: ../resize/virt-resize.pod:95
22106 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
22107 " Name Type Size Parent\n"
22108 " /dev/sda1 partition 101M /dev/sda\n"
22109 " /dev/sda2 partition 7.9G /dev/sda\n"
22110 " /dev/sda device 8.0G -\n"
22115 #: ../resize/virt-resize.pod:101
22117 "(This example is a virtual machine with an 8 GB disk which we would like to "
22118 "expand up to 10 GB)."
22122 #: ../resize/virt-resize.pod:104
22123 msgid "4. Create output disk"
22127 #: ../resize/virt-resize.pod:106
22129 "Virt-resize cannot do in-place disk modifications. You have to have space "
22130 "to store the resized output disk."
22134 #: ../resize/virt-resize.pod:109
22135 msgid "To store the resized disk image in a file, create a file of a suitable size:"
22139 #: ../resize/virt-resize.pod:112
22142 " # rm -f outdisk\n"
22143 " # truncate -s 10G outdisk\n"
22148 #: ../resize/virt-resize.pod:115
22149 msgid "Or use L<lvcreate(1)> to create a logical volume:"
22153 #: ../resize/virt-resize.pod:117
22156 " # lvcreate -L 10G -n lv_name vg_name\n"
22161 #: ../resize/virt-resize.pod:119
22162 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
22166 #: ../resize/virt-resize.pod:121
22169 " # virsh pool-list\n"
22170 " # virsh vol-create-as poolname newvol 10G\n"
22175 #: ../resize/virt-resize.pod:124
22180 #: ../resize/virt-resize.pod:126
22182 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
22183 "file) and the output disk. The output disk is the one created in the "
22188 #: ../resize/virt-resize.pod:130
22191 " # virt-resize indisk outdisk\n"
22196 #: ../resize/virt-resize.pod:132
22198 "This command just copies disk image C<indisk> to disk image C<outdisk> "
22199 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
22200 "larger, then an extra, empty partition is created at the end of the disk "
22201 "covering the extra space. If C<outdisk> is smaller, then it will give an "
22206 #: ../resize/virt-resize.pod:138
22208 "More realistically you'd want to expand existing partitions in the disk "
22209 "image by passing extra options (for the full list see the L</OPTIONS> "
22214 #: ../resize/virt-resize.pod:142
22216 "L</--expand> is the most useful option. It expands the named partition "
22217 "within the disk to fill any extra space:"
22221 #: ../resize/virt-resize.pod:145
22224 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
22229 #: ../resize/virt-resize.pod:147
22231 "(In this case, an extra partition is I<not> created at the end of the disk, "
22232 "because there will be no unused space)."
22236 #: ../resize/virt-resize.pod:150
22238 "L</--resize> is the other commonly used option. The following would "
22239 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
22240 "rest of the available space:"
22244 #: ../resize/virt-resize.pod:154
22247 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22248 " indisk outdisk\n"
22253 #: ../resize/virt-resize.pod:157
22255 "If the expanded partition in the image contains a filesystem or LVM PV, then "
22256 "if virt-resize knows how, it will resize the contents, the equivalent of "
22257 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
22258 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
22259 "filesystems, so you would have to online resize them after booting the "
22264 #: ../resize/virt-resize.pod:164
22265 msgid "Other options are covered below."
22269 #: ../resize/virt-resize.pod:166
22274 #: ../resize/virt-resize.pod:168
22275 msgid "Thoroughly test the new disk image I<before> discarding the old one."
22279 #: ../resize/virt-resize.pod:170
22280 msgid "If you are using libvirt, edit the XML to point at the new disk:"
22284 #: ../resize/virt-resize.pod:172
22287 " # virsh edit guestname\n"
22292 #: ../resize/virt-resize.pod:174
22294 "Change E<lt>source ...E<gt>, see "
22295 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
22299 #: ../resize/virt-resize.pod:177
22300 msgid "Then start up the domain with the new, resized disk:"
22304 #: ../resize/virt-resize.pod:179
22307 " # virsh start guestname\n"
22312 #: ../resize/virt-resize.pod:181
22314 "and check that it still works. See also the L</NOTES> section below for "
22315 "additional information."
22319 #: ../resize/virt-resize.pod:184
22320 msgid "7. Resize LVs etc inside the guest"
22324 #: ../resize/virt-resize.pod:186
22325 msgid "(This can also be done offline using L<guestfish(1)>)"
22329 #: ../resize/virt-resize.pod:188
22331 "Once the guest has booted you should see the new space available, at least "
22332 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
22333 "may need to resize LVs inside PVs, and also resize filesystem types that "
22334 "virt-resize does not know how to expand."
22338 #: ../resize/virt-resize.pod:195
22339 msgid "SHRINKING A VIRTUAL MACHINE DISK"
22343 #: ../resize/virt-resize.pod:197
22345 "Shrinking is somewhat more complex than expanding, and only an overview is "
22350 #: ../resize/virt-resize.pod:200
22352 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
22353 "filesystems). The user has to shrink content before passing the disk image "
22354 "to virt-resize, and virt-resize will check that the content has been shrunk "
22359 #: ../resize/virt-resize.pod:205
22360 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
22364 #: ../resize/virt-resize.pod:207
22366 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
22367 "steps 3 and 4 above to allocate a new disk image."
22371 #: ../resize/virt-resize.pod:210
22372 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
22376 #: ../resize/virt-resize.pod:213
22377 msgid "IGNORING OR DELETING PARTITIONS"
22381 #: ../resize/virt-resize.pod:215
22383 "virt-resize also gives a convenient way to ignore or delete partitions when "
22384 "copying from the input disk to the output disk. Ignoring a partition speeds "
22385 "up the copy where you don't care about the existing contents of a "
22386 "partition. Deleting a partition removes it completely, but note that it "
22387 "also renumbers any partitions after the one which is deleted, which can "
22388 "leave some guests unbootable."
22392 #: ../resize/virt-resize.pod:222
22393 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
22397 #: ../resize/virt-resize.pod:224
22399 "If the input disk is in qcow2 format, then you may prefer that the output is "
22400 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
22401 "the fly. The output format is simply determined by the format of the empty "
22402 "output container that you provide. Thus to create qcow2 output, use:"
22406 #: ../resize/virt-resize.pod:230
22409 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
22414 #: ../resize/virt-resize.pod:232
22415 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
22419 #: ../resize/virt-resize.pod:234
22420 msgid "Similarly, to get non-sparse raw output use:"
22424 #: ../resize/virt-resize.pod:236
22427 " fallocate -l size outdisk\n"
22432 #: ../resize/virt-resize.pod:238
22434 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
22435 "if=/dev/zero of=outdisk bs=1M count=..>)"
22439 #: ../resize/virt-resize.pod:247 ../sparsify/virt-sparsify.pod:105
22440 msgid "Display help."
22444 #: ../resize/virt-resize.pod:249
22449 #: ../resize/virt-resize.pod:251 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
22454 #: ../resize/virt-resize.pod:253 ../tools/virt-win-reg.pl:122
22455 msgid "Enable debugging messages."
22459 #: ../resize/virt-resize.pod:255
22460 msgid "B<--delete part>"
22464 #: ../resize/virt-resize.pod:257
22466 "Delete the named partition. It would be more accurate to describe this as "
22467 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
22468 "the original disk image is left intact."
22472 #: ../resize/virt-resize.pod:261
22474 "Note that when you delete a partition, then anything contained in the "
22475 "partition is also deleted. Furthermore, this causes any partitions that "
22476 "come after to be I<renumbered>, which can easily make your guest unbootable."
22480 #: ../resize/virt-resize.pod:266 ../resize/virt-resize.pod:327 ../resize/virt-resize.pod:454 ../sparsify/virt-sparsify.pod:145
22481 msgid "You can give this option multiple times."
22485 #: ../resize/virt-resize.pod:268
22486 msgid "B<--expand part>"
22490 #: ../resize/virt-resize.pod:270
22492 "Expand the named partition so it uses up all extra space (space left over "
22493 "after any other resize changes that you request have been done)."
22497 #: ../resize/virt-resize.pod:273
22499 "If virt-resize knows how, it will expand the direct content of the "
22500 "partition. For example, if the partition is an LVM PV, it will expand the "
22501 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
22502 "content it doesn't know about alone."
22506 #: ../resize/virt-resize.pod:278
22507 msgid "Currently virt-resize can resize:"
22511 #: ../resize/virt-resize.pod:284
22512 msgid "ext2, ext3 and ext4 filesystems."
22516 #: ../resize/virt-resize.pod:288
22517 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
22521 #: ../resize/virt-resize.pod:290
22523 "The filesystem must have been shut down consistently last time it was used. "
22524 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
22525 "consistency check, so at the first boot after resizing Windows will check "
22530 #: ../resize/virt-resize.pod:297
22532 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
22533 "inside the PV, but see the I<--LV-expand> option. The user could also "
22534 "resize LVs as desired after boot."
22538 #: ../resize/virt-resize.pod:303
22539 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
22543 #: ../resize/virt-resize.pod:307 ../resize/virt-resize.pod:482
22544 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
22548 #: ../resize/virt-resize.pod:309 ../sparsify/virt-sparsify.pod:125 ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92 ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
22549 msgid "B<--format> raw"
22553 #: ../resize/virt-resize.pod:311 ../sparsify/virt-sparsify.pod:129
22555 "Specify the format of the input disk image. If this flag is not given then "
22556 "it is auto-detected from the image itself."
22560 #: ../resize/virt-resize.pod:317
22562 "Note that this option I<does not> affect the output format. See L</QCOW2 "
22563 "AND NON-SPARSE RAW FORMATS>."
22567 #: ../resize/virt-resize.pod:320
22568 msgid "B<--ignore part>"
22572 #: ../resize/virt-resize.pod:322
22574 "Ignore the named partition. Effectively this means the partition is "
22575 "allocated on the destination disk, but the content is not copied across from "
22576 "the source disk. The content of the partition will be blank (all zero "
22581 #: ../resize/virt-resize.pod:329
22582 msgid "B<--LV-expand logvol>"
22586 #: ../resize/virt-resize.pod:331
22588 "This takes the logical volume and, as a final step, expands it to fill all "
22589 "the space available in its volume group. A typical usage, assuming a Linux "
22590 "guest with a single PV C</dev/sda2> and a root device called "
22591 "C</dev/vg_guest/lv_root> would be:"
22595 #: ../resize/virt-resize.pod:336
22598 " virt-resize indisk outdisk \\\n"
22599 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
22604 #: ../resize/virt-resize.pod:339
22606 "This would first expand the partition (and PV), and then expand the root "
22607 "device to fill the extra space in the PV."
22611 #: ../resize/virt-resize.pod:342
22613 "The contents of the LV are also resized if virt-resize knows how to do "
22614 "that. You can stop virt-resize from trying to expand the content by using "
22615 "the option I<--no-expand-content>."
22619 #: ../resize/virt-resize.pod:346
22620 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
22624 #: ../resize/virt-resize.pod:348
22626 "You can give this option multiple times, I<but> it doesn't make sense to do "
22627 "this unless the logical volumes you specify are all in different volume "
22632 #: ../resize/virt-resize.pod:352 ../sparsify/virt-sparsify.pod:147
22633 msgid "B<--machine-readable>"
22637 #: ../resize/virt-resize.pod:354 ../sparsify/virt-sparsify.pod:149
22639 "This option is used to make the output more machine friendly when being "
22640 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
22644 #: ../resize/virt-resize.pod:360
22645 msgid "B<--dryrun>"
22649 #: ../resize/virt-resize.pod:362
22650 msgid "Print a summary of what would be done, but don't do anything."
22654 #: ../resize/virt-resize.pod:364
22655 msgid "B<--no-copy-boot-loader>"
22659 #: ../resize/virt-resize.pod:366
22661 "By default, virt-resize copies over some sectors at the start of the disk "
22662 "(up to the beginning of the first partition). Commonly these sectors "
22663 "contain the Master Boot Record (MBR) and the boot loader, and are required "
22664 "in order for the guest to boot correctly."
22668 #: ../resize/virt-resize.pod:371
22670 "If you specify this flag, then this initial copy is not done. You may need "
22671 "to reinstall the boot loader in this case."
22675 #: ../resize/virt-resize.pod:374
22676 msgid "B<--no-extra-partition>"
22680 #: ../resize/virt-resize.pod:376
22682 "By default, virt-resize creates an extra partition if there is any extra, "
22683 "unused space after all resizing has happened. Use this option to prevent "
22684 "the extra partition from being created. If you do this then the extra space "
22685 "will be inaccessible until you run fdisk, parted, or some other partitioning "
22686 "tool in the guest."
22690 #: ../resize/virt-resize.pod:382
22692 "Note that if the surplus space is smaller than 10 MB, no extra partition "
22697 #: ../resize/virt-resize.pod:385
22698 msgid "B<--no-expand-content>"
22702 #: ../resize/virt-resize.pod:387
22704 "By default, virt-resize will try to expand the direct contents of "
22705 "partitions, if it knows how (see I<--expand> option above)."
22709 #: ../resize/virt-resize.pod:390
22711 "If you give the I<--no-expand-content> option then virt-resize will not "
22716 #: ../resize/virt-resize.pod:393
22717 msgid "B<--ntfsresize-force>"
22721 #: ../resize/virt-resize.pod:395
22723 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
22724 "the NTFS disk is marked as needing a consistency check. You have to use "
22725 "this option if you want to resize a Windows guest multiple times without "
22726 "booting into Windows between each resize."
22730 #: ../resize/virt-resize.pod:401
22731 msgid "B<--output-format> raw"
22735 #: ../resize/virt-resize.pod:403
22737 "Specify the format of the output disk image. If this flag is not given then "
22738 "it is auto-detected from the image itself."
22742 #: ../resize/virt-resize.pod:409
22744 "Note that this option I<does not create> the output format. This option "
22745 "just tells libguestfs what it is so it doesn't try to guess it. You still "
22746 "need to create the output disk with the right format. See L</QCOW2 AND "
22747 "NON-SPARSE RAW FORMATS>."
22751 #: ../resize/virt-resize.pod:418
22752 msgid "Don't print the summary."
22756 #: ../resize/virt-resize.pod:420
22757 msgid "B<--resize part=size>"
22761 #: ../resize/virt-resize.pod:422
22763 "Resize the named partition (expanding or shrinking it) so that it has the "
22768 #: ../resize/virt-resize.pod:425
22770 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
22771 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
22772 "size; or as a relative number or percentage. For example:"
22776 #: ../resize/virt-resize.pod:431
22779 " --resize /dev/sda2=10G\n"
22784 #: ../resize/virt-resize.pod:433
22787 " --resize /dev/sda4=90%\n"
22792 #: ../resize/virt-resize.pod:435
22795 " --resize /dev/sda2=+1G\n"
22800 #: ../resize/virt-resize.pod:437
22803 " --resize /dev/sda2=-200M\n"
22808 #: ../resize/virt-resize.pod:439
22811 " --resize /dev/sda1=+128K\n"
22816 #: ../resize/virt-resize.pod:441
22819 " --resize /dev/sda1=+10%\n"
22824 #: ../resize/virt-resize.pod:443
22827 " --resize /dev/sda1=-10%\n"
22832 #: ../resize/virt-resize.pod:445
22834 "You can increase the size of any partition. Virt-resize will expand the "
22835 "direct content of the partition if it knows how (see I<--expand> below)."
22839 #: ../resize/virt-resize.pod:449
22841 "You can only I<decrease> the size of partitions that contain filesystems or "
22842 "PVs which have already been shrunk. Virt-resize will check this has been "
22843 "done before proceeding, or else will print an error (see also "
22844 "I<--resize-force>)."
22848 #: ../resize/virt-resize.pod:456
22849 msgid "B<--resize-force part=size>"
22853 #: ../resize/virt-resize.pod:458
22855 "This is the same as I<--resize> except that it will let you decrease the "
22856 "size of any partition. Generally this means you will lose any data which "
22857 "was at the end of the partition you shrink, but you may not care about that "
22858 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
22859 "as a swap partition)."
22863 #: ../resize/virt-resize.pod:464
22864 msgid "See also the I<--ignore> option."
22868 #: ../resize/virt-resize.pod:466
22869 msgid "B<--shrink part>"
22873 #: ../resize/virt-resize.pod:468
22875 "Shrink the named partition until the overall disk image fits in the "
22876 "destination. The named partition B<must> contain a filesystem or PV which "
22877 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
22878 "online tools). Virt-resize will check this and give an error if it has not "
22883 #: ../resize/virt-resize.pod:474
22885 "The amount by which the overall disk must be shrunk (after carrying out all "
22886 "other operations requested by the user) is called the \"deficit\". For "
22887 "example, a straight copy (assume no other operations) from a 5GB disk image "
22888 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
22889 "would give an error unless the user specified a partition to shrink and that "
22890 "partition had more than a gigabyte of free space."
22894 #: ../resize/virt-resize.pod:492 ../sparsify/virt-sparsify.pod:177
22895 msgid "MACHINE READABLE OUTPUT"
22899 #: ../resize/virt-resize.pod:494
22901 "The I<--machine-readable> option can be used to make the output more machine "
22902 "friendly, which is useful when calling virt-resize from other programs, GUIs "
22907 #: ../resize/virt-resize.pod:498 ../sparsify/virt-sparsify.pod:183
22908 msgid "There are two ways to use this option."
22912 #: ../resize/virt-resize.pod:500
22914 "Firstly use the option on its own to query the capabilities of the "
22915 "virt-resize binary. Typical output looks like this:"
22919 #: ../resize/virt-resize.pod:503
22922 " $ virt-resize --machine-readable\n"
22924 " ntfsresize-force\n"
22932 #: ../resize/virt-resize.pod:510 ../sparsify/virt-sparsify.pod:193
22934 "A list of features is printed, one per line, and the program exits with "
22939 #: ../resize/virt-resize.pod:513 ../sparsify/virt-sparsify.pod:196
22941 "Secondly use the option in conjunction with other options to make the "
22942 "regular program output more machine friendly."
22946 #: ../resize/virt-resize.pod:516 ../sparsify/virt-sparsify.pod:199
22947 msgid "At the moment this means:"
22951 #: ../resize/virt-resize.pod:522 ../sparsify/virt-sparsify.pod:205
22953 "Progress bar messages can be parsed from stdout by looking for this regular "
22958 #: ../resize/virt-resize.pod:525 ../sparsify/virt-sparsify.pod:208
22961 " ^[0-9]+/[0-9]+$\n"
22966 #: ../resize/virt-resize.pod:529 ../sparsify/virt-sparsify.pod:212
22968 "The calling program should treat messages sent to stdout (except for "
22969 "progress bar messages) as status messages. They can be logged and/or "
22970 "displayed to the user."
22974 #: ../resize/virt-resize.pod:535
22976 "The calling program should treat messages sent to stderr as error messages. "
22977 "In addition, virt-resize exits with a non-zero status code if there was a "
22982 #: ../resize/virt-resize.pod:541
22984 "Versions of the program prior to 1.13.9 did not support the "
22985 "I<--machine-readable> option and will return an error."
22989 #: ../resize/virt-resize.pod:546
22990 msgid "\"Partition 1 does not end on cylinder boundary.\""
22994 #: ../resize/virt-resize.pod:548
22996 "Virt-resize aligns partitions to multiples of 64 sectors. Usually this "
22997 "means the partitions will not be aligned to the ancient CHS geometry. "
22998 "However CHS geometry is meaningless for disks manufactured since the early "
22999 "1990s, and doubly so for virtual hard drives. Alignment of partitions to "
23000 "cylinders is not required by any modern operating system."
23004 #: ../resize/virt-resize.pod:555
23005 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
23009 #: ../resize/virt-resize.pod:557
23011 "In Windows Vista and later versions, Microsoft switched to using a separate "
23012 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
23013 "and C</dev/sda2> is the main (C:) drive. We have not had any luck resizing "
23014 "the boot partition. Doing so seems to break the guest completely. However "
23015 "expanding the second partition (ie. C: drive) should work."
23019 #: ../resize/virt-resize.pod:564
23021 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
23022 "NTFS partitions have been expanded. This is just a safety check and (unless "
23023 "it find errors) is nothing to worry about."
23027 #: ../resize/virt-resize.pod:568
23028 msgid "GUEST BOOT STUCK AT \"GRUB\""
23032 #: ../resize/virt-resize.pod:570
23034 "If a Linux guest does not boot after resizing, and the boot is stuck after "
23035 "printing C<GRUB> on the console, try reinstalling grub. This sometimes "
23036 "happens on older (RHEL 5-era) guests, for reasons we don't fully understand, "
23037 "although we think is to do with partition alignment."
23041 #: ../resize/virt-resize.pod:575
23044 " guestfish -i -a newdisk\n"
23045 " ><fs> cat /boot/grub/device.map\n"
23046 " # check the contents of this file are sensible or\n"
23047 " # edit the file if necessary\n"
23048 " ><fs> grub-install / /dev/vda\n"
23054 #: ../resize/virt-resize.pod:582
23056 "For more flexible guest reconfiguration, including if you need to specify "
23057 "other parameters to grub-install, use L<virt-rescue(1)>."
23061 #: ../resize/virt-resize.pod:585
23062 msgid "ALTERNATIVE TOOLS"
23066 #: ../resize/virt-resize.pod:587
23068 "There are several proprietary tools for resizing partitions. We won't "
23069 "mention any here."
23073 #: ../resize/virt-resize.pod:590
23075 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
23076 "operations on disk images. They can resize and move partitions, but I don't "
23077 "think they can do anything with the contents, and they certainly don't "
23082 #: ../resize/virt-resize.pod:595
23084 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
23085 "but at a much lower level. You will probably end up hand-calculating sector "
23086 "offsets, which is something that virt-resize was designed to avoid. If you "
23087 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
23092 #: ../resize/virt-resize.pod:615
23094 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
23095 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
23096 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
23097 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
23098 "L<virt-sparsify(1)>, L<http://libguestfs.org/>."
23102 #: ../ruby/examples/guestfs-ruby.pod:5
23103 msgid "guestfs-ruby - How to use libguestfs from Ruby"
23107 #: ../ruby/examples/guestfs-ruby.pod:9
23110 " require 'guestfs'\n"
23111 " g = Guestfs::Guestfs.new()\n"
23112 " g.add_drive_opts(\"disk.img\",\n"
23113 " :readonly => 1, :format => \"raw\")\n"
23119 #: ../ruby/examples/guestfs-ruby.pod:17
23121 "This manual page documents how to call libguestfs from the Ruby programming "
23122 "language. This page just documents the differences from the C API and gives "
23123 "some examples. If you are not familiar with using libguestfs, you also need "
23124 "to read L<guestfs(3)>."
23128 #: ../ruby/examples/guestfs-ruby.pod:24
23130 "Errors from libguestfs functions are mapped into the C<Error> exception. "
23131 "This has a single parameter which is the error message (a string)."
23135 #: ../ruby/examples/guestfs-ruby.pod:38
23137 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
23138 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
23139 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
23143 #: ../sparsify/virt-sparsify.pod:5
23144 msgid "virt-sparsify - Make a virtual machine disk sparse"
23148 #: ../sparsify/virt-sparsify.pod:9
23151 " virt-sparsify [--options] indisk outdisk\n"
23156 #: ../sparsify/virt-sparsify.pod:13
23158 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
23159 "image) sparse a.k.a. thin-provisioned. This means that free space within "
23160 "the disk image can be converted back to free space on the host."
23164 #: ../sparsify/virt-sparsify.pod:18
23166 "Virt-sparsify can locate and sparsify free space in most filesystems "
23167 "(eg. ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
23171 #: ../sparsify/virt-sparsify.pod:21
23173 "Virt-sparsify can also convert between some disk formats, for example "
23174 "converting a raw disk image to a thin-provisioned qcow2 image."
23178 #: ../sparsify/virt-sparsify.pod:24
23180 "Virt-sparsify can operate on any disk image, not just ones from virtual "
23181 "machines. If a virtual machine has more than one attached disk, you must "
23182 "sparsify each one separately."
23186 #: ../sparsify/virt-sparsify.pod:28
23187 msgid "IMPORTANT LIMITATIONS"
23191 #: ../sparsify/virt-sparsify.pod:34
23193 "Virt-sparsify does not do in-place modifications. It copies from a source "
23194 "image to a destination image, leaving the source unchanged. I<Check that "
23195 "the sparsification was successful before deleting the source image>."
23199 #: ../sparsify/virt-sparsify.pod:41
23200 msgid "The virtual machine I<must be shut down> before using this tool."
23204 #: ../sparsify/virt-sparsify.pod:45
23206 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
23207 "(1 temporary copy + 1 destination image). This is in the worst case and "
23208 "usually much less space is required."
23212 #: ../sparsify/virt-sparsify.pod:51
23213 msgid "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
23217 #: ../sparsify/virt-sparsify.pod:56
23218 msgid "Virt-sparsify cannot handle encrypted disks."
23222 #: ../sparsify/virt-sparsify.pod:60
23224 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
23225 "this space is often used for critical items like bootloaders so it's not "
23230 #: ../sparsify/virt-sparsify.pod:66
23232 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
23233 "to do this unless we can be sure there is no hibernation data, so at the "
23234 "moment swap partitions are ignored."
23238 #: ../sparsify/virt-sparsify.pod:72
23240 "You may also want to read the manual pages for the associated tools "
23241 "L<virt-filesystems(1)> and L<virt-df(1)> before starting."
23245 #: ../sparsify/virt-sparsify.pod:77
23246 msgid "Typical usage is:"
23250 #: ../sparsify/virt-sparsify.pod:79
23253 " virt-sparsify indisk outdisk\n"
23258 #: ../sparsify/virt-sparsify.pod:81
23260 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
23261 "is created, or overwritten if it already exists. The format of the input "
23262 "disk is detected (eg. qcow2) and the same format is used for the output "
23267 #: ../sparsify/virt-sparsify.pod:86
23268 msgid "To convert between formats, use the I<--convert> option:"
23272 #: ../sparsify/virt-sparsify.pod:88
23275 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
23280 #: ../sparsify/virt-sparsify.pod:90
23282 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
23283 "can find within the source disk image. You can get it to ignore (don't zero "
23284 "free space on) certain filesystems by doing:"
23288 #: ../sparsify/virt-sparsify.pod:94
23291 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
23296 #: ../sparsify/virt-sparsify.pod:96
23297 msgid "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
23301 #: ../sparsify/virt-sparsify.pod:107
23302 msgid "B<--convert> raw"
23306 #: ../sparsify/virt-sparsify.pod:109
23307 msgid "B<--convert> qcow2"
23311 #: ../sparsify/virt-sparsify.pod:111
23312 msgid "B<--convert> [other formats]"
23316 #: ../sparsify/virt-sparsify.pod:113
23318 "Use C<output-format> as the format for the destination image. If this is "
23319 "not specified, then the input format is used."
23323 #: ../sparsify/virt-sparsify.pod:116
23324 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
23328 #: ../sparsify/virt-sparsify.pod:118
23330 "You can also use any format supported by the L<qemu-img(1)> program, "
23331 "eg. C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
23335 #: ../sparsify/virt-sparsify.pod:122
23337 "Specifying the I<--convert> option is usually a good idea, because then "
23338 "virt-sparsify doesn't need to try to guess the input format."
23342 #: ../sparsify/virt-sparsify.pod:127
23343 msgid "B<--format> qcow2"
23347 #: ../sparsify/virt-sparsify.pod:135
23348 msgid "B<--ignore> filesystem"
23352 #: ../sparsify/virt-sparsify.pod:137
23353 msgid "B<--ignore> volgroup"
23357 #: ../sparsify/virt-sparsify.pod:139
23359 "Ignore the named filesystem. Free space on the filesystem will not be "
23360 "zeroed, but existing blocks of zeroes will still be sparsified."
23364 #: ../sparsify/virt-sparsify.pod:142
23366 "In the second form, this ignores the named volume group. Use the volume "
23367 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
23371 #: ../sparsify/virt-sparsify.pod:157
23372 msgid "This disables progress bars and other unnecessary output."
23376 #: ../sparsify/virt-sparsify.pod:179
23378 "The I<--machine-readable> option can be used to make the output more machine "
23379 "friendly, which is useful when calling virt-sparsify from other programs, "
23384 #: ../sparsify/virt-sparsify.pod:185
23386 "Firstly use the option on its own to query the capabilities of the "
23387 "virt-sparsify binary. Typical output looks like this:"
23391 #: ../sparsify/virt-sparsify.pod:188
23394 " $ virt-sparsify --machine-readable\n"
23402 #: ../sparsify/virt-sparsify.pod:218
23404 "The calling program should treat messages sent to stderr as error messages. "
23405 "In addition, virt-sparsify exits with a non-zero status code if there was a "
23410 #: ../sparsify/virt-sparsify.pod:224
23412 "All versions of virt-sparsify have supported the I<--machine-readable> "
23417 #: ../sparsify/virt-sparsify.pod:238
23419 "Location of the temporary directory used for the potentially large temporary "
23424 #: ../sparsify/virt-sparsify.pod:241
23426 "You should ensure there is enough free space in the worst case for a full "
23427 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
23428 "to another directory that has enough space."
23432 #: ../sparsify/virt-sparsify.pod:245
23433 msgid "This defaults to C</tmp>."
23437 #: ../sparsify/virt-sparsify.pod:249
23438 msgid "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
23442 #: ../sparsify/virt-sparsify.pod:253
23444 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
23445 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, "
23446 "L<qemu-img(1)>, L<http://libguestfs.org/>."
23450 #: ../src/guestfs-actions.pod:1
23451 msgid "guestfs_add_cdrom"
23455 #: ../src/guestfs-actions.pod:3
23459 " guestfs_add_cdrom (guestfs_h *g,\n"
23460 " const char *filename);\n"
23465 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:255 ../src/guestfs-actions.pod:276
23467 "I<This function is deprecated.> In new code, use the "
23468 "L</guestfs_add_drive_opts> call instead."
23472 #: ../src/guestfs-actions.pod:24
23474 "This call checks for the existence of C<filename>. This stops you from "
23475 "specifying other types of drive which are supported by qemu such as C<nbd:> "
23476 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
23481 #: ../src/guestfs-actions.pod:31
23483 "If you just want to add an ISO file (often you use this as an efficient way "
23484 "to transfer large files into the guest), then you should probably use "
23485 "C<guestfs_add_drive_ro> instead."
23489 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140 ../src/guestfs-actions.pod:207 ../src/guestfs-actions.pod:244 ../src/guestfs-actions.pod:265 ../src/guestfs-actions.pod:286 ../src/guestfs-actions.pod:299 ../src/guestfs-actions.pod:313 ../src/guestfs-actions.pod:433 ../src/guestfs-actions.pod:453 ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:512 ../src/guestfs-actions.pod:540 ../src/guestfs-actions.pod:558 ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:658 ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:687 ../src/guestfs-actions.pod:786 ../src/guestfs-actions.pod:804 ../src/guestfs-actions.pod:818 ../src/guestfs-actions.pod:832 ../src/guestfs-actions.pod:869 ../src/guestfs-actions.pod:1052 ../src/guestfs-actions.pod:1072 ../src/guestfs-actions.pod:1090 ../src/guestfs-actions.pod:1180 ../src/guestfs-actions.pod:1239 ../src/guestfs-actions.pod:1285 ../src/guestfs-actions.pod:1303 ../src/guestfs-actions.pod:1322 ../src/guestfs-actions.pod:1336 ../src/guestfs-actions.pod:1356 ../src/guestfs-actions.pod:1426 ../src/guestfs-actions.pod:1457 ../src/guestfs-actions.pod:1482 ../src/guestfs-actions.pod:1524 ../src/guestfs-actions.pod:1637 ../src/guestfs-actions.pod:1664 ../src/guestfs-actions.pod:1879 ../src/guestfs-actions.pod:1901 ../src/guestfs-actions.pod:1988 ../src/guestfs-actions.pod:2496 ../src/guestfs-actions.pod:2640 ../src/guestfs-actions.pod:2701 ../src/guestfs-actions.pod:2736 ../src/guestfs-actions.pod:3793 ../src/guestfs-actions.pod:3808 ../src/guestfs-actions.pod:3833 ../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:4114 ../src/guestfs-actions.pod:4186 ../src/guestfs-actions.pod:4206 ../src/guestfs-actions.pod:4223 ../src/guestfs-actions.pod:4246 ../src/guestfs-actions.pod:4269 ../src/guestfs-actions.pod:4304 ../src/guestfs-actions.pod:4323 ../src/guestfs-actions.pod:4342 ../src/guestfs-actions.pod:4377 ../src/guestfs-actions.pod:4389 ../src/guestfs-actions.pod:4425 ../src/guestfs-actions.pod:4441 ../src/guestfs-actions.pod:4454 ../src/guestfs-actions.pod:4469 ../src/guestfs-actions.pod:4486 ../src/guestfs-actions.pod:4579 ../src/guestfs-actions.pod:4599 ../src/guestfs-actions.pod:4612 ../src/guestfs-actions.pod:4663 ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:4699 ../src/guestfs-actions.pod:4715 ../src/guestfs-actions.pod:4729 ../src/guestfs-actions.pod:4743 ../src/guestfs-actions.pod:4760 ../src/guestfs-actions.pod:4775 ../src/guestfs-actions.pod:4802 ../src/guestfs-actions.pod:4865 ../src/guestfs-actions.pod:4938 ../src/guestfs-actions.pod:4969 ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5007 ../src/guestfs-actions.pod:5019 ../src/guestfs-actions.pod:5036 ../src/guestfs-actions.pod:5049 ../src/guestfs-actions.pod:5064 ../src/guestfs-actions.pod:5079 ../src/guestfs-actions.pod:5111 ../src/guestfs-actions.pod:5137 ../src/guestfs-actions.pod:5176 ../src/guestfs-actions.pod:5196 ../src/guestfs-actions.pod:5210 ../src/guestfs-actions.pod:5227 ../src/guestfs-actions.pod:5276 ../src/guestfs-actions.pod:5329 ../src/guestfs-actions.pod:5376 ../src/guestfs-actions.pod:5419 ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5464 ../src/guestfs-actions.pod:5482 ../src/guestfs-actions.pod:5622 ../src/guestfs-actions.pod:5679 ../src/guestfs-actions.pod:5701 ../src/guestfs-actions.pod:5719 ../src/guestfs-actions.pod:5751 ../src/guestfs-actions.pod:5817 ../src/guestfs-actions.pod:5834 ../src/guestfs-actions.pod:5847 ../src/guestfs-actions.pod:5861 ../src/guestfs-actions.pod:6150 ../src/guestfs-actions.pod:6169 ../src/guestfs-actions.pod:6188 ../src/guestfs-actions.pod:6202 ../src/guestfs-actions.pod:6214 ../src/guestfs-actions.pod:6228 ../src/guestfs-actions.pod:6240 ../src/guestfs-actions.pod:6254 ../src/guestfs-actions.pod:6270 ../src/guestfs-actions.pod:6291 ../src/guestfs-actions.pod:6310 ../src/guestfs-actions.pod:6329 ../src/guestfs-actions.pod:6359 ../src/guestfs-actions.pod:6377 ../src/guestfs-actions.pod:6400 ../src/guestfs-actions.pod:6418 ../src/guestfs-actions.pod:6437 ../src/guestfs-actions.pod:6458 ../src/guestfs-actions.pod:6477 ../src/guestfs-actions.pod:6494 ../src/guestfs-actions.pod:6513 ../src/guestfs-actions.pod:6541 ../src/guestfs-actions.pod:6565 ../src/guestfs-actions.pod:6584 ../src/guestfs-actions.pod:6600 ../src/guestfs-actions.pod:6624 ../src/guestfs-actions.pod:6643 ../src/guestfs-actions.pod:6658 ../src/guestfs-actions.pod:6677 ../src/guestfs-actions.pod:6721 ../src/guestfs-actions.pod:6751 ../src/guestfs-actions.pod:6784 ../src/guestfs-actions.pod:6899 ../src/guestfs-actions.pod:7020 ../src/guestfs-actions.pod:7032 ../src/guestfs-actions.pod:7045 ../src/guestfs-actions.pod:7058 ../src/guestfs-actions.pod:7080 ../src/guestfs-actions.pod:7093 ../src/guestfs-actions.pod:7106 ../src/guestfs-actions.pod:7119 ../src/guestfs-actions.pod:7134 ../src/guestfs-actions.pod:7193 ../src/guestfs-actions.pod:7210 ../src/guestfs-actions.pod:7226 ../src/guestfs-actions.pod:7242 ../src/guestfs-actions.pod:7259 ../src/guestfs-actions.pod:7272 ../src/guestfs-actions.pod:7292 ../src/guestfs-actions.pod:7328 ../src/guestfs-actions.pod:7342 ../src/guestfs-actions.pod:7383 ../src/guestfs-actions.pod:7396 ../src/guestfs-actions.pod:7414 ../src/guestfs-actions.pod:7448 ../src/guestfs-actions.pod:7484 ../src/guestfs-actions.pod:7600 ../src/guestfs-actions.pod:7615 ../src/guestfs-actions.pod:7629 ../src/guestfs-actions.pod:7684 ../src/guestfs-actions.pod:7697 ../src/guestfs-actions.pod:7742 ../src/guestfs-actions.pod:7782 ../src/guestfs-actions.pod:7838 ../src/guestfs-actions.pod:7858 ../src/guestfs-actions.pod:7891 ../src/guestfs-actions.pod:7955 ../src/guestfs-actions.pod:7978 ../src/guestfs-actions.pod:8007
23490 msgid "This function returns 0 on success or -1 on error."
23494 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142 ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:2102 ../src/guestfs-actions.pod:2200 ../src/guestfs-actions.pod:2325 ../src/guestfs-actions.pod:3795 ../src/guestfs-actions.pod:3815 ../src/guestfs-actions.pod:5113 ../src/guestfs-actions.pod:6379 ../src/guestfs-actions.pod:6496 ../src/guestfs-actions.pod:6645 ../src/guestfs-actions.pod:7136 ../src/guestfs-actions.pod:7261 ../src/guestfs-actions.pod:7784
23495 msgid "(Added in 0.3)"
23499 #: ../src/guestfs-actions.pod:41
23500 msgid "guestfs_add_domain"
23504 #: ../src/guestfs-actions.pod:43
23508 " guestfs_add_domain (guestfs_h *g,\n"
23509 " const char *dom,\n"
23515 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151 ../src/guestfs-actions.pod:843 ../src/guestfs-actions.pod:1167 ../src/guestfs-actions.pod:1219 ../src/guestfs-actions.pod:2993 ../src/guestfs-actions.pod:4814 ../src/guestfs-actions.pod:5123 ../src/guestfs-actions.pod:5340
23517 "You may supply a list of optional arguments to this call. Use zero or more "
23518 "of the following pairs of parameters, and terminate the list with C<-1> on "
23519 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
23523 #: ../src/guestfs-actions.pod:53
23526 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
23527 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
23528 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
23529 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
23530 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
23535 #: ../src/guestfs-actions.pod:59
23537 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
23538 "It works by connecting to libvirt, requesting the domain and domain XML from "
23539 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
23544 #: ../src/guestfs-actions.pod:94
23546 "The other optional parameters are passed directly through to "
23547 "C<guestfs_add_drive_opts>."
23551 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:356 ../src/guestfs-actions.pod:526 ../src/guestfs-actions.pod:704 ../src/guestfs-actions.pod:735 ../src/guestfs-actions.pod:753 ../src/guestfs-actions.pod:772 ../src/guestfs-actions.pod:1502 ../src/guestfs-actions.pod:1858 ../src/guestfs-actions.pod:2061 ../src/guestfs-actions.pod:2172 ../src/guestfs-actions.pod:2223 ../src/guestfs-actions.pod:2275 ../src/guestfs-actions.pod:2289 ../src/guestfs-actions.pod:2312 ../src/guestfs-actions.pod:2627 ../src/guestfs-actions.pod:3111 ../src/guestfs-actions.pod:3129 ../src/guestfs-actions.pod:5299 ../src/guestfs-actions.pod:5519 ../src/guestfs-actions.pod:5931 ../src/guestfs-actions.pod:5957 ../src/guestfs-actions.pod:7369 ../src/guestfs-actions.pod:7795 ../src/guestfs-actions.pod:7808 ../src/guestfs-actions.pod:7821
23552 msgid "On error this function returns -1."
23556 #: ../src/guestfs-actions.pod:99
23557 msgid "(Added in 1.7.4)"
23561 #: ../src/guestfs-actions.pod:101
23562 msgid "guestfs_add_domain_va"
23566 #: ../src/guestfs-actions.pod:103
23570 " guestfs_add_domain_va (guestfs_h *g,\n"
23571 " const char *dom,\n"
23572 " va_list args);\n"
23577 #: ../src/guestfs-actions.pod:108
23578 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
23582 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:220 ../src/guestfs-actions.pod:231 ../src/guestfs-actions.pod:882 ../src/guestfs-actions.pod:893 ../src/guestfs-actions.pod:1195 ../src/guestfs-actions.pod:1208 ../src/guestfs-actions.pod:1254 ../src/guestfs-actions.pod:1267 ../src/guestfs-actions.pod:3077 ../src/guestfs-actions.pod:3089 ../src/guestfs-actions.pod:4879 ../src/guestfs-actions.pod:4891 ../src/guestfs-actions.pod:5151 ../src/guestfs-actions.pod:5163 ../src/guestfs-actions.pod:5389 ../src/guestfs-actions.pod:5400
23583 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
23587 #: ../src/guestfs-actions.pod:112
23588 msgid "guestfs_add_domain_argv"
23592 #: ../src/guestfs-actions.pod:114
23596 " guestfs_add_domain_argv (guestfs_h *g,\n"
23597 " const char *dom,\n"
23598 " const struct guestfs_add_domain_argv *optargs);\n"
23603 #: ../src/guestfs-actions.pod:119
23604 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
23608 #: ../src/guestfs-actions.pod:123
23609 msgid "guestfs_add_drive"
23613 #: ../src/guestfs-actions.pod:125
23617 " guestfs_add_drive (guestfs_h *g,\n"
23618 " const char *filename);\n"
23623 #: ../src/guestfs-actions.pod:129
23625 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
23626 "optional parameters, so the disk is added writable, with the format being "
23627 "detected automatically."
23631 #: ../src/guestfs-actions.pod:133
23633 "Automatic detection of the format opens you up to a potential security hole "
23634 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
23635 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
23636 "you should think about replacing calls to this function with calls to "
23637 "C<guestfs_add_drive_opts>, and specifying the format."
23641 #: ../src/guestfs-actions.pod:144
23642 msgid "guestfs_add_drive_opts"
23646 #: ../src/guestfs-actions.pod:146
23650 " guestfs_add_drive_opts (guestfs_h *g,\n"
23651 " const char *filename,\n"
23657 #: ../src/guestfs-actions.pod:156
23660 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
23661 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
23662 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
23663 " GUESTFS_ADD_DRIVE_OPTS_NAME, const char *name,\n"
23668 #: ../src/guestfs-actions.pod:186
23670 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
23671 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
23672 "Possible formats include C<raw> and C<qcow2>."
23676 #: ../src/guestfs-actions.pod:197
23678 "This rarely-used option lets you emulate the behaviour of the deprecated "
23679 "C<guestfs_add_drive_with_if> call (q.v.)"
23683 #: ../src/guestfs-actions.pod:209
23684 msgid "(Added in 1.5.23)"
23688 #: ../src/guestfs-actions.pod:211
23689 msgid "guestfs_add_drive_opts_va"
23693 #: ../src/guestfs-actions.pod:213
23697 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
23698 " const char *filename,\n"
23699 " va_list args);\n"
23704 #: ../src/guestfs-actions.pod:218
23705 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
23709 #: ../src/guestfs-actions.pod:222
23710 msgid "guestfs_add_drive_opts_argv"
23714 #: ../src/guestfs-actions.pod:224
23718 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
23719 " const char *filename,\n"
23720 " const struct guestfs_add_drive_opts_argv "
23726 #: ../src/guestfs-actions.pod:229
23727 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
23731 #: ../src/guestfs-actions.pod:233
23732 msgid "guestfs_add_drive_ro"
23736 #: ../src/guestfs-actions.pod:235
23740 " guestfs_add_drive_ro (guestfs_h *g,\n"
23741 " const char *filename);\n"
23746 #: ../src/guestfs-actions.pod:239
23748 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
23749 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
23750 "disk is added read-only, with the format being detected automatically."
23754 #: ../src/guestfs-actions.pod:246
23755 msgid "(Added in 1.0.38)"
23759 #: ../src/guestfs-actions.pod:248
23760 msgid "guestfs_add_drive_ro_with_if"
23764 #: ../src/guestfs-actions.pod:250
23768 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
23769 " const char *filename,\n"
23770 " const char *iface);\n"
23775 #: ../src/guestfs-actions.pod:262
23777 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
23778 "QEMU interface emulation to use at run time."
23782 #: ../src/guestfs-actions.pod:267 ../src/guestfs-actions.pod:288 ../src/guestfs-actions.pod:2586
23783 msgid "(Added in 1.0.84)"
23787 #: ../src/guestfs-actions.pod:269
23788 msgid "guestfs_add_drive_with_if"
23792 #: ../src/guestfs-actions.pod:271
23796 " guestfs_add_drive_with_if (guestfs_h *g,\n"
23797 " const char *filename,\n"
23798 " const char *iface);\n"
23803 #: ../src/guestfs-actions.pod:283
23805 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
23806 "QEMU interface emulation to use at run time."
23810 #: ../src/guestfs-actions.pod:290
23811 msgid "guestfs_aug_clear"
23815 #: ../src/guestfs-actions.pod:292
23819 " guestfs_aug_clear (guestfs_h *g,\n"
23820 " const char *augpath);\n"
23825 #: ../src/guestfs-actions.pod:301 ../src/guestfs-actions.pod:2314
23826 msgid "(Added in 1.3.4)"
23830 #: ../src/guestfs-actions.pod:303
23831 msgid "guestfs_aug_close"
23835 #: ../src/guestfs-actions.pod:305
23839 " guestfs_aug_close (guestfs_h *g);\n"
23844 #: ../src/guestfs-actions.pod:308
23846 "Close the current Augeas handle and free up any resources used by it. After "
23847 "calling this, you have to call C<guestfs_aug_init> again before you can use "
23848 "any other Augeas functions."
23852 #: ../src/guestfs-actions.pod:315 ../src/guestfs-actions.pod:340 ../src/guestfs-actions.pod:358 ../src/guestfs-actions.pod:372 ../src/guestfs-actions.pod:435 ../src/guestfs-actions.pod:455 ../src/guestfs-actions.pod:469 ../src/guestfs-actions.pod:500 ../src/guestfs-actions.pod:514 ../src/guestfs-actions.pod:528 ../src/guestfs-actions.pod:542 ../src/guestfs-actions.pod:560 ../src/guestfs-actions.pod:6008
23853 msgid "(Added in 0.7)"
23857 #: ../src/guestfs-actions.pod:317
23858 msgid "guestfs_aug_defnode"
23862 #: ../src/guestfs-actions.pod:319
23865 " struct guestfs_int_bool *\n"
23866 " guestfs_aug_defnode (guestfs_h *g,\n"
23867 " const char *name,\n"
23868 " const char *expr,\n"
23869 " const char *val);\n"
23874 #: ../src/guestfs-actions.pod:328
23876 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
23877 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
23878 "containing that single node."
23882 #: ../src/guestfs-actions.pod:336
23884 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
23885 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
23889 #: ../src/guestfs-actions.pod:342
23890 msgid "guestfs_aug_defvar"
23894 #: ../src/guestfs-actions.pod:344
23898 " guestfs_aug_defvar (guestfs_h *g,\n"
23899 " const char *name,\n"
23900 " const char *expr);\n"
23905 #: ../src/guestfs-actions.pod:360
23906 msgid "guestfs_aug_get"
23910 #: ../src/guestfs-actions.pod:362
23914 " guestfs_aug_get (guestfs_h *g,\n"
23915 " const char *augpath);\n"
23920 #: ../src/guestfs-actions.pod:369 ../src/guestfs-actions.pod:933 ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:1011 ../src/guestfs-actions.pod:1027 ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1371 ../src/guestfs-actions.pod:1388 ../src/guestfs-actions.pod:1407 ../src/guestfs-actions.pod:1541 ../src/guestfs-actions.pod:1729 ../src/guestfs-actions.pod:1841 ../src/guestfs-actions.pod:2004 ../src/guestfs-actions.pod:2021 ../src/guestfs-actions.pod:2088 ../src/guestfs-actions.pod:2131 ../src/guestfs-actions.pod:2152 ../src/guestfs-actions.pod:2337 ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:2755 ../src/guestfs-actions.pod:2857 ../src/guestfs-actions.pod:2961 ../src/guestfs-actions.pod:2980 ../src/guestfs-actions.pod:3195 ../src/guestfs-actions.pod:3223 ../src/guestfs-actions.pod:3244 ../src/guestfs-actions.pod:3278 ../src/guestfs-actions.pod:3341 ../src/guestfs-actions.pod:3361 ../src/guestfs-actions.pod:3381 ../src/guestfs-actions.pod:4008 ../src/guestfs-actions.pod:4361 ../src/guestfs-actions.pod:4531 ../src/guestfs-actions.pod:4641 ../src/guestfs-actions.pod:5537 ../src/guestfs-actions.pod:5736 ../src/guestfs-actions.pod:5906 ../src/guestfs-actions.pod:6084 ../src/guestfs-actions.pod:6133 ../src/guestfs-actions.pod:6805 ../src/guestfs-actions.pod:6821 ../src/guestfs-actions.pod:6845 ../src/guestfs-actions.pod:6869 ../src/guestfs-actions.pod:7543 ../src/guestfs-actions.pod:7562 ../src/guestfs-actions.pod:7580 ../src/guestfs-actions.pod:7754 ../src/guestfs-actions.pod:8071
23922 "This function returns a string, or NULL on error. I<The caller must free "
23923 "the returned string after use>."
23927 #: ../src/guestfs-actions.pod:374
23928 msgid "guestfs_aug_init"
23932 #: ../src/guestfs-actions.pod:376
23936 " guestfs_aug_init (guestfs_h *g,\n"
23937 " const char *root,\n"
23943 #: ../src/guestfs-actions.pod:385
23944 msgid "You must call this before using any other C<guestfs_aug_*> commands."
23948 #: ../src/guestfs-actions.pod:410
23950 "This option is only useful when debugging Augeas lenses. Use of this option "
23951 "may require additional memory for the libguestfs appliance. You may need to "
23952 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
23953 "C<guestfs_set_memsize>."
23957 #: ../src/guestfs-actions.pod:425
23958 msgid "Do not load the tree in C<guestfs_aug_init>."
23962 #: ../src/guestfs-actions.pod:429
23963 msgid "To close the handle, you can call C<guestfs_aug_close>."
23967 #: ../src/guestfs-actions.pod:437
23968 msgid "guestfs_aug_insert"
23972 #: ../src/guestfs-actions.pod:439
23976 " guestfs_aug_insert (guestfs_h *g,\n"
23977 " const char *augpath,\n"
23978 " const char *label,\n"
23984 #: ../src/guestfs-actions.pod:457
23985 msgid "guestfs_aug_load"
23989 #: ../src/guestfs-actions.pod:459
23993 " guestfs_aug_load (guestfs_h *g);\n"
23998 #: ../src/guestfs-actions.pod:471
23999 msgid "guestfs_aug_ls"
24003 #: ../src/guestfs-actions.pod:473
24007 " guestfs_aug_ls (guestfs_h *g,\n"
24008 " const char *augpath);\n"
24013 #: ../src/guestfs-actions.pod:477
24015 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
24016 "sorting the resulting nodes into alphabetical order."
24020 #: ../src/guestfs-actions.pod:480 ../src/guestfs-actions.pod:496 ../src/guestfs-actions.pod:642 ../src/guestfs-actions.pod:1149 ../src/guestfs-actions.pod:1556 ../src/guestfs-actions.pod:1575 ../src/guestfs-actions.pod:1678 ../src/guestfs-actions.pod:1697 ../src/guestfs-actions.pod:1943 ../src/guestfs-actions.pod:2409 ../src/guestfs-actions.pod:2425 ../src/guestfs-actions.pod:2444 ../src/guestfs-actions.pod:2509 ../src/guestfs-actions.pod:2533 ../src/guestfs-actions.pod:2604 ../src/guestfs-actions.pod:2653 ../src/guestfs-actions.pod:2922 ../src/guestfs-actions.pod:3297 ../src/guestfs-actions.pod:3577 ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:3908 ../src/guestfs-actions.pod:3928 ../src/guestfs-actions.pod:3990 ../src/guestfs-actions.pod:4095 ../src/guestfs-actions.pod:4503 ../src/guestfs-actions.pod:5260 ../src/guestfs-actions.pod:5878 ../src/guestfs-actions.pod:6004 ../src/guestfs-actions.pod:6118 ../src/guestfs-actions.pod:6885 ../src/guestfs-actions.pod:6946 ../src/guestfs-actions.pod:7001 ../src/guestfs-actions.pod:7147 ../src/guestfs-actions.pod:7171 ../src/guestfs-actions.pod:7647 ../src/guestfs-actions.pod:7667 ../src/guestfs-actions.pod:7714 ../src/guestfs-actions.pod:7908 ../src/guestfs-actions.pod:7927 ../src/guestfs-actions.pod:8021 ../src/guestfs-actions.pod:8040 ../src/guestfs-actions.pod:8086 ../src/guestfs-actions.pod:8105
24022 "This function returns a NULL-terminated array of strings (like "
24023 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
24024 "strings and the array after use>."
24028 #: ../src/guestfs-actions.pod:484 ../src/guestfs-actions.pod:1074 ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1613 ../src/guestfs-actions.pod:3655 ../src/guestfs-actions.pod:3686 ../src/guestfs-actions.pod:4344 ../src/guestfs-actions.pod:4394 ../src/guestfs-actions.pod:4581 ../src/guestfs-actions.pod:4614 ../src/guestfs-actions.pod:4777 ../src/guestfs-actions.pod:5264 ../src/guestfs-actions.pod:5819 ../src/guestfs-actions.pod:6216 ../src/guestfs-actions.pod:6230 ../src/guestfs-actions.pod:6242 ../src/guestfs-actions.pod:6726 ../src/guestfs-actions.pod:7385 ../src/guestfs-actions.pod:7398 ../src/guestfs-actions.pod:7631 ../src/guestfs-actions.pod:7896
24029 msgid "(Added in 0.8)"
24033 #: ../src/guestfs-actions.pod:486
24034 msgid "guestfs_aug_match"
24038 #: ../src/guestfs-actions.pod:488
24042 " guestfs_aug_match (guestfs_h *g,\n"
24043 " const char *augpath);\n"
24048 #: ../src/guestfs-actions.pod:502
24049 msgid "guestfs_aug_mv"
24053 #: ../src/guestfs-actions.pod:504
24057 " guestfs_aug_mv (guestfs_h *g,\n"
24058 " const char *src,\n"
24059 " const char *dest);\n"
24064 #: ../src/guestfs-actions.pod:516
24065 msgid "guestfs_aug_rm"
24069 #: ../src/guestfs-actions.pod:518
24073 " guestfs_aug_rm (guestfs_h *g,\n"
24074 " const char *augpath);\n"
24079 #: ../src/guestfs-actions.pod:530
24080 msgid "guestfs_aug_save"
24084 #: ../src/guestfs-actions.pod:532
24088 " guestfs_aug_save (guestfs_h *g);\n"
24093 #: ../src/guestfs-actions.pod:537
24095 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
24100 #: ../src/guestfs-actions.pod:544
24101 msgid "guestfs_aug_set"
24105 #: ../src/guestfs-actions.pod:546
24109 " guestfs_aug_set (guestfs_h *g,\n"
24110 " const char *augpath,\n"
24111 " const char *val);\n"
24116 #: ../src/guestfs-actions.pod:553
24118 "In the Augeas API, it is possible to clear a node by setting the value to "
24119 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
24120 "this call. Instead you must use the C<guestfs_aug_clear> call."
24124 #: ../src/guestfs-actions.pod:562
24125 msgid "guestfs_available"
24129 #: ../src/guestfs-actions.pod:564
24133 " guestfs_available (guestfs_h *g,\n"
24134 " char *const *groups);\n"
24139 #: ../src/guestfs-actions.pod:572
24141 "The libguestfs groups, and the functions that those groups correspond to, "
24142 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
24143 "runtime by calling C<guestfs_available_all_groups>."
24147 #: ../src/guestfs-actions.pod:596
24148 msgid "You must call C<guestfs_launch> before calling this function."
24152 #: ../src/guestfs-actions.pod:618
24154 "This call was added in version C<1.0.80>. In previous versions of "
24155 "libguestfs all you could do would be to speculatively execute a command to "
24156 "find out if the daemon implemented it. See also C<guestfs_version>."
24160 #: ../src/guestfs-actions.pod:627 ../src/guestfs-actions.pod:1358
24161 msgid "(Added in 1.0.80)"
24165 #: ../src/guestfs-actions.pod:629
24166 msgid "guestfs_available_all_groups"
24170 #: ../src/guestfs-actions.pod:631
24174 " guestfs_available_all_groups (guestfs_h *g);\n"
24179 #: ../src/guestfs-actions.pod:634
24181 "This command returns a list of all optional groups that this daemon knows "
24182 "about. Note this returns both supported and unsupported groups. To find "
24183 "out which ones the daemon can actually support you have to call "
24184 "C<guestfs_available> on each member of the returned list."
24188 #: ../src/guestfs-actions.pod:640
24189 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
24193 #: ../src/guestfs-actions.pod:646
24194 msgid "(Added in 1.3.15)"
24198 #: ../src/guestfs-actions.pod:648
24199 msgid "guestfs_base64_in"
24203 #: ../src/guestfs-actions.pod:650
24207 " guestfs_base64_in (guestfs_h *g,\n"
24208 " const char *base64file,\n"
24209 " const char *filename);\n"
24214 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:674
24215 msgid "(Added in 1.3.5)"
24219 #: ../src/guestfs-actions.pod:662
24220 msgid "guestfs_base64_out"
24224 #: ../src/guestfs-actions.pod:664
24228 " guestfs_base64_out (guestfs_h *g,\n"
24229 " const char *filename,\n"
24230 " const char *base64file);\n"
24235 #: ../src/guestfs-actions.pod:676
24236 msgid "guestfs_blockdev_flushbufs"
24240 #: ../src/guestfs-actions.pod:678
24244 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
24245 " const char *device);\n"
24250 #: ../src/guestfs-actions.pod:689 ../src/guestfs-actions.pod:706 ../src/guestfs-actions.pod:721 ../src/guestfs-actions.pod:737 ../src/guestfs-actions.pod:755 ../src/guestfs-actions.pod:774 ../src/guestfs-actions.pod:788 ../src/guestfs-actions.pod:806 ../src/guestfs-actions.pod:820 ../src/guestfs-actions.pod:834
24251 msgid "(Added in 0.9.3)"
24255 #: ../src/guestfs-actions.pod:691
24256 msgid "guestfs_blockdev_getbsz"
24260 #: ../src/guestfs-actions.pod:693
24264 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
24265 " const char *device);\n"
24270 #: ../src/guestfs-actions.pod:708
24271 msgid "guestfs_blockdev_getro"
24275 #: ../src/guestfs-actions.pod:710
24279 " guestfs_blockdev_getro (guestfs_h *g,\n"
24280 " const char *device);\n"
24285 #: ../src/guestfs-actions.pod:719 ../src/guestfs-actions.pod:1596 ../src/guestfs-actions.pod:1611 ../src/guestfs-actions.pod:2100 ../src/guestfs-actions.pod:2111 ../src/guestfs-actions.pod:2183 ../src/guestfs-actions.pod:2209 ../src/guestfs-actions.pod:2249 ../src/guestfs-actions.pod:2264 ../src/guestfs-actions.pod:2300 ../src/guestfs-actions.pod:2323 ../src/guestfs-actions.pod:3398 ../src/guestfs-actions.pod:3414 ../src/guestfs-actions.pod:3432 ../src/guestfs-actions.pod:3594 ../src/guestfs-actions.pod:3608 ../src/guestfs-actions.pod:3623 ../src/guestfs-actions.pod:3637 ../src/guestfs-actions.pod:3653 ../src/guestfs-actions.pod:3668 ../src/guestfs-actions.pod:3684 ../src/guestfs-actions.pod:3698 ../src/guestfs-actions.pod:3711 ../src/guestfs-actions.pod:3725 ../src/guestfs-actions.pod:3740 ../src/guestfs-actions.pod:3755 ../src/guestfs-actions.pod:3768 ../src/guestfs-actions.pod:3782 ../src/guestfs-actions.pod:5501
24286 msgid "This function returns a C truth value on success or -1 on error."
24290 #: ../src/guestfs-actions.pod:723
24291 msgid "guestfs_blockdev_getsize64"
24295 #: ../src/guestfs-actions.pod:725
24299 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
24300 " const char *device);\n"
24305 #: ../src/guestfs-actions.pod:731
24306 msgid "See also C<guestfs_blockdev_getsz>."
24310 #: ../src/guestfs-actions.pod:739
24311 msgid "guestfs_blockdev_getss"
24315 #: ../src/guestfs-actions.pod:741
24319 " guestfs_blockdev_getss (guestfs_h *g,\n"
24320 " const char *device);\n"
24325 #: ../src/guestfs-actions.pod:748
24327 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
24332 #: ../src/guestfs-actions.pod:757
24333 msgid "guestfs_blockdev_getsz"
24337 #: ../src/guestfs-actions.pod:759
24341 " guestfs_blockdev_getsz (guestfs_h *g,\n"
24342 " const char *device);\n"
24347 #: ../src/guestfs-actions.pod:766
24349 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
24350 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
24354 #: ../src/guestfs-actions.pod:776
24355 msgid "guestfs_blockdev_rereadpt"
24359 #: ../src/guestfs-actions.pod:778
24363 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
24364 " const char *device);\n"
24369 #: ../src/guestfs-actions.pod:790
24370 msgid "guestfs_blockdev_setbsz"
24374 #: ../src/guestfs-actions.pod:792
24378 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
24379 " const char *device,\n"
24380 " int blocksize);\n"
24385 #: ../src/guestfs-actions.pod:808
24386 msgid "guestfs_blockdev_setro"
24390 #: ../src/guestfs-actions.pod:810
24394 " guestfs_blockdev_setro (guestfs_h *g,\n"
24395 " const char *device);\n"
24400 #: ../src/guestfs-actions.pod:822
24401 msgid "guestfs_blockdev_setrw"
24405 #: ../src/guestfs-actions.pod:824
24409 " guestfs_blockdev_setrw (guestfs_h *g,\n"
24410 " const char *device);\n"
24415 #: ../src/guestfs-actions.pod:836
24416 msgid "guestfs_btrfs_filesystem_resize"
24420 #: ../src/guestfs-actions.pod:838
24424 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
24425 " const char *mountpoint,\n"
24431 #: ../src/guestfs-actions.pod:848
24434 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
24439 #: ../src/guestfs-actions.pod:871
24440 msgid "(Added in 1.11.17)"
24444 #: ../src/guestfs-actions.pod:873
24445 msgid "guestfs_btrfs_filesystem_resize_va"
24449 #: ../src/guestfs-actions.pod:875
24453 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
24454 " const char *mountpoint,\n"
24455 " va_list args);\n"
24460 #: ../src/guestfs-actions.pod:880
24461 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
24465 #: ../src/guestfs-actions.pod:884
24466 msgid "guestfs_btrfs_filesystem_resize_argv"
24470 #: ../src/guestfs-actions.pod:886
24474 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
24475 " const char *mountpoint,\n"
24477 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
24482 #: ../src/guestfs-actions.pod:891
24483 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
24487 #: ../src/guestfs-actions.pod:895
24488 msgid "guestfs_case_sensitive_path"
24492 #: ../src/guestfs-actions.pod:897
24496 " guestfs_case_sensitive_path (guestfs_h *g,\n"
24497 " const char *path);\n"
24502 #: ../src/guestfs-actions.pod:923
24504 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
24505 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
24506 "how the directories were originally created under Windows)."
24510 #: ../src/guestfs-actions.pod:931
24511 msgid "See also C<guestfs_realpath>."
24515 #: ../src/guestfs-actions.pod:936 ../src/guestfs-actions.pod:7565
24516 msgid "(Added in 1.0.75)"
24520 #: ../src/guestfs-actions.pod:938
24521 msgid "guestfs_cat"
24525 #: ../src/guestfs-actions.pod:940
24529 " guestfs_cat (guestfs_h *g,\n"
24530 " const char *path);\n"
24535 #: ../src/guestfs-actions.pod:946
24537 "Note that this function cannot correctly handle binary files (specifically, "
24538 "files containing C<\\0> character which is treated as end of string). For "
24539 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
24540 "functions which have a more complex interface."
24544 #: ../src/guestfs-actions.pod:957 ../src/guestfs-actions.pod:3912 ../src/guestfs-actions.pod:3994 ../src/guestfs-actions.pod:4011 ../src/guestfs-actions.pod:4099 ../src/guestfs-actions.pod:4507 ../src/guestfs-actions.pod:4521 ../src/guestfs-actions.pod:5882 ../src/guestfs-actions.pod:5896 ../src/guestfs-actions.pod:7718 ../src/guestfs-actions.pod:7732
24545 msgid "(Added in 0.4)"
24549 #: ../src/guestfs-actions.pod:959
24550 msgid "guestfs_checksum"
24554 #: ../src/guestfs-actions.pod:961
24558 " guestfs_checksum (guestfs_h *g,\n"
24559 " const char *csumtype,\n"
24560 " const char *path);\n"
24565 #: ../src/guestfs-actions.pod:1007
24566 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
24570 #: ../src/guestfs-actions.pod:1009
24571 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
24575 #: ../src/guestfs-actions.pod:1014 ../src/guestfs-actions.pod:1433 ../src/guestfs-actions.pod:2291 ../src/guestfs-actions.pod:3610 ../src/guestfs-actions.pod:3639 ../src/guestfs-actions.pod:3700 ../src/guestfs-actions.pod:3727 ../src/guestfs-actions.pod:7421
24576 msgid "(Added in 1.0.2)"
24580 #: ../src/guestfs-actions.pod:1016
24581 msgid "guestfs_checksum_device"
24585 #: ../src/guestfs-actions.pod:1018
24589 " guestfs_checksum_device (guestfs_h *g,\n"
24590 " const char *csumtype,\n"
24591 " const char *device);\n"
24596 #: ../src/guestfs-actions.pod:1023
24598 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
24599 "device named C<device>. For the types of checksums supported see the "
24600 "C<guestfs_checksum> command."
24604 #: ../src/guestfs-actions.pod:1030 ../src/guestfs-actions.pod:5331 ../src/guestfs-actions.pod:5466 ../src/guestfs-actions.pod:5503 ../src/guestfs-actions.pod:5521 ../src/guestfs-actions.pod:5703 ../src/guestfs-actions.pod:7330 ../src/guestfs-actions.pod:7344 ../src/guestfs-actions.pod:7744
24605 msgid "(Added in 1.3.2)"
24609 #: ../src/guestfs-actions.pod:1032
24610 msgid "guestfs_checksums_out"
24614 #: ../src/guestfs-actions.pod:1034
24618 " guestfs_checksums_out (guestfs_h *g,\n"
24619 " const char *csumtype,\n"
24620 " const char *directory,\n"
24621 " const char *sumsfile);\n"
24626 #: ../src/guestfs-actions.pod:1054
24627 msgid "(Added in 1.3.7)"
24631 #: ../src/guestfs-actions.pod:1056
24632 msgid "guestfs_chmod"
24636 #: ../src/guestfs-actions.pod:1058
24640 " guestfs_chmod (guestfs_h *g,\n"
24642 " const char *path);\n"
24647 #: ../src/guestfs-actions.pod:1076
24648 msgid "guestfs_chown"
24652 #: ../src/guestfs-actions.pod:1078
24656 " guestfs_chown (guestfs_h *g,\n"
24659 " const char *path);\n"
24664 #: ../src/guestfs-actions.pod:1094
24665 msgid "guestfs_command"
24669 #: ../src/guestfs-actions.pod:1096
24673 " guestfs_command (guestfs_h *g,\n"
24674 " char *const *arguments);\n"
24679 #: ../src/guestfs-actions.pod:1105
24681 "The single parameter is an argv-style list of arguments. The first element "
24682 "is the name of the program to run. Subsequent elements are parameters. The "
24683 "list must be non-empty (ie. must contain a program name). Note that the "
24684 "command runs directly, and is I<not> invoked via the shell (see "
24689 #: ../src/guestfs-actions.pod:1136 ../src/guestfs-actions.pod:1156 ../src/guestfs-actions.pod:1732
24690 msgid "(Added in 0.9.1)"
24694 #: ../src/guestfs-actions.pod:1138
24695 msgid "guestfs_command_lines"
24699 #: ../src/guestfs-actions.pod:1140
24703 " guestfs_command_lines (guestfs_h *g,\n"
24704 " char *const *arguments);\n"
24709 #: ../src/guestfs-actions.pod:1144
24711 "This is the same as C<guestfs_command>, but splits the result into a list of "
24716 #: ../src/guestfs-actions.pod:1147
24717 msgid "See also: C<guestfs_sh_lines>"
24721 #: ../src/guestfs-actions.pod:1158
24722 msgid "guestfs_compress_device_out"
24726 #: ../src/guestfs-actions.pod:1160
24730 " guestfs_compress_device_out (guestfs_h *g,\n"
24731 " const char *ctype,\n"
24732 " const char *device,\n"
24733 " const char *zdevice,\n"
24739 #: ../src/guestfs-actions.pod:1172
24742 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
24747 #: ../src/guestfs-actions.pod:1177
24749 "The C<ctype> and optional C<level> parameters have the same meaning as in "
24750 "C<guestfs_compress_out>."
24754 #: ../src/guestfs-actions.pod:1182 ../src/guestfs-actions.pod:1241 ../src/guestfs-actions.pod:2277 ../src/guestfs-actions.pod:6602
24755 msgid "(Added in 1.13.15)"
24759 #: ../src/guestfs-actions.pod:1184
24760 msgid "guestfs_compress_device_out_va"
24764 #: ../src/guestfs-actions.pod:1186
24768 " guestfs_compress_device_out_va (guestfs_h *g,\n"
24769 " const char *ctype,\n"
24770 " const char *device,\n"
24771 " const char *zdevice,\n"
24772 " va_list args);\n"
24777 #: ../src/guestfs-actions.pod:1193
24778 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
24782 #: ../src/guestfs-actions.pod:1197
24783 msgid "guestfs_compress_device_out_argv"
24787 #: ../src/guestfs-actions.pod:1199
24791 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
24792 " const char *ctype,\n"
24793 " const char *device,\n"
24794 " const char *zdevice,\n"
24796 "guestfs_compress_device_out_argv *optargs);\n"
24801 #: ../src/guestfs-actions.pod:1206
24802 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
24806 #: ../src/guestfs-actions.pod:1210
24807 msgid "guestfs_compress_out"
24811 #: ../src/guestfs-actions.pod:1212
24815 " guestfs_compress_out (guestfs_h *g,\n"
24816 " const char *ctype,\n"
24817 " const char *file,\n"
24818 " const char *zfile,\n"
24824 #: ../src/guestfs-actions.pod:1224
24827 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
24832 #: ../src/guestfs-actions.pod:1243
24833 msgid "guestfs_compress_out_va"
24837 #: ../src/guestfs-actions.pod:1245
24841 " guestfs_compress_out_va (guestfs_h *g,\n"
24842 " const char *ctype,\n"
24843 " const char *file,\n"
24844 " const char *zfile,\n"
24845 " va_list args);\n"
24850 #: ../src/guestfs-actions.pod:1252
24851 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
24855 #: ../src/guestfs-actions.pod:1256
24856 msgid "guestfs_compress_out_argv"
24860 #: ../src/guestfs-actions.pod:1258
24864 " guestfs_compress_out_argv (guestfs_h *g,\n"
24865 " const char *ctype,\n"
24866 " const char *file,\n"
24867 " const char *zfile,\n"
24868 " const struct guestfs_compress_out_argv "
24874 #: ../src/guestfs-actions.pod:1265
24875 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
24879 #: ../src/guestfs-actions.pod:1269
24880 msgid "guestfs_config"
24884 #: ../src/guestfs-actions.pod:1271
24888 " guestfs_config (guestfs_h *g,\n"
24889 " const char *qemuparam,\n"
24890 " const char *qemuvalue);\n"
24895 #: ../src/guestfs-actions.pod:1289
24896 msgid "guestfs_copy_size"
24900 #: ../src/guestfs-actions.pod:1291
24904 " guestfs_copy_size (guestfs_h *g,\n"
24905 " const char *src,\n"
24906 " const char *dest,\n"
24907 " int64_t size);\n"
24912 #: ../src/guestfs-actions.pod:1305 ../src/guestfs-actions.pod:1428 ../src/guestfs-actions.pod:1459 ../src/guestfs-actions.pod:1504 ../src/guestfs-actions.pod:1881 ../src/guestfs-actions.pod:1903 ../src/guestfs-actions.pod:3810 ../src/guestfs-actions.pod:7416 ../src/guestfs-actions.pod:7450 ../src/guestfs-actions.pod:7957 ../src/guestfs-actions.pod:7980
24914 "This long-running command can generate progress notification messages so "
24915 "that the caller can display a progress bar or indicator. To receive these "
24916 "messages, the caller must register a progress event callback. See "
24917 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
24921 #: ../src/guestfs-actions.pod:1310 ../src/guestfs-actions.pod:4534 ../src/guestfs-actions.pod:5909 ../src/guestfs-actions.pod:7651 ../src/guestfs-actions.pod:7671 ../src/guestfs-actions.pod:7757
24922 msgid "(Added in 1.0.87)"
24926 #: ../src/guestfs-actions.pod:1312
24931 #: ../src/guestfs-actions.pod:1314
24935 " guestfs_cp (guestfs_h *g,\n"
24936 " const char *src,\n"
24937 " const char *dest);\n"
24942 #: ../src/guestfs-actions.pod:1324 ../src/guestfs-actions.pod:1338 ../src/guestfs-actions.pod:1410 ../src/guestfs-actions.pod:1484 ../src/guestfs-actions.pod:1598 ../src/guestfs-actions.pod:5278 ../src/guestfs-actions.pod:5753
24943 msgid "(Added in 1.0.18)"
24947 #: ../src/guestfs-actions.pod:1326
24948 msgid "guestfs_cp_a"
24952 #: ../src/guestfs-actions.pod:1328
24956 " guestfs_cp_a (guestfs_h *g,\n"
24957 " const char *src,\n"
24958 " const char *dest);\n"
24963 #: ../src/guestfs-actions.pod:1340
24968 #: ../src/guestfs-actions.pod:1342
24972 " guestfs_dd (guestfs_h *g,\n"
24973 " const char *src,\n"
24974 " const char *dest);\n"
24979 #: ../src/guestfs-actions.pod:1352
24981 "If the destination is a device, it must be as large or larger than the "
24982 "source file or device, otherwise the copy will fail. This command cannot do "
24983 "partial copies (see C<guestfs_copy_size>)."
24987 #: ../src/guestfs-actions.pod:1360
24992 #: ../src/guestfs-actions.pod:1362
24996 " guestfs_df (guestfs_h *g);\n"
25001 #: ../src/guestfs-actions.pod:1367 ../src/guestfs-actions.pod:1384
25003 "This command is mostly useful for interactive sessions. It is I<not> "
25004 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
25009 #: ../src/guestfs-actions.pod:1374 ../src/guestfs-actions.pod:1391 ../src/guestfs-actions.pod:1509 ../src/guestfs-actions.pod:2516 ../src/guestfs-actions.pod:2540 ../src/guestfs-actions.pod:2608 ../src/guestfs-actions.pod:4644 ../src/guestfs-actions.pod:5178 ../src/guestfs-actions.pod:7154 ../src/guestfs-actions.pod:7178 ../src/guestfs-actions.pod:7797 ../src/guestfs-actions.pod:7810 ../src/guestfs-actions.pod:7823
25010 msgid "(Added in 1.0.54)"
25014 #: ../src/guestfs-actions.pod:1376
25015 msgid "guestfs_df_h"
25019 #: ../src/guestfs-actions.pod:1378
25023 " guestfs_df_h (guestfs_h *g);\n"
25028 #: ../src/guestfs-actions.pod:1393
25029 msgid "guestfs_dmesg"
25033 #: ../src/guestfs-actions.pod:1395
25037 " guestfs_dmesg (guestfs_h *g);\n"
25042 #: ../src/guestfs-actions.pod:1402
25044 "Another way to get the same information is to enable verbose messages with "
25045 "C<guestfs_set_verbose> or by setting the environment variable "
25046 "C<LIBGUESTFS_DEBUG=1> before running the program."
25050 #: ../src/guestfs-actions.pod:1412
25051 msgid "guestfs_download"
25055 #: ../src/guestfs-actions.pod:1414
25059 " guestfs_download (guestfs_h *g,\n"
25060 " const char *remotefilename,\n"
25061 " const char *filename);\n"
25066 #: ../src/guestfs-actions.pod:1424
25067 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
25071 #: ../src/guestfs-actions.pod:1435
25072 msgid "guestfs_download_offset"
25076 #: ../src/guestfs-actions.pod:1437
25080 " guestfs_download_offset (guestfs_h *g,\n"
25081 " const char *remotefilename,\n"
25082 " const char *filename,\n"
25083 " int64_t offset,\n"
25084 " int64_t size);\n"
25089 #: ../src/guestfs-actions.pod:1450
25091 "Note that there is no limit on the amount of data that can be downloaded "
25092 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
25093 "full amount unless an error occurs."
25097 #: ../src/guestfs-actions.pod:1455
25098 msgid "See also C<guestfs_download>, C<guestfs_pread>."
25102 #: ../src/guestfs-actions.pod:1464 ../src/guestfs-actions.pod:7455
25103 msgid "(Added in 1.5.17)"
25107 #: ../src/guestfs-actions.pod:1466
25108 msgid "guestfs_drop_caches"
25112 #: ../src/guestfs-actions.pod:1468
25116 " guestfs_drop_caches (guestfs_h *g,\n"
25117 " int whattodrop);\n"
25122 #: ../src/guestfs-actions.pod:1486
25127 #: ../src/guestfs-actions.pod:1488
25131 " guestfs_du (guestfs_h *g,\n"
25132 " const char *path);\n"
25137 #: ../src/guestfs-actions.pod:1511
25138 msgid "guestfs_e2fsck_f"
25142 #: ../src/guestfs-actions.pod:1513
25146 " guestfs_e2fsck_f (guestfs_h *g,\n"
25147 " const char *device);\n"
25152 #: ../src/guestfs-actions.pod:1521
25154 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
25155 "Normally you should use C<guestfs_fsck>."
25159 #: ../src/guestfs-actions.pod:1526
25160 msgid "(Added in 1.0.29)"
25164 #: ../src/guestfs-actions.pod:1528
25165 msgid "guestfs_echo_daemon"
25169 #: ../src/guestfs-actions.pod:1530
25173 " guestfs_echo_daemon (guestfs_h *g,\n"
25174 " char *const *words);\n"
25179 #: ../src/guestfs-actions.pod:1539
25180 msgid "See also C<guestfs_ping_daemon>."
25184 #: ../src/guestfs-actions.pod:1544 ../src/guestfs-actions.pod:2302 ../src/guestfs-actions.pod:6626
25185 msgid "(Added in 1.0.69)"
25189 #: ../src/guestfs-actions.pod:1546
25190 msgid "guestfs_egrep"
25194 #: ../src/guestfs-actions.pod:1548
25198 " guestfs_egrep (guestfs_h *g,\n"
25199 " const char *regex,\n"
25200 " const char *path);\n"
25205 #: ../src/guestfs-actions.pod:1563 ../src/guestfs-actions.pod:1582 ../src/guestfs-actions.pod:1639 ../src/guestfs-actions.pod:1685 ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:2432 ../src/guestfs-actions.pod:2451 ../src/guestfs-actions.pod:2629 ../src/guestfs-actions.pod:2642 ../src/guestfs-actions.pod:2657 ../src/guestfs-actions.pod:2703 ../src/guestfs-actions.pod:2725 ../src/guestfs-actions.pod:2738 ../src/guestfs-actions.pod:4024 ../src/guestfs-actions.pod:4038 ../src/guestfs-actions.pod:4051 ../src/guestfs-actions.pod:4065 ../src/guestfs-actions.pod:5066 ../src/guestfs-actions.pod:6087 ../src/guestfs-actions.pod:6136 ../src/guestfs-actions.pod:7022 ../src/guestfs-actions.pod:7034 ../src/guestfs-actions.pod:7047 ../src/guestfs-actions.pod:7060 ../src/guestfs-actions.pod:7082 ../src/guestfs-actions.pod:7095 ../src/guestfs-actions.pod:7108 ../src/guestfs-actions.pod:7121 ../src/guestfs-actions.pod:7915 ../src/guestfs-actions.pod:7934 ../src/guestfs-actions.pod:8028 ../src/guestfs-actions.pod:8047 ../src/guestfs-actions.pod:8093 ../src/guestfs-actions.pod:8112
25206 msgid "(Added in 1.0.66)"
25210 #: ../src/guestfs-actions.pod:1565
25211 msgid "guestfs_egrepi"
25215 #: ../src/guestfs-actions.pod:1567
25219 " guestfs_egrepi (guestfs_h *g,\n"
25220 " const char *regex,\n"
25221 " const char *path);\n"
25226 #: ../src/guestfs-actions.pod:1584
25227 msgid "guestfs_equal"
25231 #: ../src/guestfs-actions.pod:1586
25235 " guestfs_equal (guestfs_h *g,\n"
25236 " const char *file1,\n"
25237 " const char *file2);\n"
25242 #: ../src/guestfs-actions.pod:1600
25243 msgid "guestfs_exists"
25247 #: ../src/guestfs-actions.pod:1602
25251 " guestfs_exists (guestfs_h *g,\n"
25252 " const char *path);\n"
25257 #: ../src/guestfs-actions.pod:1609
25258 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
25262 #: ../src/guestfs-actions.pod:1615
25263 msgid "guestfs_fallocate"
25267 #: ../src/guestfs-actions.pod:1617
25271 " guestfs_fallocate (guestfs_h *g,\n"
25272 " const char *path,\n"
25278 #: ../src/guestfs-actions.pod:1622
25280 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
25285 #: ../src/guestfs-actions.pod:1641
25286 msgid "guestfs_fallocate64"
25290 #: ../src/guestfs-actions.pod:1643
25294 " guestfs_fallocate64 (guestfs_h *g,\n"
25295 " const char *path,\n"
25301 #: ../src/guestfs-actions.pod:1652
25303 "Note that this call allocates disk blocks for the file. To create a sparse "
25304 "file use C<guestfs_truncate_size> instead."
25308 #: ../src/guestfs-actions.pod:1655
25310 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
25311 "oversight it only allowed 30 bit lengths to be specified, effectively "
25312 "limiting the maximum size of files created through that call to 1GB."
25316 #: ../src/guestfs-actions.pod:1666
25317 msgid "(Added in 1.3.17)"
25321 #: ../src/guestfs-actions.pod:1668
25322 msgid "guestfs_fgrep"
25326 #: ../src/guestfs-actions.pod:1670
25330 " guestfs_fgrep (guestfs_h *g,\n"
25331 " const char *pattern,\n"
25332 " const char *path);\n"
25337 #: ../src/guestfs-actions.pod:1687
25338 msgid "guestfs_fgrepi"
25342 #: ../src/guestfs-actions.pod:1689
25346 " guestfs_fgrepi (guestfs_h *g,\n"
25347 " const char *pattern,\n"
25348 " const char *path);\n"
25353 #: ../src/guestfs-actions.pod:1706
25354 msgid "guestfs_file"
25358 #: ../src/guestfs-actions.pod:1708
25362 " guestfs_file (guestfs_h *g,\n"
25363 " const char *path);\n"
25368 #: ../src/guestfs-actions.pod:1726
25370 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
25371 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
25375 #: ../src/guestfs-actions.pod:1734
25376 msgid "guestfs_file_architecture"
25380 #: ../src/guestfs-actions.pod:1736
25384 " guestfs_file_architecture (guestfs_h *g,\n"
25385 " const char *filename);\n"
25390 #: ../src/guestfs-actions.pod:1844 ../src/guestfs-actions.pod:2007 ../src/guestfs-actions.pod:2024 ../src/guestfs-actions.pod:2758 ../src/guestfs-actions.pod:2860 ../src/guestfs-actions.pod:2926 ../src/guestfs-actions.pod:3113 ../src/guestfs-actions.pod:3131 ../src/guestfs-actions.pod:3171 ../src/guestfs-actions.pod:3247 ../src/guestfs-actions.pod:3344 ../src/guestfs-actions.pod:3581 ../src/guestfs-actions.pod:3713
25391 msgid "(Added in 1.5.3)"
25395 #: ../src/guestfs-actions.pod:1846
25396 msgid "guestfs_filesize"
25400 #: ../src/guestfs-actions.pod:1848
25404 " guestfs_filesize (guestfs_h *g,\n"
25405 " const char *file);\n"
25410 #: ../src/guestfs-actions.pod:1854
25412 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
25413 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
25414 "devices, use C<guestfs_blockdev_getsize64>."
25418 #: ../src/guestfs-actions.pod:1860
25419 msgid "(Added in 1.0.82)"
25423 #: ../src/guestfs-actions.pod:1862
25424 msgid "guestfs_fill"
25428 #: ../src/guestfs-actions.pod:1864
25432 " guestfs_fill (guestfs_h *g,\n"
25435 " const char *path);\n"
25440 #: ../src/guestfs-actions.pod:1874
25442 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
25443 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
25444 "bytes use C<guestfs_fill_pattern>."
25448 #: ../src/guestfs-actions.pod:1886
25449 msgid "(Added in 1.0.79)"
25453 #: ../src/guestfs-actions.pod:1888
25454 msgid "guestfs_fill_pattern"
25458 #: ../src/guestfs-actions.pod:1890
25462 " guestfs_fill_pattern (guestfs_h *g,\n"
25463 " const char *pattern,\n"
25465 " const char *path);\n"
25470 #: ../src/guestfs-actions.pod:1896
25472 "This function is like C<guestfs_fill> except that it creates a new file of "
25473 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
25474 "pattern is truncated if necessary to ensure the length of the file is "
25475 "exactly C<len> bytes."
25479 #: ../src/guestfs-actions.pod:1908
25480 msgid "(Added in 1.3.12)"
25484 #: ../src/guestfs-actions.pod:1910
25485 msgid "guestfs_find"
25489 #: ../src/guestfs-actions.pod:1912
25493 " guestfs_find (guestfs_h *g,\n"
25494 " const char *directory);\n"
25499 #: ../src/guestfs-actions.pod:1928
25500 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
25504 #: ../src/guestfs-actions.pod:1941
25505 msgid "See also C<guestfs_find0>."
25509 #: ../src/guestfs-actions.pod:1950 ../src/guestfs-actions.pod:4471 ../src/guestfs-actions.pod:6171
25510 msgid "(Added in 1.0.27)"
25514 #: ../src/guestfs-actions.pod:1952
25515 msgid "guestfs_find0"
25519 #: ../src/guestfs-actions.pod:1954
25523 " guestfs_find0 (guestfs_h *g,\n"
25524 " const char *directory,\n"
25525 " const char *files);\n"
25530 #: ../src/guestfs-actions.pod:1963
25532 "This command works the same way as C<guestfs_find> with the following "
25537 #: ../src/guestfs-actions.pod:1990
25538 msgid "(Added in 1.0.74)"
25542 #: ../src/guestfs-actions.pod:1992
25543 msgid "guestfs_findfs_label"
25547 #: ../src/guestfs-actions.pod:1994
25551 " guestfs_findfs_label (guestfs_h *g,\n"
25552 " const char *label);\n"
25557 #: ../src/guestfs-actions.pod:2002
25558 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
25562 #: ../src/guestfs-actions.pod:2009
25563 msgid "guestfs_findfs_uuid"
25567 #: ../src/guestfs-actions.pod:2011
25571 " guestfs_findfs_uuid (guestfs_h *g,\n"
25572 " const char *uuid);\n"
25577 #: ../src/guestfs-actions.pod:2019
25578 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
25582 #: ../src/guestfs-actions.pod:2026
25583 msgid "guestfs_fsck"
25587 #: ../src/guestfs-actions.pod:2028
25591 " guestfs_fsck (guestfs_h *g,\n"
25592 " const char *fstype,\n"
25593 " const char *device);\n"
25598 #: ../src/guestfs-actions.pod:2063 ../src/guestfs-actions.pod:7962
25599 msgid "(Added in 1.0.16)"
25603 #: ../src/guestfs-actions.pod:2065
25604 msgid "guestfs_get_append"
25608 #: ../src/guestfs-actions.pod:2067
25612 " guestfs_get_append (guestfs_h *g);\n"
25617 #: ../src/guestfs-actions.pod:2075
25619 "This function returns a string which may be NULL. There is no way to return "
25620 "an error from this function. The string is owned by the guest handle and "
25621 "must I<not> be freed."
25625 #: ../src/guestfs-actions.pod:2079 ../src/guestfs-actions.pod:5849 ../src/guestfs-actions.pod:6331 ../src/guestfs-actions.pod:6789 ../src/guestfs-actions.pod:6808 ../src/guestfs-actions.pod:6824 ../src/guestfs-actions.pod:6848 ../src/guestfs-actions.pod:7602 ../src/guestfs-actions.pod:7617 ../src/guestfs-actions.pod:8009
25626 msgid "(Added in 1.0.26)"
25630 #: ../src/guestfs-actions.pod:2081
25631 msgid "guestfs_get_attach_method"
25635 #: ../src/guestfs-actions.pod:2083
25639 " guestfs_get_attach_method (guestfs_h *g);\n"
25644 #: ../src/guestfs-actions.pod:2086
25645 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
25649 #: ../src/guestfs-actions.pod:2091 ../src/guestfs-actions.pod:6361
25650 msgid "(Added in 1.9.8)"
25654 #: ../src/guestfs-actions.pod:2093
25655 msgid "guestfs_get_autosync"
25659 #: ../src/guestfs-actions.pod:2095
25663 " guestfs_get_autosync (guestfs_h *g);\n"
25668 #: ../src/guestfs-actions.pod:2104
25669 msgid "guestfs_get_direct"
25673 #: ../src/guestfs-actions.pod:2106
25677 " guestfs_get_direct (guestfs_h *g);\n"
25682 #: ../src/guestfs-actions.pod:2113 ../src/guestfs-actions.pod:6402
25683 msgid "(Added in 1.0.72)"
25687 #: ../src/guestfs-actions.pod:2115
25688 msgid "guestfs_get_e2label"
25692 #: ../src/guestfs-actions.pod:2117
25696 " guestfs_get_e2label (guestfs_h *g,\n"
25697 " const char *device);\n"
25702 #: ../src/guestfs-actions.pod:2121
25704 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
25709 #: ../src/guestfs-actions.pod:2134 ../src/guestfs-actions.pod:2155 ../src/guestfs-actions.pod:6420 ../src/guestfs-actions.pod:6439
25710 msgid "(Added in 1.0.15)"
25714 #: ../src/guestfs-actions.pod:2136
25715 msgid "guestfs_get_e2uuid"
25719 #: ../src/guestfs-actions.pod:2138
25723 " guestfs_get_e2uuid (guestfs_h *g,\n"
25724 " const char *device);\n"
25729 #: ../src/guestfs-actions.pod:2142
25731 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
25736 #: ../src/guestfs-actions.pod:2157
25737 msgid "guestfs_get_memsize"
25741 #: ../src/guestfs-actions.pod:2159
25745 " guestfs_get_memsize (guestfs_h *g);\n"
25750 #: ../src/guestfs-actions.pod:2165
25752 "If C<guestfs_set_memsize> was not called on this handle, and if "
25753 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
25754 "value for memsize."
25758 #: ../src/guestfs-actions.pod:2174 ../src/guestfs-actions.pod:4762 ../src/guestfs-actions.pod:4971 ../src/guestfs-actions.pod:4990 ../src/guestfs-actions.pod:5009 ../src/guestfs-actions.pod:5021 ../src/guestfs-actions.pod:5038 ../src/guestfs-actions.pod:5051 ../src/guestfs-actions.pod:6074 ../src/guestfs-actions.pod:6460 ../src/guestfs-actions.pod:6756 ../src/guestfs-actions.pod:7371
25759 msgid "(Added in 1.0.55)"
25763 #: ../src/guestfs-actions.pod:2176
25764 msgid "guestfs_get_network"
25768 #: ../src/guestfs-actions.pod:2178
25772 " guestfs_get_network (guestfs_h *g);\n"
25777 #: ../src/guestfs-actions.pod:2185 ../src/guestfs-actions.pod:6479
25778 msgid "(Added in 1.5.4)"
25782 #: ../src/guestfs-actions.pod:2187
25783 msgid "guestfs_get_path"
25787 #: ../src/guestfs-actions.pod:2189
25791 " guestfs_get_path (guestfs_h *g);\n"
25796 #: ../src/guestfs-actions.pod:2197 ../src/guestfs-actions.pod:2237
25798 "This function returns a string, or NULL on error. The string is owned by "
25799 "the guest handle and must I<not> be freed."
25803 #: ../src/guestfs-actions.pod:2202
25804 msgid "guestfs_get_pgroup"
25808 #: ../src/guestfs-actions.pod:2204
25812 " guestfs_get_pgroup (guestfs_h *g);\n"
25817 #: ../src/guestfs-actions.pod:2211 ../src/guestfs-actions.pod:6515 ../src/guestfs-actions.pod:7863
25818 msgid "(Added in 1.11.18)"
25822 #: ../src/guestfs-actions.pod:2213
25823 msgid "guestfs_get_pid"
25827 #: ../src/guestfs-actions.pod:2215
25831 " guestfs_get_pid (guestfs_h *g);\n"
25836 #: ../src/guestfs-actions.pod:2225
25837 msgid "(Added in 1.0.56)"
25841 #: ../src/guestfs-actions.pod:2227
25842 msgid "guestfs_get_qemu"
25846 #: ../src/guestfs-actions.pod:2229
25850 " guestfs_get_qemu (guestfs_h *g);\n"
25855 #: ../src/guestfs-actions.pod:2240 ../src/guestfs-actions.pod:6543
25856 msgid "(Added in 1.0.6)"
25860 #: ../src/guestfs-actions.pod:2242
25861 msgid "guestfs_get_recovery_proc"
25865 #: ../src/guestfs-actions.pod:2244
25869 " guestfs_get_recovery_proc (guestfs_h *g);\n"
25874 #: ../src/guestfs-actions.pod:2251 ../src/guestfs-actions.pod:3835 ../src/guestfs-actions.pod:4166 ../src/guestfs-actions.pod:4569 ../src/guestfs-actions.pod:4601 ../src/guestfs-actions.pod:5779 ../src/guestfs-actions.pod:6122 ../src/guestfs-actions.pod:6567 ../src/guestfs-actions.pod:7274 ../src/guestfs-actions.pod:7294 ../src/guestfs-actions.pod:7486
25875 msgid "(Added in 1.0.77)"
25879 #: ../src/guestfs-actions.pod:2253
25880 msgid "guestfs_get_selinux"
25884 #: ../src/guestfs-actions.pod:2255
25888 " guestfs_get_selinux (guestfs_h *g);\n"
25893 #: ../src/guestfs-actions.pod:2258
25895 "This returns the current setting of the selinux flag which is passed to the "
25896 "appliance at boot time. See C<guestfs_set_selinux>."
25900 #: ../src/guestfs-actions.pod:2266 ../src/guestfs-actions.pod:2340 ../src/guestfs-actions.pod:6586 ../src/guestfs-actions.pod:6660
25901 msgid "(Added in 1.0.67)"
25905 #: ../src/guestfs-actions.pod:2268
25906 msgid "guestfs_get_smp"
25910 #: ../src/guestfs-actions.pod:2270
25914 " guestfs_get_smp (guestfs_h *g);\n"
25919 #: ../src/guestfs-actions.pod:2279
25920 msgid "guestfs_get_state"
25924 #: ../src/guestfs-actions.pod:2281
25928 " guestfs_get_state (guestfs_h *g);\n"
25933 #: ../src/guestfs-actions.pod:2293
25934 msgid "guestfs_get_trace"
25938 #: ../src/guestfs-actions.pod:2295
25942 " guestfs_get_trace (guestfs_h *g);\n"
25947 #: ../src/guestfs-actions.pod:2304
25948 msgid "guestfs_get_umask"
25952 #: ../src/guestfs-actions.pod:2306
25956 " guestfs_get_umask (guestfs_h *g);\n"
25961 #: ../src/guestfs-actions.pod:2309
25963 "Return the current umask. By default the umask is C<022> unless it has been "
25964 "set by calling C<guestfs_umask>."
25968 #: ../src/guestfs-actions.pod:2316
25969 msgid "guestfs_get_verbose"
25973 #: ../src/guestfs-actions.pod:2318
25977 " guestfs_get_verbose (guestfs_h *g);\n"
25982 #: ../src/guestfs-actions.pod:2327
25983 msgid "guestfs_getcon"
25987 #: ../src/guestfs-actions.pod:2329
25991 " guestfs_getcon (guestfs_h *g);\n"
25996 #: ../src/guestfs-actions.pod:2334
25997 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
26001 #: ../src/guestfs-actions.pod:2342
26002 msgid "guestfs_getxattr"
26006 #: ../src/guestfs-actions.pod:2344
26010 " guestfs_getxattr (guestfs_h *g,\n"
26011 " const char *path,\n"
26012 " const char *name,\n"
26013 " size_t *size_r);\n"
26018 #: ../src/guestfs-actions.pod:2350
26020 "Get a single extended attribute from file C<path> named C<name>. This call "
26021 "follows symlinks. If you want to lookup an extended attribute for the "
26022 "symlink itself, use C<guestfs_lgetxattr>."
26026 #: ../src/guestfs-actions.pod:2354 ../src/guestfs-actions.pod:3849
26028 "Normally it is better to get all extended attributes from a file in one go "
26029 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
26030 "implementations are buggy and do not provide a way to list out attributes. "
26031 "For these filesystems (notably ntfs-3g) you have to know the names of the "
26032 "extended attributes you want in advance and call this function."
26036 #: ../src/guestfs-actions.pod:2364
26037 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
26041 #: ../src/guestfs-actions.pod:2366 ../src/guestfs-actions.pod:2579 ../src/guestfs-actions.pod:3061 ../src/guestfs-actions.pod:3861 ../src/guestfs-actions.pod:5772 ../src/guestfs-actions.pod:5798 ../src/guestfs-actions.pod:5979
26043 "This function returns a buffer, or NULL on error. The size of the returned "
26044 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
26049 #: ../src/guestfs-actions.pod:2370 ../src/guestfs-actions.pod:3865
26050 msgid "(Added in 1.7.24)"
26054 #: ../src/guestfs-actions.pod:2372
26055 msgid "guestfs_getxattrs"
26059 #: ../src/guestfs-actions.pod:2374
26062 " struct guestfs_xattr_list *\n"
26063 " guestfs_getxattrs (guestfs_h *g,\n"
26064 " const char *path);\n"
26069 #: ../src/guestfs-actions.pod:2384
26070 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
26074 #: ../src/guestfs-actions.pod:2386 ../src/guestfs-actions.pod:3877 ../src/guestfs-actions.pod:4565
26076 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
26077 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
26081 #: ../src/guestfs-actions.pod:2390 ../src/guestfs-actions.pod:3881 ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4116 ../src/guestfs-actions.pod:6152 ../src/guestfs-actions.pod:6679 ../src/guestfs-actions.pod:8074
26082 msgid "(Added in 1.0.59)"
26086 #: ../src/guestfs-actions.pod:2392
26087 msgid "guestfs_glob_expand"
26091 #: ../src/guestfs-actions.pod:2394
26095 " guestfs_glob_expand (guestfs_h *g,\n"
26096 " const char *pattern);\n"
26101 #: ../src/guestfs-actions.pod:2413 ../src/guestfs-actions.pod:6872 ../src/guestfs-actions.pod:6889
26102 msgid "(Added in 1.0.50)"
26106 #: ../src/guestfs-actions.pod:2415
26107 msgid "guestfs_grep"
26111 #: ../src/guestfs-actions.pod:2417
26115 " guestfs_grep (guestfs_h *g,\n"
26116 " const char *regex,\n"
26117 " const char *path);\n"
26122 #: ../src/guestfs-actions.pod:2434
26123 msgid "guestfs_grepi"
26127 #: ../src/guestfs-actions.pod:2436
26131 " guestfs_grepi (guestfs_h *g,\n"
26132 " const char *regex,\n"
26133 " const char *path);\n"
26138 #: ../src/guestfs-actions.pod:2453
26139 msgid "guestfs_grub_install"
26143 #: ../src/guestfs-actions.pod:2455
26147 " guestfs_grub_install (guestfs_h *g,\n"
26148 " const char *root,\n"
26149 " const char *device);\n"
26154 #: ../src/guestfs-actions.pod:2498
26155 msgid "(Added in 1.0.17)"
26159 #: ../src/guestfs-actions.pod:2500
26160 msgid "guestfs_head"
26164 #: ../src/guestfs-actions.pod:2502
26168 " guestfs_head (guestfs_h *g,\n"
26169 " const char *path);\n"
26174 #: ../src/guestfs-actions.pod:2518
26175 msgid "guestfs_head_n"
26179 #: ../src/guestfs-actions.pod:2520
26183 " guestfs_head_n (guestfs_h *g,\n"
26185 " const char *path);\n"
26190 #: ../src/guestfs-actions.pod:2542
26191 msgid "guestfs_hexdump"
26195 #: ../src/guestfs-actions.pod:2544
26199 " guestfs_hexdump (guestfs_h *g,\n"
26200 " const char *path);\n"
26205 #: ../src/guestfs-actions.pod:2557 ../src/guestfs-actions.pod:6953 ../src/guestfs-actions.pod:7008
26206 msgid "(Added in 1.0.22)"
26210 #: ../src/guestfs-actions.pod:2559
26211 msgid "guestfs_initrd_cat"
26215 #: ../src/guestfs-actions.pod:2561
26219 " guestfs_initrd_cat (guestfs_h *g,\n"
26220 " const char *initrdpath,\n"
26221 " const char *filename,\n"
26222 " size_t *size_r);\n"
26227 #: ../src/guestfs-actions.pod:2577
26228 msgid "See also C<guestfs_initrd_list>."
26232 #: ../src/guestfs-actions.pod:2588
26233 msgid "guestfs_initrd_list"
26237 #: ../src/guestfs-actions.pod:2590
26241 " guestfs_initrd_list (guestfs_h *g,\n"
26242 " const char *path);\n"
26247 #: ../src/guestfs-actions.pod:2610
26248 msgid "guestfs_inotify_add_watch"
26252 #: ../src/guestfs-actions.pod:2612
26256 " guestfs_inotify_add_watch (guestfs_h *g,\n"
26257 " const char *path,\n"
26263 #: ../src/guestfs-actions.pod:2631
26264 msgid "guestfs_inotify_close"
26268 #: ../src/guestfs-actions.pod:2633
26272 " guestfs_inotify_close (guestfs_h *g);\n"
26277 #: ../src/guestfs-actions.pod:2644
26278 msgid "guestfs_inotify_files"
26282 #: ../src/guestfs-actions.pod:2646
26286 " guestfs_inotify_files (guestfs_h *g);\n"
26291 #: ../src/guestfs-actions.pod:2649
26293 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
26294 "returns a list of pathnames of objects that were touched. The returned "
26295 "pathnames are sorted and deduplicated."
26299 #: ../src/guestfs-actions.pod:2659
26300 msgid "guestfs_inotify_init"
26304 #: ../src/guestfs-actions.pod:2661
26308 " guestfs_inotify_init (guestfs_h *g,\n"
26309 " int maxevents);\n"
26314 #: ../src/guestfs-actions.pod:2669
26316 "C<maxevents> is the maximum number of events which will be queued up between "
26317 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
26318 "passed as C<0>, then the kernel (or previously set) default is used. For "
26319 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
26320 "throws away events, but records the fact that it threw them away by setting "
26321 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
26322 "C<guestfs_inotify_read>)."
26326 #: ../src/guestfs-actions.pod:2679
26328 "Before any events are generated, you have to add some watches to the "
26329 "internal watch list. See: C<guestfs_inotify_add_watch>, "
26330 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
26334 #: ../src/guestfs-actions.pod:2685
26336 "Queued up events should be read periodically by calling "
26337 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
26338 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
26339 "often enough then you risk the internal queue overflowing."
26343 #: ../src/guestfs-actions.pod:2692
26345 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
26346 "This also removes any watches automatically."
26350 #: ../src/guestfs-actions.pod:2705
26351 msgid "guestfs_inotify_read"
26355 #: ../src/guestfs-actions.pod:2707
26358 " struct guestfs_inotify_event_list *\n"
26359 " guestfs_inotify_read (guestfs_h *g);\n"
26364 #: ../src/guestfs-actions.pod:2721
26366 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
26367 "there was an error. I<The caller must call "
26368 "C<guestfs_free_inotify_event_list> after use>."
26372 #: ../src/guestfs-actions.pod:2727
26373 msgid "guestfs_inotify_rm_watch"
26377 #: ../src/guestfs-actions.pod:2729
26381 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
26387 #: ../src/guestfs-actions.pod:2733
26389 "Remove a previously defined inotify watch. See "
26390 "C<guestfs_inotify_add_watch>."
26394 #: ../src/guestfs-actions.pod:2740
26395 msgid "guestfs_inspect_get_arch"
26399 #: ../src/guestfs-actions.pod:2742
26403 " guestfs_inspect_get_arch (guestfs_h *g,\n"
26404 " const char *root);\n"
26409 #: ../src/guestfs-actions.pod:2746
26411 "This returns the architecture of the inspected operating system. The "
26412 "possible return values are listed under C<guestfs_file_architecture>."
26416 #: ../src/guestfs-actions.pod:2760
26417 msgid "guestfs_inspect_get_distro"
26421 #: ../src/guestfs-actions.pod:2762
26425 " guestfs_inspect_get_distro (guestfs_h *g,\n"
26426 " const char *root);\n"
26431 #: ../src/guestfs-actions.pod:2862
26432 msgid "guestfs_inspect_get_drive_mappings"
26436 #: ../src/guestfs-actions.pod:2864
26440 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
26441 " const char *root);\n"
26446 #: ../src/guestfs-actions.pod:2893
26448 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26449 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
26453 #: ../src/guestfs-actions.pod:2897 ../src/guestfs-actions.pod:3165 ../src/guestfs-actions.pod:3968 ../src/guestfs-actions.pod:5240 ../src/guestfs-actions.pod:7310
26455 "This function returns a NULL-terminated array of strings, or NULL if there "
26456 "was an error. The array of strings will always have length C<2n+1>, where "
26457 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
26458 "caller must free the strings and the array after use>."
26462 #: ../src/guestfs-actions.pod:2903 ../src/guestfs-actions.pod:3364
26463 msgid "(Added in 1.9.17)"
26467 #: ../src/guestfs-actions.pod:2905
26468 msgid "guestfs_inspect_get_filesystems"
26472 #: ../src/guestfs-actions.pod:2907
26476 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
26477 " const char *root);\n"
26482 #: ../src/guestfs-actions.pod:2919
26484 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26485 "C<guestfs_inspect_get_mountpoints>."
26489 #: ../src/guestfs-actions.pod:2928
26490 msgid "guestfs_inspect_get_format"
26494 #: ../src/guestfs-actions.pod:2930
26498 " guestfs_inspect_get_format (guestfs_h *g,\n"
26499 " const char *root);\n"
26504 #: ../src/guestfs-actions.pod:2964 ../src/guestfs-actions.pod:3400 ../src/guestfs-actions.pod:3416 ../src/guestfs-actions.pod:3434 ../src/guestfs-actions.pod:6190
26505 msgid "(Added in 1.9.4)"
26509 #: ../src/guestfs-actions.pod:2966
26510 msgid "guestfs_inspect_get_hostname"
26514 #: ../src/guestfs-actions.pod:2968
26518 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
26519 " const char *root);\n"
26524 #: ../src/guestfs-actions.pod:2983
26525 msgid "(Added in 1.7.9)"
26529 #: ../src/guestfs-actions.pod:2985
26530 msgid "guestfs_inspect_get_icon"
26534 #: ../src/guestfs-actions.pod:2987
26538 " guestfs_inspect_get_icon (guestfs_h *g,\n"
26539 " const char *root,\n"
26540 " size_t *size_r,\n"
26546 #: ../src/guestfs-actions.pod:2998
26549 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
26550 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
26555 #: ../src/guestfs-actions.pod:3065 ../src/guestfs-actions.pod:3895 ../src/guestfs-actions.pod:5139
26556 msgid "(Added in 1.11.12)"
26560 #: ../src/guestfs-actions.pod:3067
26561 msgid "guestfs_inspect_get_icon_va"
26565 #: ../src/guestfs-actions.pod:3069
26569 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
26570 " const char *root,\n"
26571 " size_t *size_r,\n"
26572 " va_list args);\n"
26577 #: ../src/guestfs-actions.pod:3075
26578 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
26582 #: ../src/guestfs-actions.pod:3079
26583 msgid "guestfs_inspect_get_icon_argv"
26587 #: ../src/guestfs-actions.pod:3081
26591 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
26592 " const char *root,\n"
26593 " size_t *size_r,\n"
26594 " const struct guestfs_inspect_get_icon_argv "
26600 #: ../src/guestfs-actions.pod:3087
26601 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
26605 #: ../src/guestfs-actions.pod:3091
26606 msgid "guestfs_inspect_get_major_version"
26610 #: ../src/guestfs-actions.pod:3093
26614 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
26615 " const char *root);\n"
26620 #: ../src/guestfs-actions.pod:3115
26621 msgid "guestfs_inspect_get_minor_version"
26625 #: ../src/guestfs-actions.pod:3117
26629 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
26630 " const char *root);\n"
26635 #: ../src/guestfs-actions.pod:3126
26637 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26638 "C<guestfs_inspect_get_major_version>."
26642 #: ../src/guestfs-actions.pod:3133
26643 msgid "guestfs_inspect_get_mountpoints"
26647 #: ../src/guestfs-actions.pod:3135
26651 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
26652 " const char *root);\n"
26657 #: ../src/guestfs-actions.pod:3156
26659 "For operating systems like Windows which still use drive letters, this call "
26660 "will only return an entry for the first drive \"mounted on\" C</>. For "
26661 "information about the mapping of drive letters to partitions, see "
26662 "C<guestfs_inspect_get_drive_mappings>."
26666 #: ../src/guestfs-actions.pod:3162
26668 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26669 "C<guestfs_inspect_get_filesystems>."
26673 #: ../src/guestfs-actions.pod:3173
26674 msgid "guestfs_inspect_get_package_format"
26678 #: ../src/guestfs-actions.pod:3175
26682 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
26683 " const char *root);\n"
26688 #: ../src/guestfs-actions.pod:3179
26690 "This function and C<guestfs_inspect_get_package_management> return the "
26691 "package format and package management tool used by the inspected operating "
26692 "system. For example for Fedora these functions would return C<rpm> (package "
26693 "format) and C<yum> (package management)."
26697 #: ../src/guestfs-actions.pod:3198 ../src/guestfs-actions.pod:3226
26698 msgid "(Added in 1.7.5)"
26702 #: ../src/guestfs-actions.pod:3200
26703 msgid "guestfs_inspect_get_package_management"
26707 #: ../src/guestfs-actions.pod:3202
26711 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
26712 " const char *root);\n"
26717 #: ../src/guestfs-actions.pod:3206
26719 "C<guestfs_inspect_get_package_format> and this function return the package "
26720 "format and package management tool used by the inspected operating system. "
26721 "For example for Fedora these functions would return C<rpm> (package format) "
26722 "and C<yum> (package management)."
26726 #: ../src/guestfs-actions.pod:3228
26727 msgid "guestfs_inspect_get_product_name"
26731 #: ../src/guestfs-actions.pod:3230
26735 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
26736 " const char *root);\n"
26741 #: ../src/guestfs-actions.pod:3249
26742 msgid "guestfs_inspect_get_product_variant"
26746 #: ../src/guestfs-actions.pod:3251
26750 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
26751 " const char *root);\n"
26756 #: ../src/guestfs-actions.pod:3274
26758 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26759 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
26763 #: ../src/guestfs-actions.pod:3281
26764 msgid "(Added in 1.9.13)"
26768 #: ../src/guestfs-actions.pod:3283
26769 msgid "guestfs_inspect_get_roots"
26773 #: ../src/guestfs-actions.pod:3285
26777 " guestfs_inspect_get_roots (guestfs_h *g);\n"
26782 #: ../src/guestfs-actions.pod:3288
26784 "This function is a convenient way to get the list of root devices, as "
26785 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
26786 "the whole inspection process."
26790 #: ../src/guestfs-actions.pod:3292
26792 "This returns an empty list if either no root devices were found or the "
26793 "caller has not called C<guestfs_inspect_os>."
26797 #: ../src/guestfs-actions.pod:3301
26798 msgid "(Added in 1.7.3)"
26802 #: ../src/guestfs-actions.pod:3303
26803 msgid "guestfs_inspect_get_type"
26807 #: ../src/guestfs-actions.pod:3305
26811 " guestfs_inspect_get_type (guestfs_h *g,\n"
26812 " const char *root);\n"
26817 #: ../src/guestfs-actions.pod:3346
26818 msgid "guestfs_inspect_get_windows_current_control_set"
26822 #: ../src/guestfs-actions.pod:3348
26826 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
26827 " const char *root);\n"
26832 #: ../src/guestfs-actions.pod:3366
26833 msgid "guestfs_inspect_get_windows_systemroot"
26837 #: ../src/guestfs-actions.pod:3368
26841 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
26842 " const char *root);\n"
26847 #: ../src/guestfs-actions.pod:3384
26848 msgid "(Added in 1.5.25)"
26852 #: ../src/guestfs-actions.pod:3386
26853 msgid "guestfs_inspect_is_live"
26857 #: ../src/guestfs-actions.pod:3388
26861 " guestfs_inspect_is_live (guestfs_h *g,\n"
26862 " const char *root);\n"
26867 #: ../src/guestfs-actions.pod:3392
26869 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26870 "disk), then this returns true if a live image was detected on the disk."
26874 #: ../src/guestfs-actions.pod:3402
26875 msgid "guestfs_inspect_is_multipart"
26879 #: ../src/guestfs-actions.pod:3404
26883 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
26884 " const char *root);\n"
26889 #: ../src/guestfs-actions.pod:3408
26891 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26892 "disk), then this returns true if the disk is part of a set."
26896 #: ../src/guestfs-actions.pod:3418
26897 msgid "guestfs_inspect_is_netinst"
26901 #: ../src/guestfs-actions.pod:3420
26905 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
26906 " const char *root);\n"
26911 #: ../src/guestfs-actions.pod:3424
26913 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26914 "disk), then this returns true if the disk is a network installer, ie. not a "
26915 "self-contained install CD but one which is likely to require network access "
26916 "to complete the install."
26920 #: ../src/guestfs-actions.pod:3436
26921 msgid "guestfs_inspect_list_applications"
26925 #: ../src/guestfs-actions.pod:3438
26928 " struct guestfs_application_list *\n"
26929 " guestfs_inspect_list_applications (guestfs_h *g,\n"
26930 " const char *root);\n"
26935 #: ../src/guestfs-actions.pod:3444
26937 "I<Note:> This call works differently from other parts of the inspection "
26938 "API. You have to call C<guestfs_inspect_os>, then "
26939 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
26940 "this. Listing applications is a significantly more difficult operation "
26941 "which requires access to the full filesystem. Also note that unlike the "
26942 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
26943 "the libguestfs handle, this call actually reads parts of the mounted "
26944 "filesystems during the call."
26948 #: ../src/guestfs-actions.pod:3534
26950 "This function returns a C<struct guestfs_application_list *>, or NULL if "
26951 "there was an error. I<The caller must call C<guestfs_free_application_list> "
26956 #: ../src/guestfs-actions.pod:3538
26957 msgid "(Added in 1.7.8)"
26961 #: ../src/guestfs-actions.pod:3540
26962 msgid "guestfs_inspect_os"
26966 #: ../src/guestfs-actions.pod:3542
26970 " guestfs_inspect_os (guestfs_h *g);\n"
26975 #: ../src/guestfs-actions.pod:3558
26977 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
26978 "functions in order to query further information about each operating system, "
26979 "such as the name and version."
26983 #: ../src/guestfs-actions.pod:3563
26985 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
26986 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
26987 "the contents. This should be called with no disks currently mounted. The "
26988 "function may also use Augeas, so any existing Augeas handle will be closed."
26992 #: ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:3906 ../src/guestfs-actions.pod:3988
26993 msgid "See also C<guestfs_list_filesystems>."
26997 #: ../src/guestfs-actions.pod:3583
26998 msgid "guestfs_is_blockdev"
27002 #: ../src/guestfs-actions.pod:3585
27006 " guestfs_is_blockdev (guestfs_h *g,\n"
27007 " const char *path);\n"
27012 #: ../src/guestfs-actions.pod:3592 ../src/guestfs-actions.pod:3621 ../src/guestfs-actions.pod:3651 ../src/guestfs-actions.pod:3666 ../src/guestfs-actions.pod:3682 ../src/guestfs-actions.pod:3738 ../src/guestfs-actions.pod:3753
27013 msgid "See also C<guestfs_stat>."
27017 #: ../src/guestfs-actions.pod:3596 ../src/guestfs-actions.pod:3625 ../src/guestfs-actions.pod:3670 ../src/guestfs-actions.pod:3742 ../src/guestfs-actions.pod:3757
27018 msgid "(Added in 1.5.10)"
27022 #: ../src/guestfs-actions.pod:3598
27023 msgid "guestfs_is_busy"
27027 #: ../src/guestfs-actions.pod:3600
27031 " guestfs_is_busy (guestfs_h *g);\n"
27036 #: ../src/guestfs-actions.pod:3612
27037 msgid "guestfs_is_chardev"
27041 #: ../src/guestfs-actions.pod:3614
27045 " guestfs_is_chardev (guestfs_h *g,\n"
27046 " const char *path);\n"
27051 #: ../src/guestfs-actions.pod:3627
27052 msgid "guestfs_is_config"
27056 #: ../src/guestfs-actions.pod:3629
27060 " guestfs_is_config (guestfs_h *g);\n"
27065 #: ../src/guestfs-actions.pod:3641
27066 msgid "guestfs_is_dir"
27070 #: ../src/guestfs-actions.pod:3643
27074 " guestfs_is_dir (guestfs_h *g,\n"
27075 " const char *path);\n"
27080 #: ../src/guestfs-actions.pod:3657
27081 msgid "guestfs_is_fifo"
27085 #: ../src/guestfs-actions.pod:3659
27089 " guestfs_is_fifo (guestfs_h *g,\n"
27090 " const char *path);\n"
27095 #: ../src/guestfs-actions.pod:3672
27096 msgid "guestfs_is_file"
27100 #: ../src/guestfs-actions.pod:3674
27104 " guestfs_is_file (guestfs_h *g,\n"
27105 " const char *path);\n"
27110 #: ../src/guestfs-actions.pod:3688
27111 msgid "guestfs_is_launching"
27115 #: ../src/guestfs-actions.pod:3690
27119 " guestfs_is_launching (guestfs_h *g);\n"
27124 #: ../src/guestfs-actions.pod:3702
27125 msgid "guestfs_is_lv"
27129 #: ../src/guestfs-actions.pod:3704
27133 " guestfs_is_lv (guestfs_h *g,\n"
27134 " const char *device);\n"
27139 #: ../src/guestfs-actions.pod:3715
27140 msgid "guestfs_is_ready"
27144 #: ../src/guestfs-actions.pod:3717
27148 " guestfs_is_ready (guestfs_h *g);\n"
27153 #: ../src/guestfs-actions.pod:3729
27154 msgid "guestfs_is_socket"
27158 #: ../src/guestfs-actions.pod:3731
27162 " guestfs_is_socket (guestfs_h *g,\n"
27163 " const char *path);\n"
27168 #: ../src/guestfs-actions.pod:3744
27169 msgid "guestfs_is_symlink"
27173 #: ../src/guestfs-actions.pod:3746
27177 " guestfs_is_symlink (guestfs_h *g,\n"
27178 " const char *path);\n"
27183 #: ../src/guestfs-actions.pod:3759
27184 msgid "guestfs_is_zero"
27188 #: ../src/guestfs-actions.pod:3761
27192 " guestfs_is_zero (guestfs_h *g,\n"
27193 " const char *path);\n"
27198 #: ../src/guestfs-actions.pod:3770 ../src/guestfs-actions.pod:3784
27199 msgid "(Added in 1.11.8)"
27203 #: ../src/guestfs-actions.pod:3772
27204 msgid "guestfs_is_zero_device"
27208 #: ../src/guestfs-actions.pod:3774
27212 " guestfs_is_zero_device (guestfs_h *g,\n"
27213 " const char *device);\n"
27218 #: ../src/guestfs-actions.pod:3786
27219 msgid "guestfs_kill_subprocess"
27223 #: ../src/guestfs-actions.pod:3788
27227 " guestfs_kill_subprocess (guestfs_h *g);\n"
27232 #: ../src/guestfs-actions.pod:3797
27233 msgid "guestfs_launch"
27237 #: ../src/guestfs-actions.pod:3799
27241 " guestfs_launch (guestfs_h *g);\n"
27246 #: ../src/guestfs-actions.pod:3817
27247 msgid "guestfs_lchown"
27251 #: ../src/guestfs-actions.pod:3819
27255 " guestfs_lchown (guestfs_h *g,\n"
27258 " const char *path);\n"
27263 #: ../src/guestfs-actions.pod:3825
27265 "Change the file owner to C<owner> and group to C<group>. This is like "
27266 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
27267 "changed, not the target."
27271 #: ../src/guestfs-actions.pod:3837
27272 msgid "guestfs_lgetxattr"
27276 #: ../src/guestfs-actions.pod:3839
27280 " guestfs_lgetxattr (guestfs_h *g,\n"
27281 " const char *path,\n"
27282 " const char *name,\n"
27283 " size_t *size_r);\n"
27288 #: ../src/guestfs-actions.pod:3859
27289 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
27293 #: ../src/guestfs-actions.pod:3867
27294 msgid "guestfs_lgetxattrs"
27298 #: ../src/guestfs-actions.pod:3869
27301 " struct guestfs_xattr_list *\n"
27302 " guestfs_lgetxattrs (guestfs_h *g,\n"
27303 " const char *path);\n"
27308 #: ../src/guestfs-actions.pod:3873
27310 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
27311 "then it returns the extended attributes of the link itself."
27315 #: ../src/guestfs-actions.pod:3883
27316 msgid "guestfs_list_9p"
27320 #: ../src/guestfs-actions.pod:3885
27324 " guestfs_list_9p (guestfs_h *g);\n"
27329 #: ../src/guestfs-actions.pod:3897
27330 msgid "guestfs_list_devices"
27334 #: ../src/guestfs-actions.pod:3899
27338 " guestfs_list_devices (guestfs_h *g);\n"
27343 #: ../src/guestfs-actions.pod:3914
27344 msgid "guestfs_list_dm_devices"
27348 #: ../src/guestfs-actions.pod:3916
27352 " guestfs_list_dm_devices (guestfs_h *g);\n"
27357 #: ../src/guestfs-actions.pod:3921
27359 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
27360 "previous call to C<guestfs_luks_open>."
27364 #: ../src/guestfs-actions.pod:3924
27366 "Device mapper devices which correspond to logical volumes are I<not> "
27367 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
27372 #: ../src/guestfs-actions.pod:3932 ../src/guestfs-actions.pod:5378
27373 msgid "(Added in 1.11.15)"
27377 #: ../src/guestfs-actions.pod:3934
27378 msgid "guestfs_list_filesystems"
27382 #: ../src/guestfs-actions.pod:3936
27386 " guestfs_list_filesystems (guestfs_h *g);\n"
27391 #: ../src/guestfs-actions.pod:3956
27393 "This command runs other libguestfs commands, which might include "
27394 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
27395 "soon after launch and only when nothing is mounted."
27399 #: ../src/guestfs-actions.pod:3960
27401 "Not all of the filesystems returned will be mountable. In particular, swap "
27402 "partitions are returned in the list. Also this command does not check that "
27403 "each filesystem found is valid and mountable, and some filesystems might be "
27404 "mountable but require special options. Filesystems may not all belong to a "
27405 "single logical operating system (use C<guestfs_inspect_os> to look for "
27410 #: ../src/guestfs-actions.pod:3974 ../src/guestfs-actions.pod:5739
27411 msgid "(Added in 1.5.15)"
27415 #: ../src/guestfs-actions.pod:3976
27416 msgid "guestfs_list_partitions"
27420 #: ../src/guestfs-actions.pod:3978
27424 " guestfs_list_partitions (guestfs_h *g);\n"
27429 #: ../src/guestfs-actions.pod:3985
27431 "This does not return logical volumes. For that you will need to call "
27436 #: ../src/guestfs-actions.pod:3996
27441 #: ../src/guestfs-actions.pod:3998
27445 " guestfs_ll (guestfs_h *g,\n"
27446 " const char *directory);\n"
27451 #: ../src/guestfs-actions.pod:4013
27456 #: ../src/guestfs-actions.pod:4015
27460 " guestfs_ln (guestfs_h *g,\n"
27461 " const char *target,\n"
27462 " const char *linkname);\n"
27467 #: ../src/guestfs-actions.pod:4026
27468 msgid "guestfs_ln_f"
27472 #: ../src/guestfs-actions.pod:4028
27476 " guestfs_ln_f (guestfs_h *g,\n"
27477 " const char *target,\n"
27478 " const char *linkname);\n"
27483 #: ../src/guestfs-actions.pod:4040
27484 msgid "guestfs_ln_s"
27488 #: ../src/guestfs-actions.pod:4042
27492 " guestfs_ln_s (guestfs_h *g,\n"
27493 " const char *target,\n"
27494 " const char *linkname);\n"
27499 #: ../src/guestfs-actions.pod:4053
27500 msgid "guestfs_ln_sf"
27504 #: ../src/guestfs-actions.pod:4055
27508 " guestfs_ln_sf (guestfs_h *g,\n"
27509 " const char *target,\n"
27510 " const char *linkname);\n"
27515 #: ../src/guestfs-actions.pod:4067
27516 msgid "guestfs_lremovexattr"
27520 #: ../src/guestfs-actions.pod:4069
27524 " guestfs_lremovexattr (guestfs_h *g,\n"
27525 " const char *xattr,\n"
27526 " const char *path);\n"
27531 #: ../src/guestfs-actions.pod:4074
27533 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
27534 "link, then it removes an extended attribute of the link itself."
27538 #: ../src/guestfs-actions.pod:4082
27543 #: ../src/guestfs-actions.pod:4084
27547 " guestfs_ls (guestfs_h *g,\n"
27548 " const char *directory);\n"
27553 #: ../src/guestfs-actions.pod:4092
27555 "This command is mostly useful for interactive sessions. Programs should "
27556 "probably use C<guestfs_readdir> instead."
27560 #: ../src/guestfs-actions.pod:4101
27561 msgid "guestfs_lsetxattr"
27565 #: ../src/guestfs-actions.pod:4103
27569 " guestfs_lsetxattr (guestfs_h *g,\n"
27570 " const char *xattr,\n"
27571 " const char *val,\n"
27573 " const char *path);\n"
27578 #: ../src/guestfs-actions.pod:4110
27580 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
27581 "then it sets an extended attribute of the link itself."
27585 #: ../src/guestfs-actions.pod:4118
27586 msgid "guestfs_lstat"
27590 #: ../src/guestfs-actions.pod:4120
27593 " struct guestfs_stat *\n"
27594 " guestfs_lstat (guestfs_h *g,\n"
27595 " const char *path);\n"
27600 #: ../src/guestfs-actions.pod:4126
27602 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
27603 "link, then the link is stat-ed, not the file it refers to."
27607 #: ../src/guestfs-actions.pod:4132 ../src/guestfs-actions.pod:6913
27609 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
27610 "error. I<The caller must call C<guestfs_free_stat> after use>."
27614 #: ../src/guestfs-actions.pod:4136 ../src/guestfs-actions.pod:6917 ../src/guestfs-actions.pod:6935 ../src/guestfs-actions.pod:7316
27615 msgid "(Added in 0.9.2)"
27619 #: ../src/guestfs-actions.pod:4138
27620 msgid "guestfs_lstatlist"
27624 #: ../src/guestfs-actions.pod:4140
27627 " struct guestfs_stat_list *\n"
27628 " guestfs_lstatlist (guestfs_h *g,\n"
27629 " const char *path,\n"
27630 " char *const *names);\n"
27635 #: ../src/guestfs-actions.pod:4145
27637 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
27638 "files, where all files are in the directory C<path>. C<names> is the list "
27639 "of files from this directory."
27643 #: ../src/guestfs-actions.pod:4154
27645 "This call is intended for programs that want to efficiently list a directory "
27646 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
27647 "for a similarly efficient call for getting extended attributes. Very long "
27648 "directory listings might cause the protocol message size to be exceeded, "
27649 "causing this call to fail. The caller must split up such requests into "
27650 "smaller groups of names."
27654 #: ../src/guestfs-actions.pod:4162
27656 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
27657 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
27661 #: ../src/guestfs-actions.pod:4168
27662 msgid "guestfs_luks_add_key"
27666 #: ../src/guestfs-actions.pod:4170
27670 " guestfs_luks_add_key (guestfs_h *g,\n"
27671 " const char *device,\n"
27672 " const char *key,\n"
27673 " const char *newkey,\n"
27679 #: ../src/guestfs-actions.pod:4182
27681 "Note that if C<keyslot> already contains a key, then this command will "
27682 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
27686 #: ../src/guestfs-actions.pod:4188 ../src/guestfs-actions.pod:4228 ../src/guestfs-actions.pod:4251 ../src/guestfs-actions.pod:4271 ../src/guestfs-actions.pod:4306 ../src/guestfs-actions.pod:4325
27688 "This function takes a key or passphrase parameter which could contain "
27689 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
27694 #: ../src/guestfs-actions.pod:4192 ../src/guestfs-actions.pod:4232 ../src/guestfs-actions.pod:4255 ../src/guestfs-actions.pod:4275
27695 msgid "(Added in 1.5.2)"
27699 #: ../src/guestfs-actions.pod:4194
27700 msgid "guestfs_luks_close"
27704 #: ../src/guestfs-actions.pod:4196
27708 " guestfs_luks_close (guestfs_h *g,\n"
27709 " const char *device);\n"
27714 #: ../src/guestfs-actions.pod:4200
27716 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
27717 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
27718 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
27719 "underlying block device."
27723 #: ../src/guestfs-actions.pod:4208 ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4329 ../src/guestfs-actions.pod:4379 ../src/guestfs-actions.pod:4427
27724 msgid "(Added in 1.5.1)"
27728 #: ../src/guestfs-actions.pod:4210
27729 msgid "guestfs_luks_format"
27733 #: ../src/guestfs-actions.pod:4212
27737 " guestfs_luks_format (guestfs_h *g,\n"
27738 " const char *device,\n"
27739 " const char *key,\n"
27745 #: ../src/guestfs-actions.pod:4234
27746 msgid "guestfs_luks_format_cipher"
27750 #: ../src/guestfs-actions.pod:4236
27754 " guestfs_luks_format_cipher (guestfs_h *g,\n"
27755 " const char *device,\n"
27756 " const char *key,\n"
27758 " const char *cipher);\n"
27763 #: ../src/guestfs-actions.pod:4243
27765 "This command is the same as C<guestfs_luks_format> but it also allows you to "
27766 "set the C<cipher> used."
27770 #: ../src/guestfs-actions.pod:4257
27771 msgid "guestfs_luks_kill_slot"
27775 #: ../src/guestfs-actions.pod:4259
27779 " guestfs_luks_kill_slot (guestfs_h *g,\n"
27780 " const char *device,\n"
27781 " const char *key,\n"
27787 #: ../src/guestfs-actions.pod:4277
27788 msgid "guestfs_luks_open"
27792 #: ../src/guestfs-actions.pod:4279
27796 " guestfs_luks_open (guestfs_h *g,\n"
27797 " const char *device,\n"
27798 " const char *key,\n"
27799 " const char *mapname);\n"
27804 #: ../src/guestfs-actions.pod:4297
27806 "If this block device contains LVM volume groups, then calling "
27807 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
27812 #: ../src/guestfs-actions.pod:4301
27813 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
27817 #: ../src/guestfs-actions.pod:4312
27818 msgid "guestfs_luks_open_ro"
27822 #: ../src/guestfs-actions.pod:4314
27826 " guestfs_luks_open_ro (guestfs_h *g,\n"
27827 " const char *device,\n"
27828 " const char *key,\n"
27829 " const char *mapname);\n"
27834 #: ../src/guestfs-actions.pod:4320
27836 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
27841 #: ../src/guestfs-actions.pod:4331
27842 msgid "guestfs_lvcreate"
27846 #: ../src/guestfs-actions.pod:4333
27850 " guestfs_lvcreate (guestfs_h *g,\n"
27851 " const char *logvol,\n"
27852 " const char *volgroup,\n"
27858 #: ../src/guestfs-actions.pod:4346
27859 msgid "guestfs_lvm_canonical_lv_name"
27863 #: ../src/guestfs-actions.pod:4348
27867 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
27868 " const char *lvname);\n"
27873 #: ../src/guestfs-actions.pod:4359
27874 msgid "See also C<guestfs_is_lv>."
27878 #: ../src/guestfs-actions.pod:4364
27879 msgid "(Added in 1.5.24)"
27883 #: ../src/guestfs-actions.pod:4366
27884 msgid "guestfs_lvm_clear_filter"
27888 #: ../src/guestfs-actions.pod:4368
27892 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
27897 #: ../src/guestfs-actions.pod:4371
27899 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
27900 "see every block device."
27904 #: ../src/guestfs-actions.pod:4381
27905 msgid "guestfs_lvm_remove_all"
27909 #: ../src/guestfs-actions.pod:4383
27913 " guestfs_lvm_remove_all (guestfs_h *g);\n"
27918 #: ../src/guestfs-actions.pod:4396
27919 msgid "guestfs_lvm_set_filter"
27923 #: ../src/guestfs-actions.pod:4398
27927 " guestfs_lvm_set_filter (guestfs_h *g,\n"
27928 " char *const *devices);\n"
27933 #: ../src/guestfs-actions.pod:4429
27934 msgid "guestfs_lvremove"
27938 #: ../src/guestfs-actions.pod:4431
27942 " guestfs_lvremove (guestfs_h *g,\n"
27943 " const char *device);\n"
27948 #: ../src/guestfs-actions.pod:4443 ../src/guestfs-actions.pod:5836 ../src/guestfs-actions.pod:7686
27949 msgid "(Added in 1.0.13)"
27953 #: ../src/guestfs-actions.pod:4445
27954 msgid "guestfs_lvrename"
27958 #: ../src/guestfs-actions.pod:4447
27962 " guestfs_lvrename (guestfs_h *g,\n"
27963 " const char *logvol,\n"
27964 " const char *newlogvol);\n"
27969 #: ../src/guestfs-actions.pod:4456 ../src/guestfs-actions.pod:7699
27970 msgid "(Added in 1.0.83)"
27974 #: ../src/guestfs-actions.pod:4458
27975 msgid "guestfs_lvresize"
27979 #: ../src/guestfs-actions.pod:4460
27983 " guestfs_lvresize (guestfs_h *g,\n"
27984 " const char *device,\n"
27990 #: ../src/guestfs-actions.pod:4473
27991 msgid "guestfs_lvresize_free"
27995 #: ../src/guestfs-actions.pod:4475
27999 " guestfs_lvresize_free (guestfs_h *g,\n"
28000 " const char *lv,\n"
28006 #: ../src/guestfs-actions.pod:4488
28007 msgid "(Added in 1.3.3)"
28011 #: ../src/guestfs-actions.pod:4490
28012 msgid "guestfs_lvs"
28016 #: ../src/guestfs-actions.pod:4492
28020 " guestfs_lvs (guestfs_h *g);\n"
28025 #: ../src/guestfs-actions.pod:4501
28026 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
28030 #: ../src/guestfs-actions.pod:4509
28031 msgid "guestfs_lvs_full"
28035 #: ../src/guestfs-actions.pod:4511
28038 " struct guestfs_lvm_lv_list *\n"
28039 " guestfs_lvs_full (guestfs_h *g);\n"
28044 #: ../src/guestfs-actions.pod:4517
28046 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
28047 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
28052 #: ../src/guestfs-actions.pod:4523
28053 msgid "guestfs_lvuuid"
28057 #: ../src/guestfs-actions.pod:4525
28061 " guestfs_lvuuid (guestfs_h *g,\n"
28062 " const char *device);\n"
28067 #: ../src/guestfs-actions.pod:4536
28068 msgid "guestfs_lxattrlist"
28072 #: ../src/guestfs-actions.pod:4538
28075 " struct guestfs_xattr_list *\n"
28076 " guestfs_lxattrlist (guestfs_h *g,\n"
28077 " const char *path,\n"
28078 " char *const *names);\n"
28083 #: ../src/guestfs-actions.pod:4557
28085 "This call is intended for programs that want to efficiently list a directory "
28086 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
28087 "a similarly efficient call for getting standard stats. Very long directory "
28088 "listings might cause the protocol message size to be exceeded, causing this "
28089 "call to fail. The caller must split up such requests into smaller groups of "
28094 #: ../src/guestfs-actions.pod:4571
28095 msgid "guestfs_mkdir"
28099 #: ../src/guestfs-actions.pod:4573
28103 " guestfs_mkdir (guestfs_h *g,\n"
28104 " const char *path);\n"
28109 #: ../src/guestfs-actions.pod:4583
28110 msgid "guestfs_mkdir_mode"
28114 #: ../src/guestfs-actions.pod:4585
28118 " guestfs_mkdir_mode (guestfs_h *g,\n"
28119 " const char *path,\n"
28125 #: ../src/guestfs-actions.pod:4597
28126 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
28130 #: ../src/guestfs-actions.pod:4603
28131 msgid "guestfs_mkdir_p"
28135 #: ../src/guestfs-actions.pod:4605
28139 " guestfs_mkdir_p (guestfs_h *g,\n"
28140 " const char *path);\n"
28145 #: ../src/guestfs-actions.pod:4616
28146 msgid "guestfs_mkdtemp"
28150 #: ../src/guestfs-actions.pod:4618
28154 " guestfs_mkdtemp (guestfs_h *g,\n"
28155 " const char *template);\n"
28160 #: ../src/guestfs-actions.pod:4646
28161 msgid "guestfs_mke2fs_J"
28165 #: ../src/guestfs-actions.pod:4648
28169 " guestfs_mke2fs_J (guestfs_h *g,\n"
28170 " const char *fstype,\n"
28171 " int blocksize,\n"
28172 " const char *device,\n"
28173 " const char *journal);\n"
28178 #: ../src/guestfs-actions.pod:4661
28179 msgid "See also C<guestfs_mke2journal>."
28183 #: ../src/guestfs-actions.pod:4665 ../src/guestfs-actions.pod:4683 ../src/guestfs-actions.pod:4701 ../src/guestfs-actions.pod:4717 ../src/guestfs-actions.pod:4731 ../src/guestfs-actions.pod:4745 ../src/guestfs-actions.pod:4804 ../src/guestfs-actions.pod:5081
28184 msgid "(Added in 1.0.68)"
28188 #: ../src/guestfs-actions.pod:4667
28189 msgid "guestfs_mke2fs_JL"
28193 #: ../src/guestfs-actions.pod:4669
28197 " guestfs_mke2fs_JL (guestfs_h *g,\n"
28198 " const char *fstype,\n"
28199 " int blocksize,\n"
28200 " const char *device,\n"
28201 " const char *label);\n"
28206 #: ../src/guestfs-actions.pod:4679
28207 msgid "See also C<guestfs_mke2journal_L>."
28211 #: ../src/guestfs-actions.pod:4685
28212 msgid "guestfs_mke2fs_JU"
28216 #: ../src/guestfs-actions.pod:4687
28220 " guestfs_mke2fs_JU (guestfs_h *g,\n"
28221 " const char *fstype,\n"
28222 " int blocksize,\n"
28223 " const char *device,\n"
28224 " const char *uuid);\n"
28229 #: ../src/guestfs-actions.pod:4697
28230 msgid "See also C<guestfs_mke2journal_U>."
28234 #: ../src/guestfs-actions.pod:4703
28235 msgid "guestfs_mke2journal"
28239 #: ../src/guestfs-actions.pod:4705
28243 " guestfs_mke2journal (guestfs_h *g,\n"
28244 " int blocksize,\n"
28245 " const char *device);\n"
28250 #: ../src/guestfs-actions.pod:4719
28251 msgid "guestfs_mke2journal_L"
28255 #: ../src/guestfs-actions.pod:4721
28259 " guestfs_mke2journal_L (guestfs_h *g,\n"
28260 " int blocksize,\n"
28261 " const char *label,\n"
28262 " const char *device);\n"
28267 #: ../src/guestfs-actions.pod:4733
28268 msgid "guestfs_mke2journal_U"
28272 #: ../src/guestfs-actions.pod:4735
28276 " guestfs_mke2journal_U (guestfs_h *g,\n"
28277 " int blocksize,\n"
28278 " const char *uuid,\n"
28279 " const char *device);\n"
28284 #: ../src/guestfs-actions.pod:4747
28285 msgid "guestfs_mkfifo"
28289 #: ../src/guestfs-actions.pod:4749
28293 " guestfs_mkfifo (guestfs_h *g,\n"
28295 " const char *path);\n"
28300 #: ../src/guestfs-actions.pod:4754
28302 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
28303 "is just a convenient wrapper around C<guestfs_mknod>."
28307 #: ../src/guestfs-actions.pod:4764
28308 msgid "guestfs_mkfs"
28312 #: ../src/guestfs-actions.pod:4766
28316 " guestfs_mkfs (guestfs_h *g,\n"
28317 " const char *fstype,\n"
28318 " const char *device);\n"
28323 #: ../src/guestfs-actions.pod:4779
28324 msgid "guestfs_mkfs_b"
28328 #: ../src/guestfs-actions.pod:4781
28332 " guestfs_mkfs_b (guestfs_h *g,\n"
28333 " const char *fstype,\n"
28334 " int blocksize,\n"
28335 " const char *device);\n"
28340 #: ../src/guestfs-actions.pod:4787
28342 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
28347 #: ../src/guestfs-actions.pod:4794
28349 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
28350 "block size of the resulting filesystem. Supported block sizes depend on the "
28351 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
28355 #: ../src/guestfs-actions.pod:4806
28356 msgid "guestfs_mkfs_opts"
28360 #: ../src/guestfs-actions.pod:4808
28364 " guestfs_mkfs_opts (guestfs_h *g,\n"
28365 " const char *fstype,\n"
28366 " const char *device,\n"
28372 #: ../src/guestfs-actions.pod:4819
28375 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
28376 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
28377 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
28378 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
28383 #: ../src/guestfs-actions.pod:4867
28384 msgid "(Added in 1.7.19)"
28388 #: ../src/guestfs-actions.pod:4869
28389 msgid "guestfs_mkfs_opts_va"
28393 #: ../src/guestfs-actions.pod:4871
28397 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
28398 " const char *fstype,\n"
28399 " const char *device,\n"
28400 " va_list args);\n"
28405 #: ../src/guestfs-actions.pod:4877
28406 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
28410 #: ../src/guestfs-actions.pod:4881
28411 msgid "guestfs_mkfs_opts_argv"
28415 #: ../src/guestfs-actions.pod:4883
28419 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
28420 " const char *fstype,\n"
28421 " const char *device,\n"
28422 " const struct guestfs_mkfs_opts_argv *optargs);\n"
28427 #: ../src/guestfs-actions.pod:4889
28428 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
28432 #: ../src/guestfs-actions.pod:4893
28433 msgid "guestfs_mkmountpoint"
28437 #: ../src/guestfs-actions.pod:4895
28441 " guestfs_mkmountpoint (guestfs_h *g,\n"
28442 " const char *exemptpath);\n"
28447 #: ../src/guestfs-actions.pod:4899
28449 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
28450 "that can be used to create extra mountpoints before mounting the first "
28455 #: ../src/guestfs-actions.pod:4923
28457 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
28458 "may get unexpected errors if you try to mix these calls. It is safest to "
28459 "manually unmount filesystems and remove mountpoints after use."
28463 #: ../src/guestfs-actions.pod:4927
28465 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
28466 "first, so for this to work for manual mountpoints, you must ensure that the "
28467 "innermost mountpoints have the longest pathnames, as in the example code "
28472 #: ../src/guestfs-actions.pod:4934
28474 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
28475 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
28476 "can also trigger these issues."
28480 #: ../src/guestfs-actions.pod:4940 ../src/guestfs-actions.pod:5246 ../src/guestfs-actions.pod:6256
28481 msgid "(Added in 1.0.62)"
28485 #: ../src/guestfs-actions.pod:4942
28486 msgid "guestfs_mknod"
28490 #: ../src/guestfs-actions.pod:4944
28494 " guestfs_mknod (guestfs_h *g,\n"
28498 " const char *path);\n"
28503 #: ../src/guestfs-actions.pod:4959
28505 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
28506 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
28507 "regular file). These constants are available in the standard Linux header "
28508 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
28509 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
28510 "the appropriate constant for you."
28514 #: ../src/guestfs-actions.pod:4973
28515 msgid "guestfs_mknod_b"
28519 #: ../src/guestfs-actions.pod:4975
28523 " guestfs_mknod_b (guestfs_h *g,\n"
28527 " const char *path);\n"
28532 #: ../src/guestfs-actions.pod:4982
28534 "This call creates a block device node called C<path> with mode C<mode> and "
28535 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28536 "wrapper around C<guestfs_mknod>."
28540 #: ../src/guestfs-actions.pod:4992
28541 msgid "guestfs_mknod_c"
28545 #: ../src/guestfs-actions.pod:4994
28549 " guestfs_mknod_c (guestfs_h *g,\n"
28553 " const char *path);\n"
28558 #: ../src/guestfs-actions.pod:5001
28560 "This call creates a char device node called C<path> with mode C<mode> and "
28561 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28562 "wrapper around C<guestfs_mknod>."
28566 #: ../src/guestfs-actions.pod:5011
28567 msgid "guestfs_mkswap"
28571 #: ../src/guestfs-actions.pod:5013
28575 " guestfs_mkswap (guestfs_h *g,\n"
28576 " const char *device);\n"
28581 #: ../src/guestfs-actions.pod:5023
28582 msgid "guestfs_mkswap_L"
28586 #: ../src/guestfs-actions.pod:5025
28590 " guestfs_mkswap_L (guestfs_h *g,\n"
28591 " const char *label,\n"
28592 " const char *device);\n"
28597 #: ../src/guestfs-actions.pod:5040
28598 msgid "guestfs_mkswap_U"
28602 #: ../src/guestfs-actions.pod:5042
28606 " guestfs_mkswap_U (guestfs_h *g,\n"
28607 " const char *uuid,\n"
28608 " const char *device);\n"
28613 #: ../src/guestfs-actions.pod:5053
28614 msgid "guestfs_mkswap_file"
28618 #: ../src/guestfs-actions.pod:5055
28622 " guestfs_mkswap_file (guestfs_h *g,\n"
28623 " const char *path);\n"
28628 #: ../src/guestfs-actions.pod:5061
28630 "This command just writes a swap file signature to an existing file. To "
28631 "create the file itself, use something like C<guestfs_fallocate>."
28635 #: ../src/guestfs-actions.pod:5068
28636 msgid "guestfs_modprobe"
28640 #: ../src/guestfs-actions.pod:5070
28644 " guestfs_modprobe (guestfs_h *g,\n"
28645 " const char *modulename);\n"
28650 #: ../src/guestfs-actions.pod:5083
28651 msgid "guestfs_mount"
28655 #: ../src/guestfs-actions.pod:5085
28659 " guestfs_mount (guestfs_h *g,\n"
28660 " const char *device,\n"
28661 " const char *mountpoint);\n"
28666 #: ../src/guestfs-actions.pod:5104
28668 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
28669 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
28670 "problems for users. If your program might need to work with older versions "
28671 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
28672 "for the first parameter if you don't want any options)."
28676 #: ../src/guestfs-actions.pod:5115
28677 msgid "guestfs_mount_9p"
28681 #: ../src/guestfs-actions.pod:5117
28685 " guestfs_mount_9p (guestfs_h *g,\n"
28686 " const char *mounttag,\n"
28687 " const char *mountpoint,\n"
28693 #: ../src/guestfs-actions.pod:5128
28696 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
28701 #: ../src/guestfs-actions.pod:5141
28702 msgid "guestfs_mount_9p_va"
28706 #: ../src/guestfs-actions.pod:5143
28710 " guestfs_mount_9p_va (guestfs_h *g,\n"
28711 " const char *mounttag,\n"
28712 " const char *mountpoint,\n"
28713 " va_list args);\n"
28718 #: ../src/guestfs-actions.pod:5149
28719 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
28723 #: ../src/guestfs-actions.pod:5153
28724 msgid "guestfs_mount_9p_argv"
28728 #: ../src/guestfs-actions.pod:5155
28732 " guestfs_mount_9p_argv (guestfs_h *g,\n"
28733 " const char *mounttag,\n"
28734 " const char *mountpoint,\n"
28735 " const struct guestfs_mount_9p_argv *optargs);\n"
28740 #: ../src/guestfs-actions.pod:5161
28741 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
28745 #: ../src/guestfs-actions.pod:5165
28746 msgid "guestfs_mount_loop"
28750 #: ../src/guestfs-actions.pod:5167
28754 " guestfs_mount_loop (guestfs_h *g,\n"
28755 " const char *file,\n"
28756 " const char *mountpoint);\n"
28761 #: ../src/guestfs-actions.pod:5180
28762 msgid "guestfs_mount_options"
28766 #: ../src/guestfs-actions.pod:5182
28770 " guestfs_mount_options (guestfs_h *g,\n"
28771 " const char *options,\n"
28772 " const char *device,\n"
28773 " const char *mountpoint);\n"
28778 #: ../src/guestfs-actions.pod:5188
28780 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28781 "the mount options as for the L<mount(8)> I<-o> flag."
28785 #: ../src/guestfs-actions.pod:5198 ../src/guestfs-actions.pod:5212 ../src/guestfs-actions.pod:5229
28786 msgid "(Added in 1.0.10)"
28790 #: ../src/guestfs-actions.pod:5200
28791 msgid "guestfs_mount_ro"
28795 #: ../src/guestfs-actions.pod:5202
28799 " guestfs_mount_ro (guestfs_h *g,\n"
28800 " const char *device,\n"
28801 " const char *mountpoint);\n"
28806 #: ../src/guestfs-actions.pod:5207
28808 "This is the same as the C<guestfs_mount> command, but it mounts the "
28809 "filesystem with the read-only (I<-o ro>) flag."
28813 #: ../src/guestfs-actions.pod:5214
28814 msgid "guestfs_mount_vfs"
28818 #: ../src/guestfs-actions.pod:5216
28822 " guestfs_mount_vfs (guestfs_h *g,\n"
28823 " const char *options,\n"
28824 " const char *vfstype,\n"
28825 " const char *device,\n"
28826 " const char *mountpoint);\n"
28831 #: ../src/guestfs-actions.pod:5223
28833 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28834 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
28839 #: ../src/guestfs-actions.pod:5231
28840 msgid "guestfs_mountpoints"
28844 #: ../src/guestfs-actions.pod:5233
28848 " guestfs_mountpoints (guestfs_h *g);\n"
28853 #: ../src/guestfs-actions.pod:5236
28855 "This call is similar to C<guestfs_mounts>. That call returns a list of "
28856 "devices. This one returns a hash table (map) of device name to directory "
28857 "where the device is mounted."
28861 #: ../src/guestfs-actions.pod:5248
28862 msgid "guestfs_mounts"
28866 #: ../src/guestfs-actions.pod:5250
28870 " guestfs_mounts (guestfs_h *g);\n"
28875 #: ../src/guestfs-actions.pod:5258
28876 msgid "See also: C<guestfs_mountpoints>"
28880 #: ../src/guestfs-actions.pod:5266
28885 #: ../src/guestfs-actions.pod:5268
28889 " guestfs_mv (guestfs_h *g,\n"
28890 " const char *src,\n"
28891 " const char *dest);\n"
28896 #: ../src/guestfs-actions.pod:5280
28897 msgid "guestfs_ntfs_3g_probe"
28901 #: ../src/guestfs-actions.pod:5282
28905 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
28907 " const char *device);\n"
28912 #: ../src/guestfs-actions.pod:5301
28913 msgid "(Added in 1.0.43)"
28917 #: ../src/guestfs-actions.pod:5303
28918 msgid "guestfs_ntfsresize"
28922 #: ../src/guestfs-actions.pod:5305
28926 " guestfs_ntfsresize (guestfs_h *g,\n"
28927 " const char *device);\n"
28932 #: ../src/guestfs-actions.pod:5309 ../src/guestfs-actions.pod:5409
28934 "I<This function is deprecated.> In new code, use the "
28935 "L</guestfs_ntfsresize_opts> call instead."
28939 #: ../src/guestfs-actions.pod:5333
28940 msgid "guestfs_ntfsresize_opts"
28944 #: ../src/guestfs-actions.pod:5335
28948 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
28949 " const char *device,\n"
28955 #: ../src/guestfs-actions.pod:5345
28958 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
28959 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
28964 #: ../src/guestfs-actions.pod:5365
28966 "After the resize operation, the filesystem is always marked as requiring a "
28967 "consistency check (for safety). You have to boot into Windows to perform "
28968 "this check and clear this condition. If you I<don't> set the C<force> "
28969 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
28970 "times on a single filesystem without booting into Windows between each "
28975 #: ../src/guestfs-actions.pod:5380
28976 msgid "guestfs_ntfsresize_opts_va"
28980 #: ../src/guestfs-actions.pod:5382
28984 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
28985 " const char *device,\n"
28986 " va_list args);\n"
28991 #: ../src/guestfs-actions.pod:5387
28992 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
28996 #: ../src/guestfs-actions.pod:5391
28997 msgid "guestfs_ntfsresize_opts_argv"
29001 #: ../src/guestfs-actions.pod:5393
29005 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
29006 " const char *device,\n"
29007 " const struct guestfs_ntfsresize_opts_argv "
29013 #: ../src/guestfs-actions.pod:5398
29014 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
29018 #: ../src/guestfs-actions.pod:5402
29019 msgid "guestfs_ntfsresize_size"
29023 #: ../src/guestfs-actions.pod:5404
29027 " guestfs_ntfsresize_size (guestfs_h *g,\n"
29028 " const char *device,\n"
29029 " int64_t size);\n"
29034 #: ../src/guestfs-actions.pod:5416
29036 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
29037 "to specify the new size (in bytes) explicitly."
29041 #: ../src/guestfs-actions.pod:5421 ../src/guestfs-actions.pod:5863 ../src/guestfs-actions.pod:5936 ../src/guestfs-actions.pod:6204 ../src/guestfs-actions.pod:7843
29042 msgid "(Added in 1.3.14)"
29046 #: ../src/guestfs-actions.pod:5423
29047 msgid "guestfs_part_add"
29051 #: ../src/guestfs-actions.pod:5425
29055 " guestfs_part_add (guestfs_h *g,\n"
29056 " const char *device,\n"
29057 " const char *prlogex,\n"
29058 " int64_t startsect,\n"
29059 " int64_t endsect);\n"
29064 #: ../src/guestfs-actions.pod:5432
29066 "This command adds a partition to C<device>. If there is no partition table "
29067 "on the device, call C<guestfs_part_init> first."
29071 #: ../src/guestfs-actions.pod:5444
29073 "Creating a partition which covers the whole disk is not so easy. Use "
29074 "C<guestfs_part_disk> to do that."
29078 #: ../src/guestfs-actions.pod:5449 ../src/guestfs-actions.pod:5487 ../src/guestfs-actions.pod:5540 ../src/guestfs-actions.pod:5624 ../src/guestfs-actions.pod:5662 ../src/guestfs-actions.pod:5681 ../src/guestfs-actions.pod:5721
29079 msgid "(Added in 1.0.78)"
29083 #: ../src/guestfs-actions.pod:5451
29084 msgid "guestfs_part_del"
29088 #: ../src/guestfs-actions.pod:5453
29092 " guestfs_part_del (guestfs_h *g,\n"
29093 " const char *device,\n"
29099 #: ../src/guestfs-actions.pod:5468
29100 msgid "guestfs_part_disk"
29104 #: ../src/guestfs-actions.pod:5470
29108 " guestfs_part_disk (guestfs_h *g,\n"
29109 " const char *device,\n"
29110 " const char *parttype);\n"
29115 #: ../src/guestfs-actions.pod:5475
29117 "This command is simply a combination of C<guestfs_part_init> followed by "
29118 "C<guestfs_part_add> to create a single primary partition covering the whole "
29123 #: ../src/guestfs-actions.pod:5479
29125 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
29126 "possible values are described in C<guestfs_part_init>."
29130 #: ../src/guestfs-actions.pod:5489
29131 msgid "guestfs_part_get_bootable"
29135 #: ../src/guestfs-actions.pod:5491
29139 " guestfs_part_get_bootable (guestfs_h *g,\n"
29140 " const char *device,\n"
29146 #: ../src/guestfs-actions.pod:5499
29147 msgid "See also C<guestfs_part_set_bootable>."
29151 #: ../src/guestfs-actions.pod:5505
29152 msgid "guestfs_part_get_mbr_id"
29156 #: ../src/guestfs-actions.pod:5507
29160 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
29161 " const char *device,\n"
29167 #: ../src/guestfs-actions.pod:5515 ../src/guestfs-actions.pod:5697
29169 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
29170 "undefined results for other partition table types (see "
29171 "C<guestfs_part_get_parttype>)."
29175 #: ../src/guestfs-actions.pod:5523
29176 msgid "guestfs_part_get_parttype"
29180 #: ../src/guestfs-actions.pod:5525
29184 " guestfs_part_get_parttype (guestfs_h *g,\n"
29185 " const char *device);\n"
29190 #: ../src/guestfs-actions.pod:5532
29192 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
29193 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
29194 "possible, although unusual. See C<guestfs_part_init> for a full list."
29198 #: ../src/guestfs-actions.pod:5542
29199 msgid "guestfs_part_init"
29203 #: ../src/guestfs-actions.pod:5544
29207 " guestfs_part_init (guestfs_h *g,\n"
29208 " const char *device,\n"
29209 " const char *parttype);\n"
29214 #: ../src/guestfs-actions.pod:5553
29216 "Initially there are no partitions. Following this, you should call "
29217 "C<guestfs_part_add> for each partition required."
29221 #: ../src/guestfs-actions.pod:5626
29222 msgid "guestfs_part_list"
29226 #: ../src/guestfs-actions.pod:5628
29229 " struct guestfs_partition_list *\n"
29230 " guestfs_part_list (guestfs_h *g,\n"
29231 " const char *device);\n"
29236 #: ../src/guestfs-actions.pod:5645
29238 "Start of the partition I<in bytes>. To get sectors you have to divide by "
29239 "the device's sector size, see C<guestfs_blockdev_getss>."
29243 #: ../src/guestfs-actions.pod:5658
29245 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
29246 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
29251 #: ../src/guestfs-actions.pod:5664
29252 msgid "guestfs_part_set_bootable"
29256 #: ../src/guestfs-actions.pod:5666
29260 " guestfs_part_set_bootable (guestfs_h *g,\n"
29261 " const char *device,\n"
29263 " int bootable);\n"
29268 #: ../src/guestfs-actions.pod:5683
29269 msgid "guestfs_part_set_mbr_id"
29273 #: ../src/guestfs-actions.pod:5685
29277 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
29278 " const char *device,\n"
29285 #: ../src/guestfs-actions.pod:5705
29286 msgid "guestfs_part_set_name"
29290 #: ../src/guestfs-actions.pod:5707
29294 " guestfs_part_set_name (guestfs_h *g,\n"
29295 " const char *device,\n"
29297 " const char *name);\n"
29302 #: ../src/guestfs-actions.pod:5723
29303 msgid "guestfs_part_to_dev"
29307 #: ../src/guestfs-actions.pod:5725
29311 " guestfs_part_to_dev (guestfs_h *g,\n"
29312 " const char *partition);\n"
29317 #: ../src/guestfs-actions.pod:5733
29319 "The named partition must exist, for example as a string returned from "
29320 "C<guestfs_list_partitions>."
29324 #: ../src/guestfs-actions.pod:5741
29325 msgid "guestfs_ping_daemon"
29329 #: ../src/guestfs-actions.pod:5743
29333 " guestfs_ping_daemon (guestfs_h *g);\n"
29338 #: ../src/guestfs-actions.pod:5755
29339 msgid "guestfs_pread"
29343 #: ../src/guestfs-actions.pod:5757
29347 " guestfs_pread (guestfs_h *g,\n"
29348 " const char *path,\n"
29350 " int64_t offset,\n"
29351 " size_t *size_r);\n"
29356 #: ../src/guestfs-actions.pod:5770
29357 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
29361 #: ../src/guestfs-actions.pod:5781
29362 msgid "guestfs_pread_device"
29366 #: ../src/guestfs-actions.pod:5783
29370 " guestfs_pread_device (guestfs_h *g,\n"
29371 " const char *device,\n"
29373 " int64_t offset,\n"
29374 " size_t *size_r);\n"
29379 #: ../src/guestfs-actions.pod:5796
29380 msgid "See also C<guestfs_pread>."
29384 #: ../src/guestfs-actions.pod:5805
29385 msgid "(Added in 1.5.21)"
29389 #: ../src/guestfs-actions.pod:5807
29390 msgid "guestfs_pvcreate"
29394 #: ../src/guestfs-actions.pod:5809
29398 " guestfs_pvcreate (guestfs_h *g,\n"
29399 " const char *device);\n"
29404 #: ../src/guestfs-actions.pod:5821
29405 msgid "guestfs_pvremove"
29409 #: ../src/guestfs-actions.pod:5823
29413 " guestfs_pvremove (guestfs_h *g,\n"
29414 " const char *device);\n"
29419 #: ../src/guestfs-actions.pod:5838
29420 msgid "guestfs_pvresize"
29424 #: ../src/guestfs-actions.pod:5840
29428 " guestfs_pvresize (guestfs_h *g,\n"
29429 " const char *device);\n"
29434 #: ../src/guestfs-actions.pod:5851
29435 msgid "guestfs_pvresize_size"
29439 #: ../src/guestfs-actions.pod:5853
29443 " guestfs_pvresize_size (guestfs_h *g,\n"
29444 " const char *device,\n"
29445 " int64_t size);\n"
29450 #: ../src/guestfs-actions.pod:5858
29452 "This command is the same as C<guestfs_pvresize> except that it allows you to "
29453 "specify the new size (in bytes) explicitly."
29457 #: ../src/guestfs-actions.pod:5865
29458 msgid "guestfs_pvs"
29462 #: ../src/guestfs-actions.pod:5867
29466 " guestfs_pvs (guestfs_h *g);\n"
29471 #: ../src/guestfs-actions.pod:5876
29472 msgid "See also C<guestfs_pvs_full>."
29476 #: ../src/guestfs-actions.pod:5884
29477 msgid "guestfs_pvs_full"
29481 #: ../src/guestfs-actions.pod:5886
29484 " struct guestfs_lvm_pv_list *\n"
29485 " guestfs_pvs_full (guestfs_h *g);\n"
29490 #: ../src/guestfs-actions.pod:5892
29492 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
29493 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
29498 #: ../src/guestfs-actions.pod:5898
29499 msgid "guestfs_pvuuid"
29503 #: ../src/guestfs-actions.pod:5900
29507 " guestfs_pvuuid (guestfs_h *g,\n"
29508 " const char *device);\n"
29513 #: ../src/guestfs-actions.pod:5911
29514 msgid "guestfs_pwrite"
29518 #: ../src/guestfs-actions.pod:5913
29522 " guestfs_pwrite (guestfs_h *g,\n"
29523 " const char *path,\n"
29524 " const char *content,\n"
29525 " size_t content_size,\n"
29526 " int64_t offset);\n"
29531 #: ../src/guestfs-actions.pod:5929
29532 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
29536 #: ../src/guestfs-actions.pod:5938
29537 msgid "guestfs_pwrite_device"
29541 #: ../src/guestfs-actions.pod:5940
29545 " guestfs_pwrite_device (guestfs_h *g,\n"
29546 " const char *device,\n"
29547 " const char *content,\n"
29548 " size_t content_size,\n"
29549 " int64_t offset);\n"
29554 #: ../src/guestfs-actions.pod:5955
29555 msgid "See also C<guestfs_pwrite>."
29559 #: ../src/guestfs-actions.pod:5962
29560 msgid "(Added in 1.5.20)"
29564 #: ../src/guestfs-actions.pod:5964
29565 msgid "guestfs_read_file"
29569 #: ../src/guestfs-actions.pod:5966
29573 " guestfs_read_file (guestfs_h *g,\n"
29574 " const char *path,\n"
29575 " size_t *size_r);\n"
29580 #: ../src/guestfs-actions.pod:5974
29582 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
29583 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
29584 "function is limited in the total size of file that can be handled."
29588 #: ../src/guestfs-actions.pod:5986
29589 msgid "(Added in 1.0.63)"
29593 #: ../src/guestfs-actions.pod:5988
29594 msgid "guestfs_read_lines"
29598 #: ../src/guestfs-actions.pod:5990
29602 " guestfs_read_lines (guestfs_h *g,\n"
29603 " const char *path);\n"
29608 #: ../src/guestfs-actions.pod:5999
29610 "Note that this function cannot correctly handle binary files (specifically, "
29611 "files containing C<\\0> character which is treated as end of line). For "
29612 "those you need to use the C<guestfs_read_file> function which has a more "
29613 "complex interface."
29617 #: ../src/guestfs-actions.pod:6010
29618 msgid "guestfs_readdir"
29622 #: ../src/guestfs-actions.pod:6012
29625 " struct guestfs_dirent_list *\n"
29626 " guestfs_readdir (guestfs_h *g,\n"
29627 " const char *dir);\n"
29632 #: ../src/guestfs-actions.pod:6066
29634 "This function is primarily intended for use by programs. To get a simple "
29635 "list of names, use C<guestfs_ls>. To get a printable directory for human "
29636 "consumption, use C<guestfs_ll>."
29640 #: ../src/guestfs-actions.pod:6070
29642 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
29643 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
29648 #: ../src/guestfs-actions.pod:6076
29649 msgid "guestfs_readlink"
29653 #: ../src/guestfs-actions.pod:6078
29657 " guestfs_readlink (guestfs_h *g,\n"
29658 " const char *path);\n"
29663 #: ../src/guestfs-actions.pod:6089
29664 msgid "guestfs_readlinklist"
29668 #: ../src/guestfs-actions.pod:6091
29672 " guestfs_readlinklist (guestfs_h *g,\n"
29673 " const char *path,\n"
29674 " char *const *names);\n"
29679 #: ../src/guestfs-actions.pod:6124
29680 msgid "guestfs_realpath"
29684 #: ../src/guestfs-actions.pod:6126
29688 " guestfs_realpath (guestfs_h *g,\n"
29689 " const char *path);\n"
29694 #: ../src/guestfs-actions.pod:6138
29695 msgid "guestfs_removexattr"
29699 #: ../src/guestfs-actions.pod:6140
29703 " guestfs_removexattr (guestfs_h *g,\n"
29704 " const char *xattr,\n"
29705 " const char *path);\n"
29710 #: ../src/guestfs-actions.pod:6148
29711 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
29715 #: ../src/guestfs-actions.pod:6154
29716 msgid "guestfs_resize2fs"
29720 #: ../src/guestfs-actions.pod:6156
29724 " guestfs_resize2fs (guestfs_h *g,\n"
29725 " const char *device);\n"
29730 #: ../src/guestfs-actions.pod:6163
29732 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
29733 "C<device> before calling this command. For unknown reasons C<resize2fs> "
29734 "sometimes gives an error about this and sometimes not. In any case, it is "
29735 "always safe to call C<guestfs_e2fsck_f> before calling this function."
29739 #: ../src/guestfs-actions.pod:6173
29740 msgid "guestfs_resize2fs_M"
29744 #: ../src/guestfs-actions.pod:6175
29748 " guestfs_resize2fs_M (guestfs_h *g,\n"
29749 " const char *device);\n"
29754 #: ../src/guestfs-actions.pod:6179
29756 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
29757 "resized to its minimum size. This works like the I<-M> option to the "
29758 "C<resize2fs> command."
29762 #: ../src/guestfs-actions.pod:6183
29764 "To get the resulting size of the filesystem you should call "
29765 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
29766 "These two numbers, multiplied together, give the resulting size of the "
29767 "minimal filesystem in bytes."
29771 #: ../src/guestfs-actions.pod:6192
29772 msgid "guestfs_resize2fs_size"
29776 #: ../src/guestfs-actions.pod:6194
29780 " guestfs_resize2fs_size (guestfs_h *g,\n"
29781 " const char *device,\n"
29782 " int64_t size);\n"
29787 #: ../src/guestfs-actions.pod:6199
29789 "This command is the same as C<guestfs_resize2fs> except that it allows you "
29790 "to specify the new size (in bytes) explicitly."
29794 #: ../src/guestfs-actions.pod:6206
29799 #: ../src/guestfs-actions.pod:6208
29803 " guestfs_rm (guestfs_h *g,\n"
29804 " const char *path);\n"
29809 #: ../src/guestfs-actions.pod:6218
29810 msgid "guestfs_rm_rf"
29814 #: ../src/guestfs-actions.pod:6220
29818 " guestfs_rm_rf (guestfs_h *g,\n"
29819 " const char *path);\n"
29824 #: ../src/guestfs-actions.pod:6232
29825 msgid "guestfs_rmdir"
29829 #: ../src/guestfs-actions.pod:6234
29833 " guestfs_rmdir (guestfs_h *g,\n"
29834 " const char *path);\n"
29839 #: ../src/guestfs-actions.pod:6244
29840 msgid "guestfs_rmmountpoint"
29844 #: ../src/guestfs-actions.pod:6246
29848 " guestfs_rmmountpoint (guestfs_h *g,\n"
29849 " const char *exemptpath);\n"
29854 #: ../src/guestfs-actions.pod:6250
29856 "This calls removes a mountpoint that was previously created with "
29857 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
29861 #: ../src/guestfs-actions.pod:6258
29862 msgid "guestfs_scrub_device"
29866 #: ../src/guestfs-actions.pod:6260
29870 " guestfs_scrub_device (guestfs_h *g,\n"
29871 " const char *device);\n"
29876 #: ../src/guestfs-actions.pod:6275 ../src/guestfs-actions.pod:6293 ../src/guestfs-actions.pod:6312
29877 msgid "(Added in 1.0.52)"
29881 #: ../src/guestfs-actions.pod:6277
29882 msgid "guestfs_scrub_file"
29886 #: ../src/guestfs-actions.pod:6279
29890 " guestfs_scrub_file (guestfs_h *g,\n"
29891 " const char *file);\n"
29896 #: ../src/guestfs-actions.pod:6295
29897 msgid "guestfs_scrub_freespace"
29901 #: ../src/guestfs-actions.pod:6297
29905 " guestfs_scrub_freespace (guestfs_h *g,\n"
29906 " const char *dir);\n"
29911 #: ../src/guestfs-actions.pod:6301
29913 "This command creates the directory C<dir> and then fills it with files until "
29914 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
29915 "and deletes them. The intention is to scrub any free space on the partition "
29916 "containing C<dir>."
29920 #: ../src/guestfs-actions.pod:6314
29921 msgid "guestfs_set_append"
29925 #: ../src/guestfs-actions.pod:6316
29929 " guestfs_set_append (guestfs_h *g,\n"
29930 " const char *append);\n"
29935 #: ../src/guestfs-actions.pod:6333
29936 msgid "guestfs_set_attach_method"
29940 #: ../src/guestfs-actions.pod:6335
29944 " guestfs_set_attach_method (guestfs_h *g,\n"
29945 " const char *attachmethod);\n"
29950 #: ../src/guestfs-actions.pod:6363
29951 msgid "guestfs_set_autosync"
29955 #: ../src/guestfs-actions.pod:6365
29959 " guestfs_set_autosync (guestfs_h *g,\n"
29960 " int autosync);\n"
29965 #: ../src/guestfs-actions.pod:6381
29966 msgid "guestfs_set_direct"
29970 #: ../src/guestfs-actions.pod:6383
29974 " guestfs_set_direct (guestfs_h *g,\n"
29980 #: ../src/guestfs-actions.pod:6391
29982 "One consequence of this is that log messages aren't caught by the library "
29983 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
29988 #: ../src/guestfs-actions.pod:6404
29989 msgid "guestfs_set_e2label"
29993 #: ../src/guestfs-actions.pod:6406
29997 " guestfs_set_e2label (guestfs_h *g,\n"
29998 " const char *device,\n"
29999 " const char *label);\n"
30004 #: ../src/guestfs-actions.pod:6415
30006 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
30007 "the existing label on a filesystem."
30011 #: ../src/guestfs-actions.pod:6422
30012 msgid "guestfs_set_e2uuid"
30016 #: ../src/guestfs-actions.pod:6424
30020 " guestfs_set_e2uuid (guestfs_h *g,\n"
30021 " const char *device,\n"
30022 " const char *uuid);\n"
30027 #: ../src/guestfs-actions.pod:6434
30029 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
30030 "the existing UUID of a filesystem."
30034 #: ../src/guestfs-actions.pod:6441
30035 msgid "guestfs_set_memsize"
30039 #: ../src/guestfs-actions.pod:6443
30043 " guestfs_set_memsize (guestfs_h *g,\n"
30049 #: ../src/guestfs-actions.pod:6447
30051 "This sets the memory size in megabytes allocated to the qemu subprocess. "
30052 "This only has any effect if called before C<guestfs_launch>."
30056 #: ../src/guestfs-actions.pod:6462
30057 msgid "guestfs_set_network"
30061 #: ../src/guestfs-actions.pod:6464
30065 " guestfs_set_network (guestfs_h *g,\n"
30071 #: ../src/guestfs-actions.pod:6474
30073 "You must call this before calling C<guestfs_launch>, otherwise it has no "
30078 #: ../src/guestfs-actions.pod:6481
30079 msgid "guestfs_set_path"
30083 #: ../src/guestfs-actions.pod:6483
30087 " guestfs_set_path (guestfs_h *g,\n"
30088 " const char *searchpath);\n"
30093 #: ../src/guestfs-actions.pod:6498
30094 msgid "guestfs_set_pgroup"
30098 #: ../src/guestfs-actions.pod:6500
30102 " guestfs_set_pgroup (guestfs_h *g,\n"
30108 #: ../src/guestfs-actions.pod:6517
30109 msgid "guestfs_set_qemu"
30113 #: ../src/guestfs-actions.pod:6519
30117 " guestfs_set_qemu (guestfs_h *g,\n"
30118 " const char *qemu);\n"
30123 #: ../src/guestfs-actions.pod:6545
30124 msgid "guestfs_set_recovery_proc"
30128 #: ../src/guestfs-actions.pod:6547
30132 " guestfs_set_recovery_proc (guestfs_h *g,\n"
30133 " int recoveryproc);\n"
30138 #: ../src/guestfs-actions.pod:6551
30140 "If this is called with the parameter C<false> then C<guestfs_launch> does "
30141 "not create a recovery process. The purpose of the recovery process is to "
30142 "stop runaway qemu processes in the case where the main program aborts "
30147 #: ../src/guestfs-actions.pod:6556
30149 "This only has any effect if called before C<guestfs_launch>, and the default "
30154 #: ../src/guestfs-actions.pod:6569
30155 msgid "guestfs_set_selinux"
30159 #: ../src/guestfs-actions.pod:6571
30163 " guestfs_set_selinux (guestfs_h *g,\n"
30169 #: ../src/guestfs-actions.pod:6588
30170 msgid "guestfs_set_smp"
30174 #: ../src/guestfs-actions.pod:6590
30178 " guestfs_set_smp (guestfs_h *g,\n"
30184 #: ../src/guestfs-actions.pod:6598
30185 msgid "This function must be called before C<guestfs_launch>."
30189 #: ../src/guestfs-actions.pod:6604
30190 msgid "guestfs_set_trace"
30194 #: ../src/guestfs-actions.pod:6606
30198 " guestfs_set_trace (guestfs_h *g,\n"
30204 #: ../src/guestfs-actions.pod:6620
30206 "Trace messages are normally sent to C<stderr>, unless you register a "
30207 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30211 #: ../src/guestfs-actions.pod:6628
30212 msgid "guestfs_set_verbose"
30216 #: ../src/guestfs-actions.pod:6630
30220 " guestfs_set_verbose (guestfs_h *g,\n"
30226 #: ../src/guestfs-actions.pod:6639
30228 "Verbose messages are normally sent to C<stderr>, unless you register a "
30229 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30233 #: ../src/guestfs-actions.pod:6647
30234 msgid "guestfs_setcon"
30238 #: ../src/guestfs-actions.pod:6649
30242 " guestfs_setcon (guestfs_h *g,\n"
30243 " const char *context);\n"
30248 #: ../src/guestfs-actions.pod:6662
30249 msgid "guestfs_setxattr"
30253 #: ../src/guestfs-actions.pod:6664
30257 " guestfs_setxattr (guestfs_h *g,\n"
30258 " const char *xattr,\n"
30259 " const char *val,\n"
30261 " const char *path);\n"
30266 #: ../src/guestfs-actions.pod:6675
30267 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
30271 #: ../src/guestfs-actions.pod:6681
30272 msgid "guestfs_sfdisk"
30276 #: ../src/guestfs-actions.pod:6683
30280 " guestfs_sfdisk (guestfs_h *g,\n"
30281 " const char *device,\n"
30285 " char *const *lines);\n"
30290 #: ../src/guestfs-actions.pod:6691 ../src/guestfs-actions.pod:6735 ../src/guestfs-actions.pod:6769
30292 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
30297 #: ../src/guestfs-actions.pod:6718
30298 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
30302 #: ../src/guestfs-actions.pod:6728
30303 msgid "guestfs_sfdiskM"
30307 #: ../src/guestfs-actions.pod:6730
30311 " guestfs_sfdiskM (guestfs_h *g,\n"
30312 " const char *device,\n"
30313 " char *const *lines);\n"
30318 #: ../src/guestfs-actions.pod:6742
30320 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
30321 "partition sizes are specified in megabytes only (rounded to the nearest "
30322 "cylinder) and you don't need to specify the cyls, heads and sectors "
30323 "parameters which were rarely if ever used anyway."
30327 #: ../src/guestfs-actions.pod:6748
30329 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
30330 "C<guestfs_part_disk>"
30334 #: ../src/guestfs-actions.pod:6758
30335 msgid "guestfs_sfdisk_N"
30339 #: ../src/guestfs-actions.pod:6760
30343 " guestfs_sfdisk_N (guestfs_h *g,\n"
30344 " const char *device,\n"
30349 " const char *line);\n"
30354 #: ../src/guestfs-actions.pod:6779
30356 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
30357 "for the cyls/heads/sectors parameters."
30361 #: ../src/guestfs-actions.pod:6782
30362 msgid "See also: C<guestfs_part_add>"
30366 #: ../src/guestfs-actions.pod:6791
30367 msgid "guestfs_sfdisk_disk_geometry"
30371 #: ../src/guestfs-actions.pod:6793
30375 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
30376 " const char *device);\n"
30381 #: ../src/guestfs-actions.pod:6797
30383 "This displays the disk geometry of C<device> read from the partition table. "
30384 "Especially in the case where the underlying block device has been resized, "
30385 "this can be different from the kernel's idea of the geometry (see "
30386 "C<guestfs_sfdisk_kernel_geometry>)."
30390 #: ../src/guestfs-actions.pod:6810
30391 msgid "guestfs_sfdisk_kernel_geometry"
30395 #: ../src/guestfs-actions.pod:6812
30399 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
30400 " const char *device);\n"
30405 #: ../src/guestfs-actions.pod:6826
30406 msgid "guestfs_sfdisk_l"
30410 #: ../src/guestfs-actions.pod:6828
30414 " guestfs_sfdisk_l (guestfs_h *g,\n"
30415 " const char *device);\n"
30420 #: ../src/guestfs-actions.pod:6832
30422 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
30427 #: ../src/guestfs-actions.pod:6843
30428 msgid "See also: C<guestfs_part_list>"
30432 #: ../src/guestfs-actions.pod:6850
30437 #: ../src/guestfs-actions.pod:6852
30441 " guestfs_sh (guestfs_h *g,\n"
30442 " const char *command);\n"
30447 #: ../src/guestfs-actions.pod:6859
30448 msgid "This is like C<guestfs_command>, but passes the command to:"
30452 #: ../src/guestfs-actions.pod:6867
30453 msgid "All the provisos about C<guestfs_command> apply to this call."
30457 #: ../src/guestfs-actions.pod:6874
30458 msgid "guestfs_sh_lines"
30462 #: ../src/guestfs-actions.pod:6876
30466 " guestfs_sh_lines (guestfs_h *g,\n"
30467 " const char *command);\n"
30472 #: ../src/guestfs-actions.pod:6880
30474 "This is the same as C<guestfs_sh>, but splits the result into a list of "
30479 #: ../src/guestfs-actions.pod:6883
30480 msgid "See also: C<guestfs_command_lines>"
30484 #: ../src/guestfs-actions.pod:6891
30485 msgid "guestfs_sleep"
30489 #: ../src/guestfs-actions.pod:6893
30493 " guestfs_sleep (guestfs_h *g,\n"
30499 #: ../src/guestfs-actions.pod:6901
30500 msgid "(Added in 1.0.41)"
30504 #: ../src/guestfs-actions.pod:6903 ../src/guestfs-structs.pod:109
30505 msgid "guestfs_stat"
30509 #: ../src/guestfs-actions.pod:6905
30512 " struct guestfs_stat *\n"
30513 " guestfs_stat (guestfs_h *g,\n"
30514 " const char *path);\n"
30519 #: ../src/guestfs-actions.pod:6919 ../src/guestfs-structs.pod:135
30520 msgid "guestfs_statvfs"
30524 #: ../src/guestfs-actions.pod:6921
30527 " struct guestfs_statvfs *\n"
30528 " guestfs_statvfs (guestfs_h *g,\n"
30529 " const char *path);\n"
30534 #: ../src/guestfs-actions.pod:6931
30536 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
30537 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
30541 #: ../src/guestfs-actions.pod:6937
30542 msgid "guestfs_strings"
30546 #: ../src/guestfs-actions.pod:6939
30550 " guestfs_strings (guestfs_h *g,\n"
30551 " const char *path);\n"
30556 #: ../src/guestfs-actions.pod:6955
30557 msgid "guestfs_strings_e"
30561 #: ../src/guestfs-actions.pod:6957
30565 " guestfs_strings_e (guestfs_h *g,\n"
30566 " const char *encoding,\n"
30567 " const char *path);\n"
30572 #: ../src/guestfs-actions.pod:6962
30574 "This is like the C<guestfs_strings> command, but allows you to specify the "
30575 "encoding of strings that are looked for in the source file C<path>."
30579 #: ../src/guestfs-actions.pod:6972
30581 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
30582 "ISO-8859-X (this is what C<guestfs_strings> uses)."
30586 #: ../src/guestfs-actions.pod:7010
30587 msgid "guestfs_swapoff_device"
30591 #: ../src/guestfs-actions.pod:7012
30595 " guestfs_swapoff_device (guestfs_h *g,\n"
30596 " const char *device);\n"
30601 #: ../src/guestfs-actions.pod:7016
30603 "This command disables the libguestfs appliance swap device or partition "
30604 "named C<device>. See C<guestfs_swapon_device>."
30608 #: ../src/guestfs-actions.pod:7024
30609 msgid "guestfs_swapoff_file"
30613 #: ../src/guestfs-actions.pod:7026
30617 " guestfs_swapoff_file (guestfs_h *g,\n"
30618 " const char *file);\n"
30623 #: ../src/guestfs-actions.pod:7036
30624 msgid "guestfs_swapoff_label"
30628 #: ../src/guestfs-actions.pod:7038
30632 " guestfs_swapoff_label (guestfs_h *g,\n"
30633 " const char *label);\n"
30638 #: ../src/guestfs-actions.pod:7049
30639 msgid "guestfs_swapoff_uuid"
30643 #: ../src/guestfs-actions.pod:7051
30647 " guestfs_swapoff_uuid (guestfs_h *g,\n"
30648 " const char *uuid);\n"
30653 #: ../src/guestfs-actions.pod:7062
30654 msgid "guestfs_swapon_device"
30658 #: ../src/guestfs-actions.pod:7064
30662 " guestfs_swapon_device (guestfs_h *g,\n"
30663 " const char *device);\n"
30668 #: ../src/guestfs-actions.pod:7068
30670 "This command enables the libguestfs appliance to use the swap device or "
30671 "partition named C<device>. The increased memory is made available for all "
30672 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
30676 #: ../src/guestfs-actions.pod:7084
30677 msgid "guestfs_swapon_file"
30681 #: ../src/guestfs-actions.pod:7086
30685 " guestfs_swapon_file (guestfs_h *g,\n"
30686 " const char *file);\n"
30691 #: ../src/guestfs-actions.pod:7090
30693 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
30698 #: ../src/guestfs-actions.pod:7097
30699 msgid "guestfs_swapon_label"
30703 #: ../src/guestfs-actions.pod:7099
30707 " guestfs_swapon_label (guestfs_h *g,\n"
30708 " const char *label);\n"
30713 #: ../src/guestfs-actions.pod:7103
30715 "This command enables swap to a labeled swap partition. See "
30716 "C<guestfs_swapon_device> for other notes."
30720 #: ../src/guestfs-actions.pod:7110
30721 msgid "guestfs_swapon_uuid"
30725 #: ../src/guestfs-actions.pod:7112
30729 " guestfs_swapon_uuid (guestfs_h *g,\n"
30730 " const char *uuid);\n"
30735 #: ../src/guestfs-actions.pod:7116
30737 "This command enables swap to a swap partition with the given UUID. See "
30738 "C<guestfs_swapon_device> for other notes."
30742 #: ../src/guestfs-actions.pod:7123
30743 msgid "guestfs_sync"
30747 #: ../src/guestfs-actions.pod:7125
30751 " guestfs_sync (guestfs_h *g);\n"
30756 #: ../src/guestfs-actions.pod:7138
30757 msgid "guestfs_tail"
30761 #: ../src/guestfs-actions.pod:7140
30765 " guestfs_tail (guestfs_h *g,\n"
30766 " const char *path);\n"
30771 #: ../src/guestfs-actions.pod:7156
30772 msgid "guestfs_tail_n"
30776 #: ../src/guestfs-actions.pod:7158
30780 " guestfs_tail_n (guestfs_h *g,\n"
30782 " const char *path);\n"
30787 #: ../src/guestfs-actions.pod:7180
30788 msgid "guestfs_tar_in"
30792 #: ../src/guestfs-actions.pod:7182
30796 " guestfs_tar_in (guestfs_h *g,\n"
30797 " const char *tarfile,\n"
30798 " const char *directory);\n"
30803 #: ../src/guestfs-actions.pod:7190
30804 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
30808 #: ../src/guestfs-actions.pod:7195 ../src/guestfs-actions.pod:7212 ../src/guestfs-actions.pod:7228 ../src/guestfs-actions.pod:7244
30809 msgid "(Added in 1.0.3)"
30813 #: ../src/guestfs-actions.pod:7197
30814 msgid "guestfs_tar_out"
30818 #: ../src/guestfs-actions.pod:7199
30822 " guestfs_tar_out (guestfs_h *g,\n"
30823 " const char *directory,\n"
30824 " const char *tarfile);\n"
30829 #: ../src/guestfs-actions.pod:7207
30831 "To download a compressed tarball, use C<guestfs_tgz_out> or "
30832 "C<guestfs_txz_out>."
30836 #: ../src/guestfs-actions.pod:7214
30837 msgid "guestfs_tgz_in"
30841 #: ../src/guestfs-actions.pod:7216
30845 " guestfs_tgz_in (guestfs_h *g,\n"
30846 " const char *tarball,\n"
30847 " const char *directory);\n"
30852 #: ../src/guestfs-actions.pod:7224
30853 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
30857 #: ../src/guestfs-actions.pod:7230
30858 msgid "guestfs_tgz_out"
30862 #: ../src/guestfs-actions.pod:7232
30866 " guestfs_tgz_out (guestfs_h *g,\n"
30867 " const char *directory,\n"
30868 " const char *tarball);\n"
30873 #: ../src/guestfs-actions.pod:7240
30874 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
30878 #: ../src/guestfs-actions.pod:7246
30879 msgid "guestfs_touch"
30883 #: ../src/guestfs-actions.pod:7248
30887 " guestfs_touch (guestfs_h *g,\n"
30888 " const char *path);\n"
30893 #: ../src/guestfs-actions.pod:7263
30894 msgid "guestfs_truncate"
30898 #: ../src/guestfs-actions.pod:7265
30902 " guestfs_truncate (guestfs_h *g,\n"
30903 " const char *path);\n"
30908 #: ../src/guestfs-actions.pod:7276
30909 msgid "guestfs_truncate_size"
30913 #: ../src/guestfs-actions.pod:7278
30917 " guestfs_truncate_size (guestfs_h *g,\n"
30918 " const char *path,\n"
30919 " int64_t size);\n"
30924 #: ../src/guestfs-actions.pod:7286
30926 "If the current file size is less than C<size> then the file is extended to "
30927 "the required size with zero bytes. This creates a sparse file (ie. disk "
30928 "blocks are not allocated for the file until you write to it). To create a "
30929 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
30933 #: ../src/guestfs-actions.pod:7296
30934 msgid "guestfs_tune2fs_l"
30938 #: ../src/guestfs-actions.pod:7298
30942 " guestfs_tune2fs_l (guestfs_h *g,\n"
30943 " const char *device);\n"
30948 #: ../src/guestfs-actions.pod:7318
30949 msgid "guestfs_txz_in"
30953 #: ../src/guestfs-actions.pod:7320
30957 " guestfs_txz_in (guestfs_h *g,\n"
30958 " const char *tarball,\n"
30959 " const char *directory);\n"
30964 #: ../src/guestfs-actions.pod:7332
30965 msgid "guestfs_txz_out"
30969 #: ../src/guestfs-actions.pod:7334
30973 " guestfs_txz_out (guestfs_h *g,\n"
30974 " const char *directory,\n"
30975 " const char *tarball);\n"
30980 #: ../src/guestfs-actions.pod:7346
30981 msgid "guestfs_umask"
30985 #: ../src/guestfs-actions.pod:7348
30989 " guestfs_umask (guestfs_h *g,\n"
30995 #: ../src/guestfs-actions.pod:7364
30997 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
30998 "C<guestfs_mkdir>."
31002 #: ../src/guestfs-actions.pod:7373
31003 msgid "guestfs_umount"
31007 #: ../src/guestfs-actions.pod:7375
31011 " guestfs_umount (guestfs_h *g,\n"
31012 " const char *pathordevice);\n"
31017 #: ../src/guestfs-actions.pod:7387
31018 msgid "guestfs_umount_all"
31022 #: ../src/guestfs-actions.pod:7389
31026 " guestfs_umount_all (guestfs_h *g);\n"
31031 #: ../src/guestfs-actions.pod:7400
31032 msgid "guestfs_upload"
31036 #: ../src/guestfs-actions.pod:7402
31040 " guestfs_upload (guestfs_h *g,\n"
31041 " const char *filename,\n"
31042 " const char *remotefilename);\n"
31047 #: ../src/guestfs-actions.pod:7412
31048 msgid "See also C<guestfs_download>."
31052 #: ../src/guestfs-actions.pod:7423
31053 msgid "guestfs_upload_offset"
31057 #: ../src/guestfs-actions.pod:7425
31061 " guestfs_upload_offset (guestfs_h *g,\n"
31062 " const char *filename,\n"
31063 " const char *remotefilename,\n"
31064 " int64_t offset);\n"
31069 #: ../src/guestfs-actions.pod:7441
31071 "Note that there is no limit on the amount of data that can be uploaded with "
31072 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
31073 "full amount unless an error occurs."
31077 #: ../src/guestfs-actions.pod:7446
31078 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
31082 #: ../src/guestfs-actions.pod:7457
31083 msgid "guestfs_utimens"
31087 #: ../src/guestfs-actions.pod:7459
31091 " guestfs_utimens (guestfs_h *g,\n"
31092 " const char *path,\n"
31093 " int64_t atsecs,\n"
31094 " int64_t atnsecs,\n"
31095 " int64_t mtsecs,\n"
31096 " int64_t mtnsecs);\n"
31101 #: ../src/guestfs-actions.pod:7488 ../src/guestfs-structs.pod:175
31102 msgid "guestfs_version"
31106 #: ../src/guestfs-actions.pod:7490
31109 " struct guestfs_version *\n"
31110 " guestfs_version (guestfs_h *g);\n"
31115 #: ../src/guestfs-actions.pod:7518
31117 "I<Note:> Don't use this call to test for availability of features. In "
31118 "enterprise distributions we backport features from later versions into "
31119 "earlier versions, making this an unreliable way to test for features. Use "
31120 "C<guestfs_available> instead."
31124 #: ../src/guestfs-actions.pod:7524
31126 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
31127 "error. I<The caller must call C<guestfs_free_version> after use>."
31131 #: ../src/guestfs-actions.pod:7528
31132 msgid "(Added in 1.0.58)"
31136 #: ../src/guestfs-actions.pod:7530
31137 msgid "guestfs_vfs_label"
31141 #: ../src/guestfs-actions.pod:7532
31145 " guestfs_vfs_label (guestfs_h *g,\n"
31146 " const char *device);\n"
31151 #: ../src/guestfs-actions.pod:7541
31152 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
31156 #: ../src/guestfs-actions.pod:7546 ../src/guestfs-actions.pod:7583
31157 msgid "(Added in 1.3.18)"
31161 #: ../src/guestfs-actions.pod:7548
31162 msgid "guestfs_vfs_type"
31166 #: ../src/guestfs-actions.pod:7550
31170 " guestfs_vfs_type (guestfs_h *g,\n"
31171 " const char *device);\n"
31176 #: ../src/guestfs-actions.pod:7567
31177 msgid "guestfs_vfs_uuid"
31181 #: ../src/guestfs-actions.pod:7569
31185 " guestfs_vfs_uuid (guestfs_h *g,\n"
31186 " const char *device);\n"
31191 #: ../src/guestfs-actions.pod:7578
31192 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
31196 #: ../src/guestfs-actions.pod:7585
31197 msgid "guestfs_vg_activate"
31201 #: ../src/guestfs-actions.pod:7587
31205 " guestfs_vg_activate (guestfs_h *g,\n"
31207 " char *const *volgroups);\n"
31212 #: ../src/guestfs-actions.pod:7604
31213 msgid "guestfs_vg_activate_all"
31217 #: ../src/guestfs-actions.pod:7606
31221 " guestfs_vg_activate_all (guestfs_h *g,\n"
31222 " int activate);\n"
31227 #: ../src/guestfs-actions.pod:7619
31228 msgid "guestfs_vgcreate"
31232 #: ../src/guestfs-actions.pod:7621
31236 " guestfs_vgcreate (guestfs_h *g,\n"
31237 " const char *volgroup,\n"
31238 " char *const *physvols);\n"
31243 #: ../src/guestfs-actions.pod:7633
31244 msgid "guestfs_vglvuuids"
31248 #: ../src/guestfs-actions.pod:7635
31252 " guestfs_vglvuuids (guestfs_h *g,\n"
31253 " const char *vgname);\n"
31258 #: ../src/guestfs-actions.pod:7642
31260 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
31261 "associate logical volumes and volume groups."
31265 #: ../src/guestfs-actions.pod:7645
31266 msgid "See also C<guestfs_vgpvuuids>."
31270 #: ../src/guestfs-actions.pod:7653
31271 msgid "guestfs_vgpvuuids"
31275 #: ../src/guestfs-actions.pod:7655
31279 " guestfs_vgpvuuids (guestfs_h *g,\n"
31280 " const char *vgname);\n"
31285 #: ../src/guestfs-actions.pod:7662
31287 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
31288 "associate physical volumes and volume groups."
31292 #: ../src/guestfs-actions.pod:7665
31293 msgid "See also C<guestfs_vglvuuids>."
31297 #: ../src/guestfs-actions.pod:7673
31298 msgid "guestfs_vgremove"
31302 #: ../src/guestfs-actions.pod:7675
31306 " guestfs_vgremove (guestfs_h *g,\n"
31307 " const char *vgname);\n"
31312 #: ../src/guestfs-actions.pod:7688
31313 msgid "guestfs_vgrename"
31317 #: ../src/guestfs-actions.pod:7690
31321 " guestfs_vgrename (guestfs_h *g,\n"
31322 " const char *volgroup,\n"
31323 " const char *newvolgroup);\n"
31328 #: ../src/guestfs-actions.pod:7701
31329 msgid "guestfs_vgs"
31333 #: ../src/guestfs-actions.pod:7703
31337 " guestfs_vgs (guestfs_h *g);\n"
31342 #: ../src/guestfs-actions.pod:7712
31343 msgid "See also C<guestfs_vgs_full>."
31347 #: ../src/guestfs-actions.pod:7720
31348 msgid "guestfs_vgs_full"
31352 #: ../src/guestfs-actions.pod:7722
31355 " struct guestfs_lvm_vg_list *\n"
31356 " guestfs_vgs_full (guestfs_h *g);\n"
31361 #: ../src/guestfs-actions.pod:7728
31363 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
31364 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
31369 #: ../src/guestfs-actions.pod:7734
31370 msgid "guestfs_vgscan"
31374 #: ../src/guestfs-actions.pod:7736
31378 " guestfs_vgscan (guestfs_h *g);\n"
31383 #: ../src/guestfs-actions.pod:7746
31384 msgid "guestfs_vguuid"
31388 #: ../src/guestfs-actions.pod:7748
31392 " guestfs_vguuid (guestfs_h *g,\n"
31393 " const char *vgname);\n"
31398 #: ../src/guestfs-actions.pod:7759
31399 msgid "guestfs_wait_ready"
31403 #: ../src/guestfs-actions.pod:7761
31407 " guestfs_wait_ready (guestfs_h *g);\n"
31412 #: ../src/guestfs-actions.pod:7764
31414 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
31419 #: ../src/guestfs-actions.pod:7771
31420 msgid "This function is a no op."
31424 #: ../src/guestfs-actions.pod:7773
31426 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
31427 "calling C<guestfs_launch> to wait for the launch to complete. However this "
31428 "is no longer necessary because C<guestfs_launch> now does the waiting."
31432 #: ../src/guestfs-actions.pod:7778
31434 "If you see any calls to this function in code then you can just remove them, "
31435 "unless you want to retain compatibility with older versions of the API."
31439 #: ../src/guestfs-actions.pod:7786
31440 msgid "guestfs_wc_c"
31444 #: ../src/guestfs-actions.pod:7788
31448 " guestfs_wc_c (guestfs_h *g,\n"
31449 " const char *path);\n"
31454 #: ../src/guestfs-actions.pod:7799
31455 msgid "guestfs_wc_l"
31459 #: ../src/guestfs-actions.pod:7801
31463 " guestfs_wc_l (guestfs_h *g,\n"
31464 " const char *path);\n"
31469 #: ../src/guestfs-actions.pod:7812
31470 msgid "guestfs_wc_w"
31474 #: ../src/guestfs-actions.pod:7814
31478 " guestfs_wc_w (guestfs_h *g,\n"
31479 " const char *path);\n"
31484 #: ../src/guestfs-actions.pod:7825
31485 msgid "guestfs_write"
31489 #: ../src/guestfs-actions.pod:7827
31493 " guestfs_write (guestfs_h *g,\n"
31494 " const char *path,\n"
31495 " const char *content,\n"
31496 " size_t content_size);\n"
31501 #: ../src/guestfs-actions.pod:7836
31502 msgid "See also C<guestfs_write_append>."
31506 #: ../src/guestfs-actions.pod:7845
31507 msgid "guestfs_write_append"
31511 #: ../src/guestfs-actions.pod:7847
31515 " guestfs_write_append (guestfs_h *g,\n"
31516 " const char *path,\n"
31517 " const char *content,\n"
31518 " size_t content_size);\n"
31523 #: ../src/guestfs-actions.pod:7856
31524 msgid "See also C<guestfs_write>."
31528 #: ../src/guestfs-actions.pod:7865
31529 msgid "guestfs_write_file"
31533 #: ../src/guestfs-actions.pod:7867
31537 " guestfs_write_file (guestfs_h *g,\n"
31538 " const char *path,\n"
31539 " const char *content,\n"
31545 #: ../src/guestfs-actions.pod:7873
31547 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
31552 #: ../src/guestfs-actions.pod:7898
31553 msgid "guestfs_zegrep"
31557 #: ../src/guestfs-actions.pod:7900
31561 " guestfs_zegrep (guestfs_h *g,\n"
31562 " const char *regex,\n"
31563 " const char *path);\n"
31568 #: ../src/guestfs-actions.pod:7917
31569 msgid "guestfs_zegrepi"
31573 #: ../src/guestfs-actions.pod:7919
31577 " guestfs_zegrepi (guestfs_h *g,\n"
31578 " const char *regex,\n"
31579 " const char *path);\n"
31584 #: ../src/guestfs-actions.pod:7936
31585 msgid "guestfs_zero"
31589 #: ../src/guestfs-actions.pod:7938
31593 " guestfs_zero (guestfs_h *g,\n"
31594 " const char *device);\n"
31599 #: ../src/guestfs-actions.pod:7952
31601 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
31602 "C<guestfs_is_zero_device>"
31606 #: ../src/guestfs-actions.pod:7964
31607 msgid "guestfs_zero_device"
31611 #: ../src/guestfs-actions.pod:7966
31615 " guestfs_zero_device (guestfs_h *g,\n"
31616 " const char *device);\n"
31621 #: ../src/guestfs-actions.pod:7970
31623 "This command writes zeroes over the entire C<device>. Compare with "
31624 "C<guestfs_zero> which just zeroes the first few blocks of a device."
31628 #: ../src/guestfs-actions.pod:7988
31629 msgid "(Added in 1.3.1)"
31633 #: ../src/guestfs-actions.pod:7990
31634 msgid "guestfs_zerofree"
31638 #: ../src/guestfs-actions.pod:7992
31642 " guestfs_zerofree (guestfs_h *g,\n"
31643 " const char *device);\n"
31648 #: ../src/guestfs-actions.pod:8011
31649 msgid "guestfs_zfgrep"
31653 #: ../src/guestfs-actions.pod:8013
31657 " guestfs_zfgrep (guestfs_h *g,\n"
31658 " const char *pattern,\n"
31659 " const char *path);\n"
31664 #: ../src/guestfs-actions.pod:8030
31665 msgid "guestfs_zfgrepi"
31669 #: ../src/guestfs-actions.pod:8032
31673 " guestfs_zfgrepi (guestfs_h *g,\n"
31674 " const char *pattern,\n"
31675 " const char *path);\n"
31680 #: ../src/guestfs-actions.pod:8049
31681 msgid "guestfs_zfile"
31685 #: ../src/guestfs-actions.pod:8051
31689 " guestfs_zfile (guestfs_h *g,\n"
31690 " const char *meth,\n"
31691 " const char *path);\n"
31696 #: ../src/guestfs-actions.pod:8056
31698 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
31703 #: ../src/guestfs-actions.pod:8068
31705 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
31710 #: ../src/guestfs-actions.pod:8076
31711 msgid "guestfs_zgrep"
31715 #: ../src/guestfs-actions.pod:8078
31719 " guestfs_zgrep (guestfs_h *g,\n"
31720 " const char *regex,\n"
31721 " const char *path);\n"
31726 #: ../src/guestfs-actions.pod:8095
31727 msgid "guestfs_zgrepi"
31731 #: ../src/guestfs-actions.pod:8097
31735 " guestfs_zgrepi (guestfs_h *g,\n"
31736 " const char *regex,\n"
31737 " const char *path);\n"
31742 #: ../src/guestfs-availability.pod:3
31747 #: ../src/guestfs-availability.pod:5
31749 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
31750 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
31751 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
31752 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
31753 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
31757 #: ../src/guestfs-availability.pod:21
31762 #: ../src/guestfs-availability.pod:23
31763 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
31767 #: ../src/guestfs-availability.pod:26
31772 #: ../src/guestfs-availability.pod:28
31773 msgid "The following functions: L</guestfs_grub_install>"
31777 #: ../src/guestfs-availability.pod:31
31782 #: ../src/guestfs-availability.pod:33
31784 "The following functions: L</guestfs_inotify_add_watch> "
31785 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
31786 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
31790 #: ../src/guestfs-availability.pod:41
31791 msgid "B<linuxfsuuid>"
31795 #: ../src/guestfs-availability.pod:43
31797 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
31798 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
31802 #: ../src/guestfs-availability.pod:50
31803 msgid "B<linuxmodules>"
31807 #: ../src/guestfs-availability.pod:52
31808 msgid "The following functions: L</guestfs_modprobe>"
31812 #: ../src/guestfs-availability.pod:55
31813 msgid "B<linuxxattrs>"
31817 #: ../src/guestfs-availability.pod:57
31819 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
31820 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
31821 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
31822 "L</guestfs_setxattr>"
31826 #: ../src/guestfs-availability.pod:68
31831 #: ../src/guestfs-availability.pod:70
31833 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
31834 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
31835 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
31839 #: ../src/guestfs-availability.pod:79
31844 #: ../src/guestfs-availability.pod:81
31846 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
31847 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
31848 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
31849 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
31850 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
31851 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
31852 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
31853 "L</guestfs_vgs_full>"
31857 #: ../src/guestfs-availability.pod:104
31862 #: ../src/guestfs-availability.pod:106
31864 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
31865 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
31869 #: ../src/guestfs-availability.pod:112
31874 #: ../src/guestfs-availability.pod:114
31875 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
31879 #: ../src/guestfs-availability.pod:117
31880 msgid "B<ntfsprogs>"
31884 #: ../src/guestfs-availability.pod:119
31886 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
31887 "L</guestfs_ntfsresize_size>"
31891 #: ../src/guestfs-availability.pod:124
31892 msgid "B<realpath>"
31896 #: ../src/guestfs-availability.pod:126
31897 msgid "The following functions: L</guestfs_realpath>"
31901 #: ../src/guestfs-availability.pod:129
31906 #: ../src/guestfs-availability.pod:131
31908 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
31909 "L</guestfs_scrub_freespace>"
31913 #: ../src/guestfs-availability.pod:136
31918 #: ../src/guestfs-availability.pod:138
31919 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
31923 #: ../src/guestfs-availability.pod:142
31928 #: ../src/guestfs-availability.pod:144
31929 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
31933 #: ../src/guestfs-availability.pod:148
31934 msgid "B<zerofree>"
31938 #: ../src/guestfs-availability.pod:150
31939 msgid "The following functions: L</guestfs_zerofree>"
31943 #: ../src/guestfs-structs.pod:1
31944 msgid "guestfs_int_bool"
31948 #: ../src/guestfs-structs.pod:3
31951 " struct guestfs_int_bool {\n"
31959 #: ../src/guestfs-structs.pod:8
31962 " struct guestfs_int_bool_list {\n"
31963 " uint32_t len; /* Number of elements in list. */\n"
31964 " struct guestfs_int_bool *val; /* Elements. */\n"
31970 #: ../src/guestfs-structs.pod:13
31973 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
31974 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
31979 #: ../src/guestfs-structs.pod:16
31980 msgid "guestfs_lvm_pv"
31984 #: ../src/guestfs-structs.pod:18
31987 " struct guestfs_lvm_pv {\n"
31988 " char *pv_name;\n"
31989 " /* The next field is NOT nul-terminated, be careful when printing it: "
31991 " char pv_uuid[32];\n"
31993 " uint64_t pv_size;\n"
31994 " uint64_t dev_size;\n"
31995 " uint64_t pv_free;\n"
31996 " uint64_t pv_used;\n"
31997 " char *pv_attr;\n"
31998 " int64_t pv_pe_count;\n"
31999 " int64_t pv_pe_alloc_count;\n"
32000 " char *pv_tags;\n"
32001 " uint64_t pe_start;\n"
32002 " int64_t pv_mda_count;\n"
32003 " uint64_t pv_mda_free;\n"
32009 #: ../src/guestfs-structs.pod:36
32012 " struct guestfs_lvm_pv_list {\n"
32013 " uint32_t len; /* Number of elements in list. */\n"
32014 " struct guestfs_lvm_pv *val; /* Elements. */\n"
32020 #: ../src/guestfs-structs.pod:41
32023 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
32024 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
32029 #: ../src/guestfs-structs.pod:44
32030 msgid "guestfs_lvm_vg"
32034 #: ../src/guestfs-structs.pod:46
32037 " struct guestfs_lvm_vg {\n"
32038 " char *vg_name;\n"
32039 " /* The next field is NOT nul-terminated, be careful when printing it: "
32041 " char vg_uuid[32];\n"
32043 " char *vg_attr;\n"
32044 " uint64_t vg_size;\n"
32045 " uint64_t vg_free;\n"
32046 " char *vg_sysid;\n"
32047 " uint64_t vg_extent_size;\n"
32048 " int64_t vg_extent_count;\n"
32049 " int64_t vg_free_count;\n"
32050 " int64_t max_lv;\n"
32051 " int64_t max_pv;\n"
32052 " int64_t pv_count;\n"
32053 " int64_t lv_count;\n"
32054 " int64_t snap_count;\n"
32055 " int64_t vg_seqno;\n"
32056 " char *vg_tags;\n"
32057 " int64_t vg_mda_count;\n"
32058 " uint64_t vg_mda_free;\n"
32064 #: ../src/guestfs-structs.pod:69
32067 " struct guestfs_lvm_vg_list {\n"
32068 " uint32_t len; /* Number of elements in list. */\n"
32069 " struct guestfs_lvm_vg *val; /* Elements. */\n"
32075 #: ../src/guestfs-structs.pod:74
32078 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
32079 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
32084 #: ../src/guestfs-structs.pod:77
32085 msgid "guestfs_lvm_lv"
32089 #: ../src/guestfs-structs.pod:79
32092 " struct guestfs_lvm_lv {\n"
32093 " char *lv_name;\n"
32094 " /* The next field is NOT nul-terminated, be careful when printing it: "
32096 " char lv_uuid[32];\n"
32097 " char *lv_attr;\n"
32098 " int64_t lv_major;\n"
32099 " int64_t lv_minor;\n"
32100 " int64_t lv_kernel_major;\n"
32101 " int64_t lv_kernel_minor;\n"
32102 " uint64_t lv_size;\n"
32103 " int64_t seg_count;\n"
32105 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32106 " float snap_percent;\n"
32107 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32108 " float copy_percent;\n"
32109 " char *move_pv;\n"
32110 " char *lv_tags;\n"
32111 " char *mirror_log;\n"
32112 " char *modules;\n"
32118 #: ../src/guestfs-structs.pod:101
32121 " struct guestfs_lvm_lv_list {\n"
32122 " uint32_t len; /* Number of elements in list. */\n"
32123 " struct guestfs_lvm_lv *val; /* Elements. */\n"
32129 #: ../src/guestfs-structs.pod:106
32132 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
32133 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
32138 #: ../src/guestfs-structs.pod:111
32141 " struct guestfs_stat {\n"
32145 " int64_t nlink;\n"
32150 " int64_t blksize;\n"
32151 " int64_t blocks;\n"
32152 " int64_t atime;\n"
32153 " int64_t mtime;\n"
32154 " int64_t ctime;\n"
32160 #: ../src/guestfs-structs.pod:127
32163 " struct guestfs_stat_list {\n"
32164 " uint32_t len; /* Number of elements in list. */\n"
32165 " struct guestfs_stat *val; /* Elements. */\n"
32171 #: ../src/guestfs-structs.pod:132
32174 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
32175 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
32180 #: ../src/guestfs-structs.pod:137
32183 " struct guestfs_statvfs {\n"
32184 " int64_t bsize;\n"
32185 " int64_t frsize;\n"
32186 " int64_t blocks;\n"
32187 " int64_t bfree;\n"
32188 " int64_t bavail;\n"
32189 " int64_t files;\n"
32190 " int64_t ffree;\n"
32191 " int64_t favail;\n"
32194 " int64_t namemax;\n"
32200 #: ../src/guestfs-structs.pod:151
32203 " struct guestfs_statvfs_list {\n"
32204 " uint32_t len; /* Number of elements in list. */\n"
32205 " struct guestfs_statvfs *val; /* Elements. */\n"
32211 #: ../src/guestfs-structs.pod:156
32214 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
32215 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
32220 #: ../src/guestfs-structs.pod:159
32221 msgid "guestfs_dirent"
32225 #: ../src/guestfs-structs.pod:161
32228 " struct guestfs_dirent {\n"
32237 #: ../src/guestfs-structs.pod:167
32240 " struct guestfs_dirent_list {\n"
32241 " uint32_t len; /* Number of elements in list. */\n"
32242 " struct guestfs_dirent *val; /* Elements. */\n"
32248 #: ../src/guestfs-structs.pod:172
32251 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
32252 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
32257 #: ../src/guestfs-structs.pod:177
32260 " struct guestfs_version {\n"
32261 " int64_t major;\n"
32262 " int64_t minor;\n"
32263 " int64_t release;\n"
32270 #: ../src/guestfs-structs.pod:184
32273 " struct guestfs_version_list {\n"
32274 " uint32_t len; /* Number of elements in list. */\n"
32275 " struct guestfs_version *val; /* Elements. */\n"
32281 #: ../src/guestfs-structs.pod:189
32284 " void guestfs_free_version (struct guestfs_free_version *);\n"
32285 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
32290 #: ../src/guestfs-structs.pod:192
32291 msgid "guestfs_xattr"
32295 #: ../src/guestfs-structs.pod:194
32298 " struct guestfs_xattr {\n"
32299 " char *attrname;\n"
32300 " /* The next two fields describe a byte array. */\n"
32301 " uint32_t attrval_len;\n"
32302 " char *attrval;\n"
32308 #: ../src/guestfs-structs.pod:201
32311 " struct guestfs_xattr_list {\n"
32312 " uint32_t len; /* Number of elements in list. */\n"
32313 " struct guestfs_xattr *val; /* Elements. */\n"
32319 #: ../src/guestfs-structs.pod:206
32322 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
32323 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
32328 #: ../src/guestfs-structs.pod:209
32329 msgid "guestfs_inotify_event"
32333 #: ../src/guestfs-structs.pod:211
32336 " struct guestfs_inotify_event {\n"
32337 " int64_t in_wd;\n"
32338 " uint32_t in_mask;\n"
32339 " uint32_t in_cookie;\n"
32340 " char *in_name;\n"
32346 #: ../src/guestfs-structs.pod:218
32349 " struct guestfs_inotify_event_list {\n"
32350 " uint32_t len; /* Number of elements in list. */\n"
32351 " struct guestfs_inotify_event *val; /* Elements. */\n"
32357 #: ../src/guestfs-structs.pod:223
32360 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
32361 " void guestfs_free_inotify_event_list (struct "
32362 "guestfs_free_inotify_event_list *);\n"
32367 #: ../src/guestfs-structs.pod:226
32368 msgid "guestfs_partition"
32372 #: ../src/guestfs-structs.pod:228
32375 " struct guestfs_partition {\n"
32376 " int32_t part_num;\n"
32377 " uint64_t part_start;\n"
32378 " uint64_t part_end;\n"
32379 " uint64_t part_size;\n"
32385 #: ../src/guestfs-structs.pod:235
32388 " struct guestfs_partition_list {\n"
32389 " uint32_t len; /* Number of elements in list. */\n"
32390 " struct guestfs_partition *val; /* Elements. */\n"
32396 #: ../src/guestfs-structs.pod:240
32399 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
32400 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
32405 #: ../src/guestfs-structs.pod:243
32406 msgid "guestfs_application"
32410 #: ../src/guestfs-structs.pod:245
32413 " struct guestfs_application {\n"
32414 " char *app_name;\n"
32415 " char *app_display_name;\n"
32416 " int32_t app_epoch;\n"
32417 " char *app_version;\n"
32418 " char *app_release;\n"
32419 " char *app_install_path;\n"
32420 " char *app_trans_path;\n"
32421 " char *app_publisher;\n"
32422 " char *app_url;\n"
32423 " char *app_source_package;\n"
32424 " char *app_summary;\n"
32425 " char *app_description;\n"
32431 #: ../src/guestfs-structs.pod:260
32434 " struct guestfs_application_list {\n"
32435 " uint32_t len; /* Number of elements in list. */\n"
32436 " struct guestfs_application *val; /* Elements. */\n"
32442 #: ../src/guestfs-structs.pod:265
32445 " void guestfs_free_application (struct guestfs_free_application *);\n"
32446 " void guestfs_free_application_list (struct guestfs_free_application_list "
32452 #: ../src/guestfs.pod:5
32453 msgid "guestfs - Library for accessing and modifying virtual machine images"
32457 #: ../src/guestfs.pod:11
32460 " guestfs_h *g = guestfs_create ();\n"
32461 " guestfs_add_drive (g, \"guest.img\");\n"
32462 " guestfs_launch (g);\n"
32463 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
32464 " guestfs_touch (g, \"/hello\");\n"
32465 " guestfs_umount (g, \"/\");\n"
32466 " guestfs_close (g);\n"
32471 #: ../src/guestfs.pod:25
32473 "Libguestfs is a library for accessing and modifying guest disk images. "
32474 "Amongst the things this is good for: making batch configuration changes to "
32475 "guests, getting disk used/free statistics (see also: virt-df), migrating "
32476 "between virtualization systems (see also: virt-p2v), performing partial "
32477 "backups, performing partial guest clones, cloning guests and changing "
32478 "registry/UUID/hostname info, and much else besides."
32482 #: ../src/guestfs.pod:33
32484 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
32485 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
32486 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
32491 #: ../src/guestfs.pod:38
32493 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
32494 "what filesystem is in each LV, etc.). It can also run commands in the "
32495 "context of the guest. Also you can access filesystems over FUSE."
32499 #: ../src/guestfs.pod:43
32501 "Libguestfs is a library that can be linked with C and C++ management "
32502 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
32503 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
32508 #: ../src/guestfs.pod:48
32510 "You don't need to be root to use libguestfs, although obviously you do need "
32511 "enough permissions to access the disk images."
32515 #: ../src/guestfs.pod:51
32517 "Libguestfs is a large API because it can do many things. For a gentle "
32518 "introduction, please read the L</API OVERVIEW> section next."
32522 #: ../src/guestfs.pod:54
32524 "There are also some example programs in the L<guestfs-examples(3)> manual "
32529 #: ../src/guestfs.pod:57
32530 msgid "API OVERVIEW"
32534 #: ../src/guestfs.pod:59
32536 "This section provides a gentler overview of the libguestfs API. We also try "
32537 "to group API calls together, where that may not be obvious from reading "
32538 "about the individual calls in the main section of this manual."
32542 #: ../src/guestfs.pod:64
32547 #: ../src/guestfs.pod:66
32549 "Before you can use libguestfs calls, you have to create a handle. Then you "
32550 "must add at least one disk image to the handle, followed by launching the "
32551 "handle, then performing whatever operations you want, and finally closing "
32552 "the handle. By convention we use the single letter C<g> for the name of the "
32553 "handle variable, although of course you can use any name you want."
32557 #: ../src/guestfs.pod:73
32558 msgid "The general structure of all libguestfs-using programs looks like this:"
32562 #: ../src/guestfs.pod:76
32565 " guestfs_h *g = guestfs_create ();\n"
32570 #: ../src/guestfs.pod:78
32573 " /* Call guestfs_add_drive additional times if there are\n"
32574 " * multiple disk images.\n"
32576 " guestfs_add_drive (g, \"guest.img\");\n"
32581 #: ../src/guestfs.pod:83
32584 " /* Most manipulation calls won't work until you've launched\n"
32585 " * the handle 'g'. You have to do this _after_ adding drives\n"
32586 " * and _before_ other commands.\n"
32588 " guestfs_launch (g);\n"
32593 #: ../src/guestfs.pod:89
32596 " /* Now you can examine what partitions, LVs etc are available.\n"
32598 " char **partitions = guestfs_list_partitions (g);\n"
32599 " char **logvols = guestfs_lvs (g);\n"
32604 #: ../src/guestfs.pod:94
32607 " /* To access a filesystem in the image, you must mount it.\n"
32609 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
32614 #: ../src/guestfs.pod:98
32617 " /* Now you can perform filesystem actions on the guest\n"
32620 " guestfs_touch (g, \"/hello\");\n"
32625 #: ../src/guestfs.pod:103
32628 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
32629 " * it is done automatically when you close the handle. See\n"
32630 " * discussion of autosync in this page.\n"
32632 " guestfs_sync (g);\n"
32637 #: ../src/guestfs.pod:109
32640 " /* Close the handle 'g'. */\n"
32641 " guestfs_close (g);\n"
32646 #: ../src/guestfs.pod:112
32648 "The code above doesn't include any error checking. In real code you should "
32649 "check return values carefully for errors. In general all functions that "
32650 "return integers return C<-1> on error, and all functions that return "
32651 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
32652 "how to handle errors, and consult the documentation for each function call "
32653 "below to see precisely how they return error indications. See "
32654 "L<guestfs-examples(3)> for fully worked examples."
32658 #: ../src/guestfs.pod:121
32659 msgid "DISK IMAGES"
32663 #: ../src/guestfs.pod:123
32665 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
32666 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
32667 "actual block device, or simply an empty file of zeroes that you have created "
32668 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
32673 #: ../src/guestfs.pod:129
32675 "The call you should use in modern code for adding drives is "
32676 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
32677 "specifying that the format is raw, do:"
32681 #: ../src/guestfs.pod:133
32684 " guestfs_add_drive_opts (g, filename,\n"
32685 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32691 #: ../src/guestfs.pod:137
32692 msgid "You can add a disk read-only using:"
32696 #: ../src/guestfs.pod:139
32699 " guestfs_add_drive_opts (g, filename,\n"
32700 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32701 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
32707 #: ../src/guestfs.pod:144
32709 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
32710 "libguestfs won't modify the file."
32714 #: ../src/guestfs.pod:147
32716 "Be extremely cautious if the disk image is in use, eg. if it is being used "
32717 "by a virtual machine. Adding it read-write will almost certainly cause disk "
32718 "corruption, but adding it read-only is safe."
32722 #: ../src/guestfs.pod:151
32724 "You must add at least one disk image, and you may add multiple disk images. "
32725 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
32726 "first one you added), C</dev/sdb> (for the second one you added), etc."
32730 #: ../src/guestfs.pod:156
32732 "Once L</guestfs_launch> has been called you cannot add any more images. You "
32733 "can call L</guestfs_list_devices> to get a list of the device names, in the "
32734 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
32738 #: ../src/guestfs.pod:161
32743 #: ../src/guestfs.pod:163
32745 "Before you can read or write files, create directories and so on in a disk "
32746 "image that contains filesystems, you have to mount those filesystems using "
32747 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
32748 "a disk image contains (for example) one partition with a filesystem on that "
32749 "partition, then you can mount it directly:"
32753 #: ../src/guestfs.pod:170
32756 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
32761 #: ../src/guestfs.pod:172
32763 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
32764 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
32765 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
32766 "that these are libguestfs virtual devices, and are nothing to do with host "
32771 #: ../src/guestfs.pod:178
32773 "If you are given a disk image and you don't know what it contains then you "
32774 "have to find out. Libguestfs can do that too: use "
32775 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
32776 "and LVs, and either try mounting each to see what is mountable, or else "
32777 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
32778 "filesystems, use L</guestfs_list_filesystems>."
32782 #: ../src/guestfs.pod:186
32784 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
32785 "L</INSPECTION> below). But you might find it easier to look at higher level "
32786 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
32790 #: ../src/guestfs.pod:191
32792 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
32793 "several other variations of the C<guestfs_mount_*> call."
32797 #: ../src/guestfs.pod:194
32798 msgid "FILESYSTEM ACCESS AND MODIFICATION"
32802 #: ../src/guestfs.pod:196
32804 "The majority of the libguestfs API consists of fairly low-level calls for "
32805 "accessing and modifying the files, directories, symlinks etc on mounted "
32806 "filesystems. There are over a hundred such calls which you can find listed "
32807 "in detail below in this man page, and we don't even pretend to cover them "
32808 "all in this overview."
32812 #: ../src/guestfs.pod:202
32814 "Specify filenames as full paths, starting with C<\"/\"> and including the "
32819 #: ../src/guestfs.pod:205
32821 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
32822 "the file called C<\"etc/passwd\"> then you could do:"
32826 #: ../src/guestfs.pod:208
32829 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
32834 #: ../src/guestfs.pod:210
32836 "This would return C<data> as a newly allocated buffer containing the full "
32837 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
32838 "or C<NULL> if there was an error."
32842 #: ../src/guestfs.pod:214
32844 "As another example, to create a top-level directory on that filesystem "
32845 "called C<\"var\"> you would do:"
32849 #: ../src/guestfs.pod:217
32852 " guestfs_mkdir (g, \"/var\");\n"
32857 #: ../src/guestfs.pod:219
32858 msgid "To create a symlink you could do:"
32862 #: ../src/guestfs.pod:221
32865 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
32866 " \"/etc/rc3.d/S30portmap\");\n"
32871 #: ../src/guestfs.pod:224
32873 "Libguestfs will reject attempts to use relative paths and there is no "
32874 "concept of a current working directory."
32878 #: ../src/guestfs.pod:227
32880 "Libguestfs can return errors in many situations: for example if the "
32881 "filesystem isn't writable, or if a file or directory that you requested "
32882 "doesn't exist. If you are using the C API (documented here) you have to "
32883 "check for those error conditions after each call. (Other language bindings "
32884 "turn these errors into exceptions)."
32888 #: ../src/guestfs.pod:233
32890 "File writes are affected by the per-handle umask, set by calling "
32891 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
32895 #: ../src/guestfs.pod:236
32896 msgid "PARTITIONING"
32900 #: ../src/guestfs.pod:238
32902 "Libguestfs contains API calls to read, create and modify partition tables on "
32907 #: ../src/guestfs.pod:241
32909 "In the common case where you want to create a single partition covering the "
32910 "whole disk, you should use the L</guestfs_part_disk> call:"
32914 #: ../src/guestfs.pod:245
32917 " const char *parttype = \"mbr\";\n"
32918 " if (disk_is_larger_than_2TB)\n"
32919 " parttype = \"gpt\";\n"
32920 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
32925 #: ../src/guestfs.pod:250
32927 "Obviously this effectively wipes anything that was on that disk image "
32932 #: ../src/guestfs.pod:253
32937 #: ../src/guestfs.pod:255
32939 "Libguestfs provides access to a large part of the LVM2 API, such as "
32940 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
32941 "unless you familiarize yourself with the concepts of physical volumes, "
32942 "volume groups and logical volumes."
32946 #: ../src/guestfs.pod:260
32948 "This author strongly recommends reading the LVM HOWTO, online at "
32949 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
32953 #: ../src/guestfs.pod:263
32954 msgid "DOWNLOADING"
32958 #: ../src/guestfs.pod:265
32960 "Use L</guestfs_cat> to download small, text only files. This call is "
32961 "limited to files which are less than 2 MB and which cannot contain any ASCII "
32962 "NUL (C<\\0>) characters. However the API is very simple to use."
32966 #: ../src/guestfs.pod:269
32968 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
32969 "bit data, since it returns a (pointer, size) pair. However it is still "
32970 "limited to \"small\" files, less than 2 MB."
32974 #: ../src/guestfs.pod:273
32976 "L</guestfs_download> can be used to download any file, with no limits on "
32977 "content or size (even files larger than 4 GB)."
32981 #: ../src/guestfs.pod:276
32982 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
32986 #: ../src/guestfs.pod:279
32991 #: ../src/guestfs.pod:281
32993 "It's often the case that you want to write a file or files to the disk "
32998 #: ../src/guestfs.pod:284
33000 "To write a small file with fixed content, use L</guestfs_write>. To create "
33001 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
33002 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
33003 "variety of other functions for creating test files, for example "
33004 "L</guestfs_fill> and L</guestfs_fill_pattern>."
33008 #: ../src/guestfs.pod:290
33010 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
33011 "file content or size (even files larger than 4 GB)."
33015 #: ../src/guestfs.pod:293
33016 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
33020 #: ../src/guestfs.pod:295
33022 "However the fastest way to upload I<large numbers of arbitrary files> is to "
33023 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
33024 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
33025 "the drive in a predictable way (eg. adding it last after all other drives) "
33026 "then you can get the device name from L</guestfs_list_devices> and mount it "
33027 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
33028 "sometimes non-portable between kernel versions, and they don't support "
33029 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
33030 "using a label or UUID, use an ISO image instead."
33034 #: ../src/guestfs.pod:306
33039 #: ../src/guestfs.pod:308
33041 "There are various different commands for copying between files and devices "
33042 "and in and out of the guest filesystem. These are summarised in the table "
33047 #: ../src/guestfs.pod:314
33048 msgid "B<file> to B<file>"
33052 #: ../src/guestfs.pod:316
33054 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
33055 "directories recursively."
33059 #: ../src/guestfs.pod:319
33060 msgid "B<file or device> to B<file or device>"
33064 #: ../src/guestfs.pod:321
33066 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
33067 "devices in the guest."
33071 #: ../src/guestfs.pod:324
33072 msgid "Example: duplicate the contents of an LV:"
33076 #: ../src/guestfs.pod:326
33079 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
33084 #: ../src/guestfs.pod:328
33086 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
33087 "(C</dev/VG/Original>). To copy less than the whole source device, use "
33088 "L</guestfs_copy_size>."
33092 #: ../src/guestfs.pod:332
33093 msgid "B<file on the host> to B<file or device>"
33097 #: ../src/guestfs.pod:334
33098 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
33102 #: ../src/guestfs.pod:336
33103 msgid "B<file or device> to B<file on the host>"
33107 #: ../src/guestfs.pod:338
33108 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
33112 #: ../src/guestfs.pod:342
33113 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
33117 #: ../src/guestfs.pod:344
33119 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
33120 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
33121 "appears you can only upload and download to files. However many Un*x-like "
33122 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
33123 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
33124 "stderr, and arbitrary file descriptor N."
33128 #: ../src/guestfs.pod:352
33129 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
33133 #: ../src/guestfs.pod:355
33136 " guestfs_download (g, filename, \"/dev/stdout\");\n"
33141 #: ../src/guestfs.pod:357
33142 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
33146 #: ../src/guestfs.pod:359
33149 " char devfd[64];\n"
33150 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
33151 " guestfs_tar_out (g, \"/\", devfd);\n"
33156 #: ../src/guestfs.pod:363
33157 msgid "LISTING FILES"
33161 #: ../src/guestfs.pod:365
33163 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
33164 "L<guestfish(1)>-equivalent command C<ll>)."
33168 #: ../src/guestfs.pod:368
33170 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
33171 "programs, as a flat list of strings."
33175 #: ../src/guestfs.pod:371
33177 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
33178 "directory, plus additional information about each one. It is more "
33179 "equivalent to using the L<readdir(3)> call on a local filesystem."
33183 #: ../src/guestfs.pod:375
33185 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
33190 #: ../src/guestfs.pod:378
33191 msgid "RUNNING COMMANDS"
33195 #: ../src/guestfs.pod:380
33197 "Although libguestfs is primarily an API for manipulating files inside guest "
33198 "images, we also provide some limited facilities for running commands inside "
33203 #: ../src/guestfs.pod:384
33204 msgid "There are many limitations to this:"
33208 #: ../src/guestfs.pod:390
33210 "The kernel version that the command runs under will be different from what "
33215 #: ../src/guestfs.pod:395
33217 "If the command needs to communicate with daemons, then most likely they "
33218 "won't be running."
33222 #: ../src/guestfs.pod:400
33223 msgid "The command will be running in limited memory."
33227 #: ../src/guestfs.pod:404
33229 "The network may not be available unless you enable it (see "
33230 "L</guestfs_set_network>)."
33234 #: ../src/guestfs.pod:409
33235 msgid "Only supports Linux guests (not Windows, BSD, etc)."
33239 #: ../src/guestfs.pod:413
33240 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
33244 #: ../src/guestfs.pod:418
33246 "For SELinux guests, you may need to enable SELinux and load policy first. "
33247 "See L</SELINUX> in this manpage."
33251 #: ../src/guestfs.pod:423
33253 "I<Security:> It is not safe to run commands from untrusted, possibly "
33254 "malicious guests. These commands may attempt to exploit your program by "
33255 "sending unexpected output. They could also try to exploit the Linux kernel "
33256 "or qemu provided by the libguestfs appliance. They could use the network "
33257 "provided by the libguestfs appliance to bypass ordinary network partitions "
33258 "and firewalls. They could use the elevated privileges or different SELinux "
33259 "context of your program to their advantage."
33263 #: ../src/guestfs.pod:432
33265 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
33266 "(a script which runs when the guest next boots normally), and to have this "
33267 "script run the commands you want in the normal context of the running guest, "
33268 "network security and so on. For information about other security issues, "
33269 "see L</SECURITY>."
33273 #: ../src/guestfs.pod:440
33275 "The two main API calls to run commands are L</guestfs_command> and "
33276 "L</guestfs_sh> (there are also variations)."
33280 #: ../src/guestfs.pod:443
33282 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
33283 "shell globs, redirections, etc will work."
33287 #: ../src/guestfs.pod:446
33288 msgid "CONFIGURATION FILES"
33292 #: ../src/guestfs.pod:448
33294 "To read and write configuration files in Linux guest filesystems, we "
33295 "strongly recommend using Augeas. For example, Augeas understands how to "
33296 "read and write, say, a Linux shadow password file or X.org configuration "
33297 "file, and so avoids you having to write that code."
33301 #: ../src/guestfs.pod:453
33303 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
33304 "document Augeas itself here because there is excellent documentation on the "
33305 "L<http://augeas.net/> website."
33309 #: ../src/guestfs.pod:457
33311 "If you don't want to use Augeas (you fool!) then try calling "
33312 "L</guestfs_read_lines> to get the file as a list of lines which you can "
33317 #: ../src/guestfs.pod:461
33322 #: ../src/guestfs.pod:463
33324 "We support SELinux guests. To ensure that labeling happens correctly in "
33325 "SELinux guests, you need to enable SELinux and load the guest's policy:"
33329 #: ../src/guestfs.pod:471
33330 msgid "Before launching, do:"
33334 #: ../src/guestfs.pod:473
33337 " guestfs_set_selinux (g, 1);\n"
33342 #: ../src/guestfs.pod:477
33344 "After mounting the guest's filesystem(s), load the policy. This is best "
33345 "done by running the L<load_policy(8)> command in the guest itself:"
33349 #: ../src/guestfs.pod:481
33352 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
33357 #: ../src/guestfs.pod:483
33359 "(Older versions of C<load_policy> require you to specify the name of the "
33364 #: ../src/guestfs.pod:488
33366 "Optionally, set the security context for the API. The correct security "
33367 "context to use can only be known by inspecting the guest. As an example:"
33371 #: ../src/guestfs.pod:492
33374 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
33379 #: ../src/guestfs.pod:496
33380 msgid "This will work for running commands and editing existing files."
33384 #: ../src/guestfs.pod:498
33386 "When new files are created, you may need to label them explicitly, for "
33387 "example by running the external command C<restorecon pathname>."
33391 #: ../src/guestfs.pod:502
33396 #: ../src/guestfs.pod:504
33398 "Certain calls are affected by the current file mode creation mask (the "
33399 "\"umask\"). In particular ones which create files or directories, such as "
33400 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
33401 "either the default mode that the file is created with or modifies the mode "
33406 #: ../src/guestfs.pod:510
33408 "The default umask is C<022>, so files are created with modes such as C<0644> "
33409 "and directories with C<0755>."
33413 #: ../src/guestfs.pod:513
33415 "There are two ways to avoid being affected by umask. Either set umask to 0 "
33416 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
33417 "L</guestfs_chmod> after creating each file or directory."
33421 #: ../src/guestfs.pod:517
33422 msgid "For more information about umask, see L<umask(2)>."
33426 #: ../src/guestfs.pod:521
33428 "Libguestfs allows you to access Linux guests which have been encrypted using "
33429 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
33430 "standard. This includes nearly all whole disk encryption systems used by "
33431 "modern Linux guests."
33435 #: ../src/guestfs.pod:527
33437 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
33438 "returns the string C<crypto_LUKS>)."
33442 #: ../src/guestfs.pod:530
33444 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
33445 "will require the passphrase!"
33449 #: ../src/guestfs.pod:533
33451 "Opening a LUKS device creates a new device mapper device called "
33452 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
33453 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
33454 "decrypted from and encrypted to the underlying block device respectively."
33458 #: ../src/guestfs.pod:539
33460 "LVM volume groups on the device can be made visible by calling "
33461 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
33462 "volume(s) can now be mounted in the usual way."
33466 #: ../src/guestfs.pod:543
33468 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
33469 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
33470 "[\"/dev/VG\"])>. Then close the mapper device by calling "
33471 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
33472 "underlying encrypted block device)."
33476 #: ../src/guestfs.pod:550
33481 #: ../src/guestfs.pod:552
33483 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
33484 "contains operating systems, an install CD or a live CD. (These APIs used to "
33485 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
33486 "version 1.5.3 the most frequently used part of this library has been "
33487 "rewritten in C and moved into the core code)."
33491 #: ../src/guestfs.pod:559
33493 "Add all disks belonging to the unknown virtual machine and call "
33494 "L</guestfs_launch> in the usual way."
33498 #: ../src/guestfs.pod:562
33500 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
33501 "and certain heuristics, and returns a list of operating systems that were "
33502 "found. An empty list means none were found. A single element is the root "
33503 "filesystem of the operating system. For dual- or multi-boot guests, "
33504 "multiple roots can be returned, each one corresponding to a separate "
33505 "operating system. (Multi-boot virtual machines are extremely rare in the "
33506 "world of virtualization, but since this scenario can happen, we have built "
33507 "libguestfs to deal with it.)"
33511 #: ../src/guestfs.pod:571
33513 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
33514 "to get additional details about that operating system. For example, call "
33515 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
33516 "Windows and Linux-based operating systems respectively."
33520 #: ../src/guestfs.pod:577
33522 "Un*x-like and Linux-based operating systems usually consist of several "
33523 "filesystems which are mounted at boot time (for example, a separate boot "
33524 "partition mounted on C</boot>). The inspection rules are able to detect how "
33525 "filesystems correspond to mount points. Call "
33526 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
33527 "hash table like this example:"
33531 #: ../src/guestfs.pod:584
33534 " /boot => /dev/sda1\n"
33535 " / => /dev/vg_guest/lv_root\n"
33536 " /usr => /dev/vg_guest/lv_usr\n"
33541 #: ../src/guestfs.pod:588
33543 "The caller can then make calls to L</guestfs_mount_options> to mount the "
33544 "filesystems as suggested."
33548 #: ../src/guestfs.pod:591
33550 "Be careful to mount filesystems in the right order (eg. C</> before "
33551 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
33556 #: ../src/guestfs.pod:595
33558 "Inspection currently only works for some common operating systems. "
33559 "Contributors are welcome to send patches for other operating systems that we "
33560 "currently cannot detect."
33564 #: ../src/guestfs.pod:599
33566 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
33567 "for more details. The L</guestfs_inspect_os> function just ignores any "
33568 "encrypted devices."
33572 #: ../src/guestfs.pod:603
33574 "A note on the implementation: The call L</guestfs_inspect_os> performs "
33575 "inspection and caches the results in the guest handle. Subsequent calls to "
33576 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
33577 "re-read the disks. If you change the content of the guest disks, you can "
33578 "redo inspection by calling L</guestfs_inspect_os> again. "
33579 "(L</guestfs_inspect_list_applications> works a little differently from the "
33580 "other calls and does read the disks. See documentation for that function "
33585 #: ../src/guestfs.pod:612
33586 msgid "INSPECTING INSTALL DISKS"
33590 #: ../src/guestfs.pod:614
33592 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
33597 #: ../src/guestfs.pod:617
33599 "Call L</guestfs_inspect_get_format> to return the format of the operating "
33600 "system, which currently can be C<installed> (a regular operating system) or "
33601 "C<installer> (some sort of install disk)."
33605 #: ../src/guestfs.pod:621
33607 "Further information is available about the operating system that can be "
33608 "installed using the regular inspection APIs like "
33609 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
33614 #: ../src/guestfs.pod:626
33616 "Some additional information specific to installer disks is also available "
33617 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
33618 "L</guestfs_inspect_is_multipart> calls."
33622 #: ../src/guestfs.pod:631
33623 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
33627 #: ../src/guestfs.pod:633
33629 "Libguestfs can mount NTFS partitions. It does this using the "
33630 "L<http://www.ntfs-3g.org/> driver."
33634 #: ../src/guestfs.pod:636
33635 msgid "DRIVE LETTERS AND PATHS"
33639 #: ../src/guestfs.pod:638
33641 "DOS and Windows still use drive letters, and the filesystems are always "
33642 "treated as case insensitive by Windows itself, and therefore you might find "
33643 "a Windows configuration file referring to a path like "
33644 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
33645 "that directory might be referred to as C</WINDOWS/System32>."
33649 #: ../src/guestfs.pod:644
33651 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
33652 "L</guestfs_inspect_get_drive_mappings>)"
33656 #: ../src/guestfs.pod:647
33658 "Dealing with separator characters (backslash vs forward slash) is outside "
33659 "the scope of libguestfs, but usually a simple character replacement will "
33664 #: ../src/guestfs.pod:651
33666 "To resolve the case insensitivity of paths, call "
33667 "L</guestfs_case_sensitive_path>."
33671 #: ../src/guestfs.pod:654
33672 msgid "ACCESSING THE WINDOWS REGISTRY"
33676 #: ../src/guestfs.pod:656
33678 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
33679 "files, through the library C<hivex> which is part of the libguestfs project "
33680 "although ships as a separate tarball. You have to locate and download the "
33681 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
33682 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
33683 "L<virt-win-reg(1)> for more help on this issue."
33687 #: ../src/guestfs.pod:664
33688 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
33692 #: ../src/guestfs.pod:666
33694 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
33695 "provide something which looks like a Linux symlink. The way it tries to do "
33696 "the rewriting is described here:"
33700 #: ../src/guestfs.pod:670
33701 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
33705 #: ../src/guestfs.pod:672
33707 "The essential problem is that ntfs-3g simply does not have enough "
33708 "information to do a correct job. NTFS links can contain drive letters and "
33709 "references to external device GUIDs that ntfs-3g has no way of resolving. "
33710 "It is almost certainly the case that libguestfs callers should ignore what "
33711 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
33715 #: ../src/guestfs.pod:679
33717 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
33718 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
33719 "attribute, and read the raw reparse data from that (you can find the format "
33720 "documented in various places around the web)."
33724 #: ../src/guestfs.pod:684
33725 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
33729 #: ../src/guestfs.pod:686
33731 "There are other useful extended attributes that can be read from ntfs-3g "
33732 "filesystems (using L</guestfs_getxattr>). See:"
33736 #: ../src/guestfs.pod:689
33737 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
33741 #: ../src/guestfs.pod:691
33742 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
33746 #: ../src/guestfs.pod:693
33748 "Although we don't want to discourage you from using the C API, we will "
33749 "mention here that the same API is also available in other languages."
33753 #: ../src/guestfs.pod:696
33755 "The API is broadly identical in all supported languages. This means that "
33756 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
33757 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
33758 "OCaml. In other words, a straightforward, predictable isomorphism between "
33763 #: ../src/guestfs.pod:702
33765 "Error messages are automatically transformed into exceptions if the language "
33770 #: ../src/guestfs.pod:705
33772 "We don't try to \"object orientify\" parts of the API in OO languages, "
33773 "although contributors are welcome to write higher level APIs above what we "
33774 "provide in their favourite languages if they wish."
33778 #: ../src/guestfs.pod:711
33783 #: ../src/guestfs.pod:713
33785 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
33786 "identical to the C API. C++ classes and exceptions are not used."
33790 #: ../src/guestfs.pod:717
33795 #: ../src/guestfs.pod:719
33797 "The C# bindings are highly experimental. Please read the warnings at the "
33798 "top of C<csharp/Libguestfs.cs>."
33802 #: ../src/guestfs.pod:722
33807 #: ../src/guestfs.pod:724
33808 msgid "See L<guestfs-erlang(3)>."
33812 #: ../src/guestfs.pod:726
33817 #: ../src/guestfs.pod:728
33819 "This is the only language binding that is working but incomplete. Only "
33820 "calls which return simple integers have been bound in Haskell, and we are "
33821 "looking for help to complete this binding."
33825 #: ../src/guestfs.pod:732
33830 #: ../src/guestfs.pod:734
33832 "Full documentation is contained in the Javadoc which is distributed with "
33833 "libguestfs. For examples, see L<guestfs-java(3)>."
33837 #: ../src/guestfs.pod:737
33842 #: ../src/guestfs.pod:739
33843 msgid "See L<guestfs-ocaml(3)>."
33847 #: ../src/guestfs.pod:741
33852 #: ../src/guestfs.pod:743
33853 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
33857 #: ../src/guestfs.pod:745
33862 #: ../src/guestfs.pod:747
33864 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
33865 "the php-libguestfs package for your distribution."
33869 #: ../src/guestfs.pod:750
33870 msgid "The PHP binding only works correctly on 64 bit machines."
33874 #: ../src/guestfs.pod:752
33879 #: ../src/guestfs.pod:754
33880 msgid "See L<guestfs-python(3)>."
33884 #: ../src/guestfs.pod:756
33889 #: ../src/guestfs.pod:758
33890 msgid "See L<guestfs-ruby(3)>."
33894 #: ../src/guestfs.pod:760
33895 msgid "B<shell scripts>"
33899 #: ../src/guestfs.pod:762
33900 msgid "See L<guestfish(1)>."
33904 #: ../src/guestfs.pod:766
33905 msgid "LIBGUESTFS GOTCHAS"
33909 #: ../src/guestfs.pod:768
33911 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
33912 "system [...] that works in the way it is documented but is counterintuitive "
33913 "and almost invites mistakes.\""
33917 #: ../src/guestfs.pod:772
33919 "Since we developed libguestfs and the associated tools, there are several "
33920 "things we would have designed differently, but are now stuck with for "
33921 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
33922 "release, you can expect these to change. Beware of them."
33926 #: ../src/guestfs.pod:780
33927 msgid "Autosync / forgetting to sync."
33931 #: ../src/guestfs.pod:782
33933 "I<Update:> Autosync is enabled by default for all API users starting from "
33934 "libguestfs 1.5.24. This section only applies to older versions."
33938 #: ../src/guestfs.pod:785
33940 "When modifying a filesystem from C or another language, you B<must> unmount "
33941 "all filesystems and call L</guestfs_sync> explicitly before you close the "
33942 "libguestfs handle. You can also call:"
33946 #: ../src/guestfs.pod:789
33949 " guestfs_set_autosync (g, 1);\n"
33954 #: ../src/guestfs.pod:791
33956 "to have the unmount/sync done automatically for you when the handle 'g' is "
33957 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
33962 #: ../src/guestfs.pod:795
33964 "If you forget to do this, then it is entirely possible that your changes "
33965 "won't be written out, or will be partially written, or (very rarely) that "
33966 "you'll get disk corruption."
33970 #: ../src/guestfs.pod:799
33972 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
33973 "guestfish scripts that forget to sync will work just fine, which can make "
33974 "this very puzzling if you are trying to debug a problem."
33978 #: ../src/guestfs.pod:803
33979 msgid "Mount option C<-o sync> should not be the default."
33983 #: ../src/guestfs.pod:805
33985 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
33986 "libguestfs 1.13.16. This section only applies to older versions."
33990 #: ../src/guestfs.pod:808
33992 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
33993 "However C<-o sync> does not add any reliability benefit, but does have a "
33994 "very large performance impact."
33998 #: ../src/guestfs.pod:812
34000 "The work around is to use L</guestfs_mount_options> and set the mount "
34001 "options that you actually want to use."
34005 #: ../src/guestfs.pod:815
34006 msgid "Read-only should be the default."
34010 #: ../src/guestfs.pod:817
34012 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
34013 "specify I<--rw> if you want to make changes to the image."
34017 #: ../src/guestfs.pod:820
34018 msgid "This would reduce the potential to corrupt live VM images."
34022 #: ../src/guestfs.pod:822
34024 "Note that many filesystems change the disk when you just mount and unmount, "
34025 "even if you didn't perform any writes. You need to use "
34026 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
34030 #: ../src/guestfs.pod:826
34031 msgid "guestfish command line is hard to use."
34035 #: ../src/guestfs.pod:828
34037 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
34038 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
34039 "exist, so it fails. In earlier versions of guestfish the error message was "
34040 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
34041 "we should have used C<guestfish -c command> to run commands."
34045 #: ../src/guestfs.pod:835
34046 msgid "guestfish megabyte modifiers don't work right on all commands"
34050 #: ../src/guestfs.pod:837
34052 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
34053 "other modifiers). What guestfish actually does is to multiply the number "
34054 "part by the modifier part and pass the result to the C API. However this "
34055 "doesn't work for a few APIs which aren't expecting bytes, but are already "
34056 "expecting some other unit (eg. megabytes)."
34060 #: ../src/guestfs.pod:844
34061 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
34065 #: ../src/guestfs.pod:846
34068 " lvcreate LV VG 100M\n"
34073 #: ../src/guestfs.pod:848
34075 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
34076 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
34077 "megabytes * megabytes) logical volume. The error message you get from this "
34078 "is also a little obscure."
34082 #: ../src/guestfs.pod:853
34084 "This could be fixed in the generator by specially marking parameters and "
34085 "return values which take bytes or other units."
34089 #: ../src/guestfs.pod:856
34090 msgid "Ambiguity between devices and paths"
34094 #: ../src/guestfs.pod:858
34096 "There is a subtle ambiguity in the API between a device name "
34097 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
34098 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
34102 #: ../src/guestfs.pod:863
34104 "In the current API we usually resolve this ambiguity by having two separate "
34105 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
34106 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
34107 "detecting if the path supplied begins with C</dev/>."
34111 #: ../src/guestfs.pod:869
34113 "To avoid both the ambiguity and the need to duplicate some calls, we could "
34114 "make paths/devices into structured names. One way to do this would be to "
34115 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
34116 "aspect of grub. Another way would be to use a structured type, equivalent "
34117 "to this OCaml type:"
34121 #: ../src/guestfs.pod:875
34124 " type path = Path of string | Device of int | Partition of int * int\n"
34129 #: ../src/guestfs.pod:877
34130 msgid "which would allow you to pass arguments like:"
34134 #: ../src/guestfs.pod:879
34137 " Path \"/foo/bar\"\n"
34138 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
34139 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
34140 " Path \"/dev/sdb2\" (* not a device *)\n"
34145 #: ../src/guestfs.pod:884
34147 "As you can see there are still problems to resolve even with this "
34148 "representation. Also consider how it might work in guestfish."
34152 #: ../src/guestfs.pod:889
34153 msgid "KEYS AND PASSPHRASES"
34157 #: ../src/guestfs.pod:891
34159 "Certain libguestfs calls take a parameter that contains sensitive key "
34160 "material, passed in as a C string."
34164 #: ../src/guestfs.pod:894
34166 "In the future we would hope to change the libguestfs implementation so that "
34167 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
34168 "swap. However this is I<not> done at the moment, because of the complexity "
34169 "of such an implementation."
34173 #: ../src/guestfs.pod:899
34175 "Therefore you should be aware that any key parameter you pass to libguestfs "
34176 "might end up being written out to the swap partition. If this is a concern, "
34177 "scrub the swap partition or don't use libguestfs on encrypted devices."
34181 #: ../src/guestfs.pod:904
34182 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
34186 #: ../src/guestfs.pod:906
34188 "All high-level libguestfs actions are synchronous. If you want to use "
34189 "libguestfs asynchronously then you must create a thread."
34193 #: ../src/guestfs.pod:909
34195 "Only use the handle from a single thread. Either use the handle exclusively "
34196 "from one thread, or provide your own mutex so that two threads cannot issue "
34197 "calls on the same handle at the same time."
34201 #: ../src/guestfs.pod:913
34203 "See the graphical program guestfs-browser for one possible architecture for "
34204 "multithreaded programs using libvirt and libguestfs."
34208 #: ../src/guestfs.pod:916
34213 #: ../src/guestfs.pod:918
34215 "Libguestfs needs a supermin appliance, which it finds by looking along an "
34220 #: ../src/guestfs.pod:921
34222 "By default it looks for these in the directory C<$libdir/guestfs> "
34223 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
34227 #: ../src/guestfs.pod:924
34229 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
34230 "to change the directories that libguestfs will search in. The value is a "
34231 "colon-separated list of paths. The current directory is I<not> searched "
34232 "unless the path contains an empty element or C<.>. For example "
34233 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
34234 "then C</usr/lib/guestfs>."
34238 #: ../src/guestfs.pod:931
34239 msgid "QEMU WRAPPERS"
34243 #: ../src/guestfs.pod:933
34245 "If you want to compile your own qemu, run qemu from a non-standard location, "
34246 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
34251 #: ../src/guestfs.pod:937
34253 "There is one important rule to remember: you I<must C<exec qemu>> as the "
34254 "last command in the shell script (so that qemu replaces the shell and "
34255 "becomes the direct child of the libguestfs-using program). If you don't do "
34256 "this, then the qemu process won't be cleaned up correctly."
34260 #: ../src/guestfs.pod:942
34262 "Here is an example of a wrapper, where I have built my own copy of qemu from "
34267 #: ../src/guestfs.pod:945
34271 " qemudir=/home/rjones/d/qemu\n"
34272 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
34278 #: ../src/guestfs.pod:949
34280 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
34281 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
34286 #: ../src/guestfs.pod:953
34289 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
34294 #: ../src/guestfs.pod:955
34296 "Note that libguestfs also calls qemu with the -help and -version options in "
34297 "order to determine features."
34301 #: ../src/guestfs.pod:958
34303 "Wrappers can also be used to edit the options passed to qemu. In the "
34304 "following example, the C<-machine ...> option (C<-machine> and the following "
34305 "argument) are removed from the command line and replaced with C<-machine "
34306 "pc,accel=tcg>. The while loop iterates over the options until it finds the "
34307 "right one to remove, putting the remaining options into the C<args> array."
34311 #: ../src/guestfs.pod:967
34315 " while [ $# -gt 0 ]; do\n"
34316 " case \"$1\" in\n"
34320 " args[i]=\"$1\"\n"
34329 #: ../src/guestfs.pod:979
34332 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
34337 #: ../src/guestfs.pod:981
34338 msgid "ATTACHING TO RUNNING DAEMONS"
34342 #: ../src/guestfs.pod:983
34344 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
34345 "babies. Use with caution."
34349 #: ../src/guestfs.pod:986
34351 "I<Note (2):> This section explains how to attach to a running daemon from a "
34352 "low level perspective. For most users, simply using virt tools such as "
34353 "L<guestfish(1)> with the I<--live> option will \"just work\"."
34357 #: ../src/guestfs.pod:990
34358 msgid "Using guestfs_set_attach_method"
34362 #: ../src/guestfs.pod:992
34364 "By calling L</guestfs_set_attach_method> you can change how the library "
34365 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
34366 "L</ARCHITECTURE> for some background)."
34370 #: ../src/guestfs.pod:996
34372 "The normal attach method is C<appliance>, where a small appliance is created "
34373 "containing the daemon, and then the library connects to this."
34377 #: ../src/guestfs.pod:999
34379 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
34380 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
34381 "daemon over the Unix domain socket."
34385 #: ../src/guestfs.pod:1003
34387 "The normal use for this is to connect to a running virtual machine that "
34388 "contains a C<guestfsd> daemon, and send commands so you can read and write "
34389 "files inside the live virtual machine."
34393 #: ../src/guestfs.pod:1007
34394 msgid "Using guestfs_add_domain with live flag"
34398 #: ../src/guestfs.pod:1009
34400 "L</guestfs_add_domain> provides some help for getting the correct attach "
34401 "method. If you pass the C<live> option to this function, then (if the "
34402 "virtual machine is running) it will examine the libvirt XML looking for a "
34403 "virtio-serial channel to connect to:"
34407 #: ../src/guestfs.pod:1015
34414 " <channel type='unix'>\n"
34415 " <source mode='bind' path='/path/to/socket'/>\n"
34416 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
34425 #: ../src/guestfs.pod:1027
34427 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
34428 "method to C<unix:/path/to/socket>."
34432 #: ../src/guestfs.pod:1030
34434 "Some of the libguestfs tools (including guestfish) support a I<--live> "
34435 "option which is passed through to L</guestfs_add_domain> thus allowing you "
34436 "to attach to and modify live virtual machines."
34440 #: ../src/guestfs.pod:1034
34442 "The virtual machine needs to have been set up beforehand so that it has the "
34443 "virtio-serial channel and so that guestfsd is running inside it."
34447 #: ../src/guestfs.pod:1038
34448 msgid "ABI GUARANTEE"
34452 #: ../src/guestfs.pod:1040
34454 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
34455 "actions as outlined in this section. Although we will deprecate some "
34456 "actions, for example if they get replaced by newer calls, we will keep the "
34457 "old actions forever. This allows you the developer to program in confidence "
34458 "against the libguestfs API."
34462 #: ../src/guestfs.pod:1046
34463 msgid "BLOCK DEVICE NAMING"
34467 #: ../src/guestfs.pod:1048
34469 "In the kernel there is now quite a profusion of schemata for naming block "
34470 "devices (in this context, by I<block device> I mean a physical or virtual "
34471 "hard drive). The original Linux IDE driver used names starting with "
34472 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
34473 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
34474 "replacement for the old IDE driver (particularly for SATA devices) those "
34475 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
34476 "machines with paravirtualized drivers. This has created several different "
34477 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
34482 #: ../src/guestfs.pod:1060
34484 "As discussed above, libguestfs uses a qemu appliance running an embedded "
34485 "Linux kernel to access block devices. We can run a variety of appliances "
34486 "based on a variety of Linux kernels."
34490 #: ../src/guestfs.pod:1064
34492 "This causes a problem for libguestfs because many API calls use device or "
34493 "partition names. Working scripts and the recipe (example) scripts that we "
34494 "make available over the internet could fail if the naming scheme changes."
34498 #: ../src/guestfs.pod:1069
34500 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
34501 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
34502 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
34503 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
34507 #: ../src/guestfs.pod:1075
34509 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
34510 "L</guestfs_list_partitions> and similar calls return the true names of the "
34511 "devices and partitions as known to the appliance."
34515 #: ../src/guestfs.pod:1080
34516 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
34520 #: ../src/guestfs.pod:1082
34522 "Usually this translation is transparent. However in some (very rare) cases "
34523 "you may need to know the exact algorithm. Such cases include where you use "
34524 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
34525 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
34530 #: ../src/guestfs.pod:1088
34532 "The algorithm is applied only to I<parameters> which are known to be either "
34533 "device or partition names. Return values from functions such as "
34534 "L</guestfs_list_devices> are never changed."
34538 #: ../src/guestfs.pod:1096
34539 msgid "Is the string a parameter which is a device or partition name?"
34543 #: ../src/guestfs.pod:1100
34544 msgid "Does the string begin with C</dev/sd>?"
34548 #: ../src/guestfs.pod:1104
34550 "Does the named device exist? If so, we use that device. However if I<not> "
34551 "then we continue with this algorithm."
34555 #: ../src/guestfs.pod:1109
34556 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
34560 #: ../src/guestfs.pod:1111
34561 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
34565 #: ../src/guestfs.pod:1113
34566 msgid "If that named device exists, use it. If not, continue."
34570 #: ../src/guestfs.pod:1117
34571 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
34575 #: ../src/guestfs.pod:1119
34576 msgid "If that named device exists, use it. If not, return an error."
34580 #: ../src/guestfs.pod:1123
34581 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
34585 #: ../src/guestfs.pod:1125
34587 "Although the standard naming scheme and automatic translation is useful for "
34588 "simple programs and guestfish scripts, for larger programs it is best not to "
34589 "rely on this mechanism."
34593 #: ../src/guestfs.pod:1129
34595 "Where possible for maximum future portability programs using libguestfs "
34596 "should use these future-proof techniques:"
34600 #: ../src/guestfs.pod:1136
34602 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
34603 "device names, and then use those names directly."
34607 #: ../src/guestfs.pod:1139
34608 msgid "Since those device names exist by definition, they will never be translated."
34612 #: ../src/guestfs.pod:1144
34614 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
34615 "filesystem labels."
34619 #: ../src/guestfs.pod:1151
34621 "This section discusses security implications of using libguestfs, "
34622 "particularly with untrusted or malicious guests or disk images."
34626 #: ../src/guestfs.pod:1154
34627 msgid "GENERAL SECURITY CONSIDERATIONS"
34631 #: ../src/guestfs.pod:1156
34633 "Be careful with any files or data that you download from a guest (by "
34634 "\"download\" we mean not just the L</guestfs_download> command but any "
34635 "command that reads files, filenames, directories or anything else from a "
34636 "disk image). An attacker could manipulate the data to fool your program "
34637 "into doing the wrong thing. Consider cases such as:"
34641 #: ../src/guestfs.pod:1166
34642 msgid "the data (file etc) not being present"
34646 #: ../src/guestfs.pod:1170
34647 msgid "being present but empty"
34651 #: ../src/guestfs.pod:1174
34652 msgid "being much larger than normal"
34656 #: ../src/guestfs.pod:1178
34657 msgid "containing arbitrary 8 bit data"
34661 #: ../src/guestfs.pod:1182
34662 msgid "being in an unexpected character encoding"
34666 #: ../src/guestfs.pod:1186
34667 msgid "containing homoglyphs."
34671 #: ../src/guestfs.pod:1190
34672 msgid "SECURITY OF MOUNTING FILESYSTEMS"
34676 #: ../src/guestfs.pod:1192
34678 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
34679 "(VFS) module can sometimes be escalated into exploits by deliberately "
34680 "creating a malicious, malformed filesystem. These exploits are very severe "
34681 "for two reasons. Firstly there are very many filesystem drivers in the "
34682 "kernel, and many of them are infrequently used and not much developer "
34683 "attention has been paid to the code. Linux userspace helps potential "
34684 "crackers by detecting the filesystem type and automatically choosing the "
34685 "right VFS driver, even if that filesystem type is obscure or unexpected for "
34686 "the administrator. Secondly, a kernel-level exploit is like a local root "
34687 "exploit (worse in some ways), giving immediate and total access to the "
34688 "system right down to the hardware level."
34692 #: ../src/guestfs.pod:1205
34694 "That explains why you should never mount a filesystem from an untrusted "
34695 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
34696 "inside a qemu virtual machine, usually running as a non-root user. The "
34697 "attacker would need to write a filesystem which first exploited the kernel, "
34698 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
34699 "the libguestfs protocol, and finally to be as serious as the host kernel "
34700 "exploit it would need to escalate its privileges to root. This multi-step "
34701 "escalation, performed by a static piece of data, is thought to be extremely "
34702 "hard to do, although we never say 'never' about security issues."
34706 #: ../src/guestfs.pod:1216
34708 "In any case callers can reduce the attack surface by forcing the filesystem "
34709 "type when mounting (use L</guestfs_mount_vfs>)."
34713 #: ../src/guestfs.pod:1219
34714 msgid "PROTOCOL SECURITY"
34718 #: ../src/guestfs.pod:1221
34720 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
34721 "defined upper message size. However a program that uses libguestfs must "
34722 "also take care - for example you can write a program that downloads a binary "
34723 "from a disk image and executes it locally, and no amount of protocol "
34724 "security will save you from the consequences."
34728 #: ../src/guestfs.pod:1227
34729 msgid "INSPECTION SECURITY"
34733 #: ../src/guestfs.pod:1229
34735 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
34736 "directly from the guest, and these could contain any 8 bit data. Callers "
34737 "should be careful to escape these before printing them to a structured file "
34738 "(for example, use HTML escaping if creating a web page)."
34742 #: ../src/guestfs.pod:1235
34744 "Guest configuration may be altered in unusual ways by the administrator of "
34745 "the virtual machine, and may not reflect reality (particularly for untrusted "
34746 "or actively malicious guests). For example we parse the hostname from "
34747 "configuration files like C</etc/sysconfig/network> that we find in the "
34748 "guest, but the guest administrator can easily manipulate these files to "
34749 "provide the wrong hostname."
34753 #: ../src/guestfs.pod:1243
34755 "The inspection API parses guest configuration using two external libraries: "
34756 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
34757 "designed to be robust in the face of malicious data, although denial of "
34758 "service attacks are still possible, for example with oversized configuration "
34763 #: ../src/guestfs.pod:1249
34764 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
34768 #: ../src/guestfs.pod:1251
34770 "Be very cautious about running commands from the guest. By running a "
34771 "command in the guest, you are giving CPU time to a binary that you do not "
34772 "control, under the same user account as the library, albeit wrapped in qemu "
34773 "virtualization. More information and alternatives can be found in the "
34774 "section L</RUNNING COMMANDS>."
34778 #: ../src/guestfs.pod:1257
34779 msgid "CVE-2010-3851"
34783 #: ../src/guestfs.pod:1259
34784 msgid "https://bugzilla.redhat.com/642934"
34788 #: ../src/guestfs.pod:1261
34790 "This security bug concerns the automatic disk format detection that qemu "
34791 "does on disk images."
34795 #: ../src/guestfs.pod:1264
34797 "A raw disk image is just the raw bytes, there is no header. Other disk "
34798 "images like qcow2 contain a special header. Qemu deals with this by looking "
34799 "for one of the known headers, and if none is found then assuming the disk "
34800 "image must be raw."
34804 #: ../src/guestfs.pod:1269
34806 "This allows a guest which has been given a raw disk image to write some "
34807 "other header. At next boot (or when the disk image is accessed by "
34808 "libguestfs) qemu would do autodetection and think the disk image format was, "
34809 "say, qcow2 based on the header written by the guest."
34813 #: ../src/guestfs.pod:1274
34815 "This in itself would not be a problem, but qcow2 offers many features, one "
34816 "of which is to allow a disk image to refer to another image (called the "
34817 "\"backing disk\"). It does this by placing the path to the backing disk "
34818 "into the qcow2 header. This path is not validated and could point to any "
34819 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
34820 "\"holes\" in the qcow2 disk image, which of course is completely under the "
34821 "control of the attacker."
34825 #: ../src/guestfs.pod:1282
34826 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
34830 #: ../src/guestfs.pod:1289
34831 msgid "You have enabled the network or have opened the disk in write mode."
34835 #: ../src/guestfs.pod:1293
34837 "You are also running untrusted code from the guest (see L</RUNNING "
34842 #: ../src/guestfs.pod:1298
34844 "The way to avoid this is to specify the expected disk format when adding "
34845 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
34846 "should always do this if the disk is raw format, and it's a good idea for "
34851 #: ../src/guestfs.pod:1303
34853 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
34854 "format is fetched from libvirt and passed through."
34858 #: ../src/guestfs.pod:1306
34860 "For libguestfs tools, use the I<--format> command line parameter as "
34865 #: ../src/guestfs.pod:1309
34866 msgid "CONNECTION MANAGEMENT"
34870 #: ../src/guestfs.pod:1311
34871 msgid "guestfs_h *"
34875 #: ../src/guestfs.pod:1313
34877 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
34878 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
34879 "handle and release all resources used."
34883 #: ../src/guestfs.pod:1317
34885 "For information on using multiple handles and threads, see the section "
34886 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
34890 #: ../src/guestfs.pod:1320
34891 msgid "guestfs_create"
34895 #: ../src/guestfs.pod:1322
34898 " guestfs_h *guestfs_create (void);\n"
34903 #: ../src/guestfs.pod:1324
34904 msgid "Create a connection handle."
34908 #: ../src/guestfs.pod:1326
34910 "On success this returns a non-NULL pointer to a handle. On error it returns "
34915 #: ../src/guestfs.pod:1329
34917 "You have to \"configure\" the handle after creating it. This includes "
34918 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
34919 "handle at least once."
34923 #: ../src/guestfs.pod:1333
34924 msgid "After configuring the handle, you have to call L</guestfs_launch>."
34928 #: ../src/guestfs.pod:1335
34930 "You may also want to configure error handling for the handle. See the "
34931 "L</ERROR HANDLING> section below."
34935 #: ../src/guestfs.pod:1338
34936 msgid "guestfs_close"
34940 #: ../src/guestfs.pod:1340
34943 " void guestfs_close (guestfs_h *g);\n"
34948 #: ../src/guestfs.pod:1342
34949 msgid "This closes the connection handle and frees up all resources used."
34953 #: ../src/guestfs.pod:1344
34955 "If autosync was set on the handle and the handle was launched, then this "
34956 "implicitly calls various functions to unmount filesystems and sync the "
34957 "disk. See L</guestfs_set_autosync> for more details."
34961 #: ../src/guestfs.pod:1348
34962 msgid "If a close callback was set on the handle, then it is called."
34966 #: ../src/guestfs.pod:1350
34967 msgid "ERROR HANDLING"
34971 #: ../src/guestfs.pod:1352
34973 "API functions can return errors. For example, almost all functions that "
34974 "return C<int> will return C<-1> to indicate an error."
34978 #: ../src/guestfs.pod:1355
34980 "Additional information is available for errors: an error message string and "
34981 "optionally an error number (errno) if the thing that failed was a system "
34986 #: ../src/guestfs.pod:1359
34988 "You can get at the additional information about the last error on the handle "
34989 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
34990 "up an error handler with L</guestfs_set_error_handler>."
34994 #: ../src/guestfs.pod:1364
34996 "When the handle is created, a default error handler is installed which "
34997 "prints the error message string to C<stderr>. For small short-running "
34998 "command line programs it is sufficient to do:"
35002 #: ../src/guestfs.pod:1368
35005 " if (guestfs_launch (g) == -1)\n"
35006 " exit (EXIT_FAILURE);\n"
35011 #: ../src/guestfs.pod:1371
35013 "since the default error handler will ensure that an error message has been "
35014 "printed to C<stderr> before the program exits."
35018 #: ../src/guestfs.pod:1374
35020 "For other programs the caller will almost certainly want to install an "
35021 "alternate error handler or do error handling in-line like this:"
35025 #: ../src/guestfs.pod:1377
35028 " /* This disables the default behaviour of printing errors\n"
35030 " guestfs_set_error_handler (g, NULL, NULL);\n"
35035 #: ../src/guestfs.pod:1381
35038 " if (guestfs_launch (g) == -1) {\n"
35039 " /* Examine the error message and print it etc. */\n"
35040 " char *msg = guestfs_last_error (g);\n"
35041 " int errnum = guestfs_last_errno (g);\n"
35042 " fprintf (stderr, \"%s\", msg);\n"
35043 " if (errnum != 0)\n"
35044 " fprintf (stderr, \": %s\", strerror (errnum));\n"
35045 " fprintf (stderr, \"\\n\");\n"
35052 #: ../src/guestfs.pod:1392
35054 "Out of memory errors are handled differently. The default action is to call "
35055 "L<abort(3)>. If this is undesirable, then you can set a handler using "
35056 "L</guestfs_set_out_of_memory_handler>."
35060 #: ../src/guestfs.pod:1396
35062 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
35063 "because there is no handle if this happens there is no way to get additional "
35064 "error information. However L</guestfs_create> is supposed to be a "
35065 "lightweight operation which can only fail because of insufficient memory (it "
35066 "returns NULL in this case)."
35070 #: ../src/guestfs.pod:1402
35071 msgid "guestfs_last_error"
35075 #: ../src/guestfs.pod:1404
35078 " const char *guestfs_last_error (guestfs_h *g);\n"
35083 #: ../src/guestfs.pod:1406
35085 "This returns the last error message that happened on C<g>. If there has not "
35086 "been an error since the handle was created, then this returns C<NULL>."
35090 #: ../src/guestfs.pod:1410
35092 "The lifetime of the returned string is until the next error occurs, or "
35093 "L</guestfs_close> is called."
35097 #: ../src/guestfs.pod:1413
35098 msgid "guestfs_last_errno"
35102 #: ../src/guestfs.pod:1415
35105 " int guestfs_last_errno (guestfs_h *g);\n"
35110 #: ../src/guestfs.pod:1417
35111 msgid "This returns the last error number (errno) that happened on C<g>."
35115 #: ../src/guestfs.pod:1419
35116 msgid "If successful, an errno integer not equal to zero is returned."
35120 #: ../src/guestfs.pod:1421
35121 msgid "If no error, this returns 0. This call can return 0 in three situations:"
35125 #: ../src/guestfs.pod:1428
35126 msgid "There has not been any error on the handle."
35130 #: ../src/guestfs.pod:1432
35132 "There has been an error but the errno was meaningless. This corresponds to "
35133 "the case where the error did not come from a failed system call, but for "
35134 "some other reason."
35138 #: ../src/guestfs.pod:1438
35140 "There was an error from a failed system call, but for some reason the errno "
35141 "was not captured and returned. This usually indicates a bug in libguestfs."
35145 #: ../src/guestfs.pod:1444
35147 "Libguestfs tries to convert the errno from inside the applicance into a "
35148 "corresponding errno for the caller (not entirely trivial: the appliance "
35149 "might be running a completely different operating system from the library "
35150 "and error numbers are not standardized across Un*xen). If this could not be "
35151 "done, then the error is translated to C<EINVAL>. In practice this should "
35152 "only happen in very rare circumstances."
35156 #: ../src/guestfs.pod:1452
35157 msgid "guestfs_set_error_handler"
35161 #: ../src/guestfs.pod:1454
35164 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
35166 " const char *msg);\n"
35167 " void guestfs_set_error_handler (guestfs_h *g,\n"
35168 " guestfs_error_handler_cb cb,\n"
35169 " void *opaque);\n"
35174 #: ../src/guestfs.pod:1461
35176 "The callback C<cb> will be called if there is an error. The parameters "
35177 "passed to the callback are an opaque data pointer and the error message "
35182 #: ../src/guestfs.pod:1465
35184 "C<errno> is not passed to the callback. To get that the callback must call "
35185 "L</guestfs_last_errno>."
35189 #: ../src/guestfs.pod:1468
35191 "Note that the message string C<msg> is freed as soon as the callback "
35192 "function returns, so if you want to stash it somewhere you must make your "
35197 #: ../src/guestfs.pod:1472
35198 msgid "The default handler prints messages on C<stderr>."
35202 #: ../src/guestfs.pod:1474
35203 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
35207 #: ../src/guestfs.pod:1476
35208 msgid "guestfs_get_error_handler"
35212 #: ../src/guestfs.pod:1478
35215 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
35216 " void **opaque_rtn);\n"
35221 #: ../src/guestfs.pod:1481
35222 msgid "Returns the current error handler callback."
35226 #: ../src/guestfs.pod:1483
35227 msgid "guestfs_set_out_of_memory_handler"
35231 #: ../src/guestfs.pod:1485
35234 " typedef void (*guestfs_abort_cb) (void);\n"
35235 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
35236 " guestfs_abort_cb);\n"
35241 #: ../src/guestfs.pod:1489
35243 "The callback C<cb> will be called if there is an out of memory situation. "
35244 "I<Note this callback must not return>."
35248 #: ../src/guestfs.pod:1492
35249 msgid "The default is to call L<abort(3)>."
35253 #: ../src/guestfs.pod:1494
35254 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
35258 #: ../src/guestfs.pod:1497
35259 msgid "guestfs_get_out_of_memory_handler"
35263 #: ../src/guestfs.pod:1499
35266 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
35271 #: ../src/guestfs.pod:1501
35272 msgid "This returns the current out of memory handler."
35276 #: ../src/guestfs.pod:1503
35281 #: ../src/guestfs.pod:1507
35286 #: ../src/guestfs.pod:1509
35291 #: ../src/guestfs.pod:1511
35292 msgid "AVAILABILITY"
35296 #: ../src/guestfs.pod:1513
35297 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
35301 #: ../src/guestfs.pod:1515
35303 "Using L</guestfs_available> you can test availability of the following "
35304 "groups of functions. This test queries the appliance to see if the "
35305 "appliance you are currently using supports the functionality."
35309 #: ../src/guestfs.pod:1520
35310 msgid "@AVAILABILITY@"
35314 #: ../src/guestfs.pod:1522
35315 msgid "GUESTFISH supported COMMAND"
35319 #: ../src/guestfs.pod:1524
35321 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
35322 "prints out the available groups and whether they are supported by this build "
35323 "of libguestfs. Note however that you have to do C<run> first."
35327 #: ../src/guestfs.pod:1529
35328 msgid "SINGLE CALLS AT COMPILE TIME"
35332 #: ../src/guestfs.pod:1531
35334 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
35335 "function, such as:"
35339 #: ../src/guestfs.pod:1534
35342 " #define LIBGUESTFS_HAVE_DD 1\n"
35347 #: ../src/guestfs.pod:1536
35348 msgid "if L</guestfs_dd> is available."
35352 #: ../src/guestfs.pod:1538
35354 "Before version 1.5.8, if you needed to test whether a single libguestfs "
35355 "function is available at compile time, we recommended using build tools such "
35356 "as autoconf or cmake. For example in autotools you could use:"
35360 #: ../src/guestfs.pod:1543
35363 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
35364 " AC_CHECK_FUNCS([guestfs_dd])\n"
35369 #: ../src/guestfs.pod:1546
35371 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
35376 #: ../src/guestfs.pod:1549
35377 msgid "SINGLE CALLS AT RUN TIME"
35381 #: ../src/guestfs.pod:1551
35383 "Testing at compile time doesn't guarantee that a function really exists in "
35384 "the library. The reason is that you might be dynamically linked against a "
35385 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
35386 "This situation unfortunately results in a segmentation fault, which is a "
35387 "shortcoming of the C dynamic linking system itself."
35391 #: ../src/guestfs.pod:1558
35393 "You can use L<dlopen(3)> to test if a function is available at run time, as "
35394 "in this example program (note that you still need the compile time check as "
35399 #: ../src/guestfs.pod:1562
35402 " #include <stdio.h>\n"
35403 " #include <stdlib.h>\n"
35404 " #include <unistd.h>\n"
35405 " #include <dlfcn.h>\n"
35406 " #include <guestfs.h>\n"
35411 #: ../src/guestfs.pod:1568
35416 " #ifdef LIBGUESTFS_HAVE_DD\n"
35418 " int has_function;\n"
35423 #: ../src/guestfs.pod:1574
35426 " /* Test if the function guestfs_dd is really available. */\n"
35427 " dl = dlopen (NULL, RTLD_LAZY);\n"
35429 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
35430 " exit (EXIT_FAILURE);\n"
35432 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
35438 #: ../src/guestfs.pod:1583
35441 " if (!has_function)\n"
35442 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
35444 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
35445 " /* Now it's safe to call\n"
35446 " guestfs_dd (g, \"foo\", \"bar\");\n"
35450 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
35457 #: ../src/guestfs.pod:1596
35459 "You may think the above is an awful lot of hassle, and it is. There are "
35460 "other ways outside of the C linking system to ensure that this kind of "
35461 "incompatibility never arises, such as using package versioning:"
35465 #: ../src/guestfs.pod:1601
35468 " Requires: libguestfs >= 1.0.80\n"
35473 #: ../src/guestfs.pod:1603
35474 msgid "CALLS WITH OPTIONAL ARGUMENTS"
35478 #: ../src/guestfs.pod:1605
35480 "A recent feature of the API is the introduction of calls which take optional "
35481 "arguments. In C these are declared 3 ways. The main way is as a call which "
35482 "takes variable arguments (ie. C<...>), as in this example:"
35486 #: ../src/guestfs.pod:1610
35489 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
35494 #: ../src/guestfs.pod:1612
35496 "Call this with a list of optional arguments, terminated by C<-1>. So to "
35497 "call with no optional arguments specified:"
35501 #: ../src/guestfs.pod:1615
35504 " guestfs_add_drive_opts (g, filename, -1);\n"
35509 #: ../src/guestfs.pod:1617
35510 msgid "With a single optional argument:"
35514 #: ../src/guestfs.pod:1619
35517 " guestfs_add_drive_opts (g, filename,\n"
35518 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35524 #: ../src/guestfs.pod:1623
35529 #: ../src/guestfs.pod:1625
35532 " guestfs_add_drive_opts (g, filename,\n"
35533 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35534 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
35540 #: ../src/guestfs.pod:1630
35542 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
35547 #: ../src/guestfs.pod:1633
35548 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
35552 #: ../src/guestfs.pod:1635
35554 "The second variant has the same name with the suffix C<_va>, which works the "
35555 "same way but takes a C<va_list>. See the C manual for details. For the "
35556 "example function, this is declared:"
35560 #: ../src/guestfs.pod:1639
35563 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
35564 " va_list args);\n"
35569 #: ../src/guestfs.pod:1642
35570 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
35574 #: ../src/guestfs.pod:1644
35576 "The third variant is useful where you need to construct these calls. You "
35577 "pass in a structure where you fill in the optional fields. The structure "
35578 "has a bitmask as the first element which you must set to indicate which "
35579 "fields you have filled in. For our example function the structure and call "
35584 #: ../src/guestfs.pod:1650
35587 " struct guestfs_add_drive_opts_argv {\n"
35588 " uint64_t bitmask;\n"
35590 " const char *format;\n"
35593 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
35594 " const struct guestfs_add_drive_opts_argv *optargs);\n"
35599 #: ../src/guestfs.pod:1659
35600 msgid "You could call it like this:"
35604 #: ../src/guestfs.pod:1661
35607 " struct guestfs_add_drive_opts_argv optargs = {\n"
35608 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
35609 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
35610 " .readonly = 1,\n"
35611 " .format = \"qcow2\"\n"
35617 #: ../src/guestfs.pod:1668
35620 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
35625 #: ../src/guestfs.pod:1676
35626 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
35630 #: ../src/guestfs.pod:1681
35631 msgid "You do not need to fill in all fields of the structure."
35635 #: ../src/guestfs.pod:1685
35637 "There must be a one-to-one correspondence between fields of the structure "
35638 "that are filled in, and bits set in the bitmask."
35642 #: ../src/guestfs.pod:1690
35643 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
35647 #: ../src/guestfs.pod:1692
35649 "In other languages, optional arguments are expressed in the way that is "
35650 "natural for that language. We refer you to the language-specific "
35651 "documentation for more details on that."
35655 #: ../src/guestfs.pod:1696
35656 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
35660 #: ../src/guestfs.pod:1698
35661 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
35665 #: ../src/guestfs.pod:1700
35667 "B<Note:> This section documents the generic event mechanism introduced in "
35668 "libguestfs 1.10, which you should use in new code if possible. The old "
35669 "functions C<guestfs_set_log_message_callback>, "
35670 "C<guestfs_set_subprocess_quit_callback>, "
35671 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
35672 "C<guestfs_set_progress_callback> are no longer documented in this manual "
35673 "page. Because of the ABI guarantee, the old functions continue to work."
35677 #: ../src/guestfs.pod:1709
35679 "Handles generate events when certain things happen, such as log messages "
35680 "being generated, progress messages during long-running operations, or the "
35681 "handle being closed. The API calls described below let you register a "
35682 "callback to be called when events happen. You can register multiple "
35683 "callbacks (for the same, different or overlapping sets of events), and "
35684 "individually remove callbacks. If callbacks are not removed, then they "
35685 "remain in force until the handle is closed."
35689 #: ../src/guestfs.pod:1717
35691 "In the current implementation, events are only generated synchronously: that "
35692 "means that events (and hence callbacks) can only happen while you are in the "
35693 "middle of making another libguestfs call. The callback is called in the "
35698 #: ../src/guestfs.pod:1722
35700 "Events may contain a payload, usually nothing (void), an array of 64 bit "
35701 "unsigned integers, or a message buffer. Payloads are discussed later on."
35705 #: ../src/guestfs.pod:1726
35706 msgid "CLASSES OF EVENTS"
35710 #: ../src/guestfs.pod:1730
35711 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
35715 #: ../src/guestfs.pod:1733
35717 "The callback function will be called while the handle is being closed "
35718 "(synchronously from L</guestfs_close>)."
35722 #: ../src/guestfs.pod:1736
35724 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
35725 "handles that are open when the program exits. This means that this callback "
35726 "might be called indirectly from L<exit(3)>, which can cause unexpected "
35727 "problems in higher-level languages (eg. if your HLL interpreter has already "
35728 "been cleaned up by the time this is called, and if your callback then jumps "
35729 "into some HLL function)."
35733 #: ../src/guestfs.pod:1743
35735 "If no callback is registered: the handle is closed without any callback "
35740 #: ../src/guestfs.pod:1746
35741 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
35745 #: ../src/guestfs.pod:1749
35747 "The callback function will be called when the child process quits, either "
35748 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
35749 "corresponds to a transition from any state to the CONFIG state)."
35753 #: ../src/guestfs.pod:1753 ../src/guestfs.pod:1762 ../src/guestfs.pod:1879
35754 msgid "If no callback is registered: the event is ignored."
35758 #: ../src/guestfs.pod:1755
35759 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
35763 #: ../src/guestfs.pod:1758
35765 "The callback function will be called when the child process becomes ready "
35766 "first time after it has been launched. (This corresponds to a transition "
35767 "from LAUNCHING to the READY state)."
35771 #: ../src/guestfs.pod:1764
35772 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
35776 #: ../src/guestfs.pod:1767
35778 "Some long-running operations can generate progress messages. If this "
35779 "callback is registered, then it will be called each time a progress message "
35780 "is generated (usually two seconds after the operation started, and three "
35781 "times per second thereafter until it completes, although the frequency may "
35782 "change in future versions)."
35786 #: ../src/guestfs.pod:1773
35788 "The callback receives in the payload four unsigned 64 bit numbers which are "
35789 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
35793 #: ../src/guestfs.pod:1776
35795 "The units of C<total> are not defined, although for some operations C<total> "
35796 "may relate in some way to the amount of data to be transferred (eg. in bytes "
35797 "or megabytes), and C<position> may be the portion which has been "
35802 #: ../src/guestfs.pod:1781
35803 msgid "The only defined and stable parts of the API are:"
35807 #: ../src/guestfs.pod:1787
35809 "The callback can display to the user some type of progress bar or indicator "
35810 "which shows the ratio of C<position>:C<total>."
35814 #: ../src/guestfs.pod:1792
35815 msgid "0 E<lt>= C<position> E<lt>= C<total>"
35819 #: ../src/guestfs.pod:1796
35821 "If any progress notification is sent during a call, then a final progress "
35822 "notification is always sent when C<position> = C<total> (I<unless> the call "
35823 "fails with an error)."
35827 #: ../src/guestfs.pod:1800
35829 "This is to simplify caller code, so callers can easily set the progress "
35830 "indicator to \"100%\" at the end of the operation, without requiring special "
35831 "code to detect this case."
35835 #: ../src/guestfs.pod:1806
35837 "For some calls we are unable to estimate the progress of the call, but we "
35838 "can still generate progress messages to indicate activity. This is known as "
35839 "\"pulse mode\", and is directly supported by certain progress bar "
35840 "implementations (eg. GtkProgressBar)."
35844 #: ../src/guestfs.pod:1811
35846 "For these calls, zero or more progress messages are generated with "
35847 "C<position = 0> and C<total = 1>, followed by a final message with "
35848 "C<position = total = 1>."
35852 #: ../src/guestfs.pod:1815
35854 "As noted above, if the call fails with an error then the final message may "
35855 "not be generated."
35859 #: ../src/guestfs.pod:1820
35861 "The callback also receives the procedure number (C<proc_nr>) and serial "
35862 "number (C<serial>) of the call. These are only useful for debugging "
35863 "protocol issues, and the callback can normally ignore them. The callback "
35864 "may want to print these numbers in error messages or debugging messages."
35868 #: ../src/guestfs.pod:1826
35869 msgid "If no callback is registered: progress messages are discarded."
35873 #: ../src/guestfs.pod:1828
35874 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
35878 #: ../src/guestfs.pod:1831
35880 "The callback function is called whenever a log message is generated by qemu, "
35881 "the appliance kernel, guestfsd (daemon), or utility programs."
35885 #: ../src/guestfs.pod:1834
35887 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
35888 "(L</guestfs_launch>) then additional debug messages are generated."
35892 #: ../src/guestfs.pod:1837 ../src/guestfs.pod:1851
35894 "If no callback is registered: the messages are discarded unless the verbose "
35895 "flag is set in which case they are sent to stderr. You can override the "
35896 "printing of verbose messages to stderr by setting up a callback."
35900 #: ../src/guestfs.pod:1842
35901 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
35905 #: ../src/guestfs.pod:1845
35907 "The callback function is called whenever a log message is generated by the "
35908 "library part of libguestfs."
35912 #: ../src/guestfs.pod:1848
35914 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
35915 "messages are generated."
35919 #: ../src/guestfs.pod:1856
35920 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
35924 #: ../src/guestfs.pod:1859
35926 "The callback function is called whenever a trace message is generated. This "
35927 "only applies if the trace flag (L</guestfs_set_trace>) is set."
35931 #: ../src/guestfs.pod:1862
35933 "If no callback is registered: the messages are sent to stderr. You can "
35934 "override the printing of trace messages to stderr by setting up a callback."
35938 #: ../src/guestfs.pod:1866
35939 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
35943 #: ../src/guestfs.pod:1869
35944 msgid "The callback function is called whenever a libguestfs function is entered."
35948 #: ../src/guestfs.pod:1872
35950 "The payload is a string which contains the name of the function that we are "
35951 "entering (not including C<guestfs_> prefix)."
35955 #: ../src/guestfs.pod:1875
35957 "Note that libguestfs functions can call themselves, so you may see many "
35958 "events from a single call. A few libguestfs functions do not generate this "
35963 #: ../src/guestfs.pod:1883
35964 msgid "guestfs_set_event_callback"
35968 #: ../src/guestfs.pod:1885
35971 " int guestfs_set_event_callback (guestfs_h *g,\n"
35972 " guestfs_event_callback cb,\n"
35973 " uint64_t event_bitmask,\n"
35975 " void *opaque);\n"
35980 #: ../src/guestfs.pod:1891
35982 "This function registers a callback (C<cb>) for all event classes in the "
35983 "C<event_bitmask>."
35987 #: ../src/guestfs.pod:1894
35989 "For example, to register for all log message events, you could call this "
35990 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
35991 "To register a single callback for all possible classes of events, use "
35992 "C<GUESTFS_EVENT_ALL>."
35996 #: ../src/guestfs.pod:1900
35997 msgid "C<flags> should always be passed as 0."
36001 #: ../src/guestfs.pod:1902
36003 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
36004 "it for any purpose."
36008 #: ../src/guestfs.pod:1905
36010 "The return value is the event handle (an integer) which you can use to "
36011 "delete the callback (see below)."
36015 #: ../src/guestfs.pod:1908
36017 "If there is an error, this function returns C<-1>, and sets the error in the "
36018 "handle in the usual way (see L</guestfs_last_error> etc.)"
36022 #: ../src/guestfs.pod:1911
36024 "Callbacks remain in effect until they are deleted, or until the handle is "
36029 #: ../src/guestfs.pod:1914
36031 "In the case where multiple callbacks are registered for a particular event "
36032 "class, all of the callbacks are called. The order in which multiple "
36033 "callbacks are called is not defined."
36037 #: ../src/guestfs.pod:1918
36038 msgid "guestfs_delete_event_callback"
36042 #: ../src/guestfs.pod:1920
36045 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
36050 #: ../src/guestfs.pod:1922
36052 "Delete a callback that was previously registered. C<event_handle> should be "
36053 "the integer that was returned by a previous call to "
36054 "C<guestfs_set_event_callback> on the same handle."
36058 #: ../src/guestfs.pod:1926
36059 msgid "guestfs_event_callback"
36063 #: ../src/guestfs.pod:1928
36066 " typedef void (*guestfs_event_callback) (\n"
36069 " uint64_t event,\n"
36070 " int event_handle,\n"
36072 " const char *buf, size_t buf_len,\n"
36073 " const uint64_t *array, size_t array_len);\n"
36078 #: ../src/guestfs.pod:1937
36079 msgid "This is the type of the event callback function that you have to provide."
36083 #: ../src/guestfs.pod:1940
36085 "The basic parameters are: the handle (C<g>), the opaque user pointer "
36086 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
36087 "handle, and C<flags> which in the current API you should ignore."
36091 #: ../src/guestfs.pod:1944
36093 "The remaining parameters contain the event payload (if any). Each event may "
36094 "contain a payload, which usually relates to the event class, but for future "
36095 "proofing your code should be written to handle any payload for any event "
36100 #: ../src/guestfs.pod:1949
36102 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
36103 "there is no message buffer). Note that this message buffer can contain "
36104 "arbitrary 8 bit data, including NUL bytes."
36108 #: ../src/guestfs.pod:1953
36110 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
36111 "moment this is only used for progress messages."
36115 #: ../src/guestfs.pod:1956
36116 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
36120 #: ../src/guestfs.pod:1958
36122 "One motivation for the generic event API was to allow GUI programs to "
36123 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
36124 "unconditionally to C<stderr>."
36128 #: ../src/guestfs.pod:1962
36130 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
36131 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
36132 "messages are not events; you must capture error messages separately)."
36136 #: ../src/guestfs.pod:1967
36138 "Programs have to set up a callback to capture the classes of events of "
36143 #: ../src/guestfs.pod:1970
36147 " guestfs_set_event_callback\n"
36148 " (g, message_callback,\n"
36149 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
36150 " GUESTFS_EVENT_TRACE,\n"
36151 " 0, NULL) == -1)\n"
36152 " if (eh == -1) {\n"
36153 " // handle error in the usual way\n"
36159 #: ../src/guestfs.pod:1980
36161 "The callback can then direct messages to the appropriate place. In this "
36162 "example, messages are directed to syslog:"
36166 #: ../src/guestfs.pod:1983
36170 " message_callback (\n"
36173 " uint64_t event,\n"
36174 " int event_handle,\n"
36176 " const char *buf, size_t buf_len,\n"
36177 " const uint64_t *array, size_t array_len)\n"
36179 " const int priority = LOG_USER|LOG_INFO;\n"
36180 " if (buf_len > 0)\n"
36181 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
36187 #: ../src/guestfs.pod:1998
36188 msgid "CANCELLING LONG TRANSFERS"
36192 #: ../src/guestfs.pod:2000
36194 "Some operations can be cancelled by the caller while they are in progress. "
36195 "Currently only operations that involve uploading or downloading data can be "
36196 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
36197 "parameters in the generator)."
36201 #: ../src/guestfs.pod:2005
36202 msgid "guestfs_user_cancel"
36206 #: ../src/guestfs.pod:2007
36209 " void guestfs_user_cancel (guestfs_h *g);\n"
36214 #: ../src/guestfs.pod:2009
36215 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
36219 #: ../src/guestfs.pod:2012
36221 "Unlike most other libguestfs calls, this function is signal safe and thread "
36222 "safe. You can call it from a signal handler or from another thread, without "
36223 "needing to do any locking."
36227 #: ../src/guestfs.pod:2016
36229 "The transfer that was in progress (if there is one) will stop shortly "
36230 "afterwards, and will return an error. The errno (see "
36231 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
36232 "out if the operation was cancelled or failed because of another error."
36236 #: ../src/guestfs.pod:2022
36238 "No cleanup is performed: for example, if a file was being uploaded then "
36239 "after cancellation there may be a partially uploaded file. It is the "
36240 "caller's responsibility to clean up if necessary."
36244 #: ../src/guestfs.pod:2026
36245 msgid "There are two common places that you might call C<guestfs_user_cancel>."
36249 #: ../src/guestfs.pod:2028
36251 "In an interactive text-based program, you might call it from a C<SIGINT> "
36252 "signal handler so that pressing C<^C> cancels the current operation. (You "
36253 "also need to call L</guestfs_set_pgroup> so that child processes don't "
36254 "receive the C<^C> signal)."
36258 #: ../src/guestfs.pod:2033
36260 "In a graphical program, when the main thread is displaying a progress bar "
36261 "with a cancel button, wire up the cancel button to call this function."
36265 #: ../src/guestfs.pod:2037
36266 msgid "PRIVATE DATA AREA"
36270 #: ../src/guestfs.pod:2039
36272 "You can attach named pieces of private data to the libguestfs handle, fetch "
36273 "them by name, and walk over them, for the lifetime of the handle. This is "
36274 "called the private data area and is only available from the C API."
36278 #: ../src/guestfs.pod:2044
36279 msgid "To attach a named piece of data, use the following call:"
36283 #: ../src/guestfs.pod:2046
36286 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
36291 #: ../src/guestfs.pod:2048
36293 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
36294 "pointer (which can be C<NULL>). Any previous item with the same key is "
36299 #: ../src/guestfs.pod:2052
36301 "You can use any C<key> you want, but your key should I<not> start with an "
36302 "underscore character. Keys beginning with an underscore character are "
36303 "reserved for internal libguestfs purposes (eg. for implementing language "
36304 "bindings). It is recommended that you prefix the key with some unique "
36305 "string to avoid collisions with other users."
36309 #: ../src/guestfs.pod:2058
36310 msgid "To retrieve the pointer, use:"
36314 #: ../src/guestfs.pod:2060
36317 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
36322 #: ../src/guestfs.pod:2062
36324 "This function returns C<NULL> if either no data is found associated with "
36325 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
36330 #: ../src/guestfs.pod:2066
36332 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
36333 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
36334 "all. In particular, libguestfs does I<not> try to free the data when the "
36335 "handle is closed. If the data must be freed, then the caller must either "
36336 "free it before calling L</guestfs_close> or must set up a close callback to "
36337 "do it (see L</GUESTFS_EVENT_CLOSE>)."
36341 #: ../src/guestfs.pod:2073
36342 msgid "To walk over all entries, use these two functions:"
36346 #: ../src/guestfs.pod:2075
36349 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
36354 #: ../src/guestfs.pod:2077
36357 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
36362 #: ../src/guestfs.pod:2079
36364 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
36365 "not have any particular meaning -- keys are not returned in any defined "
36366 "order). A pointer to the key is returned in C<*key_rtn> and the "
36367 "corresponding data pointer is returned from the function. C<NULL> is "
36368 "returned if there are no keys stored in the handle."
36372 #: ../src/guestfs.pod:2085
36374 "C<guestfs_next_private> returns the next key, pointer pair. The return "
36375 "value of this function is also C<NULL> is there are no further entries to "
36380 #: ../src/guestfs.pod:2089
36381 msgid "Notes about walking over entries:"
36385 #: ../src/guestfs.pod:2095
36386 msgid "You must not call C<guestfs_set_private> while walking over the entries."
36390 #: ../src/guestfs.pod:2100
36392 "The handle maintains an internal iterator which is reset when you call "
36393 "C<guestfs_first_private>. This internal iterator is invalidated when you "
36394 "call C<guestfs_set_private>."
36398 #: ../src/guestfs.pod:2106
36399 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
36403 #: ../src/guestfs.pod:2108
36406 " guestfs_set_private (g, key, NULL);\n"
36411 #: ../src/guestfs.pod:2110
36412 msgid "then that C<key> is not returned when walking."
36416 #: ../src/guestfs.pod:2114
36418 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
36419 "C<guestfs_next_private> or C<guestfs_set_private>."
36423 #: ../src/guestfs.pod:2120
36425 "The following example code shows how to print all keys and data pointers "
36426 "that are associated with the handle C<g>:"
36430 #: ../src/guestfs.pod:2123
36433 " const char *key;\n"
36434 " void *data = guestfs_first_private (g, &key);\n"
36435 " while (data != NULL)\n"
36437 " printf (\"key = %s, data = %p\\n\", key, data);\n"
36438 " data = guestfs_next_private (g, &key);\n"
36444 #: ../src/guestfs.pod:2131
36446 "More commonly you are only interested in keys that begin with an "
36447 "application-specific prefix C<foo_>. Modify the loop like so:"
36451 #: ../src/guestfs.pod:2134
36454 " const char *key;\n"
36455 " void *data = guestfs_first_private (g, &key);\n"
36456 " while (data != NULL)\n"
36458 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
36459 " printf (\"key = %s, data = %p\\n\", key, data);\n"
36460 " data = guestfs_next_private (g, &key);\n"
36466 #: ../src/guestfs.pod:2143
36468 "If you need to modify keys while walking, then you have to jump back to the "
36469 "beginning of the loop. For example, to delete all keys prefixed with "
36474 #: ../src/guestfs.pod:2147
36477 " const char *key;\n"
36480 " data = guestfs_first_private (g, &key);\n"
36481 " while (data != NULL)\n"
36483 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
36485 " guestfs_set_private (g, key, NULL);\n"
36486 " /* note that 'key' pointer is now invalid, and so is\n"
36487 " the internal iterator */\n"
36490 " data = guestfs_next_private (g, &key);\n"
36496 #: ../src/guestfs.pod:2163
36498 "Note that the above loop is guaranteed to terminate because the keys are "
36499 "being deleted, but other manipulations of keys within the loop might not "
36500 "terminate unless you also maintain an indication of which keys have been "
36505 #: ../src/guestfs.pod:2168
36510 #: ../src/guestfs.pod:2170
36512 "The libguestfs C library can be probed using systemtap or DTrace. This is "
36513 "true of any library, not just libguestfs. However libguestfs also contains "
36514 "static markers to help in probing internal operations."
36518 #: ../src/guestfs.pod:2174
36519 msgid "You can list all the static markers by doing:"
36523 #: ../src/guestfs.pod:2176
36526 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
36527 " .provider(\"guestfs\").mark(\"*\")'\n"
36532 #: ../src/guestfs.pod:2179
36534 "B<Note:> These static markers are I<not> part of the stable API and may "
36535 "change in future versions."
36539 #: ../src/guestfs.pod:2182
36540 msgid "SYSTEMTAP SCRIPT EXAMPLE"
36544 #: ../src/guestfs.pod:2184
36546 "This script contains examples of displaying both the static markers and some "
36547 "ordinary C entry points:"
36551 #: ../src/guestfs.pod:2187
36559 #: ../src/guestfs.pod:2189
36562 " function display_time () {\n"
36563 " now = gettimeofday_us ();\n"
36566 " delta = now - last;\n"
36572 #: ../src/guestfs.pod:2196
36575 " printf (\"%d (+%d):\", now, delta);\n"
36581 #: ../src/guestfs.pod:2199
36586 " printf (\"ready\\n\");\n"
36592 #: ../src/guestfs.pod:2204
36595 " /* Display all calls to static markers. */\n"
36596 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
36597 " .provider(\"guestfs\").mark(\"*\") ? {\n"
36598 " display_time();\n"
36599 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
36605 #: ../src/guestfs.pod:2211
36608 " /* Display all calls to guestfs_mkfs* functions. */\n"
36609 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
36610 " .function(\"guestfs_mkfs*\") ? {\n"
36611 " display_time();\n"
36612 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
36618 #: ../src/guestfs.pod:2218
36620 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
36621 "program. Note that you either have to be root, or you have to add yourself "
36622 "to several special stap groups. Consult the systemtap documentation for "
36623 "more information."
36627 #: ../src/guestfs.pod:2223
36630 " # stap /tmp/test.stap\n"
36636 #: ../src/guestfs.pod:2226
36637 msgid "In another terminal, run a guestfish command such as this:"
36641 #: ../src/guestfs.pod:2230
36642 msgid "In the first terminal, stap trace output similar to this is shown:"
36646 #: ../src/guestfs.pod:2232
36649 " 1318248056692655 (+0):\tlaunch_start\n"
36650 " 1318248056692850 (+195): launch_build_appliance_start\n"
36651 " 1318248056818285 (+125435): launch_build_appliance_end\n"
36652 " 1318248056838059 (+19774): launch_run_qemu\n"
36653 " 1318248061071167 (+4233108): launch_end\n"
36654 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f "
36655 "device=0x1024e60\n"
36660 #: ../src/guestfs.pod:2239 ../src/guestfs.pod:2244
36665 #: ../src/guestfs.pod:2241
36667 "<!-- old anchor for the next section --> <a "
36668 "name=\"state_machine_and_low_level_event_api\"/>"
36672 #: ../src/guestfs.pod:2246
36673 msgid "ARCHITECTURE"
36677 #: ../src/guestfs.pod:2248
36679 "Internally, libguestfs is implemented by running an appliance (a special "
36680 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
36681 "process of the main program."
36685 #: ../src/guestfs.pod:2252
36688 " ___________________\n"
36690 " | main program |\n"
36692 " | | child process / appliance\n"
36693 " | | __________________________\n"
36695 " +-------------------+ RPC | +-----------------+ |\n"
36696 " | libguestfs <--------------------> guestfsd | |\n"
36697 " | | | +-----------------+ |\n"
36698 " \\___________________/ | | Linux kernel | |\n"
36699 " | +--^--------------+ |\n"
36700 " \\_________|________________/\n"
36702 " _______v______\n"
36705 " | disk image |\n"
36706 " \\______________/\n"
36711 #: ../src/guestfs.pod:2272
36713 "The library, linked to the main program, creates the child process and hence "
36714 "the appliance in the L</guestfs_launch> function."
36718 #: ../src/guestfs.pod:2275
36720 "Inside the appliance is a Linux kernel and a complete stack of userspace "
36721 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
36722 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
36723 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
36724 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
36725 "attached to the qemu process which translates device access by the "
36726 "appliance's Linux kernel into accesses to the image."
36730 #: ../src/guestfs.pod:2284
36732 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
36733 "Although the disk image you are attached to might also be used by some "
36734 "virtual machine, libguestfs doesn't know or care about this. (But you will "
36735 "care if both libguestfs's qemu process and your virtual machine are trying "
36736 "to update the disk image at the same time, since these usually results in "
36737 "massive disk corruption)."
36741 #: ../src/guestfs.pod:2291
36742 msgid "STATE MACHINE"
36746 #: ../src/guestfs.pod:2293
36747 msgid "libguestfs uses a state machine to model the child process:"
36751 #: ../src/guestfs.pod:2295
36755 " guestfs_create\n"
36763 " / | \\ \\ guestfs_launch\n"
36764 " / | _\\__V______\n"
36766 " / | | LAUNCHING |\n"
36767 " / | \\___________/\n"
36769 " / | guestfs_launch\n"
36771 " ______ / __|____V\n"
36772 " / \\ ------> / \\\n"
36773 " | BUSY | | READY |\n"
36774 " \\______/ <------ \\________/\n"
36779 #: ../src/guestfs.pod:2317
36781 "The normal transitions are (1) CONFIG (when the handle is created, but there "
36782 "is no child process), (2) LAUNCHING (when the child process is booting up), "
36783 "(3) alternating between READY and BUSY as commands are issued to, and "
36784 "carried out by, the child process."
36788 #: ../src/guestfs.pod:2322
36790 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
36791 "asynchronously at any time (eg. due to some internal error), and that causes "
36792 "the state to transition back to CONFIG."
36796 #: ../src/guestfs.pod:2326
36798 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
36799 "issued when in the CONFIG state."
36803 #: ../src/guestfs.pod:2329
36805 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
36806 "L</guestfs_launch> blocks until the child process is READY to accept "
36807 "commands (or until some failure or timeout). L</guestfs_launch> internally "
36808 "moves the state from CONFIG to LAUNCHING while it is running."
36812 #: ../src/guestfs.pod:2335
36814 "API actions such as L</guestfs_mount> can only be issued when in the READY "
36815 "state. These API calls block waiting for the command to be carried out "
36816 "(ie. the state to transition to BUSY and then back to READY). There are no "
36817 "non-blocking versions, and no way to issue more than one command per handle "
36818 "at the same time."
36822 #: ../src/guestfs.pod:2341
36824 "Finally, the child process sends asynchronous messages back to the main "
36825 "program, such as kernel log messages. You can register a callback to "
36826 "receive these messages."
36830 #: ../src/guestfs.pod:2345
36835 #: ../src/guestfs.pod:2347
36836 msgid "APPLIANCE BOOT PROCESS"
36840 #: ../src/guestfs.pod:2349
36842 "This process has evolved and continues to evolve. The description here "
36843 "corresponds only to the current version of libguestfs and is provided for "
36844 "information only."
36848 #: ../src/guestfs.pod:2353
36850 "In order to follow the stages involved below, enable libguestfs debugging "
36851 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
36855 #: ../src/guestfs.pod:2358
36856 msgid "Create the appliance"
36860 #: ../src/guestfs.pod:2360
36862 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
36863 "initrd and the appliance."
36867 #: ../src/guestfs.pod:2363
36869 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
36870 "directory if C<TMPDIR> is set)."
36874 #: ../src/guestfs.pod:2366
36876 "For a complete description of how the appliance is created and cached, read "
36877 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
36881 #: ../src/guestfs.pod:2370
36882 msgid "Start qemu and boot the kernel"
36886 #: ../src/guestfs.pod:2372
36887 msgid "qemu is invoked to boot the kernel."
36891 #: ../src/guestfs.pod:2374
36892 msgid "Run the initrd"
36896 #: ../src/guestfs.pod:2376
36898 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
36899 "appliance. The purpose of the initrd is to load enough kernel modules in "
36900 "order that the appliance itself can be mounted and started."
36904 #: ../src/guestfs.pod:2380
36906 "The initrd is a cpio archive called "
36907 "C</var/tmp/.guestfs-E<lt>UIDE<gt>/initrd>."
36911 #: ../src/guestfs.pod:2383
36913 "When the initrd has started you will see messages showing that kernel "
36914 "modules are being loaded, similar to this:"
36918 #: ../src/guestfs.pod:2386
36921 " febootstrap: ext2 mini initrd starting up\n"
36922 " febootstrap: mounting /sys\n"
36923 " febootstrap: internal insmod libcrc32c.ko\n"
36924 " febootstrap: internal insmod crc32c-intel.ko\n"
36929 #: ../src/guestfs.pod:2391
36930 msgid "Find and mount the appliance device"
36934 #: ../src/guestfs.pod:2393
36936 "The appliance is a sparse file containing an ext2 filesystem which contains "
36937 "a familiar (although reduced in size) Linux operating system. It would "
36938 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
36942 #: ../src/guestfs.pod:2397
36944 "The regular disks being inspected by libguestfs are the first devices "
36945 "exposed by qemu (eg. as C</dev/vda>)."
36949 #: ../src/guestfs.pod:2400
36951 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
36952 "there was only one regular disk)."
36956 #: ../src/guestfs.pod:2403
36958 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
36959 "and switch root into the appliance, and run C</init> from the appliance."
36963 #: ../src/guestfs.pod:2407
36964 msgid "If this works successfully you will see messages such as:"
36968 #: ../src/guestfs.pod:2409
36971 " febootstrap: picked /sys/block/vdb/dev as root device\n"
36972 " febootstrap: creating /dev/root as block special 252:16\n"
36973 " febootstrap: mounting new root on /root\n"
36974 " febootstrap: chroot\n"
36975 " Starting /init script ...\n"
36980 #: ../src/guestfs.pod:2415
36982 "Note that C<Starting /init script ...> indicates that the appliance's init "
36983 "script is now running."
36987 #: ../src/guestfs.pod:2418
36988 msgid "Initialize the appliance"
36992 #: ../src/guestfs.pod:2420
36994 "The appliance itself now initializes itself. This involves starting certain "
36995 "processes like C<udev>, possibly printing some debug information, and "
36996 "finally running the daemon (C<guestfsd>)."
37000 #: ../src/guestfs.pod:2424
37005 #: ../src/guestfs.pod:2426
37007 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
37012 #: ../src/guestfs.pod:2429
37015 " verbose daemon enabled\n"
37020 #: ../src/guestfs.pod:2431
37022 "The daemon expects to see a named virtio-serial port exposed by qemu and "
37023 "connected on the other end to the library."
37027 #: ../src/guestfs.pod:2434
37029 "The daemon connects to this port (and hence to the library) and sends a four "
37030 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
37031 "protocol (see below)."
37035 #: ../src/guestfs.pod:2440
37036 msgid "COMMUNICATION PROTOCOL"
37040 #: ../src/guestfs.pod:2442
37042 "Don't rely on using this protocol directly. This section documents how it "
37043 "currently works, but it may change at any time."
37047 #: ../src/guestfs.pod:2445
37049 "The protocol used to talk between the library and the daemon running inside "
37050 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
37051 "1014, RFC 1832, RFC 4506)."
37055 #: ../src/guestfs.pod:2449
37057 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
37058 "this file is automatically generated)."
37062 #: ../src/guestfs.pod:2452
37064 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
37065 "and C<FileOut> parameters, which are handled with very simple request/reply "
37066 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
37067 "parameters, which use the same request and reply messages, but they may also "
37068 "be followed by files sent using a chunked encoding."
37072 #: ../src/guestfs.pod:2459
37073 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
37077 #: ../src/guestfs.pod:2461
37078 msgid "For ordinary functions, the request message is:"
37082 #: ../src/guestfs.pod:2463
37085 " total length (header + arguments,\n"
37086 " but not including the length word itself)\n"
37087 " struct guestfs_message_header (encoded as XDR)\n"
37088 " struct guestfs_<foo>_args (encoded as XDR)\n"
37093 #: ../src/guestfs.pod:2468
37095 "The total length field allows the daemon to allocate a fixed size buffer "
37096 "into which it slurps the rest of the message. As a result, the total length "
37097 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
37098 "effective size of any request is limited to somewhere under this size."
37102 #: ../src/guestfs.pod:2474
37104 "Note also that many functions don't take any arguments, in which case the "
37105 "C<guestfs_I<foo>_args> is completely omitted."
37109 #: ../src/guestfs.pod:2477
37111 "The header contains the procedure number (C<guestfs_proc>) which is how the "
37112 "receiver knows what type of args structure to expect, or none at all."
37116 #: ../src/guestfs.pod:2481
37118 "For functions that take optional arguments, the optional arguments are "
37119 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
37120 "arguments. A bitmask in the header indicates which optional arguments are "
37121 "meaningful. The bitmask is also checked to see if it contains bits set "
37122 "which the daemon does not know about (eg. if more optional arguments were "
37123 "added in a later version of the library), and this causes the call to be "
37128 #: ../src/guestfs.pod:2489
37129 msgid "The reply message for ordinary functions is:"
37133 #: ../src/guestfs.pod:2491
37136 " total length (header + ret,\n"
37137 " but not including the length word itself)\n"
37138 " struct guestfs_message_header (encoded as XDR)\n"
37139 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37144 #: ../src/guestfs.pod:2496
37146 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
37147 "functions that return no formal return values."
37151 #: ../src/guestfs.pod:2499
37152 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
37156 #: ../src/guestfs.pod:2502
37158 "In the case of an error, a flag is set in the header, and the reply message "
37159 "is slightly changed:"
37163 #: ../src/guestfs.pod:2505
37166 " total length (header + error,\n"
37167 " but not including the length word itself)\n"
37168 " struct guestfs_message_header (encoded as XDR)\n"
37169 " struct guestfs_message_error (encoded as XDR)\n"
37174 #: ../src/guestfs.pod:2510
37176 "The C<guestfs_message_error> structure contains the error message as a "
37181 #: ../src/guestfs.pod:2513
37182 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
37186 #: ../src/guestfs.pod:2515
37188 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
37189 "The normal request message is sent (see above). However this is followed by "
37190 "a sequence of file chunks."
37194 #: ../src/guestfs.pod:2519
37197 " total length (header + arguments,\n"
37198 " but not including the length word itself,\n"
37199 " and not including the chunks)\n"
37200 " struct guestfs_message_header (encoded as XDR)\n"
37201 " struct guestfs_<foo>_args (encoded as XDR)\n"
37202 " sequence of chunks for FileIn param #0\n"
37203 " sequence of chunks for FileIn param #1 etc.\n"
37208 #: ../src/guestfs.pod:2527
37209 msgid "The \"sequence of chunks\" is:"
37213 #: ../src/guestfs.pod:2529
37216 " length of chunk (not including length word itself)\n"
37217 " struct guestfs_chunk (encoded as XDR)\n"
37218 " length of chunk\n"
37219 " struct guestfs_chunk (encoded as XDR)\n"
37221 " length of chunk\n"
37222 " struct guestfs_chunk (with data.data_len == 0)\n"
37227 #: ../src/guestfs.pod:2537
37229 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
37230 "is set in the final chunk to indicate either successful completion or early "
37235 #: ../src/guestfs.pod:2541
37237 "At time of writing there are no functions that have more than one FileIn "
37238 "parameter. However this is (theoretically) supported, by sending the "
37239 "sequence of chunks for each FileIn parameter one after another (from left to "
37244 #: ../src/guestfs.pod:2546
37246 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
37247 "transfer. The library does this by sending a chunk with a special flag set "
37248 "to indicate cancellation. When the daemon sees this, it cancels the whole "
37249 "RPC, does I<not> send any reply, and goes back to reading the next request."
37253 #: ../src/guestfs.pod:2552
37255 "The daemon may also cancel. It does this by writing a special word "
37256 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
37257 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
37258 "cancel chunk). The special word is chosen so that even if cancellation "
37259 "happens right at the end of the transfer (after the library has finished "
37260 "writing and has started listening for the reply), the \"spurious\" cancel "
37261 "flag will not be confused with the reply message."
37265 #: ../src/guestfs.pod:2561
37267 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
37268 "limit), and also files where the size is not known in advance (eg. from "
37269 "pipes or sockets). However the chunks are rather small "
37270 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
37271 "to keep much in memory."
37275 #: ../src/guestfs.pod:2567
37276 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
37280 #: ../src/guestfs.pod:2569
37282 "The protocol for FileOut parameters is exactly the same as for FileIn "
37283 "parameters, but with the roles of daemon and library reversed."
37287 #: ../src/guestfs.pod:2572
37290 " total length (header + ret,\n"
37291 " but not including the length word itself,\n"
37292 " and not including the chunks)\n"
37293 " struct guestfs_message_header (encoded as XDR)\n"
37294 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37295 " sequence of chunks for FileOut param #0\n"
37296 " sequence of chunks for FileOut param #1 etc.\n"
37301 #: ../src/guestfs.pod:2580
37302 msgid "INITIAL MESSAGE"
37306 #: ../src/guestfs.pod:2582
37308 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
37309 "which indicates that the guest and daemon is alive. This is what "
37310 "L</guestfs_launch> waits for."
37314 #: ../src/guestfs.pod:2586
37315 msgid "PROGRESS NOTIFICATION MESSAGES"
37319 #: ../src/guestfs.pod:2588
37321 "The daemon may send progress notification messages at any time. These are "
37322 "distinguished by the normal length word being replaced by "
37323 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
37327 #: ../src/guestfs.pod:2592
37329 "The library turns them into progress callbacks (see "
37330 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
37335 #: ../src/guestfs.pod:2596
37337 "The daemon self-limits the frequency of progress messages it sends (see "
37338 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
37343 #: ../src/guestfs.pod:2600
37344 msgid "LIBGUESTFS VERSION NUMBERS"
37348 #: ../src/guestfs.pod:2602
37350 "Since April 2010, libguestfs has started to make separate development and "
37351 "stable releases, along with corresponding branches in our git repository. "
37352 "These separate releases can be identified by version number:"
37356 #: ../src/guestfs.pod:2607
37359 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
37360 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
37366 " | `-------- sub-version\n"
37368 " `------ always '1' because we don't change the ABI\n"
37373 #: ../src/guestfs.pod:2618
37374 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
37378 #: ../src/guestfs.pod:2620
37380 "As time passes we cherry pick fixes from the development branch and backport "
37381 "those into the stable branch, the effect being that the stable branch should "
37382 "get more stable and less buggy over time. So the stable releases are ideal "
37383 "for people who don't need new features but would just like the software to "
37388 #: ../src/guestfs.pod:2626
37389 msgid "Our criteria for backporting changes are:"
37393 #: ../src/guestfs.pod:2632
37395 "Documentation changes which don't affect any code are backported unless the "
37396 "documentation refers to a future feature which is not in stable."
37400 #: ../src/guestfs.pod:2638
37402 "Bug fixes which are not controversial, fix obvious problems, and have been "
37403 "well tested are backported."
37407 #: ../src/guestfs.pod:2643
37409 "Simple rearrangements of code which shouldn't affect how it works get "
37410 "backported. This is so that the code in the two branches doesn't get too "
37411 "far out of step, allowing us to backport future fixes more easily."
37415 #: ../src/guestfs.pod:2649
37417 "We I<don't> backport new features, new APIs, new tools etc, except in one "
37418 "exceptional case: the new feature is required in order to implement an "
37419 "important bug fix."
37423 #: ../src/guestfs.pod:2655
37425 "A new stable branch starts when we think the new features in development are "
37426 "substantial and compelling enough over the current stable branch to warrant "
37427 "it. When that happens we create new stable and development versions 1.N.0 "
37428 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
37429 "stable at this point, but by backporting fixes from development, that branch "
37430 "will stabilize over time."
37434 #: ../src/guestfs.pod:2663
37435 msgid "EXTENDING LIBGUESTFS"
37439 #: ../src/guestfs.pod:2665
37440 msgid "ADDING A NEW API ACTION"
37444 #: ../src/guestfs.pod:2667
37446 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
37447 "documentation) are generated, and this makes it easy to extend the "
37452 #: ../src/guestfs.pod:2671
37453 msgid "To add a new API action there are two changes:"
37457 #: ../src/guestfs.pod:2677
37459 "You need to add a description of the call (name, parameters, return type, "
37460 "tests, documentation) to C<generator/generator_actions.ml>."
37464 #: ../src/guestfs.pod:2680
37466 "There are two sorts of API action, depending on whether the call goes "
37467 "through to the daemon in the appliance, or is serviced entirely by the "
37468 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
37469 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
37470 "an example of the latter, since a trace flag is maintained in the handle and "
37471 "all tracing is done on the library side."
37475 #: ../src/guestfs.pod:2688
37477 "Most new actions are of the first type, and get added to the "
37478 "C<daemon_functions> list. Each function has a unique procedure number used "
37479 "in the RPC protocol which is assigned to that action when we publish "
37480 "libguestfs and cannot be reused. Take the latest procedure number and "
37485 #: ../src/guestfs.pod:2694
37487 "For library-only actions of the second type, add to the "
37488 "C<non_daemon_functions> list. Since these functions are serviced by the "
37489 "library and do not travel over the RPC mechanism to the daemon, these "
37490 "functions do not need a procedure number, and so the procedure number is set "
37495 #: ../src/guestfs.pod:2702
37496 msgid "Implement the action (in C):"
37500 #: ../src/guestfs.pod:2704
37502 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
37503 "C<daemon/> directory."
37507 #: ../src/guestfs.pod:2707
37509 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
37510 "(note: double underscore) in the C<src/> directory."
37514 #: ../src/guestfs.pod:2710
37515 msgid "In either case, use another function as an example of what to do."
37519 #: ../src/guestfs.pod:2714
37520 msgid "After making these changes, use C<make> to compile."
37524 #: ../src/guestfs.pod:2716
37526 "Note that you don't need to implement the RPC, language bindings, manual "
37527 "pages or anything else. It's all automatically generated from the OCaml "
37532 #: ../src/guestfs.pod:2720
37533 msgid "ADDING TESTS FOR AN API ACTION"
37537 #: ../src/guestfs.pod:2722
37539 "You can supply zero or as many tests as you want per API call. The tests "
37540 "can either be added as part of the API description "
37541 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
37542 "drop a script into C<regressions/>. Note that adding a script to "
37543 "C<regressions/> is slower, so if possible use the first method."
37547 #: ../src/guestfs.pod:2728
37549 "The following describes the test environment used when you add an API test "
37550 "in C<generator_actions.ml>."
37554 #: ../src/guestfs.pod:2731
37555 msgid "The test environment has 4 block devices:"
37559 #: ../src/guestfs.pod:2735
37560 msgid "C</dev/sda> 500MB"
37564 #: ../src/guestfs.pod:2737
37565 msgid "General block device for testing."
37569 #: ../src/guestfs.pod:2739
37570 msgid "C</dev/sdb> 50MB"
37574 #: ../src/guestfs.pod:2741
37576 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
37581 #: ../src/guestfs.pod:2744
37582 msgid "C</dev/sdc> 10MB"
37586 #: ../src/guestfs.pod:2746
37587 msgid "Used in a few tests where two block devices are needed."
37591 #: ../src/guestfs.pod:2748
37592 msgid "C</dev/sdd>"
37596 #: ../src/guestfs.pod:2750
37597 msgid "ISO with fixed content (see C<images/test.iso>)."
37601 #: ../src/guestfs.pod:2754
37603 "To be able to run the tests in a reasonable amount of time, the libguestfs "
37604 "appliance and block devices are reused between tests. So don't try testing "
37605 "L</guestfs_kill_subprocess> :-x"
37609 #: ../src/guestfs.pod:2758
37611 "Each test starts with an initial scenario, selected using one of the "
37612 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
37613 "initialize the disks mentioned above in a particular way as documented in "
37614 "C<generator_types.ml>. You should not assume anything about the previous "
37615 "contents of other disks that are not initialized."
37619 #: ../src/guestfs.pod:2764
37621 "You can add a prerequisite clause to any individual test. This is a "
37622 "run-time check, which, if it fails, causes the test to be skipped. Useful "
37623 "if testing a command which might not work on all variations of libguestfs "
37624 "builds. A test that has prerequisite of C<Always> means to run "
37629 #: ../src/guestfs.pod:2770
37631 "In addition, packagers can skip individual tests by setting environment "
37632 "variables before running C<make check>."
37636 #: ../src/guestfs.pod:2773
37639 " SKIP_TEST_<CMD>_<NUM>=1\n"
37644 #: ../src/guestfs.pod:2775
37645 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
37649 #: ../src/guestfs.pod:2777
37654 #: ../src/guestfs.pod:2779
37657 " SKIP_TEST_<CMD>=1\n"
37662 #: ../src/guestfs.pod:2781
37663 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
37667 #: ../src/guestfs.pod:2783
37668 msgid "Packagers can run only certain tests by setting for example:"
37672 #: ../src/guestfs.pod:2785
37675 " TEST_ONLY=\"vfs_type zerofree\"\n"
37680 #: ../src/guestfs.pod:2787
37682 "See C<capitests/tests.c> for more details of how these environment variables "
37687 #: ../src/guestfs.pod:2790
37688 msgid "DEBUGGING NEW API ACTIONS"
37692 #: ../src/guestfs.pod:2792
37693 msgid "Test new actions work before submitting them."
37697 #: ../src/guestfs.pod:2794
37698 msgid "You can use guestfish to try out new commands."
37702 #: ../src/guestfs.pod:2796
37704 "Debugging the daemon is a problem because it runs inside a minimal "
37705 "environment. However you can fprintf messages in the daemon to stderr, and "
37706 "they will show up if you use C<guestfish -v>."
37710 #: ../src/guestfs.pod:2800
37711 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
37715 #: ../src/guestfs.pod:2802
37717 "Our C source code generally adheres to some basic code-formatting "
37718 "conventions. The existing code base is not totally consistent on this "
37719 "front, but we do prefer that contributed code be formatted similarly. In "
37720 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
37721 "indentation level, and other than that, follow the K&R style."
37725 #: ../src/guestfs.pod:2808
37727 "If you use Emacs, add the following to one of one of your start-up files "
37728 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
37732 #: ../src/guestfs.pod:2811
37735 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
37736 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
37737 " (add-hook 'find-file-hook\n"
37738 " '(lambda () (if (and buffer-file-name\n"
37739 " (string-match \"/libguestfs\\\\>\"\n"
37740 " (buffer-file-name))\n"
37741 " (not (string-equal mode-name \"Change Log\"))\n"
37742 " (not (string-equal mode-name \"Makefile\")))\n"
37743 " (setq indent-tabs-mode nil))))\n"
37748 #: ../src/guestfs.pod:2821
37751 " ;;; When editing C sources in libguestfs, use this style.\n"
37752 " (defun libguestfs-c-mode ()\n"
37753 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
37755 " (c-set-style \"K&R\")\n"
37756 " (setq c-indent-level 2)\n"
37757 " (setq c-basic-offset 2))\n"
37758 " (add-hook 'c-mode-hook\n"
37759 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
37760 " (buffer-file-name))\n"
37761 " (libguestfs-c-mode))))\n"
37766 #: ../src/guestfs.pod:2833
37767 msgid "Enable warnings when compiling (and fix any problems this finds):"
37771 #: ../src/guestfs.pod:2836
37774 " ./configure --enable-gcc-warnings\n"
37779 #: ../src/guestfs.pod:2838
37780 msgid "Useful targets are:"
37784 #: ../src/guestfs.pod:2840
37787 " make syntax-check # checks the syntax of the C code\n"
37788 " make check # runs the test suite\n"
37793 #: ../src/guestfs.pod:2843
37794 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
37798 #: ../src/guestfs.pod:2845
37800 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
37801 "which are used to do shell quoting."
37805 #: ../src/guestfs.pod:2850
37810 #: ../src/guestfs.pod:2852
37812 "Simple shell quoted string. Any spaces or other shell characters are "
37817 #: ../src/guestfs.pod:2855
37822 #: ../src/guestfs.pod:2857
37824 "Same as C<%Q> except the string is treated as a path which is prefixed by "
37829 #: ../src/guestfs.pod:2864
37832 " asprintf (&cmd, \"cat %R\", path);\n"
37837 #: ../src/guestfs.pod:2866
37838 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
37842 #: ../src/guestfs.pod:2868
37844 "I<Note:> Do I<not> use these when you are passing parameters to the "
37845 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
37846 "because they are not passed via the shell (instead, straight to exec). You "
37847 "probably want to use the C<sysroot_path()> function however."
37851 #: ../src/guestfs.pod:2874
37852 msgid "SUBMITTING YOUR NEW API ACTIONS"
37856 #: ../src/guestfs.pod:2876
37858 "Submit patches to the mailing list: "
37859 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
37860 "L<rjones@redhat.com>."
37864 #: ../src/guestfs.pod:2880
37865 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
37869 #: ../src/guestfs.pod:2882
37870 msgid "We support i18n (gettext anyhow) in the library."
37874 #: ../src/guestfs.pod:2884
37876 "However many messages come from the daemon, and we don't translate those at "
37877 "the moment. One reason is that the appliance generally has all locale files "
37878 "removed from it, because they take up a lot of space. So we'd have to readd "
37879 "some of those, as well as copying our PO files into the appliance."
37883 #: ../src/guestfs.pod:2890
37885 "Debugging messages are never translated, since they are intended for the "
37890 #: ../src/guestfs.pod:2893
37891 msgid "SOURCE CODE SUBDIRECTORIES"
37895 #: ../src/guestfs.pod:2897
37900 #: ../src/guestfs.pod:2899
37901 msgid "L<virt-alignment-scan(1)> command and documentation."
37905 #: ../src/guestfs.pod:2903
37906 msgid "The libguestfs appliance, build scripts and so on."
37910 #: ../src/guestfs.pod:2905
37911 msgid "C<capitests>"
37915 #: ../src/guestfs.pod:2907
37916 msgid "Automated tests of the C API."
37920 #: ../src/guestfs.pod:2909
37925 #: ../src/guestfs.pod:2911
37927 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
37932 #: ../src/guestfs.pod:2914
37937 #: ../src/guestfs.pod:2916
37939 "Safety and liveness tests of components that libguestfs depends upon (not of "
37940 "libguestfs itself). Mainly this is for qemu and the kernel."
37944 #: ../src/guestfs.pod:2919
37949 #: ../src/guestfs.pod:2921
37951 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
37952 "command and documentation."
37956 #: ../src/guestfs.pod:2924
37961 #: ../src/guestfs.pod:2926
37962 msgid "Outside contributions, experimental parts."
37966 #: ../src/guestfs.pod:2928
37971 #: ../src/guestfs.pod:2930
37973 "The daemon that runs inside the libguestfs appliance and carries out "
37978 #: ../src/guestfs.pod:2933
37983 #: ../src/guestfs.pod:2935
37984 msgid "L<virt-df(1)> command and documentation."
37988 #: ../src/guestfs.pod:2937
37993 #: ../src/guestfs.pod:2939
37994 msgid "L<virt-edit(1)> command and documentation."
37998 #: ../src/guestfs.pod:2941
37999 msgid "C<examples>"
38003 #: ../src/guestfs.pod:2943
38004 msgid "C API example code."
38008 #: ../src/guestfs.pod:2945
38013 #: ../src/guestfs.pod:2947
38015 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
38016 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
38017 "L<virt-tar-out(1)>."
38021 #: ../src/guestfs.pod:2951
38026 #: ../src/guestfs.pod:2953
38027 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
38031 #: ../src/guestfs.pod:2955
38032 msgid "C<generator>"
38036 #: ../src/guestfs.pod:2957
38038 "The crucially important generator, used to automatically generate large "
38039 "amounts of boilerplate C code for things like RPC and bindings."
38043 #: ../src/guestfs.pod:2960
38048 #: ../src/guestfs.pod:2962
38049 msgid "Files used by the test suite."
38053 #: ../src/guestfs.pod:2964
38054 msgid "Some \"phony\" guest images which we test against."
38058 #: ../src/guestfs.pod:2966
38059 msgid "C<inspector>"
38063 #: ../src/guestfs.pod:2968
38064 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
38068 #: ../src/guestfs.pod:2970
38073 #: ../src/guestfs.pod:2972
38074 msgid "Logo used on the website. The fish is called Arthur by the way."
38078 #: ../src/guestfs.pod:2974
38083 #: ../src/guestfs.pod:2976
38084 msgid "M4 macros used by autoconf."
38088 #: ../src/guestfs.pod:2978
38093 #: ../src/guestfs.pod:2980
38094 msgid "Translations of simple gettext strings."
38098 #: ../src/guestfs.pod:2982
38103 #: ../src/guestfs.pod:2984
38105 "The build infrastructure and PO files for translations of manpages and POD "
38106 "files. Eventually this will be combined with the C<po> directory, but that "
38107 "is rather complicated."
38111 #: ../src/guestfs.pod:2988
38112 msgid "C<regressions>"
38116 #: ../src/guestfs.pod:2990
38117 msgid "Regression tests."
38121 #: ../src/guestfs.pod:2992
38126 #: ../src/guestfs.pod:2994
38127 msgid "L<virt-rescue(1)> command and documentation."
38131 #: ../src/guestfs.pod:2996
38136 #: ../src/guestfs.pod:2998
38137 msgid "L<virt-resize(1)> command and documentation."
38141 #: ../src/guestfs.pod:3000
38142 msgid "C<sparsify>"
38146 #: ../src/guestfs.pod:3002
38147 msgid "L<virt-sparsify(1)> command and documentation."
38151 #: ../src/guestfs.pod:3004
38156 #: ../src/guestfs.pod:3006
38157 msgid "Source code to the C library."
38161 #: ../src/guestfs.pod:3008
38166 #: ../src/guestfs.pod:3010
38167 msgid "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
38171 #: ../src/guestfs.pod:3012
38172 msgid "C<test-tool>"
38176 #: ../src/guestfs.pod:3014
38178 "Test tool for end users to test if their qemu/kernel combination will work "
38183 #: ../src/guestfs.pod:3017
38188 #: ../src/guestfs.pod:3019
38193 #: ../src/guestfs.pod:3021
38198 #: ../src/guestfs.pod:3023
38203 #: ../src/guestfs.pod:3025
38208 #: ../src/guestfs.pod:3027
38213 #: ../src/guestfs.pod:3029
38218 #: ../src/guestfs.pod:3031
38223 #: ../src/guestfs.pod:3033
38228 #: ../src/guestfs.pod:3035
38229 msgid "Language bindings."
38233 #: ../src/guestfs.pod:3039
38234 msgid "MAKING A STABLE RELEASE"
38238 #: ../src/guestfs.pod:3041
38240 "When we make a stable release, there are several steps documented here. See "
38241 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
38246 #: ../src/guestfs.pod:3049
38247 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
38251 #: ../src/guestfs.pod:3054
38252 msgid "Finalize RELEASE-NOTES."
38256 #: ../src/guestfs.pod:3058
38257 msgid "Update ROADMAP."
38261 #: ../src/guestfs.pod:3062
38262 msgid "Run C<src/api-support/update-from-tarballs.sh>."
38266 #: ../src/guestfs.pod:3066
38267 msgid "Push and pull from Transifex."
38271 #: ../src/guestfs.pod:3068
38276 #: ../src/guestfs.pod:3070
38284 #: ../src/guestfs.pod:3072
38285 msgid "to push the latest POT files to Transifex. Then run:"
38289 #: ../src/guestfs.pod:3074
38297 #: ../src/guestfs.pod:3076
38298 msgid "which is a wrapper to pull the latest translated C<*.po> files."
38302 #: ../src/guestfs.pod:3080
38304 "Create new stable and development directories under "
38305 "L<http://libguestfs.org/download>."
38309 #: ../src/guestfs.pod:3085
38310 msgid "Create the branch in git:"
38314 #: ../src/guestfs.pod:3087
38317 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
38318 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
38319 " git branch stable-1.XX\n"
38320 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
38325 #: ../src/guestfs.pod:3094
38330 #: ../src/guestfs.pod:3096
38331 msgid "PROTOCOL LIMITS"
38335 #: ../src/guestfs.pod:3098
38337 "Internally libguestfs uses a message-based protocol to pass API calls and "
38338 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
38339 "plenty more detail about this). The maximum message size used by the "
38340 "protocol is slightly less than 4 MB. For some API calls you may need to be "
38341 "aware of this limit. The API calls which may be affected are individually "
38342 "documented, with a link back to this section of the documentation."
38346 #: ../src/guestfs.pod:3106
38348 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
38349 "a simple string. Because this string is at some point internally encoded as "
38350 "a message, the maximum size that it can return is slightly under 4 MB. If "
38351 "the requested file is larger than this then you will get an error."
38355 #: ../src/guestfs.pod:3112
38357 "In order to transfer large files into and out of the guest filesystem, you "
38358 "need to use particular calls that support this. The sections L</UPLOADING> "
38359 "and L</DOWNLOADING> document how to do this."
38363 #: ../src/guestfs.pod:3116
38365 "You might also consider mounting the disk image using our FUSE filesystem "
38366 "support (L<guestmount(1)>)."
38370 #: ../src/guestfs.pod:3119
38371 msgid "MAXIMUM NUMBER OF DISKS"
38375 #: ../src/guestfs.pod:3121
38376 msgid "When using virtio disks (the default) the current limit is B<25> disks."
38380 #: ../src/guestfs.pod:3124
38382 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
38383 "slots. However febootstrap only understands disks with names C</dev/vda> "
38384 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
38389 #: ../src/guestfs.pod:3129
38391 "We are working to substantially raise this limit in future versions but it "
38392 "requires complex changes to qemu."
38396 #: ../src/guestfs.pod:3132
38398 "In future versions of libguestfs it should also be possible to \"hot plug\" "
38399 "disks (add and remove disks after calling L</guestfs_launch>). This also "
38400 "requires changes to qemu."
38404 #: ../src/guestfs.pod:3136
38405 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
38409 #: ../src/guestfs.pod:3138
38410 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
38414 #: ../src/guestfs.pod:3140
38416 "This is because it reserves 4 bits for the minor device number (thus "
38417 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
38421 #: ../src/guestfs.pod:3143
38423 "If you attach a disk with more than 15 partitions, the extra partitions are "
38424 "ignored by libguestfs."
38428 #: ../src/guestfs.pod:3146
38429 msgid "MAXIMUM SIZE OF A DISK"
38433 #: ../src/guestfs.pod:3148
38434 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
38438 #: ../src/guestfs.pod:3150
38440 "We have tested block devices up to 1 exabyte (2**60 or "
38441 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
38446 #: ../src/guestfs.pod:3154
38448 "Although libguestfs probably does not impose any limit, the underlying host "
38449 "storage will. If you store disk images on a host ext4 filesystem, then the "
38450 "maximum size will be limited by the maximum ext4 file size (currently 16 "
38451 "TB). If you store disk images as host logical volumes then you are limited "
38452 "by the maximum size of an LV."
38456 #: ../src/guestfs.pod:3160
38458 "For the hugest disk image files, we recommend using XFS on the host for "
38463 #: ../src/guestfs.pod:3163
38464 msgid "MAXIMUM SIZE OF A PARTITION"
38468 #: ../src/guestfs.pod:3165
38470 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
38471 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
38472 "address a partition located beyond 2 TB on the disk."
38476 #: ../src/guestfs.pod:3169
38478 "It is recommended that you use GPT partitions on disks which are larger than "
38479 "this size. GPT uses 64 bit sector numbers and so can address partitions "
38480 "which are theoretically larger than the largest disk we could support."
38484 #: ../src/guestfs.pod:3174
38485 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
38489 #: ../src/guestfs.pod:3176
38491 "This depends on the filesystem type. libguestfs itself does not impose any "
38492 "known limit. Consult Wikipedia or the filesystem documentation to find out "
38493 "what these limits are."
38497 #: ../src/guestfs.pod:3180
38498 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
38502 #: ../src/guestfs.pod:3182
38504 "The API functions L</guestfs_upload>, L</guestfs_download>, "
38505 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
38506 "uploads and downloads."
38510 #: ../src/guestfs.pod:3186
38511 msgid "INSPECTION LIMITS"
38515 #: ../src/guestfs.pod:3188
38517 "The inspection code has several arbitrary limits on things like the size of "
38518 "Windows Registry hive it will read, and the length of product name. These "
38519 "are intended to stop a malicious guest from consuming arbitrary amounts of "
38520 "memory and disk space on the host, and should not be reached in practice. "
38521 "See the source code for more information."
38525 #: ../src/guestfs.pod:3214
38527 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
38528 "effect as calling C<guestfs_set_verbose (g, 1)>."
38532 #: ../src/guestfs.pod:3226
38534 "Set the path that libguestfs uses to search for a supermin appliance. See "
38535 "the discussion of paths in section L</PATH> above."
38539 #: ../src/guestfs.pod:3235
38540 msgid "See also L</QEMU WRAPPERS> above."
38544 #: ../src/guestfs.pod:3239
38546 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
38547 "effect as calling C<guestfs_set_trace (g, 1)>."
38551 #: ../src/guestfs.pod:3257
38553 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
38554 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
38555 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, "
38556 "L<virt-alignment-scan(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
38557 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
38558 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
38559 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
38560 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, "
38561 "L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
38562 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
38563 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)>, "
38564 "L<http://libguestfs.org/>."
38568 #: ../src/guestfs.pod:3293
38570 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
38571 "L<lvm(8)>, L<disktype(1)>."
38575 #: ../src/guestfs.pod:3300 ../tools/virt-make-fs.pl:553 ../tools/virt-win-reg.pl:761
38580 #: ../src/guestfs.pod:3302
38581 msgid "To get a list of bugs against libguestfs use this link:"
38585 #: ../src/guestfs.pod:3304
38586 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
38590 #: ../src/guestfs.pod:3306
38591 msgid "To report a new bug against libguestfs use this link:"
38595 #: ../src/guestfs.pod:3308
38596 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
38600 #: ../src/guestfs.pod:3310
38601 msgid "When reporting a bug, please check:"
38605 #: ../src/guestfs.pod:3316
38606 msgid "That the bug hasn't been reported already."
38610 #: ../src/guestfs.pod:3320
38611 msgid "That you are testing a recent version."
38615 #: ../src/guestfs.pod:3324
38616 msgid "Describe the bug accurately, and give a way to reproduce it."
38620 #: ../src/guestfs.pod:3328
38622 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
38627 #: ../test-tool/libguestfs-test-tool.pod:5
38628 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
38632 #: ../test-tool/libguestfs-test-tool.pod:9
38635 " libguestfs-test-tool [--options]\n"
38640 #: ../test-tool/libguestfs-test-tool.pod:13
38642 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
38643 "to check basic libguestfs functionality is working. This is needed because "
38644 "libguestfs occasionally breaks for reasons beyond our control: usually "
38645 "because of changes in the underlying qemu or kernel packages, or the host "
38650 #: ../test-tool/libguestfs-test-tool.pod:19
38651 msgid "If you suspect a problem in libguestfs, then just run:"
38655 #: ../test-tool/libguestfs-test-tool.pod:21
38658 " libguestfs-test-tool\n"
38663 #: ../test-tool/libguestfs-test-tool.pod:23
38664 msgid "It will print lots of diagnostic messages."
38668 #: ../test-tool/libguestfs-test-tool.pod:25
38669 msgid "If it runs to completion successfully, you will see this near the end:"
38673 #: ../test-tool/libguestfs-test-tool.pod:27
38676 " ===== TEST FINISHED OK =====\n"
38681 #: ../test-tool/libguestfs-test-tool.pod:29
38682 msgid "and the test tool will exit with code 0."
38686 #: ../test-tool/libguestfs-test-tool.pod:31
38688 "If it fails (and/or exits with non-zero error code), please paste the "
38689 "I<complete, unedited> output of the test tool into a bug report. More "
38690 "information about reporting bugs can be found on the "
38691 "L<http://libguestfs.org/> website."
38695 #: ../test-tool/libguestfs-test-tool.pod:42
38696 msgid "Display short usage information and exit."
38700 #: ../test-tool/libguestfs-test-tool.pod:44
38701 msgid "B<--qemu qemu_binary>"
38705 #: ../test-tool/libguestfs-test-tool.pod:46
38707 "If you have downloaded another qemu binary, point this option at the full "
38708 "path of the binary to try it."
38712 #: ../test-tool/libguestfs-test-tool.pod:49
38713 msgid "B<--qemudir qemu_source_dir>"
38717 #: ../test-tool/libguestfs-test-tool.pod:51
38719 "If you have compiled qemu from source, point this option at the source "
38720 "directory to try it."
38724 #: ../test-tool/libguestfs-test-tool.pod:54
38729 #: ../test-tool/libguestfs-test-tool.pod:56
38730 msgid "B<--timeout N>"
38734 #: ../test-tool/libguestfs-test-tool.pod:58
38736 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
38737 "minutes) which does not usually need to be adjusted."
38741 #: ../test-tool/libguestfs-test-tool.pod:63
38742 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
38746 #: ../test-tool/libguestfs-test-tool.pod:65
38748 "If you have compiled another version of qemu from source and would like to "
38749 "try that, then you can use the I<--qemudir> option to point to the qemu "
38750 "source directory."
38754 #: ../test-tool/libguestfs-test-tool.pod:69
38756 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
38757 "option to point to the binary."
38761 #: ../test-tool/libguestfs-test-tool.pod:72
38763 "Note when using these options, you can ignore the business of qemu wrapper "
38764 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
38765 "wrapper script for you if one is needed."
38769 #: ../test-tool/libguestfs-test-tool.pod:76
38770 msgid "TRYING OUT A DIFFERENT KERNEL"
38774 #: ../test-tool/libguestfs-test-tool.pod:78
38776 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
38777 "libguestfs tries. You do this by setting the environment variables "
38778 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
38782 #: ../test-tool/libguestfs-test-tool.pod:82
38784 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
38789 #: ../test-tool/libguestfs-test-tool.pod:85
38790 msgid "SELF-DIAGNOSIS"
38794 #: ../test-tool/libguestfs-test-tool.pod:87
38796 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
38797 "produced by libguestfs-test-tool and/or possible errors."
38801 #: ../test-tool/libguestfs-test-tool.pod:92
38803 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
38804 "I<1> if there was an error."
38808 #: ../test-tool/libguestfs-test-tool.pod:97
38810 "For the full list of environment variables which may affect libguestfs, "
38811 "please see the L<guestfs(3)> manual page."
38815 #: ../test-tool/libguestfs-test-tool.pod:102
38816 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
38820 #: ../tools/virt-list-filesystems.pl:32
38821 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
38825 #: ../tools/virt-list-filesystems.pl:36
38828 " virt-list-filesystems [--options] domname\n"
38833 #: ../tools/virt-list-filesystems.pl:38
38836 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
38841 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
38843 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
38848 #: ../tools/virt-list-filesystems.pl:45
38850 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
38851 "are contained in a virtual machine or disk image."
38855 #: ../tools/virt-list-filesystems.pl:49
38857 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
38858 "functionality. For more complex cases you should look at the "
38859 "L<guestfish(1)> tool."
38863 #: ../tools/virt-list-filesystems.pl:112
38865 "With this option, C<virt-list-filesystems> displays the type of each "
38866 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
38870 #: ../tools/virt-list-filesystems.pl:119
38875 #: ../tools/virt-list-filesystems.pl:123
38877 "Normally we only show mountable filesystems. If this option is given then "
38878 "swap devices are shown too."
38882 #: ../tools/virt-list-filesystems.pl:197
38884 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
38885 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
38886 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38890 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
38891 msgid "Copyright (C) 2009 Red Hat Inc."
38895 #: ../tools/virt-list-partitions.pl:32
38896 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
38900 #: ../tools/virt-list-partitions.pl:36
38903 " virt-list-partitions [--options] domname\n"
38908 #: ../tools/virt-list-partitions.pl:38
38911 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
38916 #: ../tools/virt-list-partitions.pl:45
38918 "C<virt-list-partitions> is a command line tool to list the partitions that "
38919 "are contained in a virtual machine or disk image. It is mainly useful as a "
38920 "first step to using L<virt-resize(1)>."
38924 #: ../tools/virt-list-partitions.pl:50
38926 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
38927 "functionality. For more complex cases you should look at the "
38928 "L<guestfish(1)> tool."
38932 #: ../tools/virt-list-partitions.pl:113
38933 msgid "Show sizes in human-readable form (eg. \"1G\")."
38937 #: ../tools/virt-list-partitions.pl:123
38939 "With this option, C<virt-list-partitions> displays the type and size of each "
38940 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
38944 #: ../tools/virt-list-partitions.pl:130
38949 #: ../tools/virt-list-partitions.pl:132
38954 #: ../tools/virt-list-partitions.pl:134
38955 msgid "Display the total size of each block device (as a separate row or rows)."
38959 #: ../tools/virt-list-partitions.pl:267
38961 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
38962 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
38963 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38967 #: ../tools/virt-list-partitions.pl:283
38968 msgid "Copyright (C) 2009-2010 Red Hat Inc."
38972 #: ../tools/virt-make-fs.pl:37
38973 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
38977 #: ../tools/virt-make-fs.pl:41
38980 " virt-make-fs [--options] input.tar output.img\n"
38985 #: ../tools/virt-make-fs.pl:43
38988 " virt-make-fs [--options] input.tar.gz output.img\n"
38993 #: ../tools/virt-make-fs.pl:45
38996 " virt-make-fs [--options] directory output.img\n"
39001 #: ../tools/virt-make-fs.pl:49
39003 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
39004 "archive or some files in a directory. It is similar to tools like "
39005 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
39006 "it can create common filesystem types like ext2/3 or NTFS, which can be "
39007 "useful if you want to attach these filesystems to existing virtual machines "
39008 "(eg. to import large amounts of read-only data to a VM)."
39012 #: ../tools/virt-make-fs.pl:57
39013 msgid "Basic usage is:"
39017 #: ../tools/virt-make-fs.pl:59
39020 " virt-make-fs input output\n"
39025 #: ../tools/virt-make-fs.pl:61
39027 "where C<input> is either a directory containing files that you want to add, "
39028 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
39029 "C<output> is a disk image. The input type is detected automatically. The "
39030 "output disk image defaults to a raw ext2 image unless you specify extra "
39031 "flags (see L</OPTIONS> below)."
39035 #: ../tools/virt-make-fs.pl:67
39036 msgid "EXTRA SPACE"
39040 #: ../tools/virt-make-fs.pl:69
39042 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
39043 "the files that it contains, but might have extra space. Depending on how "
39044 "you are going to use the output, you might think this extra space is wasted "
39045 "and want to minimize it, or you might want to leave space so that more files "
39046 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
39047 "but you can use the I<--size> flag to leave space in the filesystem if you "
39052 #: ../tools/virt-make-fs.pl:77
39054 "An alternative way to leave extra space but not make the output image any "
39055 "bigger is to use an alternative disk image format (instead of the default "
39056 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
39057 "image format (check your hypervisor supports this before using it). This "
39058 "allows you to choose a large I<--size> but the extra space won't actually be "
39059 "allocated in the image until you try to store something in it."
39063 #: ../tools/virt-make-fs.pl:85
39065 "Don't forget that you can also use local commands including L<resize2fs(8)> "
39066 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
39067 "to build another image from scratch."
39071 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
39076 #: ../tools/virt-make-fs.pl:91
39079 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
39084 #: ../tools/virt-make-fs.pl:93
39085 msgid "FILESYSTEM TYPE"
39089 #: ../tools/virt-make-fs.pl:95
39091 "The default filesystem type is C<ext2>. Just about any filesystem type that "
39092 "libguestfs supports can be used (but I<not> read-only formats like "
39093 "ISO9660). Here are some of the more common choices:"
39097 #: ../tools/virt-make-fs.pl:101
39102 #: ../tools/virt-make-fs.pl:103
39104 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
39105 "you are not going to use the filesystem in a way that requires the journal, "
39106 "then this is just wasted overhead."
39110 #: ../tools/virt-make-fs.pl:107
39111 msgid "I<ntfs> or I<vfat>"
39115 #: ../tools/virt-make-fs.pl:109
39116 msgid "Useful if exporting data to a Windows guest."
39120 #: ../tools/virt-make-fs.pl:111
39122 "I<Note for vfat>: The tar archive or local directory must only contain files "
39123 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
39124 "program running within libguestfs is unable to change the ownership of "
39125 "non-root files, since vfat itself does not support this."
39129 #: ../tools/virt-make-fs.pl:116
39134 #: ../tools/virt-make-fs.pl:118
39136 "Lower overhead than C<ext2>, but certain limitations on filename length and "
39137 "total filesystem size."
39141 #: ../tools/virt-make-fs.pl:125
39144 " virt-make-fs --type=minix input minixfs.img\n"
39149 #: ../tools/virt-make-fs.pl:127
39150 msgid "TO PARTITION OR NOT TO PARTITION"
39154 #: ../tools/virt-make-fs.pl:129
39155 msgid "Optionally virt-make-fs can add a partition table to the output disk."
39159 #: ../tools/virt-make-fs.pl:131
39161 "Adding a partition can make the disk image more compatible with certain "
39162 "virtualized operating systems which don't expect to see a filesystem "
39163 "directly located on a block device (Linux doesn't care and will happily "
39164 "handle both types)."
39168 #: ../tools/virt-make-fs.pl:136
39170 "On the other hand, if you have a partition table then the output image is no "
39171 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
39172 "directly on a partitioned disk image. (However libguestfs tools such as "
39173 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
39177 #: ../tools/virt-make-fs.pl:144
39178 msgid "Add an MBR partition:"
39182 #: ../tools/virt-make-fs.pl:146
39185 " virt-make-fs --partition -- input disk.img\n"
39190 #: ../tools/virt-make-fs.pl:148
39192 "If the output disk image could be terabyte-sized or larger, it's better to "
39193 "use an EFI/GPT-compatible partition table:"
39197 #: ../tools/virt-make-fs.pl:151
39200 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
39205 #: ../tools/virt-make-fs.pl:179
39206 msgid "Enable debugging information."
39210 #: ../tools/virt-make-fs.pl:185
39211 msgid "B<--size=E<lt>NE<gt>>"
39215 #: ../tools/virt-make-fs.pl:187
39216 msgid "B<--size=+E<lt>NE<gt>>"
39220 #: ../tools/virt-make-fs.pl:189
39221 msgid "B<-s E<lt>NE<gt>>"
39225 #: ../tools/virt-make-fs.pl:191
39226 msgid "B<-s +E<lt>NE<gt>>"
39230 #: ../tools/virt-make-fs.pl:193
39231 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
39235 #: ../tools/virt-make-fs.pl:196
39237 "If this option is I<not> given, then the output image will be just large "
39238 "enough to contain all the files, with not much wasted space."
39242 #: ../tools/virt-make-fs.pl:199
39244 "To choose a fixed size output disk, specify an absolute number followed by "
39245 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
39246 "Petabytes or Exabytes. This must be large enough to contain all the input "
39247 "files, else you will get an error."
39251 #: ../tools/virt-make-fs.pl:204
39253 "To leave extra space, specify C<+> (plus sign) and a number followed by "
39254 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
39255 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
39256 "the input files, and (approximately) an extra 200 MB free space."
39260 #: ../tools/virt-make-fs.pl:210
39262 "Note that virt-make-fs estimates free space, and therefore will not produce "
39263 "filesystems containing precisely the free space requested. (It is much more "
39264 "expensive and time-consuming to produce a filesystem which has precisely the "
39265 "desired free space)."
39269 #: ../tools/virt-make-fs.pl:219
39270 msgid "B<--format=E<lt>fmtE<gt>>"
39274 #: ../tools/virt-make-fs.pl:221
39275 msgid "B<-F E<lt>fmtE<gt>>"
39279 #: ../tools/virt-make-fs.pl:223
39280 msgid "Choose the output disk image format."
39284 #: ../tools/virt-make-fs.pl:225
39285 msgid "The default is C<raw> (raw disk image)."
39289 #: ../tools/virt-make-fs.pl:227
39291 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
39292 "that would really make sense here is C<qcow2>."
39296 #: ../tools/virt-make-fs.pl:234
39297 msgid "B<--type=E<lt>fsE<gt>>"
39301 #: ../tools/virt-make-fs.pl:236
39302 msgid "B<-t E<lt>fsE<gt>>"
39306 #: ../tools/virt-make-fs.pl:238
39307 msgid "Choose the output filesystem type."
39311 #: ../tools/virt-make-fs.pl:240
39312 msgid "The default is C<ext2>."
39316 #: ../tools/virt-make-fs.pl:242
39317 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
39321 #: ../tools/virt-make-fs.pl:249
39322 msgid "B<--partition>"
39326 #: ../tools/virt-make-fs.pl:251
39327 msgid "B<--partition=E<lt>parttypeE<gt>>"
39331 #: ../tools/virt-make-fs.pl:253
39333 "If specified, this flag adds an MBR partition table to the output disk "
39338 #: ../tools/virt-make-fs.pl:256
39340 "You can change the partition table type, eg. I<--partition=gpt> for large "
39345 #: ../tools/virt-make-fs.pl:259
39347 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
39348 "might consider the next parameter to be the partition type. For example:"
39352 #: ../tools/virt-make-fs.pl:263
39355 " virt-make-fs --partition input.tar ...\n"
39360 #: ../tools/virt-make-fs.pl:265
39362 "would cause virt-make-fs to think you wanted to use a partition type of "
39363 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
39364 "dash) between options and the input file argument:"
39368 #: ../tools/virt-make-fs.pl:269
39371 " virt-make-fs --partition -- input.tar ...\n"
39376 #: ../tools/virt-make-fs.pl:541
39378 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
39379 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
39380 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
39384 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
39386 "When reporting bugs, please enable debugging and capture the I<complete> "
39391 #: ../tools/virt-make-fs.pl:558
39394 " export LIBGUESTFS_DEBUG=1\n"
39395 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
39400 #: ../tools/virt-make-fs.pl:561
39402 "Attach /tmp/virt-make-fs.log to a new bug report at "
39403 "L<https://bugzilla.redhat.com/>"
39407 #: ../tools/virt-tar.pl:33
39408 msgid "virt-tar - Extract or upload files to a virtual machine"
39412 #: ../tools/virt-tar.pl:37
39415 " virt-tar [--options] -x domname directory tarball\n"
39420 #: ../tools/virt-tar.pl:39
39423 " virt-tar [--options] -u domname tarball directory\n"
39428 #: ../tools/virt-tar.pl:41
39431 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
39436 #: ../tools/virt-tar.pl:43
39439 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
39444 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
39449 #: ../tools/virt-tar.pl:47
39451 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
39452 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
39456 #: ../tools/virt-tar.pl:52
39457 msgid "Download C</home> from the VM into a local tarball:"
39461 #: ../tools/virt-tar.pl:54
39464 " virt-tar -x domname /home home.tar\n"
39469 #: ../tools/virt-tar.pl:56
39472 " virt-tar -zx domname /home home.tar.gz\n"
39477 #: ../tools/virt-tar.pl:58
39478 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
39482 #: ../tools/virt-tar.pl:60
39485 " virt-tar -u domname uploadstuff.tar /tmp\n"
39490 #: ../tools/virt-tar.pl:62
39493 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
39498 #: ../tools/virt-tar.pl:66
39500 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
39501 "virtual machines. If you do this, you risk disk corruption in the VM. "
39502 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
39506 #: ../tools/virt-tar.pl:71
39508 "You can use I<-x> (extract) on live virtual machines, but you might get "
39509 "inconsistent results or errors if there is filesystem activity inside the "
39510 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
39511 "work, but the only way to guarantee consistent results is if the virtual "
39512 "machine is shut down."
39516 #: ../tools/virt-tar.pl:79
39518 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
39519 "parts of a guest filesystem. There are many possibilities: making backups, "
39520 "uploading data files, snooping on guest activity, fixing or customizing "
39525 #: ../tools/virt-tar.pl:84
39527 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
39528 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
39529 "should look at the L<guestfish(1)> tool."
39533 #: ../tools/virt-tar.pl:88
39535 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
39536 "its contents (recursively) from the virtual machine into a local tarball. "
39537 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
39538 "virtual machine. You cannot use these two options together."
39542 #: ../tools/virt-tar.pl:94
39544 "In addition, you may need to use the I<-z> (gZip) option to enable "
39545 "compression. When uploading, you have to specify I<-z> if the upload file "
39546 "is compressed because virt-tar won't detect this on its own."
39550 #: ../tools/virt-tar.pl:98
39552 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
39553 "example it cannot do PKZip files or bzip2 compression. If you want that "
39554 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
39555 "the L<libguestfs(3)> API)."
39559 #: ../tools/virt-tar.pl:160
39560 msgid "B<--extract>"
39564 #: ../tools/virt-tar.pl:162
39565 msgid "B<--download>"
39569 #: ../tools/virt-tar.pl:164
39574 #: ../tools/virt-tar.pl:166
39575 msgid "B<--upload>"
39579 #: ../tools/virt-tar.pl:168
39581 "Use I<-x> to extract (download) a directory from a virtual machine to a "
39586 #: ../tools/virt-tar.pl:171
39588 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
39589 "Please read the L</WARNING> section above before using this option."
39593 #: ../tools/virt-tar.pl:175
39594 msgid "You must specify exactly one of these options."
39598 #: ../tools/virt-tar.pl:181
39603 #: ../tools/virt-tar.pl:183
39608 #: ../tools/virt-tar.pl:185
39609 msgid "Specify that the input or output tarball is gzip-compressed."
39613 #: ../tools/virt-tar.pl:298
39615 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
39616 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
39617 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
39618 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39622 #: ../tools/virt-win-reg.pl:37
39624 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
39629 #: ../tools/virt-win-reg.pl:41
39632 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
39637 #: ../tools/virt-win-reg.pl:43
39640 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
39645 #: ../tools/virt-win-reg.pl:45
39648 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
39653 #: ../tools/virt-win-reg.pl:47
39656 " virt-win-reg --merge domname [input.reg ...]\n"
39661 #: ../tools/virt-win-reg.pl:49
39664 " virt-win-reg [--options] disk.img ... # instead of domname\n"
39669 #: ../tools/virt-win-reg.pl:53
39671 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
39672 "virtual machines. If you do this, you I<will> get irreversible disk "
39673 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
39674 "but doesn't catch all cases."
39678 #: ../tools/virt-win-reg.pl:58
39680 "Modifying the Windows Registry is an inherently risky operation. The format "
39681 "is deliberately obscure and undocumented, and Registry changes can leave the "
39682 "system unbootable. Therefore when using the I<--merge> option, make sure "
39683 "you have a reliable backup first."
39687 #: ../tools/virt-win-reg.pl:65
39689 "This program can export and merge Windows Registry entries from a Windows "
39694 #: ../tools/virt-win-reg.pl:68
39696 "The first parameter is the libvirt guest name or the raw disk image of a "
39701 #: ../tools/virt-win-reg.pl:71
39703 "If I<--merge> is I<not> specified, then the chosen registry key is "
39704 "displayed/exported (recursively). For example:"
39708 #: ../tools/virt-win-reg.pl:74
39711 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
39716 #: ../tools/virt-win-reg.pl:76
39717 msgid "You can also display single values from within registry keys, for example:"
39721 #: ../tools/virt-win-reg.pl:79
39724 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
39725 " $ virt-win-reg Windows7 $cvkey ProductName\n"
39726 " Windows 7 Enterprise\n"
39731 #: ../tools/virt-win-reg.pl:83
39733 "With I<--merge>, you can merge a textual regedit file into the Windows "
39738 #: ../tools/virt-win-reg.pl:86
39741 " $ virt-win-reg --merge Windows7 changes.reg\n"
39746 #: ../tools/virt-win-reg.pl:90
39748 "This program is only meant for simple access to the registry. If you want "
39749 "to do complicated things with the registry, we suggest you download the "
39750 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
39751 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
39752 "L<hivexregedit(1)>."
39756 #: ../tools/virt-win-reg.pl:159
39761 #: ../tools/virt-win-reg.pl:161
39763 "In merge mode, this merges a textual regedit file into the Windows Registry "
39764 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
39765 "displays or exports Registry entries instead."
39769 #: ../tools/virt-win-reg.pl:165
39771 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
39772 "result in disk corruption. However exporting (without this flag) is always "
39777 #: ../tools/virt-win-reg.pl:173
39778 msgid "B<--encoding> UTF-16LE|ASCII"
39782 #: ../tools/virt-win-reg.pl:175
39784 "When merging (only), you may need to specify the encoding for strings to be "
39785 "used in the hive file. This is explained in detail in "
39786 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
39790 #: ../tools/virt-win-reg.pl:179
39792 "The default is to use UTF-16LE, which should work with recent versions of "
39797 #: ../tools/virt-win-reg.pl:186
39798 msgid "B<--unsafe-printable-strings>"
39802 #: ../tools/virt-win-reg.pl:188
39804 "When exporting (only), assume strings are UTF-16LE and print them as strings "
39805 "instead of hex sequences. Remove the final zero codepoint from strings if "
39810 #: ../tools/virt-win-reg.pl:192
39812 "This is unsafe and does not preserve the fidelity of strings in the original "
39813 "Registry for various reasons:"
39817 #: ../tools/virt-win-reg.pl:199
39819 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
39820 "other encodings will be corrupted by this transformation."
39824 #: ../tools/virt-win-reg.pl:204
39826 "Assumes that everything which has type 1 or 2 is really a string and that "
39827 "everything else is not a string, but the type field in real Registries is "
39832 #: ../tools/virt-win-reg.pl:210
39834 "Loses information about whether a zero codepoint followed the string in the "
39839 #: ../tools/virt-win-reg.pl:215
39841 "This all happens because the Registry itself contains no information about "
39842 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
39846 #: ../tools/virt-win-reg.pl:219
39848 "You should only use this option for quick hacking and debugging of the "
39849 "Registry contents, and I<never> use it if the output is going to be passed "
39850 "into another program or stored in another Registry."
39854 #: ../tools/virt-win-reg.pl:556
39855 msgid "SUPPORTED SYSTEMS"
39859 #: ../tools/virt-win-reg.pl:558
39861 "The program currently supports Windows NT-derived guests starting with "
39862 "Windows XP through to at least Windows 7."
39866 #: ../tools/virt-win-reg.pl:561
39867 msgid "The following Registry keys are supported:"
39871 #: ../tools/virt-win-reg.pl:565
39872 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
39876 #: ../tools/virt-win-reg.pl:567
39877 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
39881 #: ../tools/virt-win-reg.pl:569
39882 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
39886 #: ../tools/virt-win-reg.pl:571
39887 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
39891 #: ../tools/virt-win-reg.pl:573
39892 msgid "C<HKEY_USERS\\.DEFAULT>"
39896 #: ../tools/virt-win-reg.pl:575
39897 msgid "C<HKEY_USERS\\I<SID>>"
39901 #: ../tools/virt-win-reg.pl:577
39902 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
39906 #: ../tools/virt-win-reg.pl:579
39907 msgid "C<HKEY_USERS\\I<username>>"
39911 #: ../tools/virt-win-reg.pl:581
39912 msgid "where I<username> is a local user name (this is a libguestfs extension)."
39916 #: ../tools/virt-win-reg.pl:585
39918 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
39923 #: ../tools/virt-win-reg.pl:588
39925 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
39926 "supported (there is no \"current user\")."
39930 #: ../tools/virt-win-reg.pl:591
39935 #: ../tools/virt-win-reg.pl:593
39937 "C<virt-win-reg> expects that regedit files have already been reencoded in "
39938 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
39939 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
39940 "with Windows-style line endings, you may need to reencode the whole file "
39941 "before or after processing."
39945 #: ../tools/virt-win-reg.pl:599
39947 "To reencode a file from Windows format to Linux (before processing it with "
39948 "the I<--merge> option), you would do something like this:"
39952 #: ../tools/virt-win-reg.pl:602
39955 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
39960 #: ../tools/virt-win-reg.pl:604
39962 "To go in the opposite direction, after exporting and before sending the file "
39963 "to a Windows user, do something like this:"
39967 #: ../tools/virt-win-reg.pl:607
39970 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
39975 #: ../tools/virt-win-reg.pl:609
39976 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
39980 #: ../tools/virt-win-reg.pl:611
39982 "If you are unsure about the current encoding, use the L<file(1)> command. "
39983 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
39984 "Windows-style (CRLF) line endings, like this:"
39988 #: ../tools/virt-win-reg.pl:615
39991 " $ file software.reg\n"
39992 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
39993 " with CRLF line terminators\n"
39998 #: ../tools/virt-win-reg.pl:619
39999 msgid "This file would need conversion before you could I<--merge> it."
40003 #: ../tools/virt-win-reg.pl:621
40004 msgid "CurrentControlSet etc."
40008 #: ../tools/virt-win-reg.pl:623
40010 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
40011 "Registry at the level of the hive file, and therefore you cannot modify "
40016 #: ../tools/virt-win-reg.pl:627
40018 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
40019 "circumstances it might refer to another control set. The way to find out is "
40020 "to look at the C<HKLM\\SYSTEM\\Select> key:"
40024 #: ../tools/virt-win-reg.pl:631
40027 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
40028 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
40029 " \"Current\"=dword:00000001\n"
40030 " \"Default\"=dword:00000001\n"
40031 " \"Failed\"=dword:00000000\n"
40032 " \"LastKnownGood\"=dword:00000002\n"
40037 #: ../tools/virt-win-reg.pl:638
40038 msgid "\"Current\" is the one which Windows will choose when it boots."
40042 #: ../tools/virt-win-reg.pl:640
40043 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
40047 #: ../tools/virt-win-reg.pl:643
40048 msgid "WINDOWS TIPS"
40052 #: ../tools/virt-win-reg.pl:645
40054 "Note that some of these tips modify the guest disk image. The guest I<must> "
40055 "be shut off, else you will get disk corruption."
40059 #: ../tools/virt-win-reg.pl:648
40060 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
40064 #: ../tools/virt-win-reg.pl:650
40066 "Prepare a DOS batch script, VBScript or executable. Upload this using "
40067 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
40068 "is uploaded into C<C:\\>:"
40072 #: ../tools/virt-win-reg.pl:654
40075 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
40080 #: ../tools/virt-win-reg.pl:656
40081 msgid "Prepare a regedit file containing the registry change:"
40085 #: ../tools/virt-win-reg.pl:658
40088 " cat > test.reg <<'EOF'\n"
40089 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
40090 " \"Test\"=\"c:\\\\test.bat\"\n"
40096 #: ../tools/virt-win-reg.pl:663
40098 "In this example we use the key C<RunOnce> which means that the script will "
40099 "run precisely once when the first user logs in. If you want it to run every "
40100 "time a user logs in, replace C<RunOnce> with C<Run>."
40104 #: ../tools/virt-win-reg.pl:667
40105 msgid "Now update the registry:"
40109 #: ../tools/virt-win-reg.pl:669
40112 " virt-win-reg --merge WindowsGuest test.reg\n"
40117 #: ../tools/virt-win-reg.pl:671
40118 msgid "INSTALLING A SERVICE"
40122 #: ../tools/virt-win-reg.pl:673
40124 "This section assumes you are familiar with Windows services, and you either "
40125 "have a program which handles the Windows Service Control Protocol directly "
40126 "or you want to run any program using a service wrapper like SrvAny or the "
40131 #: ../tools/virt-win-reg.pl:678
40133 "First upload the program and optionally the service wrapper. In this case "
40134 "the test program is called C<test.exe> and we are using the RHSrvAny "
40139 #: ../tools/virt-win-reg.pl:682
40142 " guestfish -i -d WindowsGuest <<EOF\n"
40143 " upload rhsrvany.exe /rhsrvany.exe\n"
40144 " upload test.exe /test.exe\n"
40150 #: ../tools/virt-win-reg.pl:687
40152 "Prepare a regedit file containing the registry changes. In this example, "
40153 "the first registry change is needed for the service itself or the service "
40154 "wrapper (if used). The second registry change is only needed because I am "
40155 "using the RHSrvAny service wrapper."
40159 #: ../tools/virt-win-reg.pl:692
40162 " cat > service.reg <<'EOF'\n"
40163 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
40164 " \"Type\"=dword:00000010\n"
40165 " \"Start\"=dword:00000002\n"
40166 " \"ErrorControl\"=dword:00000001\n"
40167 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
40168 " \"DisplayName\"=\"RHSrvAny\"\n"
40169 " \"ObjectName\"=\"NetworkService\"\n"
40174 #: ../tools/virt-win-reg.pl:701
40177 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
40178 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
40179 " \"PWD\"=\"c:\\\\Temp\"\n"
40185 #: ../tools/virt-win-reg.pl:712
40187 "For use of C<ControlSet001> see the section above in this manual page. You "
40188 "may need to adjust this according to the control set that is in use by the "
40193 #: ../tools/virt-win-reg.pl:718
40195 "C<\"ObjectName\"> controls the privileges that the service will have. An "
40196 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
40197 "privileged account."
40201 #: ../tools/virt-win-reg.pl:724
40203 "For the meaning of the magic numbers, see this Microsoft KB article: "
40204 "L<http://support.microsoft.com/kb/103000>."
40208 #: ../tools/virt-win-reg.pl:729
40209 msgid "Update the registry:"
40213 #: ../tools/virt-win-reg.pl:731
40216 " virt-win-reg --merge WindowsGuest service.reg\n"
40221 #: ../tools/virt-win-reg.pl:735
40223 "Be careful when passing parameters containing C<\\> (backslash) in the "
40224 "shell. Usually you will have to use 'single quotes' or double backslashes "
40225 "(but not both) to protect them from the shell."
40229 #: ../tools/virt-win-reg.pl:739
40230 msgid "Paths and value names are case-insensitive."
40234 #: ../tools/virt-win-reg.pl:748
40236 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
40237 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
40238 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
40239 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40243 #: ../tools/virt-win-reg.pl:766
40246 " export LIBGUESTFS_DEBUG=1\n"
40247 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
40252 #: ../tools/virt-win-reg.pl:769
40254 "Attach /tmp/virt-win-reg.log to a new bug report at "
40255 "L<https://bugzilla.redhat.com/>"