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.26\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-10-26 21:10+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:262 ../sparsify/virt-sparsify.pod:99 ../test-tool/libguestfs-test-tool.pod:36 ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54 ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103 ../tools/virt-win-reg.pl:96
220 #: ../align/virt-alignment-scan.pod:93 ../cat/virt-cat.pod:66 ../cat/virt-filesystems.pod:95 ../cat/virt-ls.pod:265 ../clone/virt-sysprep.pod:46 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66 ../fish/guestfish.pod:152 ../fuse/guestmount.pod:160 ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:88 ../resize/virt-resize.pod:266 ../sparsify/virt-sparsify.pod:103 ../test-tool/libguestfs-test-tool.pod:40 ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62 ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111 ../tools/virt-win-reg.pl:104
225 #: ../align/virt-alignment-scan.pod:95 ../cat/virt-cat.pod:68 ../cat/virt-filesystems.pod:97 ../cat/virt-ls.pod:267 ../clone/virt-sysprep.pod:48 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68 ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod: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:2877
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:491 ../sparsify/virt-sparsify.pod:153
358 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:493 ../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:561 ../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:563 ../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:565 ../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 "L<virt-resize(1)> can change the alignment of the partitions of some "
621 "guests. Currently it can fully align all the partitions of all Windows "
622 "guests, and it will fix the bootloader where necessary. For Linux guests, "
623 "it can align the second and subsequent partitions, so the majority of OS "
624 "accesses except at boot will be aligned."
628 #: ../align/virt-alignment-scan.pod:284
630 "Another way to correct partition alignment problems is to reinstall your "
631 "guest operating systems. If you install operating systems from templates, "
632 "ensure these have correct partition alignment too."
636 #: ../align/virt-alignment-scan.pod:288
638 "For older versions of Windows, the following NetApp document contains useful "
639 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
643 #: ../align/virt-alignment-scan.pod:291
645 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
646 "an explicit C<%pre> section that creates aligned partitions using "
647 "L<parted(8)>. Do not use the Kickstart C<part> command. The NetApp "
648 "document above contains an example."
652 #: ../align/virt-alignment-scan.pod:296 ../cat/virt-cat.pod:231 ../cat/virt-filesystems.pod:373 ../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:676 ../tools/virt-list-filesystems.pl:188 ../tools/virt-list-partitions.pl:258 ../tools/virt-make-fs.pl:550 ../tools/virt-tar.pl:289 ../tools/virt-win-reg.pl:744
653 msgid "SHELL QUOTING"
657 #: ../align/virt-alignment-scan.pod:298 ../cat/virt-cat.pod:233 ../cat/virt-filesystems.pod:375 ../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:678 ../tools/virt-list-filesystems.pl:190 ../tools/virt-list-partitions.pl:260 ../tools/virt-make-fs.pl:552 ../tools/virt-tar.pl:291 ../tools/virt-win-reg.pl:752
659 "Libvirt guest names can contain arbitrary characters, some of which have "
660 "meaning to the shell such as C<#> and space. You may need to quote or "
661 "escape these characters on the command line. See the shell manual page "
662 "L<sh(1)> for details."
666 #: ../align/virt-alignment-scan.pod:303 ../cat/virt-cat.pod:238 ../cat/virt-filesystems.pod:380 ../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:683 ../sparsify/virt-sparsify.pod:227 ../test-tool/libguestfs-test-tool.pod:90
671 #: ../align/virt-alignment-scan.pod:305
672 msgid "This program returns:"
676 #: ../align/virt-alignment-scan.pod:309 ../align/virt-alignment-scan.pod:315 ../align/virt-alignment-scan.pod:321 ../align/virt-alignment-scan.pod:328 ../cat/virt-cat.pod:177 ../cat/virt-cat.pod:182 ../cat/virt-cat.pod:187 ../cat/virt-cat.pod:198 ../cat/virt-cat.pod:202 ../clone/virt-sysprep.pod:283 ../clone/virt-sysprep.pod:287 ../clone/virt-sysprep.pod:291 ../clone/virt-sysprep.pod:295 ../clone/virt-sysprep.pod:310 ../clone/virt-sysprep.pod:314 ../clone/virt-sysprep.pod:318 ../clone/virt-sysprep.pod:322 ../clone/virt-sysprep.pod:326 ../clone/virt-sysprep.pod:362 ../clone/virt-sysprep.pod:384 ../clone/virt-sysprep.pod:388 ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266 ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276 ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291 ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102 ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132 ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227 ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235 ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:441 ../fish/guestfish-actions.pod:449 ../fish/guestfish-actions.pod:456 ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:1262 ../fish/guestfish-actions.pod:1266 ../fish/guestfish-actions.pod:1270 ../fish/guestfish-actions.pod:1274 ../fish/guestfish-actions.pod:1282 ../fish/guestfish-actions.pod:1286 ../fish/guestfish-actions.pod:1290 ../fish/guestfish-actions.pod:1300 ../fish/guestfish-actions.pod:1304 ../fish/guestfish-actions.pod:1308 ../fish/guestfish-actions.pod:1398 ../fish/guestfish-actions.pod:1402 ../fish/guestfish-actions.pod:1407 ../fish/guestfish-actions.pod:1412 ../fish/guestfish-actions.pod:1454 ../fish/guestfish-actions.pod:1458 ../fish/guestfish-actions.pod:1463 ../fish/guestfish-actions.pod:1719 ../fish/guestfish-actions.pod:1726 ../fish/guestfish-actions.pod:1733 ../fish/guestfish-actions.pod:2136 ../fish/guestfish-actions.pod:2142 ../fish/guestfish-actions.pod:2150 ../fish/guestfish-actions.pod:2157 ../fish/guestfish-actions.pod:2164 ../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:359 ../resize/virt-resize.pod:363 ../resize/virt-resize.pod:372 ../resize/virt-resize.pod:378 ../sparsify/virt-sparsify.pod:32 ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43 ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54 ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:641 ../src/guestfs-actions.pod:649 ../src/guestfs-actions.pod:656 ../src/guestfs-actions.pod:663 ../src/guestfs-actions.pod:2071 ../src/guestfs-actions.pod:2075 ../src/guestfs-actions.pod:2079 ../src/guestfs-actions.pod:2083 ../src/guestfs-actions.pod:2091 ../src/guestfs-actions.pod:2095 ../src/guestfs-actions.pod:2099 ../src/guestfs-actions.pod:2109 ../src/guestfs-actions.pod:2113 ../src/guestfs-actions.pod:2117 ../src/guestfs-actions.pod:2255 ../src/guestfs-actions.pod:2259 ../src/guestfs-actions.pod:2264 ../src/guestfs-actions.pod:2269 ../src/guestfs-actions.pod:2330 ../src/guestfs-actions.pod:2334 ../src/guestfs-actions.pod:2339 ../src/guestfs-actions.pod:2754 ../src/guestfs-actions.pod:2761 ../src/guestfs-actions.pod:2768 ../src/guestfs-actions.pod:3313 ../src/guestfs-actions.pod:3319 ../src/guestfs-actions.pod:3327 ../src/guestfs-actions.pod:3334 ../src/guestfs-actions.pod:3341 ../src/guestfs.pod:403 ../src/guestfs.pod:408 ../src/guestfs.pod:413 ../src/guestfs.pod:417 ../src/guestfs.pod:422 ../src/guestfs.pod:426 ../src/guestfs.pod:431 ../src/guestfs.pod:436 ../src/guestfs.pod:1109 ../src/guestfs.pod:1113 ../src/guestfs.pod:1117 ../src/guestfs.pod:1122 ../src/guestfs.pod:1130 ../src/guestfs.pod:1149 ../src/guestfs.pod:1157 ../src/guestfs.pod:1179 ../src/guestfs.pod:1183 ../src/guestfs.pod:1187 ../src/guestfs.pod:1191 ../src/guestfs.pod:1195 ../src/guestfs.pod:1199 ../src/guestfs.pod:1689 ../src/guestfs.pod:1694 ../src/guestfs.pod:1698 ../src/guestfs.pod:1800 ../src/guestfs.pod:1805 ../src/guestfs.pod:1809 ../src/guestfs.pod:1819 ../src/guestfs.pod:2108 ../src/guestfs.pod:2113 ../src/guestfs.pod:2119 ../src/guestfs.pod:2127 ../src/guestfs.pod:2645 ../src/guestfs.pod:2651 ../src/guestfs.pod:2656 ../src/guestfs.pod:2662 ../src/guestfs.pod:3062 ../src/guestfs.pod:3067 ../src/guestfs.pod:3071 ../src/guestfs.pod:3075 ../src/guestfs.pod:3079 ../src/guestfs.pod:3093 ../src/guestfs.pod:3098 ../src/guestfs.pod:3329 ../src/guestfs.pod:3333 ../src/guestfs.pod:3337 ../src/guestfs.pod:3341 ../tools/virt-win-reg.pl:197 ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208 ../tools/virt-win-reg.pl:721 ../tools/virt-win-reg.pl:727 ../tools/virt-win-reg.pl:733
681 #: ../align/virt-alignment-scan.pod:311
686 #: ../align/virt-alignment-scan.pod:313
687 msgid "successful exit, all partitions are aligned E<ge> 64K for best performance"
691 #: ../align/virt-alignment-scan.pod:317
696 #: ../align/virt-alignment-scan.pod:319
697 msgid "an error scanning the disk image or guest"
701 #: ../align/virt-alignment-scan.pod:323
706 #: ../align/virt-alignment-scan.pod:325
708 "successful exit, some partitions have alignment E<lt> 64K which can result "
709 "in poor performance on high end network storage"
713 #: ../align/virt-alignment-scan.pod:330
718 #: ../align/virt-alignment-scan.pod:332
720 "successful exit, some partitions have alignment E<lt> 4K which can result in "
721 "poor performance on most hypervisors"
725 #: ../align/virt-alignment-scan.pod:337 ../cat/virt-cat.pod:243 ../cat/virt-filesystems.pod:385 ../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:688 ../ruby/examples/guestfs-ruby.pod:36 ../sparsify/virt-sparsify.pod:251 ../src/guestfs.pod:3270 ../test-tool/libguestfs-test-tool.pod:100 ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265 ../tools/virt-make-fs.pl:557 ../tools/virt-tar.pl:296 ../tools/virt-win-reg.pl:757
730 #: ../align/virt-alignment-scan.pod:339
732 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
733 "L<virt-resize(1)>, L<http://libguestfs.org/>."
737 #: ../align/virt-alignment-scan.pod:346 ../cat/virt-cat.pod:252 ../cat/virt-filesystems.pod:396 ../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:711 ../sparsify/virt-sparsify.pod:264 ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277 ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:311 ../tools/virt-win-reg.pl:783
742 #: ../align/virt-alignment-scan.pod:348 ../cat/virt-cat.pod:254 ../cat/virt-filesystems.pod:398 ../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:713 ../sparsify/virt-sparsify.pod:266 ../tools/virt-list-filesystems.pl:210 ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:584 ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:785
743 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
747 #: ../align/virt-alignment-scan.pod:350 ../cat/virt-cat.pod:256 ../cat/virt-filesystems.pod:400 ../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:715 ../ruby/examples/guestfs-ruby.pod:52 ../sparsify/virt-sparsify.pod:268 ../src/guestfs.pod:3352 ../test-tool/libguestfs-test-tool.pod:110 ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281 ../tools/virt-make-fs.pl:586 ../tools/virt-tar.pl:315 ../tools/virt-win-reg.pl:787
752 #: ../align/virt-alignment-scan.pod:352 ../clone/virt-sysprep.pod:507 ../sparsify/virt-sparsify.pod:270
753 msgid "Copyright (C) 2011 Red Hat Inc."
757 #: ../align/virt-alignment-scan.pod:354 ../cat/virt-cat.pod:260 ../cat/virt-filesystems.pod:404 ../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:719 ../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:590 ../tools/virt-tar.pl:319 ../tools/virt-win-reg.pl:791
759 "This program is free software; you can redistribute it and/or modify it "
760 "under the terms of the GNU General Public License as published by the Free "
761 "Software Foundation; either version 2 of the License, or (at your option) "
766 #: ../align/virt-alignment-scan.pod:359 ../cat/virt-cat.pod:265 ../cat/virt-filesystems.pod:409 ../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:724 ../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:595 ../tools/virt-tar.pl:324 ../tools/virt-win-reg.pl:796
768 "This program is distributed in the hope that it will be useful, but WITHOUT "
769 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
770 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
775 #: ../align/virt-alignment-scan.pod:364 ../cat/virt-cat.pod:270 ../cat/virt-filesystems.pod:414 ../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:729 ../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:600 ../tools/virt-tar.pl:329 ../tools/virt-win-reg.pl:801
777 "You should have received a copy of the GNU General Public License along with "
778 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
779 "Ave, Cambridge, MA 02139, USA."
783 #: ../cat/virt-cat.pod:5
784 msgid "virt-cat - Display files in a virtual machine"
788 #: ../cat/virt-cat.pod:9
791 " virt-cat [--options] -d domname file [file ...]\n"
796 #: ../cat/virt-cat.pod:11
799 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
804 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15 ../inspector/virt-inspector.pod:13
809 #: ../cat/virt-cat.pod:15
812 " virt-cat domname file\n"
817 #: ../cat/virt-cat.pod:17
820 " virt-cat disk.img file\n"
825 #: ../cat/virt-cat.pod:21
827 "C<virt-cat> is a command line tool to display the contents of C<file> where "
828 "C<file> exists in the named virtual machine (or disk image)."
832 #: ../cat/virt-cat.pod:24
834 "Multiple filenames can be given, in which case they are concatenated "
835 "together. Each filename must be a full path, starting at the root directory "
836 "(starting with '/')."
840 #: ../cat/virt-cat.pod:28
842 "C<virt-cat> can be used to quickly view a file. To edit a file, use "
843 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
844 "tool (see L</USING GUESTFISH> below)."
848 #: ../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
853 #: ../cat/virt-cat.pod:34
854 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
858 #: ../cat/virt-cat.pod:37
861 " virt-cat -d mydomain /etc/fstab\n"
866 #: ../cat/virt-cat.pod:39
867 msgid "List syslog messages from a VM disk image file:"
871 #: ../cat/virt-cat.pod:41
874 " virt-cat -a disk.img /var/log/messages | tail\n"
879 #: ../cat/virt-cat.pod:43
880 msgid "Find out what DHCP IP address a VM acquired:"
884 #: ../cat/virt-cat.pod:45
887 " virt-cat -d mydomain /var/log/messages | \\\n"
888 " grep 'dhclient: bound to' | tail\n"
893 #: ../cat/virt-cat.pod:48
894 msgid "Find out what packages were recently installed:"
898 #: ../cat/virt-cat.pod:50
901 " virt-cat -d mydomain /var/log/yum.log | tail\n"
906 #: ../cat/virt-cat.pod:52
907 msgid "Find out who is logged on inside a virtual machine:"
911 #: ../cat/virt-cat.pod:54
914 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
920 #: ../cat/virt-cat.pod:57
921 msgid "or who was logged on:"
925 #: ../cat/virt-cat.pod:59
928 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
929 " last -f /tmp/wtmp\n"
934 #: ../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
936 "Add I<file> which should be a disk image from a virtual machine. If the "
937 "virtual machine has multiple block devices, you must supply all of them with "
938 "separate I<-a> options."
942 #: ../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
943 msgid "B<--echo-keys>"
947 #: ../cat/virt-cat.pod:100
949 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
950 "so you cannot see what you are typing. If you are not worried about Tempest "
951 "attacks and there is no one else in the room you can specify this flag to "
952 "see what you are typing."
956 #: ../cat/virt-cat.pod:116
959 " virt-cat --format=raw -a disk.img file\n"
964 #: ../cat/virt-cat.pod:120
967 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
972 #: ../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
973 msgid "B<--keys-from-stdin>"
977 #: ../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
979 "Read key or passphrase parameters from stdin. The default is to try to read "
980 "passphrases from the user by opening C</dev/tty>."
984 #: ../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
985 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
989 #: ../cat/virt-cat.pod:154
990 msgid "Previous versions of virt-cat allowed you to write either:"
994 #: ../cat/virt-cat.pod:156
997 " virt-cat disk.img [disk.img ...] file\n"
1002 #: ../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
1007 #: ../cat/virt-cat.pod:160
1010 " virt-cat guestname file\n"
1015 #: ../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
1017 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1018 "the confusing case where a disk image might have the same name as a guest."
1022 #: ../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
1023 msgid "For compatibility the old style is still supported."
1027 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
1028 msgid "WINDOWS PATHS"
1032 #: ../cat/virt-cat.pod:170
1034 "C<virt-cat> has a limited ability to understand Windows drive letters and "
1035 "paths (eg. C<E:\\foo\\bar.txt>)."
1039 #: ../cat/virt-cat.pod:173 ../edit/virt-edit.pod:262
1040 msgid "If and only if the guest is running Windows then:"
1044 #: ../cat/virt-cat.pod:179 ../edit/virt-edit.pod:268
1046 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
1047 "to the correct filesystem."
1051 #: ../cat/virt-cat.pod:184 ../edit/virt-edit.pod:273
1053 "Any backslash (C<\\>) characters in the path are replaced with forward "
1054 "slashes so that libguestfs can process it."
1058 #: ../cat/virt-cat.pod:189
1060 "The path is resolved case insensitively to locate the file that should be "
1065 #: ../cat/virt-cat.pod:194 ../edit/virt-edit.pod:283
1066 msgid "There are some known shortcomings:"
1070 #: ../cat/virt-cat.pod:200 ../edit/virt-edit.pod:289
1071 msgid "Some NTFS symbolic links may not be followed correctly."
1075 #: ../cat/virt-cat.pod:204 ../edit/virt-edit.pod:293
1076 msgid "NTFS junction points that cross filesystems are not followed."
1080 #: ../cat/virt-cat.pod:208 ../edit/virt-edit.pod:297
1081 msgid "USING GUESTFISH"
1085 #: ../cat/virt-cat.pod:210
1087 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1088 "C<virt-cat> doesn't work."
1092 #: ../cat/virt-cat.pod:213
1093 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1097 #: ../cat/virt-cat.pod:215
1100 " guestfish --ro -i -d domname download file -\n"
1105 #: ../cat/virt-cat.pod:217
1107 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1108 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1112 #: ../cat/virt-cat.pod:221
1114 "The command above uses libguestfs's guest inspection feature and so does not "
1115 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1116 "disk images that don't contain guests. To display a file from a disk image "
1121 #: ../cat/virt-cat.pod:226
1124 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1129 #: ../cat/virt-cat.pod:228
1131 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1132 "the disk image, and C<file> is the full path to the file."
1136 #: ../cat/virt-cat.pod:240 ../cat/virt-filesystems.pod:382 ../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:685 ../sparsify/virt-sparsify.pod:229
1137 msgid "This program returns 0 if successful, or non-zero if there was an error."
1141 #: ../cat/virt-cat.pod:245
1143 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
1144 "L<virt-tar-out(1)>, L<http://libguestfs.org/>."
1148 #: ../cat/virt-cat.pod:258 ../inspector/virt-inspector.pod:405 ../resize/virt-resize.pod:717 ../tools/virt-make-fs.pl:588
1149 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1153 #: ../cat/virt-filesystems.pod:5
1155 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1156 "virtual machine or disk image"
1160 #: ../cat/virt-filesystems.pod:9
1163 " virt-filesystems [--options] -d domname\n"
1168 #: ../cat/virt-filesystems.pod:11
1171 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1176 #: ../cat/virt-filesystems.pod:15
1178 "This tool allows you to discover filesystems, partitions, logical volumes, "
1179 "and their sizes in a disk image or virtual machine. It is a replacement for "
1180 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1184 #: ../cat/virt-filesystems.pod:20
1186 "One use for this tool is from shell scripts to iterate over all filesystems "
1187 "from a disk image:"
1191 #: ../cat/virt-filesystems.pod:23
1194 " for fs in $(virt-filesystems -a disk.img); do\n"
1201 #: ../cat/virt-filesystems.pod:27
1203 "Another use is to list partitions before using another tool to modify those "
1204 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1205 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1209 #: ../cat/virt-filesystems.pod:32
1211 "Various command line options control what this program displays. You need "
1212 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1213 "guest respectively. If you just specify that then the program shows "
1214 "filesystems found, one per line, like this:"
1218 #: ../cat/virt-filesystems.pod:37
1221 " $ virt-filesystems -a disk.img\n"
1223 " /dev/vg_guest/lv_root\n"
1228 #: ../cat/virt-filesystems.pod:41
1229 msgid "If you add I<-l> or I<--long> then the output includes extra information:"
1233 #: ../cat/virt-filesystems.pod:44
1236 " $ virt-filesystems -a disk.img -l\n"
1237 " Name Type VFS Label Size\n"
1238 " /dev/sda1 filesystem ext4 boot 524288000\n"
1239 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1244 #: ../cat/virt-filesystems.pod:49
1246 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1251 #: ../cat/virt-filesystems.pod:52
1254 " $ virt-filesystems -a disk.img --extra\n"
1256 " /dev/vg_guest/lv_root\n"
1257 " /dev/vg_guest/lv_swap\n"
1258 " /dev/vg_guest/lv_data\n"
1263 #: ../cat/virt-filesystems.pod:58
1264 msgid "If you add I<--partitions> then partitions are shown instead of filesystems:"
1268 #: ../cat/virt-filesystems.pod:60
1271 " $ virt-filesystems -a disk.img --partitions\n"
1278 #: ../cat/virt-filesystems.pod:64
1280 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, "
1281 "I<--physical-volumes>, I<--block-devices> to list those items."
1285 #: ../cat/virt-filesystems.pod:67
1287 "You can use these options in combination as well (if you want a combination "
1288 "including filesystems, you have to add I<--filesystems>). Notice that some "
1289 "items fall into several categories (eg. C</dev/sda1> might be both a "
1290 "partition and a filesystem). These items are listed several times. To get "
1291 "a list which includes absolutely everything that virt-filesystems knows "
1292 "about, use the I<--all> option."
1296 #: ../cat/virt-filesystems.pod:74
1298 "UUIDs (because they are quite long) are not shown by default. Add the "
1299 "I<--uuid> option to display device and filesystem UUIDs in the long output."
1303 #: ../cat/virt-filesystems.pod:78
1305 "I<--all --long --uuid> is a useful combination to display all possible "
1306 "information about everything."
1310 #: ../cat/virt-filesystems.pod:81
1313 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1314 " Name Type VFS Label Size Parent UUID\n"
1315 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1316 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1317 " /dev/sda1 partition - - 100M /dev/sda -\n"
1318 " /dev/sda2 partition - - 20G /dev/sda -\n"
1319 " /dev/sda device - - 20G - -\n"
1324 #: ../cat/virt-filesystems.pod:89
1325 msgid "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1329 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1334 #: ../cat/virt-filesystems.pod:112
1336 "Display everything. This is currently the same as specifying these options: "
1337 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, "
1338 "I<--logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may "
1339 "be added to this list in future)."
1343 #: ../cat/virt-filesystems.pod:117
1344 msgid "See also I<--long>."
1348 #: ../cat/virt-filesystems.pod:119
1349 msgid "B<--blkdevs>"
1353 #: ../cat/virt-filesystems.pod:121
1354 msgid "B<--block-devices>"
1358 #: ../cat/virt-filesystems.pod:123
1359 msgid "Display block devices."
1363 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1368 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1370 "Write out the results in CSV format (comma-separated values). This format "
1371 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1372 "ABOUT CSV FORMAT> below."
1376 #: ../cat/virt-filesystems.pod:150
1378 "When prompting for keys and passphrases, virt-filesystems normally turns "
1379 "echoing off so you cannot see what you are typing. If you are not worried "
1380 "about Tempest attacks and there is no one else in the room you can specify "
1381 "this flag to see what you are typing."
1385 #: ../cat/virt-filesystems.pod:155
1390 #: ../cat/virt-filesystems.pod:157
1392 "This causes filesystems that are not ordinary, mountable filesystems to be "
1393 "displayed. This category includes swapspace, and filesystems that are empty "
1394 "or contain unknown data."
1398 #: ../cat/virt-filesystems.pod:161
1399 msgid "This option implies I<--filesystems>."
1403 #: ../cat/virt-filesystems.pod:163
1404 msgid "B<--filesystems>"
1408 #: ../cat/virt-filesystems.pod:165
1410 "Display mountable filesystems. If no display option was selected then this "
1411 "option is implied."
1415 #: ../cat/virt-filesystems.pod:168
1416 msgid "With I<--extra>, non-mountable filesystems are shown too."
1420 #: ../cat/virt-filesystems.pod:181
1423 " virt-filesystems --format=raw -a disk.img\n"
1428 #: ../cat/virt-filesystems.pod:185
1431 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1436 #: ../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
1441 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354 ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1442 msgid "B<--human-readable>"
1446 #: ../cat/virt-filesystems.pod:198
1447 msgid "In I<--long> mode, display sizes in human-readable format."
1451 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366 ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1456 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368 ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1461 #: ../cat/virt-filesystems.pod:209
1462 msgid "Display extra columns of data (\"long format\")."
1466 #: ../cat/virt-filesystems.pod:211
1467 msgid "A title row is added unless you also specify I<--no-title>."
1471 #: ../cat/virt-filesystems.pod:213
1473 "The extra columns displayed depend on what output you select, and the "
1474 "ordering of columns may change in future versions. Use the title row, "
1475 "I<--csv> output and/or L<csvtool(1)> to match columns to data in external "
1480 #: ../cat/virt-filesystems.pod:218
1482 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1483 "default is to show raw numbers of I<bytes>."
1487 #: ../cat/virt-filesystems.pod:221
1488 msgid "Use I<--uuid> to display UUIDs too."
1492 #: ../cat/virt-filesystems.pod:223
1497 #: ../cat/virt-filesystems.pod:225
1498 msgid "B<--logvols>"
1502 #: ../cat/virt-filesystems.pod:227
1503 msgid "B<--logical-volumes>"
1507 #: ../cat/virt-filesystems.pod:229
1509 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1510 "of whether the LVs contain filesystems."
1514 #: ../cat/virt-filesystems.pod:232
1515 msgid "B<--no-title>"
1519 #: ../cat/virt-filesystems.pod:234
1520 msgid "In I<--long> mode, don't add a title row."
1524 #: ../cat/virt-filesystems.pod:236
1526 "Note that the order of the columns is not fixed, and may change in future "
1527 "versions of virt-filesystems, so using this option may give you unexpected "
1532 #: ../cat/virt-filesystems.pod:240
1537 #: ../cat/virt-filesystems.pod:242
1538 msgid "B<--partitions>"
1542 #: ../cat/virt-filesystems.pod:244
1544 "Display partitions. In this mode, these are displayed irrespective of "
1545 "whether the partitions contain filesystems."
1549 #: ../cat/virt-filesystems.pod:247
1554 #: ../cat/virt-filesystems.pod:249
1555 msgid "B<--physvols>"
1559 #: ../cat/virt-filesystems.pod:251
1560 msgid "B<--physical-volumes>"
1564 #: ../cat/virt-filesystems.pod:253
1565 msgid "Display LVM physical volumes."
1569 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1574 #: ../cat/virt-filesystems.pod:257
1579 #: ../cat/virt-filesystems.pod:259
1580 msgid "In I<--long> mode, display UUIDs as well."
1584 #: ../cat/virt-filesystems.pod:273
1589 #: ../cat/virt-filesystems.pod:275
1590 msgid "B<--volgroups>"
1594 #: ../cat/virt-filesystems.pod:277
1595 msgid "B<--volume-groups>"
1599 #: ../cat/virt-filesystems.pod:279
1600 msgid "Display LVM volume groups."
1604 #: ../cat/virt-filesystems.pod:287
1609 #: ../cat/virt-filesystems.pod:289
1611 "Note that columns in the output are subject to reordering and change in "
1612 "future versions of this tool."
1616 #: ../cat/virt-filesystems.pod:294
1621 #: ../cat/virt-filesystems.pod:296
1622 msgid "The filesystem, partition, block device or LVM name."
1626 #: ../cat/virt-filesystems.pod:298
1628 "For device and partition names these are displayed as canonical libguestfs "
1629 "names, so that for example C</dev/sda2> is the second partition on the first "
1634 #: ../cat/virt-filesystems.pod:302
1636 "If the I<--long> option is B<not> specified, then only the name column is "
1637 "shown in the output."
1641 #: ../cat/virt-filesystems.pod:305
1646 #: ../cat/virt-filesystems.pod:307
1647 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1651 #: ../cat/virt-filesystems.pod:309
1656 #: ../cat/virt-filesystems.pod:311
1658 "If there is a filesystem, then this column displays the filesystem type if "
1659 "one could be detected, eg. C<ext4>."
1663 #: ../cat/virt-filesystems.pod:314
1668 #: ../cat/virt-filesystems.pod:316
1670 "If the object has a label (used for identifying and mounting filesystems) "
1671 "then this column contains the label."
1675 #: ../cat/virt-filesystems.pod:319
1680 #: ../cat/virt-filesystems.pod:321
1682 "The partition type byte, displayed as a two digit hexadecimal number. A "
1683 "comprehensive list of partition types can be found here: "
1684 "L<http://www.win.tue.nl/~aeb/partitions/partition_types-1.html>"
1688 #: ../cat/virt-filesystems.pod:325
1689 msgid "This is only applicable for DOS (MBR) partitions."
1693 #: ../cat/virt-filesystems.pod:327
1698 #: ../cat/virt-filesystems.pod:329
1700 "The size of the object in bytes. If the I<--human> option is used then the "
1701 "size is displayed in a human-readable form."
1705 #: ../cat/virt-filesystems.pod:332
1710 #: ../cat/virt-filesystems.pod:334
1712 "The parent column records the parent relationship between objects. For "
1713 "example, if the object is a partition, then this column contains the name of "
1714 "the containing device. If the object is a logical volume, then this column "
1715 "is the name of the volume group."
1719 #: ../cat/virt-filesystems.pod:339
1724 #: ../cat/virt-filesystems.pod:341
1726 "If the object has a UUID (used for identifying and mounting filesystems and "
1727 "block devices) then this column contains the UUID as a string."
1731 #: ../cat/virt-filesystems.pod:345
1732 msgid "The UUID is only displayed if the I<--uuid> option is given."
1736 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:459 ../df/virt-df.pod:191
1737 msgid "NOTE ABOUT CSV FORMAT"
1741 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:461 ../df/virt-df.pod:193
1743 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1744 "should be easy to parse, but it is definitely not easy to parse."
1748 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:464 ../df/virt-df.pod:196
1750 "Myth: Just split fields at commas. Reality: This does I<not> work "
1751 "reliably. This example has two columns:"
1755 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:467 ../df/virt-df.pod:199
1758 " \"foo,bar\",baz\n"
1763 #: ../cat/virt-filesystems.pod:359 ../cat/virt-ls.pod:469 ../df/virt-df.pod:201
1765 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1766 "reliably. This example has one row:"
1770 #: ../cat/virt-filesystems.pod:362 ../cat/virt-ls.pod:472 ../df/virt-df.pod:204
1779 #: ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:475 ../df/virt-df.pod:207
1781 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1782 "packaged in major Linux distributions)."
1786 #: ../cat/virt-filesystems.pod:368 ../cat/virt-ls.pod:478 ../df/virt-df.pod:210
1788 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1789 "or Python's built-in csv library)."
1793 #: ../cat/virt-filesystems.pod:371 ../cat/virt-ls.pod:481 ../df/virt-df.pod:213
1794 msgid "Most spreadsheets and databases can import CSV directly."
1798 #: ../cat/virt-filesystems.pod:387
1800 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
1801 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, "
1802 "L<http://libguestfs.org/>."
1806 #: ../cat/virt-filesystems.pod:402 ../tools/virt-win-reg.pl:789
1807 msgid "Copyright (C) 2010 Red Hat Inc."
1811 #: ../cat/virt-ls.pod:5
1812 msgid "virt-ls - List files in a virtual machine"
1816 #: ../cat/virt-ls.pod:9
1819 " virt-ls [--options] -d domname directory [directory ...]\n"
1824 #: ../cat/virt-ls.pod:11
1827 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory "
1833 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
1838 #: ../cat/virt-ls.pod:15
1841 " virt-ls [--options] domname directory\n"
1846 #: ../cat/virt-ls.pod:17
1849 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1854 #: ../cat/virt-ls.pod:21
1856 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1857 "more from a virtual machine or disk image."
1861 #: ../cat/virt-ls.pod:24
1863 "Multiple directory names can be given, in which case the output from each is "
1868 #: ../cat/virt-ls.pod:27
1870 "To list directories from a libvirt guest use the I<-d> option to specify the "
1871 "name of the guest. For a disk image, use the I<-a> option."
1875 #: ../cat/virt-ls.pod:31
1877 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1878 "may need to use L<guestfish(1)>, or write a program directly to the "
1879 "L<guestfs(3)> API."
1883 #: ../cat/virt-ls.pod:37
1884 msgid "Get a list of all files and directories in a virtual machine:"
1888 #: ../cat/virt-ls.pod:39
1891 " virt-ls -R -d guest /\n"
1896 #: ../cat/virt-ls.pod:41
1897 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1901 #: ../cat/virt-ls.pod:43
1904 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1909 #: ../cat/virt-ls.pod:45
1910 msgid "List all public-writable directories in a Linux virtual machine:"
1914 #: ../cat/virt-ls.pod:47
1917 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1922 #: ../cat/virt-ls.pod:49
1923 msgid "List all Unix domain sockets in a Linux virtual machine:"
1927 #: ../cat/virt-ls.pod:51
1930 " virt-ls -lR -d guest / | grep '^s'\n"
1935 #: ../cat/virt-ls.pod:53
1936 msgid "List all regular files with filenames ending in '.png':"
1940 #: ../cat/virt-ls.pod:55
1943 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1948 #: ../cat/virt-ls.pod:57
1949 msgid "To display files larger than 10MB in home directories:"
1953 #: ../cat/virt-ls.pod:59
1956 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1961 #: ../cat/virt-ls.pod:61
1962 msgid "Find everything modified in the last 7 days:"
1966 #: ../cat/virt-ls.pod:63
1969 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1974 #: ../cat/virt-ls.pod:65
1975 msgid "Find regular files modified in the last 24 hours:"
1979 #: ../cat/virt-ls.pod:67
1982 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
1987 #: ../cat/virt-ls.pod:69
1988 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
1992 #: ../cat/virt-ls.pod:71
1994 "Find the differences between files in a guest and an earlier snapshot of the "
1999 #: ../cat/virt-ls.pod:74
2002 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
2003 " virt-ls -lR -a current.img / --uids --time-t > new\n"
2004 " diff -u old new | less\n"
2009 #: ../cat/virt-ls.pod:78
2011 "The commands above won't find files where the content has changed but the "
2012 "metadata (eg. file size and modification date) is the same. To do that, you "
2013 "need to add the I<--checksum> parameter to both C<virt-ls> commands. "
2014 "I<--checksum> can be quite slow since it has to read and compute a checksum "
2015 "of every regular file in the virtual machine."
2019 #: ../cat/virt-ls.pod:84
2020 msgid "OUTPUT MODES"
2024 #: ../cat/virt-ls.pod:86
2026 "C<virt-ls> has four output modes, controlled by different combinations of "
2027 "the I<-l> and I<-R> options."
2031 #: ../cat/virt-ls.pod:89
2032 msgid "SIMPLE LISTING"
2036 #: ../cat/virt-ls.pod:91
2037 msgid "A simple listing is like the ordinary L<ls(1)> command:"
2041 #: ../cat/virt-ls.pod:93
2044 " $ virt-ls -d guest /\n"
2052 #: ../cat/virt-ls.pod:98
2053 msgid "LONG LISTING"
2057 #: ../cat/virt-ls.pod:100
2059 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
2060 "(more specifically, like the C<guestfs_ll> function)."
2064 #: ../cat/virt-ls.pod:103
2067 " $ virt-ls -l -d guest /\n"
2069 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2070 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2076 #: ../cat/virt-ls.pod:109
2078 "Note that while this is useful for displaying a directory, do not try "
2079 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2084 #: ../cat/virt-ls.pod:113
2085 msgid "RECURSIVE LISTING"
2089 #: ../cat/virt-ls.pod:115
2091 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2092 "and directories recursively:"
2096 #: ../cat/virt-ls.pod:118
2099 " $ virt-ls -R -d guest /tmp\n"
2107 #: ../cat/virt-ls.pod:123
2109 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2110 "converts C<\\0> characters to C<\\n>."
2114 #: ../cat/virt-ls.pod:126
2115 msgid "RECURSIVE LONG LISTING"
2119 #: ../cat/virt-ls.pod:128
2121 "Using I<-lR> options together changes the output to display directories "
2122 "recursively, with file stats, and optionally other features such as "
2123 "checksums and extended attributes."
2127 #: ../cat/virt-ls.pod:132
2129 "Most of the interesting features of C<virt-ls> are only available when using "
2134 #: ../cat/virt-ls.pod:135
2136 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2137 "you cannot use the output in another program (because filenames can contain "
2138 "spaces and other unsafe characters). If the guest was untrusted and someone "
2139 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2140 "on you by creating filenames with embedded newline characters. To B<safely> "
2141 "parse the output in another program, use the I<--csv> (Comma-Separated "
2146 #: ../cat/virt-ls.pod:143
2148 "Note that this output format is completely unrelated to the C<ls -lR> "
2153 #: ../cat/virt-ls.pod:146
2156 " $ virt-ls -lR -d guest /bin\n"
2157 " d 0555 4096 /bin\n"
2158 " - 0755 123 /bin/alsaunmute\n"
2159 " - 0755 28328 /bin/arch\n"
2160 " l 0777 4 /bin/awk -> gawk\n"
2161 " - 0755 27216 /bin/basename\n"
2162 " - 0755 943360 /bin/bash\n"
2168 #: ../cat/virt-ls.pod:155
2169 msgid "These basic fields are always shown:"
2173 #: ../cat/virt-ls.pod:159
2178 #: ../cat/virt-ls.pod:161
2180 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2181 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2182 "link), C<s> (socket) or C<u> (unknown)."
2186 #: ../cat/virt-ls.pod:171
2191 #: ../cat/virt-ls.pod:173
2192 msgid "The Unix permissions, displayed as a 4 digit octal number."
2196 #: ../cat/virt-ls.pod:175
2201 #: ../cat/virt-ls.pod:177
2203 "The size of the file. This is shown in bytes unless I<-h> or "
2204 "I<--human-readable> option is given, in which case this is shown as a "
2205 "human-readable number."
2209 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4395
2214 #: ../cat/virt-ls.pod:183
2215 msgid "The full path of the file or directory."
2219 #: ../cat/virt-ls.pod:185
2224 #: ../cat/virt-ls.pod:187
2225 msgid "For symbolic links only, the link target."
2229 #: ../cat/virt-ls.pod:191
2231 "In I<-lR> mode, additional command line options enable the display of more "
2236 #: ../cat/virt-ls.pod:194
2238 "With the I<--uids> flag, these additional fields are displayed before the "
2243 #: ../cat/virt-ls.pod:199
2248 #: ../cat/virt-ls.pod:201
2253 #: ../cat/virt-ls.pod:203
2255 "The UID and GID of the owner of the file (displayed numerically). Note "
2256 "these only make sense in the context of a Unix-like guest."
2260 #: ../cat/virt-ls.pod:208
2261 msgid "With the I<--times> flag, these additional fields are displayed:"
2265 #: ../cat/virt-ls.pod:212
2270 #: ../cat/virt-ls.pod:214
2271 msgid "The time of last access."
2275 #: ../cat/virt-ls.pod:216
2280 #: ../cat/virt-ls.pod:218
2281 msgid "The time of last modification."
2285 #: ../cat/virt-ls.pod:220
2290 #: ../cat/virt-ls.pod:222
2291 msgid "The time of last status change."
2295 #: ../cat/virt-ls.pod:226
2297 "The time fields are displayed as string dates and times, unless one of the "
2298 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2302 #: ../cat/virt-ls.pod:229
2303 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2307 #: ../cat/virt-ls.pod:233
2312 #: ../cat/virt-ls.pod:235
2314 "The device containing the file (displayed as major:minor). This may not "
2315 "match devices as known to the guest."
2319 #: ../cat/virt-ls.pod:238
2324 #: ../cat/virt-ls.pod:240
2325 msgid "The inode number."
2329 #: ../cat/virt-ls.pod:242
2334 #: ../cat/virt-ls.pod:244
2335 msgid "The number of hard links."
2339 #: ../cat/virt-ls.pod:246
2344 #: ../cat/virt-ls.pod:248
2345 msgid "For block and char special files, the device (displayed as major:minor)."
2349 #: ../cat/virt-ls.pod:251
2354 #: ../cat/virt-ls.pod:253
2355 msgid "The number of 512 byte blocks allocated to the file."
2359 #: ../cat/virt-ls.pod:257
2361 "With the I<--checksum> flag, the checksum of the file contents is shown "
2362 "(only for regular files). Computing file checksums can take a considerable "
2367 #: ../cat/virt-ls.pod:280
2368 msgid "B<--checksum>"
2372 #: ../cat/virt-ls.pod:282
2373 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2377 #: ../cat/virt-ls.pod:284
2379 "Display checksum over file contents for regular files. With no argument, "
2380 "this defaults to using I<md5>. Using an argument, you can select the "
2381 "checksum type to use."
2385 #: ../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
2387 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2392 #: ../cat/virt-ls.pod:316
2394 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2395 "so you cannot see what you are typing. If you are not worried about Tempest "
2396 "attacks and there is no one else in the room you can specify this flag to "
2397 "see what you are typing."
2401 #: ../cat/virt-ls.pod:321
2402 msgid "B<--extra-stats>"
2406 #: ../cat/virt-ls.pod:323
2407 msgid "Display extra stats."
2411 #: ../cat/virt-ls.pod:339
2414 " virt-ls --format=raw -a disk.img /dir\n"
2419 #: ../cat/virt-ls.pod:343
2422 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2427 #: ../cat/virt-ls.pod:356
2428 msgid "Display file sizes in human-readable format."
2432 #: ../cat/virt-ls.pod:370
2437 #: ../cat/virt-ls.pod:372
2438 msgid "B<--recursive>"
2442 #: ../cat/virt-ls.pod:374
2444 "Select the mode. With neither of these options, C<virt-ls> produces a "
2445 "simple, flat list of the files in the named directory. See L</SIMPLE "
2450 #: ../cat/virt-ls.pod:378
2452 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See "
2457 #: ../cat/virt-ls.pod:381
2459 "C<virt-ls -R> produces a recursive list of files starting at the named "
2460 "directory. See L</RECURSIVE LISTING>."
2464 #: ../cat/virt-ls.pod:384
2466 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2467 "parsed. See L</RECURSIVE LONG LISTING>."
2471 #: ../cat/virt-ls.pod:387
2476 #: ../cat/virt-ls.pod:389
2477 msgid "Display time fields."
2481 #: ../cat/virt-ls.pod:394
2482 msgid "B<--time-days>"
2486 #: ../cat/virt-ls.pod:396
2487 msgid "Display time fields as days before now (negative if in the future)."
2491 #: ../cat/virt-ls.pod:398
2493 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2494 "of the file is between 0 and 86399 seconds."
2498 #: ../cat/virt-ls.pod:404
2499 msgid "B<--time-relative>"
2503 #: ../cat/virt-ls.pod:406
2504 msgid "Display time fields as seconds before now (negative if in the future)."
2508 #: ../cat/virt-ls.pod:411
2513 #: ../cat/virt-ls.pod:413
2514 msgid "Display time fields as seconds since the Unix epoch."
2518 #: ../cat/virt-ls.pod:418
2523 #: ../cat/virt-ls.pod:420
2524 msgid "Display UID and GID fields."
2528 #: ../cat/virt-ls.pod:445
2529 msgid "Previous versions of virt-ls allowed you to write either:"
2533 #: ../cat/virt-ls.pod:447
2536 " virt-ls disk.img [disk.img ...] /dir\n"
2541 #: ../cat/virt-ls.pod:451
2544 " virt-ls guestname /dir\n"
2549 #: ../cat/virt-ls.pod:497
2551 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, "
2552 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
2553 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
2557 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374 ../rescue/virt-rescue.pod:302
2558 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2562 #: ../clone/virt-sysprep.pod:5
2563 msgid "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
2567 #: ../clone/virt-sysprep.pod:9
2570 " virt-sysprep [--options] -d domname\n"
2575 #: ../clone/virt-sysprep.pod:11
2578 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
2583 #: ../clone/virt-sysprep.pod:15
2585 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
2586 "can be made from it. Steps in this process include removing SSH host keys, "
2587 "removing persistent network MAC configuration, and removing user accounts. "
2588 "Each step can be enabled or disabled as required."
2592 #: ../clone/virt-sysprep.pod:21
2594 "Virt-sysprep is a simple shell script, allowing easy inspection or "
2595 "customization by the system administrator."
2599 #: ../clone/virt-sysprep.pod:24
2601 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
2602 "be shut down. If you want to preserve the existing contents of the guest, "
2603 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> "
2608 #: ../clone/virt-sysprep.pod:29
2610 "You do I<not> need to run virt-sysprep as root. In fact we'd generally "
2611 "recommend that you don't. The time you might want to run it as root is when "
2612 "you need root in order to access the disk image, but even in this case it "
2613 "would be better to change the permissions on the disk image to be writable "
2614 "as the non-root user running virt-sysprep."
2618 #: ../clone/virt-sysprep.pod:35
2620 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
2621 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
2622 "machines in preparation for cloning them. Having said that, virt-sysprep "
2623 "does I<not> currently work on Microsoft Windows guests. We plan to support "
2624 "Windows sysprepping in a future version, and we already have code to do it."
2628 #: ../clone/virt-sysprep.pod:76
2629 msgid "B<--enable=...>"
2633 #: ../clone/virt-sysprep.pod:78
2635 "Choose which sysprep operations to perform. Give a comma-separated list of "
2636 "operations, for example:"
2640 #: ../clone/virt-sysprep.pod:81
2643 " --enable=ssh-hostkeys,udev-persistent-net\n"
2648 #: ../clone/virt-sysprep.pod:83
2649 msgid "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
2653 #: ../clone/virt-sysprep.pod:85
2655 "If the I<--enable> option is not given, then we default to trying all "
2656 "possible sysprep operations. But some sysprep operations are skipped for "
2661 #: ../clone/virt-sysprep.pod:89
2663 "Use I<--list-operations> to list operations supported by a particular "
2664 "version of virt-sysprep."
2668 #: ../clone/virt-sysprep.pod:92
2669 msgid "See L</OPERATIONS> below for a list and an explanation of each operation."
2673 #: ../clone/virt-sysprep.pod:106
2676 " virt-sysprep --format=raw -a disk.img\n"
2681 #: ../clone/virt-sysprep.pod:110
2684 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
2689 #: ../clone/virt-sysprep.pod:119
2690 msgid "B<--hostname> newhostname"
2694 #: ../clone/virt-sysprep.pod:121
2696 "Change the hostname. See the L</hostname> operation below. If not given, "
2697 "defaults to C<localhost.localdomain>."
2701 #: ../clone/virt-sysprep.pod:124
2702 msgid "B<--list-operations>"
2706 #: ../clone/virt-sysprep.pod:126
2707 msgid "List the operations supported by the virt-sysprep program."
2711 #: ../clone/virt-sysprep.pod:128
2712 msgid "B<--selinux-relabel>"
2716 #: ../clone/virt-sysprep.pod:130
2717 msgid "B<--no-selinux-relabel>"
2721 #: ../clone/virt-sysprep.pod:132
2723 "I<--selinux-relabel> forces SELinux relabelling next time the guest boots. "
2724 "I<--no-selinux-relabel> disables relabelling."
2728 #: ../clone/virt-sysprep.pod:135
2730 "The default is to try to detect if SELinux relabelling is required. See "
2731 "L</SELINUX RELABELLING> below for more details."
2735 #: ../clone/virt-sysprep.pod:156
2740 #: ../clone/virt-sysprep.pod:158
2742 "If the I<--enable> option is I<not> given, then I<all sysprep operations are "
2743 "enabled>, although some are skipped depending on the type of guest."
2747 #: ../clone/virt-sysprep.pod:162
2749 "Operations can be individually enabled using the I<--enable> option. Use a "
2750 "comma-separated list, for example:"
2754 #: ../clone/virt-sysprep.pod:165
2757 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
2762 #: ../clone/virt-sysprep.pod:167
2764 "To list the operations supported by the current version of virt-sysprep, use "
2765 "I<--list-operations>."
2769 #: ../clone/virt-sysprep.pod:170
2771 "Future versions of virt-sysprep may add more operations. If you are using "
2772 "virt-sysprep and want predictable behaviour, specify only the operations "
2773 "that you want to have enabled."
2777 #: ../clone/virt-sysprep.pod:174
2782 #: ../clone/virt-sysprep.pod:176
2783 msgid "Remove user at-jobs and cron-jobs."
2787 #: ../clone/virt-sysprep.pod:178
2788 msgid "dhcp-client-state"
2792 #: ../clone/virt-sysprep.pod:180
2793 msgid "Remove DHCP client leases."
2797 #: ../clone/virt-sysprep.pod:182
2798 msgid "dhcp-server-state"
2802 #: ../clone/virt-sysprep.pod:184
2803 msgid "Remove DHCP server leases."
2807 #: ../clone/virt-sysprep.pod:186
2812 #: ../clone/virt-sysprep.pod:188
2814 "Changes the hostname of the guest to the value given in the I<--hostname> "
2819 #: ../clone/virt-sysprep.pod:191
2821 "If the I<--hostname> parameter is not given, then the hostname is changed to "
2822 "C<localhost.localdomain>."
2826 #: ../clone/virt-sysprep.pod:194
2831 #: ../clone/virt-sysprep.pod:196
2832 msgid "Remove many log files."
2836 #: ../clone/virt-sysprep.pod:198
2841 #: ../clone/virt-sysprep.pod:200
2842 msgid "Remove email from the local mail spool directory."
2846 #: ../clone/virt-sysprep.pod:202
2851 #: ../clone/virt-sysprep.pod:204
2853 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
2854 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
2858 #: ../clone/virt-sysprep.pod:207
2863 #: ../clone/virt-sysprep.pod:209
2865 "Write some random bytes from the host into the random seed file of the "
2870 #: ../clone/virt-sysprep.pod:212
2871 msgid "See L</RANDOM SEED> below."
2875 #: ../clone/virt-sysprep.pod:214
2876 msgid "rhn-systemid"
2880 #: ../clone/virt-sysprep.pod:216
2881 msgid "Remove the RHN system ID."
2885 #: ../clone/virt-sysprep.pod:218
2890 #: ../clone/virt-sysprep.pod:220
2891 msgid "Remove the Smolt hardware UUID."
2895 #: ../clone/virt-sysprep.pod:222
2896 msgid "ssh-hostkeys"
2900 #: ../clone/virt-sysprep.pod:224
2901 msgid "Remove the SSH host keys in the guest."
2905 #: ../clone/virt-sysprep.pod:226
2907 "The SSH host keys are regenerated (differently) next time the guest is "
2912 #: ../clone/virt-sysprep.pod:229
2914 "If, after cloning, the guest gets the same IP address, ssh will give you a "
2915 "stark warning about the host key changing:"
2919 #: ../clone/virt-sysprep.pod:232
2922 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2923 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
2924 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2925 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
2930 #: ../clone/virt-sysprep.pod:237
2931 msgid "udev-persistent-net"
2935 #: ../clone/virt-sysprep.pod:239
2937 "Remove udev persistent net rules which map the guest's existing MAC address "
2938 "to a fixed ethernet device (eg. eth0)."
2942 #: ../clone/virt-sysprep.pod:242
2944 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
2945 "address occupies the old name (eg. eth0), this means the fresh MAC address "
2946 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
2947 "Erasing the udev persistent net rules avoids this."
2951 #: ../clone/virt-sysprep.pod:247
2956 #: ../clone/virt-sysprep.pod:249
2957 msgid "Remove the utmp file."
2961 #: ../clone/virt-sysprep.pod:251
2963 "This records who is currently logged in on a machine. In modern Linux "
2964 "distros it is stored in a ramdisk and hence not part of the virtual "
2965 "machine's disk, but it was stored on disk in older distros."
2969 #: ../clone/virt-sysprep.pod:255
2974 #: ../clone/virt-sysprep.pod:257
2975 msgid "Remove the yum UUID."
2979 #: ../clone/virt-sysprep.pod:259
2981 "Yum creates a fresh UUID the next time it runs when it notices that the "
2982 "original UUID has been erased."
2986 #: ../clone/virt-sysprep.pod:262
2987 msgid "COPYING AND CLONING"
2991 #: ../clone/virt-sysprep.pod:264
2993 "Virt-sysprep can be used as part of a process of cloning guests, or to "
2994 "prepare a template from which guests can be cloned. There are many "
2995 "different ways to achieve this using the virt tools, and this section is "
2996 "just an introduction."
3000 #: ../clone/virt-sysprep.pod:269
3001 msgid "A virtual machine (when switched off) consists of two parts:"
3005 #: ../clone/virt-sysprep.pod:273
3006 msgid "I<configuration>"
3010 #: ../clone/virt-sysprep.pod:275
3012 "The configuration or description of the guest. eg. The libvirt XML (see "
3013 "C<virsh dumpxml>), the running configuration of the guest, or another "
3014 "external format like OVF."
3018 #: ../clone/virt-sysprep.pod:279
3019 msgid "Some configuration items that might need to be changed:"
3023 #: ../clone/virt-sysprep.pod:285
3028 #: ../clone/virt-sysprep.pod:289 ../clone/virt-sysprep.pod:316
3033 #: ../clone/virt-sysprep.pod:293
3034 msgid "path to block device(s)"
3038 #: ../clone/virt-sysprep.pod:297
3039 msgid "network card MAC address"
3043 #: ../clone/virt-sysprep.pod:301
3044 msgid "I<block device(s)>"
3048 #: ../clone/virt-sysprep.pod:303
3050 "One or more hard disk images, themselves containing files, directories, "
3051 "applications, kernels, configuration, etc."
3055 #: ../clone/virt-sysprep.pod:306
3056 msgid "Some things inside the block devices that might need to be changed:"
3060 #: ../clone/virt-sysprep.pod:312
3061 msgid "hostname and other net configuration"
3065 #: ../clone/virt-sysprep.pod:320
3066 msgid "SSH host keys"
3070 #: ../clone/virt-sysprep.pod:324
3071 msgid "Windows unique security ID (SID)"
3075 #: ../clone/virt-sysprep.pod:328
3076 msgid "Puppet registration"
3080 #: ../clone/virt-sysprep.pod:334
3081 msgid "COPYING THE BLOCK DEVICE"
3085 #: ../clone/virt-sysprep.pod:336
3087 "Starting with an original guest, you probably wish to copy the guest block "
3088 "device and its configuration to make a template. Then once you are happy "
3089 "with the template, you will want to make many clones from it."
3093 #: ../clone/virt-sysprep.pod:341
3099 " original guest --------> template ---------->\n"
3100 " \\------> cloned\n"
3101 " \\-----> guests\n"
3107 #: ../clone/virt-sysprep.pod:349
3109 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3114 #: ../clone/virt-sysprep.pod:352
3118 " original guest --------> template ---------->\n"
3119 " \\------> cloned\n"
3120 " \\-----> guests\n"
3126 #: ../clone/virt-sysprep.pod:358
3127 msgid "There are some smarter (and faster) ways too:"
3131 #: ../clone/virt-sysprep.pod:364
3135 " template ---------->\n"
3136 " \\------> cloned\n"
3137 " \\-----> guests\n"
3143 #: ../clone/virt-sysprep.pod:370
3145 "Use the block device as a backing file and create a snapshot on top for each "
3146 "guest. The advantage is that you don't need to copy the block device (very "
3147 "fast) and only changes are stored (less storage required)."
3151 #: ../clone/virt-sysprep.pod:375
3153 "Note that writing to the backing file once you have created guests on top of "
3154 "it is not possible: you will corrupt the guests."
3158 #: ../clone/virt-sysprep.pod:378
3160 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 "
3161 "-o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3162 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3163 "also create cheap snapshots from files or LUNs."
3167 #: ../clone/virt-sysprep.pod:386
3168 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3172 #: ../clone/virt-sysprep.pod:390
3173 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3177 #: ../clone/virt-sysprep.pod:394
3182 #: ../clone/virt-sysprep.pod:396
3184 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3185 "and/or modify the external libvirt configuration of a guest. It will reset "
3186 "the name, UUID and MAC address of the guest in the libvirt XML."
3190 #: ../clone/virt-sysprep.pod:401
3192 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3193 "image. This was the original motivation to write virt-sysprep."
3197 #: ../clone/virt-sysprep.pod:404
3202 #: ../clone/virt-sysprep.pod:406
3206 " original guest --------> template\n"
3211 #: ../clone/virt-sysprep.pod:409
3213 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3214 "it easier to compress and/or faster to copy."
3218 #: ../clone/virt-sysprep.pod:412
3220 "Notice that since virt-sparsify also copies the image, you can use it to "
3221 "make the initial copy (instead of C<dd>)."
3225 #: ../clone/virt-sysprep.pod:415
3230 #: ../clone/virt-sysprep.pod:417
3234 " template ---------->\n"
3235 " \\------> cloned\n"
3236 " \\-----> guests\n"
3242 #: ../clone/virt-sysprep.pod:423
3244 "If you want to give people cloned guests, but let them pick the size of the "
3245 "guest themselves (eg. depending on how much they are prepared to pay for "
3246 "disk space), then instead of copying the template, you can run "
3247 "L<virt-resize(1)>. Virt-resize performs a copy and resize, and thus is "
3248 "ideal for cloning guests from a template."
3252 #: ../clone/virt-sysprep.pod:429 ../src/guestfs.pod:1164
3257 #: ../clone/virt-sysprep.pod:431
3259 "Although virt-sysprep removes some sensitive information from the guest, it "
3260 "does not pretend to remove all of it. You should examine the L</OPERATIONS> "
3261 "above, and the implementation of the operations in the shell script. You "
3262 "should also examine the guest afterwards."
3266 #: ../clone/virt-sysprep.pod:436
3268 "Sensitive files are simply removed. The data they contained may still exist "
3269 "on the disk, easily recovered with a hex editor or undelete tool. Use "
3270 "L<virt-sparsify(1)> as one way to remove this content. See also the "
3271 "L<scrub(1)> command to get rid of deleted content in directory entries and "
3276 #: ../clone/virt-sysprep.pod:442
3281 #: ../clone/virt-sysprep.pod:444
3282 msgid "I<(This section applies to Linux guests only)>"
3286 #: ../clone/virt-sysprep.pod:446
3288 "The virt-sysprep C<random-seed> operation writes a few bytes of randomness "
3289 "from the host into the guest's random seed file."
3293 #: ../clone/virt-sysprep.pod:449
3295 "If this is just done once and the guest is cloned from the same template, "
3296 "then each guest will start with the same entropy, and things like SSH host "
3297 "keys and TCP sequence numbers may be predictable."
3301 #: ../clone/virt-sysprep.pod:453
3303 "Therefore you should arrange to add more randomness I<after> cloning from a "
3304 "template too, which can be done by just enabling the C<random-seed> "
3309 #: ../clone/virt-sysprep.pod:457
3312 " cp template.img newguest.img\n"
3313 " virt-sysprep --enable=random-seed -a newguest.img\n"
3318 #: ../clone/virt-sysprep.pod:460
3319 msgid "SELINUX RELABELLING"
3323 #: ../clone/virt-sysprep.pod:462
3324 msgid "I<(This section applies to Linux guests using SELinux only)>"
3328 #: ../clone/virt-sysprep.pod:464
3330 "If any new files are created by virt-sysprep, then virt-sysprep touches "
3331 "C</.autorelabel> so that these will be correctly labelled by SELinux the "
3332 "next time the guest is booted. This process interrupts boot and can take "
3337 #: ../clone/virt-sysprep.pod:469
3339 "You can force relabelling for all guests by supplying the "
3340 "I<--selinux-relabel> option."
3344 #: ../clone/virt-sysprep.pod:472
3346 "You can disable relabelling entirely by supplying the "
3347 "I<--no-selinux-relabel> option."
3351 #: ../clone/virt-sysprep.pod:484
3352 msgid "This program returns 0 on success, or 1 if there was an error."
3356 #: ../clone/virt-sysprep.pod:488
3358 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, "
3359 "L<virt-resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<lvcreate(8)>, "
3360 "L<qemu-img(1)>, L<scrub(1)>, L<http://libguestfs.org/>, "
3361 "L<http://libvirt.org/>."
3365 #: ../df/virt-df.pod:5
3366 msgid "virt-df - Display free space on virtual filesystems"
3370 #: ../df/virt-df.pod:9
3373 " virt-df [--options]\n"
3378 #: ../df/virt-df.pod:11
3381 " virt-df [--options] -d domname\n"
3386 #: ../df/virt-df.pod:13
3389 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3394 #: ../df/virt-df.pod:17
3397 " virt-df [--options] domname\n"
3402 #: ../df/virt-df.pod:19
3405 " virt-df [--options] disk.img [disk.img ...]\n"
3410 #: ../df/virt-df.pod:23
3412 "C<virt-df> is a command line tool to display free space on virtual machine "
3413 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3414 "allocated to a virtual machine, but can look inside disk images to see how "
3415 "much space is really being used."
3419 #: ../df/virt-df.pod:28
3421 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3422 "to get a list of all active and inactive guests, and performs a C<df>-type "
3423 "operation on each one in turn, printing out the results."
3427 #: ../df/virt-df.pod:32
3429 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a "
3430 "C<df>-type operation on either the single named libvirt domain, or on the "
3431 "disk image(s) listed on the command line (which must all belong to a single "
3432 "VM). In this mode (with arguments), C<virt-df> will I<only work for a "
3433 "single guest>. If you want to run on multiple guests, then you have to "
3434 "invoke C<virt-df> multiple times."
3438 #: ../df/virt-df.pod:39
3440 "Use the I<--csv> option to get a format which can be easily parsed by other "
3441 "programs. Other options are similar to the standard L<df(1)> command."
3445 #: ../df/virt-df.pod:45
3447 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3448 "output human-readable:"
3452 #: ../df/virt-df.pod:48
3455 " # virt-df -d F14x64 -h\n"
3456 " Filesystem Size Used Available Use%\n"
3457 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3458 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3463 #: ../df/virt-df.pod:53
3464 msgid "Show disk usage for a disk image file called C<test.img>:"
3468 #: ../df/virt-df.pod:55
3471 " $ virt-df -a test1.img\n"
3472 " Filesystem 1K-blocks Used Available Use%\n"
3473 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3478 #: ../df/virt-df.pod:112
3481 " virt-df --format=raw -a disk.img\n"
3486 #: ../df/virt-df.pod:116
3489 " virt-df --format=raw -a disk.img --format -a another.img\n"
3494 #: ../df/virt-df.pod:129
3495 msgid "Print sizes in human-readable format."
3499 #: ../df/virt-df.pod:131
3500 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3504 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:164
3509 #: ../df/virt-df.pod:135
3514 #: ../df/virt-df.pod:137
3515 msgid "Print inodes instead of blocks."
3519 #: ../df/virt-df.pod:139
3520 msgid "B<--one-per-guest>"
3524 #: ../df/virt-df.pod:141
3526 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3527 "disks from several guests to a single libguestfs appliance."
3531 #: ../df/virt-df.pod:144
3532 msgid "You might use this option in the following circumstances:"
3536 #: ../df/virt-df.pod:150
3538 "If you think an untrusted guest might actively try to exploit the libguestfs "
3539 "appliance kernel, then this prevents one guest from interfering with the "
3540 "stats printed for another guest."
3544 #: ../df/virt-df.pod:156
3546 "If the kernel has a bug which stops it from accessing a filesystem in one "
3547 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3548 "and report stats for further guests."
3552 #: ../df/virt-df.pod:165
3554 "Print UUIDs instead of names. This is useful for following a guest even "
3555 "when the guest is migrated or renamed, or when two guests happen to have the "
3560 #: ../df/virt-df.pod:169
3562 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3563 "images, we still print the disk image name even when this option is "
3568 #: ../df/virt-df.pod:229
3570 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
3571 "L<http://libguestfs.org/>."
3575 #: ../edit/virt-edit.pod:5
3576 msgid "virt-edit - Edit a file in a virtual machine"
3580 #: ../edit/virt-edit.pod:9
3583 " virt-edit [--options] -d domname file [file ...]\n"
3588 #: ../edit/virt-edit.pod:11
3591 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
3596 #: ../edit/virt-edit.pod:13
3599 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
3604 #: ../edit/virt-edit.pod:17
3607 " virt-edit domname file\n"
3612 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
3615 " virt-edit disk.img [disk.img ...] file\n"
3620 #: ../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
3625 #: ../edit/virt-edit.pod:23
3627 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
3628 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
3629 "doing this, but doesn't catch all cases."
3633 #: ../edit/virt-edit.pod:29
3635 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
3636 "exists in the named virtual machine (or disk image)."
3640 #: ../edit/virt-edit.pod:32
3642 "Multiple filenames can be given, in which case they are each edited in "
3643 "turn. Each filename must be a full path, starting at the root directory "
3644 "(starting with '/')."
3648 #: ../edit/virt-edit.pod:36
3649 msgid "If you want to just view a file, use L<virt-cat(1)>."
3653 #: ../edit/virt-edit.pod:38
3655 "For more complex cases you should look at the L<guestfish(1)> tool (see "
3656 "L</USING GUESTFISH> below)."
3660 #: ../edit/virt-edit.pod:41
3662 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
3663 "that and much more."
3667 #: ../edit/virt-edit.pod:46
3668 msgid "Edit the named files interactively:"
3672 #: ../edit/virt-edit.pod:48
3675 " virt-edit -d mydomain /boot/grub/grub.conf\n"
3680 #: ../edit/virt-edit.pod:50
3683 " virt-edit -d mydomain /etc/passwd\n"
3688 #: ../edit/virt-edit.pod:52
3689 msgid "For Windows guests, some Windows paths are understood:"
3693 #: ../edit/virt-edit.pod:54
3696 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
3701 #: ../edit/virt-edit.pod:56
3703 "If Perl is installed, you can also edit files non-interactively (see "
3704 "L</NON-INTERACTIVE EDITING> below). To change the init default level to 5:"
3708 #: ../edit/virt-edit.pod:60
3711 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
3716 #: ../edit/virt-edit.pod:81
3717 msgid "B<-b> extension"
3721 #: ../edit/virt-edit.pod:83
3722 msgid "B<--backup> extension"
3726 #: ../edit/virt-edit.pod:85
3728 "Create a backup of the original file I<in the guest disk image>. The backup "
3729 "has the original filename with C<extension> added."
3733 #: ../edit/virt-edit.pod:88
3735 "Usually the first character of C<extension> would be a dot C<.> so you would "
3740 #: ../edit/virt-edit.pod:91
3743 " virt-edit -b .orig [etc]\n"
3748 #: ../edit/virt-edit.pod:93
3749 msgid "By default, no backup file is made."
3753 #: ../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
3758 #: ../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
3759 msgid "B<--connect URI>"
3763 #: ../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
3765 "If you specify guest block devices directly, then libvirt is not used at "
3770 #: ../edit/virt-edit.pod:114
3772 "When prompting for keys and passphrases, virt-edit normally turns echoing "
3773 "off so you cannot see what you are typing. If you are not worried about "
3774 "Tempest attacks and there is no one else in the room you can specify this "
3775 "flag to see what you are typing."
3779 #: ../edit/virt-edit.pod:119
3784 #: ../edit/virt-edit.pod:121
3785 msgid "B<--expr> EXPR"
3789 #: ../edit/virt-edit.pod:123
3791 "Instead of launching the external editor, non-interactively apply the Perl "
3792 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
3797 #: ../edit/virt-edit.pod:127
3799 "Be careful to properly quote the expression to prevent it from being altered "
3804 #: ../edit/virt-edit.pod:130
3805 msgid "Note that this option is only available when Perl 5 is installed."
3809 #: ../edit/virt-edit.pod:132
3810 msgid "B<--format> raw|qcow2|..."
3814 #: ../edit/virt-edit.pod:143
3817 " virt-edit --format=raw -a disk.img file\n"
3822 #: ../edit/virt-edit.pod:147
3825 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
3830 #: ../edit/virt-edit.pod:181
3831 msgid "Previous versions of virt-edit allowed you to write either:"
3835 #: ../edit/virt-edit.pod:187
3838 " virt-edit guestname file\n"
3843 #: ../edit/virt-edit.pod:195
3844 msgid "NON-INTERACTIVE EDITING"
3848 #: ../edit/virt-edit.pod:197
3850 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
3851 "administrator can interactively edit the file."
3855 #: ../edit/virt-edit.pod:200
3857 "There are two ways also to use C<virt-edit> from scripts in order to make "
3858 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
3859 "like this, it's less error-prone to write scripts directly using the "
3860 "libguestfs API and Augeas for configuration file editing.)"
3864 #: ../edit/virt-edit.pod:206
3866 "The first method is to temporarily set C<$EDITOR> to any script or program "
3867 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
3868 "update C<tmpfile> in place however it likes."
3872 #: ../edit/virt-edit.pod:210
3874 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
3875 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
3876 "instances of C<foo> with C<bar> in a file:"
3880 #: ../edit/virt-edit.pod:214
3883 " virt-edit -d domname filename -e 's/foo/bar/'\n"
3888 #: ../edit/virt-edit.pod:216
3890 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
3891 "For example to delete root's password you could do:"
3895 #: ../edit/virt-edit.pod:219
3898 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3903 #: ../edit/virt-edit.pod:221
3905 "What really happens is that the snippet is evaluated as a Perl expression "
3906 "for each line of the file. The line, including the final C<\\n>, is passed "
3907 "in C<$_> and the expression should update C<$_> or leave it unchanged."
3911 #: ../edit/virt-edit.pod:226
3913 "To delete a line, set C<$_> to the empty string. For example, to delete the "
3914 "C<apache> user account from the password file you can do:"
3918 #: ../edit/virt-edit.pod:229
3921 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
3926 #: ../edit/virt-edit.pod:231
3928 "To insert a line, prepend or append it to C<$_>. However appending lines to "
3929 "the end of the file is rather difficult this way since there is no concept "
3930 "of \"last line of the file\" - your expression just doesn't get called "
3931 "again. You might want to use the first method (setting C<$EDITOR>) if you "
3936 #: ../edit/virt-edit.pod:237
3938 "The variable C<$lineno> contains the current line number. As is "
3939 "traditional, the first line in the file is number C<1>."
3943 #: ../edit/virt-edit.pod:240
3945 "The return value from the expression is ignored, but the expression may call "
3946 "C<die> in order to abort the whole program, leaving the original file "
3951 #: ../edit/virt-edit.pod:244
3953 "Remember when matching the end of a line that C<$_> may contain the final "
3954 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
3955 "newline then neither of these. Thus to match or substitute some text at the "
3956 "end of a line, use this regular expression:"
3960 #: ../edit/virt-edit.pod:249
3963 " /some text(\\r?\\n)?$/\n"
3968 #: ../edit/virt-edit.pod:251
3970 "Alternately, use the perl C<chomp> function, being careful not to chomp "
3971 "C<$_> itself (since that would remove all newlines from the file):"
3975 #: ../edit/virt-edit.pod:255
3978 " my $m = $_; chomp $m; $m =~ /some text$/\n"
3983 #: ../edit/virt-edit.pod:259
3985 "C<virt-edit> has a limited ability to understand Windows drive letters and "
3986 "paths (eg. C<E:\\foo\\bar.txt>)."
3990 #: ../edit/virt-edit.pod:278
3992 "The path is resolved case insensitively to locate the file that should be "
3997 #: ../edit/virt-edit.pod:299
3999 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
4000 "C<virt-edit> doesn't work."
4004 #: ../edit/virt-edit.pod:302
4005 msgid "Using C<virt-edit> is approximately equivalent to doing:"
4009 #: ../edit/virt-edit.pod:304
4012 " guestfish --rw -i -d domname edit /file\n"
4017 #: ../edit/virt-edit.pod:306
4019 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
4024 #: ../edit/virt-edit.pod:309
4026 "The command above uses libguestfs's guest inspection feature and so does not "
4027 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
4028 "disk images that don't contain guests. To edit a file on a disk image "
4033 #: ../edit/virt-edit.pod:314
4036 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4041 #: ../edit/virt-edit.pod:316
4043 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4044 "the disk image to edit, and C</file> is the full path to the file."
4048 #: ../edit/virt-edit.pod:320
4050 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4051 "C<write> or C<upload> instead:"
4055 #: ../edit/virt-edit.pod:323
4058 " guestfish --rw -i -d domname touch /newfile\n"
4063 #: ../edit/virt-edit.pod:325
4066 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4071 #: ../edit/virt-edit.pod:327
4074 " guestfish --rw -i -d domname upload localfile /newfile\n"
4079 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1119 ../rescue/virt-rescue.pod:261 ../sparsify/virt-sparsify.pod:232 ../src/guestfs.pod:3209 ../test-tool/libguestfs-test-tool.pod:95
4080 msgid "ENVIRONMENT VARIABLES"
4084 #: ../edit/virt-edit.pod:333
4089 #: ../edit/virt-edit.pod:335
4091 "If set, this string is used as the editor. It may contain arguments, "
4092 "eg. C<\"emacs -nw\">"
4096 #: ../edit/virt-edit.pod:338
4097 msgid "If not set, C<vi> is used."
4101 #: ../edit/virt-edit.pod:356
4103 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
4104 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
4105 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4109 #: ../erlang/examples/guestfs-erlang.pod:5
4110 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4114 #: ../erlang/examples/guestfs-erlang.pod:9
4117 " {ok, G} = guestfs:create(),\n"
4118 " ok = guestfs:add_drive_opts(G, Disk,\n"
4119 " [{format, \"raw\"}, {readonly, true}]),\n"
4120 " ok = guestfs:launch(G),\n"
4121 " [Device] = guestfs:list_devices(G),\n"
4122 " ok = guestfs:close(G).\n"
4127 #: ../erlang/examples/guestfs-erlang.pod:18
4129 "This manual page documents how to call libguestfs from the Erlang "
4130 "programming language. This page just documents the differences from the C "
4131 "API and gives some examples. If you are not familiar with using libguestfs, "
4132 "you also need to read L<guestfs(3)>."
4136 #: ../erlang/examples/guestfs-erlang.pod:23
4137 msgid "OPENING AND CLOSING THE HANDLE"
4141 #: ../erlang/examples/guestfs-erlang.pod:25
4143 "The Erlang bindings are implemented using an external program called "
4144 "C<erl-guestfs>. This program must be on the current PATH, or else you "
4145 "should specify the full path to the program:"
4149 #: ../erlang/examples/guestfs-erlang.pod:29
4152 " {ok, G} = guestfs:create().\n"
4157 #: ../erlang/examples/guestfs-erlang.pod:31
4160 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4165 #: ../erlang/examples/guestfs-erlang.pod:33
4166 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4170 #: ../erlang/examples/guestfs-erlang.pod:36
4171 msgid "To close the handle:"
4175 #: ../erlang/examples/guestfs-erlang.pod:38
4178 " ok = guestfs:close(G).\n"
4183 #: ../erlang/examples/guestfs-erlang.pod:40
4184 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4188 #: ../erlang/examples/guestfs-erlang.pod:42
4190 "For functions that take optional arguments, the first arguments are the "
4191 "non-optional ones. The last argument is a list of tuples supplying the "
4192 "remaining optional arguments."
4196 #: ../erlang/examples/guestfs-erlang.pod:46
4199 " ok = guestfs:add_drive_opts(G, Disk,\n"
4200 " [{format, \"raw\"}, {readonly, true}]).\n"
4205 #: ../erlang/examples/guestfs-erlang.pod:49
4206 msgid "If the last argument would be an empty list, you can also omit it:"
4210 #: ../erlang/examples/guestfs-erlang.pod:51
4213 " ok = guestfs:add_drive_opts(G, Disk).\n"
4218 #: ../erlang/examples/guestfs-erlang.pod:53
4219 msgid "RETURN VALUES AND ERRORS"
4223 #: ../erlang/examples/guestfs-erlang.pod:55
4225 "On success, most functions return a C<Result> term (which could be a list, "
4226 "string, tuple etc.). If there is nothing for the function to return, then "
4227 "the atom C<ok> is returned."
4231 #: ../erlang/examples/guestfs-erlang.pod:59
4232 msgid "On error, you would see one of the following tuples:"
4236 #: ../erlang/examples/guestfs-erlang.pod:63
4237 msgid "C<{error, Msg, Errno}>"
4241 #: ../erlang/examples/guestfs-erlang.pod:65
4242 msgid "This indicates an ordinary error from the function."
4246 #: ../erlang/examples/guestfs-erlang.pod:67
4248 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4253 #: ../erlang/examples/guestfs-erlang.pod:70
4254 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4258 #: ../erlang/examples/guestfs-erlang.pod:72
4259 msgid "C<{unknown, Function}>"
4263 #: ../erlang/examples/guestfs-erlang.pod:74
4265 "This indicates that the function you called is not known. Generally this "
4266 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4267 "which you should not do."
4271 #: ../erlang/examples/guestfs-erlang.pod:78
4272 msgid "C<Function> is the name of the unknown function."
4276 #: ../erlang/examples/guestfs-erlang.pod:80
4277 msgid "C<{unknownarg, Arg}>"
4281 #: ../erlang/examples/guestfs-erlang.pod:82
4283 "This indicates that you called a function with optional arguments, with an "
4284 "unknown argument name."
4288 #: ../erlang/examples/guestfs-erlang.pod:85
4289 msgid "C<Arg> is the name of the unknown argument."
4293 #: ../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
4294 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4298 #: ../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
4303 #: ../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
4304 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4308 #: ../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
4313 #: ../erlang/examples/guestfs-erlang.pod:99
4315 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
4316 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4317 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://www.erlang.org/>. "
4318 "L<http://libguestfs.org/>."
4322 #: ../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:3348 ../test-tool/libguestfs-test-tool.pod:106
4327 #: ../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:3350 ../test-tool/libguestfs-test-tool.pod:108
4328 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4332 #: ../erlang/examples/guestfs-erlang.pod:116 ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4333 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4337 #: ../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
4339 "The examples in this manual page may be freely copied, modified and "
4340 "distributed without any restrictions."
4344 #: ../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:3357
4346 "This library is free software; you can redistribute it and/or modify it "
4347 "under the terms of the GNU Lesser General Public License as published by the "
4348 "Free Software Foundation; either version 2 of the License, or (at your "
4349 "option) any later version."
4353 #: ../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:3362
4355 "This library is distributed in the hope that it will be useful, but WITHOUT "
4356 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4357 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4362 #: ../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:3367
4364 "You should have received a copy of the GNU Lesser General Public License "
4365 "along with this library; if not, write to the Free Software Foundation, "
4366 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4370 #: ../examples/guestfs-examples.pod:5
4371 msgid "guestfs-examples - Examples of using libguestfs from C"
4375 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4378 " #include <guestfs.h>\n"
4383 #: ../examples/guestfs-examples.pod:11
4386 " guestfs_h *g = guestfs_create ();\n"
4387 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4388 " guestfs_launch (g);\n"
4393 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4396 " cc prog.c -o prog -lguestfs\n"
4398 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4403 #: ../examples/guestfs-examples.pod:21
4405 "This manual page contains examples of calling libguestfs from the C "
4406 "programming language. If you are not familiar with using libguestfs, you "
4407 "also need to read L<guestfs(3)>."
4411 #: ../examples/guestfs-examples.pod:35
4413 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
4414 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4415 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4419 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97 ../python/examples/guestfs-python.pod:60 ../ruby/examples/guestfs-ruby.pod:54
4420 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4424 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4429 #: ../examples/guestfs-recipes.pod:5
4431 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4432 "here. The only way which works for both sorts of output is to just write "
4433 "the URL directly. Do NOT use L<...> for URLs."
4437 #: ../examples/guestfs-recipes.pod:9
4439 "We break with tradition here and don't use ALL CAPS for the section "
4440 "headings, as this makes them much easier to read."
4444 #: ../examples/guestfs-recipes.pod:16
4445 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4449 #: ../examples/guestfs-recipes.pod:20
4451 "This page contains recipes for and links to things you can do using "
4452 "libguestfs, L<guestfish(1)> and the virt tools."
4456 #: ../examples/guestfs-recipes.pod:23
4457 msgid "Audit a virtual machine for setuid files"
4461 #: ../examples/guestfs-recipes.pod:25
4463 "The link below contains a small program which can be used to audit a Linux "
4464 "virtual machine to see what setuid and setgid files it contains."
4468 #: ../examples/guestfs-recipes.pod:28
4469 msgid "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-files/#content"
4473 #: ../examples/guestfs-recipes.pod:30
4474 msgid "Change the background image in a Windows XP VM"
4478 #: ../examples/guestfs-recipes.pod:32
4480 "The links below explain how to use L<guestfish(1)> to change the background "
4481 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4482 "be substantially different for each version of Windows."
4486 #: ../examples/guestfs-recipes.pod:37
4488 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html "
4489 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4493 #: ../examples/guestfs-recipes.pod:40
4494 msgid "Cloning a virtual machine (Linux)"
4498 #: ../examples/guestfs-recipes.pod:42
4500 "The guestfish technique described in the link below works well for most "
4501 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4506 #: ../examples/guestfs-recipes.pod:46
4507 msgid "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/#content"
4511 #: ../examples/guestfs-recipes.pod:48
4513 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
4518 #: ../examples/guestfs-recipes.pod:51
4519 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4523 #: ../examples/guestfs-recipes.pod:53
4524 msgid "Cloning a virtual machine (Windows)"
4528 #: ../examples/guestfs-recipes.pod:55
4530 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
4531 "straightforward. Currently there is code in the Aeolus Oz project which "
4532 "does this (using libguestfs). As part of our review of the virt-clone tool, "
4533 "we may add sysprepping ability."
4537 #: ../examples/guestfs-recipes.pod:60
4539 "https://github.com/clalancette/oz "
4540 "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4544 #: ../examples/guestfs-recipes.pod:63
4545 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
4549 #: ../examples/guestfs-recipes.pod:65
4550 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
4554 #: ../examples/guestfs-recipes.pod:67
4557 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
4562 #: ../examples/guestfs-recipes.pod:69
4563 msgid "To export just a subdirectory, eg. C</files>, do:"
4567 #: ../examples/guestfs-recipes.pod:71
4570 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
4575 #: ../examples/guestfs-recipes.pod:73
4576 msgid "Create empty disk images"
4580 #: ../examples/guestfs-recipes.pod:75
4582 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
4583 "The useful guide below explains the options available."
4587 #: ../examples/guestfs-recipes.pod:78
4588 msgid "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/#content"
4592 #: ../examples/guestfs-recipes.pod:80
4593 msgid "Dump raw filesystem content from inside a disk image or VM"
4597 #: ../examples/guestfs-recipes.pod:82
4599 "You can use the L<guestfish(1)> C<download> command to extract the raw "
4600 "filesystem content from any filesystem in a disk image or a VM (even one "
4601 "which is encrypted or buried inside an LV):"
4605 #: ../examples/guestfs-recipes.pod:86
4608 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
4613 #: ../examples/guestfs-recipes.pod:88
4616 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
4621 #: ../examples/guestfs-recipes.pod:90
4622 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
4626 #: ../examples/guestfs-recipes.pod:92
4627 msgid "Edit grub configuration in a VM"
4631 #: ../examples/guestfs-recipes.pod:94
4632 msgid "You can use this to:"
4636 #: ../examples/guestfs-recipes.pod:100
4637 msgid "Fix a virtual machine that does not boot."
4641 #: ../examples/guestfs-recipes.pod:104
4642 msgid "Change which kernel is used to boot the VM."
4646 #: ../examples/guestfs-recipes.pod:108
4647 msgid "Change kernel command line options."
4651 #: ../examples/guestfs-recipes.pod:112
4652 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
4656 #: ../examples/guestfs-recipes.pod:114
4659 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
4664 #: ../examples/guestfs-recipes.pod:116
4666 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
4671 #: ../examples/guestfs-recipes.pod:119
4674 " virt-rescue -d BrokenGuest\n"
4679 #: ../examples/guestfs-recipes.pod:121
4680 msgid "Export any directory from a VM"
4684 #: ../examples/guestfs-recipes.pod:123
4685 msgid "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
4689 #: ../examples/guestfs-recipes.pod:126
4692 " virt-copy-out -d Guest /home .\n"
4697 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1450 ../fish/guestfish-actions.pod:1715 ../fish/guestfish-actions.pod:2132 ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:2326 ../src/guestfs-actions.pod:2750 ../src/guestfs-actions.pod:3309 ../src/guestfs.pod:1685 ../tools/virt-win-reg.pl:717
4702 #: ../examples/guestfs-recipes.pod:134
4704 "The final dot of the command is not a printing error. It means we want to "
4705 "copy out to the current directory."
4709 #: ../examples/guestfs-recipes.pod:139
4710 msgid "This creates a directory called C<home> under the current directory."
4714 #: ../examples/guestfs-recipes.pod:143
4716 "If the guest is a Windows guest then you can use drive letters and "
4717 "backslashes, but you must prefix the path with C<win:> and quote it to "
4718 "protect it from the shell, like this:"
4722 #: ../examples/guestfs-recipes.pod:147
4725 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
4730 #: ../examples/guestfs-recipes.pod:149
4731 msgid "To get the output as a compressed tarball, do:"
4735 #: ../examples/guestfs-recipes.pod:151
4738 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
4743 #: ../examples/guestfs-recipes.pod:153
4745 "Although it sounds tempting, this is usually not a reliable way to get a "
4746 "backup from a running guest. See the entry in the FAQ: "
4747 "http://libguestfs.org/FAQ.html#backup"
4751 #: ../examples/guestfs-recipes.pod:157
4752 msgid "Find out which user is using the most space"
4756 #: ../examples/guestfs-recipes.pod:159
4758 "This simple script examines a Linux guest to find out which user is using "
4759 "the most space in their home directory:"
4763 #: ../examples/guestfs-recipes.pod:162
4771 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
4779 #: ../examples/guestfs-recipes.pod:166
4788 #: ../examples/guestfs-recipes.pod:169
4791 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
4796 #: ../examples/guestfs-recipes.pod:171
4799 " for d in $(guestfish --remote ls \"$dir\"); do\n"
4800 " echo -n \"$dir/$d\"\n"
4802 " guestfish --remote du \"$dir/$d\";\n"
4803 " done | sort -nr -k 2\n"
4808 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
4811 " guestfish --remote exit\n"
4816 #: ../examples/guestfs-recipes.pod:179
4817 msgid "Get DHCP address from a VM"
4821 #: ../examples/guestfs-recipes.pod:181
4823 "The link below explains the many different possible techniques for getting "
4824 "the last assigned DHCP address of a virtual machine."
4828 #: ../examples/guestfs-recipes.pod:184
4829 msgid "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-a-virtual-machine-disk-image/#content"
4833 #: ../examples/guestfs-recipes.pod:186
4835 "In the libguestfs source examples directory you will find the latest version "
4836 "of the C<virt-dhcp-address.c> program."
4840 #: ../examples/guestfs-recipes.pod:189
4841 msgid "Get the operating system product name string"
4845 #: ../examples/guestfs-recipes.pod:191
4846 msgid "Save the following script into a file called C<product-name.sh>:"
4850 #: ../examples/guestfs-recipes.pod:193
4855 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4856 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4857 " guestfish --remote inspect-get-product-name \"$root\"\n"
4858 " guestfish --remote exit\n"
4863 #: ../examples/guestfs-recipes.pod:200
4864 msgid "Make the script executable and run it on a named guest:"
4868 #: ../examples/guestfs-recipes.pod:202
4871 " # product-name.sh RHEL60x64\n"
4872 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
4877 #: ../examples/guestfs-recipes.pod:205
4879 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
4880 "C<xpath> command line tool or from your favourite programming language:"
4884 #: ../examples/guestfs-recipes.pod:209
4887 " # virt-inspector RHEL60x64 > xml\n"
4888 " # xpath '//product_name' < xml\n"
4891 " <product_name>Red Hat Enterprise Linux Server release 6.0 "
4892 "(Santiago)</product_name>\n"
4897 #: ../examples/guestfs-recipes.pod:215
4898 msgid "Get the default boot kernel for a Linux VM"
4902 #: ../examples/guestfs-recipes.pod:217
4904 "The link below contains a program to print the default boot kernel for a "
4909 #: ../examples/guestfs-recipes.pod:220
4910 msgid "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-kernel-for-a-vm/#content"
4914 #: ../examples/guestfs-recipes.pod:222
4916 "It uses Augeas, and the technique is generally applicable for many different "
4921 #: ../examples/guestfs-recipes.pod:229
4922 msgid "listing the user accounts in the guest"
4926 #: ../examples/guestfs-recipes.pod:233
4927 msgid "what repositories is it configured to use"
4931 #: ../examples/guestfs-recipes.pod:237
4932 msgid "what NTP servers does it connect to"
4936 #: ../examples/guestfs-recipes.pod:241
4937 msgid "what were the boot messages last time it booted"
4941 #: ../examples/guestfs-recipes.pod:245
4942 msgid "listing who was logged in recently"
4946 #: ../examples/guestfs-recipes.pod:249
4947 msgid "http://augeas.net/"
4951 #: ../examples/guestfs-recipes.pod:251
4952 msgid "Install RPMs in a guest"
4956 #: ../examples/guestfs-recipes.pod:253
4958 "The link below contains a method to install RPMs in a guest. In fact the "
4959 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
4960 "installs them next time the guest is booted. You could use this technique "
4961 "to install vital security updates in an offline guest."
4965 #: ../examples/guestfs-recipes.pod:259
4966 msgid "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
4970 #: ../examples/guestfs-recipes.pod:261
4971 msgid "List applications installed in a VM"
4975 #: ../examples/guestfs-recipes.pod:263
4976 msgid "Save the following to a file C<list-apps.sh>:"
4980 #: ../examples/guestfs-recipes.pod:265
4985 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4986 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4987 " guestfish --remote inspect-list-applications \"$root\"\n"
4988 " guestfish --remote exit\n"
4993 #: ../examples/guestfs-recipes.pod:272
4995 "Make the file executable and then you can run it on any named virtual "
5000 #: ../examples/guestfs-recipes.pod:275
5003 " # list-apps.sh WinGuest\n"
5005 " app_name: Mozilla Firefox (3.6.12)\n"
5006 " app_display_name: Mozilla Firefox (3.6.12)\n"
5008 " app_version: 3.6.12 (en-GB)\n"
5010 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
5011 " app_trans_path:\n"
5012 " app_publisher: Mozilla\n"
5013 " app_url: http://www.mozilla.com/en-GB/\n"
5014 " app_source_package:\n"
5016 " app_description: Mozilla Firefox\n"
5019 " app_name: VLC media player\n"
5020 " app_display_name: VLC media player 1.1.5\n"
5022 " app_version: 1.1.5\n"
5024 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
5025 " app_trans_path:\n"
5026 " app_publisher: VideoLAN\n"
5027 " app_url: http://www.videolan.org/\n"
5028 " app_source_package:\n"
5030 " app_description:\n"
5036 #: ../examples/guestfs-recipes.pod:305
5038 "If you want to run the script on disk images (instead of libvirt virtual "
5039 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also "
5040 "L<virt-inspector(1)>."
5044 #: ../examples/guestfs-recipes.pod:309
5045 msgid "List files and directories in a VM"
5049 #: ../examples/guestfs-recipes.pod:311
5050 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5054 #: ../examples/guestfs-recipes.pod:313
5057 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5062 #: ../examples/guestfs-recipes.pod:315
5063 msgid "List services in a Windows VM"
5067 #: ../examples/guestfs-recipes.pod:317
5069 "The link below contains a script that can be used to list out the services "
5070 "from a Windows VM, and whether those services run at boot time or are loaded "
5075 #: ../examples/guestfs-recipes.pod:321
5076 msgid "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/#content"
5080 #: ../examples/guestfs-recipes.pod:323
5081 msgid "Make a disk image sparse"
5085 #: ../examples/guestfs-recipes.pod:325
5087 "The link below contains some guides for making a disk image sparse (or "
5088 "reintroducing sparseness)."
5092 #: ../examples/guestfs-recipes.pod:328
5093 msgid "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5097 #: ../examples/guestfs-recipes.pod:330
5098 msgid "Monitor disk usage over time"
5102 #: ../examples/guestfs-recipes.pod:332
5104 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5105 "The link below contains a guide."
5109 #: ../examples/guestfs-recipes.pod:335
5110 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5114 #: ../examples/guestfs-recipes.pod:337
5115 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5119 #: ../examples/guestfs-recipes.pod:339
5121 "L<guestfish(1)> plus the tools described in the link below can be used to "
5122 "read out the Windows Event Log from any virtual machine running Windows "
5123 "Vista or a later version."
5127 #: ../examples/guestfs-recipes.pod:343
5128 msgid "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-guestfish/#content"
5132 #: ../examples/guestfs-recipes.pod:345
5133 msgid "Remove root password (Linux)"
5137 #: ../examples/guestfs-recipes.pod:347
5139 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5140 "files. One use is to remove the root password from a Linux guest:"
5144 #: ../examples/guestfs-recipes.pod:350
5147 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5152 #: ../examples/guestfs-recipes.pod:352
5153 msgid "Remove Administrator password (Windows)"
5157 #: ../examples/guestfs-recipes.pod:354
5159 "The link below contains one technique for removing the Administrator "
5160 "password from a Windows VM, or to be more precise, it gives you a command "
5161 "prompt the next time you log in which you can use to bypass any security:"
5165 #: ../examples/guestfs-recipes.pod:359
5166 msgid "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-administrator-password-with-guestfish/"
5170 #: ../examples/guestfs-recipes.pod:361
5171 msgid "Unpack a live CD"
5175 #: ../examples/guestfs-recipes.pod:363
5177 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5178 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5179 "layers, as outlined in the guide below."
5183 #: ../examples/guestfs-recipes.pod:367
5184 msgid "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/#content"
5188 #: ../examples/guestfs-recipes.pod:369
5189 msgid "Uploading and downloading files"
5193 #: ../examples/guestfs-recipes.pod:371
5195 "The link below contains general tips on uploading (copying in) and "
5196 "downloading (copying out) files from VMs."
5200 #: ../examples/guestfs-recipes.pod:374
5201 msgid "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5205 #: ../examples/guestfs-recipes.pod:376
5206 msgid "Use libguestfs tools on VMware ESX guests"
5210 #: ../examples/guestfs-recipes.pod:378
5212 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5213 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5217 #: ../examples/guestfs-recipes.pod:382
5218 msgid "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/#content"
5222 #: ../examples/guestfs-recipes.pod:386
5224 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, "
5225 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
5226 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
5227 "L<http://libguestfs.org/>."
5231 #: ../examples/guestfs-recipes.pod:403
5232 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5236 #: ../fish/guestfish-actions.pod:1
5241 #: ../fish/guestfish-actions.pod:3
5244 " add-cdrom filename\n"
5249 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
5250 msgid "This function adds a virtual CD-ROM disk image to the guest."
5254 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
5255 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
5259 #: ../fish/guestfish-actions.pod:15
5261 "This call checks for the existence of C<filename>. This stops you from "
5262 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5263 "and C<http:> URLs. To specify those, use the general L</config> call "
5268 #: ../fish/guestfish-actions.pod:22
5270 "If you just want to add an ISO file (often you use this as an efficient way "
5271 "to transfer large files into the guest), then you should probably use "
5272 "L</add-drive-ro> instead."
5276 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:214 ../fish/guestfish-actions.pod:228
5278 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
5283 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:217 ../fish/guestfish-actions.pod:231 ../fish/guestfish-actions.pod:941 ../fish/guestfish-actions.pod:976 ../fish/guestfish-actions.pod:1149 ../fish/guestfish-actions.pod:1509 ../fish/guestfish-actions.pod:1523 ../fish/guestfish-actions.pod:3293 ../fish/guestfish-actions.pod:3604 ../fish/guestfish-actions.pod:3652 ../fish/guestfish-actions.pod:4579 ../fish/guestfish-actions.pod:4602 ../fish/guestfish-actions.pod:4624 ../fish/guestfish-actions.pod:4662 ../fish/guestfish-actions.pod:5311 ../fish/guestfish-actions.pod:5417 ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:305 ../src/guestfs-actions.pod:326 ../src/guestfs-actions.pod:1572 ../src/guestfs-actions.pod:1629 ../src/guestfs-actions.pod:1912 ../src/guestfs-actions.pod:2411 ../src/guestfs-actions.pod:2432 ../src/guestfs-actions.pod:5077 ../src/guestfs-actions.pod:5599 ../src/guestfs-actions.pod:5699 ../src/guestfs-actions.pod:6999 ../src/guestfs-actions.pod:7043 ../src/guestfs-actions.pod:7077 ../src/guestfs-actions.pod:7140 ../src/guestfs-actions.pod:8072 ../src/guestfs-actions.pod:8181 ../src/guestfs-actions.pod:8364
5285 "Deprecated functions will not be removed from the API, but the fact that "
5286 "they are deprecated indicates that there are problems with correct use of "
5291 #: ../fish/guestfish-actions.pod:35
5296 #: ../fish/guestfish-actions.pod:37
5301 #: ../fish/guestfish-actions.pod:39
5304 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] "
5305 "[allowuuid:..] [readonlydisk:..]\n"
5310 #: ../fish/guestfish-actions.pod:41
5312 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5313 "It works by connecting to libvirt, requesting the domain and domain XML from "
5314 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
5318 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:65
5320 "The number of disks added is returned. This operation is atomic: if an "
5321 "error is returned, then no disks are added."
5325 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:68
5327 "This function does some minimal checks to make sure the libvirt domain is "
5328 "not running (unless C<readonly> is true). In a future version we will try "
5329 "to acquire the libvirt lock on each disk."
5333 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:72
5335 "Disks must be accessible locally. This often means that adding disks from a "
5336 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5337 "unless those disks are accessible via the same device path locally too."
5341 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:77
5343 "The optional C<libvirturi> parameter sets the libvirt URI (see "
5344 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
5345 "default libvirt URI (or one set through an environment variable, see the "
5346 "libvirt documentation for full details)."
5350 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:83
5352 "The optional C<live> flag controls whether this call will try to connect to "
5353 "a running virtual machine C<guestfsd> process if it sees a suitable "
5354 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5355 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5356 "DAEMONS> for more information."
5360 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:90
5362 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
5363 "passed instead of the domain name. The C<dom> string is treated as a UUID "
5364 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
5369 #: ../fish/guestfish-actions.pod:76 ../src/guestfs-actions.pod:95
5371 "The optional C<readonlydisk> parameter controls what we do for disks which "
5372 "are marked E<lt>readonly/E<gt> in the libvirt XML. Possible values are:"
5376 #: ../fish/guestfish-actions.pod:82 ../src/guestfs-actions.pod:101
5377 msgid "readonlydisk = \"error\""
5381 #: ../fish/guestfish-actions.pod:84 ../fish/guestfish-actions.pod:95 ../fish/guestfish-actions.pod:106 ../src/guestfs-actions.pod:103 ../src/guestfs-actions.pod:114 ../src/guestfs-actions.pod:125
5382 msgid "If C<readonly> is false:"
5386 #: ../fish/guestfish-actions.pod:86 ../src/guestfs-actions.pod:105
5388 "The whole call is aborted with an error if any disk with the "
5389 "E<lt>readonly/E<gt> flag is found."
5393 #: ../fish/guestfish-actions.pod:89 ../fish/guestfish-actions.pod:100 ../fish/guestfish-actions.pod:110 ../src/guestfs-actions.pod:108 ../src/guestfs-actions.pod:119 ../src/guestfs-actions.pod:129
5394 msgid "If C<readonly> is true:"
5398 #: ../fish/guestfish-actions.pod:91 ../fish/guestfish-actions.pod:102 ../fish/guestfish-actions.pod:112 ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:131
5399 msgid "Disks with the E<lt>readonly/E<gt> flag are added read-only."
5403 #: ../fish/guestfish-actions.pod:93 ../src/guestfs-actions.pod:112
5404 msgid "readonlydisk = \"read\""
5408 #: ../fish/guestfish-actions.pod:97 ../src/guestfs-actions.pod:116
5410 "Disks with the E<lt>readonly/E<gt> flag are added read-only. Other disks "
5411 "are added read/write."
5415 #: ../fish/guestfish-actions.pod:104 ../src/guestfs-actions.pod:123
5416 msgid "readonlydisk = \"write\" (default)"
5420 #: ../fish/guestfish-actions.pod:108 ../src/guestfs-actions.pod:127
5421 msgid "Disks with the E<lt>readonly/E<gt> flag are added read/write."
5425 #: ../fish/guestfish-actions.pod:114 ../src/guestfs-actions.pod:133
5426 msgid "readonlydisk = \"ignore\""
5430 #: ../fish/guestfish-actions.pod:116 ../src/guestfs-actions.pod:135
5431 msgid "If C<readonly> is true or false:"
5435 #: ../fish/guestfish-actions.pod:118 ../src/guestfs-actions.pod:137
5436 msgid "Disks with the E<lt>readonly/E<gt> flag are skipped."
5440 #: ../fish/guestfish-actions.pod:122
5442 "The other optional parameters are passed directly through to "
5443 "L</add-drive-opts>."
5447 #: ../fish/guestfish-actions.pod:125 ../fish/guestfish-actions.pod:194 ../fish/guestfish-actions.pod:624 ../fish/guestfish-actions.pod:835 ../fish/guestfish-actions.pod:856 ../fish/guestfish-actions.pod:894 ../fish/guestfish-actions.pod:903 ../fish/guestfish-actions.pod:912 ../fish/guestfish-actions.pod:926 ../fish/guestfish-actions.pod:2171 ../fish/guestfish-actions.pod:3342 ../fish/guestfish-actions.pod:3505 ../fish/guestfish-actions.pod:3640
5449 "This command has one or more optional arguments. See L</OPTIONAL "
5454 #: ../fish/guestfish-actions.pod:127
5459 #: ../fish/guestfish-actions.pod:129
5462 " add-drive filename\n"
5467 #: ../fish/guestfish-actions.pod:131
5469 "This function is the equivalent of calling L</add-drive-opts> with no "
5470 "optional parameters, so the disk is added writable, with the format being "
5471 "detected automatically."
5475 #: ../fish/guestfish-actions.pod:135
5477 "Automatic detection of the format opens you up to a potential security hole "
5478 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5479 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5480 "you should think about replacing calls to this function with calls to "
5481 "L</add-drive-opts>, and specifying the format."
5485 #: ../fish/guestfish-actions.pod:142
5486 msgid "add-drive-opts"
5490 #: ../fish/guestfish-actions.pod:144
5495 #: ../fish/guestfish-actions.pod:146
5498 " add-drive-opts filename [readonly:..] [format:..] [iface:..] [name:..]\n"
5503 #: ../fish/guestfish-actions.pod:148 ../src/guestfs-actions.pod:208
5505 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5506 "The first time you call this function, the disk appears as C</dev/sda>, the "
5507 "second time as C</dev/sdb>, and so on."
5511 #: ../fish/guestfish-actions.pod:153 ../src/guestfs-actions.pod:213
5513 "You don't necessarily need to be root when using libguestfs. However you "
5514 "obviously do need sufficient permissions to access the filename for whatever "
5515 "operations you want to perform (ie. read access if you just want to read the "
5516 "image or write access if you want to modify the image)."
5520 #: ../fish/guestfish-actions.pod:159 ../src/guestfs-actions.pod:219
5521 msgid "This call checks that C<filename> exists."
5525 #: ../fish/guestfish-actions.pod:161 ../fish/guestfish-actions.pod:3304 ../src/guestfs-actions.pod:221 ../src/guestfs-actions.pod:5114
5526 msgid "The optional arguments are:"
5530 #: ../fish/guestfish-actions.pod:165 ../src/guestfs-actions.pod:225
5535 #: ../fish/guestfish-actions.pod:167 ../src/guestfs-actions.pod:227
5537 "If true then the image is treated as read-only. Writes are still allowed, "
5538 "but they are stored in a temporary snapshot overlay which is discarded at "
5539 "the end. The disk that you add is not modified."
5543 #: ../fish/guestfish-actions.pod:171 ../src/guestfs-actions.pod:231
5548 #: ../fish/guestfish-actions.pod:173
5550 "This forces the image format. If you omit this (or use L</add-drive> or "
5551 "L</add-drive-ro>) then the format is automatically detected. Possible "
5552 "formats include C<raw> and C<qcow2>."
5556 #: ../fish/guestfish-actions.pod:177 ../src/guestfs-actions.pod:237
5558 "Automatic detection of the format opens you up to a potential security hole "
5559 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5560 "RHBZ#642934. Specifying the format closes this security hole."
5564 #: ../fish/guestfish-actions.pod:182 ../src/guestfs-actions.pod:242
5569 #: ../fish/guestfish-actions.pod:184
5571 "This rarely-used option lets you emulate the behaviour of the deprecated "
5572 "L</add-drive-with-if> call (q.v.)"
5576 #: ../fish/guestfish-actions.pod:187 ../src/guestfs-actions.pod:247
5581 #: ../fish/guestfish-actions.pod:189 ../src/guestfs-actions.pod:249
5583 "The name the drive had in the original guest, e.g. /dev/sdb. This is used as "
5584 "a hint to the guest inspection process if it is available."
5588 #: ../fish/guestfish-actions.pod:196
5589 msgid "add-drive-ro"
5593 #: ../fish/guestfish-actions.pod:198
5598 #: ../fish/guestfish-actions.pod:200
5601 " add-drive-ro filename\n"
5606 #: ../fish/guestfish-actions.pod:202
5608 "This function is the equivalent of calling L</add-drive-opts> with the "
5609 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
5610 "is added read-only, with the format being detected automatically."
5614 #: ../fish/guestfish-actions.pod:207
5615 msgid "add-drive-ro-with-if"
5619 #: ../fish/guestfish-actions.pod:209
5622 " add-drive-ro-with-if filename iface\n"
5627 #: ../fish/guestfish-actions.pod:211
5629 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
5630 "interface emulation to use at run time."
5634 #: ../fish/guestfish-actions.pod:221
5635 msgid "add-drive-with-if"
5639 #: ../fish/guestfish-actions.pod:223
5642 " add-drive-with-if filename iface\n"
5647 #: ../fish/guestfish-actions.pod:225
5649 "This is the same as L</add-drive> but it allows you to specify the QEMU "
5650 "interface emulation to use at run time."
5654 #: ../fish/guestfish-actions.pod:235
5659 #: ../fish/guestfish-actions.pod:237
5662 " aug-clear augpath\n"
5667 #: ../fish/guestfish-actions.pod:239 ../src/guestfs-actions.pod:343
5669 "Set the value associated with C<path> to C<NULL>. This is the same as the "
5670 "L<augtool(1)> C<clear> command."
5674 #: ../fish/guestfish-actions.pod:242
5679 #: ../fish/guestfish-actions.pod:244
5687 #: ../fish/guestfish-actions.pod:246
5689 "Close the current Augeas handle and free up any resources used by it. After "
5690 "calling this, you have to call L</aug-init> again before you can use any "
5691 "other Augeas functions."
5695 #: ../fish/guestfish-actions.pod:251
5700 #: ../fish/guestfish-actions.pod:253
5703 " aug-defnode name expr val\n"
5708 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:372
5709 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
5713 #: ../fish/guestfish-actions.pod:258
5715 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
5716 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
5717 "containing that single node."
5721 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:379
5723 "On success this returns a pair containing the number of nodes in the "
5724 "nodeset, and a boolean flag if a node was created."
5728 #: ../fish/guestfish-actions.pod:266
5733 #: ../fish/guestfish-actions.pod:268
5736 " aug-defvar name expr\n"
5741 #: ../fish/guestfish-actions.pod:270 ../src/guestfs-actions.pod:396
5743 "Defines an Augeas variable C<name> whose value is the result of evaluating "
5744 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
5748 #: ../fish/guestfish-actions.pod:274 ../src/guestfs-actions.pod:400
5750 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
5751 "evaluates to something which is not a nodeset."
5755 #: ../fish/guestfish-actions.pod:277
5760 #: ../fish/guestfish-actions.pod:279
5763 " aug-get augpath\n"
5768 #: ../fish/guestfish-actions.pod:281 ../src/guestfs-actions.pod:413
5770 "Look up the value associated with C<path>. If C<path> matches exactly one "
5771 "node, the C<value> is returned."
5775 #: ../fish/guestfish-actions.pod:284
5780 #: ../fish/guestfish-actions.pod:286
5783 " aug-init root flags\n"
5788 #: ../fish/guestfish-actions.pod:288 ../src/guestfs-actions.pod:428
5790 "Create a new Augeas handle for editing configuration files. If there was "
5791 "any previous Augeas handle associated with this guestfs session, then it is "
5796 #: ../fish/guestfish-actions.pod:292
5797 msgid "You must call this before using any other L</aug-*> commands."
5801 #: ../fish/guestfish-actions.pod:295 ../src/guestfs-actions.pod:435
5802 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5806 #: ../fish/guestfish-actions.pod:298 ../src/guestfs-actions.pod:438
5808 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5809 "logical I<or> of the following integers:"
5813 #: ../fish/guestfish-actions.pod:304 ../src/guestfs-actions.pod:444
5814 msgid "C<AUG_SAVE_BACKUP> = 1"
5818 #: ../fish/guestfish-actions.pod:306 ../src/guestfs-actions.pod:446
5819 msgid "Keep the original file with a C<.augsave> extension."
5823 #: ../fish/guestfish-actions.pod:308 ../src/guestfs-actions.pod:448
5824 msgid "C<AUG_SAVE_NEWFILE> = 2"
5828 #: ../fish/guestfish-actions.pod:310 ../src/guestfs-actions.pod:450
5830 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5831 "original. Overrides C<AUG_SAVE_BACKUP>."
5835 #: ../fish/guestfish-actions.pod:313 ../src/guestfs-actions.pod:453
5836 msgid "C<AUG_TYPE_CHECK> = 4"
5840 #: ../fish/guestfish-actions.pod:315 ../src/guestfs-actions.pod:455
5841 msgid "Typecheck lenses."
5845 #: ../fish/guestfish-actions.pod:317
5847 "This option is only useful when debugging Augeas lenses. Use of this option "
5848 "may require additional memory for the libguestfs appliance. You may need to "
5849 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
5853 #: ../fish/guestfish-actions.pod:322 ../src/guestfs-actions.pod:462
5854 msgid "C<AUG_NO_STDINC> = 8"
5858 #: ../fish/guestfish-actions.pod:324 ../src/guestfs-actions.pod:464
5859 msgid "Do not use standard load path for modules."
5863 #: ../fish/guestfish-actions.pod:326 ../src/guestfs-actions.pod:466
5864 msgid "C<AUG_SAVE_NOOP> = 16"
5868 #: ../fish/guestfish-actions.pod:328 ../src/guestfs-actions.pod:468
5869 msgid "Make save a no-op, just record what would have been changed."
5873 #: ../fish/guestfish-actions.pod:330 ../src/guestfs-actions.pod:470
5874 msgid "C<AUG_NO_LOAD> = 32"
5878 #: ../fish/guestfish-actions.pod:332
5879 msgid "Do not load the tree in L</aug-init>."
5883 #: ../fish/guestfish-actions.pod:336
5884 msgid "To close the handle, you can call L</aug-close>."
5888 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:478
5889 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5893 #: ../fish/guestfish-actions.pod:340
5898 #: ../fish/guestfish-actions.pod:342
5901 " aug-insert augpath label true|false\n"
5906 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:492
5908 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5909 "or after C<path> (depending on the boolean flag C<before>)."
5913 #: ../fish/guestfish-actions.pod:348 ../src/guestfs-actions.pod:496
5915 "C<path> must match exactly one existing node in the tree, and C<label> must "
5916 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5920 #: ../fish/guestfish-actions.pod:352
5925 #: ../fish/guestfish-actions.pod:354
5933 #: ../fish/guestfish-actions.pod:356 ../src/guestfs-actions.pod:509
5934 msgid "Load files into the tree."
5938 #: ../fish/guestfish-actions.pod:358 ../src/guestfs-actions.pod:511
5939 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5943 #: ../fish/guestfish-actions.pod:361
5948 #: ../fish/guestfish-actions.pod:363
5956 #: ../fish/guestfish-actions.pod:365
5958 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
5959 "resulting nodes into alphabetical order."
5963 #: ../fish/guestfish-actions.pod:368
5968 #: ../fish/guestfish-actions.pod:370
5971 " aug-match augpath\n"
5976 #: ../fish/guestfish-actions.pod:372 ../src/guestfs-actions.pod:539
5978 "Returns a list of paths which match the path expression C<path>. The "
5979 "returned paths are sufficiently qualified so that they match exactly one "
5980 "node in the current tree."
5984 #: ../fish/guestfish-actions.pod:376
5989 #: ../fish/guestfish-actions.pod:378
5992 " aug-mv src dest\n"
5997 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:556
5999 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6000 "C<dest> is overwritten if it exists."
6004 #: ../fish/guestfish-actions.pod:383
6009 #: ../fish/guestfish-actions.pod:385
6017 #: ../fish/guestfish-actions.pod:387 ../src/guestfs-actions.pod:569
6018 msgid "Remove C<path> and all of its children."
6022 #: ../fish/guestfish-actions.pod:389 ../src/guestfs-actions.pod:571
6023 msgid "On success this returns the number of entries which were removed."
6027 #: ../fish/guestfish-actions.pod:391
6032 #: ../fish/guestfish-actions.pod:393
6040 #: ../fish/guestfish-actions.pod:395 ../src/guestfs-actions.pod:582
6041 msgid "This writes all pending changes to disk."
6045 #: ../fish/guestfish-actions.pod:397
6047 "The flags which were passed to L</aug-init> affect exactly how files are "
6052 #: ../fish/guestfish-actions.pod:400
6057 #: ../fish/guestfish-actions.pod:402
6060 " aug-set augpath val\n"
6065 #: ../fish/guestfish-actions.pod:404 ../src/guestfs-actions.pod:598
6066 msgid "Set the value associated with C<path> to C<val>."
6070 #: ../fish/guestfish-actions.pod:406
6072 "In the Augeas API, it is possible to clear a node by setting the value to "
6073 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6074 "this call. Instead you must use the L</aug-clear> call."
6078 #: ../fish/guestfish-actions.pod:411
6083 #: ../fish/guestfish-actions.pod:413
6086 " available 'groups ...'\n"
6091 #: ../fish/guestfish-actions.pod:415 ../src/guestfs-actions.pod:615
6093 "This command is used to check the availability of some groups of "
6094 "functionality in the appliance, which not all builds of the libguestfs "
6095 "appliance will be able to provide."
6099 #: ../fish/guestfish-actions.pod:419
6101 "The libguestfs groups, and the functions that those groups correspond to, "
6102 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6103 "runtime by calling L</available-all-groups>."
6107 #: ../fish/guestfish-actions.pod:424 ../src/guestfs-actions.pod:624
6109 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
6110 "\"augeas\"]> would check for the availability of the Linux inotify functions "
6111 "and Augeas (configuration file editing) functions."
6115 #: ../fish/guestfish-actions.pod:429 ../src/guestfs-actions.pod:629
6116 msgid "The command returns no error if I<all> requested groups are available."
6120 #: ../fish/guestfish-actions.pod:431 ../src/guestfs-actions.pod:631
6122 "It fails with an error if one or more of the requested groups is unavailable "
6127 #: ../fish/guestfish-actions.pod:434 ../src/guestfs-actions.pod:634
6129 "If an unknown group name is included in the list of groups then an error is "
6134 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:637
6139 #: ../fish/guestfish-actions.pod:443
6140 msgid "You must call L</launch> before calling this function."
6144 #: ../fish/guestfish-actions.pod:445 ../src/guestfs-actions.pod:645
6146 "The reason is because we don't know what groups are supported by the "
6147 "appliance/daemon until it is running and can be queried."
6151 #: ../fish/guestfish-actions.pod:451 ../src/guestfs-actions.pod:651
6153 "If a group of functions is available, this does not necessarily mean that "
6154 "they will work. You still have to check for errors when calling individual "
6155 "API functions even if they are available."
6159 #: ../fish/guestfish-actions.pod:458 ../src/guestfs-actions.pod:658
6161 "It is usually the job of distro packagers to build complete functionality "
6162 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6163 "with all requirements satisfied, will support everything."
6167 #: ../fish/guestfish-actions.pod:465
6169 "This call was added in version C<1.0.80>. In previous versions of "
6170 "libguestfs all you could do would be to speculatively execute a command to "
6171 "find out if the daemon implemented it. See also L</version>."
6175 #: ../fish/guestfish-actions.pod:472
6176 msgid "available-all-groups"
6180 #: ../fish/guestfish-actions.pod:474
6183 " available-all-groups\n"
6188 #: ../fish/guestfish-actions.pod:476
6190 "This command returns a list of all optional groups that this daemon knows "
6191 "about. Note this returns both supported and unsupported groups. To find "
6192 "out which ones the daemon can actually support you have to call "
6193 "L</available> on each member of the returned list."
6197 #: ../fish/guestfish-actions.pod:482
6198 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6202 #: ../fish/guestfish-actions.pod:484
6207 #: ../fish/guestfish-actions.pod:486
6210 " base64-in (base64file|-) filename\n"
6215 #: ../fish/guestfish-actions.pod:488 ../src/guestfs-actions.pod:702
6216 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
6220 #: ../fish/guestfish-actions.pod:491 ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:749 ../fish/guestfish-actions.pod:833 ../fish/guestfish-actions.pod:854 ../fish/guestfish-actions.pod:1025 ../fish/guestfish-actions.pod:1044 ../fish/guestfish-actions.pod:1418 ../fish/guestfish-actions.pod:4882 ../fish/guestfish-actions.pod:4894 ../fish/guestfish-actions.pod:4905 ../fish/guestfish-actions.pod:4916 ../fish/guestfish-actions.pod:4968 ../fish/guestfish-actions.pod:4977 ../fish/guestfish-actions.pod:5031 ../fish/guestfish-actions.pod:5054
6221 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6225 #: ../fish/guestfish-actions.pod:493
6230 #: ../fish/guestfish-actions.pod:495
6233 " base64-out filename (base64file|-)\n"
6238 #: ../fish/guestfish-actions.pod:497 ../src/guestfs-actions.pod:716
6240 "This command downloads the contents of C<filename>, writing it out to local "
6241 "file C<base64file> encoded as base64."
6245 #: ../fish/guestfish-actions.pod:502
6246 msgid "blockdev-flushbufs"
6250 #: ../fish/guestfish-actions.pod:504
6253 " blockdev-flushbufs device\n"
6258 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:729
6259 msgid "This tells the kernel to flush internal buffers associated with C<device>."
6263 #: ../fish/guestfish-actions.pod:509 ../fish/guestfish-actions.pod:520 ../fish/guestfish-actions.pod:529 ../fish/guestfish-actions.pod:539 ../fish/guestfish-actions.pod:551 ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:572 ../fish/guestfish-actions.pod:583 ../fish/guestfish-actions.pod:591 ../fish/guestfish-actions.pod:599 ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:764 ../src/guestfs-actions.pod:780 ../src/guestfs-actions.pod:798 ../src/guestfs-actions.pod:817 ../src/guestfs-actions.pod:831 ../src/guestfs-actions.pod:849 ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:877
6264 msgid "This uses the L<blockdev(8)> command."
6268 #: ../fish/guestfish-actions.pod:511
6269 msgid "blockdev-getbsz"
6273 #: ../fish/guestfish-actions.pod:513
6276 " blockdev-getbsz device\n"
6281 #: ../fish/guestfish-actions.pod:515 ../src/guestfs-actions.pod:744
6282 msgid "This returns the block size of a device."
6286 #: ../fish/guestfish-actions.pod:517 ../fish/guestfish-actions.pod:580 ../src/guestfs-actions.pod:746 ../src/guestfs-actions.pod:846
6288 "(Note this is different from both I<size in blocks> and I<filesystem block "
6293 #: ../fish/guestfish-actions.pod:522
6294 msgid "blockdev-getro"
6298 #: ../fish/guestfish-actions.pod:524
6301 " blockdev-getro device\n"
6306 #: ../fish/guestfish-actions.pod:526 ../src/guestfs-actions.pod:761
6308 "Returns a boolean indicating if the block device is read-only (true if "
6309 "read-only, false if not)."
6313 #: ../fish/guestfish-actions.pod:531
6314 msgid "blockdev-getsize64"
6318 #: ../fish/guestfish-actions.pod:533
6321 " blockdev-getsize64 device\n"
6326 #: ../fish/guestfish-actions.pod:535 ../src/guestfs-actions.pod:776
6327 msgid "This returns the size of the device in bytes."
6331 #: ../fish/guestfish-actions.pod:537
6332 msgid "See also L</blockdev-getsz>."
6336 #: ../fish/guestfish-actions.pod:541
6337 msgid "blockdev-getss"
6341 #: ../fish/guestfish-actions.pod:543
6344 " blockdev-getss device\n"
6349 #: ../fish/guestfish-actions.pod:545 ../src/guestfs-actions.pod:792
6351 "This returns the size of sectors on a block device. Usually 512, but can be "
6352 "larger for modern devices."
6356 #: ../fish/guestfish-actions.pod:548
6357 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
6361 #: ../fish/guestfish-actions.pod:553
6362 msgid "blockdev-getsz"
6366 #: ../fish/guestfish-actions.pod:555
6369 " blockdev-getsz device\n"
6374 #: ../fish/guestfish-actions.pod:557 ../src/guestfs-actions.pod:810
6376 "This returns the size of the device in units of 512-byte sectors (even if "
6377 "the sectorsize isn't 512 bytes ... weird)."
6381 #: ../fish/guestfish-actions.pod:560
6383 "See also L</blockdev-getss> for the real sector size of the device, and "
6384 "L</blockdev-getsize64> for the more useful I<size in bytes>."
6388 #: ../fish/guestfish-actions.pod:566
6389 msgid "blockdev-rereadpt"
6393 #: ../fish/guestfish-actions.pod:568
6396 " blockdev-rereadpt device\n"
6401 #: ../fish/guestfish-actions.pod:570 ../src/guestfs-actions.pod:829
6402 msgid "Reread the partition table on C<device>."
6406 #: ../fish/guestfish-actions.pod:574
6407 msgid "blockdev-setbsz"
6411 #: ../fish/guestfish-actions.pod:576
6414 " blockdev-setbsz device blocksize\n"
6419 #: ../fish/guestfish-actions.pod:578 ../src/guestfs-actions.pod:844
6420 msgid "This sets the block size of a device."
6424 #: ../fish/guestfish-actions.pod:585
6425 msgid "blockdev-setro"
6429 #: ../fish/guestfish-actions.pod:587
6432 " blockdev-setro device\n"
6437 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:861
6438 msgid "Sets the block device named C<device> to read-only."
6442 #: ../fish/guestfish-actions.pod:593
6443 msgid "blockdev-setrw"
6447 #: ../fish/guestfish-actions.pod:595
6450 " blockdev-setrw device\n"
6455 #: ../fish/guestfish-actions.pod:597 ../src/guestfs-actions.pod:875
6456 msgid "Sets the block device named C<device> to read-write."
6460 #: ../fish/guestfish-actions.pod:601
6461 msgid "btrfs-filesystem-resize"
6465 #: ../fish/guestfish-actions.pod:603
6468 " btrfs-filesystem-resize mountpoint [size:..]\n"
6473 #: ../fish/guestfish-actions.pod:605 ../src/guestfs-actions.pod:897
6474 msgid "This command resizes a btrfs filesystem."
6478 #: ../fish/guestfish-actions.pod:607 ../src/guestfs-actions.pod:899
6480 "Note that unlike other resize calls, the filesystem has to be mounted and "
6481 "the parameter is the mountpoint not the device (this is a requirement of "
6486 #: ../fish/guestfish-actions.pod:611 ../fish/guestfish-actions.pod:3615 ../src/guestfs-actions.pod:903 ../src/guestfs-actions.pod:5638
6487 msgid "The optional parameters are:"
6491 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3619 ../src/guestfs-actions.pod:907 ../src/guestfs-actions.pod:5642
6496 #: ../fish/guestfish-actions.pod:617 ../src/guestfs-actions.pod:909
6498 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
6499 "resized to the maximum size."
6503 #: ../fish/guestfish-actions.pod:622 ../src/guestfs-actions.pod:914
6504 msgid "See also L<btrfs(8)>."
6508 #: ../fish/guestfish-actions.pod:626
6509 msgid "case-sensitive-path"
6513 #: ../fish/guestfish-actions.pod:628
6516 " case-sensitive-path path\n"
6521 #: ../fish/guestfish-actions.pod:630 ../src/guestfs-actions.pod:948
6523 "This can be used to resolve case insensitive paths on a filesystem which is "
6524 "case sensitive. The use case is to resolve paths which you have read from "
6525 "Windows configuration files or the Windows Registry, to the true path."
6529 #: ../fish/guestfish-actions.pod:635 ../src/guestfs-actions.pod:953
6531 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6532 "(and probably others), which is that although the underlying filesystem is "
6533 "case-insensitive, the driver exports the filesystem to Linux as "
6538 #: ../fish/guestfish-actions.pod:640 ../src/guestfs-actions.pod:958
6540 "One consequence of this is that special directories such as C<c:\\windows> "
6541 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6542 "precise details of how they were created. In Windows itself this would not "
6547 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:964
6549 "Bug or feature? You decide: "
6550 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
6554 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:967
6556 "This function resolves the true case of each element in the path and returns "
6557 "the case-sensitive path."
6561 #: ../fish/guestfish-actions.pod:652
6563 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
6564 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
6565 "how the directories were originally created under Windows)."
6569 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:975
6570 msgid "I<Note>: This function does not handle drive names, backslashes etc."
6574 #: ../fish/guestfish-actions.pod:660
6575 msgid "See also L</realpath>."
6579 #: ../fish/guestfish-actions.pod:662
6584 #: ../fish/guestfish-actions.pod:664
6592 #: ../fish/guestfish-actions.pod:666 ../fish/guestfish-actions.pod:4049 ../src/guestfs-actions.pod:991 ../src/guestfs-actions.pod:6299
6593 msgid "Return the contents of the file named C<path>."
6597 #: ../fish/guestfish-actions.pod:668
6599 "Note that this function cannot correctly handle binary files (specifically, "
6600 "files containing C<\\0> character which is treated as end of string). For "
6601 "those you need to use the L</read-file> or L</download> functions which have "
6602 "a more complex interface."
6606 #: ../fish/guestfish-actions.pod:673 ../fish/guestfish-actions.pod:808 ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:1103 ../fish/guestfish-actions.pod:1113 ../fish/guestfish-actions.pod:1180 ../fish/guestfish-actions.pod:1190 ../fish/guestfish-actions.pod:1382 ../fish/guestfish-actions.pod:1695 ../fish/guestfish-actions.pod:1705 ../fish/guestfish-actions.pod:1755 ../fish/guestfish-actions.pod:1770 ../fish/guestfish-actions.pod:1780 ../fish/guestfish-actions.pod:1799 ../fish/guestfish-actions.pod:3919 ../fish/guestfish-actions.pod:3934 ../fish/guestfish-actions.pod:4010 ../fish/guestfish-actions.pod:4027 ../fish/guestfish-actions.pod:4042 ../fish/guestfish-actions.pod:4723 ../fish/guestfish-actions.pod:4769 ../fish/guestfish-actions.pod:4854 ../fish/guestfish-actions.pod:4869 ../fish/guestfish-actions.pod:5275 ../fish/guestfish-actions.pod:5287 ../fish/guestfish-actions.pod:5305 ../fish/guestfish-actions.pod:5322 ../fish/guestfish-actions.pod:5332 ../fish/guestfish-actions.pod:5389 ../fish/guestfish-actions.pod:5399 ../fish/guestfish-actions.pod:5428 ../fish/guestfish-actions.pod:5438 ../src/guestfs-actions.pod:1001 ../src/guestfs-actions.pod:1180 ../src/guestfs-actions.pod:1200 ../src/guestfs-actions.pod:1847 ../src/guestfs-actions.pod:1866 ../src/guestfs-actions.pod:1969 ../src/guestfs-actions.pod:1988 ../src/guestfs-actions.pod:2234 ../src/guestfs-actions.pod:2716 ../src/guestfs-actions.pod:2735 ../src/guestfs-actions.pod:2800 ../src/guestfs-actions.pod:2824 ../src/guestfs-actions.pod:2841 ../src/guestfs-actions.pod:2870 ../src/guestfs-actions.pod:6081 ../src/guestfs-actions.pod:6107 ../src/guestfs-actions.pod:6238 ../src/guestfs-actions.pod:6264 ../src/guestfs-actions.pod:6288 ../src/guestfs-actions.pod:7255 ../src/guestfs-actions.pod:7310 ../src/guestfs-actions.pod:7456 ../src/guestfs-actions.pod:7480 ../src/guestfs-actions.pod:8145 ../src/guestfs-actions.pod:8165 ../src/guestfs-actions.pod:8198 ../src/guestfs-actions.pod:8217 ../src/guestfs-actions.pod:8236 ../src/guestfs-actions.pod:8330 ../src/guestfs-actions.pod:8349 ../src/guestfs-actions.pod:8395 ../src/guestfs-actions.pod:8414
6608 "Because of the message protocol, there is a transfer limit of somewhere "
6609 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6613 #: ../fish/guestfish-actions.pod:676
6618 #: ../fish/guestfish-actions.pod:678
6621 " checksum csumtype path\n"
6626 #: ../fish/guestfish-actions.pod:680 ../src/guestfs-actions.pod:1013
6627 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6631 #: ../fish/guestfish-actions.pod:683 ../src/guestfs-actions.pod:1016
6633 "The type of checksum to compute is given by the C<csumtype> parameter which "
6634 "must have one of the following values:"
6638 #: ../fish/guestfish-actions.pod:688 ../src/guestfs-actions.pod:1021
6643 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1023
6645 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6650 #: ../fish/guestfish-actions.pod:693 ../src/guestfs-actions.pod:1026
6655 #: ../fish/guestfish-actions.pod:695 ../src/guestfs-actions.pod:1028
6656 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6660 #: ../fish/guestfish-actions.pod:697 ../src/guestfs-actions.pod:1030
6665 #: ../fish/guestfish-actions.pod:699 ../src/guestfs-actions.pod:1032
6666 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6670 #: ../fish/guestfish-actions.pod:701 ../src/guestfs-actions.pod:1034
6675 #: ../fish/guestfish-actions.pod:703 ../src/guestfs-actions.pod:1036
6676 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6680 #: ../fish/guestfish-actions.pod:705 ../src/guestfs-actions.pod:1038
6685 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1040
6686 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6690 #: ../fish/guestfish-actions.pod:709 ../src/guestfs-actions.pod:1042
6695 #: ../fish/guestfish-actions.pod:711 ../src/guestfs-actions.pod:1044
6696 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6700 #: ../fish/guestfish-actions.pod:713 ../src/guestfs-actions.pod:1046
6705 #: ../fish/guestfish-actions.pod:715 ../src/guestfs-actions.pod:1048
6706 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6710 #: ../fish/guestfish-actions.pod:719 ../src/guestfs-actions.pod:1052
6711 msgid "The checksum is returned as a printable string."
6715 #: ../fish/guestfish-actions.pod:721
6716 msgid "To get the checksum for a device, use L</checksum-device>."
6720 #: ../fish/guestfish-actions.pod:723
6721 msgid "To get the checksums for many files, use L</checksums-out>."
6725 #: ../fish/guestfish-actions.pod:725
6726 msgid "checksum-device"
6730 #: ../fish/guestfish-actions.pod:727
6733 " checksum-device csumtype device\n"
6738 #: ../fish/guestfish-actions.pod:729
6740 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6741 "device named C<device>. For the types of checksums supported see the "
6742 "L</checksum> command."
6746 #: ../fish/guestfish-actions.pod:733
6747 msgid "checksums-out"
6751 #: ../fish/guestfish-actions.pod:735
6754 " checksums-out csumtype directory (sumsfile|-)\n"
6759 #: ../fish/guestfish-actions.pod:737 ../src/guestfs-actions.pod:1087
6761 "This command computes the checksums of all regular files in C<directory> and "
6762 "then emits a list of those checksums to the local output file C<sumsfile>."
6766 #: ../fish/guestfish-actions.pod:741 ../src/guestfs-actions.pod:1091
6768 "This can be used for verifying the integrity of a virtual machine. However "
6769 "to be properly secure you should pay attention to the output of the checksum "
6770 "command (it uses the ones from GNU coreutils). In particular when the "
6771 "filename is not printable, coreutils uses a special backslash syntax. For "
6772 "more information, see the GNU coreutils info file."
6776 #: ../fish/guestfish-actions.pod:751
6781 #: ../fish/guestfish-actions.pod:753
6784 " chmod mode path\n"
6789 #: ../fish/guestfish-actions.pod:755 ../src/guestfs-actions.pod:1110
6791 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6796 #: ../fish/guestfish-actions.pod:758 ../src/guestfs-actions.pod:1113
6798 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6799 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6804 #: ../fish/guestfish-actions.pod:762 ../fish/guestfish-actions.pod:3268 ../fish/guestfish-actions.pod:3407 ../fish/guestfish-actions.pod:3417 ../fish/guestfish-actions.pod:3427 ../src/guestfs-actions.pod:1117 ../src/guestfs-actions.pod:5045 ../src/guestfs-actions.pod:5254 ../src/guestfs-actions.pod:5273 ../src/guestfs-actions.pod:5292
6805 msgid "The mode actually set is affected by the umask."
6809 #: ../fish/guestfish-actions.pod:764
6814 #: ../fish/guestfish-actions.pod:766
6817 " chown owner group path\n"
6822 #: ../fish/guestfish-actions.pod:768 ../src/guestfs-actions.pod:1131
6823 msgid "Change the file owner to C<owner> and group to C<group>."
6827 #: ../fish/guestfish-actions.pod:770 ../fish/guestfish-actions.pod:2703 ../src/guestfs-actions.pod:1133 ../src/guestfs-actions.pod:4116
6829 "Only numeric uid and gid are supported. If you want to use names, you will "
6830 "need to locate and parse the password file yourself (Augeas support makes "
6831 "this relatively easy)."
6835 #: ../fish/guestfish-actions.pod:774
6840 #: ../fish/guestfish-actions.pod:776
6843 " command 'arguments ...'\n"
6848 #: ../fish/guestfish-actions.pod:778 ../src/guestfs-actions.pod:1147
6850 "This call runs a command from the guest filesystem. The filesystem must be "
6851 "mounted, and must contain a compatible operating system (ie. something "
6852 "Linux, with the same or compatible processor architecture)."
6856 #: ../fish/guestfish-actions.pod:783
6858 "The single parameter is an argv-style list of arguments. The first element "
6859 "is the name of the program to run. Subsequent elements are parameters. The "
6860 "list must be non-empty (ie. must contain a program name). Note that the "
6861 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
6865 #: ../fish/guestfish-actions.pod:790 ../src/guestfs-actions.pod:1159
6866 msgid "The return value is anything printed to I<stdout> by the command."
6870 #: ../fish/guestfish-actions.pod:793 ../src/guestfs-actions.pod:1162
6872 "If the command returns a non-zero exit status, then this function returns an "
6873 "error message. The error message string is the content of I<stderr> from "
6878 #: ../fish/guestfish-actions.pod:797 ../src/guestfs-actions.pod:1166
6880 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
6881 "C</bin>. If you require a program from another location, you should provide "
6882 "the full path in the first parameter."
6886 #: ../fish/guestfish-actions.pod:802 ../src/guestfs-actions.pod:1171
6888 "Shared libraries and data files required by the program must be available on "
6889 "filesystems which are mounted in the correct places. It is the caller's "
6890 "responsibility to ensure all filesystems that are needed are mounted at the "
6895 #: ../fish/guestfish-actions.pod:811
6896 msgid "command-lines"
6900 #: ../fish/guestfish-actions.pod:813
6903 " command-lines 'arguments ...'\n"
6908 #: ../fish/guestfish-actions.pod:815
6909 msgid "This is the same as L</command>, but splits the result into a list of lines."
6913 #: ../fish/guestfish-actions.pod:818
6914 msgid "See also: L</sh-lines>"
6918 #: ../fish/guestfish-actions.pod:823
6919 msgid "compress-device-out"
6923 #: ../fish/guestfish-actions.pod:825
6926 " compress-device-out ctype device (zdevice|-) [level:..]\n"
6931 #: ../fish/guestfish-actions.pod:827 ../src/guestfs-actions.pod:1221
6933 "This command compresses C<device> and writes it out to the local file "
6938 #: ../fish/guestfish-actions.pod:830
6940 "The C<ctype> and optional C<level> parameters have the same meaning as in "
6945 #: ../fish/guestfish-actions.pod:837
6946 msgid "compress-out"
6950 #: ../fish/guestfish-actions.pod:839
6953 " compress-out ctype file (zfile|-) [level:..]\n"
6958 #: ../fish/guestfish-actions.pod:841 ../src/guestfs-actions.pod:1273
6960 "This command compresses C<file> and writes it out to the local file "
6965 #: ../fish/guestfish-actions.pod:844 ../src/guestfs-actions.pod:1276
6967 "The compression program used is controlled by the C<ctype> parameter. "
6968 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
6969 "Some compression types may not be supported by particular builds of "
6970 "libguestfs, in which case you will get an error containing the substring "
6971 "\"not supported\"."
6975 #: ../fish/guestfish-actions.pod:850 ../src/guestfs-actions.pod:1282
6977 "The optional C<level> parameter controls compression level. The meaning and "
6978 "default for this parameter depends on the compression program being used."
6982 #: ../fish/guestfish-actions.pod:858
6987 #: ../fish/guestfish-actions.pod:860
6990 " config qemuparam qemuvalue\n"
6995 #: ../fish/guestfish-actions.pod:862 ../src/guestfs-actions.pod:1323
6997 "This can be used to add arbitrary qemu command line parameters of the form "
6998 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
6999 "setting some parameters which would interfere with parameters that we use."
7003 #: ../fish/guestfish-actions.pod:867 ../src/guestfs-actions.pod:1328
7004 msgid "The first character of C<param> string must be a C<-> (dash)."
7008 #: ../fish/guestfish-actions.pod:869 ../src/guestfs-actions.pod:1330
7009 msgid "C<value> can be NULL."
7013 #: ../fish/guestfish-actions.pod:871
7014 msgid "copy-device-to-device"
7018 #: ../fish/guestfish-actions.pod:873
7021 " copy-device-to-device src dest [srcoffset:..] [destoffset:..] [size:..]\n"
7026 #: ../fish/guestfish-actions.pod:875
7028 "The four calls L</copy-device-to-device>, L</copy-device-to-file>, "
7029 "L</copy-file-to-device>, and L</copy-file-to-file> let you copy from a "
7030 "source (device|file) to a destination (device|file)."
7034 #: ../fish/guestfish-actions.pod:882 ../src/guestfs-actions.pod:1360
7036 "Partial copies can be made since you can specify optionally the source "
7037 "offset, destination offset and size to copy. These values are all specified "
7038 "in bytes. If not given, the offsets both default to zero, and the size "
7039 "defaults to copying as much as possible until we hit the end of the source."
7043 #: ../fish/guestfish-actions.pod:888 ../src/guestfs-actions.pod:1366
7045 "The source and destination may be the same object. However overlapping "
7046 "regions may not be copied correctly."
7050 #: ../fish/guestfish-actions.pod:891 ../src/guestfs-actions.pod:1369
7052 "If the destination is a file, it is created if required. If the destination "
7053 "file is not large enough, it is extended."
7057 #: ../fish/guestfish-actions.pod:896
7058 msgid "copy-device-to-file"
7062 #: ../fish/guestfish-actions.pod:898
7065 " copy-device-to-file src dest [srcoffset:..] [destoffset:..] [size:..]\n"
7070 #: ../fish/guestfish-actions.pod:900 ../fish/guestfish-actions.pod:909 ../fish/guestfish-actions.pod:918
7071 msgid "See L</copy-device-to-device> for a general overview of this call."
7075 #: ../fish/guestfish-actions.pod:905
7076 msgid "copy-file-to-device"
7080 #: ../fish/guestfish-actions.pod:907
7083 " copy-file-to-device src dest [srcoffset:..] [destoffset:..] [size:..]\n"
7088 #: ../fish/guestfish-actions.pod:914
7089 msgid "copy-file-to-file"
7093 #: ../fish/guestfish-actions.pod:916
7096 " copy-file-to-file src dest [srcoffset:..] [destoffset:..] [size:..]\n"
7101 #: ../fish/guestfish-actions.pod:921
7103 "This is B<not> the function you want for copying files. This is for copying "
7104 "blocks within existing files. See L</cp>, L</cp-a> and L</mv> for general "
7105 "file copying and moving functions."
7109 #: ../fish/guestfish-actions.pod:928
7114 #: ../fish/guestfish-actions.pod:930
7117 " copy-size src dest size\n"
7122 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1576
7124 "This command copies exactly C<size> bytes from one source device or file "
7125 "C<src> to another destination device or file C<dest>."
7129 #: ../fish/guestfish-actions.pod:935 ../src/guestfs-actions.pod:1579
7131 "Note this will fail if the source is too short or if the destination is not "
7136 #: ../fish/guestfish-actions.pod:938 ../fish/guestfish-actions.pod:973
7138 "I<This function is deprecated.> In new code, use the "
7139 "L</copy_device_to_device> call instead."
7143 #: ../fish/guestfish-actions.pod:945
7148 #: ../fish/guestfish-actions.pod:947
7156 #: ../fish/guestfish-actions.pod:949 ../src/guestfs-actions.pod:1598
7158 "This copies a file from C<src> to C<dest> where C<dest> is either a "
7159 "destination filename or destination directory."
7163 #: ../fish/guestfish-actions.pod:952
7168 #: ../fish/guestfish-actions.pod:954
7176 #: ../fish/guestfish-actions.pod:956 ../src/guestfs-actions.pod:1612
7178 "This copies a file or directory from C<src> to C<dest> recursively using the "
7183 #: ../fish/guestfish-actions.pod:959
7188 #: ../fish/guestfish-actions.pod:961
7196 #: ../fish/guestfish-actions.pod:963 ../src/guestfs-actions.pod:1633
7198 "This command copies from one source device or file C<src> to another "
7199 "destination device or file C<dest>. Normally you would use this to copy to "
7200 "or from a device or partition, for example to duplicate a filesystem."
7204 #: ../fish/guestfish-actions.pod:968
7206 "If the destination is a device, it must be as large or larger than the "
7207 "source file or device, otherwise the copy will fail. This command cannot do "
7208 "partial copies (see L</copy-device-to-device>)."
7212 #: ../fish/guestfish-actions.pod:980
7217 #: ../fish/guestfish-actions.pod:982
7225 #: ../fish/guestfish-actions.pod:984 ../src/guestfs-actions.pod:1652
7226 msgid "This command runs the C<df> command to report disk space used."
7230 #: ../fish/guestfish-actions.pod:986 ../fish/guestfish-actions.pod:997
7232 "This command is mostly useful for interactive sessions. It is I<not> "
7233 "intended that you try to parse the output string. Use L</statvfs> from "
7238 #: ../fish/guestfish-actions.pod:990
7243 #: ../fish/guestfish-actions.pod:992
7251 #: ../fish/guestfish-actions.pod:994 ../src/guestfs-actions.pod:1668
7253 "This command runs the C<df -h> command to report disk space used in "
7254 "human-readable format."
7258 #: ../fish/guestfish-actions.pod:1001
7263 #: ../fish/guestfish-actions.pod:1003
7271 #: ../fish/guestfish-actions.pod:1005 ../src/guestfs-actions.pod:1685
7273 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7274 "This is sometimes useful for extended debugging of problems."
7278 #: ../fish/guestfish-actions.pod:1009
7280 "Another way to get the same information is to enable verbose messages with "
7281 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
7282 "before running the program."
7286 #: ../fish/guestfish-actions.pod:1014
7291 #: ../fish/guestfish-actions.pod:1016
7294 " download remotefilename (filename|-)\n"
7299 #: ../fish/guestfish-actions.pod:1018 ../fish/guestfish-actions.pod:1031 ../src/guestfs-actions.pod:1706 ../src/guestfs-actions.pod:1731
7301 "Download file C<remotefilename> and save it as C<filename> on the local "
7306 #: ../fish/guestfish-actions.pod:1021 ../fish/guestfish-actions.pod:5027 ../src/guestfs-actions.pod:1709 ../src/guestfs-actions.pod:7715
7307 msgid "C<filename> can also be a named pipe."
7311 #: ../fish/guestfish-actions.pod:1023
7312 msgid "See also L</upload>, L</cat>."
7316 #: ../fish/guestfish-actions.pod:1027
7317 msgid "download-offset"
7321 #: ../fish/guestfish-actions.pod:1029
7324 " download-offset remotefilename (filename|-) offset size\n"
7329 #: ../fish/guestfish-actions.pod:1034 ../src/guestfs-actions.pod:1734
7331 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7332 "region must be within the file or device)."
7336 #: ../fish/guestfish-actions.pod:1037
7338 "Note that there is no limit on the amount of data that can be downloaded "
7339 "with this call, unlike with L</pread>, and this call always reads the full "
7340 "amount unless an error occurs."
7344 #: ../fish/guestfish-actions.pod:1042
7345 msgid "See also L</download>, L</pread>."
7349 #: ../fish/guestfish-actions.pod:1046
7354 #: ../fish/guestfish-actions.pod:1048
7357 " drop-caches whattodrop\n"
7362 #: ../fish/guestfish-actions.pod:1050 ../src/guestfs-actions.pod:1759
7364 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7365 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7366 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7370 #: ../fish/guestfish-actions.pod:1055 ../src/guestfs-actions.pod:1764
7371 msgid "Setting C<whattodrop> to 3 should drop everything."
7375 #: ../fish/guestfish-actions.pod:1057 ../src/guestfs-actions.pod:1766
7377 "This automatically calls L<sync(2)> before the operation, so that the "
7378 "maximum guest memory is freed."
7382 #: ../fish/guestfish-actions.pod:1060
7387 #: ../fish/guestfish-actions.pod:1062
7395 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1779
7397 "This command runs the C<du -s> command to estimate file space usage for "
7402 #: ../fish/guestfish-actions.pod:1067 ../src/guestfs-actions.pod:1782
7404 "C<path> can be a file or a directory. If C<path> is a directory then the "
7405 "estimate includes the contents of the directory and all subdirectories "
7410 #: ../fish/guestfish-actions.pod:1071 ../src/guestfs-actions.pod:1786
7411 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7415 #: ../fish/guestfish-actions.pod:1074
7420 #: ../fish/guestfish-actions.pod:1076
7423 " e2fsck-f device\n"
7428 #: ../fish/guestfish-actions.pod:1078 ../src/guestfs-actions.pod:1804
7430 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7431 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
7436 #: ../fish/guestfish-actions.pod:1082
7438 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
7439 "should use L</fsck>."
7443 #: ../fish/guestfish-actions.pod:1085
7448 #: ../fish/guestfish-actions.pod:1087
7451 " echo-daemon 'words ...'\n"
7456 #: ../fish/guestfish-actions.pod:1089 ../src/guestfs-actions.pod:1821
7458 "This command concatenates the list of C<words> passed with single spaces "
7459 "between them and returns the resulting string."
7463 #: ../fish/guestfish-actions.pod:1092 ../src/guestfs-actions.pod:1824
7464 msgid "You can use this command to test the connection through to the daemon."
7468 #: ../fish/guestfish-actions.pod:1094
7469 msgid "See also L</ping-daemon>."
7473 #: ../fish/guestfish-actions.pod:1096
7478 #: ../fish/guestfish-actions.pod:1098
7481 " egrep regex path\n"
7486 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1840
7487 msgid "This calls the external C<egrep> program and returns the matching lines."
7491 #: ../fish/guestfish-actions.pod:1106
7496 #: ../fish/guestfish-actions.pod:1108
7499 " egrepi regex path\n"
7504 #: ../fish/guestfish-actions.pod:1110 ../src/guestfs-actions.pod:1859
7505 msgid "This calls the external C<egrep -i> program and returns the matching lines."
7509 #: ../fish/guestfish-actions.pod:1116
7514 #: ../fish/guestfish-actions.pod:1118
7517 " equal file1 file2\n"
7522 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1878
7524 "This compares the two files C<file1> and C<file2> and returns true if their "
7525 "content is exactly equal, or false otherwise."
7529 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1881
7530 msgid "The external L<cmp(1)> program is used for the comparison."
7534 #: ../fish/guestfish-actions.pod:1125
7539 #: ../fish/guestfish-actions.pod:1127
7547 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1893
7549 "This returns C<true> if and only if there is a file, directory (or anything) "
7550 "with the given C<path> name."
7554 #: ../fish/guestfish-actions.pod:1132
7555 msgid "See also L</is-file>, L</is-dir>, L</stat>."
7559 #: ../fish/guestfish-actions.pod:1134
7564 #: ../fish/guestfish-actions.pod:1136
7567 " fallocate path len\n"
7572 #: ../fish/guestfish-actions.pod:1138 ../fish/guestfish-actions.pod:1157 ../src/guestfs-actions.pod:1916 ../src/guestfs-actions.pod:1935
7574 "This command preallocates a file (containing zero bytes) named C<path> of "
7575 "size C<len> bytes. If the file exists already, it is overwritten."
7579 #: ../fish/guestfish-actions.pod:1142 ../src/guestfs-actions.pod:1920
7581 "Do not confuse this with the guestfish-specific C<alloc> command which "
7582 "allocates a file in the host and attaches it as a device."
7586 #: ../fish/guestfish-actions.pod:1146
7588 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
7593 #: ../fish/guestfish-actions.pod:1153
7598 #: ../fish/guestfish-actions.pod:1155
7601 " fallocate64 path len\n"
7606 #: ../fish/guestfish-actions.pod:1161
7608 "Note that this call allocates disk blocks for the file. To create a sparse "
7609 "file use L</truncate-size> instead."
7613 #: ../fish/guestfish-actions.pod:1164
7615 "The deprecated call L</fallocate> does the same, but owing to an oversight "
7616 "it only allowed 30 bit lengths to be specified, effectively limiting the "
7617 "maximum size of files created through that call to 1GB."
7621 #: ../fish/guestfish-actions.pod:1169 ../src/guestfs-actions.pod:1947
7623 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
7624 "commands which create a file in the host and attach it as a device."
7628 #: ../fish/guestfish-actions.pod:1173
7633 #: ../fish/guestfish-actions.pod:1175
7636 " fgrep pattern path\n"
7641 #: ../fish/guestfish-actions.pod:1177 ../src/guestfs-actions.pod:1962
7642 msgid "This calls the external C<fgrep> program and returns the matching lines."
7646 #: ../fish/guestfish-actions.pod:1183
7651 #: ../fish/guestfish-actions.pod:1185
7654 " fgrepi pattern path\n"
7659 #: ../fish/guestfish-actions.pod:1187 ../src/guestfs-actions.pod:1981
7660 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
7664 #: ../fish/guestfish-actions.pod:1193
7669 #: ../fish/guestfish-actions.pod:1195
7677 #: ../fish/guestfish-actions.pod:1197 ../src/guestfs-actions.pod:1999
7679 "This call uses the standard L<file(1)> command to determine the type or "
7680 "contents of the file."
7684 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:2002
7686 "This call will also transparently look inside various types of compressed "
7691 #: ../fish/guestfish-actions.pod:1203 ../src/guestfs-actions.pod:2005
7693 "The exact command which runs is C<file -zb path>. Note in particular that "
7694 "the filename is not prepended to the output (the I<-b> option)."
7698 #: ../fish/guestfish-actions.pod:1207 ../src/guestfs-actions.pod:2009
7700 "The output depends on the output of the underlying L<file(1)> command and it "
7701 "can change in future in ways beyond our control. In other words, the output "
7702 "is not guaranteed by the ABI."
7706 #: ../fish/guestfish-actions.pod:1211
7708 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
7709 "(etc), L</is-zero>."
7713 #: ../fish/guestfish-actions.pod:1214
7714 msgid "file-architecture"
7718 #: ../fish/guestfish-actions.pod:1216
7721 " file-architecture filename\n"
7726 #: ../fish/guestfish-actions.pod:1218 ../src/guestfs-actions.pod:2027
7728 "This detects the architecture of the binary C<filename>, and returns it if "
7733 #: ../fish/guestfish-actions.pod:1221 ../src/guestfs-actions.pod:2030
7734 msgid "Currently defined architectures are:"
7738 #: ../fish/guestfish-actions.pod:1225 ../src/guestfs-actions.pod:2034
7743 #: ../fish/guestfish-actions.pod:1227 ../src/guestfs-actions.pod:2036
7745 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7746 "irrespective of the precise processor requirements of the binary."
7750 #: ../fish/guestfish-actions.pod:1230 ../src/guestfs-actions.pod:2039
7755 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:2041
7756 msgid "64 bit x86-64."
7760 #: ../fish/guestfish-actions.pod:1234 ../src/guestfs-actions.pod:2043
7765 #: ../fish/guestfish-actions.pod:1236 ../src/guestfs-actions.pod:2045
7766 msgid "32 bit SPARC."
7770 #: ../fish/guestfish-actions.pod:1238 ../src/guestfs-actions.pod:2047
7775 #: ../fish/guestfish-actions.pod:1240 ../src/guestfs-actions.pod:2049
7776 msgid "64 bit SPARC V9 and above."
7780 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:2051
7785 #: ../fish/guestfish-actions.pod:1244 ../src/guestfs-actions.pod:2053
7786 msgid "Intel Itanium."
7790 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:2055
7795 #: ../fish/guestfish-actions.pod:1248 ../src/guestfs-actions.pod:2057
7796 msgid "32 bit Power PC."
7800 #: ../fish/guestfish-actions.pod:1250 ../src/guestfs-actions.pod:2059
7805 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:2061
7806 msgid "64 bit Power PC."
7810 #: ../fish/guestfish-actions.pod:1256 ../src/guestfs-actions.pod:2065
7811 msgid "Libguestfs may return other architecture strings in future."
7815 #: ../fish/guestfish-actions.pod:1258 ../src/guestfs-actions.pod:2067
7816 msgid "The function works on at least the following types of files:"
7820 #: ../fish/guestfish-actions.pod:1264 ../src/guestfs-actions.pod:2073
7821 msgid "many types of Un*x and Linux binary"
7825 #: ../fish/guestfish-actions.pod:1268 ../src/guestfs-actions.pod:2077
7826 msgid "many types of Un*x and Linux shared library"
7830 #: ../fish/guestfish-actions.pod:1272 ../src/guestfs-actions.pod:2081
7831 msgid "Windows Win32 and Win64 binaries"
7835 #: ../fish/guestfish-actions.pod:1276 ../src/guestfs-actions.pod:2085
7836 msgid "Windows Win32 and Win64 DLLs"
7840 #: ../fish/guestfish-actions.pod:1278 ../src/guestfs-actions.pod:2087
7841 msgid "Win32 binaries and DLLs return C<i386>."
7845 #: ../fish/guestfish-actions.pod:1280 ../src/guestfs-actions.pod:2089
7846 msgid "Win64 binaries and DLLs return C<x86_64>."
7850 #: ../fish/guestfish-actions.pod:1284 ../src/guestfs-actions.pod:2093
7851 msgid "Linux kernel modules"
7855 #: ../fish/guestfish-actions.pod:1288 ../src/guestfs-actions.pod:2097
7856 msgid "Linux new-style initrd images"
7860 #: ../fish/guestfish-actions.pod:1292 ../src/guestfs-actions.pod:2101
7861 msgid "some non-x86 Linux vmlinuz kernels"
7865 #: ../fish/guestfish-actions.pod:1296 ../src/guestfs-actions.pod:2105
7866 msgid "What it can't do currently:"
7870 #: ../fish/guestfish-actions.pod:1302 ../src/guestfs-actions.pod:2111
7871 msgid "static libraries (libfoo.a)"
7875 #: ../fish/guestfish-actions.pod:1306 ../src/guestfs-actions.pod:2115
7876 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7880 #: ../fish/guestfish-actions.pod:1310 ../src/guestfs-actions.pod:2119
7881 msgid "x86 Linux vmlinuz kernels"
7885 #: ../fish/guestfish-actions.pod:1312 ../src/guestfs-actions.pod:2121
7887 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7888 "compressed code, and are horribly hard to unpack. If you want to find the "
7889 "architecture of a kernel, use the architecture of the associated initrd or "
7890 "kernel module(s) instead."
7894 #: ../fish/guestfish-actions.pod:1319
7899 #: ../fish/guestfish-actions.pod:1321
7907 #: ../fish/guestfish-actions.pod:1323 ../src/guestfs-actions.pod:2139
7908 msgid "This command returns the size of C<file> in bytes."
7912 #: ../fish/guestfish-actions.pod:1325
7914 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
7915 "L</is-file> etc. To get the size of block devices, use "
7916 "L</blockdev-getsize64>."
7920 #: ../fish/guestfish-actions.pod:1329
7925 #: ../fish/guestfish-actions.pod:1331
7928 " fill c len path\n"
7933 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:2157
7935 "This command creates a new file called C<path>. The initial content of the "
7936 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
7941 #: ../fish/guestfish-actions.pod:1337
7943 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7944 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
7949 #: ../fish/guestfish-actions.pod:1342
7950 msgid "fill-pattern"
7954 #: ../fish/guestfish-actions.pod:1344
7957 " fill-pattern pattern len path\n"
7962 #: ../fish/guestfish-actions.pod:1346
7964 "This function is like L</fill> except that it creates a new file of length "
7965 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
7966 "is truncated if necessary to ensure the length of the file is exactly C<len> "
7971 #: ../fish/guestfish-actions.pod:1351
7976 #: ../fish/guestfish-actions.pod:1353
7984 #: ../fish/guestfish-actions.pod:1355 ../src/guestfs-actions.pod:2203
7986 "This command lists out all files and directories, recursively, starting at "
7987 "C<directory>. It is essentially equivalent to running the shell command "
7988 "C<find directory -print> but some post-processing happens on the output, "
7993 #: ../fish/guestfish-actions.pod:1360 ../src/guestfs-actions.pod:2208
7995 "This returns a list of strings I<without any prefix>. Thus if the directory "
8000 #: ../fish/guestfish-actions.pod:1363 ../src/guestfs-actions.pod:2211
8010 #: ../fish/guestfish-actions.pod:1367
8011 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
8015 #: ../fish/guestfish-actions.pod:1370 ../src/guestfs-actions.pod:2218
8026 #: ../fish/guestfish-actions.pod:1375 ../src/guestfs-actions.pod:2223
8027 msgid "If C<directory> is not a directory, then this command returns an error."
8031 #: ../fish/guestfish-actions.pod:1378 ../src/guestfs-actions.pod:2226
8032 msgid "The returned list is sorted."
8036 #: ../fish/guestfish-actions.pod:1380
8037 msgid "See also L</find0>."
8041 #: ../fish/guestfish-actions.pod:1385
8046 #: ../fish/guestfish-actions.pod:1387
8049 " find0 directory (files|-)\n"
8054 #: ../fish/guestfish-actions.pod:1389 ../src/guestfs-actions.pod:2246
8056 "This command lists out all files and directories, recursively, starting at "
8057 "C<directory>, placing the resulting list in the external file called "
8062 #: ../fish/guestfish-actions.pod:1393
8063 msgid "This command works the same way as L</find> with the following exceptions:"
8067 #: ../fish/guestfish-actions.pod:1400 ../src/guestfs-actions.pod:2257
8068 msgid "The resulting list is written to an external file."
8072 #: ../fish/guestfish-actions.pod:1404 ../src/guestfs-actions.pod:2261
8074 "Items (filenames) in the result are separated by C<\\0> characters. See "
8075 "L<find(1)> option I<-print0>."
8079 #: ../fish/guestfish-actions.pod:1409 ../src/guestfs-actions.pod:2266
8080 msgid "This command is not limited in the number of names that it can return."
8084 #: ../fish/guestfish-actions.pod:1414 ../src/guestfs-actions.pod:2271
8085 msgid "The result list is not sorted."
8089 #: ../fish/guestfish-actions.pod:1420
8090 msgid "findfs-label"
8094 #: ../fish/guestfish-actions.pod:1422
8097 " findfs-label label\n"
8102 #: ../fish/guestfish-actions.pod:1424 ../src/guestfs-actions.pod:2285
8104 "This command searches the filesystems and returns the one which has the "
8105 "given label. An error is returned if no such filesystem can be found."
8109 #: ../fish/guestfish-actions.pod:1428
8110 msgid "To find the label of a filesystem, use L</vfs-label>."
8114 #: ../fish/guestfish-actions.pod:1430
8119 #: ../fish/guestfish-actions.pod:1432
8122 " findfs-uuid uuid\n"
8127 #: ../fish/guestfish-actions.pod:1434 ../src/guestfs-actions.pod:2302
8129 "This command searches the filesystems and returns the one which has the "
8130 "given UUID. An error is returned if no such filesystem can be found."
8134 #: ../fish/guestfish-actions.pod:1438
8135 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
8139 #: ../fish/guestfish-actions.pod:1440
8144 #: ../fish/guestfish-actions.pod:1442
8147 " fsck fstype device\n"
8152 #: ../fish/guestfish-actions.pod:1444 ../src/guestfs-actions.pod:2320
8154 "This runs the filesystem checker (fsck) on C<device> which should have "
8155 "filesystem type C<fstype>."
8159 #: ../fish/guestfish-actions.pod:1447 ../src/guestfs-actions.pod:2323
8161 "The returned integer is the status. See L<fsck(8)> for the list of status "
8162 "codes from C<fsck>."
8166 #: ../fish/guestfish-actions.pod:1456 ../src/guestfs-actions.pod:2332
8167 msgid "Multiple status codes can be summed together."
8171 #: ../fish/guestfish-actions.pod:1460 ../src/guestfs-actions.pod:2336
8173 "A non-zero return code can mean \"success\", for example if errors have been "
8174 "corrected on the filesystem."
8178 #: ../fish/guestfish-actions.pod:1465 ../src/guestfs-actions.pod:2341
8179 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
8183 #: ../fish/guestfish-actions.pod:1470 ../src/guestfs-actions.pod:2346
8184 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
8188 #: ../fish/guestfish-actions.pod:1472
8193 #: ../fish/guestfish-actions.pod:1474
8201 #: ../fish/guestfish-actions.pod:1476 ../src/guestfs-actions.pod:2357
8203 "Return the additional kernel options which are added to the guest kernel "
8208 #: ../fish/guestfish-actions.pod:1479 ../src/guestfs-actions.pod:2360
8209 msgid "If C<NULL> then no options are added."
8213 #: ../fish/guestfish-actions.pod:1481
8214 msgid "get-attach-method"
8218 #: ../fish/guestfish-actions.pod:1483
8221 " get-attach-method\n"
8226 #: ../fish/guestfish-actions.pod:1485
8227 msgid "Return the current attach method. See L</set-attach-method>."
8231 #: ../fish/guestfish-actions.pod:1487
8232 msgid "get-autosync"
8236 #: ../fish/guestfish-actions.pod:1489
8244 #: ../fish/guestfish-actions.pod:1491 ../src/guestfs-actions.pod:2385
8245 msgid "Get the autosync flag."
8249 #: ../fish/guestfish-actions.pod:1493
8254 #: ../fish/guestfish-actions.pod:1495
8262 #: ../fish/guestfish-actions.pod:1497 ../src/guestfs-actions.pod:2396
8263 msgid "Return the direct appliance mode flag."
8267 #: ../fish/guestfish-actions.pod:1499
8272 #: ../fish/guestfish-actions.pod:1501
8275 " get-e2label device\n"
8280 #: ../fish/guestfish-actions.pod:1503 ../src/guestfs-actions.pod:2415
8281 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8285 #: ../fish/guestfish-actions.pod:1506
8287 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
8292 #: ../fish/guestfish-actions.pod:1513
8297 #: ../fish/guestfish-actions.pod:1515
8300 " get-e2uuid device\n"
8305 #: ../fish/guestfish-actions.pod:1517 ../src/guestfs-actions.pod:2436
8306 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8310 #: ../fish/guestfish-actions.pod:1520
8312 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
8317 #: ../fish/guestfish-actions.pod:1527
8322 #: ../fish/guestfish-actions.pod:1529
8330 #: ../fish/guestfish-actions.pod:1531 ../src/guestfs-actions.pod:2449
8331 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
8335 #: ../fish/guestfish-actions.pod:1534
8337 "If L</set-memsize> was not called on this handle, and if "
8338 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8339 "value for memsize."
8343 #: ../fish/guestfish-actions.pod:1538 ../fish/guestfish-actions.pod:1595 ../fish/guestfish-actions.pod:4375 ../fish/guestfish-actions.pod:4477 ../src/guestfs-actions.pod:2456 ../src/guestfs-actions.pod:2548 ../src/guestfs-actions.pod:6760 ../src/guestfs-actions.pod:6886
8344 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8348 #: ../fish/guestfish-actions.pod:1541
8353 #: ../fish/guestfish-actions.pod:1543
8361 #: ../fish/guestfish-actions.pod:1545 ../src/guestfs-actions.pod:2468
8362 msgid "This returns the enable network flag."
8366 #: ../fish/guestfish-actions.pod:1547
8371 #: ../fish/guestfish-actions.pod:1549
8379 #: ../fish/guestfish-actions.pod:1551 ../src/guestfs-actions.pod:2479
8380 msgid "Return the current search path."
8384 #: ../fish/guestfish-actions.pod:1553 ../src/guestfs-actions.pod:2481
8386 "This is always non-NULL. If it wasn't set already, then this will return "
8391 #: ../fish/guestfish-actions.pod:1556
8396 #: ../fish/guestfish-actions.pod:1558
8404 #: ../fish/guestfish-actions.pod:1560 ../src/guestfs-actions.pod:2494
8405 msgid "This returns the process group flag."
8409 #: ../fish/guestfish-actions.pod:1562
8414 #: ../fish/guestfish-actions.pod:1564
8419 #: ../fish/guestfish-actions.pod:1566
8427 #: ../fish/guestfish-actions.pod:1568 ../src/guestfs-actions.pod:2505
8429 "Return the process ID of the qemu subprocess. If there is no qemu "
8430 "subprocess, then this will return an error."
8434 #: ../fish/guestfish-actions.pod:1571 ../src/guestfs-actions.pod:2508
8435 msgid "This is an internal call used for debugging and testing."
8439 #: ../fish/guestfish-actions.pod:1573
8444 #: ../fish/guestfish-actions.pod:1575
8452 #: ../fish/guestfish-actions.pod:1577 ../src/guestfs-actions.pod:2519
8453 msgid "Return the current qemu binary."
8457 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2521
8459 "This is always non-NULL. If it wasn't set already, then this will return "
8460 "the default qemu binary name."
8464 #: ../fish/guestfish-actions.pod:1582
8465 msgid "get-recovery-proc"
8469 #: ../fish/guestfish-actions.pod:1584
8472 " get-recovery-proc\n"
8477 #: ../fish/guestfish-actions.pod:1586 ../src/guestfs-actions.pod:2534
8478 msgid "Return the recovery process enabled flag."
8482 #: ../fish/guestfish-actions.pod:1588
8487 #: ../fish/guestfish-actions.pod:1590
8495 #: ../fish/guestfish-actions.pod:1592
8497 "This returns the current setting of the selinux flag which is passed to the "
8498 "appliance at boot time. See L</set-selinux>."
8502 #: ../fish/guestfish-actions.pod:1598
8507 #: ../fish/guestfish-actions.pod:1600
8515 #: ../fish/guestfish-actions.pod:1602 ../src/guestfs-actions.pod:2560
8516 msgid "This returns the number of virtual CPUs assigned to the appliance."
8520 #: ../fish/guestfish-actions.pod:1604
8525 #: ../fish/guestfish-actions.pod:1606
8533 #: ../fish/guestfish-actions.pod:1608 ../src/guestfs-actions.pod:2571
8535 "This returns the current state as an opaque integer. This is only useful "
8536 "for printing debug and internal error messages."
8540 #: ../fish/guestfish-actions.pod:1611 ../fish/guestfish-actions.pod:2570 ../fish/guestfish-actions.pod:2588 ../fish/guestfish-actions.pod:2626 ../fish/guestfish-actions.pod:2642 ../src/guestfs-actions.pod:2574 ../src/guestfs-actions.pod:3893 ../src/guestfs-actions.pod:3922 ../src/guestfs-actions.pod:3983 ../src/guestfs-actions.pod:4010
8541 msgid "For more information on states, see L<guestfs(3)>."
8545 #: ../fish/guestfish-actions.pod:1613
8550 #: ../fish/guestfish-actions.pod:1615
8558 #: ../fish/guestfish-actions.pod:1617 ../src/guestfs-actions.pod:2585
8559 msgid "Return the command trace flag."
8563 #: ../fish/guestfish-actions.pod:1619
8568 #: ../fish/guestfish-actions.pod:1621
8576 #: ../fish/guestfish-actions.pod:1623
8578 "Return the current umask. By default the umask is C<022> unless it has been "
8579 "set by calling L</umask>."
8583 #: ../fish/guestfish-actions.pod:1626
8588 #: ../fish/guestfish-actions.pod:1628
8596 #: ../fish/guestfish-actions.pod:1630 ../src/guestfs-actions.pod:2608
8597 msgid "This returns the verbose messages flag."
8601 #: ../fish/guestfish-actions.pod:1632
8606 #: ../fish/guestfish-actions.pod:1634
8614 #: ../fish/guestfish-actions.pod:1636 ../src/guestfs-actions.pod:2619
8615 msgid "This gets the SELinux security context of the daemon."
8619 #: ../fish/guestfish-actions.pod:1638
8620 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
8624 #: ../fish/guestfish-actions.pod:1641
8629 #: ../fish/guestfish-actions.pod:1643
8632 " getxattr path name\n"
8637 #: ../fish/guestfish-actions.pod:1645
8639 "Get a single extended attribute from file C<path> named C<name>. This call "
8640 "follows symlinks. If you want to lookup an extended attribute for the "
8641 "symlink itself, use L</lgetxattr>."
8645 #: ../fish/guestfish-actions.pod:1649 ../fish/guestfish-actions.pod:2715
8647 "Normally it is better to get all extended attributes from a file in one go "
8648 "by calling L</getxattrs>. However some Linux filesystem implementations are "
8649 "buggy and do not provide a way to list out attributes. For these "
8650 "filesystems (notably ntfs-3g) you have to know the names of the extended "
8651 "attributes you want in advance and call this function."
8655 #: ../fish/guestfish-actions.pod:1656 ../fish/guestfish-actions.pod:2722 ../src/guestfs-actions.pod:2648 ../src/guestfs-actions.pod:4143
8657 "Extended attribute values are blobs of binary data. If there is no extended "
8658 "attribute named C<name>, this returns an error."
8662 #: ../fish/guestfish-actions.pod:1659
8663 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
8667 #: ../fish/guestfish-actions.pod:1661
8672 #: ../fish/guestfish-actions.pod:1663
8680 #: ../fish/guestfish-actions.pod:1665 ../src/guestfs-actions.pod:2665
8681 msgid "This call lists the extended attributes of the file or directory C<path>."
8685 #: ../fish/guestfish-actions.pod:1668 ../src/guestfs-actions.pod:2668
8687 "At the system call level, this is a combination of the L<listxattr(2)> and "
8688 "L<getxattr(2)> calls."
8692 #: ../fish/guestfish-actions.pod:1671
8693 msgid "See also: L</lgetxattrs>, L<attr(5)>."
8697 #: ../fish/guestfish-actions.pod:1673
8702 #: ../fish/guestfish-actions.pod:1675
8705 " glob-expand pattern\n"
8710 #: ../fish/guestfish-actions.pod:1677 ../src/guestfs-actions.pod:2685
8712 "This command searches for all the pathnames matching C<pattern> according to "
8713 "the wildcard expansion rules used by the shell."
8717 #: ../fish/guestfish-actions.pod:1681 ../src/guestfs-actions.pod:2689
8718 msgid "If no paths match, then this returns an empty list (note: not an error)."
8722 #: ../fish/guestfish-actions.pod:1684 ../src/guestfs-actions.pod:2692
8724 "It is just a wrapper around the C L<glob(3)> function with flags "
8725 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
8729 #: ../fish/guestfish-actions.pod:1688
8734 #: ../fish/guestfish-actions.pod:1690
8737 " grep regex path\n"
8742 #: ../fish/guestfish-actions.pod:1692 ../src/guestfs-actions.pod:2709
8743 msgid "This calls the external C<grep> program and returns the matching lines."
8747 #: ../fish/guestfish-actions.pod:1698
8752 #: ../fish/guestfish-actions.pod:1700
8755 " grepi regex path\n"
8760 #: ../fish/guestfish-actions.pod:1702 ../src/guestfs-actions.pod:2728
8761 msgid "This calls the external C<grep -i> program and returns the matching lines."
8765 #: ../fish/guestfish-actions.pod:1708
8766 msgid "grub-install"
8770 #: ../fish/guestfish-actions.pod:1710
8773 " grub-install root device\n"
8778 #: ../fish/guestfish-actions.pod:1712 ../src/guestfs-actions.pod:2747
8780 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
8781 "with the root directory being C<root>."
8785 #: ../fish/guestfish-actions.pod:1721 ../src/guestfs-actions.pod:2756
8787 "There is currently no way in the API to install grub2, which is used by most "
8788 "modern Linux guests. It is possible to run the grub2 command from the "
8789 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
8793 #: ../fish/guestfish-actions.pod:1728 ../src/guestfs-actions.pod:2763
8795 "This uses C<grub-install> from the host. Unfortunately grub is not always "
8796 "compatible with itself, so this only works in rather narrow circumstances. "
8797 "Careful testing with each guest version is advisable."
8801 #: ../fish/guestfish-actions.pod:1735 ../src/guestfs-actions.pod:2770
8803 "If grub-install reports the error \"No suitable drive was found in the "
8804 "generated device map.\" it may be that you need to create a "
8805 "C</boot/grub/device.map> file first that contains the mapping between grub "
8806 "device names and Linux device names. It is usually sufficient to create a "
8811 #: ../fish/guestfish-actions.pod:1742 ../src/guestfs-actions.pod:2777
8819 #: ../fish/guestfish-actions.pod:1744 ../src/guestfs-actions.pod:2779
8820 msgid "replacing C</dev/vda> with the name of the installation device."
8824 #: ../fish/guestfish-actions.pod:1748
8829 #: ../fish/guestfish-actions.pod:1750
8837 #: ../fish/guestfish-actions.pod:1752 ../src/guestfs-actions.pod:2793
8839 "This command returns up to the first 10 lines of a file as a list of "
8844 #: ../fish/guestfish-actions.pod:1758
8849 #: ../fish/guestfish-actions.pod:1760
8852 " head-n nrlines path\n"
8857 #: ../fish/guestfish-actions.pod:1762 ../src/guestfs-actions.pod:2812
8859 "If the parameter C<nrlines> is a positive number, this returns the first "
8860 "C<nrlines> lines of the file C<path>."
8864 #: ../fish/guestfish-actions.pod:1765 ../src/guestfs-actions.pod:2815
8866 "If the parameter C<nrlines> is a negative number, this returns lines from "
8867 "the file C<path>, excluding the last C<nrlines> lines."
8871 #: ../fish/guestfish-actions.pod:1768 ../fish/guestfish-actions.pod:4867 ../src/guestfs-actions.pod:2818 ../src/guestfs-actions.pod:7474
8872 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8876 #: ../fish/guestfish-actions.pod:1773
8881 #: ../fish/guestfish-actions.pod:1775
8889 #: ../fish/guestfish-actions.pod:1777 ../src/guestfs-actions.pod:2835
8891 "This runs C<hexdump -C> on the given C<path>. The result is the "
8892 "human-readable, canonical hex dump of the file."
8896 #: ../fish/guestfish-actions.pod:1783
8901 #: ../fish/guestfish-actions.pod:1785
8904 " initrd-cat initrdpath filename\n"
8909 #: ../fish/guestfish-actions.pod:1787 ../src/guestfs-actions.pod:2854
8911 "This command unpacks the file C<filename> from the initrd file called "
8912 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8917 #: ../fish/guestfish-actions.pod:1791 ../src/guestfs-actions.pod:2858
8919 "For example, in guestfish you could use the following command to examine the "
8920 "boot script (usually called C</init>) contained in a Linux initrd or "
8925 #: ../fish/guestfish-actions.pod:1795 ../src/guestfs-actions.pod:2862
8928 " initrd-cat /boot/initrd-<version>.img init\n"
8933 #: ../fish/guestfish-actions.pod:1797
8934 msgid "See also L</initrd-list>."
8938 #: ../fish/guestfish-actions.pod:1802
8943 #: ../fish/guestfish-actions.pod:1804
8946 " initrd-list path\n"
8951 #: ../fish/guestfish-actions.pod:1806 ../src/guestfs-actions.pod:2881
8952 msgid "This command lists out files contained in an initrd."
8956 #: ../fish/guestfish-actions.pod:1808 ../src/guestfs-actions.pod:2883
8958 "The files are listed without any initial C</> character. The files are "
8959 "listed in the order they appear (not necessarily alphabetical). Directory "
8960 "names are listed as separate items."
8964 #: ../fish/guestfish-actions.pod:1812 ../src/guestfs-actions.pod:2887
8966 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8967 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8972 #: ../fish/guestfish-actions.pod:1816
8973 msgid "inotify-add-watch"
8977 #: ../fish/guestfish-actions.pod:1818
8980 " inotify-add-watch path mask\n"
8985 #: ../fish/guestfish-actions.pod:1820 ../src/guestfs-actions.pod:2904
8986 msgid "Watch C<path> for the events listed in C<mask>."
8990 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2906
8992 "Note that if C<path> is a directory then events within that directory are "
8993 "watched, but this does I<not> happen recursively (in subdirectories)."
8997 #: ../fish/guestfish-actions.pod:1826 ../src/guestfs-actions.pod:2910
8999 "Note for non-C or non-Linux callers: the inotify events are defined by the "
9000 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
9004 #: ../fish/guestfish-actions.pod:1830
9005 msgid "inotify-close"
9009 #: ../fish/guestfish-actions.pod:1832
9017 #: ../fish/guestfish-actions.pod:1834 ../src/guestfs-actions.pod:2923
9019 "This closes the inotify handle which was previously opened by inotify_init. "
9020 "It removes all watches, throws away any pending events, and deallocates all "
9025 #: ../fish/guestfish-actions.pod:1838
9026 msgid "inotify-files"
9030 #: ../fish/guestfish-actions.pod:1840
9038 #: ../fish/guestfish-actions.pod:1842
9040 "This function is a helpful wrapper around L</inotify-read> which just "
9041 "returns a list of pathnames of objects that were touched. The returned "
9042 "pathnames are sorted and deduplicated."
9046 #: ../fish/guestfish-actions.pod:1846
9047 msgid "inotify-init"
9051 #: ../fish/guestfish-actions.pod:1848
9054 " inotify-init maxevents\n"
9059 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2952
9061 "This command creates a new inotify handle. The inotify subsystem can be "
9062 "used to notify events which happen to objects in the guest filesystem."
9066 #: ../fish/guestfish-actions.pod:1854
9068 "C<maxevents> is the maximum number of events which will be queued up between "
9069 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
9070 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
9071 "default was 16384 events. Beyond this limit, the kernel throws away events, "
9072 "but records the fact that it threw them away by setting a flag "
9073 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
9077 #: ../fish/guestfish-actions.pod:1864
9079 "Before any events are generated, you have to add some watches to the "
9080 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
9081 "L</inotify-watch-all>."
9085 #: ../fish/guestfish-actions.pod:1870
9087 "Queued up events should be read periodically by calling L</inotify-read> (or "
9088 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
9089 "If you don't read the events out often enough then you risk the internal "
9090 "queue overflowing."
9094 #: ../fish/guestfish-actions.pod:1877
9096 "The handle should be closed after use by calling L</inotify-close>. This "
9097 "also removes any watches automatically."
9101 #: ../fish/guestfish-actions.pod:1881 ../src/guestfs-actions.pod:2983
9103 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9104 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9105 "that there is one global inotify handle per libguestfs instance."
9109 #: ../fish/guestfish-actions.pod:1886
9110 msgid "inotify-read"
9114 #: ../fish/guestfish-actions.pod:1888
9122 #: ../fish/guestfish-actions.pod:1890 ../src/guestfs-actions.pod:2997
9124 "Return the complete queue of events that have happened since the previous "
9129 #: ../fish/guestfish-actions.pod:1893 ../src/guestfs-actions.pod:3000
9130 msgid "If no events have happened, this returns an empty list."
9134 #: ../fish/guestfish-actions.pod:1895 ../src/guestfs-actions.pod:3002
9136 "I<Note>: In order to make sure that all events have been read, you must call "
9137 "this function repeatedly until it returns an empty list. The reason is that "
9138 "the call will read events up to the maximum appliance-to-host message size "
9139 "and leave remaining events in the queue."
9143 #: ../fish/guestfish-actions.pod:1901
9144 msgid "inotify-rm-watch"
9148 #: ../fish/guestfish-actions.pod:1903
9151 " inotify-rm-watch wd\n"
9156 #: ../fish/guestfish-actions.pod:1905
9157 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
9161 #: ../fish/guestfish-actions.pod:1908
9162 msgid "inspect-get-arch"
9166 #: ../fish/guestfish-actions.pod:1910
9169 " inspect-get-arch root\n"
9174 #: ../fish/guestfish-actions.pod:1912
9176 "This returns the architecture of the inspected operating system. The "
9177 "possible return values are listed under L</file-architecture>."
9181 #: ../fish/guestfish-actions.pod:1916 ../src/guestfs-actions.pod:3037
9183 "If the architecture could not be determined, then the string C<unknown> is "
9188 #: ../fish/guestfish-actions.pod:1919 ../fish/guestfish-actions.pod:2014 ../fish/guestfish-actions.pod:2093 ../fish/guestfish-actions.pod:2105 ../fish/guestfish-actions.pod:2189 ../fish/guestfish-actions.pod:2251 ../fish/guestfish-actions.pod:2272 ../fish/guestfish-actions.pod:2286 ../fish/guestfish-actions.pod:2326 ../fish/guestfish-actions.pod:2362 ../fish/guestfish-actions.pod:2375 ../fish/guestfish-actions.pod:2388 ../fish/guestfish-actions.pod:2398 ../fish/guestfish-actions.pod:2408 ../fish/guestfish-actions.pod:2420 ../fish/guestfish-actions.pod:2516 ../fish/guestfish-actions.pod:2550 ../src/guestfs-actions.pod:3040 ../src/guestfs-actions.pod:3142 ../src/guestfs-actions.pod:3246 ../src/guestfs-actions.pod:3265 ../src/guestfs-actions.pod:3396 ../src/guestfs-actions.pod:3480 ../src/guestfs-actions.pod:3508 ../src/guestfs-actions.pod:3529 ../src/guestfs-actions.pod:3582 ../src/guestfs-actions.pod:3626 ../src/guestfs-actions.pod:3646 ../src/guestfs-actions.pod:3666 ../src/guestfs-actions.pod:3683 ../src/guestfs-actions.pod:3699 ../src/guestfs-actions.pod:3717 ../src/guestfs-actions.pod:3819 ../src/guestfs-actions.pod:3860
9189 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
9193 #: ../fish/guestfish-actions.pod:1921
9194 msgid "inspect-get-distro"
9198 #: ../fish/guestfish-actions.pod:1923
9201 " inspect-get-distro root\n"
9206 #: ../fish/guestfish-actions.pod:1925 ../src/guestfs-actions.pod:3053
9207 msgid "This returns the distro (distribution) of the inspected operating system."
9211 #: ../fish/guestfish-actions.pod:1928 ../src/guestfs-actions.pod:3056
9212 msgid "Currently defined distros are:"
9216 #: ../fish/guestfish-actions.pod:1932 ../src/guestfs-actions.pod:3060
9217 msgid "\"archlinux\""
9221 #: ../fish/guestfish-actions.pod:1934 ../src/guestfs-actions.pod:3062
9226 #: ../fish/guestfish-actions.pod:1936 ../src/guestfs-actions.pod:3064
9231 #: ../fish/guestfish-actions.pod:1938 ../src/guestfs-actions.pod:3066
9236 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:3068
9241 #: ../fish/guestfish-actions.pod:1942 ../src/guestfs-actions.pod:3070
9246 #: ../fish/guestfish-actions.pod:1944 ../src/guestfs-actions.pod:3072
9251 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:3074
9256 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:3076
9261 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:3078
9266 #: ../fish/guestfish-actions.pod:1952 ../src/guestfs-actions.pod:3080
9267 msgid "\"linuxmint\""
9271 #: ../fish/guestfish-actions.pod:1954 ../src/guestfs-actions.pod:3082
9276 #: ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:3084
9281 #: ../fish/guestfish-actions.pod:1958 ../src/guestfs-actions.pod:3086
9286 #: ../fish/guestfish-actions.pod:1960 ../src/guestfs-actions.pod:3088
9287 msgid "\"mandriva\""
9291 #: ../fish/guestfish-actions.pod:1962 ../src/guestfs-actions.pod:3090
9296 #: ../fish/guestfish-actions.pod:1964 ../src/guestfs-actions.pod:3092
9301 #: ../fish/guestfish-actions.pod:1966 ../src/guestfs-actions.pod:3094
9306 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:3096
9307 msgid "\"opensuse\""
9311 #: ../fish/guestfish-actions.pod:1970 ../src/guestfs-actions.pod:3098
9316 #: ../fish/guestfish-actions.pod:1972 ../src/guestfs-actions.pod:3100
9321 #: ../fish/guestfish-actions.pod:1974 ../src/guestfs-actions.pod:3102
9326 #: ../fish/guestfish-actions.pod:1976 ../src/guestfs-actions.pod:3104
9327 msgid "\"redhat-based\""
9331 #: ../fish/guestfish-actions.pod:1978 ../src/guestfs-actions.pod:3106
9332 msgid "Some Red Hat-derived distro."
9336 #: ../fish/guestfish-actions.pod:1980 ../src/guestfs-actions.pod:3108
9341 #: ../fish/guestfish-actions.pod:1982 ../src/guestfs-actions.pod:3110
9342 msgid "Red Hat Enterprise Linux."
9346 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:3112
9347 msgid "\"scientificlinux\""
9351 #: ../fish/guestfish-actions.pod:1986 ../src/guestfs-actions.pod:3114
9352 msgid "Scientific Linux."
9356 #: ../fish/guestfish-actions.pod:1988 ../src/guestfs-actions.pod:3116
9357 msgid "\"slackware\""
9361 #: ../fish/guestfish-actions.pod:1990 ../src/guestfs-actions.pod:3118
9366 #: ../fish/guestfish-actions.pod:1992 ../src/guestfs-actions.pod:3120
9367 msgid "\"ttylinux\""
9371 #: ../fish/guestfish-actions.pod:1994 ../src/guestfs-actions.pod:3122
9376 #: ../fish/guestfish-actions.pod:1996 ../src/guestfs-actions.pod:3124
9381 #: ../fish/guestfish-actions.pod:1998 ../src/guestfs-actions.pod:3126
9386 #: ../fish/guestfish-actions.pod:2000 ../fish/guestfish-actions.pod:2084 ../fish/guestfish-actions.pod:2353 ../src/guestfs-actions.pod:3128 ../src/guestfs-actions.pod:3237 ../src/guestfs-actions.pod:3617
9391 #: ../fish/guestfish-actions.pod:2002 ../src/guestfs-actions.pod:3130
9392 msgid "The distro could not be determined."
9396 #: ../fish/guestfish-actions.pod:2004 ../fish/guestfish-actions.pod:2341 ../src/guestfs-actions.pod:3132 ../src/guestfs-actions.pod:3605
9401 #: ../fish/guestfish-actions.pod:2006 ../src/guestfs-actions.pod:3134
9403 "Windows does not have distributions. This string is returned if the OS type "
9408 #: ../fish/guestfish-actions.pod:2011 ../fish/guestfish-actions.pod:2090 ../fish/guestfish-actions.pod:2359 ../src/guestfs-actions.pod:3139 ../src/guestfs-actions.pod:3243 ../src/guestfs-actions.pod:3623
9410 "Future versions of libguestfs may return other strings here. The caller "
9411 "should be prepared to handle any string."
9415 #: ../fish/guestfish-actions.pod:2016
9416 msgid "inspect-get-drive-mappings"
9420 #: ../fish/guestfish-actions.pod:2018
9423 " inspect-get-drive-mappings root\n"
9428 #: ../fish/guestfish-actions.pod:2020 ../src/guestfs-actions.pod:3155
9430 "This call is useful for Windows which uses a primitive system of assigning "
9431 "drive letters (like \"C:\") to partitions. This inspection API examines the "
9432 "Windows Registry to find out how disks/partitions are mapped to drive "
9433 "letters, and returns a hash table as in the example below:"
9437 #: ../fish/guestfish-actions.pod:2026 ../src/guestfs-actions.pod:3161
9447 #: ../fish/guestfish-actions.pod:2030 ../src/guestfs-actions.pod:3165
9449 "Note that keys are drive letters. For Windows, the key is case insensitive "
9450 "and just contains the drive letter, without the customary colon separator "
9455 #: ../fish/guestfish-actions.pod:2034 ../src/guestfs-actions.pod:3169
9457 "In future we may support other operating systems that also used drive "
9458 "letters, but the keys for those might not be case insensitive and might be "
9459 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
9464 #: ../fish/guestfish-actions.pod:2039 ../src/guestfs-actions.pod:3174
9466 "For Windows guests, currently only hard drive mappings are returned. "
9467 "Removable disks (eg. DVD-ROMs) are ignored."
9471 #: ../fish/guestfish-actions.pod:2042 ../src/guestfs-actions.pod:3177
9473 "For guests that do not use drive mappings, or if the drive mappings could "
9474 "not be determined, this returns an empty hash table."
9478 #: ../fish/guestfish-actions.pod:2045
9480 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9481 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
9485 #: ../fish/guestfish-actions.pod:2049
9486 msgid "inspect-get-filesystems"
9490 #: ../fish/guestfish-actions.pod:2051
9493 " inspect-get-filesystems root\n"
9498 #: ../fish/guestfish-actions.pod:2053 ../src/guestfs-actions.pod:3198
9500 "This returns a list of all the filesystems that we think are associated with "
9501 "this operating system. This includes the root filesystem, other ordinary "
9502 "filesystems, and non-mounted devices like swap partitions."
9506 #: ../fish/guestfish-actions.pod:2058 ../src/guestfs-actions.pod:3203
9508 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9509 "to be shared between operating systems."
9513 #: ../fish/guestfish-actions.pod:2061
9515 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9516 "L</inspect-get-mountpoints>."
9520 #: ../fish/guestfish-actions.pod:2064
9521 msgid "inspect-get-format"
9525 #: ../fish/guestfish-actions.pod:2066
9528 " inspect-get-format root\n"
9533 #: ../fish/guestfish-actions.pod:2068 ../src/guestfs-actions.pod:3221
9535 "This returns the format of the inspected operating system. You can use it "
9536 "to detect install images, live CDs and similar."
9540 #: ../fish/guestfish-actions.pod:2071 ../src/guestfs-actions.pod:3224
9541 msgid "Currently defined formats are:"
9545 #: ../fish/guestfish-actions.pod:2075 ../src/guestfs-actions.pod:3228
9546 msgid "\"installed\""
9550 #: ../fish/guestfish-actions.pod:2077 ../src/guestfs-actions.pod:3230
9551 msgid "This is an installed operating system."
9555 #: ../fish/guestfish-actions.pod:2079 ../src/guestfs-actions.pod:3232
9556 msgid "\"installer\""
9560 #: ../fish/guestfish-actions.pod:2081 ../src/guestfs-actions.pod:3234
9562 "The disk image being inspected is not an installed operating system, but a "
9563 "I<bootable> install disk, live CD, or similar."
9567 #: ../fish/guestfish-actions.pod:2086 ../src/guestfs-actions.pod:3239
9568 msgid "The format of this disk image is not known."
9572 #: ../fish/guestfish-actions.pod:2095
9573 msgid "inspect-get-hostname"
9577 #: ../fish/guestfish-actions.pod:2097
9580 " inspect-get-hostname root\n"
9585 #: ../fish/guestfish-actions.pod:2099 ../src/guestfs-actions.pod:3259
9587 "This function returns the hostname of the operating system as found by "
9588 "inspection of the guest's configuration files."
9592 #: ../fish/guestfish-actions.pod:2102 ../src/guestfs-actions.pod:3262
9594 "If the hostname could not be determined, then the string C<unknown> is "
9599 #: ../fish/guestfish-actions.pod:2107
9600 msgid "inspect-get-icon"
9604 #: ../fish/guestfish-actions.pod:2109
9607 " inspect-get-icon root [favicon:..] [highquality:..]\n"
9612 #: ../fish/guestfish-actions.pod:2111 ../src/guestfs-actions.pod:3288
9614 "This function returns an icon corresponding to the inspected operating "
9615 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
9616 "to PNG if necessary)."
9620 #: ../fish/guestfish-actions.pod:2115 ../src/guestfs-actions.pod:3292
9622 "If it was not possible to get an icon this function returns a zero-length "
9623 "(non-NULL) buffer. I<Callers must check for this case>."
9627 #: ../fish/guestfish-actions.pod:2118 ../src/guestfs-actions.pod:3295
9629 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
9630 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
9631 "this file will be returned. You can disable favicons by passing the "
9632 "optional C<favicon> boolean as false (default is true)."
9636 #: ../fish/guestfish-actions.pod:2124 ../src/guestfs-actions.pod:3301
9638 "If finding the favicon fails, then we look in other places in the guest for "
9643 #: ../fish/guestfish-actions.pod:2127 ../src/guestfs-actions.pod:3304
9645 "If the optional C<highquality> boolean is true then only high quality icons "
9646 "are returned, which means only icons of high resolution with an alpha "
9647 "channel. The default (false) is to return any icon we can, even if it is of "
9648 "substandard quality."
9652 #: ../fish/guestfish-actions.pod:2138 ../src/guestfs-actions.pod:3315
9654 "Unlike most other inspection API calls, the guest's disks must be mounted up "
9655 "before you call this, since it needs to read information from the guest "
9656 "filesystem during the call."
9660 #: ../fish/guestfish-actions.pod:2144 ../src/guestfs-actions.pod:3321
9662 "B<Security:> The icon data comes from the untrusted guest, and should be "
9663 "treated with caution. PNG files have been known to contain exploits. "
9664 "Ensure that libpng (or other relevant libraries) are fully up to date before "
9665 "trying to process or display the icon."
9669 #: ../fish/guestfish-actions.pod:2152 ../src/guestfs-actions.pod:3329
9671 "The PNG image returned can be any size. It might not be square. Libguestfs "
9672 "tries to return the largest, highest quality icon available. The "
9673 "application must scale the icon to the required size."
9677 #: ../fish/guestfish-actions.pod:2159 ../src/guestfs-actions.pod:3336
9679 "Extracting icons from Windows guests requires the external C<wrestool> "
9680 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
9681 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
9682 "installed separately."
9686 #: ../fish/guestfish-actions.pod:2166 ../src/guestfs-actions.pod:3343
9688 "Operating system icons are usually trademarks. Seek legal advice before "
9689 "using trademarks in applications."
9693 #: ../fish/guestfish-actions.pod:2173
9694 msgid "inspect-get-major-version"
9698 #: ../fish/guestfish-actions.pod:2175
9701 " inspect-get-major-version root\n"
9706 #: ../fish/guestfish-actions.pod:2177 ../src/guestfs-actions.pod:3384
9707 msgid "This returns the major version number of the inspected operating system."
9711 #: ../fish/guestfish-actions.pod:2180 ../src/guestfs-actions.pod:3387
9713 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9714 "popular public names used by the operating system. Notably the operating "
9715 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9716 "1). You can find out the real versions corresponding to releases of Windows "
9717 "by consulting Wikipedia or MSDN."
9721 #: ../fish/guestfish-actions.pod:2187 ../fish/guestfish-actions.pod:2198 ../src/guestfs-actions.pod:3394 ../src/guestfs-actions.pod:3411
9722 msgid "If the version could not be determined, then C<0> is returned."
9726 #: ../fish/guestfish-actions.pod:2191
9727 msgid "inspect-get-minor-version"
9731 #: ../fish/guestfish-actions.pod:2193
9734 " inspect-get-minor-version root\n"
9739 #: ../fish/guestfish-actions.pod:2195 ../src/guestfs-actions.pod:3408
9740 msgid "This returns the minor version number of the inspected operating system."
9744 #: ../fish/guestfish-actions.pod:2200
9746 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9747 "L</inspect-get-major-version>."
9751 #: ../fish/guestfish-actions.pod:2203
9752 msgid "inspect-get-mountpoints"
9756 #: ../fish/guestfish-actions.pod:2205
9759 " inspect-get-mountpoints root\n"
9764 #: ../fish/guestfish-actions.pod:2207 ../src/guestfs-actions.pod:3426
9766 "This returns a hash of where we think the filesystems associated with this "
9767 "operating system should be mounted. Callers should note that this is at "
9768 "best an educated guess made by reading configuration files such as "
9769 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
9770 "are non-existent or not mountable and callers should be prepared to handle "
9771 "or ignore failures if they try to mount them."
9775 #: ../fish/guestfish-actions.pod:2216 ../src/guestfs-actions.pod:3435
9777 "Each element in the returned hashtable has a key which is the path of the "
9778 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9779 "mounted there (eg. C</dev/sda1>)."
9783 #: ../fish/guestfish-actions.pod:2221 ../src/guestfs-actions.pod:3440
9784 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
9788 #: ../fish/guestfish-actions.pod:2224
9790 "For operating systems like Windows which still use drive letters, this call "
9791 "will only return an entry for the first drive \"mounted on\" C</>. For "
9792 "information about the mapping of drive letters to partitions, see "
9793 "L</inspect-get-drive-mappings>."
9797 #: ../fish/guestfish-actions.pod:2230
9799 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9800 "L</inspect-get-filesystems>."
9804 #: ../fish/guestfish-actions.pod:2233
9805 msgid "inspect-get-package-format"
9809 #: ../fish/guestfish-actions.pod:2235
9812 " inspect-get-package-format root\n"
9817 #: ../fish/guestfish-actions.pod:2237
9819 "This function and L</inspect-get-package-management> return the package "
9820 "format and package management tool used by the inspected operating system. "
9821 "For example for Fedora these functions would return C<rpm> (package format) "
9822 "and C<yum> (package management)."
9826 #: ../fish/guestfish-actions.pod:2243 ../src/guestfs-actions.pod:3472
9828 "This returns the string C<unknown> if we could not determine the package "
9829 "format I<or> if the operating system does not have a real packaging system "
9834 #: ../fish/guestfish-actions.pod:2247 ../src/guestfs-actions.pod:3476
9836 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
9837 "C<pkgsrc>. Future versions of libguestfs may return other strings."
9841 #: ../fish/guestfish-actions.pod:2253
9842 msgid "inspect-get-package-management"
9846 #: ../fish/guestfish-actions.pod:2255
9849 " inspect-get-package-management root\n"
9854 #: ../fish/guestfish-actions.pod:2257
9856 "L</inspect-get-package-format> and this function return the package format "
9857 "and package management tool used by the inspected operating system. For "
9858 "example for Fedora these functions would return C<rpm> (package format) and "
9859 "C<yum> (package management)."
9863 #: ../fish/guestfish-actions.pod:2263 ../src/guestfs-actions.pod:3499
9865 "This returns the string C<unknown> if we could not determine the package "
9866 "management tool I<or> if the operating system does not have a real packaging "
9867 "system (eg. Windows)."
9871 #: ../fish/guestfish-actions.pod:2267 ../src/guestfs-actions.pod:3503
9873 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9874 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
9875 "versions of libguestfs may return other strings."
9879 #: ../fish/guestfish-actions.pod:2274
9880 msgid "inspect-get-product-name"
9884 #: ../fish/guestfish-actions.pod:2276
9887 " inspect-get-product-name root\n"
9892 #: ../fish/guestfish-actions.pod:2278 ../src/guestfs-actions.pod:3521
9894 "This returns the product name of the inspected operating system. The "
9895 "product name is generally some freeform string which can be displayed to the "
9896 "user, but should not be parsed by programs."
9900 #: ../fish/guestfish-actions.pod:2283 ../src/guestfs-actions.pod:3526
9902 "If the product name could not be determined, then the string C<unknown> is "
9907 #: ../fish/guestfish-actions.pod:2288
9908 msgid "inspect-get-product-variant"
9912 #: ../fish/guestfish-actions.pod:2290
9915 " inspect-get-product-variant root\n"
9920 #: ../fish/guestfish-actions.pod:2292 ../src/guestfs-actions.pod:3542
9921 msgid "This returns the product variant of the inspected operating system."
9925 #: ../fish/guestfish-actions.pod:2295 ../src/guestfs-actions.pod:3545
9927 "For Windows guests, this returns the contents of the Registry key "
9928 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
9929 "which is usually a string such as C<Client> or C<Server> (other values are "
9930 "possible). This can be used to distinguish consumer and enterprise versions "
9931 "of Windows that have the same version number (for example, Windows 7 and "
9932 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
9933 "the latter is C<Server>)."
9937 #: ../fish/guestfish-actions.pod:2304 ../src/guestfs-actions.pod:3554
9939 "For enterprise Linux guests, in future we intend this to return the product "
9940 "variant such as C<Desktop>, C<Server> and so on. But this is not "
9941 "implemented at present."
9945 #: ../fish/guestfish-actions.pod:2308 ../src/guestfs-actions.pod:3558
9947 "If the product variant could not be determined, then the string C<unknown> "
9952 #: ../fish/guestfish-actions.pod:2311
9954 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9955 "L</inspect-get-product-name>, L</inspect-get-major-version>."
9959 #: ../fish/guestfish-actions.pod:2315
9960 msgid "inspect-get-roots"
9964 #: ../fish/guestfish-actions.pod:2317
9967 " inspect-get-roots\n"
9972 #: ../fish/guestfish-actions.pod:2319
9974 "This function is a convenient way to get the list of root devices, as "
9975 "returned from a previous call to L</inspect-os>, but without redoing the "
9976 "whole inspection process."
9980 #: ../fish/guestfish-actions.pod:2323
9982 "This returns an empty list if either no root devices were found or the "
9983 "caller has not called L</inspect-os>."
9987 #: ../fish/guestfish-actions.pod:2328
9988 msgid "inspect-get-type"
9992 #: ../fish/guestfish-actions.pod:2330
9995 " inspect-get-type root\n"
10000 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3596
10002 "This returns the type of the inspected operating system. Currently defined "
10007 #: ../fish/guestfish-actions.pod:2337 ../src/guestfs-actions.pod:3601
10012 #: ../fish/guestfish-actions.pod:2339 ../src/guestfs-actions.pod:3603
10013 msgid "Any Linux-based operating system."
10017 #: ../fish/guestfish-actions.pod:2343 ../src/guestfs-actions.pod:3607
10018 msgid "Any Microsoft Windows operating system."
10022 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3609
10023 msgid "\"freebsd\""
10027 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3611
10032 #: ../fish/guestfish-actions.pod:2349 ../src/guestfs-actions.pod:3613
10037 #: ../fish/guestfish-actions.pod:2351 ../src/guestfs-actions.pod:3615
10042 #: ../fish/guestfish-actions.pod:2355 ../src/guestfs-actions.pod:3619
10043 msgid "The operating system type could not be determined."
10047 #: ../fish/guestfish-actions.pod:2364
10048 msgid "inspect-get-windows-current-control-set"
10052 #: ../fish/guestfish-actions.pod:2366
10055 " inspect-get-windows-current-control-set root\n"
10060 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3639
10062 "This returns the Windows CurrentControlSet of the inspected guest. The "
10063 "CurrentControlSet is a registry key name such as C<ControlSet001>."
10067 #: ../fish/guestfish-actions.pod:2371 ../src/guestfs-actions.pod:3642
10069 "This call assumes that the guest is Windows and that the Registry could be "
10070 "examined by inspection. If this is not the case then an error is returned."
10074 #: ../fish/guestfish-actions.pod:2377
10075 msgid "inspect-get-windows-systemroot"
10079 #: ../fish/guestfish-actions.pod:2379
10082 " inspect-get-windows-systemroot root\n"
10087 #: ../fish/guestfish-actions.pod:2381 ../src/guestfs-actions.pod:3659
10089 "This returns the Windows systemroot of the inspected guest. The systemroot "
10090 "is a directory path such as C</WINDOWS>."
10094 #: ../fish/guestfish-actions.pod:2384 ../src/guestfs-actions.pod:3662
10096 "This call assumes that the guest is Windows and that the systemroot could be "
10097 "determined by inspection. If this is not the case then an error is "
10102 #: ../fish/guestfish-actions.pod:2390
10103 msgid "inspect-is-live"
10107 #: ../fish/guestfish-actions.pod:2392
10110 " inspect-is-live root\n"
10115 #: ../fish/guestfish-actions.pod:2394
10117 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10118 "then this returns true if a live image was detected on the disk."
10122 #: ../fish/guestfish-actions.pod:2400
10123 msgid "inspect-is-multipart"
10127 #: ../fish/guestfish-actions.pod:2402
10130 " inspect-is-multipart root\n"
10135 #: ../fish/guestfish-actions.pod:2404
10137 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10138 "then this returns true if the disk is part of a set."
10142 #: ../fish/guestfish-actions.pod:2410
10143 msgid "inspect-is-netinst"
10147 #: ../fish/guestfish-actions.pod:2412
10150 " inspect-is-netinst root\n"
10155 #: ../fish/guestfish-actions.pod:2414
10157 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10158 "then this returns true if the disk is a network installer, ie. not a "
10159 "self-contained install CD but one which is likely to require network access "
10160 "to complete the install."
10164 #: ../fish/guestfish-actions.pod:2422
10165 msgid "inspect-list-applications"
10169 #: ../fish/guestfish-actions.pod:2424
10172 " inspect-list-applications root\n"
10177 #: ../fish/guestfish-actions.pod:2426 ../src/guestfs-actions.pod:3729
10178 msgid "Return the list of applications installed in the operating system."
10182 #: ../fish/guestfish-actions.pod:2428
10184 "I<Note:> This call works differently from other parts of the inspection "
10185 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
10186 "then mount up the disks, before calling this. Listing applications is a "
10187 "significantly more difficult operation which requires access to the full "
10188 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
10189 "are just returning data cached in the libguestfs handle, this call actually "
10190 "reads parts of the mounted filesystems during the call."
10194 #: ../fish/guestfish-actions.pod:2438 ../src/guestfs-actions.pod:3741
10196 "This returns an empty list if the inspection code was not able to determine "
10197 "the list of applications."
10201 #: ../fish/guestfish-actions.pod:2441 ../src/guestfs-actions.pod:3744
10202 msgid "The application structure contains the following fields:"
10206 #: ../fish/guestfish-actions.pod:2445 ../src/guestfs-actions.pod:3748
10207 msgid "C<app_name>"
10211 #: ../fish/guestfish-actions.pod:2447 ../src/guestfs-actions.pod:3750
10213 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10214 "guests, this is the package name."
10218 #: ../fish/guestfish-actions.pod:2450 ../src/guestfs-actions.pod:3753
10219 msgid "C<app_display_name>"
10223 #: ../fish/guestfish-actions.pod:2452 ../src/guestfs-actions.pod:3755
10225 "The display name of the application, sometimes localized to the install "
10226 "language of the guest operating system."
10230 #: ../fish/guestfish-actions.pod:2455 ../src/guestfs-actions.pod:3758
10232 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10233 "to display something can use C<app_name> instead."
10237 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3761
10238 msgid "C<app_epoch>"
10242 #: ../fish/guestfish-actions.pod:2460 ../src/guestfs-actions.pod:3763
10244 "For package managers which use epochs, this contains the epoch of the "
10245 "package (an integer). If unavailable, this is returned as C<0>."
10249 #: ../fish/guestfish-actions.pod:2463 ../src/guestfs-actions.pod:3766
10250 msgid "C<app_version>"
10254 #: ../fish/guestfish-actions.pod:2465 ../src/guestfs-actions.pod:3768
10256 "The version string of the application or package. If unavailable this is "
10257 "returned as an empty string C<\"\">."
10261 #: ../fish/guestfish-actions.pod:2468 ../src/guestfs-actions.pod:3771
10262 msgid "C<app_release>"
10266 #: ../fish/guestfish-actions.pod:2470 ../src/guestfs-actions.pod:3773
10268 "The release string of the application or package, for package managers that "
10269 "use this. If unavailable this is returned as an empty string C<\"\">."
10273 #: ../fish/guestfish-actions.pod:2474 ../src/guestfs-actions.pod:3777
10274 msgid "C<app_install_path>"
10278 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3779
10280 "The installation path of the application (on operating systems such as "
10281 "Windows which use installation paths). This path is in the format used by "
10282 "the guest operating system, it is not a libguestfs path."
10286 #: ../fish/guestfish-actions.pod:2481 ../src/guestfs-actions.pod:3784
10287 msgid "If unavailable this is returned as an empty string C<\"\">."
10291 #: ../fish/guestfish-actions.pod:2483 ../src/guestfs-actions.pod:3786
10292 msgid "C<app_trans_path>"
10296 #: ../fish/guestfish-actions.pod:2485 ../src/guestfs-actions.pod:3788
10298 "The install path translated into a libguestfs path. If unavailable this is "
10299 "returned as an empty string C<\"\">."
10303 #: ../fish/guestfish-actions.pod:2488 ../src/guestfs-actions.pod:3791
10304 msgid "C<app_publisher>"
10308 #: ../fish/guestfish-actions.pod:2490 ../src/guestfs-actions.pod:3793
10310 "The name of the publisher of the application, for package managers that use "
10311 "this. If unavailable this is returned as an empty string C<\"\">."
10315 #: ../fish/guestfish-actions.pod:2494 ../src/guestfs-actions.pod:3797
10320 #: ../fish/guestfish-actions.pod:2496 ../src/guestfs-actions.pod:3799
10322 "The URL (eg. upstream URL) of the application. If unavailable this is "
10323 "returned as an empty string C<\"\">."
10327 #: ../fish/guestfish-actions.pod:2499 ../src/guestfs-actions.pod:3802
10328 msgid "C<app_source_package>"
10332 #: ../fish/guestfish-actions.pod:2501 ../src/guestfs-actions.pod:3804
10334 "For packaging systems which support this, the name of the source package. "
10335 "If unavailable this is returned as an empty string C<\"\">."
10339 #: ../fish/guestfish-actions.pod:2504 ../src/guestfs-actions.pod:3807
10340 msgid "C<app_summary>"
10344 #: ../fish/guestfish-actions.pod:2506 ../src/guestfs-actions.pod:3809
10346 "A short (usually one line) description of the application or package. If "
10347 "unavailable this is returned as an empty string C<\"\">."
10351 #: ../fish/guestfish-actions.pod:2509 ../src/guestfs-actions.pod:3812
10352 msgid "C<app_description>"
10356 #: ../fish/guestfish-actions.pod:2511 ../src/guestfs-actions.pod:3814
10358 "A longer description of the application or package. If unavailable this is "
10359 "returned as an empty string C<\"\">."
10363 #: ../fish/guestfish-actions.pod:2518
10368 #: ../fish/guestfish-actions.pod:2520
10376 #: ../fish/guestfish-actions.pod:2522 ../src/guestfs-actions.pod:3832
10378 "This function uses other libguestfs functions and certain heuristics to "
10379 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10380 "for operating systems."
10384 #: ../fish/guestfish-actions.pod:2526 ../src/guestfs-actions.pod:3836
10385 msgid "The list returned is empty if no operating systems were found."
10389 #: ../fish/guestfish-actions.pod:2528 ../src/guestfs-actions.pod:3838
10391 "If one operating system was found, then this returns a list with a single "
10392 "element, which is the name of the root filesystem of this operating system. "
10393 "It is also possible for this function to return a list containing more than "
10394 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10395 "element being the root filesystem of one of the operating systems."
10399 #: ../fish/guestfish-actions.pod:2535
10401 "You can pass the root string(s) returned to other L</inspect-get-*> "
10402 "functions in order to query further information about each operating system, "
10403 "such as the name and version."
10407 #: ../fish/guestfish-actions.pod:2540
10409 "This function uses other libguestfs features such as L</mount-ro> and "
10410 "L</umount-all> in order to mount and unmount filesystems and look at the "
10411 "contents. This should be called with no disks currently mounted. The "
10412 "function may also use Augeas, so any existing Augeas handle will be closed."
10416 #: ../fish/guestfish-actions.pod:2546 ../src/guestfs-actions.pod:3856
10418 "This function cannot decrypt encrypted disks. The caller must do that first "
10419 "(supplying the necessary keys) if the disk is encrypted."
10423 #: ../fish/guestfish-actions.pod:2552 ../fish/guestfish-actions.pod:2750 ../fish/guestfish-actions.pod:2809
10424 msgid "See also L</list-filesystems>."
10428 #: ../fish/guestfish-actions.pod:2554
10429 msgid "is-blockdev"
10433 #: ../fish/guestfish-actions.pod:2556
10436 " is-blockdev path\n"
10441 #: ../fish/guestfish-actions.pod:2558 ../src/guestfs-actions.pod:3876
10443 "This returns C<true> if and only if there is a block device with the given "
10448 #: ../fish/guestfish-actions.pod:2561 ../fish/guestfish-actions.pod:2579 ../fish/guestfish-actions.pod:2598 ../fish/guestfish-actions.pod:2607 ../fish/guestfish-actions.pod:2617 ../fish/guestfish-actions.pod:2651 ../fish/guestfish-actions.pod:2660
10449 msgid "See also L</stat>."
10453 #: ../fish/guestfish-actions.pod:2563
10458 #: ../fish/guestfish-actions.pod:2565
10466 #: ../fish/guestfish-actions.pod:2567 ../src/guestfs-actions.pod:3890
10468 "This returns true iff this handle is busy processing a command (in the "
10473 #: ../fish/guestfish-actions.pod:2572
10478 #: ../fish/guestfish-actions.pod:2574
10481 " is-chardev path\n"
10486 #: ../fish/guestfish-actions.pod:2576 ../src/guestfs-actions.pod:3905
10488 "This returns C<true> if and only if there is a character device with the "
10489 "given C<path> name."
10493 #: ../fish/guestfish-actions.pod:2581
10498 #: ../fish/guestfish-actions.pod:2583
10506 #: ../fish/guestfish-actions.pod:2585 ../src/guestfs-actions.pod:3919
10508 "This returns true iff this handle is being configured (in the C<CONFIG> "
10513 #: ../fish/guestfish-actions.pod:2590
10518 #: ../fish/guestfish-actions.pod:2592
10526 #: ../fish/guestfish-actions.pod:2594 ../src/guestfs-actions.pod:3934
10528 "This returns C<true> if and only if there is a directory with the given "
10529 "C<path> name. Note that it returns false for other objects like files."
10533 #: ../fish/guestfish-actions.pod:2600
10538 #: ../fish/guestfish-actions.pod:2602
10546 #: ../fish/guestfish-actions.pod:2604 ../src/guestfs-actions.pod:3950
10548 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
10549 "given C<path> name."
10553 #: ../fish/guestfish-actions.pod:2609
10558 #: ../fish/guestfish-actions.pod:2611
10566 #: ../fish/guestfish-actions.pod:2613 ../src/guestfs-actions.pod:3965
10568 "This returns C<true> if and only if there is a regular file with the given "
10569 "C<path> name. Note that it returns false for other objects like "
10574 #: ../fish/guestfish-actions.pod:2619
10575 msgid "is-launching"
10579 #: ../fish/guestfish-actions.pod:2621
10587 #: ../fish/guestfish-actions.pod:2623 ../src/guestfs-actions.pod:3980
10589 "This returns true iff this handle is launching the subprocess (in the "
10590 "C<LAUNCHING> state)."
10594 #: ../fish/guestfish-actions.pod:2628
10599 #: ../fish/guestfish-actions.pod:2630
10607 #: ../fish/guestfish-actions.pod:2632 ../src/guestfs-actions.pod:3995
10609 "This command tests whether C<device> is a logical volume, and returns true "
10610 "iff this is the case."
10614 #: ../fish/guestfish-actions.pod:2635
10619 #: ../fish/guestfish-actions.pod:2637
10627 #: ../fish/guestfish-actions.pod:2639 ../src/guestfs-actions.pod:4007
10629 "This returns true iff this handle is ready to accept commands (in the "
10634 #: ../fish/guestfish-actions.pod:2644
10639 #: ../fish/guestfish-actions.pod:2646
10642 " is-socket path\n"
10647 #: ../fish/guestfish-actions.pod:2648 ../src/guestfs-actions.pod:4022
10649 "This returns C<true> if and only if there is a Unix domain socket with the "
10650 "given C<path> name."
10654 #: ../fish/guestfish-actions.pod:2653
10659 #: ../fish/guestfish-actions.pod:2655
10662 " is-symlink path\n"
10667 #: ../fish/guestfish-actions.pod:2657 ../src/guestfs-actions.pod:4037
10669 "This returns C<true> if and only if there is a symbolic link with the given "
10674 #: ../fish/guestfish-actions.pod:2662
10679 #: ../fish/guestfish-actions.pod:2664
10687 #: ../fish/guestfish-actions.pod:2666 ../src/guestfs-actions.pod:4052
10689 "This returns true iff the file exists and the file is empty or it contains "
10694 #: ../fish/guestfish-actions.pod:2669
10695 msgid "is-zero-device"
10699 #: ../fish/guestfish-actions.pod:2671
10702 " is-zero-device device\n"
10707 #: ../fish/guestfish-actions.pod:2673 ../src/guestfs-actions.pod:4065
10708 msgid "This returns true iff the device exists and contains all zero bytes."
10712 #: ../fish/guestfish-actions.pod:2675 ../src/guestfs-actions.pod:4067
10713 msgid "Note that for large devices this can take a long time to run."
10717 #: ../fish/guestfish-actions.pod:2677
10718 msgid "kill-subprocess"
10722 #: ../fish/guestfish-actions.pod:2679
10725 " kill-subprocess\n"
10730 #: ../fish/guestfish-actions.pod:2681 ../src/guestfs-actions.pod:4078
10731 msgid "This kills the qemu subprocess. You should never need to call this."
10735 #: ../fish/guestfish-actions.pod:2683
10740 #: ../fish/guestfish-actions.pod:2685
10745 #: ../fish/guestfish-actions.pod:2687
10753 #: ../fish/guestfish-actions.pod:2689 ../src/guestfs-actions.pod:4089
10755 "Internally libguestfs is implemented by running a virtual machine using "
10760 #: ../fish/guestfish-actions.pod:2692 ../src/guestfs-actions.pod:4092
10762 "You should call this after configuring the handle (eg. adding drives) but "
10763 "before performing any actions."
10767 #: ../fish/guestfish-actions.pod:2695
10772 #: ../fish/guestfish-actions.pod:2697
10775 " lchown owner group path\n"
10780 #: ../fish/guestfish-actions.pod:2699
10782 "Change the file owner to C<owner> and group to C<group>. This is like "
10783 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
10788 #: ../fish/guestfish-actions.pod:2707
10793 #: ../fish/guestfish-actions.pod:2709
10796 " lgetxattr path name\n"
10801 #: ../fish/guestfish-actions.pod:2711 ../src/guestfs-actions.pod:4132
10803 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10804 "is a symlink, then this call returns an extended attribute from the symlink."
10808 #: ../fish/guestfish-actions.pod:2725
10809 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
10813 #: ../fish/guestfish-actions.pod:2727
10818 #: ../fish/guestfish-actions.pod:2729
10821 " lgetxattrs path\n"
10826 #: ../fish/guestfish-actions.pod:2731
10828 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
10829 "it returns the extended attributes of the link itself."
10833 #: ../fish/guestfish-actions.pod:2735
10838 #: ../fish/guestfish-actions.pod:2737
10846 #: ../fish/guestfish-actions.pod:2739 ../src/guestfs-actions.pod:4175
10848 "List all 9p filesystems attached to the guest. A list of mount tags is "
10853 #: ../fish/guestfish-actions.pod:2742
10854 msgid "list-devices"
10858 #: ../fish/guestfish-actions.pod:2744
10866 #: ../fish/guestfish-actions.pod:2746 ../src/guestfs-actions.pod:4189
10867 msgid "List all the block devices."
10871 #: ../fish/guestfish-actions.pod:2748 ../src/guestfs-actions.pod:4191
10872 msgid "The full block device names are returned, eg. C</dev/sda>."
10876 #: ../fish/guestfish-actions.pod:2752
10877 msgid "list-dm-devices"
10881 #: ../fish/guestfish-actions.pod:2754
10884 " list-dm-devices\n"
10889 #: ../fish/guestfish-actions.pod:2756 ../src/guestfs-actions.pod:4206
10890 msgid "List all device mapper devices."
10894 #: ../fish/guestfish-actions.pod:2758
10896 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
10897 "previous call to L</luks-open>."
10901 #: ../fish/guestfish-actions.pod:2761
10903 "Device mapper devices which correspond to logical volumes are I<not> "
10904 "returned in this list. Call L</lvs> if you want to list logical volumes."
10908 #: ../fish/guestfish-actions.pod:2765
10909 msgid "list-filesystems"
10913 #: ../fish/guestfish-actions.pod:2767
10916 " list-filesystems\n"
10921 #: ../fish/guestfish-actions.pod:2769 ../src/guestfs-actions.pod:4226
10923 "This inspection command looks for filesystems on partitions, block devices "
10924 "and logical volumes, returning a list of devices containing filesystems and "
10929 #: ../fish/guestfish-actions.pod:2773 ../src/guestfs-actions.pod:4230
10931 "The return value is a hash, where the keys are the devices containing "
10932 "filesystems, and the values are the filesystem types. For example:"
10936 #: ../fish/guestfish-actions.pod:2777 ../src/guestfs-actions.pod:4234
10939 " \"/dev/sda1\" => \"ntfs\"\n"
10940 " \"/dev/sda2\" => \"ext2\"\n"
10941 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10942 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10947 #: ../fish/guestfish-actions.pod:2782 ../src/guestfs-actions.pod:4239
10949 "The value can have the special value \"unknown\", meaning the content of the "
10950 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10954 #: ../fish/guestfish-actions.pod:2786
10956 "This command runs other libguestfs commands, which might include L</mount> "
10957 "and L</umount>, and therefore you should use this soon after launch and only "
10958 "when nothing is mounted."
10962 #: ../fish/guestfish-actions.pod:2790
10964 "Not all of the filesystems returned will be mountable. In particular, swap "
10965 "partitions are returned in the list. Also this command does not check that "
10966 "each filesystem found is valid and mountable, and some filesystems might be "
10967 "mountable but require special options. Filesystems may not all belong to a "
10968 "single logical operating system (use L</inspect-os> to look for OSes)."
10972 #: ../fish/guestfish-actions.pod:2798
10973 msgid "list-partitions"
10977 #: ../fish/guestfish-actions.pod:2800
10980 " list-partitions\n"
10985 #: ../fish/guestfish-actions.pod:2802 ../src/guestfs-actions.pod:4268
10986 msgid "List all the partitions detected on all block devices."
10990 #: ../fish/guestfish-actions.pod:2804 ../src/guestfs-actions.pod:4270
10991 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10995 #: ../fish/guestfish-actions.pod:2806
10997 "This does not return logical volumes. For that you will need to call "
11002 #: ../fish/guestfish-actions.pod:2811
11007 #: ../fish/guestfish-actions.pod:2813
11015 #: ../fish/guestfish-actions.pod:2815 ../src/guestfs-actions.pod:4289
11017 "List the files in C<directory> (relative to the root directory, there is no "
11018 "cwd) in the format of 'ls -la'."
11022 #: ../fish/guestfish-actions.pod:2818 ../src/guestfs-actions.pod:4292
11024 "This command is mostly useful for interactive sessions. It is I<not> "
11025 "intended that you try to parse the output string."
11029 #: ../fish/guestfish-actions.pod:2821
11034 #: ../fish/guestfish-actions.pod:2823
11037 " ln target linkname\n"
11042 #: ../fish/guestfish-actions.pod:2825 ../src/guestfs-actions.pod:4307
11043 msgid "This command creates a hard link using the C<ln> command."
11047 #: ../fish/guestfish-actions.pod:2827
11052 #: ../fish/guestfish-actions.pod:2829
11055 " ln-f target linkname\n"
11060 #: ../fish/guestfish-actions.pod:2831 ../src/guestfs-actions.pod:4320
11062 "This command creates a hard link using the C<ln -f> command. The I<-f> "
11063 "option removes the link (C<linkname>) if it exists already."
11067 #: ../fish/guestfish-actions.pod:2834
11072 #: ../fish/guestfish-actions.pod:2836
11075 " ln-s target linkname\n"
11080 #: ../fish/guestfish-actions.pod:2838 ../src/guestfs-actions.pod:4334
11081 msgid "This command creates a symbolic link using the C<ln -s> command."
11085 #: ../fish/guestfish-actions.pod:2840
11090 #: ../fish/guestfish-actions.pod:2842
11093 " ln-sf target linkname\n"
11098 #: ../fish/guestfish-actions.pod:2844 ../src/guestfs-actions.pod:4347
11100 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
11101 "option removes the link (C<linkname>) if it exists already."
11105 #: ../fish/guestfish-actions.pod:2847
11106 msgid "lremovexattr"
11110 #: ../fish/guestfish-actions.pod:2849
11113 " lremovexattr xattr path\n"
11118 #: ../fish/guestfish-actions.pod:2851
11120 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
11121 "it removes an extended attribute of the link itself."
11125 #: ../fish/guestfish-actions.pod:2855
11130 #: ../fish/guestfish-actions.pod:2857
11138 #: ../fish/guestfish-actions.pod:2859 ../src/guestfs-actions.pod:4375
11140 "List the files in C<directory> (relative to the root directory, there is no "
11141 "cwd). The '.' and '..' entries are not returned, but hidden files are "
11146 #: ../fish/guestfish-actions.pod:2863
11148 "This command is mostly useful for interactive sessions. Programs should "
11149 "probably use L</readdir> instead."
11153 #: ../fish/guestfish-actions.pod:2866
11158 #: ../fish/guestfish-actions.pod:2868
11161 " lsetxattr xattr val vallen path\n"
11166 #: ../fish/guestfish-actions.pod:2870
11168 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
11169 "sets an extended attribute of the link itself."
11173 #: ../fish/guestfish-actions.pod:2874
11178 #: ../fish/guestfish-actions.pod:2876
11186 #: ../fish/guestfish-actions.pod:2878 ../fish/guestfish-actions.pod:4702 ../src/guestfs-actions.pod:4411 ../src/guestfs-actions.pod:7214
11187 msgid "Returns file information for the given C<path>."
11191 #: ../fish/guestfish-actions.pod:2880
11193 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
11194 "the link is stat-ed, not the file it refers to."
11198 #: ../fish/guestfish-actions.pod:2884 ../src/guestfs-actions.pod:4417
11199 msgid "This is the same as the C<lstat(2)> system call."
11203 #: ../fish/guestfish-actions.pod:2886
11208 #: ../fish/guestfish-actions.pod:2888
11211 " lstatlist path 'names ...'\n"
11216 #: ../fish/guestfish-actions.pod:2890
11218 "This call allows you to perform the L</lstat> operation on multiple files, "
11219 "where all files are in the directory C<path>. C<names> is the list of files "
11220 "from this directory."
11224 #: ../fish/guestfish-actions.pod:2894 ../src/guestfs-actions.pod:4436
11226 "On return you get a list of stat structs, with a one-to-one correspondence "
11227 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11228 "then the C<ino> field of that structure is set to C<-1>."
11232 #: ../fish/guestfish-actions.pod:2899
11234 "This call is intended for programs that want to efficiently list a directory "
11235 "contents without making many round-trips. See also L</lxattrlist> for a "
11236 "similarly efficient call for getting extended attributes. Very long "
11237 "directory listings might cause the protocol message size to be exceeded, "
11238 "causing this call to fail. The caller must split up such requests into "
11239 "smaller groups of names."
11243 #: ../fish/guestfish-actions.pod:2907
11244 msgid "luks-add-key"
11248 #: ../fish/guestfish-actions.pod:2909
11251 " luks-add-key device keyslot\n"
11256 #: ../fish/guestfish-actions.pod:2911 ../src/guestfs-actions.pod:4464
11258 "This command adds a new key on LUKS device C<device>. C<key> is any "
11259 "existing key, and is used to access the device. C<newkey> is the new key to "
11260 "add. C<keyslot> is the key slot that will be replaced."
11264 #: ../fish/guestfish-actions.pod:2916
11266 "Note that if C<keyslot> already contains a key, then this command will "
11267 "fail. You have to use L</luks-kill-slot> first to remove that key."
11271 #: ../fish/guestfish-actions.pod:2920 ../fish/guestfish-actions.pod:2942 ../fish/guestfish-actions.pod:2955 ../fish/guestfish-actions.pod:2969 ../fish/guestfish-actions.pod:2995 ../fish/guestfish-actions.pod:3005
11273 "This command has one or more key or passphrase parameters. Guestfish will "
11274 "prompt for these separately."
11278 #: ../fish/guestfish-actions.pod:2923
11283 #: ../fish/guestfish-actions.pod:2925
11286 " luks-close device\n"
11291 #: ../fish/guestfish-actions.pod:2927
11293 "This closes a LUKS device that was created earlier by L</luks-open> or "
11294 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
11295 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
11296 "underlying block device."
11300 #: ../fish/guestfish-actions.pod:2933
11301 msgid "luks-format"
11305 #: ../fish/guestfish-actions.pod:2935
11308 " luks-format device keyslot\n"
11313 #: ../fish/guestfish-actions.pod:2937 ../src/guestfs-actions.pod:4505
11315 "This command erases existing data on C<device> and formats the device as a "
11316 "LUKS encrypted device. C<key> is the initial key, which is added to key "
11317 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
11321 #: ../fish/guestfish-actions.pod:2945 ../fish/guestfish-actions.pod:2958 ../fish/guestfish-actions.pod:3045 ../fish/guestfish-actions.pod:3696 ../fish/guestfish-actions.pod:4236 ../fish/guestfish-actions.pod:4573 ../fish/guestfish-actions.pod:4596 ../fish/guestfish-actions.pod:4618 ../fish/guestfish-actions.pod:5364 ../src/guestfs-actions.pod:4512 ../src/guestfs-actions.pod:4535 ../src/guestfs-actions.pod:4678 ../src/guestfs-actions.pod:5771 ../src/guestfs-actions.pod:6577 ../src/guestfs-actions.pod:7028 ../src/guestfs-actions.pod:7058 ../src/guestfs-actions.pod:7091 ../src/guestfs-actions.pod:8290
11323 "B<This command is dangerous. Without careful use you can easily destroy all "
11328 #: ../fish/guestfish-actions.pod:2948
11329 msgid "luks-format-cipher"
11333 #: ../fish/guestfish-actions.pod:2950
11336 " luks-format-cipher device keyslot cipher\n"
11341 #: ../fish/guestfish-actions.pod:2952
11343 "This command is the same as L</luks-format> but it also allows you to set "
11344 "the C<cipher> used."
11348 #: ../fish/guestfish-actions.pod:2961
11349 msgid "luks-kill-slot"
11353 #: ../fish/guestfish-actions.pod:2963
11356 " luks-kill-slot device keyslot\n"
11361 #: ../fish/guestfish-actions.pod:2965 ../src/guestfs-actions.pod:4552
11363 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11364 "device C<device>. C<key> must be one of the I<other> keys."
11368 #: ../fish/guestfish-actions.pod:2972
11373 #: ../fish/guestfish-actions.pod:2974
11376 " luks-open device mapname\n"
11381 #: ../fish/guestfish-actions.pod:2976 ../src/guestfs-actions.pod:4572
11383 "This command opens a block device which has been encrypted according to the "
11384 "Linux Unified Key Setup (LUKS) standard."
11388 #: ../fish/guestfish-actions.pod:2979 ../src/guestfs-actions.pod:4575
11389 msgid "C<device> is the encrypted block device or partition."
11393 #: ../fish/guestfish-actions.pod:2981 ../src/guestfs-actions.pod:4577
11395 "The caller must supply one of the keys associated with the LUKS block "
11396 "device, in the C<key> parameter."
11400 #: ../fish/guestfish-actions.pod:2984 ../src/guestfs-actions.pod:4580
11402 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
11403 "writes to this block device are decrypted from and encrypted to the "
11404 "underlying C<device> respectively."
11408 #: ../fish/guestfish-actions.pod:2988
11410 "If this block device contains LVM volume groups, then calling L</vgscan> "
11411 "followed by L</vg-activate-all> will make them visible."
11415 #: ../fish/guestfish-actions.pod:2992
11416 msgid "Use L</list-dm-devices> to list all device mapper devices."
11420 #: ../fish/guestfish-actions.pod:2998
11421 msgid "luks-open-ro"
11425 #: ../fish/guestfish-actions.pod:3000
11428 " luks-open-ro device mapname\n"
11433 #: ../fish/guestfish-actions.pod:3002
11435 "This is the same as L</luks-open> except that a read-only mapping is "
11440 #: ../fish/guestfish-actions.pod:3008
11445 #: ../fish/guestfish-actions.pod:3010
11448 " lvcreate logvol volgroup mbytes\n"
11453 #: ../fish/guestfish-actions.pod:3012 ../src/guestfs-actions.pod:4626
11455 "This creates an LVM logical volume called C<logvol> on the volume group "
11456 "C<volgroup>, with C<size> megabytes."
11460 #: ../fish/guestfish-actions.pod:3015
11461 msgid "lvm-canonical-lv-name"
11465 #: ../fish/guestfish-actions.pod:3017
11468 " lvm-canonical-lv-name lvname\n"
11473 #: ../fish/guestfish-actions.pod:3019 ../src/guestfs-actions.pod:4639
11475 "This converts alternative naming schemes for LVs that you might find to the "
11476 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
11481 #: ../fish/guestfish-actions.pod:3023 ../src/guestfs-actions.pod:4643
11483 "This command returns an error if the C<lvname> parameter does not refer to a "
11488 #: ../fish/guestfish-actions.pod:3026
11489 msgid "See also L</is-lv>."
11493 #: ../fish/guestfish-actions.pod:3028
11494 msgid "lvm-clear-filter"
11498 #: ../fish/guestfish-actions.pod:3030
11501 " lvm-clear-filter\n"
11506 #: ../fish/guestfish-actions.pod:3032
11508 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
11513 #: ../fish/guestfish-actions.pod:3035 ../fish/guestfish-actions.pod:3066 ../src/guestfs-actions.pod:4661 ../src/guestfs-actions.pod:4703
11514 msgid "This command also clears the LVM cache and performs a volume group scan."
11518 #: ../fish/guestfish-actions.pod:3038
11519 msgid "lvm-remove-all"
11523 #: ../fish/guestfish-actions.pod:3040
11526 " lvm-remove-all\n"
11531 #: ../fish/guestfish-actions.pod:3042 ../src/guestfs-actions.pod:4673
11533 "This command removes all LVM logical volumes, volume groups and physical "
11538 #: ../fish/guestfish-actions.pod:3048
11539 msgid "lvm-set-filter"
11543 #: ../fish/guestfish-actions.pod:3050
11546 " lvm-set-filter 'devices ...'\n"
11551 #: ../fish/guestfish-actions.pod:3052 ../src/guestfs-actions.pod:4689
11553 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
11554 "block devices in the list C<devices>, and will ignore all other attached "
11559 #: ../fish/guestfish-actions.pod:3056 ../src/guestfs-actions.pod:4693
11561 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
11562 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
11563 "there are two types of duplication possible: either cloned PVs/VGs which "
11564 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
11565 "same name. In normal operation you cannot create this situation, but you "
11566 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
11567 "inside the LVM metadata."
11571 #: ../fish/guestfish-actions.pod:3069 ../src/guestfs-actions.pod:4706
11572 msgid "You can filter whole block devices or individual partitions."
11576 #: ../fish/guestfish-actions.pod:3071 ../src/guestfs-actions.pod:4708
11578 "You cannot use this if any VG is currently in use (eg. contains a mounted "
11579 "filesystem), even if you are not filtering out that VG."
11583 #: ../fish/guestfish-actions.pod:3075
11588 #: ../fish/guestfish-actions.pod:3077
11591 " lvremove device\n"
11596 #: ../fish/guestfish-actions.pod:3079 ../src/guestfs-actions.pod:4722
11598 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
11599 "LV, such as C</dev/VG/LV>."
11603 #: ../fish/guestfish-actions.pod:3082 ../src/guestfs-actions.pod:4725
11605 "You can also remove all LVs in a volume group by specifying the VG name, "
11610 #: ../fish/guestfish-actions.pod:3085
11615 #: ../fish/guestfish-actions.pod:3087
11618 " lvrename logvol newlogvol\n"
11623 #: ../fish/guestfish-actions.pod:3089 ../src/guestfs-actions.pod:4739
11624 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
11628 #: ../fish/guestfish-actions.pod:3091
11633 #: ../fish/guestfish-actions.pod:3093
11636 " lvresize device mbytes\n"
11641 #: ../fish/guestfish-actions.pod:3095 ../src/guestfs-actions.pod:4752
11643 "This resizes (expands or shrinks) an existing LVM logical volume to "
11644 "C<mbytes>. When reducing, data in the reduced part is lost."
11648 #: ../fish/guestfish-actions.pod:3099
11649 msgid "lvresize-free"
11653 #: ../fish/guestfish-actions.pod:3101
11656 " lvresize-free lv percent\n"
11661 #: ../fish/guestfish-actions.pod:3103 ../src/guestfs-actions.pod:4767
11663 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
11664 "remaining free space in the volume group. Commonly you would call this with "
11665 "pc = 100 which expands the logical volume as much as possible, using all "
11666 "remaining free space in the volume group."
11670 #: ../fish/guestfish-actions.pod:3109
11675 #: ../fish/guestfish-actions.pod:3111
11683 #: ../fish/guestfish-actions.pod:3113 ../src/guestfs-actions.pod:4782
11685 "List all the logical volumes detected. This is the equivalent of the "
11686 "L<lvs(8)> command."
11690 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4785
11692 "This returns a list of the logical volume device names "
11693 "(eg. C</dev/VolGroup00/LogVol00>)."
11697 #: ../fish/guestfish-actions.pod:3119
11698 msgid "See also L</lvs-full>, L</list-filesystems>."
11702 #: ../fish/guestfish-actions.pod:3121
11707 #: ../fish/guestfish-actions.pod:3123
11715 #: ../fish/guestfish-actions.pod:3125 ../src/guestfs-actions.pod:4801
11717 "List all the logical volumes detected. This is the equivalent of the "
11718 "L<lvs(8)> command. The \"full\" version includes all fields."
11722 #: ../fish/guestfish-actions.pod:3128
11727 #: ../fish/guestfish-actions.pod:3130
11735 #: ../fish/guestfish-actions.pod:3132 ../src/guestfs-actions.pod:4816
11736 msgid "This command returns the UUID of the LVM LV C<device>."
11740 #: ../fish/guestfish-actions.pod:3134
11745 #: ../fish/guestfish-actions.pod:3136
11748 " lxattrlist path 'names ...'\n"
11753 #: ../fish/guestfish-actions.pod:3138 ../src/guestfs-actions.pod:4830
11755 "This call allows you to get the extended attributes of multiple files, where "
11756 "all files are in the directory C<path>. C<names> is the list of files from "
11761 #: ../fish/guestfish-actions.pod:3142 ../src/guestfs-actions.pod:4834
11763 "On return you get a flat list of xattr structs which must be interpreted "
11764 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11765 "C<attrval> in this struct is zero-length to indicate there was an error "
11766 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11767 "number (the number of following attributes for this file, which could be "
11768 "C<\"0\">). Then after the first xattr struct are the zero or more "
11769 "attributes for the first named file. This repeats for the second and "
11770 "subsequent files."
11774 #: ../fish/guestfish-actions.pod:3152
11776 "This call is intended for programs that want to efficiently list a directory "
11777 "contents without making many round-trips. See also L</lstatlist> for a "
11778 "similarly efficient call for getting standard stats. Very long directory "
11779 "listings might cause the protocol message size to be exceeded, causing this "
11780 "call to fail. The caller must split up such requests into smaller groups of "
11785 #: ../fish/guestfish-actions.pod:3160
11790 #: ../fish/guestfish-actions.pod:3162
11798 #: ../fish/guestfish-actions.pod:3164 ../src/guestfs-actions.pod:4864
11799 msgid "Create a directory named C<path>."
11803 #: ../fish/guestfish-actions.pod:3166
11808 #: ../fish/guestfish-actions.pod:3168
11811 " mkdir-mode path mode\n"
11816 #: ../fish/guestfish-actions.pod:3170 ../src/guestfs-actions.pod:4877
11818 "This command creates a directory, setting the initial permissions of the "
11819 "directory to C<mode>."
11823 #: ../fish/guestfish-actions.pod:3173 ../src/guestfs-actions.pod:4880
11825 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11826 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11831 #: ../fish/guestfish-actions.pod:3177
11832 msgid "See also L</mkdir>, L</umask>"
11836 #: ../fish/guestfish-actions.pod:3179
11841 #: ../fish/guestfish-actions.pod:3181
11849 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4896
11851 "Create a directory named C<path>, creating any parent directories as "
11852 "necessary. This is like the C<mkdir -p> shell command."
11856 #: ../fish/guestfish-actions.pod:3186
11861 #: ../fish/guestfish-actions.pod:3188
11864 " mkdtemp template\n"
11869 #: ../fish/guestfish-actions.pod:3190 ../src/guestfs-actions.pod:4909
11871 "This command creates a temporary directory. The C<template> parameter "
11872 "should be a full pathname for the temporary directory name with the final "
11873 "six characters being \"XXXXXX\"."
11877 #: ../fish/guestfish-actions.pod:3195 ../src/guestfs-actions.pod:4914
11879 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11880 "being suitable for Windows filesystems."
11884 #: ../fish/guestfish-actions.pod:3198 ../src/guestfs-actions.pod:4917
11885 msgid "The name of the temporary directory that was created is returned."
11889 #: ../fish/guestfish-actions.pod:3201 ../src/guestfs-actions.pod:4920
11890 msgid "The temporary directory is created with mode 0700 and is owned by root."
11894 #: ../fish/guestfish-actions.pod:3204 ../src/guestfs-actions.pod:4923
11896 "The caller is responsible for deleting the temporary directory and its "
11897 "contents after use."
11901 #: ../fish/guestfish-actions.pod:3207 ../src/guestfs-actions.pod:4926
11902 msgid "See also: L<mkdtemp(3)>"
11906 #: ../fish/guestfish-actions.pod:3209
11911 #: ../fish/guestfish-actions.pod:3211
11914 " mke2fs-J fstype blocksize device journal\n"
11919 #: ../fish/guestfish-actions.pod:3213 ../src/guestfs-actions.pod:4942
11921 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11922 "C<journal>. It is equivalent to the command:"
11926 #: ../fish/guestfish-actions.pod:3217 ../src/guestfs-actions.pod:4946
11929 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11934 #: ../fish/guestfish-actions.pod:3219
11935 msgid "See also L</mke2journal>."
11939 #: ../fish/guestfish-actions.pod:3221
11944 #: ../fish/guestfish-actions.pod:3223
11947 " mke2fs-JL fstype blocksize device label\n"
11952 #: ../fish/guestfish-actions.pod:3225 ../src/guestfs-actions.pod:4963
11954 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11955 "the journal labeled C<label>."
11959 #: ../fish/guestfish-actions.pod:3228
11960 msgid "See also L</mke2journal-L>."
11964 #: ../fish/guestfish-actions.pod:3230
11969 #: ../fish/guestfish-actions.pod:3232
11972 " mke2fs-JU fstype blocksize device uuid\n"
11977 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4981
11979 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11980 "the journal with UUID C<uuid>."
11984 #: ../fish/guestfish-actions.pod:3237
11985 msgid "See also L</mke2journal-U>."
11989 #: ../fish/guestfish-actions.pod:3239
11990 msgid "mke2journal"
11994 #: ../fish/guestfish-actions.pod:3241
11997 " mke2journal blocksize device\n"
12002 #: ../fish/guestfish-actions.pod:3243 ../src/guestfs-actions.pod:4997
12004 "This creates an ext2 external journal on C<device>. It is equivalent to the "
12009 #: ../fish/guestfish-actions.pod:3246 ../src/guestfs-actions.pod:5000
12012 " mke2fs -O journal_dev -b blocksize device\n"
12017 #: ../fish/guestfish-actions.pod:3248
12018 msgid "mke2journal-L"
12022 #: ../fish/guestfish-actions.pod:3250
12025 " mke2journal-L blocksize label device\n"
12030 #: ../fish/guestfish-actions.pod:3252 ../src/guestfs-actions.pod:5014
12031 msgid "This creates an ext2 external journal on C<device> with label C<label>."
12035 #: ../fish/guestfish-actions.pod:3254
12036 msgid "mke2journal-U"
12040 #: ../fish/guestfish-actions.pod:3256
12043 " mke2journal-U blocksize uuid device\n"
12048 #: ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:5028
12049 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
12053 #: ../fish/guestfish-actions.pod:3260
12058 #: ../fish/guestfish-actions.pod:3262
12061 " mkfifo mode path\n"
12066 #: ../fish/guestfish-actions.pod:3264
12068 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
12069 "is just a convenient wrapper around L</mknod>."
12073 #: ../fish/guestfish-actions.pod:3270
12078 #: ../fish/guestfish-actions.pod:3272
12081 " mkfs fstype device\n"
12086 #: ../fish/guestfish-actions.pod:3274 ../src/guestfs-actions.pod:5058
12088 "This creates a filesystem on C<device> (usually a partition or LVM logical "
12089 "volume). The filesystem type is C<fstype>, for example C<ext3>."
12093 #: ../fish/guestfish-actions.pod:3278
12098 #: ../fish/guestfish-actions.pod:3280
12101 " mkfs-b fstype blocksize device\n"
12106 #: ../fish/guestfish-actions.pod:3282
12108 "This call is similar to L</mkfs>, but it allows you to control the block "
12109 "size of the resulting filesystem. Supported block sizes depend on the "
12110 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
12114 #: ../fish/guestfish-actions.pod:3287 ../fish/guestfish-actions.pod:3314 ../src/guestfs-actions.pod:5086 ../src/guestfs-actions.pod:5124
12116 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
12121 #: ../fish/guestfish-actions.pod:3290
12123 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
12128 #: ../fish/guestfish-actions.pod:3297
12133 #: ../fish/guestfish-actions.pod:3299
12136 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] "
12137 "[sectorsize:..]\n"
12142 #: ../fish/guestfish-actions.pod:3301 ../src/guestfs-actions.pod:5111
12144 "This function creates a filesystem on C<device>. The filesystem type is "
12145 "C<fstype>, for example C<ext3>."
12149 #: ../fish/guestfish-actions.pod:3308 ../src/guestfs-actions.pod:5118
12150 msgid "C<blocksize>"
12154 #: ../fish/guestfish-actions.pod:3310 ../src/guestfs-actions.pod:5120
12156 "The filesystem block size. Supported block sizes depend on the filesystem "
12157 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
12162 #: ../fish/guestfish-actions.pod:3317 ../src/guestfs-actions.pod:5127
12163 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
12167 #: ../fish/guestfish-actions.pod:3319 ../src/guestfs-actions.pod:5129
12168 msgid "C<features>"
12172 #: ../fish/guestfish-actions.pod:3321 ../src/guestfs-actions.pod:5131
12173 msgid "This passes the I<-O> parameter to the external mkfs program."
12177 #: ../fish/guestfish-actions.pod:3323 ../src/guestfs-actions.pod:5133
12179 "For certain filesystem types, this allows extra filesystem features to be "
12180 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
12184 #: ../fish/guestfish-actions.pod:3327 ../src/guestfs-actions.pod:5137
12186 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
12191 #: ../fish/guestfish-actions.pod:3330 ../src/guestfs-actions.pod:5140
12196 #: ../fish/guestfish-actions.pod:3332 ../src/guestfs-actions.pod:5142
12198 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
12199 "sets the inode size (only for ext2/3/4 filesystems at present)."
12203 #: ../fish/guestfish-actions.pod:3335 ../src/guestfs-actions.pod:5145
12204 msgid "C<sectorsize>"
12208 #: ../fish/guestfish-actions.pod:3337 ../src/guestfs-actions.pod:5147
12210 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
12211 "sets sector size for ufs filesystem."
12215 #: ../fish/guestfish-actions.pod:3344
12216 msgid "mkmountpoint"
12220 #: ../fish/guestfish-actions.pod:3346
12223 " mkmountpoint exemptpath\n"
12228 #: ../fish/guestfish-actions.pod:3348
12230 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
12231 "to create extra mountpoints before mounting the first filesystem."
12235 #: ../fish/guestfish-actions.pod:3352 ../src/guestfs-actions.pod:5190
12237 "These calls are I<only> necessary in some very limited circumstances, mainly "
12238 "the case where you want to mount a mix of unrelated and/or read-only "
12239 "filesystems together."
12243 #: ../fish/guestfish-actions.pod:3356 ../src/guestfs-actions.pod:5194
12245 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
12246 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
12247 "inside that. You can unpack this as follows in guestfish:"
12251 #: ../fish/guestfish-actions.pod:3361 ../src/guestfs-actions.pod:5199
12254 " add-ro Fedora-11-i686-Live.iso\n"
12256 " mkmountpoint /cd\n"
12257 " mkmountpoint /sqsh\n"
12258 " mkmountpoint /ext3fs\n"
12259 " mount /dev/sda /cd\n"
12260 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
12261 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
12266 #: ../fish/guestfish-actions.pod:3370 ../src/guestfs-actions.pod:5208
12267 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
12271 #: ../fish/guestfish-actions.pod:3372
12273 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
12274 "unexpected errors if you try to mix these calls. It is safest to manually "
12275 "unmount filesystems and remove mountpoints after use."
12279 #: ../fish/guestfish-actions.pod:3376
12281 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
12282 "for this to work for manual mountpoints, you must ensure that the innermost "
12283 "mountpoints have the longest pathnames, as in the example code above."
12287 #: ../fish/guestfish-actions.pod:3381 ../src/guestfs-actions.pod:5219
12288 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
12292 #: ../fish/guestfish-actions.pod:3383
12294 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
12295 "L</umount-all> to be called when the handle is closed which can also trigger "
12300 #: ../fish/guestfish-actions.pod:3387
12305 #: ../fish/guestfish-actions.pod:3389
12308 " mknod mode devmajor devminor path\n"
12313 #: ../fish/guestfish-actions.pod:3391 ../src/guestfs-actions.pod:5238
12315 "This call creates block or character special devices, or named pipes "
12320 #: ../fish/guestfish-actions.pod:3394 ../src/guestfs-actions.pod:5241
12322 "The C<mode> parameter should be the mode, using the standard constants. "
12323 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
12324 "used when creating block and character special devices."
12328 #: ../fish/guestfish-actions.pod:3399
12330 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
12331 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
12332 "regular file). These constants are available in the standard Linux header "
12333 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
12334 "wrappers around this command which bitwise OR in the appropriate constant "
12339 #: ../fish/guestfish-actions.pod:3409
12344 #: ../fish/guestfish-actions.pod:3411
12347 " mknod-b mode devmajor devminor path\n"
12352 #: ../fish/guestfish-actions.pod:3413
12354 "This call creates a block device node called C<path> with mode C<mode> and "
12355 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12356 "wrapper around L</mknod>."
12360 #: ../fish/guestfish-actions.pod:3419
12365 #: ../fish/guestfish-actions.pod:3421
12368 " mknod-c mode devmajor devminor path\n"
12373 #: ../fish/guestfish-actions.pod:3423
12375 "This call creates a char device node called C<path> with mode C<mode> and "
12376 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12377 "wrapper around L</mknod>."
12381 #: ../fish/guestfish-actions.pod:3429
12386 #: ../fish/guestfish-actions.pod:3431
12394 #: ../fish/guestfish-actions.pod:3433 ../src/guestfs-actions.pod:5304
12395 msgid "Create a swap partition on C<device>."
12399 #: ../fish/guestfish-actions.pod:3435
12404 #: ../fish/guestfish-actions.pod:3437
12407 " mkswap-L label device\n"
12412 #: ../fish/guestfish-actions.pod:3439 ../src/guestfs-actions.pod:5317
12413 msgid "Create a swap partition on C<device> with label C<label>."
12417 #: ../fish/guestfish-actions.pod:3441 ../src/guestfs-actions.pod:5319
12419 "Note that you cannot attach a swap label to a block device "
12420 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
12421 "the kernel or swap tools."
12425 #: ../fish/guestfish-actions.pod:3445
12430 #: ../fish/guestfish-actions.pod:3447
12433 " mkswap-U uuid device\n"
12438 #: ../fish/guestfish-actions.pod:3449 ../src/guestfs-actions.pod:5334
12439 msgid "Create a swap partition on C<device> with UUID C<uuid>."
12443 #: ../fish/guestfish-actions.pod:3451
12444 msgid "mkswap-file"
12448 #: ../fish/guestfish-actions.pod:3453
12451 " mkswap-file path\n"
12456 #: ../fish/guestfish-actions.pod:3455 ../src/guestfs-actions.pod:5346
12457 msgid "Create a swap file."
12461 #: ../fish/guestfish-actions.pod:3457
12463 "This command just writes a swap file signature to an existing file. To "
12464 "create the file itself, use something like L</fallocate>."
12468 #: ../fish/guestfish-actions.pod:3460
12473 #: ../fish/guestfish-actions.pod:3462
12476 " modprobe modulename\n"
12481 #: ../fish/guestfish-actions.pod:3464 ../src/guestfs-actions.pod:5361
12482 msgid "This loads a kernel module in the appliance."
12486 #: ../fish/guestfish-actions.pod:3466 ../src/guestfs-actions.pod:5363
12488 "The kernel module must have been whitelisted when libguestfs was built (see "
12489 "C<appliance/kmod.whitelist.in> in the source)."
12493 #: ../fish/guestfish-actions.pod:3469
12498 #: ../fish/guestfish-actions.pod:3471
12501 " mount device mountpoint\n"
12506 #: ../fish/guestfish-actions.pod:3473 ../src/guestfs-actions.pod:5377
12508 "Mount a guest disk at a position in the filesystem. Block devices are named "
12509 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12510 "those block devices contain partitions, they will have the usual names "
12511 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12515 #: ../fish/guestfish-actions.pod:3479 ../src/guestfs-actions.pod:5383
12517 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12518 "mounted on C</> before others can be mounted. Other filesystems can only be "
12519 "mounted on directories which already exist."
12523 #: ../fish/guestfish-actions.pod:3484 ../src/guestfs-actions.pod:5388
12525 "The mounted filesystem is writable, if we have sufficient permissions on the "
12526 "underlying device."
12530 #: ../fish/guestfish-actions.pod:3487
12532 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
12533 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
12534 "problems for users. If your program might need to work with older versions "
12535 "of libguestfs, use L</mount-options> instead (using an empty string for the "
12536 "first parameter if you don't want any options)."
12540 #: ../fish/guestfish-actions.pod:3494
12545 #: ../fish/guestfish-actions.pod:3496
12548 " mount-9p mounttag mountpoint [options:..]\n"
12553 #: ../fish/guestfish-actions.pod:3498 ../src/guestfs-actions.pod:5417
12555 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
12560 #: ../fish/guestfish-actions.pod:3501 ../src/guestfs-actions.pod:5420
12562 "If required, C<trans=virtio> will be automatically added to the options. "
12563 "Any other options required can be passed in the optional C<options> "
12568 #: ../fish/guestfish-actions.pod:3507
12573 #: ../fish/guestfish-actions.pod:3509
12576 " mount-loop file mountpoint\n"
12581 #: ../fish/guestfish-actions.pod:3511 ../src/guestfs-actions.pod:5459
12583 "This command lets you mount C<file> (a filesystem image in a file) on a "
12584 "mount point. It is entirely equivalent to the command C<mount -o loop file "
12589 #: ../fish/guestfish-actions.pod:3515
12590 msgid "mount-options"
12594 #: ../fish/guestfish-actions.pod:3517
12597 " mount-options options device mountpoint\n"
12602 #: ../fish/guestfish-actions.pod:3519
12604 "This is the same as the L</mount> command, but it allows you to set the "
12605 "mount options as for the L<mount(8)> I<-o> flag."
12609 #: ../fish/guestfish-actions.pod:3523 ../src/guestfs-actions.pod:5479
12611 "If the C<options> parameter is an empty string, then no options are passed "
12612 "(all options default to whatever the filesystem uses)."
12616 #: ../fish/guestfish-actions.pod:3527
12621 #: ../fish/guestfish-actions.pod:3529
12624 " mount-ro device mountpoint\n"
12629 #: ../fish/guestfish-actions.pod:3531
12631 "This is the same as the L</mount> command, but it mounts the filesystem with "
12632 "the read-only (I<-o ro>) flag."
12636 #: ../fish/guestfish-actions.pod:3534
12641 #: ../fish/guestfish-actions.pod:3536
12644 " mount-vfs options vfstype device mountpoint\n"
12649 #: ../fish/guestfish-actions.pod:3538
12651 "This is the same as the L</mount> command, but it allows you to set both the "
12652 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
12656 #: ../fish/guestfish-actions.pod:3542
12657 msgid "mountpoints"
12661 #: ../fish/guestfish-actions.pod:3544
12669 #: ../fish/guestfish-actions.pod:3546
12671 "This call is similar to L</mounts>. That call returns a list of devices. "
12672 "This one returns a hash table (map) of device name to directory where the "
12673 "device is mounted."
12677 #: ../fish/guestfish-actions.pod:3550
12682 #: ../fish/guestfish-actions.pod:3552
12690 #: ../fish/guestfish-actions.pod:3554 ../src/guestfs-actions.pod:5540
12692 "This returns the list of currently mounted filesystems. It returns the list "
12693 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12697 #: ../fish/guestfish-actions.pod:3557 ../src/guestfs-actions.pod:5543
12698 msgid "Some internal mounts are not shown."
12702 #: ../fish/guestfish-actions.pod:3559
12703 msgid "See also: L</mountpoints>"
12707 #: ../fish/guestfish-actions.pod:3561
12712 #: ../fish/guestfish-actions.pod:3563
12720 #: ../fish/guestfish-actions.pod:3565 ../src/guestfs-actions.pod:5560
12722 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12723 "destination filename or destination directory."
12727 #: ../fish/guestfish-actions.pod:3568
12728 msgid "ntfs-3g-probe"
12732 #: ../fish/guestfish-actions.pod:3570
12735 " ntfs-3g-probe true|false device\n"
12740 #: ../fish/guestfish-actions.pod:3572 ../src/guestfs-actions.pod:5574
12742 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12743 "C<device> for mountability. (Not all NTFS volumes can be mounted "
12744 "read-write, and some cannot be mounted at all)."
12748 #: ../fish/guestfish-actions.pod:3576 ../src/guestfs-actions.pod:5578
12750 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12751 "can be mounted read-write. Set it to false if you want to test if the "
12752 "volume can be mounted read-only."
12756 #: ../fish/guestfish-actions.pod:3580 ../src/guestfs-actions.pod:5582
12758 "The return value is an integer which C<0> if the operation would succeed, or "
12759 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12763 #: ../fish/guestfish-actions.pod:3584
12768 #: ../fish/guestfish-actions.pod:3586
12771 " ntfsresize device\n"
12776 #: ../fish/guestfish-actions.pod:3588 ../fish/guestfish-actions.pod:3612 ../src/guestfs-actions.pod:5603 ../src/guestfs-actions.pod:5635
12778 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12779 "size of the underlying device."
12783 #: ../fish/guestfish-actions.pod:3591 ../src/guestfs-actions.pod:5606
12785 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
12786 "consistency check (for safety). You have to boot into Windows to perform "
12787 "this check and clear this condition. Furthermore, ntfsresize refuses to "
12788 "resize filesystems which have been marked in this way. So in effect it is "
12789 "not possible to call ntfsresize multiple times on a single filesystem "
12790 "without booting into Windows between each resize."
12794 #: ../fish/guestfish-actions.pod:3599 ../fish/guestfish-actions.pod:3638 ../src/guestfs-actions.pod:5614 ../src/guestfs-actions.pod:5661
12795 msgid "See also L<ntfsresize(8)>."
12799 #: ../fish/guestfish-actions.pod:3601 ../fish/guestfish-actions.pod:3649
12801 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
12806 #: ../fish/guestfish-actions.pod:3608
12807 msgid "ntfsresize-opts"
12811 #: ../fish/guestfish-actions.pod:3610
12814 " ntfsresize-opts device [size:..] [force:..]\n"
12819 #: ../fish/guestfish-actions.pod:3621 ../src/guestfs-actions.pod:5644
12821 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
12822 "resized to fit the container (eg. partition)."
12826 #: ../fish/guestfish-actions.pod:3624 ../src/guestfs-actions.pod:5647
12831 #: ../fish/guestfish-actions.pod:3626 ../src/guestfs-actions.pod:5649
12833 "If this option is true, then force the resize of the filesystem even if the "
12834 "filesystem is marked as requiring a consistency check."
12838 #: ../fish/guestfish-actions.pod:3629
12840 "After the resize operation, the filesystem is always marked as requiring a "
12841 "consistency check (for safety). You have to boot into Windows to perform "
12842 "this check and clear this condition. If you I<don't> set the C<force> "
12843 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
12844 "a single filesystem without booting into Windows between each resize."
12848 #: ../fish/guestfish-actions.pod:3642
12849 msgid "ntfsresize-size"
12853 #: ../fish/guestfish-actions.pod:3644
12856 " ntfsresize-size device size\n"
12861 #: ../fish/guestfish-actions.pod:3646
12863 "This command is the same as L</ntfsresize> except that it allows you to "
12864 "specify the new size (in bytes) explicitly."
12868 #: ../fish/guestfish-actions.pod:3656
12873 #: ../fish/guestfish-actions.pod:3658
12876 " part-add device prlogex startsect endsect\n"
12881 #: ../fish/guestfish-actions.pod:3660
12883 "This command adds a partition to C<device>. If there is no partition table "
12884 "on the device, call L</part-init> first."
12888 #: ../fish/guestfish-actions.pod:3663 ../src/guestfs-actions.pod:5722
12890 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12891 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12892 "C<logical>) and C<e> (or C<extended>) partition types."
12896 #: ../fish/guestfish-actions.pod:3668 ../src/guestfs-actions.pod:5727
12898 "C<startsect> and C<endsect> are the start and end of the partition in "
12899 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12900 "from the end of the disk (C<-1> is the last sector)."
12904 #: ../fish/guestfish-actions.pod:3672
12906 "Creating a partition which covers the whole disk is not so easy. Use "
12907 "L</part-disk> to do that."
12911 #: ../fish/guestfish-actions.pod:3675
12916 #: ../fish/guestfish-actions.pod:3677
12919 " part-del device partnum\n"
12924 #: ../fish/guestfish-actions.pod:3679 ../src/guestfs-actions.pod:5745
12925 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12929 #: ../fish/guestfish-actions.pod:3681 ../src/guestfs-actions.pod:5747
12931 "Note that in the case of MBR partitioning, deleting an extended partition "
12932 "also deletes any logical partitions it contains."
12936 #: ../fish/guestfish-actions.pod:3685
12941 #: ../fish/guestfish-actions.pod:3687
12944 " part-disk device parttype\n"
12949 #: ../fish/guestfish-actions.pod:3689
12951 "This command is simply a combination of L</part-init> followed by "
12952 "L</part-add> to create a single primary partition covering the whole disk."
12956 #: ../fish/guestfish-actions.pod:3693
12958 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12959 "possible values are described in L</part-init>."
12963 #: ../fish/guestfish-actions.pod:3699
12964 msgid "part-get-bootable"
12968 #: ../fish/guestfish-actions.pod:3701
12971 " part-get-bootable device partnum\n"
12976 #: ../fish/guestfish-actions.pod:3703 ../src/guestfs-actions.pod:5783
12978 "This command returns true if the partition C<partnum> on C<device> has the "
12979 "bootable flag set."
12983 #: ../fish/guestfish-actions.pod:3706
12984 msgid "See also L</part-set-bootable>."
12988 #: ../fish/guestfish-actions.pod:3708
12989 msgid "part-get-mbr-id"
12993 #: ../fish/guestfish-actions.pod:3710
12996 " part-get-mbr-id device partnum\n"
13001 #: ../fish/guestfish-actions.pod:3712 ../src/guestfs-actions.pod:5799
13003 "Returns the MBR type byte (also known as the ID byte) from the numbered "
13004 "partition C<partnum>."
13008 #: ../fish/guestfish-actions.pod:3715 ../fish/guestfish-actions.pod:3859
13010 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
13011 "undefined results for other partition table types (see "
13012 "L</part-get-parttype>)."
13016 #: ../fish/guestfish-actions.pod:3719
13017 msgid "part-get-parttype"
13021 #: ../fish/guestfish-actions.pod:3721
13024 " part-get-parttype device\n"
13029 #: ../fish/guestfish-actions.pod:3723 ../src/guestfs-actions.pod:5816
13031 "This command examines the partition table on C<device> and returns the "
13032 "partition table type (format) being used."
13036 #: ../fish/guestfish-actions.pod:3726
13038 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
13039 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
13040 "possible, although unusual. See L</part-init> for a full list."
13044 #: ../fish/guestfish-actions.pod:3731
13049 #: ../fish/guestfish-actions.pod:3733
13052 " part-init device parttype\n"
13057 #: ../fish/guestfish-actions.pod:3735 ../src/guestfs-actions.pod:5836
13059 "This creates an empty partition table on C<device> of one of the partition "
13060 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
13061 "(for large disks)."
13065 #: ../fish/guestfish-actions.pod:3739
13067 "Initially there are no partitions. Following this, you should call "
13068 "L</part-add> for each partition required."
13072 #: ../fish/guestfish-actions.pod:3742 ../src/guestfs-actions.pod:5843
13073 msgid "Possible values for C<parttype> are:"
13077 #: ../fish/guestfish-actions.pod:3746 ../src/guestfs-actions.pod:5847
13082 #: ../fish/guestfish-actions.pod:3748 ../src/guestfs-actions.pod:5849
13087 #: ../fish/guestfish-actions.pod:3750 ../src/guestfs-actions.pod:5851
13088 msgid "Intel EFI / GPT partition table."
13092 #: ../fish/guestfish-actions.pod:3752 ../src/guestfs-actions.pod:5853
13094 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
13095 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
13096 "the C<mbr> format."
13100 #: ../fish/guestfish-actions.pod:3756 ../src/guestfs-actions.pod:5857
13105 #: ../fish/guestfish-actions.pod:3758 ../src/guestfs-actions.pod:5859
13110 #: ../fish/guestfish-actions.pod:3760 ../src/guestfs-actions.pod:5861
13112 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
13113 "Windows. This partition type will B<only> work for device sizes up to 2 "
13114 "TB. For large disks we recommend using C<gpt>."
13118 #: ../fish/guestfish-actions.pod:3767 ../src/guestfs-actions.pod:5868
13119 msgid "Other partition table types that may work but are not supported include:"
13123 #: ../fish/guestfish-actions.pod:3772 ../src/guestfs-actions.pod:5873
13128 #: ../fish/guestfish-actions.pod:3774 ../src/guestfs-actions.pod:5875
13129 msgid "AIX disk labels."
13133 #: ../fish/guestfish-actions.pod:3776 ../src/guestfs-actions.pod:5877
13138 #: ../fish/guestfish-actions.pod:3778 ../src/guestfs-actions.pod:5879
13143 #: ../fish/guestfish-actions.pod:3780 ../src/guestfs-actions.pod:5881
13144 msgid "Amiga \"Rigid Disk Block\" format."
13148 #: ../fish/guestfish-actions.pod:3782 ../src/guestfs-actions.pod:5883
13153 #: ../fish/guestfish-actions.pod:3784 ../src/guestfs-actions.pod:5885
13154 msgid "BSD disk labels."
13158 #: ../fish/guestfish-actions.pod:3786 ../src/guestfs-actions.pod:5887
13163 #: ../fish/guestfish-actions.pod:3788 ../src/guestfs-actions.pod:5889
13164 msgid "DASD, used on IBM mainframes."
13168 #: ../fish/guestfish-actions.pod:3790 ../src/guestfs-actions.pod:5891
13173 #: ../fish/guestfish-actions.pod:3792 ../src/guestfs-actions.pod:5893
13174 msgid "MIPS/SGI volumes."
13178 #: ../fish/guestfish-actions.pod:3794 ../src/guestfs-actions.pod:5895
13183 #: ../fish/guestfish-actions.pod:3796 ../src/guestfs-actions.pod:5897
13184 msgid "Old Mac partition format. Modern Macs use C<gpt>."
13188 #: ../fish/guestfish-actions.pod:3798 ../src/guestfs-actions.pod:5899
13193 #: ../fish/guestfish-actions.pod:3800 ../src/guestfs-actions.pod:5901
13194 msgid "NEC PC-98 format, common in Japan apparently."
13198 #: ../fish/guestfish-actions.pod:3802 ../src/guestfs-actions.pod:5903
13203 #: ../fish/guestfish-actions.pod:3804 ../src/guestfs-actions.pod:5905
13204 msgid "Sun disk labels."
13208 #: ../fish/guestfish-actions.pod:3808
13213 #: ../fish/guestfish-actions.pod:3810
13216 " part-list device\n"
13221 #: ../fish/guestfish-actions.pod:3812 ../src/guestfs-actions.pod:5919
13223 "This command parses the partition table on C<device> and returns the list of "
13224 "partitions found."
13228 #: ../fish/guestfish-actions.pod:3815 ../src/guestfs-actions.pod:5922
13229 msgid "The fields in the returned structure are:"
13233 #: ../fish/guestfish-actions.pod:3819 ../src/guestfs-actions.pod:5926
13234 msgid "B<part_num>"
13238 #: ../fish/guestfish-actions.pod:3821 ../src/guestfs-actions.pod:5928
13239 msgid "Partition number, counting from 1."
13243 #: ../fish/guestfish-actions.pod:3823 ../src/guestfs-actions.pod:5930
13244 msgid "B<part_start>"
13248 #: ../fish/guestfish-actions.pod:3825
13250 "Start of the partition I<in bytes>. To get sectors you have to divide by "
13251 "the device's sector size, see L</blockdev-getss>."
13255 #: ../fish/guestfish-actions.pod:3828 ../src/guestfs-actions.pod:5935
13256 msgid "B<part_end>"
13260 #: ../fish/guestfish-actions.pod:3830 ../src/guestfs-actions.pod:5937
13261 msgid "End of the partition in bytes."
13265 #: ../fish/guestfish-actions.pod:3832 ../src/guestfs-actions.pod:5939
13266 msgid "B<part_size>"
13270 #: ../fish/guestfish-actions.pod:3834 ../src/guestfs-actions.pod:5941
13271 msgid "Size of the partition in bytes."
13275 #: ../fish/guestfish-actions.pod:3838
13276 msgid "part-set-bootable"
13280 #: ../fish/guestfish-actions.pod:3840
13283 " part-set-bootable device partnum true|false\n"
13288 #: ../fish/guestfish-actions.pod:3842 ../src/guestfs-actions.pod:5959
13290 "This sets the bootable flag on partition numbered C<partnum> on device "
13291 "C<device>. Note that partitions are numbered from 1."
13295 #: ../fish/guestfish-actions.pod:3845 ../src/guestfs-actions.pod:5962
13297 "The bootable flag is used by some operating systems (notably Windows) to "
13298 "determine which partition to boot from. It is by no means universally "
13303 #: ../fish/guestfish-actions.pod:3849
13304 msgid "part-set-mbr-id"
13308 #: ../fish/guestfish-actions.pod:3851
13311 " part-set-mbr-id device partnum idbyte\n"
13316 #: ../fish/guestfish-actions.pod:3853 ../src/guestfs-actions.pod:5978
13318 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
13319 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
13320 "documentation are in fact hexadecimal numbers, but usually documented "
13321 "without any leading \"0x\" which might be confusing."
13325 #: ../fish/guestfish-actions.pod:3863
13326 msgid "part-set-name"
13330 #: ../fish/guestfish-actions.pod:3865
13333 " part-set-name device partnum name\n"
13338 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:6000
13340 "This sets the partition name on partition numbered C<partnum> on device "
13341 "C<device>. Note that partitions are numbered from 1."
13345 #: ../fish/guestfish-actions.pod:3870 ../src/guestfs-actions.pod:6003
13347 "The partition name can only be set on certain types of partition table. "
13348 "This works on C<gpt> but not on C<mbr> partitions."
13352 #: ../fish/guestfish-actions.pod:3873
13353 msgid "part-to-dev"
13357 #: ../fish/guestfish-actions.pod:3875
13360 " part-to-dev partition\n"
13365 #: ../fish/guestfish-actions.pod:3877 ../src/guestfs-actions.pod:6016
13367 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
13368 "partition number, returning the device name (eg. \"/dev/sdb\")."
13372 #: ../fish/guestfish-actions.pod:3881 ../fish/guestfish-actions.pod:3893
13374 "The named partition must exist, for example as a string returned from "
13375 "L</list-partitions>."
13379 #: ../fish/guestfish-actions.pod:3884
13380 msgid "See also L</part-to-partnum>."
13384 #: ../fish/guestfish-actions.pod:3886
13385 msgid "part-to-partnum"
13389 #: ../fish/guestfish-actions.pod:3888
13392 " part-to-partnum partition\n"
13397 #: ../fish/guestfish-actions.pod:3890 ../src/guestfs-actions.pod:6036
13399 "This function takes a partition name (eg. \"/dev/sdb1\") and returns the "
13400 "partition number (eg. C<1>)."
13404 #: ../fish/guestfish-actions.pod:3896
13405 msgid "See also L</part-to-dev>."
13409 #: ../fish/guestfish-actions.pod:3898
13410 msgid "ping-daemon"
13414 #: ../fish/guestfish-actions.pod:3900
13422 #: ../fish/guestfish-actions.pod:3902 ../src/guestfs-actions.pod:6051
13424 "This is a test probe into the guestfs daemon running inside the qemu "
13425 "subprocess. Calling this function checks that the daemon responds to the "
13426 "ping message, without affecting the daemon or attached block device(s) in "
13431 #: ../fish/guestfish-actions.pod:3907
13436 #: ../fish/guestfish-actions.pod:3909
13439 " pread path count offset\n"
13444 #: ../fish/guestfish-actions.pod:3911 ../src/guestfs-actions.pod:6069
13446 "This command lets you read part of a file. It reads C<count> bytes of the "
13447 "file, starting at C<offset>, from file C<path>."
13451 #: ../fish/guestfish-actions.pod:3914 ../fish/guestfish-actions.pod:3929 ../src/guestfs-actions.pod:6072 ../src/guestfs-actions.pod:6098
13453 "This may read fewer bytes than requested. For further details see the "
13454 "L<pread(2)> system call."
13458 #: ../fish/guestfish-actions.pod:3917
13459 msgid "See also L</pwrite>, L</pread-device>."
13463 #: ../fish/guestfish-actions.pod:3922
13464 msgid "pread-device"
13468 #: ../fish/guestfish-actions.pod:3924
13471 " pread-device device count offset\n"
13476 #: ../fish/guestfish-actions.pod:3926 ../src/guestfs-actions.pod:6095
13478 "This command lets you read part of a file. It reads C<count> bytes of "
13479 "C<device>, starting at C<offset>."
13483 #: ../fish/guestfish-actions.pod:3932
13484 msgid "See also L</pread>."
13488 #: ../fish/guestfish-actions.pod:3937
13493 #: ../fish/guestfish-actions.pod:3939
13496 " pvcreate device\n"
13501 #: ../fish/guestfish-actions.pod:3941 ../src/guestfs-actions.pod:6118
13503 "This creates an LVM physical volume on the named C<device>, where C<device> "
13504 "should usually be a partition name such as C</dev/sda1>."
13508 #: ../fish/guestfish-actions.pod:3945
13513 #: ../fish/guestfish-actions.pod:3947
13516 " pvremove device\n"
13521 #: ../fish/guestfish-actions.pod:3949 ../src/guestfs-actions.pod:6132
13523 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13528 #: ../fish/guestfish-actions.pod:3952 ../src/guestfs-actions.pod:6135
13530 "The implementation uses the C<pvremove> command which refuses to wipe "
13531 "physical volumes that contain any volume groups, so you have to remove those "
13536 #: ../fish/guestfish-actions.pod:3956
13541 #: ../fish/guestfish-actions.pod:3958
13544 " pvresize device\n"
13549 #: ../fish/guestfish-actions.pod:3960 ../src/guestfs-actions.pod:6149
13551 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13552 "the new size of the underlying device."
13556 #: ../fish/guestfish-actions.pod:3963
13557 msgid "pvresize-size"
13561 #: ../fish/guestfish-actions.pod:3965
13564 " pvresize-size device size\n"
13569 #: ../fish/guestfish-actions.pod:3967
13571 "This command is the same as L</pvresize> except that it allows you to "
13572 "specify the new size (in bytes) explicitly."
13576 #: ../fish/guestfish-actions.pod:3970
13581 #: ../fish/guestfish-actions.pod:3972
13589 #: ../fish/guestfish-actions.pod:3974 ../src/guestfs-actions.pod:6175
13591 "List all the physical volumes detected. This is the equivalent of the "
13592 "L<pvs(8)> command."
13596 #: ../fish/guestfish-actions.pod:3977 ../src/guestfs-actions.pod:6178
13598 "This returns a list of just the device names that contain PVs "
13599 "(eg. C</dev/sda2>)."
13603 #: ../fish/guestfish-actions.pod:3980
13604 msgid "See also L</pvs-full>."
13608 #: ../fish/guestfish-actions.pod:3982
13613 #: ../fish/guestfish-actions.pod:3984
13621 #: ../fish/guestfish-actions.pod:3986 ../src/guestfs-actions.pod:6194
13623 "List all the physical volumes detected. This is the equivalent of the "
13624 "L<pvs(8)> command. The \"full\" version includes all fields."
13628 #: ../fish/guestfish-actions.pod:3989
13633 #: ../fish/guestfish-actions.pod:3991
13641 #: ../fish/guestfish-actions.pod:3993 ../src/guestfs-actions.pod:6209
13642 msgid "This command returns the UUID of the LVM PV C<device>."
13646 #: ../fish/guestfish-actions.pod:3995
13651 #: ../fish/guestfish-actions.pod:3997
13654 " pwrite path content offset\n"
13659 #: ../fish/guestfish-actions.pod:3999 ../src/guestfs-actions.pod:6225
13661 "This command writes to part of a file. It writes the data buffer C<content> "
13662 "to the file C<path> starting at offset C<offset>."
13666 #: ../fish/guestfish-actions.pod:4002 ../src/guestfs-actions.pod:6228
13668 "This command implements the L<pwrite(2)> system call, and like that system "
13669 "call it may not write the full data requested. The return value is the "
13670 "number of bytes that were actually written to the file. This could even be "
13671 "0, although short writes are unlikely for regular files in ordinary "
13676 #: ../fish/guestfish-actions.pod:4008
13677 msgid "See also L</pread>, L</pwrite-device>."
13681 #: ../fish/guestfish-actions.pod:4013
13682 msgid "pwrite-device"
13686 #: ../fish/guestfish-actions.pod:4015
13689 " pwrite-device device content offset\n"
13694 #: ../fish/guestfish-actions.pod:4017 ../src/guestfs-actions.pod:6252
13696 "This command writes to part of a device. It writes the data buffer "
13697 "C<content> to C<device> starting at offset C<offset>."
13701 #: ../fish/guestfish-actions.pod:4020 ../src/guestfs-actions.pod:6255
13703 "This command implements the L<pwrite(2)> system call, and like that system "
13704 "call it may not write the full data requested (although short writes to disk "
13705 "devices and partitions are probably impossible with standard Linux kernels)."
13709 #: ../fish/guestfish-actions.pod:4025
13710 msgid "See also L</pwrite>."
13714 #: ../fish/guestfish-actions.pod:4030
13719 #: ../fish/guestfish-actions.pod:4032
13722 " read-file path\n"
13727 #: ../fish/guestfish-actions.pod:4034 ../src/guestfs-actions.pod:6276
13728 msgid "This calls returns the contents of the file C<path> as a buffer."
13732 #: ../fish/guestfish-actions.pod:4037
13734 "Unlike L</cat>, this function can correctly handle files that contain "
13735 "embedded ASCII NUL characters. However unlike L</download>, this function "
13736 "is limited in the total size of file that can be handled."
13740 #: ../fish/guestfish-actions.pod:4045
13745 #: ../fish/guestfish-actions.pod:4047
13748 " read-lines path\n"
13753 #: ../fish/guestfish-actions.pod:4051 ../src/guestfs-actions.pod:6301
13755 "The file contents are returned as a list of lines. Trailing C<LF> and "
13756 "C<CRLF> character sequences are I<not> returned."
13760 #: ../fish/guestfish-actions.pod:4054
13762 "Note that this function cannot correctly handle binary files (specifically, "
13763 "files containing C<\\0> character which is treated as end of line). For "
13764 "those you need to use the L</read-file> function which has a more complex "
13769 #: ../fish/guestfish-actions.pod:4059
13774 #: ../fish/guestfish-actions.pod:4061
13782 #: ../fish/guestfish-actions.pod:4063 ../src/guestfs-actions.pod:6321
13783 msgid "This returns the list of directory entries in directory C<dir>."
13787 #: ../fish/guestfish-actions.pod:4065 ../src/guestfs-actions.pod:6323
13789 "All entries in the directory are returned, including C<.> and C<..>. The "
13790 "entries are I<not> sorted, but returned in the same order as the underlying "
13795 #: ../fish/guestfish-actions.pod:4069 ../src/guestfs-actions.pod:6327
13797 "Also this call returns basic file type information about each file. The "
13798 "C<ftyp> field will contain one of the following characters:"
13802 #: ../fish/guestfish-actions.pod:4074 ../src/guestfs-actions.pod:6332
13807 #: ../fish/guestfish-actions.pod:4076 ../src/guestfs-actions.pod:6334
13808 msgid "Block special"
13812 #: ../fish/guestfish-actions.pod:4078 ../src/guestfs-actions.pod:6336
13817 #: ../fish/guestfish-actions.pod:4080 ../src/guestfs-actions.pod:6338
13818 msgid "Char special"
13822 #: ../fish/guestfish-actions.pod:4082 ../src/guestfs-actions.pod:6340
13827 #: ../fish/guestfish-actions.pod:4084 ../src/guestfs-actions.pod:6342
13832 #: ../fish/guestfish-actions.pod:4086 ../src/guestfs-actions.pod:6344
13837 #: ../fish/guestfish-actions.pod:4088 ../src/guestfs-actions.pod:6346
13838 msgid "FIFO (named pipe)"
13842 #: ../fish/guestfish-actions.pod:4090 ../src/guestfs-actions.pod:6348
13847 #: ../fish/guestfish-actions.pod:4092 ../src/guestfs-actions.pod:6350
13848 msgid "Symbolic link"
13852 #: ../fish/guestfish-actions.pod:4094 ../src/guestfs-actions.pod:6352
13857 #: ../fish/guestfish-actions.pod:4096 ../src/guestfs-actions.pod:6354
13858 msgid "Regular file"
13862 #: ../fish/guestfish-actions.pod:4098 ../src/guestfs-actions.pod:6356
13867 #: ../fish/guestfish-actions.pod:4100 ../src/guestfs-actions.pod:6358
13872 #: ../fish/guestfish-actions.pod:4102 ../src/guestfs-actions.pod:6360
13877 #: ../fish/guestfish-actions.pod:4104 ../src/guestfs-actions.pod:6362
13878 msgid "Unknown file type"
13882 #: ../fish/guestfish-actions.pod:4106 ../src/guestfs-actions.pod:6364
13887 #: ../fish/guestfish-actions.pod:4108 ../src/guestfs-actions.pod:6366
13888 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13892 #: ../fish/guestfish-actions.pod:4113
13894 "This function is primarily intended for use by programs. To get a simple "
13895 "list of names, use L</ls>. To get a printable directory for human "
13896 "consumption, use L</ll>."
13900 #: ../fish/guestfish-actions.pod:4117
13905 #: ../fish/guestfish-actions.pod:4119
13913 #: ../fish/guestfish-actions.pod:4121 ../src/guestfs-actions.pod:6387
13914 msgid "This command reads the target of a symbolic link."
13918 #: ../fish/guestfish-actions.pod:4123
13919 msgid "readlinklist"
13923 #: ../fish/guestfish-actions.pod:4125
13926 " readlinklist path 'names ...'\n"
13931 #: ../fish/guestfish-actions.pod:4127 ../src/guestfs-actions.pod:6401
13933 "This call allows you to do a C<readlink> operation on multiple files, where "
13934 "all files are in the directory C<path>. C<names> is the list of files from "
13939 #: ../fish/guestfish-actions.pod:4131 ../src/guestfs-actions.pod:6405
13941 "On return you get a list of strings, with a one-to-one correspondence to the "
13942 "C<names> list. Each string is the value of the symbolic link."
13946 #: ../fish/guestfish-actions.pod:4135 ../src/guestfs-actions.pod:6409
13948 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13949 "result string is the empty string C<\"\">. However the whole operation is "
13950 "completed even if there were C<readlink(2)> errors, and so you can call this "
13951 "function with names where you don't know if they are symbolic links already "
13952 "(albeit slightly less efficient)."
13956 #: ../fish/guestfish-actions.pod:4142 ../src/guestfs-actions.pod:6416
13958 "This call is intended for programs that want to efficiently list a directory "
13959 "contents without making many round-trips. Very long directory listings "
13960 "might cause the protocol message size to be exceeded, causing this call to "
13961 "fail. The caller must split up such requests into smaller groups of names."
13965 #: ../fish/guestfish-actions.pod:4149
13970 #: ../fish/guestfish-actions.pod:4151
13978 #: ../fish/guestfish-actions.pod:4153 ../src/guestfs-actions.pod:6435
13980 "Return the canonicalized absolute pathname of C<path>. The returned path "
13981 "has no C<.>, C<..> or symbolic link path elements."
13985 #: ../fish/guestfish-actions.pod:4156
13986 msgid "removexattr"
13990 #: ../fish/guestfish-actions.pod:4158
13993 " removexattr xattr path\n"
13998 #: ../fish/guestfish-actions.pod:4160 ../src/guestfs-actions.pod:6450
13999 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
14003 #: ../fish/guestfish-actions.pod:4163
14004 msgid "See also: L</lremovexattr>, L<attr(5)>."
14008 #: ../fish/guestfish-actions.pod:4165
14013 #: ../fish/guestfish-actions.pod:4167
14016 " resize2fs device\n"
14021 #: ../fish/guestfish-actions.pod:4169 ../src/guestfs-actions.pod:6465
14023 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
14024 "underlying device."
14028 #: ../fish/guestfish-actions.pod:4172
14030 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
14031 "before calling this command. For unknown reasons C<resize2fs> sometimes "
14032 "gives an error about this and sometimes not. In any case, it is always safe "
14033 "to call L</e2fsck-f> before calling this function."
14037 #: ../fish/guestfish-actions.pod:4178
14038 msgid "resize2fs-M"
14042 #: ../fish/guestfish-actions.pod:4180
14045 " resize2fs-M device\n"
14050 #: ../fish/guestfish-actions.pod:4182
14052 "This command is the same as L</resize2fs>, but the filesystem is resized to "
14053 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
14058 #: ../fish/guestfish-actions.pod:4186
14060 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
14061 "and read the C<Block size> and C<Block count> values. These two numbers, "
14062 "multiplied together, give the resulting size of the minimal filesystem in "
14067 #: ../fish/guestfish-actions.pod:4191
14068 msgid "resize2fs-size"
14072 #: ../fish/guestfish-actions.pod:4193
14075 " resize2fs-size device size\n"
14080 #: ../fish/guestfish-actions.pod:4195
14082 "This command is the same as L</resize2fs> except that it allows you to "
14083 "specify the new size (in bytes) explicitly."
14087 #: ../fish/guestfish-actions.pod:4198
14092 #: ../fish/guestfish-actions.pod:4200
14100 #: ../fish/guestfish-actions.pod:4202 ../src/guestfs-actions.pod:6517
14101 msgid "Remove the single file C<path>."
14105 #: ../fish/guestfish-actions.pod:4204
14110 #: ../fish/guestfish-actions.pod:4206
14118 #: ../fish/guestfish-actions.pod:4208 ../src/guestfs-actions.pod:6529
14120 "Remove the file or directory C<path>, recursively removing the contents if "
14121 "its a directory. This is like the C<rm -rf> shell command."
14125 #: ../fish/guestfish-actions.pod:4212
14130 #: ../fish/guestfish-actions.pod:4214
14138 #: ../fish/guestfish-actions.pod:4216 ../src/guestfs-actions.pod:6543
14139 msgid "Remove the single directory C<path>."
14143 #: ../fish/guestfish-actions.pod:4218
14144 msgid "rmmountpoint"
14148 #: ../fish/guestfish-actions.pod:4220
14151 " rmmountpoint exemptpath\n"
14156 #: ../fish/guestfish-actions.pod:4222
14158 "This calls removes a mountpoint that was previously created with "
14159 "L</mkmountpoint>. See L</mkmountpoint> for full details."
14163 #: ../fish/guestfish-actions.pod:4226
14164 msgid "scrub-device"
14168 #: ../fish/guestfish-actions.pod:4228
14171 " scrub-device device\n"
14176 #: ../fish/guestfish-actions.pod:4230 ../src/guestfs-actions.pod:6569
14178 "This command writes patterns over C<device> to make data retrieval more "
14183 #: ../fish/guestfish-actions.pod:4233 ../fish/guestfish-actions.pod:4248 ../fish/guestfish-actions.pod:4261 ../src/guestfs-actions.pod:6572 ../src/guestfs-actions.pod:6593 ../src/guestfs-actions.pod:6612
14185 "It is an interface to the L<scrub(1)> program. See that manual page for "
14190 #: ../fish/guestfish-actions.pod:4239
14195 #: ../fish/guestfish-actions.pod:4241
14198 " scrub-file file\n"
14203 #: ../fish/guestfish-actions.pod:4243 ../src/guestfs-actions.pod:6588
14205 "This command writes patterns over a file to make data retrieval more "
14210 #: ../fish/guestfish-actions.pod:4246 ../src/guestfs-actions.pod:6591
14211 msgid "The file is I<removed> after scrubbing."
14215 #: ../fish/guestfish-actions.pod:4251
14216 msgid "scrub-freespace"
14220 #: ../fish/guestfish-actions.pod:4253
14223 " scrub-freespace dir\n"
14228 #: ../fish/guestfish-actions.pod:4255
14230 "This command creates the directory C<dir> and then fills it with files until "
14231 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
14232 "deletes them. The intention is to scrub any free space on the partition "
14233 "containing C<dir>."
14237 #: ../fish/guestfish-actions.pod:4264
14242 #: ../fish/guestfish-actions.pod:4266
14247 #: ../fish/guestfish-actions.pod:4268
14250 " set-append append\n"
14255 #: ../fish/guestfish-actions.pod:4270 ../src/guestfs-actions.pod:6625
14257 "This function is used to add additional options to the guest kernel command "
14262 #: ../fish/guestfish-actions.pod:4273 ../src/guestfs-actions.pod:6628
14264 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
14265 "environment variable."
14269 #: ../fish/guestfish-actions.pod:4276 ../src/guestfs-actions.pod:6631
14271 "Setting C<append> to C<NULL> means I<no> additional options are passed "
14272 "(libguestfs always adds a few of its own)."
14276 #: ../fish/guestfish-actions.pod:4279
14277 msgid "set-attach-method"
14281 #: ../fish/guestfish-actions.pod:4281
14282 msgid "attach-method"
14286 #: ../fish/guestfish-actions.pod:4283
14289 " set-attach-method attachmethod\n"
14294 #: ../fish/guestfish-actions.pod:4285 ../src/guestfs-actions.pod:6644
14296 "Set the method that libguestfs uses to connect to the back end guestfsd "
14297 "daemon. Possible methods are:"
14301 #: ../fish/guestfish-actions.pod:4290 ../src/guestfs-actions.pod:6649 ../src/guestfs.pod:2916
14302 msgid "C<appliance>"
14306 #: ../fish/guestfish-actions.pod:4292 ../src/guestfs-actions.pod:6651
14308 "Launch an appliance and connect to it. This is the ordinary method and the "
14313 #: ../fish/guestfish-actions.pod:4295 ../src/guestfs-actions.pod:6654
14314 msgid "C<unix:I<path>>"
14318 #: ../fish/guestfish-actions.pod:4297 ../src/guestfs-actions.pod:6656
14319 msgid "Connect to the Unix domain socket I<path>."
14323 #: ../fish/guestfish-actions.pod:4299 ../src/guestfs-actions.pod:6658
14325 "This method lets you connect to an existing daemon or (using virtio-serial) "
14326 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
14327 "RUNNING DAEMONS>."
14331 #: ../fish/guestfish-actions.pod:4305
14332 msgid "set-autosync"
14336 #: ../fish/guestfish-actions.pod:4307
14341 #: ../fish/guestfish-actions.pod:4309
14344 " set-autosync true|false\n"
14349 #: ../fish/guestfish-actions.pod:4311 ../src/guestfs-actions.pod:6674
14351 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
14352 "effort attempt to make filesystems consistent and synchronized when the "
14353 "handle is closed (also if the program exits without closing handles)."
14357 #: ../fish/guestfish-actions.pod:4316 ../src/guestfs-actions.pod:6679
14359 "This is enabled by default (since libguestfs 1.5.24, previously it was "
14360 "disabled by default)."
14364 #: ../fish/guestfish-actions.pod:4319
14369 #: ../fish/guestfish-actions.pod:4321
14374 #: ../fish/guestfish-actions.pod:4323
14377 " set-direct true|false\n"
14382 #: ../fish/guestfish-actions.pod:4325 ../src/guestfs-actions.pod:6692
14384 "If the direct appliance mode flag is enabled, then stdin and stdout are "
14385 "passed directly through to the appliance once it is launched."
14389 #: ../fish/guestfish-actions.pod:4329
14391 "One consequence of this is that log messages aren't caught by the library "
14392 "and handled by L</set-log-message-callback>, but go straight to stdout."
14396 #: ../fish/guestfish-actions.pod:4333 ../src/guestfs-actions.pod:6700
14397 msgid "You probably don't want to use this unless you know what you are doing."
14401 #: ../fish/guestfish-actions.pod:4336 ../src/guestfs-actions.pod:6703
14402 msgid "The default is disabled."
14406 #: ../fish/guestfish-actions.pod:4338
14407 msgid "set-e2label"
14411 #: ../fish/guestfish-actions.pod:4340
14414 " set-e2label device label\n"
14419 #: ../fish/guestfish-actions.pod:4342 ../src/guestfs-actions.pod:6716
14421 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
14422 "C<label>. Filesystem labels are limited to 16 characters."
14426 #: ../fish/guestfish-actions.pod:4346
14428 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
14429 "label on a filesystem."
14433 #: ../fish/guestfish-actions.pod:4349
14438 #: ../fish/guestfish-actions.pod:4351
14441 " set-e2uuid device uuid\n"
14446 #: ../fish/guestfish-actions.pod:4353 ../src/guestfs-actions.pod:6734
14448 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
14449 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
14450 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
14454 #: ../fish/guestfish-actions.pod:4358
14456 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
14457 "UUID of a filesystem."
14461 #: ../fish/guestfish-actions.pod:4361
14462 msgid "set-memsize"
14466 #: ../fish/guestfish-actions.pod:4363
14471 #: ../fish/guestfish-actions.pod:4365
14474 " set-memsize memsize\n"
14479 #: ../fish/guestfish-actions.pod:4367
14481 "This sets the memory size in megabytes allocated to the qemu subprocess. "
14482 "This only has any effect if called before L</launch>."
14486 #: ../fish/guestfish-actions.pod:4371 ../src/guestfs-actions.pod:6756
14488 "You can also change this by setting the environment variable "
14489 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
14493 #: ../fish/guestfish-actions.pod:4378
14494 msgid "set-network"
14498 #: ../fish/guestfish-actions.pod:4380
14503 #: ../fish/guestfish-actions.pod:4382
14506 " set-network true|false\n"
14511 #: ../fish/guestfish-actions.pod:4384 ../src/guestfs-actions.pod:6773
14513 "If C<network> is true, then the network is enabled in the libguestfs "
14514 "appliance. The default is false."
14518 #: ../fish/guestfish-actions.pod:4387 ../src/guestfs-actions.pod:6776
14520 "This affects whether commands are able to access the network (see "
14521 "L<guestfs(3)/RUNNING COMMANDS>)."
14525 #: ../fish/guestfish-actions.pod:4390
14526 msgid "You must call this before calling L</launch>, otherwise it has no effect."
14530 #: ../fish/guestfish-actions.pod:4393
14535 #: ../fish/guestfish-actions.pod:4397
14538 " set-path searchpath\n"
14543 #: ../fish/guestfish-actions.pod:4399 ../src/guestfs-actions.pod:6792
14544 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14548 #: ../fish/guestfish-actions.pod:4401 ../src/guestfs-actions.pod:6794
14550 "The default is C<$libdir/guestfs> unless overridden by setting "
14551 "C<LIBGUESTFS_PATH> environment variable."
14555 #: ../fish/guestfish-actions.pod:4404 ../src/guestfs-actions.pod:6797
14556 msgid "Setting C<path> to C<NULL> restores the default path."
14560 #: ../fish/guestfish-actions.pod:4406
14565 #: ../fish/guestfish-actions.pod:4408
14570 #: ../fish/guestfish-actions.pod:4410
14573 " set-pgroup true|false\n"
14578 #: ../fish/guestfish-actions.pod:4412 ../src/guestfs-actions.pod:6809
14580 "If C<pgroup> is true, child processes are placed into their own process "
14585 #: ../fish/guestfish-actions.pod:4415 ../src/guestfs-actions.pod:6812
14587 "The practical upshot of this is that signals like C<SIGINT> (from users "
14588 "pressing C<^C>) won't be received by the child process."
14592 #: ../fish/guestfish-actions.pod:4418 ../src/guestfs-actions.pod:6815
14594 "The default for this flag is false, because usually you want C<^C> to kill "
14599 #: ../fish/guestfish-actions.pod:4421
14604 #: ../fish/guestfish-actions.pod:4423
14609 #: ../fish/guestfish-actions.pod:4425
14617 #: ../fish/guestfish-actions.pod:4427 ../src/guestfs-actions.pod:6828
14618 msgid "Set the qemu binary that we will use."
14622 #: ../fish/guestfish-actions.pod:4429 ../src/guestfs-actions.pod:6830
14623 msgid "The default is chosen when the library was compiled by the configure script."
14627 #: ../fish/guestfish-actions.pod:4432 ../src/guestfs-actions.pod:6833
14629 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
14634 #: ../fish/guestfish-actions.pod:4435 ../src/guestfs-actions.pod:6836
14635 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
14639 #: ../fish/guestfish-actions.pod:4437 ../src/guestfs-actions.pod:6838
14641 "Note that you should call this function as early as possible after creating "
14642 "the handle. This is because some pre-launch operations depend on testing "
14643 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
14644 "don't retest features, and so you might see inconsistent results. Using the "
14645 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
14646 "the qemu binary at the same time as the handle is created."
14650 #: ../fish/guestfish-actions.pod:4445
14651 msgid "set-recovery-proc"
14655 #: ../fish/guestfish-actions.pod:4447
14656 msgid "recovery-proc"
14660 #: ../fish/guestfish-actions.pod:4449
14663 " set-recovery-proc true|false\n"
14668 #: ../fish/guestfish-actions.pod:4451
14670 "If this is called with the parameter C<false> then L</launch> does not "
14671 "create a recovery process. The purpose of the recovery process is to stop "
14672 "runaway qemu processes in the case where the main program aborts abruptly."
14676 #: ../fish/guestfish-actions.pod:4456
14678 "This only has any effect if called before L</launch>, and the default is "
14683 #: ../fish/guestfish-actions.pod:4459 ../src/guestfs-actions.pod:6864
14685 "About the only time when you would want to disable this is if the main "
14686 "process will fork itself into the background (\"daemonize\" itself). In "
14687 "this case the recovery process thinks that the main program has disappeared "
14688 "and so kills qemu, which is not very helpful."
14692 #: ../fish/guestfish-actions.pod:4465
14693 msgid "set-selinux"
14697 #: ../fish/guestfish-actions.pod:4467
14702 #: ../fish/guestfish-actions.pod:4469
14705 " set-selinux true|false\n"
14710 #: ../fish/guestfish-actions.pod:4471 ../src/guestfs-actions.pod:6880
14712 "This sets the selinux flag that is passed to the appliance at boot time. "
14713 "The default is C<selinux=0> (disabled)."
14717 #: ../fish/guestfish-actions.pod:4474 ../src/guestfs-actions.pod:6883
14719 "Note that if SELinux is enabled, it is always in Permissive mode "
14720 "(C<enforcing=0>)."
14724 #: ../fish/guestfish-actions.pod:4480
14729 #: ../fish/guestfish-actions.pod:4482
14734 #: ../fish/guestfish-actions.pod:4484
14742 #: ../fish/guestfish-actions.pod:4486 ../src/guestfs-actions.pod:6899
14744 "Change the number of virtual CPUs assigned to the appliance. The default is "
14745 "C<1>. Increasing this may improve performance, though often it has no "
14750 #: ../fish/guestfish-actions.pod:4490
14751 msgid "This function must be called before L</launch>."
14755 #: ../fish/guestfish-actions.pod:4492
14760 #: ../fish/guestfish-actions.pod:4494
14765 #: ../fish/guestfish-actions.pod:4496
14768 " set-trace true|false\n"
14773 #: ../fish/guestfish-actions.pod:4498 ../src/guestfs-actions.pod:6915
14775 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
14776 "return values are traced."
14780 #: ../fish/guestfish-actions.pod:4501 ../src/guestfs-actions.pod:6918
14782 "If you want to trace C API calls into libguestfs (and other libraries) then "
14783 "possibly a better way is to use the external ltrace(1) command."
14787 #: ../fish/guestfish-actions.pod:4505 ../src/guestfs-actions.pod:6922
14789 "Command traces are disabled unless the environment variable "
14790 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14794 #: ../fish/guestfish-actions.pod:4508
14796 "Trace messages are normally sent to C<stderr>, unless you register a "
14797 "callback to send them somewhere else (see L</set-event-callback>)."
14801 #: ../fish/guestfish-actions.pod:4512
14802 msgid "set-verbose"
14806 #: ../fish/guestfish-actions.pod:4514
14811 #: ../fish/guestfish-actions.pod:4516
14814 " set-verbose true|false\n"
14819 #: ../fish/guestfish-actions.pod:4518 ../src/guestfs-actions.pod:6939
14820 msgid "If C<verbose> is true, this turns on verbose messages."
14824 #: ../fish/guestfish-actions.pod:4520 ../src/guestfs-actions.pod:6941
14826 "Verbose messages are disabled unless the environment variable "
14827 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14831 #: ../fish/guestfish-actions.pod:4523
14833 "Verbose messages are normally sent to C<stderr>, unless you register a "
14834 "callback to send them somewhere else (see L</set-event-callback>)."
14838 #: ../fish/guestfish-actions.pod:4527
14843 #: ../fish/guestfish-actions.pod:4529
14846 " setcon context\n"
14851 #: ../fish/guestfish-actions.pod:4531 ../src/guestfs-actions.pod:6958
14853 "This sets the SELinux security context of the daemon to the string "
14858 #: ../fish/guestfish-actions.pod:4534 ../src/guestfs-actions.pod:6961
14859 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14863 #: ../fish/guestfish-actions.pod:4536
14868 #: ../fish/guestfish-actions.pod:4538
14871 " setxattr xattr val vallen path\n"
14876 #: ../fish/guestfish-actions.pod:4540 ../src/guestfs-actions.pod:6976
14878 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14879 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14883 #: ../fish/guestfish-actions.pod:4544
14884 msgid "See also: L</lsetxattr>, L<attr(5)>."
14888 #: ../fish/guestfish-actions.pod:4546
14893 #: ../fish/guestfish-actions.pod:4548
14896 " sfdisk device cyls heads sectors 'lines ...'\n"
14901 #: ../fish/guestfish-actions.pod:4550 ../src/guestfs-actions.pod:7003
14903 "This is a direct interface to the L<sfdisk(8)> program for creating "
14904 "partitions on block devices."
14908 #: ../fish/guestfish-actions.pod:4553 ../src/guestfs-actions.pod:7006
14909 msgid "C<device> should be a block device, for example C</dev/sda>."
14913 #: ../fish/guestfish-actions.pod:4555 ../src/guestfs-actions.pod:7008
14915 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14916 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
14917 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14918 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14919 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14920 "the kernel) cannot work out the right geometry and you will need to tell it."
14924 #: ../fish/guestfish-actions.pod:4563 ../src/guestfs-actions.pod:7016
14926 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14927 "refer to the L<sfdisk(8)> manpage."
14931 #: ../fish/guestfish-actions.pod:4566 ../src/guestfs-actions.pod:7019
14933 "To create a single partition occupying the whole disk, you would pass "
14934 "C<lines> as a single element list, when the single element being the string "
14939 #: ../fish/guestfish-actions.pod:4570
14940 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
14944 #: ../fish/guestfish-actions.pod:4576 ../fish/guestfish-actions.pod:4599 ../fish/guestfish-actions.pod:4621
14946 "I<This function is deprecated.> In new code, use the L</part_add> call "
14951 #: ../fish/guestfish-actions.pod:4583
14956 #: ../fish/guestfish-actions.pod:4585
14959 " sfdiskM device 'lines ...'\n"
14964 #: ../fish/guestfish-actions.pod:4587
14966 "This is a simplified interface to the L</sfdisk> command, where partition "
14967 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
14968 "you don't need to specify the cyls, heads and sectors parameters which were "
14969 "rarely if ever used anyway."
14973 #: ../fish/guestfish-actions.pod:4593
14974 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
14978 #: ../fish/guestfish-actions.pod:4606
14983 #: ../fish/guestfish-actions.pod:4608
14986 " sfdisk-N device partnum cyls heads sectors line\n"
14991 #: ../fish/guestfish-actions.pod:4610 ../src/guestfs-actions.pod:7081
14993 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14994 "(note: C<n> counts from 1)."
14998 #: ../fish/guestfish-actions.pod:4613
15000 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
15001 "cyls/heads/sectors parameters."
15005 #: ../fish/guestfish-actions.pod:4616
15006 msgid "See also: L</part-add>"
15010 #: ../fish/guestfish-actions.pod:4628
15011 msgid "sfdisk-disk-geometry"
15015 #: ../fish/guestfish-actions.pod:4630
15018 " sfdisk-disk-geometry device\n"
15023 #: ../fish/guestfish-actions.pod:4632
15025 "This displays the disk geometry of C<device> read from the partition table. "
15026 "Especially in the case where the underlying block device has been resized, "
15027 "this can be different from the kernel's idea of the geometry (see "
15028 "L</sfdisk-kernel-geometry>)."
15032 #: ../fish/guestfish-actions.pod:4637 ../fish/guestfish-actions.pod:4646 ../src/guestfs-actions.pod:7107 ../src/guestfs-actions.pod:7123
15033 msgid "The result is in human-readable format, and not designed to be parsed."
15037 #: ../fish/guestfish-actions.pod:4640
15038 msgid "sfdisk-kernel-geometry"
15042 #: ../fish/guestfish-actions.pod:4642
15045 " sfdisk-kernel-geometry device\n"
15050 #: ../fish/guestfish-actions.pod:4644 ../src/guestfs-actions.pod:7121
15051 msgid "This displays the kernel's idea of the geometry of C<device>."
15055 #: ../fish/guestfish-actions.pod:4649
15060 #: ../fish/guestfish-actions.pod:4651
15063 " sfdisk-l device\n"
15068 #: ../fish/guestfish-actions.pod:4653 ../src/guestfs-actions.pod:7144
15070 "This displays the partition table on C<device>, in the human-readable output "
15071 "of the L<sfdisk(8)> command. It is not intended to be parsed."
15075 #: ../fish/guestfish-actions.pod:4657
15076 msgid "See also: L</part-list>"
15080 #: ../fish/guestfish-actions.pod:4659
15082 "I<This function is deprecated.> In new code, use the L</part_list> call "
15087 #: ../fish/guestfish-actions.pod:4666
15092 #: ../fish/guestfish-actions.pod:4668
15100 #: ../fish/guestfish-actions.pod:4670 ../src/guestfs-actions.pod:7161
15102 "This call runs a command from the guest filesystem via the guest's "
15107 #: ../fish/guestfish-actions.pod:4673
15108 msgid "This is like L</command>, but passes the command to:"
15112 #: ../fish/guestfish-actions.pod:4675 ../src/guestfs-actions.pod:7166
15115 " /bin/sh -c \"command\"\n"
15120 #: ../fish/guestfish-actions.pod:4677 ../src/guestfs-actions.pod:7168
15122 "Depending on the guest's shell, this usually results in wildcards being "
15123 "expanded, shell expressions being interpolated and so on."
15127 #: ../fish/guestfish-actions.pod:4681
15128 msgid "All the provisos about L</command> apply to this call."
15132 #: ../fish/guestfish-actions.pod:4683
15137 #: ../fish/guestfish-actions.pod:4685
15140 " sh-lines command\n"
15145 #: ../fish/guestfish-actions.pod:4687
15146 msgid "This is the same as L</sh>, but splits the result into a list of lines."
15150 #: ../fish/guestfish-actions.pod:4690
15151 msgid "See also: L</command-lines>"
15155 #: ../fish/guestfish-actions.pod:4692
15160 #: ../fish/guestfish-actions.pod:4694
15168 #: ../fish/guestfish-actions.pod:4696 ../src/guestfs-actions.pod:7202
15169 msgid "Sleep for C<secs> seconds."
15173 #: ../fish/guestfish-actions.pod:4698
15178 #: ../fish/guestfish-actions.pod:4700
15186 #: ../fish/guestfish-actions.pod:4704 ../src/guestfs-actions.pod:7216
15187 msgid "This is the same as the C<stat(2)> system call."
15191 #: ../fish/guestfish-actions.pod:4706
15196 #: ../fish/guestfish-actions.pod:4708
15204 #: ../fish/guestfish-actions.pod:4710 ../src/guestfs-actions.pod:7230
15206 "Returns file system statistics for any mounted file system. C<path> should "
15207 "be a file or directory in the mounted file system (typically it is the mount "
15208 "point itself, but it doesn't need to be)."
15212 #: ../fish/guestfish-actions.pod:4714 ../src/guestfs-actions.pod:7234
15213 msgid "This is the same as the C<statvfs(2)> system call."
15217 #: ../fish/guestfish-actions.pod:4716
15222 #: ../fish/guestfish-actions.pod:4718
15230 #: ../fish/guestfish-actions.pod:4720 ../src/guestfs-actions.pod:7248
15232 "This runs the L<strings(1)> command on a file and returns the list of "
15233 "printable strings found."
15237 #: ../fish/guestfish-actions.pod:4726
15242 #: ../fish/guestfish-actions.pod:4728
15245 " strings-e encoding path\n"
15250 #: ../fish/guestfish-actions.pod:4730
15252 "This is like the L</strings> command, but allows you to specify the encoding "
15253 "of strings that are looked for in the source file C<path>."
15257 #: ../fish/guestfish-actions.pod:4734 ../src/guestfs-actions.pod:7271
15258 msgid "Allowed encodings are:"
15262 #: ../fish/guestfish-actions.pod:4738 ../src/guestfs-actions.pod:7275
15267 #: ../fish/guestfish-actions.pod:4740
15269 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
15270 "ISO-8859-X (this is what L</strings> uses)."
15274 #: ../fish/guestfish-actions.pod:4743 ../src/guestfs-actions.pod:7280
15279 #: ../fish/guestfish-actions.pod:4745 ../src/guestfs-actions.pod:7282
15280 msgid "Single 8-bit-byte characters."
15284 #: ../fish/guestfish-actions.pod:4747 ../src/guestfs-actions.pod:7284
15289 #: ../fish/guestfish-actions.pod:4749 ../src/guestfs-actions.pod:7286
15290 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
15294 #: ../fish/guestfish-actions.pod:4752 ../src/guestfs-actions.pod:7289
15295 msgid "l (lower case letter L)"
15299 #: ../fish/guestfish-actions.pod:4754 ../src/guestfs-actions.pod:7291
15301 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
15302 "examining binaries in Windows guests."
15306 #: ../fish/guestfish-actions.pod:4757 ../src/guestfs-actions.pod:7294
15311 #: ../fish/guestfish-actions.pod:4759 ../src/guestfs-actions.pod:7296
15312 msgid "32-bit big endian such as UCS-4BE."
15316 #: ../fish/guestfish-actions.pod:4761 ../src/guestfs-actions.pod:7298
15321 #: ../fish/guestfish-actions.pod:4763 ../src/guestfs-actions.pod:7300
15322 msgid "32-bit little endian such as UCS-4LE."
15326 #: ../fish/guestfish-actions.pod:4767 ../src/guestfs-actions.pod:7304
15327 msgid "The returned strings are transcoded to UTF-8."
15331 #: ../fish/guestfish-actions.pod:4772
15332 msgid "swapoff-device"
15336 #: ../fish/guestfish-actions.pod:4774
15339 " swapoff-device device\n"
15344 #: ../fish/guestfish-actions.pod:4776
15346 "This command disables the libguestfs appliance swap device or partition "
15347 "named C<device>. See L</swapon-device>."
15351 #: ../fish/guestfish-actions.pod:4780
15352 msgid "swapoff-file"
15356 #: ../fish/guestfish-actions.pod:4782
15359 " swapoff-file file\n"
15364 #: ../fish/guestfish-actions.pod:4784 ../src/guestfs-actions.pod:7335
15365 msgid "This command disables the libguestfs appliance swap on file."
15369 #: ../fish/guestfish-actions.pod:4786
15370 msgid "swapoff-label"
15374 #: ../fish/guestfish-actions.pod:4788
15377 " swapoff-label label\n"
15382 #: ../fish/guestfish-actions.pod:4790 ../src/guestfs-actions.pod:7347
15384 "This command disables the libguestfs appliance swap on labeled swap "
15389 #: ../fish/guestfish-actions.pod:4793
15390 msgid "swapoff-uuid"
15394 #: ../fish/guestfish-actions.pod:4795
15397 " swapoff-uuid uuid\n"
15402 #: ../fish/guestfish-actions.pod:4797 ../src/guestfs-actions.pod:7360
15404 "This command disables the libguestfs appliance swap partition with the given "
15409 #: ../fish/guestfish-actions.pod:4800
15410 msgid "swapon-device"
15414 #: ../fish/guestfish-actions.pod:4802
15417 " swapon-device device\n"
15422 #: ../fish/guestfish-actions.pod:4804
15424 "This command enables the libguestfs appliance to use the swap device or "
15425 "partition named C<device>. The increased memory is made available for all "
15426 "commands, for example those run using L</command> or L</sh>."
15430 #: ../fish/guestfish-actions.pod:4809 ../src/guestfs-actions.pod:7378
15432 "Note that you should not swap to existing guest swap partitions unless you "
15433 "know what you are doing. They may contain hibernation information, or other "
15434 "information that the guest doesn't want you to trash. You also risk leaking "
15435 "information about the host to the guest this way. Instead, attach a new "
15436 "host device to the guest and swap on that."
15440 #: ../fish/guestfish-actions.pod:4816
15441 msgid "swapon-file"
15445 #: ../fish/guestfish-actions.pod:4818
15448 " swapon-file file\n"
15453 #: ../fish/guestfish-actions.pod:4820
15454 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
15458 #: ../fish/guestfish-actions.pod:4823
15459 msgid "swapon-label"
15463 #: ../fish/guestfish-actions.pod:4825
15466 " swapon-label label\n"
15471 #: ../fish/guestfish-actions.pod:4827
15473 "This command enables swap to a labeled swap partition. See "
15474 "L</swapon-device> for other notes."
15478 #: ../fish/guestfish-actions.pod:4830
15479 msgid "swapon-uuid"
15483 #: ../fish/guestfish-actions.pod:4832
15486 " swapon-uuid uuid\n"
15491 #: ../fish/guestfish-actions.pod:4834
15493 "This command enables swap to a swap partition with the given UUID. See "
15494 "L</swapon-device> for other notes."
15498 #: ../fish/guestfish-actions.pod:4837
15503 #: ../fish/guestfish-actions.pod:4839
15511 #: ../fish/guestfish-actions.pod:4841 ../src/guestfs-actions.pod:7433
15513 "This syncs the disk, so that any writes are flushed through to the "
15514 "underlying disk image."
15518 #: ../fish/guestfish-actions.pod:4844 ../src/guestfs-actions.pod:7436
15520 "You should always call this if you have modified a disk image, before "
15521 "closing the handle."
15525 #: ../fish/guestfish-actions.pod:4847
15530 #: ../fish/guestfish-actions.pod:4849
15538 #: ../fish/guestfish-actions.pod:4851 ../src/guestfs-actions.pod:7449
15539 msgid "This command returns up to the last 10 lines of a file as a list of strings."
15543 #: ../fish/guestfish-actions.pod:4857
15548 #: ../fish/guestfish-actions.pod:4859
15551 " tail-n nrlines path\n"
15556 #: ../fish/guestfish-actions.pod:4861 ../src/guestfs-actions.pod:7468
15558 "If the parameter C<nrlines> is a positive number, this returns the last "
15559 "C<nrlines> lines of the file C<path>."
15563 #: ../fish/guestfish-actions.pod:4864 ../src/guestfs-actions.pod:7471
15565 "If the parameter C<nrlines> is a negative number, this returns lines from "
15566 "the file C<path>, starting with the C<-nrlines>th line."
15570 #: ../fish/guestfish-actions.pod:4872
15575 #: ../fish/guestfish-actions.pod:4874
15578 " tar-in (tarfile|-) directory\n"
15583 #: ../fish/guestfish-actions.pod:4876 ../src/guestfs-actions.pod:7492
15585 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
15586 "tar file) into C<directory>."
15590 #: ../fish/guestfish-actions.pod:4879
15591 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
15595 #: ../fish/guestfish-actions.pod:4884
15600 #: ../fish/guestfish-actions.pod:4886
15603 " tar-out directory (tarfile|-)\n"
15608 #: ../fish/guestfish-actions.pod:4888 ../src/guestfs-actions.pod:7509
15610 "This command packs the contents of C<directory> and downloads it to local "
15615 #: ../fish/guestfish-actions.pod:4891
15616 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
15620 #: ../fish/guestfish-actions.pod:4896
15625 #: ../fish/guestfish-actions.pod:4898
15628 " tgz-in (tarball|-) directory\n"
15633 #: ../fish/guestfish-actions.pod:4900 ../src/guestfs-actions.pod:7526
15635 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
15636 "tar file) into C<directory>."
15640 #: ../fish/guestfish-actions.pod:4903
15641 msgid "To upload an uncompressed tarball, use L</tar-in>."
15645 #: ../fish/guestfish-actions.pod:4907
15650 #: ../fish/guestfish-actions.pod:4909
15653 " tgz-out directory (tarball|-)\n"
15658 #: ../fish/guestfish-actions.pod:4911 ../src/guestfs-actions.pod:7542
15660 "This command packs the contents of C<directory> and downloads it to local "
15665 #: ../fish/guestfish-actions.pod:4914
15666 msgid "To download an uncompressed tarball, use L</tar-out>."
15670 #: ../fish/guestfish-actions.pod:4918
15675 #: ../fish/guestfish-actions.pod:4920
15683 #: ../fish/guestfish-actions.pod:4922 ../src/guestfs-actions.pod:7557
15685 "Touch acts like the L<touch(1)> command. It can be used to update the "
15686 "timestamps on a file, or, if the file does not exist, to create a new "
15687 "zero-length file."
15691 #: ../fish/guestfish-actions.pod:4926 ../src/guestfs-actions.pod:7561
15693 "This command only works on regular files, and will fail on other file types "
15694 "such as directories, symbolic links, block special etc."
15698 #: ../fish/guestfish-actions.pod:4929
15703 #: ../fish/guestfish-actions.pod:4931
15711 #: ../fish/guestfish-actions.pod:4933 ../src/guestfs-actions.pod:7574
15713 "This command truncates C<path> to a zero-length file. The file must exist "
15718 #: ../fish/guestfish-actions.pod:4936
15719 msgid "truncate-size"
15723 #: ../fish/guestfish-actions.pod:4938
15726 " truncate-size path size\n"
15731 #: ../fish/guestfish-actions.pod:4940 ../src/guestfs-actions.pod:7588
15733 "This command truncates C<path> to size C<size> bytes. The file must exist "
15738 #: ../fish/guestfish-actions.pod:4943
15740 "If the current file size is less than C<size> then the file is extended to "
15741 "the required size with zero bytes. This creates a sparse file (ie. disk "
15742 "blocks are not allocated for the file until you write to it). To create a "
15743 "non-sparse file of zeroes, use L</fallocate64> instead."
15747 #: ../fish/guestfish-actions.pod:4949
15752 #: ../fish/guestfish-actions.pod:4951
15755 " tune2fs-l device\n"
15760 #: ../fish/guestfish-actions.pod:4953 ../src/guestfs-actions.pod:7607
15762 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15767 #: ../fish/guestfish-actions.pod:4956 ../src/guestfs-actions.pod:7610
15769 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15770 "for more details. The list of fields returned isn't clearly defined, and "
15771 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15772 "and the filesystem itself."
15776 #: ../fish/guestfish-actions.pod:4961
15781 #: ../fish/guestfish-actions.pod:4963
15784 " txz-in (tarball|-) directory\n"
15789 #: ../fish/guestfish-actions.pod:4965 ../src/guestfs-actions.pod:7630
15791 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15792 "tar file) into C<directory>."
15796 #: ../fish/guestfish-actions.pod:4970
15801 #: ../fish/guestfish-actions.pod:4972
15804 " txz-out directory (tarball|-)\n"
15809 #: ../fish/guestfish-actions.pod:4974 ../src/guestfs-actions.pod:7644
15811 "This command packs the contents of C<directory> and downloads it to local "
15812 "file C<tarball> (as an xz compressed tar archive)."
15816 #: ../fish/guestfish-actions.pod:4979
15821 #: ../fish/guestfish-actions.pod:4981
15829 #: ../fish/guestfish-actions.pod:4983 ../src/guestfs-actions.pod:7657
15831 "This function sets the mask used for creating new files and device nodes to "
15836 #: ../fish/guestfish-actions.pod:4986 ../src/guestfs-actions.pod:7660
15838 "Typical umask values would be C<022> which creates new files with "
15839 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15840 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15844 #: ../fish/guestfish-actions.pod:4991 ../src/guestfs-actions.pod:7665
15846 "The default umask is C<022>. This is important because it means that "
15847 "directories and device nodes will be created with C<0644> or C<0755> mode "
15848 "even if you specify C<0777>."
15852 #: ../fish/guestfish-actions.pod:4995
15853 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
15857 #: ../fish/guestfish-actions.pod:4998 ../src/guestfs-actions.pod:7672
15858 msgid "This call returns the previous umask."
15862 #: ../fish/guestfish-actions.pod:5000
15867 #: ../fish/guestfish-actions.pod:5002
15872 #: ../fish/guestfish-actions.pod:5004
15875 " umount pathordevice\n"
15880 #: ../fish/guestfish-actions.pod:5006 ../src/guestfs-actions.pod:7684
15882 "This unmounts the given filesystem. The filesystem may be specified either "
15883 "by its mountpoint (path) or the device which contains the filesystem."
15887 #: ../fish/guestfish-actions.pod:5010
15892 #: ../fish/guestfish-actions.pod:5012
15893 msgid "unmount-all"
15897 #: ../fish/guestfish-actions.pod:5014
15905 #: ../fish/guestfish-actions.pod:5016 ../src/guestfs-actions.pod:7697
15906 msgid "This unmounts all mounted filesystems."
15910 #: ../fish/guestfish-actions.pod:5018 ../src/guestfs-actions.pod:7699
15911 msgid "Some internal mounts are not unmounted by this call."
15915 #: ../fish/guestfish-actions.pod:5020
15920 #: ../fish/guestfish-actions.pod:5022
15923 " upload (filename|-) remotefilename\n"
15928 #: ../fish/guestfish-actions.pod:5024 ../fish/guestfish-actions.pod:5037 ../src/guestfs-actions.pod:7712 ../src/guestfs-actions.pod:7736
15929 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15933 #: ../fish/guestfish-actions.pod:5029
15934 msgid "See also L</download>."
15938 #: ../fish/guestfish-actions.pod:5033
15939 msgid "upload-offset"
15943 #: ../fish/guestfish-actions.pod:5035
15946 " upload-offset (filename|-) remotefilename offset\n"
15951 #: ../fish/guestfish-actions.pod:5040 ../src/guestfs-actions.pod:7739
15953 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15954 "The intention is to overwrite parts of existing files or devices, although "
15955 "if a non-existant file is specified then it is created with a \"hole\" "
15956 "before C<offset>. The size of the data written is implicit in the size of "
15957 "the source C<filename>."
15961 #: ../fish/guestfish-actions.pod:5047
15963 "Note that there is no limit on the amount of data that can be uploaded with "
15964 "this call, unlike with L</pwrite>, and this call always writes the full "
15965 "amount unless an error occurs."
15969 #: ../fish/guestfish-actions.pod:5052
15970 msgid "See also L</upload>, L</pwrite>."
15974 #: ../fish/guestfish-actions.pod:5056
15979 #: ../fish/guestfish-actions.pod:5058
15982 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
15987 #: ../fish/guestfish-actions.pod:5060 ../src/guestfs-actions.pod:7772
15988 msgid "This command sets the timestamps of a file with nanosecond precision."
15992 #: ../fish/guestfish-actions.pod:5063 ../src/guestfs-actions.pod:7775
15994 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15999 #: ../fish/guestfish-actions.pod:5066 ../src/guestfs-actions.pod:7778
16001 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
16002 "nanoseconds from the epoch."
16006 #: ../fish/guestfish-actions.pod:5069 ../src/guestfs-actions.pod:7781
16008 "If the C<*nsecs> field contains the special value C<-1> then the "
16009 "corresponding timestamp is set to the current time. (The C<*secs> field is "
16010 "ignored in this case)."
16014 #: ../fish/guestfish-actions.pod:5073 ../src/guestfs-actions.pod:7785
16016 "If the C<*nsecs> field contains the special value C<-2> then the "
16017 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
16022 #: ../fish/guestfish-actions.pod:5077
16027 #: ../fish/guestfish-actions.pod:5079
16035 #: ../fish/guestfish-actions.pod:5081 ../src/guestfs-actions.pod:7798
16036 msgid "Return the libguestfs version number that the program is linked against."
16040 #: ../fish/guestfish-actions.pod:5084 ../src/guestfs-actions.pod:7801
16042 "Note that because of dynamic linking this is not necessarily the version of "
16043 "libguestfs that you compiled against. You can compile the program, and then "
16044 "at runtime dynamically link against a completely different C<libguestfs.so> "
16049 #: ../fish/guestfish-actions.pod:5089 ../src/guestfs-actions.pod:7806
16051 "This call was added in version C<1.0.58>. In previous versions of "
16052 "libguestfs there was no way to get the version number. From C code you can "
16053 "use dynamic linker functions to find out if this symbol exists (if it "
16054 "doesn't, then it's an earlier version)."
16058 #: ../fish/guestfish-actions.pod:5095 ../src/guestfs-actions.pod:7812
16060 "The call returns a structure with four elements. The first three (C<major>, "
16061 "C<minor> and C<release>) are numbers and correspond to the usual version "
16062 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
16063 "but may be used for distro-specific information."
16067 #: ../fish/guestfish-actions.pod:5101 ../src/guestfs-actions.pod:7818
16068 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
16072 #: ../fish/guestfish-actions.pod:5104 ../src/guestfs-actions.pod:7821
16073 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
16077 #: ../fish/guestfish-actions.pod:5106
16079 "I<Note:> Don't use this call to test for availability of features. In "
16080 "enterprise distributions we backport features from later versions into "
16081 "earlier versions, making this an unreliable way to test for features. Use "
16082 "L</available> instead."
16086 #: ../fish/guestfish-actions.pod:5112
16091 #: ../fish/guestfish-actions.pod:5114
16094 " vfs-label device\n"
16099 #: ../fish/guestfish-actions.pod:5116 ../src/guestfs-actions.pod:7841
16100 msgid "This returns the filesystem label of the filesystem on C<device>."
16104 #: ../fish/guestfish-actions.pod:5119 ../src/guestfs-actions.pod:7844
16105 msgid "If the filesystem is unlabeled, this returns the empty string."
16109 #: ../fish/guestfish-actions.pod:5121
16110 msgid "To find a filesystem from the label, use L</findfs-label>."
16114 #: ../fish/guestfish-actions.pod:5123
16119 #: ../fish/guestfish-actions.pod:5125
16122 " vfs-type device\n"
16127 #: ../fish/guestfish-actions.pod:5127 ../src/guestfs-actions.pod:7859
16129 "This command gets the filesystem type corresponding to the filesystem on "
16134 #: ../fish/guestfish-actions.pod:5130 ../src/guestfs-actions.pod:7862
16136 "For most filesystems, the result is the name of the Linux VFS module which "
16137 "would be used to mount this filesystem if you mounted it without specifying "
16138 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
16142 #: ../fish/guestfish-actions.pod:5135
16147 #: ../fish/guestfish-actions.pod:5137
16150 " vfs-uuid device\n"
16155 #: ../fish/guestfish-actions.pod:5139 ../src/guestfs-actions.pod:7878
16156 msgid "This returns the filesystem UUID of the filesystem on C<device>."
16160 #: ../fish/guestfish-actions.pod:5142 ../src/guestfs-actions.pod:7881
16161 msgid "If the filesystem does not have a UUID, this returns the empty string."
16165 #: ../fish/guestfish-actions.pod:5144
16166 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
16170 #: ../fish/guestfish-actions.pod:5146
16171 msgid "vg-activate"
16175 #: ../fish/guestfish-actions.pod:5148
16178 " vg-activate true|false 'volgroups ...'\n"
16183 #: ../fish/guestfish-actions.pod:5150 ../src/guestfs-actions.pod:7897
16185 "This command activates or (if C<activate> is false) deactivates all logical "
16186 "volumes in the listed volume groups C<volgroups>."
16190 #: ../fish/guestfish-actions.pod:5153 ../src/guestfs-actions.pod:7900
16191 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
16195 #: ../fish/guestfish-actions.pod:5155 ../src/guestfs-actions.pod:7902
16197 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
16198 "activated or deactivated."
16202 #: ../fish/guestfish-actions.pod:5158
16203 msgid "vg-activate-all"
16207 #: ../fish/guestfish-actions.pod:5160
16210 " vg-activate-all true|false\n"
16215 #: ../fish/guestfish-actions.pod:5162 ../src/guestfs-actions.pod:7915
16217 "This command activates or (if C<activate> is false) deactivates all logical "
16218 "volumes in all volume groups."
16222 #: ../fish/guestfish-actions.pod:5165 ../src/guestfs-actions.pod:7918
16223 msgid "This command is the same as running C<vgchange -a y|n>"
16227 #: ../fish/guestfish-actions.pod:5167
16232 #: ../fish/guestfish-actions.pod:5169
16235 " vgcreate volgroup 'physvols ...'\n"
16240 #: ../fish/guestfish-actions.pod:5171 ../src/guestfs-actions.pod:7931
16242 "This creates an LVM volume group called C<volgroup> from the non-empty list "
16243 "of physical volumes C<physvols>."
16247 #: ../fish/guestfish-actions.pod:5174
16252 #: ../fish/guestfish-actions.pod:5176
16255 " vglvuuids vgname\n"
16260 #: ../fish/guestfish-actions.pod:5178 ../src/guestfs-actions.pod:7944
16262 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
16263 "volumes created in this volume group."
16267 #: ../fish/guestfish-actions.pod:5181
16269 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
16270 "logical volumes and volume groups."
16274 #: ../fish/guestfish-actions.pod:5184
16275 msgid "See also L</vgpvuuids>."
16279 #: ../fish/guestfish-actions.pod:5186
16284 #: ../fish/guestfish-actions.pod:5188
16287 " vgpvuuids vgname\n"
16292 #: ../fish/guestfish-actions.pod:5190 ../src/guestfs-actions.pod:7964
16294 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
16295 "volumes that this volume group resides on."
16299 #: ../fish/guestfish-actions.pod:5193
16301 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
16302 "physical volumes and volume groups."
16306 #: ../fish/guestfish-actions.pod:5196
16307 msgid "See also L</vglvuuids>."
16311 #: ../fish/guestfish-actions.pod:5198
16316 #: ../fish/guestfish-actions.pod:5200
16319 " vgremove vgname\n"
16324 #: ../fish/guestfish-actions.pod:5202 ../src/guestfs-actions.pod:7984
16325 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
16329 #: ../fish/guestfish-actions.pod:5204 ../src/guestfs-actions.pod:7986
16330 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
16334 #: ../fish/guestfish-actions.pod:5207
16339 #: ../fish/guestfish-actions.pod:5209
16342 " vgrename volgroup newvolgroup\n"
16347 #: ../fish/guestfish-actions.pod:5211 ../src/guestfs-actions.pod:8000
16348 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
16352 #: ../fish/guestfish-actions.pod:5213
16357 #: ../fish/guestfish-actions.pod:5215
16365 #: ../fish/guestfish-actions.pod:5217 ../src/guestfs-actions.pod:8011
16367 "List all the volumes groups detected. This is the equivalent of the "
16368 "L<vgs(8)> command."
16372 #: ../fish/guestfish-actions.pod:5220 ../src/guestfs-actions.pod:8014
16374 "This returns a list of just the volume group names that were detected "
16375 "(eg. C<VolGroup00>)."
16379 #: ../fish/guestfish-actions.pod:5223
16380 msgid "See also L</vgs-full>."
16384 #: ../fish/guestfish-actions.pod:5225
16389 #: ../fish/guestfish-actions.pod:5227
16397 #: ../fish/guestfish-actions.pod:5229 ../src/guestfs-actions.pod:8030
16399 "List all the volumes groups detected. This is the equivalent of the "
16400 "L<vgs(8)> command. The \"full\" version includes all fields."
16404 #: ../fish/guestfish-actions.pod:5232
16409 #: ../fish/guestfish-actions.pod:5234
16417 #: ../fish/guestfish-actions.pod:5236 ../src/guestfs-actions.pod:8044
16419 "This rescans all block devices and rebuilds the list of LVM physical "
16420 "volumes, volume groups and logical volumes."
16424 #: ../fish/guestfish-actions.pod:5239
16429 #: ../fish/guestfish-actions.pod:5241
16437 #: ../fish/guestfish-actions.pod:5243 ../src/guestfs-actions.pod:8057
16438 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16442 #: ../fish/guestfish-actions.pod:5245
16447 #: ../fish/guestfish-actions.pod:5247
16455 #: ../fish/guestfish-actions.pod:5249 ../src/guestfs-actions.pod:8097
16457 "This command counts the characters in a file, using the C<wc -c> external "
16462 #: ../fish/guestfish-actions.pod:5252
16467 #: ../fish/guestfish-actions.pod:5254
16475 #: ../fish/guestfish-actions.pod:5256 ../src/guestfs-actions.pod:8110
16477 "This command counts the lines in a file, using the C<wc -l> external "
16482 #: ../fish/guestfish-actions.pod:5259
16487 #: ../fish/guestfish-actions.pod:5261
16495 #: ../fish/guestfish-actions.pod:5263 ../src/guestfs-actions.pod:8123
16497 "This command counts the words in a file, using the C<wc -w> external "
16502 #: ../fish/guestfish-actions.pod:5266
16507 #: ../fish/guestfish-actions.pod:5268
16510 " write path content\n"
16515 #: ../fish/guestfish-actions.pod:5270 ../src/guestfs-actions.pod:8138
16517 "This call creates a file called C<path>. The content of the file is the "
16518 "string C<content> (which can contain any 8 bit data)."
16522 #: ../fish/guestfish-actions.pod:5273
16523 msgid "See also L</write-append>."
16527 #: ../fish/guestfish-actions.pod:5278
16528 msgid "write-append"
16532 #: ../fish/guestfish-actions.pod:5280
16535 " write-append path content\n"
16540 #: ../fish/guestfish-actions.pod:5282 ../src/guestfs-actions.pod:8158
16542 "This call appends C<content> to the end of file C<path>. If C<path> does "
16543 "not exist, then a new file is created."
16547 #: ../fish/guestfish-actions.pod:5285
16548 msgid "See also L</write>."
16552 #: ../fish/guestfish-actions.pod:5290
16557 #: ../fish/guestfish-actions.pod:5292
16560 " write-file path content size\n"
16565 #: ../fish/guestfish-actions.pod:5294 ../src/guestfs-actions.pod:8185
16567 "This call creates a file called C<path>. The contents of the file is the "
16568 "string C<content> (which can contain any 8 bit data), with length C<size>."
16572 #: ../fish/guestfish-actions.pod:5298 ../src/guestfs-actions.pod:8189
16574 "As a special case, if C<size> is C<0> then the length is calculated using "
16575 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16579 #: ../fish/guestfish-actions.pod:5302 ../src/guestfs-actions.pod:8193
16581 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16582 "I<not> work, even if the length is specified."
16586 #: ../fish/guestfish-actions.pod:5308
16587 msgid "I<This function is deprecated.> In new code, use the L</write> call instead."
16591 #: ../fish/guestfish-actions.pod:5315
16596 #: ../fish/guestfish-actions.pod:5317
16599 " zegrep regex path\n"
16604 #: ../fish/guestfish-actions.pod:5319 ../src/guestfs-actions.pod:8210
16605 msgid "This calls the external C<zegrep> program and returns the matching lines."
16609 #: ../fish/guestfish-actions.pod:5325
16614 #: ../fish/guestfish-actions.pod:5327
16617 " zegrepi regex path\n"
16622 #: ../fish/guestfish-actions.pod:5329 ../src/guestfs-actions.pod:8229
16623 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
16627 #: ../fish/guestfish-actions.pod:5335
16632 #: ../fish/guestfish-actions.pod:5337
16640 #: ../fish/guestfish-actions.pod:5339 ../src/guestfs-actions.pod:8247
16641 msgid "This command writes zeroes over the first few blocks of C<device>."
16645 #: ../fish/guestfish-actions.pod:5341 ../src/guestfs-actions.pod:8249
16647 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16648 "securely wipe the device). It should be sufficient to remove any partition "
16649 "tables, filesystem superblocks and so on."
16653 #: ../fish/guestfish-actions.pod:5345 ../fish/guestfish-actions.pod:5360 ../src/guestfs-actions.pod:8253 ../src/guestfs-actions.pod:8279
16655 "If blocks are already zero, then this command avoids writing zeroes. This "
16656 "prevents the underlying device from becoming non-sparse or growing "
16661 #: ../fish/guestfish-actions.pod:5349
16662 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
16666 #: ../fish/guestfish-actions.pod:5352
16667 msgid "zero-device"
16671 #: ../fish/guestfish-actions.pod:5354
16674 " zero-device device\n"
16679 #: ../fish/guestfish-actions.pod:5356
16681 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
16682 "which just zeroes the first few blocks of a device."
16686 #: ../fish/guestfish-actions.pod:5367
16691 #: ../fish/guestfish-actions.pod:5369
16694 " zerofree device\n"
16699 #: ../fish/guestfish-actions.pod:5371 ../src/guestfs-actions.pod:8301
16701 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16702 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16703 "possible to compress the filesystem more effectively."
16707 #: ../fish/guestfish-actions.pod:5376 ../src/guestfs-actions.pod:8306
16708 msgid "You should B<not> run this program if the filesystem is mounted."
16712 #: ../fish/guestfish-actions.pod:5379 ../src/guestfs-actions.pod:8309
16714 "It is possible that using this program can damage the filesystem or data on "
16719 #: ../fish/guestfish-actions.pod:5382
16724 #: ../fish/guestfish-actions.pod:5384
16727 " zfgrep pattern path\n"
16732 #: ../fish/guestfish-actions.pod:5386 ../src/guestfs-actions.pod:8323
16733 msgid "This calls the external C<zfgrep> program and returns the matching lines."
16737 #: ../fish/guestfish-actions.pod:5392
16742 #: ../fish/guestfish-actions.pod:5394
16745 " zfgrepi pattern path\n"
16750 #: ../fish/guestfish-actions.pod:5396 ../src/guestfs-actions.pod:8342
16751 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
16755 #: ../fish/guestfish-actions.pod:5402
16760 #: ../fish/guestfish-actions.pod:5404
16763 " zfile meth path\n"
16768 #: ../fish/guestfish-actions.pod:5406 ../src/guestfs-actions.pod:8368
16769 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
16773 #: ../fish/guestfish-actions.pod:5409 ../src/guestfs-actions.pod:8371
16774 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16778 #: ../fish/guestfish-actions.pod:5411
16779 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
16783 #: ../fish/guestfish-actions.pod:5414
16784 msgid "I<This function is deprecated.> In new code, use the L</file> call instead."
16788 #: ../fish/guestfish-actions.pod:5421
16793 #: ../fish/guestfish-actions.pod:5423
16796 " zgrep regex path\n"
16801 #: ../fish/guestfish-actions.pod:5425 ../src/guestfs-actions.pod:8388
16802 msgid "This calls the external C<zgrep> program and returns the matching lines."
16806 #: ../fish/guestfish-actions.pod:5431
16811 #: ../fish/guestfish-actions.pod:5433
16814 " zgrepi regex path\n"
16819 #: ../fish/guestfish-actions.pod:5435 ../src/guestfs-actions.pod:8407
16820 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
16824 #: ../fish/guestfish-commands.pod:1
16829 #: ../fish/guestfish-commands.pod:3
16834 #: ../fish/guestfish-commands.pod:5
16837 " alloc filename size\n"
16842 #: ../fish/guestfish-commands.pod:7
16844 "This creates an empty (zeroed) file of the given size, and then adds so it "
16845 "can be further examined."
16849 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
16850 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
16854 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
16855 msgid "Size can be specified using standard suffixes, eg. C<1M>."
16859 #: ../fish/guestfish-commands.pod:14
16861 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
16862 "image, see L</PREPARED DISK IMAGES>."
16866 #: ../fish/guestfish-commands.pod:17
16871 #: ../fish/guestfish-commands.pod:19
16874 " copy-in local [local ...] /remotedir\n"
16879 #: ../fish/guestfish-commands.pod:21
16881 "C<copy-in> copies local files or directories recursively into the disk "
16882 "image, placing them in the directory called C</remotedir> (which must "
16883 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
16884 "other commands as necessary."
16888 #: ../fish/guestfish-commands.pod:26
16890 "Multiple local files and directories can be specified, but the last "
16891 "parameter must always be a remote directory. Wildcards cannot be used."
16895 #: ../fish/guestfish-commands.pod:30
16900 #: ../fish/guestfish-commands.pod:32
16903 " copy-out remote [remote ...] localdir\n"
16908 #: ../fish/guestfish-commands.pod:34
16910 "C<copy-out> copies remote files or directories recursively out of the disk "
16911 "image, placing them on the host disk in a local directory called C<localdir> "
16912 "(which must exist). This guestfish meta-command turns into a sequence of "
16913 "L</download>, L</tar-out> and other commands as necessary."
16917 #: ../fish/guestfish-commands.pod:40
16919 "Multiple remote files and directories can be specified, but the last "
16920 "parameter must always be a local directory. To download to the current "
16921 "directory, use C<.> as in:"
16925 #: ../fish/guestfish-commands.pod:44
16928 " copy-out /home .\n"
16933 #: ../fish/guestfish-commands.pod:46
16935 "Wildcards cannot be used in the ordinary command, but you can use them with "
16936 "the help of L</glob> like this:"
16940 #: ../fish/guestfish-commands.pod:49
16943 " glob copy-out /home/* .\n"
16948 #: ../fish/guestfish-commands.pod:51
16953 #: ../fish/guestfish-commands.pod:53
16956 " display filename\n"
16961 #: ../fish/guestfish-commands.pod:55
16963 "Use C<display> (a graphical display program) to display an image file. It "
16964 "downloads the file, and runs C<display> on it."
16968 #: ../fish/guestfish-commands.pod:58
16970 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
16971 "environment variable. For example to use the GNOME display program:"
16975 #: ../fish/guestfish-commands.pod:61
16978 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
16983 #: ../fish/guestfish-commands.pod:63
16984 msgid "See also L<display(1)>."
16988 #: ../fish/guestfish-commands.pod:65
16993 #: ../fish/guestfish-commands.pod:67
16996 " echo [params ...]\n"
17001 #: ../fish/guestfish-commands.pod:69
17002 msgid "This echos the parameters to the terminal."
17006 #: ../fish/guestfish-commands.pod:71
17011 #: ../fish/guestfish-commands.pod:73
17016 #: ../fish/guestfish-commands.pod:75
17021 #: ../fish/guestfish-commands.pod:77
17029 #: ../fish/guestfish-commands.pod:79
17031 "This is used to edit a file. It downloads the file, edits it locally using "
17032 "your editor, then uploads the result."
17036 #: ../fish/guestfish-commands.pod:82
17038 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
17039 "or C<emacs> you will get those corresponding editors."
17043 #: ../fish/guestfish-commands.pod:86
17048 #: ../fish/guestfish-commands.pod:88
17051 " glob command args...\n"
17056 #: ../fish/guestfish-commands.pod:90
17058 "Expand wildcards in any paths in the args list, and run C<command> "
17059 "repeatedly on each matching path."
17063 #: ../fish/guestfish-commands.pod:93
17064 msgid "See L</WILDCARDS AND GLOBBING>."
17068 #: ../fish/guestfish-commands.pod:95
17073 #: ../fish/guestfish-commands.pod:97
17076 " hexedit <filename|device>\n"
17077 " hexedit <filename|device> <max>\n"
17078 " hexedit <filename|device> <start> <max>\n"
17083 #: ../fish/guestfish-commands.pod:101
17085 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
17090 #: ../fish/guestfish-commands.pod:104
17092 "This command works by downloading potentially the whole file or device, "
17093 "editing it locally, then uploading it. If the file or device is large, you "
17094 "have to specify which part you wish to edit by using C<max> and/or C<start> "
17095 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
17096 "usual modifiers allowed such as C<1M> (1 megabyte)."
17100 #: ../fish/guestfish-commands.pod:111
17101 msgid "For example to edit the first few sectors of a disk you might do:"
17105 #: ../fish/guestfish-commands.pod:114
17108 " hexedit /dev/sda 1M\n"
17113 #: ../fish/guestfish-commands.pod:116
17115 "which would allow you to edit anywhere within the first megabyte of the "
17120 #: ../fish/guestfish-commands.pod:119
17121 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
17125 #: ../fish/guestfish-commands.pod:121
17128 " hexedit /dev/sda1 0x400 0x400\n"
17133 #: ../fish/guestfish-commands.pod:123
17134 msgid "(assuming the superblock is in the standard location)."
17138 #: ../fish/guestfish-commands.pod:125
17140 "This command requires the external L<hexedit(1)> program. You can specify "
17141 "another program to use by setting the C<HEXEDITOR> environment variable."
17145 #: ../fish/guestfish-commands.pod:129
17146 msgid "See also L</hexdump>."
17150 #: ../fish/guestfish-commands.pod:131
17155 #: ../fish/guestfish-commands.pod:133
17163 #: ../fish/guestfish-commands.pod:135
17164 msgid "Change the local directory, ie. the current directory of guestfish itself."
17168 #: ../fish/guestfish-commands.pod:138
17169 msgid "Note that C<!cd> won't do what you might expect."
17173 #: ../fish/guestfish-commands.pod:140
17178 #: ../fish/guestfish-commands.pod:142
17183 #: ../fish/guestfish-commands.pod:144
17191 #: ../fish/guestfish-commands.pod:146
17192 msgid "Opens the manual page for guestfish."
17196 #: ../fish/guestfish-commands.pod:148
17201 #: ../fish/guestfish-commands.pod:150
17206 #: ../fish/guestfish-commands.pod:152
17214 #: ../fish/guestfish-commands.pod:154
17222 #: ../fish/guestfish-commands.pod:156
17223 msgid "This is used to view a file."
17227 #: ../fish/guestfish-commands.pod:158
17229 "The default viewer is C<$PAGER>. However if you use the alternate command "
17230 "C<less> you will get the C<less> command specifically."
17234 #: ../fish/guestfish-commands.pod:161
17239 #: ../fish/guestfish-commands.pod:163
17247 #: ../fish/guestfish-commands.pod:165
17249 "Close and reopen the libguestfs handle. It is not necessary to use this "
17250 "normally, because the handle is closed properly when guestfish exits. "
17251 "However this is occasionally useful for testing."
17255 #: ../fish/guestfish-commands.pod:169
17260 #: ../fish/guestfish-commands.pod:171
17263 " setenv VAR value\n"
17268 #: ../fish/guestfish-commands.pod:173
17269 msgid "Set the environment variable C<VAR> to the string C<value>."
17273 #: ../fish/guestfish-commands.pod:175
17274 msgid "To print the value of an environment variable use a shell command such as:"
17278 #: ../fish/guestfish-commands.pod:178
17286 #: ../fish/guestfish-commands.pod:180
17291 #: ../fish/guestfish-commands.pod:182
17294 " sparse filename size\n"
17299 #: ../fish/guestfish-commands.pod:184
17301 "This creates an empty sparse file of the given size, and then adds so it can "
17302 "be further examined."
17306 #: ../fish/guestfish-commands.pod:187
17308 "In all respects it works the same as the L</alloc> command, except that the "
17309 "image file is allocated sparsely, which means that disk blocks are not "
17310 "assigned to the file until they are needed. Sparse disk files only use "
17311 "space when written to, but they are slower and there is a danger you could "
17312 "run out of real disk space during a write operation."
17316 #: ../fish/guestfish-commands.pod:197
17321 #: ../fish/guestfish-commands.pod:199
17329 #: ../fish/guestfish-commands.pod:201
17331 "This command returns a list of the optional groups known to the daemon, and "
17332 "indicates which ones are supported by this build of the libguestfs "
17337 #: ../fish/guestfish-commands.pod:205
17338 msgid "See also L<guestfs(3)/AVAILABILITY>."
17342 #: ../fish/guestfish-commands.pod:207
17347 #: ../fish/guestfish-commands.pod:209
17350 " time command args...\n"
17355 #: ../fish/guestfish-commands.pod:211
17357 "Run the command as usual, but print the elapsed time afterwards. This can "
17358 "be useful for benchmarking operations."
17362 #: ../fish/guestfish-commands.pod:214
17367 #: ../fish/guestfish-commands.pod:216
17375 #: ../fish/guestfish-commands.pod:218
17376 msgid "Remove C<VAR> from the environment."
17380 #: ../fish/guestfish.pod:5
17381 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17385 #: ../fish/guestfish.pod:9
17388 " guestfish [--options] [commands]\n"
17393 #: ../fish/guestfish.pod:11
17401 #: ../fish/guestfish.pod:13
17404 " guestfish [--ro|--rw] -a disk.img\n"
17409 #: ../fish/guestfish.pod:15
17412 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17417 #: ../fish/guestfish.pod:17
17420 " guestfish -d libvirt-domain\n"
17425 #: ../fish/guestfish.pod:19
17428 " guestfish [--ro|--rw] -a disk.img -i\n"
17433 #: ../fish/guestfish.pod:21
17436 " guestfish -d libvirt-domain -i\n"
17441 #: ../fish/guestfish.pod:25
17443 "Using guestfish in read/write mode on live virtual machines can be "
17444 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17445 "option to use guestfish safely if the disk image or virtual machine might be "
17450 #: ../fish/guestfish.pod:32
17452 "Guestfish is a shell and command-line tool for examining and modifying "
17453 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17454 "functionality of the guestfs API, see L<guestfs(3)>."
17458 #: ../fish/guestfish.pod:36
17460 "Guestfish gives you structured access to the libguestfs API, from shell "
17461 "scripts or the command line or interactively. If you want to rescue a "
17462 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17467 #: ../fish/guestfish.pod:43
17468 msgid "As an interactive shell"
17472 #: ../fish/guestfish.pod:45
17480 #: ../fish/guestfish.pod:47
17483 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17484 " editing virtual machine filesystems.\n"
17489 #: ../fish/guestfish.pod:50
17492 " Type: 'help' for a list of commands\n"
17493 " 'man' to read the manual\n"
17494 " 'quit' to quit the shell\n"
17499 #: ../fish/guestfish.pod:54
17502 " ><fs> add-ro disk.img\n"
17504 " ><fs> list-filesystems\n"
17505 " /dev/sda1: ext4\n"
17506 " /dev/vg_guest/lv_root: ext4\n"
17507 " /dev/vg_guest/lv_swap: swap\n"
17508 " ><fs> mount /dev/vg_guest/lv_root /\n"
17509 " ><fs> cat /etc/fstab\n"
17511 " # Created by anaconda\n"
17518 #: ../fish/guestfish.pod:67
17519 msgid "From shell scripts"
17523 #: ../fish/guestfish.pod:69
17524 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17528 #: ../fish/guestfish.pod:71
17531 " guestfish <<_EOF_\n"
17534 " mount /dev/vg_guest/lv_root /\n"
17535 " write /etc/motd \"Welcome, new users\"\n"
17541 #: ../fish/guestfish.pod:78
17542 msgid "List the LVM logical volumes in a disk image:"
17546 #: ../fish/guestfish.pod:80
17549 " guestfish -a disk.img --ro <<_EOF_\n"
17557 #: ../fish/guestfish.pod:85
17558 msgid "List all the filesystems in a disk image:"
17562 #: ../fish/guestfish.pod:87
17565 " guestfish -a disk.img --ro <<_EOF_\n"
17567 " list-filesystems\n"
17573 #: ../fish/guestfish.pod:92
17574 msgid "On one command line"
17578 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
17579 msgid "Update C</etc/resolv.conf> in a guest:"
17583 #: ../fish/guestfish.pod:96
17587 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17588 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17593 #: ../fish/guestfish.pod:100
17594 msgid "Edit C</boot/grub/grub.conf> interactively:"
17598 #: ../fish/guestfish.pod:102
17601 " guestfish --rw --add disk.img \\\n"
17602 " --mount /dev/vg_guest/lv_root \\\n"
17603 " --mount /dev/sda1:/boot \\\n"
17604 " edit /boot/grub/grub.conf\n"
17609 #: ../fish/guestfish.pod:107
17610 msgid "Mount disks automatically"
17614 #: ../fish/guestfish.pod:109
17616 "Use the I<-i> option to automatically mount the disks from a virtual "
17621 #: ../fish/guestfish.pod:112
17624 " guestfish --ro -a disk.img -i cat /etc/group\n"
17629 #: ../fish/guestfish.pod:114
17632 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17637 #: ../fish/guestfish.pod:116
17638 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17642 #: ../fish/guestfish.pod:118
17645 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17650 #: ../fish/guestfish.pod:120
17651 msgid "As a script interpreter"
17655 #: ../fish/guestfish.pod:122
17656 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17660 #: ../fish/guestfish.pod:124
17663 " #!/usr/bin/guestfish -f\n"
17664 " sparse test1.img 100M\n"
17666 " part-disk /dev/sda mbr\n"
17667 " mkfs ext2 /dev/sda1\n"
17672 #: ../fish/guestfish.pod:130
17673 msgid "Start with a prepared disk"
17677 #: ../fish/guestfish.pod:132
17679 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17680 "single ext2-formatted partition:"
17684 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2243
17687 " guestfish -N fs\n"
17692 #: ../fish/guestfish.pod:137
17693 msgid "To list what is available do:"
17697 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
17700 " guestfish -N help | less\n"
17705 #: ../fish/guestfish.pod:141
17706 msgid "Remote control"
17710 #: ../fish/guestfish.pod:143
17713 " eval \"`guestfish --listen`\"\n"
17714 " guestfish --remote add-ro disk.img\n"
17715 " guestfish --remote run\n"
17716 " guestfish --remote lvs\n"
17721 #: ../fish/guestfish.pod:154
17722 msgid "Displays general help on options."
17726 #: ../fish/guestfish.pod:158
17727 msgid "B<--cmd-help>"
17731 #: ../fish/guestfish.pod:160
17732 msgid "Lists all available guestfish commands."
17736 #: ../fish/guestfish.pod:162
17741 #: ../fish/guestfish.pod:164
17742 msgid "B<--cmd-help cmd>"
17746 #: ../fish/guestfish.pod:166
17747 msgid "Displays detailed help on a single command C<cmd>."
17751 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
17752 msgid "B<-a image>"
17756 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
17757 msgid "B<--add image>"
17761 #: ../fish/guestfish.pod:172
17762 msgid "Add a block device or virtual machine image to the shell."
17766 #: ../fish/guestfish.pod:177
17768 "Using this flag is mostly equivalent to using the C<add> command, with "
17769 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17770 "the I<--format=...> flag was given."
17774 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
17776 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17777 "URI to use. The default is to use the default libvirt connection."
17781 #: ../fish/guestfish.pod:189
17786 #: ../fish/guestfish.pod:191
17788 "If using the I<--listen> option and a csh-like shell, use this option. See "
17789 "section L</REMOTE CONTROL AND CSH> below."
17793 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
17794 msgid "B<-d libvirt-domain>"
17798 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
17799 msgid "B<--domain libvirt-domain>"
17803 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
17805 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17806 "used, then any libvirt domain can be used. However in write mode, only "
17807 "libvirt domains which are shut down can be named here."
17811 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
17812 msgid "Domain UUIDs can be used instead of names."
17816 #: ../fish/guestfish.pod:204
17818 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17819 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17820 "if the I<--format:...> flag was given."
17824 #: ../fish/guestfish.pod:208
17829 #: ../fish/guestfish.pod:210
17830 msgid "B<--no-dest-paths>"
17834 #: ../fish/guestfish.pod:212
17836 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17837 "to hit the tab key to complete paths on the guest filesystem, but this "
17838 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17839 "allow this feature to be disabled."
17843 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
17845 "When prompting for keys and passphrases, guestfish normally turns echoing "
17846 "off so you cannot see what you are typing. If you are not worried about "
17847 "Tempest attacks and there is no one else in the room you can specify this "
17848 "flag to see what you are typing."
17852 #: ../fish/guestfish.pod:224
17857 #: ../fish/guestfish.pod:226
17858 msgid "B<--file file>"
17862 #: ../fish/guestfish.pod:228
17863 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17867 #: ../fish/guestfish.pod:231
17870 " #!/usr/bin/guestfish -f\n"
17875 #: ../fish/guestfish.pod:244
17878 " guestfish --format=raw -a disk.img\n"
17883 #: ../fish/guestfish.pod:248
17886 " guestfish --format=raw -a disk.img --format -a another.img\n"
17891 #: ../fish/guestfish.pod:253
17893 "If you have untrusted raw-format guest disk images, you should use this "
17894 "option to specify the disk format. This avoids a possible security problem "
17895 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17899 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
17900 msgid "B<--inspector>"
17904 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
17906 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17907 "system and mount filesystems as they would be mounted on the real virtual "
17912 #: ../fish/guestfish.pod:266
17913 msgid "Typical usage is either:"
17917 #: ../fish/guestfish.pod:268
17920 " guestfish -d myguest -i\n"
17925 #: ../fish/guestfish.pod:270
17926 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17930 #: ../fish/guestfish.pod:272
17933 " guestfish --ro -d myguest -i\n"
17938 #: ../fish/guestfish.pod:274
17939 msgid "(for active domains, readonly), or specify the block device directly:"
17943 #: ../fish/guestfish.pod:276
17946 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17951 #: ../fish/guestfish.pod:278
17953 "Note that the command line syntax changed slightly over older versions of "
17954 "guestfish. You can still use the old syntax:"
17958 #: ../fish/guestfish.pod:281
17961 " guestfish [--ro] -i disk.img\n"
17966 #: ../fish/guestfish.pod:283
17969 " guestfish [--ro] -i libvirt-domain\n"
17974 #: ../fish/guestfish.pod:285
17976 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
17977 "then using other commands to mount the filesystems that were found."
17981 #: ../fish/guestfish.pod:294
17982 msgid "B<--listen>"
17986 #: ../fish/guestfish.pod:296
17988 "Fork into the background and listen for remote commands. See section "
17989 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17993 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
17998 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
18000 "Connect to a live virtual machine. (Experimental, see "
18001 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
18005 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
18006 msgid "B<-m dev[:mountpoint[:options]]>"
18010 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
18011 msgid "B<--mount dev[:mountpoint[:options]]>"
18015 #: ../fish/guestfish.pod:308
18016 msgid "Mount the named partition or logical volume on the given mountpoint."
18020 #: ../fish/guestfish.pod:310
18021 msgid "If the mountpoint is omitted, it defaults to C</>."
18025 #: ../fish/guestfish.pod:312
18026 msgid "You have to mount something on C</> before most commands will work."
18030 #: ../fish/guestfish.pod:314
18032 "If any I<-m> or I<--mount> options are given, the guest is automatically "
18037 #: ../fish/guestfish.pod:317
18039 "If you don't know what filesystems a disk image contains, you can either run "
18040 "guestfish without this option, then list the partitions, filesystems and LVs "
18041 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
18042 "commands), or you can use the L<virt-filesystems(1)> program."
18046 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
18048 "The third (and rarely used) part of the mount parameter is the list of mount "
18049 "options used to mount the underlying filesystem. If this is not given, then "
18050 "the mount options are either the empty string or C<ro> (the latter if the "
18051 "I<--ro> flag is used). By specifying the mount options, you override this "
18052 "default choice. Probably the only time you would use this is to enable ACLs "
18053 "and/or extended attributes if the filesystem can support them:"
18057 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
18060 " -m /dev/sda1:/:acl,user_xattr\n"
18065 #: ../fish/guestfish.pod:333
18066 msgid "Using this flag is equivalent to using the C<mount-options> command."
18070 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202 ../resize/virt-resize.pod:435
18075 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
18076 msgid "B<--no-sync>"
18080 #: ../fish/guestfish.pod:339
18082 "Disable autosync. This is enabled by default. See the discussion of "
18083 "autosync in the L<guestfs(3)> manpage."
18087 #: ../fish/guestfish.pod:342
18092 #: ../fish/guestfish.pod:344
18093 msgid "B<--new type>"
18097 #: ../fish/guestfish.pod:346
18102 #: ../fish/guestfish.pod:348
18104 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
18105 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
18106 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
18111 #: ../fish/guestfish.pod:353
18112 msgid "B<--progress-bars>"
18116 #: ../fish/guestfish.pod:355
18117 msgid "Enable progress bars, even when guestfish is used non-interactively."
18121 #: ../fish/guestfish.pod:357
18123 "Progress bars are enabled by default when guestfish is used as an "
18124 "interactive shell."
18128 #: ../fish/guestfish.pod:360
18129 msgid "B<--no-progress-bars>"
18133 #: ../fish/guestfish.pod:362
18134 msgid "Disable progress bars."
18138 #: ../fish/guestfish.pod:364
18139 msgid "B<--remote[=pid]>"
18143 #: ../fish/guestfish.pod:366
18145 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
18146 "CONTROL GUESTFISH OVER A SOCKET> below."
18150 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248 ../rescue/virt-rescue.pod:161
18155 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250 ../rescue/virt-rescue.pod:163
18160 #: ../fish/guestfish.pod:373
18162 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18163 "mounts are done read-only."
18167 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
18169 "The option must always be used if the disk image or virtual machine might be "
18170 "running, and is generally recommended in cases where you don't need write "
18171 "access to the disk."
18175 #: ../fish/guestfish.pod:380
18177 "Note that prepared disk images created with I<-N> are not affected by this "
18178 "option. Also commands like C<add> are not affected - you have to specify "
18179 "the C<readonly:true> option explicitly if you need it."
18183 #: ../fish/guestfish.pod:384
18184 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
18188 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262 ../rescue/virt-rescue.pod:173
18189 msgid "B<--selinux>"
18193 #: ../fish/guestfish.pod:388
18194 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
18198 #: ../fish/guestfish.pod:394
18200 "Enable very verbose messages. This is particularly useful if you find a "
18205 #: ../fish/guestfish.pod:401
18206 msgid "Display the guestfish / libguestfs version number and exit."
18210 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278 ../rescue/virt-rescue.pod:194
18215 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280 ../rescue/virt-rescue.pod:196
18220 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
18222 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18223 "mounts are done read-write."
18227 #: ../fish/guestfish.pod:410
18228 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
18232 #: ../fish/guestfish.pod:414
18233 msgid "Echo each command before executing it."
18237 #: ../fish/guestfish.pod:418
18238 msgid "COMMANDS ON COMMAND LINE"
18242 #: ../fish/guestfish.pod:420
18243 msgid "Any additional (non-option) arguments are treated as commands to execute."
18247 #: ../fish/guestfish.pod:423
18249 "Commands to execute should be separated by a colon (C<:>), where the colon "
18250 "is a separate parameter. Thus:"
18254 #: ../fish/guestfish.pod:426
18257 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18262 #: ../fish/guestfish.pod:428
18264 "If there are no additional arguments, then we enter a shell, either an "
18265 "interactive shell with a prompt (if the input is a terminal) or a "
18266 "non-interactive shell."
18270 #: ../fish/guestfish.pod:432
18272 "In either command line mode or non-interactive shell, the first command that "
18273 "gives an error causes the whole shell to exit. In interactive mode (with a "
18274 "prompt) if a command fails, you can continue to enter commands."
18278 #: ../fish/guestfish.pod:437
18279 msgid "USING launch (OR run)"
18283 #: ../fish/guestfish.pod:439
18285 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18286 "then launch it, then mount any disks you need, and finally issue "
18287 "actions/commands. So the general order of the day is:"
18291 #: ../fish/guestfish.pod:447
18292 msgid "add or -a/--add"
18296 #: ../fish/guestfish.pod:451
18297 msgid "launch (aka run)"
18301 #: ../fish/guestfish.pod:455
18302 msgid "mount or -m/--mount"
18306 #: ../fish/guestfish.pod:459
18307 msgid "any other commands"
18311 #: ../fish/guestfish.pod:463
18313 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18314 "guest before mounting or performing any other commands."
18318 #: ../fish/guestfish.pod:466
18320 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18321 "I<--new> options were given then C<run> is done automatically, simply "
18322 "because guestfish can't perform the action you asked for without doing this."
18326 #: ../fish/guestfish.pod:471
18327 msgid "OPENING DISKS FOR READ AND WRITE"
18331 #: ../fish/guestfish.pod:473
18333 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
18334 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
18335 "I<-i> and I<-m> open disk images read-only or for writing."
18339 #: ../fish/guestfish.pod:478
18341 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
18342 "opening disk images supplied on the command line for write. To open a disk "
18343 "image read-only you have to do I<-a image --ro>."
18347 #: ../fish/guestfish.pod:482
18349 "This matters: If you accidentally open a live VM disk image writable then "
18350 "you will cause irreversible disk corruption."
18354 #: ../fish/guestfish.pod:485
18356 "In a future libguestfs we intend to change the default the other way. Disk "
18357 "images will be opened read-only. You will have to either specify "
18358 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
18359 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
18360 "access for disk images specified by those other command line options."
18364 #: ../fish/guestfish.pod:492
18366 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
18367 "which does nothing (it is already the default). However it is highly "
18368 "recommended that you use this option to indicate that you need write access, "
18369 "and prepare your scripts for the day when this option will be required for "
18374 #: ../fish/guestfish.pod:498
18376 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18377 "other libguestfs program apart from guestfish and guestmount."
18381 #: ../fish/guestfish.pod:501
18386 #: ../fish/guestfish.pod:503
18388 "You can quote ordinary parameters using either single or double quotes. For "
18393 #: ../fish/guestfish.pod:506
18396 " add \"file with a space.img\"\n"
18401 #: ../fish/guestfish.pod:508
18404 " rm '/file name'\n"
18409 #: ../fish/guestfish.pod:510
18417 #: ../fish/guestfish.pod:512
18419 "A few commands require a list of strings to be passed. For these, use a "
18420 "whitespace-separated list, enclosed in quotes. Strings containing "
18421 "whitespace to be passed through must be enclosed in single quotes. A "
18422 "literal single quote must be escaped with a backslash."
18426 #: ../fish/guestfish.pod:517
18429 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18430 " command \"/bin/echo 'foo bar'\"\n"
18431 " command \"/bin/echo \\'foo\\'\"\n"
18436 #: ../fish/guestfish.pod:521
18437 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
18441 #: ../fish/guestfish.pod:523
18443 "In double-quoted arguments (only) use backslash to insert special "
18448 #: ../fish/guestfish.pod:528
18453 #: ../fish/guestfish.pod:530
18454 msgid "Alert (bell) character."
18458 #: ../fish/guestfish.pod:532
18463 #: ../fish/guestfish.pod:534
18464 msgid "Backspace character."
18468 #: ../fish/guestfish.pod:536
18473 #: ../fish/guestfish.pod:538
18474 msgid "Form feed character."
18478 #: ../fish/guestfish.pod:540
18483 #: ../fish/guestfish.pod:542
18484 msgid "Newline character."
18488 #: ../fish/guestfish.pod:544
18493 #: ../fish/guestfish.pod:546
18494 msgid "Carriage return character."
18498 #: ../fish/guestfish.pod:548
18503 #: ../fish/guestfish.pod:550
18504 msgid "Horizontal tab character."
18508 #: ../fish/guestfish.pod:552
18513 #: ../fish/guestfish.pod:554
18514 msgid "Vertical tab character."
18518 #: ../fish/guestfish.pod:556
18523 #: ../fish/guestfish.pod:558
18524 msgid "A literal double quote character."
18528 #: ../fish/guestfish.pod:560
18533 #: ../fish/guestfish.pod:562
18535 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
18540 #: ../fish/guestfish.pod:565
18545 #: ../fish/guestfish.pod:567
18546 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
18550 #: ../fish/guestfish.pod:570
18552 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
18557 #: ../fish/guestfish.pod:573
18562 #: ../fish/guestfish.pod:575
18563 msgid "A literal backslash character."
18567 #: ../fish/guestfish.pod:579
18568 msgid "OPTIONAL ARGUMENTS"
18572 #: ../fish/guestfish.pod:581
18574 "Some commands take optional arguments. These arguments appear in this "
18575 "documentation as C<[argname:..]>. You can use them as in these examples:"
18579 #: ../fish/guestfish.pod:585
18582 " add-drive-opts filename\n"
18587 #: ../fish/guestfish.pod:587
18590 " add-drive-opts filename readonly:true\n"
18595 #: ../fish/guestfish.pod:589
18598 " add-drive-opts filename format:qcow2 readonly:false\n"
18603 #: ../fish/guestfish.pod:591
18605 "Each optional argument can appear at most once. All optional arguments must "
18606 "appear after the required ones."
18610 #: ../fish/guestfish.pod:594
18615 #: ../fish/guestfish.pod:596
18616 msgid "This section applies to all commands which can take integers as parameters."
18620 #: ../fish/guestfish.pod:599
18621 msgid "SIZE SUFFIX"
18625 #: ../fish/guestfish.pod:601
18627 "When the command takes a parameter measured in bytes, you can use one of the "
18628 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18632 #: ../fish/guestfish.pod:607
18633 msgid "B<k> or B<K> or B<KiB>"
18637 #: ../fish/guestfish.pod:609
18638 msgid "The size in kilobytes (multiplied by 1024)."
18642 #: ../fish/guestfish.pod:611
18647 #: ../fish/guestfish.pod:613
18648 msgid "The size in SI 1000 byte units."
18652 #: ../fish/guestfish.pod:615
18653 msgid "B<M> or B<MiB>"
18657 #: ../fish/guestfish.pod:617
18658 msgid "The size in megabytes (multiplied by 1048576)."
18662 #: ../fish/guestfish.pod:619
18667 #: ../fish/guestfish.pod:621
18668 msgid "The size in SI 1000000 byte units."
18672 #: ../fish/guestfish.pod:623
18673 msgid "B<G> or B<GiB>"
18677 #: ../fish/guestfish.pod:625
18678 msgid "The size in gigabytes (multiplied by 2**30)."
18682 #: ../fish/guestfish.pod:627
18687 #: ../fish/guestfish.pod:629
18688 msgid "The size in SI 10**9 byte units."
18692 #: ../fish/guestfish.pod:631
18693 msgid "B<T> or B<TiB>"
18697 #: ../fish/guestfish.pod:633
18698 msgid "The size in terabytes (multiplied by 2**40)."
18702 #: ../fish/guestfish.pod:635
18707 #: ../fish/guestfish.pod:637
18708 msgid "The size in SI 10**12 byte units."
18712 #: ../fish/guestfish.pod:639
18713 msgid "B<P> or B<PiB>"
18717 #: ../fish/guestfish.pod:641
18718 msgid "The size in petabytes (multiplied by 2**50)."
18722 #: ../fish/guestfish.pod:643
18727 #: ../fish/guestfish.pod:645
18728 msgid "The size in SI 10**15 byte units."
18732 #: ../fish/guestfish.pod:647
18733 msgid "B<E> or B<EiB>"
18737 #: ../fish/guestfish.pod:649
18738 msgid "The size in exabytes (multiplied by 2**60)."
18742 #: ../fish/guestfish.pod:651
18747 #: ../fish/guestfish.pod:653
18748 msgid "The size in SI 10**18 byte units."
18752 #: ../fish/guestfish.pod:655
18753 msgid "B<Z> or B<ZiB>"
18757 #: ../fish/guestfish.pod:657
18758 msgid "The size in zettabytes (multiplied by 2**70)."
18762 #: ../fish/guestfish.pod:659
18767 #: ../fish/guestfish.pod:661
18768 msgid "The size in SI 10**21 byte units."
18772 #: ../fish/guestfish.pod:663
18773 msgid "B<Y> or B<YiB>"
18777 #: ../fish/guestfish.pod:665
18778 msgid "The size in yottabytes (multiplied by 2**80)."
18782 #: ../fish/guestfish.pod:667
18787 #: ../fish/guestfish.pod:669
18788 msgid "The size in SI 10**24 byte units."
18792 #: ../fish/guestfish.pod:675
18795 " truncate-size /file 1G\n"
18800 #: ../fish/guestfish.pod:677
18801 msgid "would truncate the file to 1 gigabyte."
18805 #: ../fish/guestfish.pod:679
18807 "Be careful because a few commands take sizes in kilobytes or megabytes "
18808 "(eg. the parameter to L</memsize> is specified in megabytes already). "
18809 "Adding a suffix will probably not do what you expect."
18813 #: ../fish/guestfish.pod:683
18814 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18818 #: ../fish/guestfish.pod:685
18820 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18821 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18825 #: ../fish/guestfish.pod:688
18828 " 1234 decimal number 1234\n"
18829 " 02322 octal number, equivalent to decimal 1234\n"
18830 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18835 #: ../fish/guestfish.pod:692
18837 "When using the C<chmod> command, you almost always want to specify an octal "
18838 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18839 "L<chmod(1)> program):"
18843 #: ../fish/guestfish.pod:696
18846 " chmod 0777 /public # OK\n"
18847 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18852 #: ../fish/guestfish.pod:699
18854 "Commands that return numbers usually print them in decimal, but some "
18855 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18856 "octal, preceeded by C<0>)."
18860 #: ../fish/guestfish.pod:703
18861 msgid "WILDCARDS AND GLOBBING"
18865 #: ../fish/guestfish.pod:705
18867 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18868 "(globbing) by default. So for example the following will not do what you "
18873 #: ../fish/guestfish.pod:709
18881 #: ../fish/guestfish.pod:711
18883 "Assuming you don't have a directory called literally C</home/*> then the "
18884 "above command will return an error."
18888 #: ../fish/guestfish.pod:714
18889 msgid "To perform wildcard expansion, use the C<glob> command."
18893 #: ../fish/guestfish.pod:716
18896 " glob rm-rf /home/*\n"
18901 #: ../fish/guestfish.pod:718
18903 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18904 "many times), equivalent to:"
18908 #: ../fish/guestfish.pod:721
18911 " rm-rf /home/jim\n"
18912 " rm-rf /home/joe\n"
18913 " rm-rf /home/mary\n"
18918 #: ../fish/guestfish.pod:725
18919 msgid "C<glob> only works on simple guest paths and not on device names."
18923 #: ../fish/guestfish.pod:727
18925 "If you have several parameters, each containing a wildcard, then glob will "
18926 "perform a Cartesian product."
18930 #: ../fish/guestfish.pod:730
18935 #: ../fish/guestfish.pod:732
18937 "Any line which starts with a I<#> character is treated as a comment and "
18938 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18939 "a command. For example:"
18943 #: ../fish/guestfish.pod:736
18946 " # this is a comment\n"
18947 " # this is a comment\n"
18948 " foo # NOT a comment\n"
18953 #: ../fish/guestfish.pod:740
18954 msgid "Blank lines are also ignored."
18958 #: ../fish/guestfish.pod:742
18959 msgid "RUNNING COMMANDS LOCALLY"
18963 #: ../fish/guestfish.pod:744
18965 "Any line which starts with a I<!> character is treated as a command sent to "
18966 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18970 #: ../fish/guestfish.pod:748
18974 " tgz-out /remote local/remote-data.tar.gz\n"
18979 #: ../fish/guestfish.pod:751
18981 "will create a directory C<local> on the host, and then export the contents "
18982 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18983 "(See C<tgz-out>)."
18987 #: ../fish/guestfish.pod:755
18989 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18990 "effect, due to the way that subprocesses work in Unix."
18994 #: ../fish/guestfish.pod:758
18995 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
18999 #: ../fish/guestfish.pod:760
19001 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
19002 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
19003 "and executed as guestfish commands."
19007 #: ../fish/guestfish.pod:764
19009 "Thus you can use shell script to construct arbitrary guestfish commands "
19010 "which are then parsed by guestfish."
19014 #: ../fish/guestfish.pod:767
19016 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
19017 "through C</foo.100>) using guestfish commands alone. However this is simple "
19018 "if we use a shell script to create the guestfish commands for us:"
19022 #: ../fish/guestfish.pod:772
19025 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
19030 #: ../fish/guestfish.pod:774
19031 msgid "or with names like C</foo.001>:"
19035 #: ../fish/guestfish.pod:776
19038 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
19043 #: ../fish/guestfish.pod:778
19045 "When using guestfish interactively it can be helpful to just run the shell "
19046 "script first (ie. remove the initial C<E<lt>> character so it is just an "
19047 "ordinary I<!> local command), see what guestfish commands it would run, and "
19048 "when you are happy with those prepend the C<E<lt>> character to run the "
19049 "guestfish commands for real."
19053 #: ../fish/guestfish.pod:784
19058 #: ../fish/guestfish.pod:786
19060 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
19061 "command (a guestfish command) to the second command (any host command). For "
19066 #: ../fish/guestfish.pod:790
19069 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
19074 #: ../fish/guestfish.pod:792
19076 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
19077 "program). The above command would list all accounts in the guest filesystem "
19078 "which have UID 0, ie. root accounts including backdoors. Other examples:"
19082 #: ../fish/guestfish.pod:797
19085 " hexdump /bin/ls | head\n"
19086 " list-devices | tail -1\n"
19087 " tgz-out / - | tar ztf -\n"
19092 #: ../fish/guestfish.pod:801
19094 "The space before the pipe symbol is required, any space after the pipe "
19095 "symbol is optional. Everything after the pipe symbol is just passed "
19096 "straight to the host shell, so it can contain redirections, globs and "
19097 "anything else that makes sense on the host side."
19101 #: ../fish/guestfish.pod:806
19103 "To use a literal argument which begins with a pipe symbol, you have to quote "
19108 #: ../fish/guestfish.pod:809
19116 #: ../fish/guestfish.pod:811
19117 msgid "HOME DIRECTORIES"
19121 #: ../fish/guestfish.pod:813
19123 "If a parameter starts with the character C<~> then the tilde may be expanded "
19124 "as a home directory path (either C<~> for the current user's home directory, "
19125 "or C<~user> for another user)."
19129 #: ../fish/guestfish.pod:817
19131 "Note that home directory expansion happens for users known I<on the host>, "
19132 "not in the guest filesystem."
19136 #: ../fish/guestfish.pod:820
19138 "To use a literal argument which begins with a tilde, you have to quote it, "
19143 #: ../fish/guestfish.pod:823
19151 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:534
19152 msgid "ENCRYPTED DISKS"
19156 #: ../fish/guestfish.pod:827
19158 "Libguestfs has some support for Linux guests encrypted according to the "
19159 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
19160 "disk encryption systems used by modern Linux guests. Currently only "
19161 "LVM-on-LUKS is supported."
19165 #: ../fish/guestfish.pod:832
19166 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
19170 #: ../fish/guestfish.pod:834
19173 " ><fs> vfs-type /dev/sda2\n"
19179 #: ../fish/guestfish.pod:837
19181 "Then open those devices using L</luks-open>. This creates a device-mapper "
19182 "device called C</dev/mapper/luksdev>."
19186 #: ../fish/guestfish.pod:840
19189 " ><fs> luks-open /dev/sda2 luksdev\n"
19190 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
19195 #: ../fish/guestfish.pod:843
19197 "Finally you have to tell LVM to scan for volume groups on the newly created "
19202 #: ../fish/guestfish.pod:846
19206 " vg-activate-all true\n"
19211 #: ../fish/guestfish.pod:849
19212 msgid "The logical volume(s) can now be mounted in the usual way."
19216 #: ../fish/guestfish.pod:851
19218 "Before closing a LUKS device you must unmount any logical volumes on it and "
19219 "deactivate the volume groups by calling C<vg-activate false VG> on each "
19220 "one. Then you can close the mapper device:"
19224 #: ../fish/guestfish.pod:855
19227 " vg-activate false /dev/VG\n"
19228 " luks-close /dev/mapper/luksdev\n"
19233 #: ../fish/guestfish.pod:860
19235 "If a path is prefixed with C<win:> then you can use Windows-style drive "
19236 "letters and paths (with some limitations). The following commands are "
19241 #: ../fish/guestfish.pod:864
19244 " file /WINDOWS/system32/config/system.LOG\n"
19249 #: ../fish/guestfish.pod:866
19252 " file win:\\windows\\system32\\config\\system.log\n"
19257 #: ../fish/guestfish.pod:868
19260 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
19265 #: ../fish/guestfish.pod:870
19267 "The parameter is rewritten \"behind the scenes\" by looking up the position "
19268 "where the drive is mounted, prepending that to the path, changing all "
19269 "backslash characters to forward slash, then resolving the result using "
19270 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
19271 "then the parameter might be rewritten like this:"
19275 #: ../fish/guestfish.pod:876
19278 " win:e:\\foo\\bar => /e/FOO/bar\n"
19283 #: ../fish/guestfish.pod:878
19284 msgid "This only works in argument positions that expect a path."
19288 #: ../fish/guestfish.pod:880
19289 msgid "UPLOADING AND DOWNLOADING FILES"
19293 #: ../fish/guestfish.pod:882
19295 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19296 "others which upload from or download to a local file, you can use the "
19297 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19301 #: ../fish/guestfish.pod:886
19309 #: ../fish/guestfish.pod:888
19310 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
19314 #: ../fish/guestfish.pod:891
19317 " tar-out /etc - | tar tf -\n"
19322 #: ../fish/guestfish.pod:893
19324 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19325 "command (see L</PIPES>)."
19329 #: ../fish/guestfish.pod:896
19331 "When using C<-> to read from stdin, the input is read up to the end of "
19332 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19333 "some arbitrary end marker:"
19337 #: ../fish/guestfish.pod:900
19340 " upload -<<END /foo\n"
19349 #: ../fish/guestfish.pod:906
19351 "Any string of characters can be used instead of C<END>. The end marker must "
19352 "appear on a line of its own, without any preceeding or following characters "
19353 "(not even spaces)."
19357 #: ../fish/guestfish.pod:910
19359 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19360 "upload local files (so-called \"FileIn\" parameters in the generator)."
19364 #: ../fish/guestfish.pod:913
19365 msgid "EXIT ON ERROR BEHAVIOUR"
19369 #: ../fish/guestfish.pod:915
19371 "By default, guestfish will ignore any errors when in interactive mode "
19372 "(ie. taking commands from a human over a tty), and will exit on the first "
19373 "error in non-interactive mode (scripts, commands given on the command line)."
19377 #: ../fish/guestfish.pod:920
19379 "If you prefix a command with a I<-> character, then that command will not "
19380 "cause guestfish to exit, even if that (one) command returns an error."
19384 #: ../fish/guestfish.pod:924
19385 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19389 #: ../fish/guestfish.pod:926
19391 "Guestfish can be remote-controlled over a socket. This is useful "
19392 "particularly in shell scripts where you want to make several different "
19393 "changes to a filesystem, but you don't want the overhead of starting up a "
19394 "guestfish process each time."
19398 #: ../fish/guestfish.pod:931
19399 msgid "Start a guestfish server process using:"
19403 #: ../fish/guestfish.pod:933
19406 " eval \"`guestfish --listen`\"\n"
19411 #: ../fish/guestfish.pod:935
19412 msgid "and then send it commands by doing:"
19416 #: ../fish/guestfish.pod:937
19419 " guestfish --remote cmd [...]\n"
19424 #: ../fish/guestfish.pod:939
19425 msgid "To cause the server to exit, send it the exit command:"
19429 #: ../fish/guestfish.pod:943
19431 "Note that the server will normally exit if there is an error in a command. "
19432 "You can change this in the usual way. See section L</EXIT ON ERROR "
19437 #: ../fish/guestfish.pod:947
19438 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19442 #: ../fish/guestfish.pod:949
19444 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19445 "is how the I<--remote> option knows where to send the commands. You can "
19446 "have several guestfish listener processes running using:"
19450 #: ../fish/guestfish.pod:953
19453 " eval \"`guestfish --listen`\"\n"
19454 " pid1=$GUESTFISH_PID\n"
19455 " eval \"`guestfish --listen`\"\n"
19456 " pid2=$GUESTFISH_PID\n"
19458 " guestfish --remote=$pid1 cmd\n"
19459 " guestfish --remote=$pid2 cmd\n"
19464 #: ../fish/guestfish.pod:961
19465 msgid "REMOTE CONTROL AND CSH"
19469 #: ../fish/guestfish.pod:963
19471 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19476 #: ../fish/guestfish.pod:966
19479 " eval \"`guestfish --listen --csh`\"\n"
19484 #: ../fish/guestfish.pod:968
19485 msgid "REMOTE CONTROL DETAILS"
19489 #: ../fish/guestfish.pod:970
19491 "Remote control happens over a Unix domain socket called "
19492 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
19493 "of the process, and C<$PID> is the process ID of the server."
19497 #: ../fish/guestfish.pod:974
19498 msgid "Guestfish client and server versions must match exactly."
19502 #: ../fish/guestfish.pod:976
19503 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
19507 #: ../fish/guestfish.pod:978
19509 "From Bash, you can use the following code which creates a guestfish "
19510 "instance, correctly quotes the command line, handles failure to start, and "
19511 "cleans up guestfish when the script exits:"
19515 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:980
19523 #: ../fish/guestfish.pod:986
19526 " guestfish[0]=\"guestfish\"\n"
19527 " guestfish[1]=\"--listen\"\n"
19528 " guestfish[2]=\"--ro\"\n"
19529 " guestfish[3]=\"-a\"\n"
19530 " guestfish[4]=\"disk.img\"\n"
19535 #: ../fish/guestfish.pod:992
19538 " GUESTFISH_PID=\n"
19539 " eval $(\"${guestfish[@]}\")\n"
19540 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
19541 " echo \"error: guestfish didn't start up, see error messages above\"\n"
19548 #: ../fish/guestfish.pod:999
19551 " cleanup_guestfish ()\n"
19553 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
19555 " trap cleanup_guestfish EXIT ERR\n"
19560 #: ../fish/guestfish.pod:1005
19563 " guestfish --remote -- run\n"
19568 #: ../fish/guestfish.pod:1007
19576 #: ../fish/guestfish.pod:1009
19577 msgid "REMOTE CONTROL RUN COMMAND HANGING"
19581 #: ../fish/guestfish.pod:1011
19583 "Using the C<run> (or C<launch>) command remotely in a command substitution "
19584 "context hangs, ie. don't do (note the backquotes):"
19588 #: ../fish/guestfish.pod:1014
19591 " a=`guestfish --remote run`\n"
19596 #: ../fish/guestfish.pod:1016
19598 "Since the C<run> command produces no output on stdout, this is not useful "
19599 "anyway. For further information see "
19600 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
19604 #: ../fish/guestfish.pod:1020
19605 msgid "PREPARED DISK IMAGES"
19609 #: ../fish/guestfish.pod:1022
19611 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
19612 "preformatted disk images that guestfish can make for you to save typing. "
19613 "This is particularly useful for testing purposes. This option is used "
19614 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
19615 "can be mixed with I<-a>)."
19619 #: ../fish/guestfish.pod:1028
19621 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
19622 "the second and so on. Existing files in the current directory are "
19627 #: ../fish/guestfish.pod:1032
19629 "The type briefly describes how the disk should be sized, partitioned, how "
19630 "filesystem(s) should be created, and how content should be added. "
19631 "Optionally the type can be followed by extra parameters, separated by C<:> "
19632 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
19633 "sparsely-allocated disk, containing a single partition, with the partition "
19634 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
19635 "on a 1GB disk instead."
19639 #: ../fish/guestfish.pod:1040
19640 msgid "To list the available types and any extra parameters they take, run:"
19644 #: ../fish/guestfish.pod:1044
19646 "Note that the prepared filesystem is not mounted. You would usually have to "
19647 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
19651 #: ../fish/guestfish.pod:1048
19653 "If any I<-N> or I<--new> options are given, the guest is automatically "
19658 #: ../fish/guestfish.pod:1053
19659 msgid "Create a 100MB disk with an ext4-formatted partition:"
19663 #: ../fish/guestfish.pod:1055
19666 " guestfish -N fs:ext4\n"
19671 #: ../fish/guestfish.pod:1057
19672 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
19676 #: ../fish/guestfish.pod:1059
19679 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
19684 #: ../fish/guestfish.pod:1061
19685 msgid "Create a blank 200MB disk:"
19689 #: ../fish/guestfish.pod:1063
19692 " guestfish -N disk:200M\n"
19697 #: ../fish/guestfish.pod:1065
19698 msgid "PROGRESS BARS"
19702 #: ../fish/guestfish.pod:1067
19704 "Some (not all) long-running commands send progress notification messages as "
19705 "they are running. Guestfish turns these messages into progress bars."
19709 #: ../fish/guestfish.pod:1071
19711 "When a command that supports progress bars takes longer than two seconds to "
19712 "run, and if progress bars are enabled, then you will see one appearing below "
19717 #: ../fish/guestfish.pod:1075
19720 " ><fs> copy-size /large-file /another-file 2048M\n"
19721 " / 10% [#####-----------------------------------------] 00:30\n"
19726 #: ../fish/guestfish.pod:1078
19728 "The spinner on the left hand side moves round once for every progress "
19729 "notification received from the backend. This is a (reasonably) golden "
19730 "assurance that the command is \"doing something\" even if the progress bar "
19731 "is not moving, because the command is able to send the progress "
19732 "notifications. When the bar reaches 100% and the command finishes, the "
19733 "spinner disappears."
19737 #: ../fish/guestfish.pod:1085
19739 "Progress bars are enabled by default when guestfish is used interactively. "
19740 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19741 "and you can disable them completely using I<--no-progress-bars>."
19745 #: ../fish/guestfish.pod:1090
19746 msgid "GUESTFISH COMMANDS"
19750 #: ../fish/guestfish.pod:1092
19752 "The commands in this section are guestfish convenience commands, in other "
19753 "words, they are not part of the L<guestfs(3)> API."
19757 #: ../fish/guestfish.pod:1095
19762 #: ../fish/guestfish.pod:1097
19771 #: ../fish/guestfish.pod:1100
19772 msgid "Without any parameter, this provides general help."
19776 #: ../fish/guestfish.pod:1102
19777 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19781 #: ../fish/guestfish.pod:1104
19782 msgid "quit | exit"
19786 #: ../fish/guestfish.pod:1106
19787 msgid "This exits guestfish. You can also use C<^D> key."
19791 #: ../fish/guestfish.pod:1108
19792 msgid "@FISH_COMMANDS@"
19796 #: ../fish/guestfish.pod:1110
19801 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1520
19806 #: ../fish/guestfish.pod:1116
19808 "guestfish returns 0 if the commands completed without error, or 1 if there "
19813 #: ../fish/guestfish.pod:1123
19818 #: ../fish/guestfish.pod:1125
19820 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19825 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3213
19826 msgid "FEBOOTSTRAP_KERNEL"
19830 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3215
19831 msgid "FEBOOTSTRAP_MODULES"
19835 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3217
19837 "These two environment variables allow the kernel that libguestfs uses in the "
19838 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
19839 "most recent host kernel is chosen. For more information about kernel "
19840 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
19841 "available in febootstrap E<ge> 3.8."
19845 #: ../fish/guestfish.pod:1138
19846 msgid "GUESTFISH_DISPLAY_IMAGE"
19850 #: ../fish/guestfish.pod:1140
19852 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
19853 "If not set, it uses L<display(1)>."
19857 #: ../fish/guestfish.pod:1143
19858 msgid "GUESTFISH_PID"
19862 #: ../fish/guestfish.pod:1145
19864 "Used with the I<--remote> option to specify the remote guestfish process to "
19865 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19869 #: ../fish/guestfish.pod:1149
19874 #: ../fish/guestfish.pod:1151
19876 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19877 "not specified, the external L<hexedit(1)> program is used."
19881 #: ../fish/guestfish.pod:1155
19886 #: ../fish/guestfish.pod:1157
19888 "If compiled with GNU readline support, various files in the home directory "
19889 "can be used. See L</FILES>."
19893 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3223
19894 msgid "LIBGUESTFS_APPEND"
19898 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3225
19899 msgid "Pass additional options to the guest kernel."
19903 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3227
19904 msgid "LIBGUESTFS_DEBUG"
19908 #: ../fish/guestfish.pod:1166
19910 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19911 "effect as using the B<-v> option."
19915 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3232
19916 msgid "LIBGUESTFS_MEMSIZE"
19920 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3234
19921 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
19925 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3237
19928 " LIBGUESTFS_MEMSIZE=700\n"
19933 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3239
19934 msgid "LIBGUESTFS_PATH"
19938 #: ../fish/guestfish.pod:1178
19940 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19941 "the discussion of paths in L<guestfs(3)>."
19945 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3244
19946 msgid "LIBGUESTFS_QEMU"
19950 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3246
19952 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
19953 "which was found at compile time by the configure script is used."
19957 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3252
19958 msgid "LIBGUESTFS_TRACE"
19962 #: ../fish/guestfish.pod:1189
19963 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19967 #: ../fish/guestfish.pod:1191
19972 #: ../fish/guestfish.pod:1193
19974 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19979 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:236 ../src/guestfs.pod:3257
19984 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3259
19986 "Location of temporary directory, defaults to C</tmp> except for the cached "
19987 "supermin appliance which defaults to C</var/tmp>."
19991 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3262
19993 "If libguestfs was compiled to use the supermin appliance then the real "
19994 "appliance is cached in this directory, shared between all handles belonging "
19995 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
19996 "use in case C</var/tmp> is not large enough."
20000 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297 ../rescue/virt-rescue.pod:273
20005 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301 ../rescue/virt-rescue.pod:277
20006 msgid "$HOME/.libguestfs-tools.rc"
20010 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303 ../rescue/virt-rescue.pod:279
20011 msgid "/etc/libguestfs-tools.conf"
20015 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305 ../rescue/virt-rescue.pod:281
20017 "This configuration file controls the default read-only or read-write mode "
20018 "(I<--ro> or I<--rw>)."
20022 #: ../fish/guestfish.pod:1220
20023 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
20027 #: ../fish/guestfish.pod:1222
20028 msgid "$HOME/.guestfish"
20032 #: ../fish/guestfish.pod:1224
20034 "If compiled with GNU readline support, then the command history is saved in "
20039 #: ../fish/guestfish.pod:1227
20040 msgid "$HOME/.inputrc"
20044 #: ../fish/guestfish.pod:1229
20045 msgid "/etc/inputrc"
20049 #: ../fish/guestfish.pod:1231
20051 "If compiled with GNU readline support, then these files can be used to "
20052 "configure readline. For further information, please see "
20053 "L<readline(3)/INITIALIZATION FILE>."
20057 #: ../fish/guestfish.pod:1235
20058 msgid "To write rules which only apply to guestfish, use:"
20062 #: ../fish/guestfish.pod:1237
20072 #: ../fish/guestfish.pod:1241
20074 "Variables that you can set in inputrc that change the behaviour of guestfish "
20075 "in useful ways include:"
20079 #: ../fish/guestfish.pod:1246
20080 msgid "completion-ignore-case (default: on)"
20084 #: ../fish/guestfish.pod:1248
20086 "By default, guestfish will ignore case when tab-completing paths on the "
20091 #: ../fish/guestfish.pod:1251
20094 " set completion-ignore-case off\n"
20099 #: ../fish/guestfish.pod:1253
20100 msgid "to make guestfish case sensitive."
20104 #: ../fish/guestfish.pod:1257
20109 #: ../fish/guestfish.pod:1259
20110 msgid "test2.img (etc)"
20114 #: ../fish/guestfish.pod:1261
20116 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
20117 "will be created in the file C<test1.img> in the current directory. The "
20118 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
20119 "the same name will be overwritten."
20123 #: ../fish/guestfish.pod:1270
20125 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, "
20126 "L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, "
20127 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, "
20128 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
20129 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
20130 "L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
20131 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
20132 "L<febootstrap-supermin-helper(8)>."
20136 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3354 ../test-tool/libguestfs-test-tool.pod:112
20137 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
20141 #: ../fish/virt-copy-in.pod:5
20142 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
20146 #: ../fish/virt-copy-in.pod:9
20149 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
20154 #: ../fish/virt-copy-in.pod:11
20157 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
20162 #: ../fish/virt-copy-in.pod:15
20164 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
20165 "causing disk corruption. The virtual machine must be shut down before you "
20166 "use this command."
20170 #: ../fish/virt-copy-in.pod:21
20172 "C<virt-copy-in> copies files and directories from the local disk into a "
20173 "virtual machine disk image or named libvirt domain."
20177 #: ../fish/virt-copy-in.pod:24
20179 "You can give one of more filenames and directories on the command line. "
20180 "Directories are copied in recursively. The final parameter must be the "
20181 "destination directory in the disk image which must be an absolute path "
20182 "starting with a C</> character."
20186 #: ../fish/virt-copy-in.pod:33
20189 " virt-copy-in -d MyGuest resolv.conf /etc\n"
20194 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
20195 msgid "Upload a home directory to a guest:"
20199 #: ../fish/virt-copy-in.pod:37
20202 " virt-copy-in -d MyGuest skel /home\n"
20207 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
20208 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
20212 #: ../fish/virt-copy-in.pod:41
20214 "This command is just a simple shell script wrapper around the "
20215 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
20216 "trivial copy, you are probably better off using guestfish directly."
20220 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
20222 "Since the shell script just passes options straight to guestfish, read "
20223 "L<guestfish(1)> to see the full list of options."
20227 #: ../fish/virt-copy-in.pod:52
20229 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
20230 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20234 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
20235 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20239 #: ../fish/virt-copy-out.pod:5
20241 "virt-copy-out - Copy files and directories out of a virtual machine disk "
20246 #: ../fish/virt-copy-out.pod:9
20249 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
20254 #: ../fish/virt-copy-out.pod:11
20257 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
20262 #: ../fish/virt-copy-out.pod:15
20264 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
20265 "image or named libvirt domain."
20269 #: ../fish/virt-copy-out.pod:18
20271 "You can give one of more filenames and directories on the command line. "
20272 "Directories are copied out recursively."
20276 #: ../fish/virt-copy-out.pod:23
20277 msgid "Download the home directories from a virtual machine:"
20281 #: ../fish/virt-copy-out.pod:25
20285 " virt-copy-out -d MyGuest /home homes\n"
20290 #: ../fish/virt-copy-out.pod:30
20292 "This command is just a simple shell script wrapper around the "
20293 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
20294 "trivial copy, you are probably better off using guestfish directly."
20298 #: ../fish/virt-copy-out.pod:41
20300 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
20301 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20305 #: ../fish/virt-tar-in.pod:5
20306 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
20310 #: ../fish/virt-tar-in.pod:9
20313 " virt-tar-in -a disk.img data.tar /destination\n"
20318 #: ../fish/virt-tar-in.pod:11
20321 " virt-tar-in -d domain data.tar /destination\n"
20326 #: ../fish/virt-tar-in.pod:13
20329 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
20334 #: ../fish/virt-tar-in.pod:17
20336 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
20337 "causing disk corruption. The virtual machine must be shut down before you "
20338 "use this command."
20342 #: ../fish/virt-tar-in.pod:23
20344 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
20345 "image or named libvirt domain."
20349 #: ../fish/virt-tar-in.pod:26
20351 "The first parameter is the tar file. Use C<-> to read the tar file from "
20352 "standard input. The second parameter is the absolute target directory to "
20357 #: ../fish/virt-tar-in.pod:34
20360 " virt-tar-in -d MyGuest homes.tar /home\n"
20365 #: ../fish/virt-tar-in.pod:38
20367 "This command is just a simple shell script wrapper around the "
20368 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
20369 "copy, you are probably better off using guestfish directly."
20373 #: ../fish/virt-tar-in.pod:49
20375 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20376 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
20377 "L<http://libguestfs.org/>."
20381 #: ../fish/virt-tar-out.pod:5
20382 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
20386 #: ../fish/virt-tar-out.pod:9
20389 " virt-tar-out -a disk.img /dir files.tar\n"
20394 #: ../fish/virt-tar-out.pod:11
20397 " virt-tar-out -d domain /dir files.tar\n"
20402 #: ../fish/virt-tar-out.pod:13
20405 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
20410 #: ../fish/virt-tar-out.pod:17
20411 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
20415 #: ../fish/virt-tar-out.pod:20
20417 "The first parameter is the absolute path of the virtual machine directory. "
20418 "The second parameter is the tar file to write. Use C<-> to write to "
20423 #: ../fish/virt-tar-out.pod:26
20424 msgid "Download the home directories from a guest:"
20428 #: ../fish/virt-tar-out.pod:28
20431 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
20436 #: ../fish/virt-tar-out.pod:32
20438 "This command is just a simple shell script wrapper around the "
20439 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
20440 "trivial copy, you are probably better off using guestfish directly."
20444 #: ../fish/virt-tar-out.pod:43
20446 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20447 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
20451 #: ../fuse/guestmount.pod:5
20452 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
20456 #: ../fuse/guestmount.pod:9
20459 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
20464 #: ../fuse/guestmount.pod:11
20467 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
20472 #: ../fuse/guestmount.pod:13
20475 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
20480 #: ../fuse/guestmount.pod:17
20482 "You must I<not> use C<guestmount> in read-write mode on live virtual "
20483 "machines. If you do this, you risk disk corruption in the VM."
20487 #: ../fuse/guestmount.pod:22
20489 "The guestmount program can be used to mount virtual machine filesystems and "
20490 "other disk images on the host. It uses libguestfs for access to the guest "
20491 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
20492 "a mountable device."
20496 #: ../fuse/guestmount.pod:27
20498 "Along with other options, you have to give at least one device (I<-a> "
20499 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
20500 "option) or use the I<-i> inspection option or the I<--live> option. How "
20501 "this works is better explained in the L<guestfish(1)> manual page, or by "
20502 "looking at the examples below."
20506 #: ../fuse/guestmount.pod:33
20508 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
20509 "by you, and the filesystem will not be visible to any other users unless you "
20510 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
20511 "the filesystem, use the C<fusermount -u> command."
20515 #: ../fuse/guestmount.pod:41
20517 "For a typical Windows guest which has its main filesystem on the first "
20522 #: ../fuse/guestmount.pod:44
20525 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
20530 #: ../fuse/guestmount.pod:46
20532 "For a typical Linux guest which has a /boot filesystem on the first "
20533 "partition, and the root filesystem on a logical volume:"
20537 #: ../fuse/guestmount.pod:49
20540 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
20545 #: ../fuse/guestmount.pod:51
20546 msgid "To get libguestfs to detect guest mountpoints for you:"
20550 #: ../fuse/guestmount.pod:53
20553 " guestmount -a guest.img -i --ro /mnt\n"
20558 #: ../fuse/guestmount.pod:55
20559 msgid "For a libvirt guest called \"Guest\" you could do:"
20563 #: ../fuse/guestmount.pod:57
20566 " guestmount -d Guest -i --ro /mnt\n"
20571 #: ../fuse/guestmount.pod:59
20573 "If you don't know what filesystems are contained in a guest or disk image, "
20574 "use L<virt-filesystems(1)> first:"
20578 #: ../fuse/guestmount.pod:62
20581 " virt-filesystems MyGuest\n"
20586 #: ../fuse/guestmount.pod:64
20588 "If you want to trace the libguestfs calls but without excessive debugging "
20589 "information, we recommend:"
20593 #: ../fuse/guestmount.pod:67
20596 " guestmount [...] --trace /mnt\n"
20601 #: ../fuse/guestmount.pod:69
20602 msgid "If you want to debug the program, we recommend:"
20606 #: ../fuse/guestmount.pod:71
20609 " guestmount [...] --trace --verbose /mnt\n"
20614 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68 ../resize/virt-resize.pod:621
20619 #: ../fuse/guestmount.pod:75
20620 msgid "Other users cannot see the filesystem by default"
20624 #: ../fuse/guestmount.pod:77
20626 "If you mount a filesystem as one user (eg. root), then other users will not "
20627 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
20628 "option when mounting:"
20632 #: ../fuse/guestmount.pod:81
20635 " sudo guestmount [...] -o allow_other /mnt\n"
20640 #: ../fuse/guestmount.pod:83
20641 msgid "Enabling FUSE"
20645 #: ../fuse/guestmount.pod:85
20647 "On some distros, you may need to add yourself to a special group "
20648 "(eg. C<fuse>) before you can use any FUSE filesystem. This is necessary on "
20649 "Debian and derivatives."
20653 #: ../fuse/guestmount.pod:89
20655 "On other distros, no special group is required. It is not necessary on "
20656 "Fedora or Red Hat Enterprise Linux."
20660 #: ../fuse/guestmount.pod:100
20661 msgid "Add a block device or virtual machine image."
20665 #: ../fuse/guestmount.pod:123
20666 msgid "B<--dir-cache-timeout N>"
20670 #: ../fuse/guestmount.pod:125
20672 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
20673 "seconds. The readdir cache [actually, there are several semi-independent "
20674 "caches] is populated after a readdir(2) call with the stat and extended "
20675 "attributes of the files in the directory, in anticipation that they will be "
20676 "requested soon after."
20680 #: ../fuse/guestmount.pod:131
20682 "There is also a different attribute cache implemented by FUSE (see the FUSE "
20683 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
20684 "requests, only cache existing ones."
20688 #: ../fuse/guestmount.pod:151
20690 "If you have untrusted raw-format guest disk images, you should use this "
20691 "option to specify the disk format. This avoids a possible security problem "
20692 "with malicious guests (CVE-2010-3851). See also "
20693 "L<guestfs(3)/guestfs_add_drive_opts>."
20697 #: ../fuse/guestmount.pod:156
20698 msgid "B<--fuse-help>"
20702 #: ../fuse/guestmount.pod:158
20703 msgid "Display help on special FUSE options (see I<-o> below)."
20707 #: ../fuse/guestmount.pod:162
20708 msgid "Display brief help and exit."
20712 #: ../fuse/guestmount.pod:186
20714 "Mount the named partition or logical volume on the given mountpoint B<in the "
20715 "guest> (this has nothing to do with mountpoints in the host)."
20719 #: ../fuse/guestmount.pod:189
20721 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
20722 "something on C</>."
20726 #: ../fuse/guestmount.pod:206
20728 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
20729 "unmounted. If you specify this option, then we don't attempt to sync the "
20730 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
20734 #: ../fuse/guestmount.pod:211
20735 msgid "B<-o option>"
20739 #: ../fuse/guestmount.pod:213
20740 msgid "B<--option option>"
20744 #: ../fuse/guestmount.pod:215
20745 msgid "Pass extra options to FUSE."
20749 #: ../fuse/guestmount.pod:217
20751 "To get a list of all the extra options supported by FUSE, use the command "
20752 "below. Note that only the FUSE I<-o> options can be passed, and only some "
20753 "of them are a good idea."
20757 #: ../fuse/guestmount.pod:221
20760 " guestmount --fuse-help\n"
20765 #: ../fuse/guestmount.pod:223
20766 msgid "Some potentially useful FUSE options:"
20770 #: ../fuse/guestmount.pod:227
20771 msgid "B<-o allow_other>"
20775 #: ../fuse/guestmount.pod:229
20776 msgid "Allow other users to see the filesystem."
20780 #: ../fuse/guestmount.pod:231
20781 msgid "B<-o attr_timeout=N>"
20785 #: ../fuse/guestmount.pod:233
20786 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
20790 #: ../fuse/guestmount.pod:235
20791 msgid "B<-o kernel_cache>"
20795 #: ../fuse/guestmount.pod:237
20797 "Allow the kernel to cache files (reduces the number of reads that have to go "
20798 "through the L<guestfs(3)> API). This is generally a good idea if you can "
20799 "afford the extra memory usage."
20803 #: ../fuse/guestmount.pod:241
20804 msgid "B<-o uid=N> B<-o gid=N>"
20808 #: ../fuse/guestmount.pod:243
20810 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
20811 "the chosen values."
20815 #: ../fuse/guestmount.pod:252
20817 "Add devices and mount everything read-only. Also disallow writes and make "
20818 "the disk appear read-only to FUSE."
20822 #: ../fuse/guestmount.pod:255
20824 "This is highly recommended if you are not going to edit the guest disk. If "
20825 "the guest is running and this option is I<not> supplied, then there is a "
20826 "strong risk of disk corruption in the guest. We try to prevent this from "
20827 "happening, but it is not always possible."
20831 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:171
20832 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20836 #: ../fuse/guestmount.pod:264
20837 msgid "Enable SELinux support for the guest."
20841 #: ../fuse/guestmount.pod:270
20842 msgid "Enable verbose messages from underlying libguestfs."
20846 #: ../fuse/guestmount.pod:276
20847 msgid "Display the program version and exit."
20851 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308 ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
20852 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20856 #: ../fuse/guestmount.pod:289
20861 #: ../fuse/guestmount.pod:291
20862 msgid "Trace libguestfs calls and entry into each FUSE function."
20866 #: ../fuse/guestmount.pod:293
20867 msgid "This also stops the daemon from forking into the background."
20871 #: ../fuse/guestmount.pod:319
20873 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
20874 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
20875 "L<http://fuse.sf.net/>."
20879 #: ../fuse/guestmount.pod:334
20880 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
20884 #: ../inspector/virt-inspector.pod:5
20886 "virt-inspector - Display operating system version and other information "
20887 "about a virtual machine"
20891 #: ../inspector/virt-inspector.pod:9
20894 " virt-inspector [--options] -d domname\n"
20899 #: ../inspector/virt-inspector.pod:11
20902 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
20907 #: ../inspector/virt-inspector.pod:15
20910 " virt-inspector domname\n"
20915 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
20918 " virt-inspector disk.img [disk.img ...]\n"
20923 #: ../inspector/virt-inspector.pod:21
20925 "B<virt-inspector> examines a virtual machine or disk image and tries to "
20926 "determine the version of the operating system and other information about "
20927 "the virtual machine."
20931 #: ../inspector/virt-inspector.pod:25
20932 msgid "Virt-inspector produces XML output for feeding into other programs."
20936 #: ../inspector/virt-inspector.pod:27
20938 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
20939 "the libvirt domain (see: C<virsh list --all>)."
20943 #: ../inspector/virt-inspector.pod:30
20945 "You can also run virt-inspector directly on disk images from a single "
20946 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
20947 "has several block devices, in which case you should list several I<-a> "
20948 "options one after another, with the first corresponding to the guest's "
20949 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
20953 #: ../inspector/virt-inspector.pod:37
20955 "You can also run virt-inspector on install disks, live CDs, bootable USB "
20956 "keys and similar."
20960 #: ../inspector/virt-inspector.pod:40
20962 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
20963 "inspect several virtual machines, you have to run virt-inspector several "
20964 "times (for example, from a shell script for-loop)."
20968 #: ../inspector/virt-inspector.pod:45
20970 "Because virt-inspector needs direct access to guest images, it won't "
20971 "normally work over remote libvirt connections."
20975 #: ../inspector/virt-inspector.pod:48
20977 "All of the information available from virt-inspector is also available "
20978 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
20979 "The same information can also be fetched using guestfish or via libguestfs "
20980 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
20981 "WITH OTHER PROGRAMMING LANGUAGES>)."
20985 #: ../inspector/virt-inspector.pod:81
20987 "Libvirt is only used if you specify a C<domname> on the command line. If "
20988 "you specify guest block devices directly (I<-a>), then libvirt is not used "
20993 #: ../inspector/virt-inspector.pod:94
20995 "When prompting for keys and passphrases, virt-inspector normally turns "
20996 "echoing off so you cannot see what you are typing. If you are not worried "
20997 "about Tempest attacks and there is no one else in the room you can specify "
20998 "this flag to see what you are typing."
21002 #: ../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
21004 "Specify the format of disk images given on the command line. If this is "
21005 "omitted then the format is autodetected from the content of the disk image."
21009 #: ../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
21011 "If disk images are requested from libvirt, then this program asks libvirt "
21012 "for this information. In this case, the value of the format parameter is "
21017 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:391 ../resize/virt-resize.pod:483 ../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
21019 "If working with untrusted raw-format guest disk images, you should ensure "
21020 "the format is always specified."
21024 #: ../inspector/virt-inspector.pod:139
21025 msgid "Previous versions of virt-inspector allowed you to write either:"
21029 #: ../inspector/virt-inspector.pod:145
21032 " virt-inspector guestname\n"
21037 #: ../inspector/virt-inspector.pod:153
21042 #: ../inspector/virt-inspector.pod:155
21044 "The virt-inspector XML is described precisely in a RELAX NG schema file "
21045 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
21046 "just an overview."
21050 #: ../inspector/virt-inspector.pod:159
21052 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
21053 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
21054 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
21055 "which is vanishingly rare in real world VMs."
21059 #: ../inspector/virt-inspector.pod:164
21060 msgid "E<lt>operatingsystemE<gt>"
21064 #: ../inspector/virt-inspector.pod:166
21066 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
21067 "describe the operating system, its architecture, the descriptive \"product "
21068 "name\" string, the type of OS and so on, as in this example:"
21072 #: ../inspector/virt-inspector.pod:170
21075 " <operatingsystems>\n"
21076 " <operatingsystem>\n"
21077 " <root>/dev/sda2</root>\n"
21078 " <name>windows</name>\n"
21079 " <arch>i386</arch>\n"
21080 " <distro>windows</distro>\n"
21081 " <product_name>Windows 7 Enterprise</product_name>\n"
21082 " <product_variant>Client</product_variant>\n"
21083 " <major_version>6</major_version>\n"
21084 " <minor_version>1</minor_version>\n"
21085 " <windows_systemroot>/Windows</windows_systemroot>\n"
21086 " <format>installed</format>\n"
21091 #: ../inspector/virt-inspector.pod:183
21093 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
21094 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
21095 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
21096 "architecture. The other fields are fairly self-explanatory, but because "
21097 "these fields are taken directly from the libguestfs inspection API you can "
21098 "find precise information from L<guestfs(3)/INSPECTION>."
21102 #: ../inspector/virt-inspector.pod:191
21104 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
21105 "of view of libguestfs (block devices may have completely different names "
21106 "inside the VM itself)."
21110 #: ../inspector/virt-inspector.pod:195
21111 msgid "E<lt>mountpointsE<gt>"
21115 #: ../inspector/virt-inspector.pod:197
21117 "Un*x-like guests typically have multiple filesystems which are mounted at "
21118 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
21119 "element which looks like this:"
21123 #: ../inspector/virt-inspector.pod:201
21126 " <operatingsystems>\n"
21127 " <operatingsystem>\n"
21130 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
21131 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
21132 " </mountpoints>\n"
21137 #: ../inspector/virt-inspector.pod:209
21139 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
21140 "and may have completely different names inside the guest. Only mountable "
21141 "filesystems appear in this list, not things like swap devices."
21145 #: ../inspector/virt-inspector.pod:214
21146 msgid "E<lt>filesystemsE<gt>"
21150 #: ../inspector/virt-inspector.pod:216
21152 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
21153 "filesystems belonging to the guest, including swap and empty partitions. "
21154 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
21155 "this OS or shared with this OS and other OSes)."
21159 #: ../inspector/virt-inspector.pod:222
21160 msgid "You might see something like this:"
21164 #: ../inspector/virt-inspector.pod:224
21167 " <operatingsystems>\n"
21168 " <operatingsystem>\n"
21171 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21172 " <type>ext4</type>\n"
21173 " <label>Fedora-13-x86_64</label>\n"
21174 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
21180 #: ../inspector/virt-inspector.pod:234
21182 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
21183 "the label, and the UUID."
21187 #: ../inspector/virt-inspector.pod:237
21188 msgid "E<lt>applicationsE<gt>"
21192 #: ../inspector/virt-inspector.pod:239
21194 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
21195 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
21200 #: ../inspector/virt-inspector.pod:243
21202 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
21203 "Typical values would be C<rpm> and C<deb>."
21207 #: ../inspector/virt-inspector.pod:246
21209 "E<lt>package_managementE<gt>, if present, describes the package manager. "
21210 "Typical values include C<yum>, C<up2date> and C<apt>"
21214 #: ../inspector/virt-inspector.pod:249
21215 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
21219 #: ../inspector/virt-inspector.pod:252
21222 " <operatingsystems>\n"
21223 " <operatingsystem>\n"
21225 " <applications>\n"
21227 " <name>coreutils</name>\n"
21228 " <version>8.5</version>\n"
21229 " <release>1</release>\n"
21230 " </application>\n"
21235 #: ../inspector/virt-inspector.pod:262
21237 "The version and release fields may not be available for some types guests. "
21238 "Other fields are possible, see "
21239 "L<guestfs(3)/guestfs_inspect_list_applications>."
21243 #: ../inspector/virt-inspector.pod:266
21244 msgid "E<lt>drive_mappingsE<gt>"
21248 #: ../inspector/virt-inspector.pod:268
21250 "For operating systems like Windows which use drive letters, virt-inspector "
21251 "is able to find out how drive letters map to filesystems."
21255 #: ../inspector/virt-inspector.pod:272
21258 " <operatingsystems>\n"
21259 " <operatingsystem>\n"
21261 " <drive_mappings>\n"
21262 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
21263 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
21264 " </drive_mappings>\n"
21269 #: ../inspector/virt-inspector.pod:280
21271 "In the example above, drive C maps to the filesystem on the second partition "
21272 "on the first disk, and drive E maps to the filesystem on the first partition "
21273 "on the second disk."
21277 #: ../inspector/virt-inspector.pod:284
21279 "Note that this only covers permanent local filesystem mappings, not things "
21280 "like network shares. Furthermore NTFS volume mount points may not be listed "
21285 #: ../inspector/virt-inspector.pod:288
21286 msgid "E<lt>iconE<gt>"
21290 #: ../inspector/virt-inspector.pod:290
21292 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
21293 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
21294 "very large and high quality."
21298 #: ../inspector/virt-inspector.pod:294
21301 " <operatingsystems>\n"
21302 " <operatingsystem>\n"
21305 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
21306 " [... many lines of base64 data ...]\n"
21312 #: ../inspector/virt-inspector.pod:302
21314 "To display the icon, you have to extract it and convert the base64 data back "
21315 "to a binary file. Use an XPath query or simply an editor to extract the "
21316 "data, then use the coreutils L<base64(1)> program to do the conversion back "
21321 #: ../inspector/virt-inspector.pod:307
21324 " base64 -i -d < icon.data > icon.png\n"
21329 #: ../inspector/virt-inspector.pod:309
21330 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
21334 #: ../inspector/virt-inspector.pod:311
21336 "Virt-inspector can detect some operating system installers on install disks, "
21337 "live CDs, bootable USB keys and more."
21341 #: ../inspector/virt-inspector.pod:314
21343 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
21344 "fields may be present to indicate a live CD, network installer, or one part "
21345 "of a multipart CD. For example:"
21349 #: ../inspector/virt-inspector.pod:318
21352 " <operatingsystems>\n"
21353 " <operatingsystem>\n"
21354 " <root>/dev/sda</root>\n"
21355 " <name>linux</name>\n"
21356 " <arch>i386</arch>\n"
21357 " <distro>ubuntu</distro>\n"
21358 " <product_name>Ubuntu 10.10 "Maverick "
21359 "Meerkat"</product_name>\n"
21360 " <major_version>10</major_version>\n"
21361 " <minor_version>10</minor_version>\n"
21362 " <format>installer</format>\n"
21368 #: ../inspector/virt-inspector.pod:330
21369 msgid "USING XPATH"
21373 #: ../inspector/virt-inspector.pod:332
21375 "You can use the XPath query language to select parts of the XML. We "
21376 "recommend using C<xmlstarlet> to perform XPath queries from the command "
21381 #: ../inspector/virt-inspector.pod:338
21384 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
21386 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21387 " <type>ext4</type>\n"
21393 #: ../inspector/virt-inspector.pod:344
21396 " $ virt-inspector -d Guest | \\\n"
21397 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
21403 #: ../inspector/virt-inspector.pod:348
21406 " $ virt-inspector -d Guest | \\\n"
21407 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
21408 " [displays the guest icon, if there is one]\n"
21413 #: ../inspector/virt-inspector.pod:359
21414 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
21418 #: ../inspector/virt-inspector.pod:361
21420 "Early versions of libguestfs shipped with a different virt-inspector program "
21421 "written in Perl (the current version is written in C). The XML output of "
21422 "the Perl virt-inspector was different and it could also output in other "
21423 "formats like text."
21427 #: ../inspector/virt-inspector.pod:366
21428 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
21432 #: ../inspector/virt-inspector.pod:369
21434 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
21435 "versions of virt-inspector with different names:"
21439 #: ../inspector/virt-inspector.pod:372
21442 " virt-inspector Old Perl version.\n"
21443 " virt-inspector2 New C version.\n"
21448 #: ../inspector/virt-inspector.pod:382
21450 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
21451 "L<base64(1)>, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
21455 #: ../inspector/virt-inspector.pod:399
21456 msgid "Matthew Booth L<mbooth@redhat.com>"
21460 #: ../java/examples/guestfs-java.pod:5
21461 msgid "guestfs-java - How to use libguestfs from Java"
21465 #: ../java/examples/guestfs-java.pod:9
21468 " import com.redhat.et.libguestfs.*;\n"
21473 #: ../java/examples/guestfs-java.pod:11
21476 " GuestFS g = new GuestFS ();\n"
21477 " g.add_drive_opts (\"disk.img\", null);\n"
21483 #: ../java/examples/guestfs-java.pod:17
21485 "This manual page documents how to call libguestfs from the Java programming "
21486 "language. This page just documents the differences from the C API and gives "
21487 "some examples. If you are not familiar with using libguestfs, you also need "
21488 "to read L<guestfs(3)>."
21492 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
21493 msgid "CLOSING THE HANDLE"
21497 #: ../java/examples/guestfs-java.pod:24
21499 "The handle is closed when it is reaped by the garbage collector. Because "
21500 "libguestfs handles include a lot of state, it is also possible to close (and "
21501 "hence free) them explicitly by calling the C<close> method."
21505 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
21510 #: ../java/examples/guestfs-java.pod:31
21512 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
21513 "exception. This has a single parameter which is the error message (a "
21518 #: ../java/examples/guestfs-java.pod:35
21519 msgid "Calling any method on a closed handle raises the same exception."
21523 #: ../java/examples/guestfs-java.pod:47
21525 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21526 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21527 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21528 "L<http://caml.inria.fr/>."
21532 #: ../ocaml/examples/guestfs-ocaml.pod:5
21533 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
21537 #: ../ocaml/examples/guestfs-ocaml.pod:9
21538 msgid "Module style:"
21542 #: ../ocaml/examples/guestfs-ocaml.pod:11
21545 " let g = Guestfs.create () in\n"
21546 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21547 " Guestfs.launch g;\n"
21552 #: ../ocaml/examples/guestfs-ocaml.pod:15
21553 msgid "Object-oriented style:"
21557 #: ../ocaml/examples/guestfs-ocaml.pod:17
21560 " let g = new Guestfs.guestfs () in\n"
21561 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21567 #: ../ocaml/examples/guestfs-ocaml.pod:21
21570 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
21572 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
21577 #: ../ocaml/examples/guestfs-ocaml.pod:27
21579 "This manual page documents how to call libguestfs from the OCaml programming "
21580 "language. This page just documents the differences from the C API and gives "
21581 "some examples. If you are not familiar with using libguestfs, you also need "
21582 "to read L<guestfs(3)>."
21586 #: ../ocaml/examples/guestfs-ocaml.pod:32
21587 msgid "PROGRAMMING STYLES"
21591 #: ../ocaml/examples/guestfs-ocaml.pod:34
21593 "There are two different programming styles supported by the OCaml bindings. "
21594 "You can use a module style, with each C function mapped to an OCaml "
21599 #: ../ocaml/examples/guestfs-ocaml.pod:38
21602 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
21607 #: ../ocaml/examples/guestfs-ocaml.pod:40
21612 #: ../ocaml/examples/guestfs-ocaml.pod:42
21615 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
21620 #: ../ocaml/examples/guestfs-ocaml.pod:44
21622 "Alternately you can use an object-oriented style, calling methods on the "
21623 "class C<Guestfs.guestfs>:"
21627 #: ../ocaml/examples/guestfs-ocaml.pod:47
21630 " method set_verbose : bool -> unit\n"
21635 #: ../ocaml/examples/guestfs-ocaml.pod:49
21637 "The object-oriented style is usually briefer, and the minor performance "
21638 "penalty isn't noticable in the general overhead of performing libguestfs "
21643 #: ../ocaml/examples/guestfs-ocaml.pod:55
21645 "The handle is closed when it is reaped by the garbage collector. Because "
21646 "libguestfs handles include a lot of state, it is also possible to close (and "
21647 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
21652 #: ../ocaml/examples/guestfs-ocaml.pod:62
21654 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
21655 "exception. This has a single parameter which is the error message (a "
21660 #: ../ocaml/examples/guestfs-ocaml.pod:66
21662 "Calling any function/method on a closed handle raises "
21663 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
21668 #: ../ocaml/examples/guestfs-ocaml.pod:80
21670 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21671 "L<guestfs-java(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21672 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21673 "L<http://caml.inria.fr/>."
21677 #: ../perl/examples/guestfs-perl.pod:5
21678 msgid "guestfs-perl - How to use libguestfs from Perl"
21682 #: ../perl/examples/guestfs-perl.pod:9
21685 " use Sys::Guestfs;\n"
21690 #: ../perl/examples/guestfs-perl.pod:11
21693 " my $h = Sys::Guestfs->new ();\n"
21694 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
21695 " $h->launch ();\n"
21696 " $h->mount_options ('', '/dev/sda1', '/');\n"
21697 " $h->touch ('/hello');\n"
21703 #: ../perl/examples/guestfs-perl.pod:20
21705 "This manual page documents how to call libguestfs from the Perl programming "
21706 "language. This page just documents the differences from the C API and gives "
21707 "some examples. If you are not familiar with using libguestfs, you also need "
21708 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
21712 #: ../perl/examples/guestfs-perl.pod:26
21717 #: ../perl/examples/guestfs-perl.pod:28
21719 "Errors from libguestfs functions turn into calls to C<croak> (see "
21724 #: ../perl/examples/guestfs-perl.pod:41
21726 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
21727 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
21728 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
21729 "L<http://libguestfs.org/>."
21733 #: ../python/examples/guestfs-python.pod:5
21734 msgid "guestfs-python - How to use libguestfs from Python"
21738 #: ../python/examples/guestfs-python.pod:9
21741 " import guestfs\n"
21742 " g = guestfs.GuestFS ()\n"
21743 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
21749 #: ../python/examples/guestfs-python.pod:16
21751 "This manual page documents how to call libguestfs from the Python "
21752 "programming language. This page just documents the differences from the C "
21753 "API and gives some examples. If you are not familiar with using libguestfs, "
21754 "you also need to read L<guestfs(3)>."
21758 #: ../python/examples/guestfs-python.pod:23
21760 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
21761 "single string argument which is the error message."
21765 #: ../python/examples/guestfs-python.pod:26
21766 msgid "MORE DOCUMENTATION"
21770 #: ../python/examples/guestfs-python.pod:28
21775 #: ../python/examples/guestfs-python.pod:30
21779 " >>> import guestfs\n"
21780 " >>> help (guestfs)\n"
21785 #: ../python/examples/guestfs-python.pod:44
21787 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21788 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
21789 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
21793 #: ../rescue/virt-rescue.pod:5
21794 msgid "virt-rescue - Run a rescue shell on a virtual machine"
21798 #: ../rescue/virt-rescue.pod:9
21801 " virt-rescue [--options] -d domname\n"
21806 #: ../rescue/virt-rescue.pod:11
21809 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
21814 #: ../rescue/virt-rescue.pod:15
21817 " virt-rescue [--options] domname\n"
21822 #: ../rescue/virt-rescue.pod:17
21825 " virt-rescue [--options] disk.img [disk.img ...]\n"
21830 #: ../rescue/virt-rescue.pod:21
21832 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
21833 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
21834 "you from doing this, but doesn't catch all cases."
21838 #: ../rescue/virt-rescue.pod:25
21840 "However if you use the I<--ro> (read only) option, then you can attach a "
21841 "shell to a live virtual machine. The results might be strange or "
21842 "inconsistent at times but you won't get disk corruption."
21846 #: ../rescue/virt-rescue.pod:31
21848 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
21849 "need for a CD. virt-rescue gives you a rescue shell and some simple "
21850 "recovery tools which you can use to examine or rescue a virtual machine or "
21855 #: ../rescue/virt-rescue.pod:36
21857 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
21858 "on disk image(s):"
21862 #: ../rescue/virt-rescue.pod:39
21865 " virt-rescue -d GuestName\n"
21870 #: ../rescue/virt-rescue.pod:41
21873 " virt-rescue --ro -a /path/to/disk.img\n"
21878 #: ../rescue/virt-rescue.pod:43
21881 " virt-rescue -a /dev/sdc\n"
21886 #: ../rescue/virt-rescue.pod:45
21887 msgid "For live VMs you I<must> use the --ro option."
21891 #: ../rescue/virt-rescue.pod:47
21893 "When you run virt-rescue on a virtual machine or disk image, you are placed "
21894 "in an interactive bash shell where you can use many ordinary Linux "
21895 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
21896 "appliance. You must mount the virtual machine's filesystems by hand. There "
21897 "is an empty directory called C</sysroot> where you can mount filesystems."
21901 #: ../rescue/virt-rescue.pod:54
21903 "In the example below, we list logical volumes, then choose one to mount "
21904 "under C</sysroot>:"
21908 #: ../rescue/virt-rescue.pod:57
21912 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
21913 " lv_root vg_f11x64 -wi-a- 8.83G\n"
21914 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
21915 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
21916 " ><rescue> ls /sysroot\n"
21921 #: ../rescue/virt-rescue.pod:64
21923 "If you don't know what filesystems are available on the virtual machine then "
21924 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
21928 #: ../rescue/virt-rescue.pod:70
21930 "Virt-rescue can be used on I<any> disk image file or device, not just a "
21931 "virtual machine. For example you can use it on a blank file if you want to "
21932 "partition that file (although we would recommend using L<guestfish(1)> "
21933 "instead as it is more suitable for this purpose). You can even use "
21934 "virt-rescue on things like SD cards."
21938 #: ../rescue/virt-rescue.pod:76
21940 "Virt-rescue does not require root. You only need to run it as root if you "
21941 "need root to open the disk image."
21945 #: ../rescue/virt-rescue.pod:79
21947 "This tool is just designed for quick interactive hacking on a virtual "
21948 "machine. For more structured access to a virtual machine disk image, you "
21949 "should use L<guestfs(3)>. To get a structured shell that you can use to "
21950 "make scripted changes to guests, use L<guestfish(1)>."
21954 #: ../rescue/virt-rescue.pod:103
21955 msgid "B<--append kernelopts>"
21959 #: ../rescue/virt-rescue.pod:105
21960 msgid "Pass additional options to the rescue kernel."
21964 #: ../rescue/virt-rescue.pod:135
21967 " virt-rescue --format=raw -a disk.img\n"
21972 #: ../rescue/virt-rescue.pod:139
21975 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
21980 #: ../rescue/virt-rescue.pod:148
21985 #: ../rescue/virt-rescue.pod:150
21986 msgid "B<--memsize MB>"
21990 #: ../rescue/virt-rescue.pod:152
21992 "Change the amount of memory allocated to the rescue system. The default is "
21993 "set by libguestfs and is small but adequate for running system tools. The "
21994 "occasional program might need more memory. The parameter is specified in "
21999 #: ../rescue/virt-rescue.pod:157
22000 msgid "B<--network>"
22004 #: ../rescue/virt-rescue.pod:159
22005 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
22009 #: ../rescue/virt-rescue.pod:165
22010 msgid "Open the image read-only."
22014 #: ../rescue/virt-rescue.pod:175
22016 "Enable SELinux in the rescue appliance. You should read "
22017 "L<guestfs(3)/SELINUX> before using this option."
22021 #: ../rescue/virt-rescue.pod:178
22026 #: ../rescue/virt-rescue.pod:180
22027 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
22031 #: ../rescue/virt-rescue.pod:198
22033 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
22034 "are done read-write."
22038 #: ../rescue/virt-rescue.pod:211
22039 msgid "Previous versions of virt-rescue allowed you to write either:"
22043 #: ../rescue/virt-rescue.pod:213
22046 " virt-rescue disk.img [disk.img ...]\n"
22051 #: ../rescue/virt-rescue.pod:217
22054 " virt-rescue guestname\n"
22059 #: ../rescue/virt-rescue.pod:225
22064 #: ../rescue/virt-rescue.pod:227
22066 "Adding the I<--network> option enables QEMU user networking in the rescue "
22067 "appliance. There are some differences between user networking and ordinary "
22072 #: ../rescue/virt-rescue.pod:233
22073 msgid "ping does not work"
22077 #: ../rescue/virt-rescue.pod:235
22079 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
22080 "send the ping packets, and because virt-rescue must be able to run as "
22081 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
22082 "command. The ping command will appear to resolve addresses but will not be "
22083 "able to send or receive any packets. This does not mean that the network is "
22088 #: ../rescue/virt-rescue.pod:242
22089 msgid "cannot receive connections"
22093 #: ../rescue/virt-rescue.pod:244
22094 msgid "QEMU user networking cannot receive incoming connections."
22098 #: ../rescue/virt-rescue.pod:246
22099 msgid "making TCP connections"
22103 #: ../rescue/virt-rescue.pod:248
22105 "The virt-rescue appliance needs to be small and so does not include many "
22106 "network tools. In particular there is no L<telnet(1)> command. You can "
22107 "make TCP connections from the shell using the magical "
22108 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
22112 #: ../rescue/virt-rescue.pod:253
22115 " exec 3<>/dev/tcp/redhat.com/80\n"
22116 " echo \"GET /\" >&3\n"
22122 #: ../rescue/virt-rescue.pod:257
22123 msgid "See L<bash(1)> for more details."
22127 #: ../rescue/virt-rescue.pod:263
22129 "Several environment variables affect virt-rescue. See "
22130 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
22134 #: ../rescue/virt-rescue.pod:290
22136 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
22137 "L<http://libguestfs.org/>."
22141 #: ../resize/virt-resize.pod:5
22142 msgid "virt-resize - Resize a virtual machine disk"
22146 #: ../resize/virt-resize.pod:9
22149 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
22150 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
22151 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
22156 #: ../resize/virt-resize.pod:15
22158 "Virt-resize is a tool which can resize a virtual machine disk, making it "
22159 "larger or smaller overall, and resizing or deleting any partitions contained "
22164 #: ../resize/virt-resize.pod:19
22166 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
22167 "not> be used on live virtual machines - for consistent results, shut the "
22168 "virtual machine down before resizing it."
22172 #: ../resize/virt-resize.pod:23
22174 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
22175 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
22179 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:597 ../sparsify/virt-sparsify.pod:203 ../src/guestfs.pod:484 ../src/guestfs.pod:1302 ../src/guestfs.pod:1441 ../src/guestfs.pod:2690
22184 #: ../resize/virt-resize.pod:33
22186 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
22187 "fill the extra 5GB of space."
22191 #: ../resize/virt-resize.pod:36
22194 " virt-filesystems --long -h --all -a olddisk\n"
22199 #: ../resize/virt-resize.pod:38
22202 " truncate -r olddisk newdisk\n"
22203 " truncate -s +5G newdisk\n"
22208 #: ../resize/virt-resize.pod:41
22211 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
22212 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
22217 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:604 ../sparsify/virt-sparsify.pod:210 ../src/guestfs.pod:490 ../src/guestfs.pod:1306 ../src/guestfs.pod:1445 ../src/guestfs.pod:2715
22222 #: ../resize/virt-resize.pod:46
22224 "As above, but make the /boot partition 200MB bigger, while giving the "
22225 "remaining space to /dev/sda2:"
22229 #: ../resize/virt-resize.pod:49
22232 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22233 " olddisk newdisk\n"
22238 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:610 ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:501 ../src/guestfs.pod:1451
22243 #: ../resize/virt-resize.pod:54
22245 "As in the first example, but expand a logical volume as the final step. "
22246 "This is what you would typically use for Linux guests that use LVM:"
22250 #: ../resize/virt-resize.pod:58
22253 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
22254 " olddisk newdisk\n"
22259 #: ../resize/virt-resize.pod:61
22264 #: ../resize/virt-resize.pod:63
22266 "As in the first example, but the output format will be qcow2 instead of a "
22271 #: ../resize/virt-resize.pod:66
22274 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
22275 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
22280 #: ../resize/virt-resize.pod:71
22281 msgid "DETAILED USAGE"
22285 #: ../resize/virt-resize.pod:73
22286 msgid "EXPANDING A VIRTUAL MACHINE DISK"
22290 #: ../resize/virt-resize.pod:77
22291 msgid "1. Shut down the virtual machine"
22295 #: ../resize/virt-resize.pod:79
22296 msgid "2. Locate input disk image"
22300 #: ../resize/virt-resize.pod:81
22302 "Locate the input disk image (ie. the file or device on the host containing "
22303 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
22304 "dumpxml> like this to find the disk image name:"
22308 #: ../resize/virt-resize.pod:85
22311 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
22312 " Found 1 nodes:\n"
22314 " <source dev=\"/dev/vg/lv_guest\" />\n"
22319 #: ../resize/virt-resize.pod:90
22320 msgid "3. Look at current sizing"
22324 #: ../resize/virt-resize.pod:92
22325 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
22329 #: ../resize/virt-resize.pod:95
22332 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
22333 " Name Type Size Parent\n"
22334 " /dev/sda1 partition 101M /dev/sda\n"
22335 " /dev/sda2 partition 7.9G /dev/sda\n"
22336 " /dev/sda device 8.0G -\n"
22341 #: ../resize/virt-resize.pod:101
22343 "(This example is a virtual machine with an 8 GB disk which we would like to "
22344 "expand up to 10 GB)."
22348 #: ../resize/virt-resize.pod:104
22349 msgid "4. Create output disk"
22353 #: ../resize/virt-resize.pod:106
22355 "Virt-resize cannot do in-place disk modifications. You have to have space "
22356 "to store the resized output disk."
22360 #: ../resize/virt-resize.pod:109
22361 msgid "To store the resized disk image in a file, create a file of a suitable size:"
22365 #: ../resize/virt-resize.pod:112
22368 " # rm -f outdisk\n"
22369 " # truncate -s 10G outdisk\n"
22374 #: ../resize/virt-resize.pod:115
22375 msgid "Or use L<lvcreate(1)> to create a logical volume:"
22379 #: ../resize/virt-resize.pod:117
22382 " # lvcreate -L 10G -n lv_name vg_name\n"
22387 #: ../resize/virt-resize.pod:119
22388 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
22392 #: ../resize/virt-resize.pod:121
22395 " # virsh pool-list\n"
22396 " # virsh vol-create-as poolname newvol 10G\n"
22401 #: ../resize/virt-resize.pod:124
22406 #: ../resize/virt-resize.pod:126
22408 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
22409 "file) and the output disk. The output disk is the one created in the "
22414 #: ../resize/virt-resize.pod:130
22417 " # virt-resize indisk outdisk\n"
22422 #: ../resize/virt-resize.pod:132
22424 "This command just copies disk image C<indisk> to disk image C<outdisk> "
22425 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
22426 "larger, then an extra, empty partition is created at the end of the disk "
22427 "covering the extra space. If C<outdisk> is smaller, then it will give an "
22432 #: ../resize/virt-resize.pod:138
22434 "More realistically you'd want to expand existing partitions in the disk "
22435 "image by passing extra options (for the full list see the L</OPTIONS> "
22440 #: ../resize/virt-resize.pod:142
22442 "L</--expand> is the most useful option. It expands the named partition "
22443 "within the disk to fill any extra space:"
22447 #: ../resize/virt-resize.pod:145
22450 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
22455 #: ../resize/virt-resize.pod:147
22457 "(In this case, an extra partition is I<not> created at the end of the disk, "
22458 "because there will be no unused space)."
22462 #: ../resize/virt-resize.pod:150
22464 "L</--resize> is the other commonly used option. The following would "
22465 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
22466 "rest of the available space:"
22470 #: ../resize/virt-resize.pod:154
22473 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22474 " indisk outdisk\n"
22479 #: ../resize/virt-resize.pod:157
22481 "If the expanded partition in the image contains a filesystem or LVM PV, then "
22482 "if virt-resize knows how, it will resize the contents, the equivalent of "
22483 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
22484 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
22485 "filesystems, so you would have to online resize them after booting the "
22490 #: ../resize/virt-resize.pod:164
22491 msgid "Other options are covered below."
22495 #: ../resize/virt-resize.pod:166
22500 #: ../resize/virt-resize.pod:168
22501 msgid "Thoroughly test the new disk image I<before> discarding the old one."
22505 #: ../resize/virt-resize.pod:170
22506 msgid "If you are using libvirt, edit the XML to point at the new disk:"
22510 #: ../resize/virt-resize.pod:172
22513 " # virsh edit guestname\n"
22518 #: ../resize/virt-resize.pod:174
22520 "Change E<lt>source ...E<gt>, see "
22521 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
22525 #: ../resize/virt-resize.pod:177
22526 msgid "Then start up the domain with the new, resized disk:"
22530 #: ../resize/virt-resize.pod:179
22533 " # virsh start guestname\n"
22538 #: ../resize/virt-resize.pod:181
22540 "and check that it still works. See also the L</NOTES> section below for "
22541 "additional information."
22545 #: ../resize/virt-resize.pod:184
22546 msgid "7. Resize LVs etc inside the guest"
22550 #: ../resize/virt-resize.pod:186
22551 msgid "(This can also be done offline using L<guestfish(1)>)"
22555 #: ../resize/virt-resize.pod:188
22557 "Once the guest has booted you should see the new space available, at least "
22558 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
22559 "may need to resize LVs inside PVs, and also resize filesystem types that "
22560 "virt-resize does not know how to expand."
22564 #: ../resize/virt-resize.pod:195
22565 msgid "SHRINKING A VIRTUAL MACHINE DISK"
22569 #: ../resize/virt-resize.pod:197
22571 "Shrinking is somewhat more complex than expanding, and only an overview is "
22576 #: ../resize/virt-resize.pod:200
22578 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
22579 "filesystems). The user has to shrink content before passing the disk image "
22580 "to virt-resize, and virt-resize will check that the content has been shrunk "
22585 #: ../resize/virt-resize.pod:205
22586 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
22590 #: ../resize/virt-resize.pod:207
22592 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
22593 "steps 3 and 4 above to allocate a new disk image."
22597 #: ../resize/virt-resize.pod:210
22598 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
22602 #: ../resize/virt-resize.pod:213
22603 msgid "IGNORING OR DELETING PARTITIONS"
22607 #: ../resize/virt-resize.pod:215
22609 "virt-resize also gives a convenient way to ignore or delete partitions when "
22610 "copying from the input disk to the output disk. Ignoring a partition speeds "
22611 "up the copy where you don't care about the existing contents of a "
22612 "partition. Deleting a partition removes it completely, but note that it "
22613 "also renumbers any partitions after the one which is deleted, which can "
22614 "leave some guests unbootable."
22618 #: ../resize/virt-resize.pod:222
22619 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
22623 #: ../resize/virt-resize.pod:224
22625 "If the input disk is in qcow2 format, then you may prefer that the output is "
22626 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
22627 "the fly. The output format is simply determined by the format of the empty "
22628 "output container that you provide. Thus to create qcow2 output, use:"
22632 #: ../resize/virt-resize.pod:230
22635 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
22640 #: ../resize/virt-resize.pod:232
22641 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
22645 #: ../resize/virt-resize.pod:234
22646 msgid "Similarly, to get non-sparse raw output use:"
22650 #: ../resize/virt-resize.pod:236
22653 " fallocate -l size outdisk\n"
22658 #: ../resize/virt-resize.pod:238
22660 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
22661 "if=/dev/zero of=outdisk bs=1M count=..>)"
22665 #: ../resize/virt-resize.pod:241
22666 msgid "LOGICAL PARTITIONS"
22670 #: ../resize/virt-resize.pod:243
22672 "Logical partitions (a.k.a. C</dev/sda5+> on disks using DOS partition "
22673 "tables) cannot be resized."
22677 #: ../resize/virt-resize.pod:246
22679 "To understand what is going on, firstly one of the four partitions "
22680 "C</dev/sda1-4> will have MBR partition type C<05> or C<0f>. This is called "
22681 "the B<extended partition>. Use L<virt-filesystems(1)> to see the MBR "
22686 #: ../resize/virt-resize.pod:251
22687 msgid "Logical partitions live inside the extended partition."
22691 #: ../resize/virt-resize.pod:253
22693 "The extended partition can be expanded, but not shrunk (unless you force it, "
22694 "which is not advisable). When the extended partition is copied across, all "
22695 "the logical partitions contained inside are copied over implicitly. "
22696 "Virt-resize does not look inside the extended partition, so it copies the "
22697 "logical partitions blindly."
22701 #: ../resize/virt-resize.pod:259
22703 "You cannot specify a logical partition (C</dev/sda5+>) at all on the command "
22704 "line. Doing so will give an error."
22708 #: ../resize/virt-resize.pod:268 ../sparsify/virt-sparsify.pod:105
22709 msgid "Display help."
22713 #: ../resize/virt-resize.pod:270
22714 msgid "B<--align-first auto>"
22718 #: ../resize/virt-resize.pod:272
22719 msgid "B<--align-first never>"
22723 #: ../resize/virt-resize.pod:274
22724 msgid "B<--align-first always>"
22728 #: ../resize/virt-resize.pod:276
22730 "Align the first partition for improved performance (see also the "
22731 "I<--alignment> option)."
22735 #: ../resize/virt-resize.pod:279
22737 "The default is I<--align-first auto> which only aligns the first partition "
22738 "if it is safe to do so. That is, only when we know how to fix the "
22739 "bootloader automatically, and at the moment that can only be done for "
22744 #: ../resize/virt-resize.pod:284
22746 "I<--align-first never> means we never move the first partition. This is the "
22747 "safest option. Try this if the guest does not boot after resizing."
22751 #: ../resize/virt-resize.pod:288
22753 "I<--align-first always> means we always align the first partition (if it "
22754 "needs to be aligned). For some guests this will break the bootloader, "
22755 "making the guest unbootable."
22759 #: ../resize/virt-resize.pod:292
22760 msgid "B<--alignment N>"
22764 #: ../resize/virt-resize.pod:294
22766 "Set the alignment of partitions to C<N> sectors. The default in virt-resize "
22767 "E<lt> 1.13.19 was 64 sectors, and after that is 128 sectors."
22771 #: ../resize/virt-resize.pod:298
22773 "Assuming 512 byte sector size inside the guest, here are some suitable "
22778 #: ../resize/virt-resize.pod:303
22779 msgid "I<--alignment 1> (512 bytes)"
22783 #: ../resize/virt-resize.pod:305
22785 "The partitions would be packed together as closely as possible, but would be "
22786 "completely unaligned. In some cases this can cause very poor performance. "
22787 "See L<virt-alignment-scan(1)> for further details."
22791 #: ../resize/virt-resize.pod:309
22792 msgid "I<--alignment 8> (4K)"
22796 #: ../resize/virt-resize.pod:311
22798 "This would be the minimum acceptable alignment for reasonable performance on "
22803 #: ../resize/virt-resize.pod:314
22804 msgid "I<--alignment 128> (64K)"
22808 #: ../resize/virt-resize.pod:316
22810 "This alignment provides good performance when the host is using high end "
22815 #: ../resize/virt-resize.pod:319
22816 msgid "I<--alignment 2048> (1M)"
22820 #: ../resize/virt-resize.pod:321
22822 "This is the standard alignment used by all newly installed guests since "
22827 #: ../resize/virt-resize.pod:326
22832 #: ../resize/virt-resize.pod:328 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
22837 #: ../resize/virt-resize.pod:330 ../tools/virt-win-reg.pl:122
22838 msgid "Enable debugging messages."
22842 #: ../resize/virt-resize.pod:332
22843 msgid "B<--delete part>"
22847 #: ../resize/virt-resize.pod:334
22849 "Delete the named partition. It would be more accurate to describe this as "
22850 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
22851 "the original disk image is left intact."
22855 #: ../resize/virt-resize.pod:338
22857 "Note that when you delete a partition, then anything contained in the "
22858 "partition is also deleted. Furthermore, this causes any partitions that "
22859 "come after to be I<renumbered>, which can easily make your guest unbootable."
22863 #: ../resize/virt-resize.pod:343 ../resize/virt-resize.pod:404 ../resize/virt-resize.pod:531 ../sparsify/virt-sparsify.pod:145
22864 msgid "You can give this option multiple times."
22868 #: ../resize/virt-resize.pod:345
22869 msgid "B<--expand part>"
22873 #: ../resize/virt-resize.pod:347
22875 "Expand the named partition so it uses up all extra space (space left over "
22876 "after any other resize changes that you request have been done)."
22880 #: ../resize/virt-resize.pod:350
22882 "If virt-resize knows how, it will expand the direct content of the "
22883 "partition. For example, if the partition is an LVM PV, it will expand the "
22884 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
22885 "content it doesn't know about alone."
22889 #: ../resize/virt-resize.pod:355
22890 msgid "Currently virt-resize can resize:"
22894 #: ../resize/virt-resize.pod:361
22895 msgid "ext2, ext3 and ext4 filesystems."
22899 #: ../resize/virt-resize.pod:365
22900 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
22904 #: ../resize/virt-resize.pod:367
22906 "The filesystem must have been shut down consistently last time it was used. "
22907 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
22908 "consistency check, so at the first boot after resizing Windows will check "
22913 #: ../resize/virt-resize.pod:374
22915 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
22916 "inside the PV, but see the I<--LV-expand> option. The user could also "
22917 "resize LVs as desired after boot."
22921 #: ../resize/virt-resize.pod:380
22922 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
22926 #: ../resize/virt-resize.pod:384 ../resize/virt-resize.pod:559
22927 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
22931 #: ../resize/virt-resize.pod:386 ../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
22932 msgid "B<--format> raw"
22936 #: ../resize/virt-resize.pod:388 ../sparsify/virt-sparsify.pod:129
22938 "Specify the format of the input disk image. If this flag is not given then "
22939 "it is auto-detected from the image itself."
22943 #: ../resize/virt-resize.pod:394
22945 "Note that this option I<does not> affect the output format. See L</QCOW2 "
22946 "AND NON-SPARSE RAW FORMATS>."
22950 #: ../resize/virt-resize.pod:397
22951 msgid "B<--ignore part>"
22955 #: ../resize/virt-resize.pod:399
22957 "Ignore the named partition. Effectively this means the partition is "
22958 "allocated on the destination disk, but the content is not copied across from "
22959 "the source disk. The content of the partition will be blank (all zero "
22964 #: ../resize/virt-resize.pod:406
22965 msgid "B<--LV-expand logvol>"
22969 #: ../resize/virt-resize.pod:408
22971 "This takes the logical volume and, as a final step, expands it to fill all "
22972 "the space available in its volume group. A typical usage, assuming a Linux "
22973 "guest with a single PV C</dev/sda2> and a root device called "
22974 "C</dev/vg_guest/lv_root> would be:"
22978 #: ../resize/virt-resize.pod:413
22981 " virt-resize indisk outdisk \\\n"
22982 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
22987 #: ../resize/virt-resize.pod:416
22989 "This would first expand the partition (and PV), and then expand the root "
22990 "device to fill the extra space in the PV."
22994 #: ../resize/virt-resize.pod:419
22996 "The contents of the LV are also resized if virt-resize knows how to do "
22997 "that. You can stop virt-resize from trying to expand the content by using "
22998 "the option I<--no-expand-content>."
23002 #: ../resize/virt-resize.pod:423
23003 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
23007 #: ../resize/virt-resize.pod:425
23009 "You can give this option multiple times, I<but> it doesn't make sense to do "
23010 "this unless the logical volumes you specify are all in different volume "
23015 #: ../resize/virt-resize.pod:429 ../sparsify/virt-sparsify.pod:147
23016 msgid "B<--machine-readable>"
23020 #: ../resize/virt-resize.pod:431 ../sparsify/virt-sparsify.pod:149
23022 "This option is used to make the output more machine friendly when being "
23023 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
23027 #: ../resize/virt-resize.pod:437
23028 msgid "B<--dryrun>"
23032 #: ../resize/virt-resize.pod:439
23033 msgid "Print a summary of what would be done, but don't do anything."
23037 #: ../resize/virt-resize.pod:441
23038 msgid "B<--no-copy-boot-loader>"
23042 #: ../resize/virt-resize.pod:443
23044 "By default, virt-resize copies over some sectors at the start of the disk "
23045 "(up to the beginning of the first partition). Commonly these sectors "
23046 "contain the Master Boot Record (MBR) and the boot loader, and are required "
23047 "in order for the guest to boot correctly."
23051 #: ../resize/virt-resize.pod:448
23053 "If you specify this flag, then this initial copy is not done. You may need "
23054 "to reinstall the boot loader in this case."
23058 #: ../resize/virt-resize.pod:451
23059 msgid "B<--no-extra-partition>"
23063 #: ../resize/virt-resize.pod:453
23065 "By default, virt-resize creates an extra partition if there is any extra, "
23066 "unused space after all resizing has happened. Use this option to prevent "
23067 "the extra partition from being created. If you do this then the extra space "
23068 "will be inaccessible until you run fdisk, parted, or some other partitioning "
23069 "tool in the guest."
23073 #: ../resize/virt-resize.pod:459
23075 "Note that if the surplus space is smaller than 10 MB, no extra partition "
23080 #: ../resize/virt-resize.pod:462
23081 msgid "B<--no-expand-content>"
23085 #: ../resize/virt-resize.pod:464
23087 "By default, virt-resize will try to expand the direct contents of "
23088 "partitions, if it knows how (see I<--expand> option above)."
23092 #: ../resize/virt-resize.pod:467
23094 "If you give the I<--no-expand-content> option then virt-resize will not "
23099 #: ../resize/virt-resize.pod:470
23100 msgid "B<--ntfsresize-force>"
23104 #: ../resize/virt-resize.pod:472
23106 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
23107 "the NTFS disk is marked as needing a consistency check. You have to use "
23108 "this option if you want to resize a Windows guest multiple times without "
23109 "booting into Windows between each resize."
23113 #: ../resize/virt-resize.pod:478
23114 msgid "B<--output-format> raw"
23118 #: ../resize/virt-resize.pod:480
23120 "Specify the format of the output disk image. If this flag is not given then "
23121 "it is auto-detected from the image itself."
23125 #: ../resize/virt-resize.pod:486
23127 "Note that this option I<does not create> the output format. This option "
23128 "just tells libguestfs what it is so it doesn't try to guess it. You still "
23129 "need to create the output disk with the right format. See L</QCOW2 AND "
23130 "NON-SPARSE RAW FORMATS>."
23134 #: ../resize/virt-resize.pod:495
23135 msgid "Don't print the summary."
23139 #: ../resize/virt-resize.pod:497
23140 msgid "B<--resize part=size>"
23144 #: ../resize/virt-resize.pod:499
23146 "Resize the named partition (expanding or shrinking it) so that it has the "
23151 #: ../resize/virt-resize.pod:502
23153 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
23154 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
23155 "size; or as a relative number or percentage. For example:"
23159 #: ../resize/virt-resize.pod:508
23162 " --resize /dev/sda2=10G\n"
23167 #: ../resize/virt-resize.pod:510
23170 " --resize /dev/sda4=90%\n"
23175 #: ../resize/virt-resize.pod:512
23178 " --resize /dev/sda2=+1G\n"
23183 #: ../resize/virt-resize.pod:514
23186 " --resize /dev/sda2=-200M\n"
23191 #: ../resize/virt-resize.pod:516
23194 " --resize /dev/sda1=+128K\n"
23199 #: ../resize/virt-resize.pod:518
23202 " --resize /dev/sda1=+10%\n"
23207 #: ../resize/virt-resize.pod:520
23210 " --resize /dev/sda1=-10%\n"
23215 #: ../resize/virt-resize.pod:522
23217 "You can increase the size of any partition. Virt-resize will expand the "
23218 "direct content of the partition if it knows how (see I<--expand> below)."
23222 #: ../resize/virt-resize.pod:526
23224 "You can only I<decrease> the size of partitions that contain filesystems or "
23225 "PVs which have already been shrunk. Virt-resize will check this has been "
23226 "done before proceeding, or else will print an error (see also "
23227 "I<--resize-force>)."
23231 #: ../resize/virt-resize.pod:533
23232 msgid "B<--resize-force part=size>"
23236 #: ../resize/virt-resize.pod:535
23238 "This is the same as I<--resize> except that it will let you decrease the "
23239 "size of any partition. Generally this means you will lose any data which "
23240 "was at the end of the partition you shrink, but you may not care about that "
23241 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
23242 "as a swap partition)."
23246 #: ../resize/virt-resize.pod:541
23247 msgid "See also the I<--ignore> option."
23251 #: ../resize/virt-resize.pod:543
23252 msgid "B<--shrink part>"
23256 #: ../resize/virt-resize.pod:545
23258 "Shrink the named partition until the overall disk image fits in the "
23259 "destination. The named partition B<must> contain a filesystem or PV which "
23260 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
23261 "online tools). Virt-resize will check this and give an error if it has not "
23266 #: ../resize/virt-resize.pod:551
23268 "The amount by which the overall disk must be shrunk (after carrying out all "
23269 "other operations requested by the user) is called the \"deficit\". For "
23270 "example, a straight copy (assume no other operations) from a 5GB disk image "
23271 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
23272 "would give an error unless the user specified a partition to shrink and that "
23273 "partition had more than a gigabyte of free space."
23277 #: ../resize/virt-resize.pod:569 ../sparsify/virt-sparsify.pod:177
23278 msgid "MACHINE READABLE OUTPUT"
23282 #: ../resize/virt-resize.pod:571
23284 "The I<--machine-readable> option can be used to make the output more machine "
23285 "friendly, which is useful when calling virt-resize from other programs, GUIs "
23290 #: ../resize/virt-resize.pod:575 ../sparsify/virt-sparsify.pod:183
23291 msgid "There are two ways to use this option."
23295 #: ../resize/virt-resize.pod:577
23297 "Firstly use the option on its own to query the capabilities of the "
23298 "virt-resize binary. Typical output looks like this:"
23302 #: ../resize/virt-resize.pod:580
23305 " $ virt-resize --machine-readable\n"
23307 " ntfsresize-force\n"
23315 #: ../resize/virt-resize.pod:587 ../sparsify/virt-sparsify.pod:193
23317 "A list of features is printed, one per line, and the program exits with "
23322 #: ../resize/virt-resize.pod:590 ../sparsify/virt-sparsify.pod:196
23324 "Secondly use the option in conjunction with other options to make the "
23325 "regular program output more machine friendly."
23329 #: ../resize/virt-resize.pod:593 ../sparsify/virt-sparsify.pod:199
23330 msgid "At the moment this means:"
23334 #: ../resize/virt-resize.pod:599 ../sparsify/virt-sparsify.pod:205
23336 "Progress bar messages can be parsed from stdout by looking for this regular "
23341 #: ../resize/virt-resize.pod:602 ../sparsify/virt-sparsify.pod:208
23344 " ^[0-9]+/[0-9]+$\n"
23349 #: ../resize/virt-resize.pod:606 ../sparsify/virt-sparsify.pod:212
23351 "The calling program should treat messages sent to stdout (except for "
23352 "progress bar messages) as status messages. They can be logged and/or "
23353 "displayed to the user."
23357 #: ../resize/virt-resize.pod:612
23359 "The calling program should treat messages sent to stderr as error messages. "
23360 "In addition, virt-resize exits with a non-zero status code if there was a "
23365 #: ../resize/virt-resize.pod:618
23367 "Versions of the program prior to 1.13.9 did not support the "
23368 "I<--machine-readable> option and will return an error."
23372 #: ../resize/virt-resize.pod:623
23373 msgid "\"Partition 1 does not end on cylinder boundary.\""
23377 #: ../resize/virt-resize.pod:625
23379 "Virt-resize aligns partitions to multiples of 128 sectors (see the "
23380 "I<--alignment> parameter). Usually this means the partitions will not be "
23381 "aligned to the ancient CHS geometry. However CHS geometry is meaningless "
23382 "for disks manufactured since the early 1990s, and doubly so for virtual hard "
23383 "drives. Alignment of partitions to cylinders is not required by any modern "
23384 "operating system."
23388 #: ../resize/virt-resize.pod:632
23389 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
23393 #: ../resize/virt-resize.pod:634
23395 "In Windows Vista and later versions, Microsoft switched to using a separate "
23396 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
23397 "and C</dev/sda2> is the main (C:) drive. Resizing the first (boot) "
23398 "partition causes the bootloader to fail with C<0xC0000225> error. Resizing "
23399 "the second partition (ie. C: drive) should work."
23403 #: ../resize/virt-resize.pod:641
23405 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
23406 "NTFS partitions have been expanded. This is just a safety check and (unless "
23407 "it find errors) is nothing to worry about."
23411 #: ../resize/virt-resize.pod:645
23412 msgid "GUEST BOOT STUCK AT \"GRUB\""
23416 #: ../resize/virt-resize.pod:647
23418 "If a Linux guest does not boot after resizing, and the boot is stuck after "
23419 "printing C<GRUB> on the console, try reinstalling grub."
23423 #: ../resize/virt-resize.pod:650
23426 " guestfish -i -a newdisk\n"
23427 " ><fs> cat /boot/grub/device.map\n"
23428 " # check the contents of this file are sensible or\n"
23429 " # edit the file if necessary\n"
23430 " ><fs> grub-install / /dev/vda\n"
23436 #: ../resize/virt-resize.pod:657
23438 "For more flexible guest reconfiguration, including if you need to specify "
23439 "other parameters to grub-install, use L<virt-rescue(1)>."
23443 #: ../resize/virt-resize.pod:660
23444 msgid "ALTERNATIVE TOOLS"
23448 #: ../resize/virt-resize.pod:662
23450 "There are several proprietary tools for resizing partitions. We won't "
23451 "mention any here."
23455 #: ../resize/virt-resize.pod:665
23457 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
23458 "operations on disk images. They can resize and move partitions, but I don't "
23459 "think they can do anything with the contents, and they certainly don't "
23464 #: ../resize/virt-resize.pod:670
23466 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
23467 "but at a much lower level. You will probably end up hand-calculating sector "
23468 "offsets, which is something that virt-resize was designed to avoid. If you "
23469 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
23474 #: ../resize/virt-resize.pod:690
23476 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
23477 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
23478 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
23479 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
23480 "L<virt-sparsify(1)>, L<virt-alignment-scan(1)>, L<http://libguestfs.org/>."
23484 #: ../ruby/examples/guestfs-ruby.pod:5
23485 msgid "guestfs-ruby - How to use libguestfs from Ruby"
23489 #: ../ruby/examples/guestfs-ruby.pod:9
23492 " require 'guestfs'\n"
23493 " g = Guestfs::Guestfs.new()\n"
23494 " g.add_drive_opts(\"disk.img\",\n"
23495 " :readonly => 1, :format => \"raw\")\n"
23501 #: ../ruby/examples/guestfs-ruby.pod:17
23503 "This manual page documents how to call libguestfs from the Ruby programming "
23504 "language. This page just documents the differences from the C API and gives "
23505 "some examples. If you are not familiar with using libguestfs, you also need "
23506 "to read L<guestfs(3)>."
23510 #: ../ruby/examples/guestfs-ruby.pod:24
23512 "Errors from libguestfs functions are mapped into the C<Error> exception. "
23513 "This has a single parameter which is the error message (a string)."
23517 #: ../ruby/examples/guestfs-ruby.pod:38
23519 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
23520 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
23521 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
23525 #: ../sparsify/virt-sparsify.pod:5
23526 msgid "virt-sparsify - Make a virtual machine disk sparse"
23530 #: ../sparsify/virt-sparsify.pod:9
23533 " virt-sparsify [--options] indisk outdisk\n"
23538 #: ../sparsify/virt-sparsify.pod:13
23540 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
23541 "image) sparse a.k.a. thin-provisioned. This means that free space within "
23542 "the disk image can be converted back to free space on the host."
23546 #: ../sparsify/virt-sparsify.pod:18
23548 "Virt-sparsify can locate and sparsify free space in most filesystems "
23549 "(eg. ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
23553 #: ../sparsify/virt-sparsify.pod:21
23555 "Virt-sparsify can also convert between some disk formats, for example "
23556 "converting a raw disk image to a thin-provisioned qcow2 image."
23560 #: ../sparsify/virt-sparsify.pod:24
23562 "Virt-sparsify can operate on any disk image, not just ones from virtual "
23563 "machines. If a virtual machine has more than one attached disk, you must "
23564 "sparsify each one separately."
23568 #: ../sparsify/virt-sparsify.pod:28
23569 msgid "IMPORTANT LIMITATIONS"
23573 #: ../sparsify/virt-sparsify.pod:34
23575 "Virt-sparsify does not do in-place modifications. It copies from a source "
23576 "image to a destination image, leaving the source unchanged. I<Check that "
23577 "the sparsification was successful before deleting the source image>."
23581 #: ../sparsify/virt-sparsify.pod:41
23582 msgid "The virtual machine I<must be shut down> before using this tool."
23586 #: ../sparsify/virt-sparsify.pod:45
23588 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
23589 "(1 temporary copy + 1 destination image). This is in the worst case and "
23590 "usually much less space is required."
23594 #: ../sparsify/virt-sparsify.pod:51
23595 msgid "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
23599 #: ../sparsify/virt-sparsify.pod:56
23600 msgid "Virt-sparsify cannot handle encrypted disks."
23604 #: ../sparsify/virt-sparsify.pod:60
23606 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
23607 "this space is often used for critical items like bootloaders so it's not "
23612 #: ../sparsify/virt-sparsify.pod:66
23614 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
23615 "to do this unless we can be sure there is no hibernation data, so at the "
23616 "moment swap partitions are ignored."
23620 #: ../sparsify/virt-sparsify.pod:72
23622 "You may also want to read the manual pages for the associated tools "
23623 "L<virt-filesystems(1)> and L<virt-df(1)> before starting."
23627 #: ../sparsify/virt-sparsify.pod:77
23628 msgid "Typical usage is:"
23632 #: ../sparsify/virt-sparsify.pod:79
23635 " virt-sparsify indisk outdisk\n"
23640 #: ../sparsify/virt-sparsify.pod:81
23642 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
23643 "is created, or overwritten if it already exists. The format of the input "
23644 "disk is detected (eg. qcow2) and the same format is used for the output "
23649 #: ../sparsify/virt-sparsify.pod:86
23650 msgid "To convert between formats, use the I<--convert> option:"
23654 #: ../sparsify/virt-sparsify.pod:88
23657 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
23662 #: ../sparsify/virt-sparsify.pod:90
23664 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
23665 "can find within the source disk image. You can get it to ignore (don't zero "
23666 "free space on) certain filesystems by doing:"
23670 #: ../sparsify/virt-sparsify.pod:94
23673 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
23678 #: ../sparsify/virt-sparsify.pod:96
23679 msgid "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
23683 #: ../sparsify/virt-sparsify.pod:107
23684 msgid "B<--convert> raw"
23688 #: ../sparsify/virt-sparsify.pod:109
23689 msgid "B<--convert> qcow2"
23693 #: ../sparsify/virt-sparsify.pod:111
23694 msgid "B<--convert> [other formats]"
23698 #: ../sparsify/virt-sparsify.pod:113
23700 "Use C<output-format> as the format for the destination image. If this is "
23701 "not specified, then the input format is used."
23705 #: ../sparsify/virt-sparsify.pod:116
23706 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
23710 #: ../sparsify/virt-sparsify.pod:118
23712 "You can also use any format supported by the L<qemu-img(1)> program, "
23713 "eg. C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
23717 #: ../sparsify/virt-sparsify.pod:122
23719 "Specifying the I<--convert> option is usually a good idea, because then "
23720 "virt-sparsify doesn't need to try to guess the input format."
23724 #: ../sparsify/virt-sparsify.pod:127
23725 msgid "B<--format> qcow2"
23729 #: ../sparsify/virt-sparsify.pod:135
23730 msgid "B<--ignore> filesystem"
23734 #: ../sparsify/virt-sparsify.pod:137
23735 msgid "B<--ignore> volgroup"
23739 #: ../sparsify/virt-sparsify.pod:139
23741 "Ignore the named filesystem. Free space on the filesystem will not be "
23742 "zeroed, but existing blocks of zeroes will still be sparsified."
23746 #: ../sparsify/virt-sparsify.pod:142
23748 "In the second form, this ignores the named volume group. Use the volume "
23749 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
23753 #: ../sparsify/virt-sparsify.pod:157
23754 msgid "This disables progress bars and other unnecessary output."
23758 #: ../sparsify/virt-sparsify.pod:179
23760 "The I<--machine-readable> option can be used to make the output more machine "
23761 "friendly, which is useful when calling virt-sparsify from other programs, "
23766 #: ../sparsify/virt-sparsify.pod:185
23768 "Firstly use the option on its own to query the capabilities of the "
23769 "virt-sparsify binary. Typical output looks like this:"
23773 #: ../sparsify/virt-sparsify.pod:188
23776 " $ virt-sparsify --machine-readable\n"
23784 #: ../sparsify/virt-sparsify.pod:218
23786 "The calling program should treat messages sent to stderr as error messages. "
23787 "In addition, virt-sparsify exits with a non-zero status code if there was a "
23792 #: ../sparsify/virt-sparsify.pod:224
23794 "All versions of virt-sparsify have supported the I<--machine-readable> "
23799 #: ../sparsify/virt-sparsify.pod:238
23801 "Location of the temporary directory used for the potentially large temporary "
23806 #: ../sparsify/virt-sparsify.pod:241
23808 "You should ensure there is enough free space in the worst case for a full "
23809 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
23810 "to another directory that has enough space."
23814 #: ../sparsify/virt-sparsify.pod:245
23815 msgid "This defaults to C</tmp>."
23819 #: ../sparsify/virt-sparsify.pod:249
23820 msgid "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
23824 #: ../sparsify/virt-sparsify.pod:253
23826 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
23827 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, "
23828 "L<qemu-img(1)>, L<http://libguestfs.org/>."
23832 #: ../src/guestfs-actions.pod:1
23833 msgid "guestfs_add_cdrom"
23837 #: ../src/guestfs-actions.pod:3
23841 " guestfs_add_cdrom (guestfs_h *g,\n"
23842 " const char *filename);\n"
23847 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:302 ../src/guestfs-actions.pod:323
23849 "I<This function is deprecated.> In new code, use the "
23850 "L</guestfs_add_drive_opts> call instead."
23854 #: ../src/guestfs-actions.pod:24
23856 "This call checks for the existence of C<filename>. This stops you from "
23857 "specifying other types of drive which are supported by qemu such as C<nbd:> "
23858 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
23863 #: ../src/guestfs-actions.pod:31
23865 "If you just want to add an ISO file (often you use this as an efficient way "
23866 "to transfer large files into the guest), then you should probably use "
23867 "C<guestfs_add_drive_ro> instead."
23871 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:187 ../src/guestfs-actions.pod:254 ../src/guestfs-actions.pod:291 ../src/guestfs-actions.pod:312 ../src/guestfs-actions.pod:333 ../src/guestfs-actions.pod:346 ../src/guestfs-actions.pod:360 ../src/guestfs-actions.pod:480 ../src/guestfs-actions.pod:500 ../src/guestfs-actions.pod:514 ../src/guestfs-actions.pod:559 ../src/guestfs-actions.pod:587 ../src/guestfs-actions.pod:605 ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:705 ../src/guestfs-actions.pod:719 ../src/guestfs-actions.pod:734 ../src/guestfs-actions.pod:833 ../src/guestfs-actions.pod:851 ../src/guestfs-actions.pod:865 ../src/guestfs-actions.pod:879 ../src/guestfs-actions.pod:916 ../src/guestfs-actions.pod:1099 ../src/guestfs-actions.pod:1119 ../src/guestfs-actions.pod:1137 ../src/guestfs-actions.pod:1227 ../src/guestfs-actions.pod:1286 ../src/guestfs-actions.pod:1332 ../src/guestfs-actions.pod:1372 ../src/guestfs-actions.pod:1423 ../src/guestfs-actions.pod:1474 ../src/guestfs-actions.pod:1530 ../src/guestfs-actions.pod:1582 ../src/guestfs-actions.pod:1601 ../src/guestfs-actions.pod:1615 ../src/guestfs-actions.pod:1643 ../src/guestfs-actions.pod:1713 ../src/guestfs-actions.pod:1744 ../src/guestfs-actions.pod:1769 ../src/guestfs-actions.pod:1811 ../src/guestfs-actions.pod:1924 ../src/guestfs-actions.pod:1951 ../src/guestfs-actions.pod:2166 ../src/guestfs-actions.pod:2188 ../src/guestfs-actions.pod:2275 ../src/guestfs-actions.pod:2783 ../src/guestfs-actions.pod:2927 ../src/guestfs-actions.pod:2988 ../src/guestfs-actions.pod:3023 ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4095 ../src/guestfs-actions.pod:4120 ../src/guestfs-actions.pod:4309 ../src/guestfs-actions.pod:4323 ../src/guestfs-actions.pod:4336 ../src/guestfs-actions.pod:4350 ../src/guestfs-actions.pod:4365 ../src/guestfs-actions.pod:4401 ../src/guestfs-actions.pod:4473 ../src/guestfs-actions.pod:4493 ../src/guestfs-actions.pod:4510 ../src/guestfs-actions.pod:4533 ../src/guestfs-actions.pod:4556 ../src/guestfs-actions.pod:4591 ../src/guestfs-actions.pod:4610 ../src/guestfs-actions.pod:4629 ../src/guestfs-actions.pod:4664 ../src/guestfs-actions.pod:4676 ../src/guestfs-actions.pod:4712 ../src/guestfs-actions.pod:4728 ../src/guestfs-actions.pod:4741 ../src/guestfs-actions.pod:4756 ../src/guestfs-actions.pod:4773 ../src/guestfs-actions.pod:4866 ../src/guestfs-actions.pod:4886 ../src/guestfs-actions.pod:4899 ../src/guestfs-actions.pod:4950 ../src/guestfs-actions.pod:4968 ../src/guestfs-actions.pod:4986 ../src/guestfs-actions.pod:5002 ../src/guestfs-actions.pod:5016 ../src/guestfs-actions.pod:5030 ../src/guestfs-actions.pod:5047 ../src/guestfs-actions.pod:5062 ../src/guestfs-actions.pod:5089 ../src/guestfs-actions.pod:5152 ../src/guestfs-actions.pod:5225 ../src/guestfs-actions.pod:5256 ../src/guestfs-actions.pod:5275 ../src/guestfs-actions.pod:5294 ../src/guestfs-actions.pod:5306 ../src/guestfs-actions.pod:5323 ../src/guestfs-actions.pod:5336 ../src/guestfs-actions.pod:5351 ../src/guestfs-actions.pod:5366 ../src/guestfs-actions.pod:5398 ../src/guestfs-actions.pod:5424 ../src/guestfs-actions.pod:5463 ../src/guestfs-actions.pod:5483 ../src/guestfs-actions.pod:5497 ../src/guestfs-actions.pod:5514 ../src/guestfs-actions.pod:5563 ../src/guestfs-actions.pod:5616 ../src/guestfs-actions.pod:5663 ../src/guestfs-actions.pod:5706 ../src/guestfs-actions.pod:5734 ../src/guestfs-actions.pod:5751 ../src/guestfs-actions.pod:5769 ../src/guestfs-actions.pod:5909 ../src/guestfs-actions.pod:5966 ../src/guestfs-actions.pod:5988 ../src/guestfs-actions.pod:6006 ../src/guestfs-actions.pod:6056 ../src/guestfs-actions.pod:6122 ../src/guestfs-actions.pod:6139 ../src/guestfs-actions.pod:6152 ../src/guestfs-actions.pod:6166 ../src/guestfs-actions.pod:6455 ../src/guestfs-actions.pod:6474 ../src/guestfs-actions.pod:6493 ../src/guestfs-actions.pod:6507 ../src/guestfs-actions.pod:6519 ../src/guestfs-actions.pod:6533 ../src/guestfs-actions.pod:6545 ../src/guestfs-actions.pod:6559 ../src/guestfs-actions.pod:6575 ../src/guestfs-actions.pod:6596 ../src/guestfs-actions.pod:6615 ../src/guestfs-actions.pod:6634 ../src/guestfs-actions.pod:6664 ../src/guestfs-actions.pod:6682 ../src/guestfs-actions.pod:6705 ../src/guestfs-actions.pod:6723 ../src/guestfs-actions.pod:6742 ../src/guestfs-actions.pod:6763 ../src/guestfs-actions.pod:6782 ../src/guestfs-actions.pod:6799 ../src/guestfs-actions.pod:6818 ../src/guestfs-actions.pod:6846 ../src/guestfs-actions.pod:6870 ../src/guestfs-actions.pod:6889 ../src/guestfs-actions.pod:6905 ../src/guestfs-actions.pod:6929 ../src/guestfs-actions.pod:6948 ../src/guestfs-actions.pod:6963 ../src/guestfs-actions.pod:6982 ../src/guestfs-actions.pod:7026 ../src/guestfs-actions.pod:7056 ../src/guestfs-actions.pod:7089 ../src/guestfs-actions.pod:7204 ../src/guestfs-actions.pod:7325 ../src/guestfs-actions.pod:7337 ../src/guestfs-actions.pod:7350 ../src/guestfs-actions.pod:7363 ../src/guestfs-actions.pod:7385 ../src/guestfs-actions.pod:7398 ../src/guestfs-actions.pod:7411 ../src/guestfs-actions.pod:7424 ../src/guestfs-actions.pod:7439 ../src/guestfs-actions.pod:7498 ../src/guestfs-actions.pod:7515 ../src/guestfs-actions.pod:7531 ../src/guestfs-actions.pod:7547 ../src/guestfs-actions.pod:7564 ../src/guestfs-actions.pod:7577 ../src/guestfs-actions.pod:7597 ../src/guestfs-actions.pod:7633 ../src/guestfs-actions.pod:7647 ../src/guestfs-actions.pod:7688 ../src/guestfs-actions.pod:7701 ../src/guestfs-actions.pod:7719 ../src/guestfs-actions.pod:7753 ../src/guestfs-actions.pod:7789 ../src/guestfs-actions.pod:7905 ../src/guestfs-actions.pod:7920 ../src/guestfs-actions.pod:7934 ../src/guestfs-actions.pod:7989 ../src/guestfs-actions.pod:8002 ../src/guestfs-actions.pod:8047 ../src/guestfs-actions.pod:8087 ../src/guestfs-actions.pod:8143 ../src/guestfs-actions.pod:8163 ../src/guestfs-actions.pod:8196 ../src/guestfs-actions.pod:8260 ../src/guestfs-actions.pod:8283 ../src/guestfs-actions.pod:8312
23872 msgid "This function returns 0 on success or -1 on error."
23876 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:189 ../src/guestfs-actions.pod:1334 ../src/guestfs-actions.pod:2389 ../src/guestfs-actions.pod:2487 ../src/guestfs-actions.pod:2612 ../src/guestfs-actions.pod:4082 ../src/guestfs-actions.pod:4102 ../src/guestfs-actions.pod:5400 ../src/guestfs-actions.pod:6684 ../src/guestfs-actions.pod:6801 ../src/guestfs-actions.pod:6950 ../src/guestfs-actions.pod:7441 ../src/guestfs-actions.pod:7566 ../src/guestfs-actions.pod:8089
23877 msgid "(Added in 0.3)"
23881 #: ../src/guestfs-actions.pod:41
23882 msgid "guestfs_add_domain"
23886 #: ../src/guestfs-actions.pod:43
23890 " guestfs_add_domain (guestfs_h *g,\n"
23891 " const char *dom,\n"
23897 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:198 ../src/guestfs-actions.pod:890 ../src/guestfs-actions.pod:1214 ../src/guestfs-actions.pod:1266 ../src/guestfs-actions.pod:1344 ../src/guestfs-actions.pod:1411 ../src/guestfs-actions.pod:1462 ../src/guestfs-actions.pod:1513 ../src/guestfs-actions.pod:3280 ../src/guestfs-actions.pod:5101 ../src/guestfs-actions.pod:5410 ../src/guestfs-actions.pod:5627
23899 "You may supply a list of optional arguments to this call. Use zero or more "
23900 "of the following pairs of parameters, and terminate the list with C<-1> on "
23901 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
23905 #: ../src/guestfs-actions.pod:53
23908 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
23909 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
23910 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
23911 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
23912 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
23913 " GUESTFS_ADD_DOMAIN_READONLYDISK, const char *readonlydisk,\n"
23918 #: ../src/guestfs-actions.pod:60
23920 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
23921 "It works by connecting to libvirt, requesting the domain and domain XML from "
23922 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
23927 #: ../src/guestfs-actions.pod:141
23929 "The other optional parameters are passed directly through to "
23930 "C<guestfs_add_drive_opts>."
23934 #: ../src/guestfs-actions.pod:144 ../src/guestfs-actions.pod:403 ../src/guestfs-actions.pod:573 ../src/guestfs-actions.pod:751 ../src/guestfs-actions.pod:782 ../src/guestfs-actions.pod:800 ../src/guestfs-actions.pod:819 ../src/guestfs-actions.pod:1789 ../src/guestfs-actions.pod:2145 ../src/guestfs-actions.pod:2348 ../src/guestfs-actions.pod:2459 ../src/guestfs-actions.pod:2510 ../src/guestfs-actions.pod:2562 ../src/guestfs-actions.pod:2576 ../src/guestfs-actions.pod:2599 ../src/guestfs-actions.pod:2914 ../src/guestfs-actions.pod:3398 ../src/guestfs-actions.pod:3416 ../src/guestfs-actions.pod:5586 ../src/guestfs-actions.pod:5806 ../src/guestfs-actions.pod:6044 ../src/guestfs-actions.pod:6236 ../src/guestfs-actions.pod:6262 ../src/guestfs-actions.pod:7674 ../src/guestfs-actions.pod:8100 ../src/guestfs-actions.pod:8113 ../src/guestfs-actions.pod:8126
23935 msgid "On error this function returns -1."
23939 #: ../src/guestfs-actions.pod:146
23940 msgid "(Added in 1.7.4)"
23944 #: ../src/guestfs-actions.pod:148
23945 msgid "guestfs_add_domain_va"
23949 #: ../src/guestfs-actions.pod:150
23953 " guestfs_add_domain_va (guestfs_h *g,\n"
23954 " const char *dom,\n"
23955 " va_list args);\n"
23960 #: ../src/guestfs-actions.pod:155
23961 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
23965 #: ../src/guestfs-actions.pod:157 ../src/guestfs-actions.pod:168 ../src/guestfs-actions.pod:267 ../src/guestfs-actions.pod:278 ../src/guestfs-actions.pod:929 ../src/guestfs-actions.pod:940 ../src/guestfs-actions.pod:1242 ../src/guestfs-actions.pod:1255 ../src/guestfs-actions.pod:1301 ../src/guestfs-actions.pod:1314 ../src/guestfs-actions.pod:1389 ../src/guestfs-actions.pod:1401 ../src/guestfs-actions.pod:1440 ../src/guestfs-actions.pod:1452 ../src/guestfs-actions.pod:1491 ../src/guestfs-actions.pod:1503 ../src/guestfs-actions.pod:1547 ../src/guestfs-actions.pod:1559 ../src/guestfs-actions.pod:3364 ../src/guestfs-actions.pod:3376 ../src/guestfs-actions.pod:5166 ../src/guestfs-actions.pod:5178 ../src/guestfs-actions.pod:5438 ../src/guestfs-actions.pod:5450 ../src/guestfs-actions.pod:5676 ../src/guestfs-actions.pod:5687
23966 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
23970 #: ../src/guestfs-actions.pod:159
23971 msgid "guestfs_add_domain_argv"
23975 #: ../src/guestfs-actions.pod:161
23979 " guestfs_add_domain_argv (guestfs_h *g,\n"
23980 " const char *dom,\n"
23981 " const struct guestfs_add_domain_argv *optargs);\n"
23986 #: ../src/guestfs-actions.pod:166
23987 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
23991 #: ../src/guestfs-actions.pod:170
23992 msgid "guestfs_add_drive"
23996 #: ../src/guestfs-actions.pod:172
24000 " guestfs_add_drive (guestfs_h *g,\n"
24001 " const char *filename);\n"
24006 #: ../src/guestfs-actions.pod:176
24008 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
24009 "optional parameters, so the disk is added writable, with the format being "
24010 "detected automatically."
24014 #: ../src/guestfs-actions.pod:180
24016 "Automatic detection of the format opens you up to a potential security hole "
24017 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
24018 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
24019 "you should think about replacing calls to this function with calls to "
24020 "C<guestfs_add_drive_opts>, and specifying the format."
24024 #: ../src/guestfs-actions.pod:191
24025 msgid "guestfs_add_drive_opts"
24029 #: ../src/guestfs-actions.pod:193
24033 " guestfs_add_drive_opts (guestfs_h *g,\n"
24034 " const char *filename,\n"
24040 #: ../src/guestfs-actions.pod:203
24043 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
24044 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
24045 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
24046 " GUESTFS_ADD_DRIVE_OPTS_NAME, const char *name,\n"
24051 #: ../src/guestfs-actions.pod:233
24053 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
24054 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
24055 "Possible formats include C<raw> and C<qcow2>."
24059 #: ../src/guestfs-actions.pod:244
24061 "This rarely-used option lets you emulate the behaviour of the deprecated "
24062 "C<guestfs_add_drive_with_if> call (q.v.)"
24066 #: ../src/guestfs-actions.pod:256
24067 msgid "(Added in 1.5.23)"
24071 #: ../src/guestfs-actions.pod:258
24072 msgid "guestfs_add_drive_opts_va"
24076 #: ../src/guestfs-actions.pod:260
24080 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
24081 " const char *filename,\n"
24082 " va_list args);\n"
24087 #: ../src/guestfs-actions.pod:265
24088 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
24092 #: ../src/guestfs-actions.pod:269
24093 msgid "guestfs_add_drive_opts_argv"
24097 #: ../src/guestfs-actions.pod:271
24101 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
24102 " const char *filename,\n"
24103 " const struct guestfs_add_drive_opts_argv "
24109 #: ../src/guestfs-actions.pod:276
24110 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
24114 #: ../src/guestfs-actions.pod:280
24115 msgid "guestfs_add_drive_ro"
24119 #: ../src/guestfs-actions.pod:282
24123 " guestfs_add_drive_ro (guestfs_h *g,\n"
24124 " const char *filename);\n"
24129 #: ../src/guestfs-actions.pod:286
24131 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
24132 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
24133 "disk is added read-only, with the format being detected automatically."
24137 #: ../src/guestfs-actions.pod:293
24138 msgid "(Added in 1.0.38)"
24142 #: ../src/guestfs-actions.pod:295
24143 msgid "guestfs_add_drive_ro_with_if"
24147 #: ../src/guestfs-actions.pod:297
24151 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
24152 " const char *filename,\n"
24153 " const char *iface);\n"
24158 #: ../src/guestfs-actions.pod:309
24160 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
24161 "QEMU interface emulation to use at run time."
24165 #: ../src/guestfs-actions.pod:314 ../src/guestfs-actions.pod:335 ../src/guestfs-actions.pod:2873
24166 msgid "(Added in 1.0.84)"
24170 #: ../src/guestfs-actions.pod:316
24171 msgid "guestfs_add_drive_with_if"
24175 #: ../src/guestfs-actions.pod:318
24179 " guestfs_add_drive_with_if (guestfs_h *g,\n"
24180 " const char *filename,\n"
24181 " const char *iface);\n"
24186 #: ../src/guestfs-actions.pod:330
24188 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
24189 "QEMU interface emulation to use at run time."
24193 #: ../src/guestfs-actions.pod:337
24194 msgid "guestfs_aug_clear"
24198 #: ../src/guestfs-actions.pod:339
24202 " guestfs_aug_clear (guestfs_h *g,\n"
24203 " const char *augpath);\n"
24208 #: ../src/guestfs-actions.pod:348 ../src/guestfs-actions.pod:2601
24209 msgid "(Added in 1.3.4)"
24213 #: ../src/guestfs-actions.pod:350
24214 msgid "guestfs_aug_close"
24218 #: ../src/guestfs-actions.pod:352
24222 " guestfs_aug_close (guestfs_h *g);\n"
24227 #: ../src/guestfs-actions.pod:355
24229 "Close the current Augeas handle and free up any resources used by it. After "
24230 "calling this, you have to call C<guestfs_aug_init> again before you can use "
24231 "any other Augeas functions."
24235 #: ../src/guestfs-actions.pod:362 ../src/guestfs-actions.pod:387 ../src/guestfs-actions.pod:405 ../src/guestfs-actions.pod:419 ../src/guestfs-actions.pod:482 ../src/guestfs-actions.pod:502 ../src/guestfs-actions.pod:516 ../src/guestfs-actions.pod:547 ../src/guestfs-actions.pod:561 ../src/guestfs-actions.pod:575 ../src/guestfs-actions.pod:589 ../src/guestfs-actions.pod:607 ../src/guestfs-actions.pod:6313
24236 msgid "(Added in 0.7)"
24240 #: ../src/guestfs-actions.pod:364
24241 msgid "guestfs_aug_defnode"
24245 #: ../src/guestfs-actions.pod:366
24248 " struct guestfs_int_bool *\n"
24249 " guestfs_aug_defnode (guestfs_h *g,\n"
24250 " const char *name,\n"
24251 " const char *expr,\n"
24252 " const char *val);\n"
24257 #: ../src/guestfs-actions.pod:375
24259 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
24260 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
24261 "containing that single node."
24265 #: ../src/guestfs-actions.pod:383
24267 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
24268 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
24272 #: ../src/guestfs-actions.pod:389
24273 msgid "guestfs_aug_defvar"
24277 #: ../src/guestfs-actions.pod:391
24281 " guestfs_aug_defvar (guestfs_h *g,\n"
24282 " const char *name,\n"
24283 " const char *expr);\n"
24288 #: ../src/guestfs-actions.pod:407
24289 msgid "guestfs_aug_get"
24293 #: ../src/guestfs-actions.pod:409
24297 " guestfs_aug_get (guestfs_h *g,\n"
24298 " const char *augpath);\n"
24303 #: ../src/guestfs-actions.pod:416 ../src/guestfs-actions.pod:980 ../src/guestfs-actions.pod:998 ../src/guestfs-actions.pod:1058 ../src/guestfs-actions.pod:1074 ../src/guestfs-actions.pod:1177 ../src/guestfs-actions.pod:1658 ../src/guestfs-actions.pod:1675 ../src/guestfs-actions.pod:1694 ../src/guestfs-actions.pod:1828 ../src/guestfs-actions.pod:2016 ../src/guestfs-actions.pod:2128 ../src/guestfs-actions.pod:2291 ../src/guestfs-actions.pod:2308 ../src/guestfs-actions.pod:2375 ../src/guestfs-actions.pod:2418 ../src/guestfs-actions.pod:2439 ../src/guestfs-actions.pod:2624 ../src/guestfs-actions.pod:2838 ../src/guestfs-actions.pod:3042 ../src/guestfs-actions.pod:3144 ../src/guestfs-actions.pod:3248 ../src/guestfs-actions.pod:3267 ../src/guestfs-actions.pod:3482 ../src/guestfs-actions.pod:3510 ../src/guestfs-actions.pod:3531 ../src/guestfs-actions.pod:3565 ../src/guestfs-actions.pod:3628 ../src/guestfs-actions.pod:3648 ../src/guestfs-actions.pod:3668 ../src/guestfs-actions.pod:4295 ../src/guestfs-actions.pod:4648 ../src/guestfs-actions.pod:4818 ../src/guestfs-actions.pod:4928 ../src/guestfs-actions.pod:5824 ../src/guestfs-actions.pod:6025 ../src/guestfs-actions.pod:6211 ../src/guestfs-actions.pod:6389 ../src/guestfs-actions.pod:6438 ../src/guestfs-actions.pod:7110 ../src/guestfs-actions.pod:7126 ../src/guestfs-actions.pod:7150 ../src/guestfs-actions.pod:7174 ../src/guestfs-actions.pod:7848 ../src/guestfs-actions.pod:7867 ../src/guestfs-actions.pod:7885 ../src/guestfs-actions.pod:8059 ../src/guestfs-actions.pod:8376
24305 "This function returns a string, or NULL on error. I<The caller must free "
24306 "the returned string after use>."
24310 #: ../src/guestfs-actions.pod:421
24311 msgid "guestfs_aug_init"
24315 #: ../src/guestfs-actions.pod:423
24319 " guestfs_aug_init (guestfs_h *g,\n"
24320 " const char *root,\n"
24326 #: ../src/guestfs-actions.pod:432
24327 msgid "You must call this before using any other C<guestfs_aug_*> commands."
24331 #: ../src/guestfs-actions.pod:457
24333 "This option is only useful when debugging Augeas lenses. Use of this option "
24334 "may require additional memory for the libguestfs appliance. You may need to "
24335 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
24336 "C<guestfs_set_memsize>."
24340 #: ../src/guestfs-actions.pod:472
24341 msgid "Do not load the tree in C<guestfs_aug_init>."
24345 #: ../src/guestfs-actions.pod:476
24346 msgid "To close the handle, you can call C<guestfs_aug_close>."
24350 #: ../src/guestfs-actions.pod:484
24351 msgid "guestfs_aug_insert"
24355 #: ../src/guestfs-actions.pod:486
24359 " guestfs_aug_insert (guestfs_h *g,\n"
24360 " const char *augpath,\n"
24361 " const char *label,\n"
24367 #: ../src/guestfs-actions.pod:504
24368 msgid "guestfs_aug_load"
24372 #: ../src/guestfs-actions.pod:506
24376 " guestfs_aug_load (guestfs_h *g);\n"
24381 #: ../src/guestfs-actions.pod:518
24382 msgid "guestfs_aug_ls"
24386 #: ../src/guestfs-actions.pod:520
24390 " guestfs_aug_ls (guestfs_h *g,\n"
24391 " const char *augpath);\n"
24396 #: ../src/guestfs-actions.pod:524
24398 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
24399 "sorting the resulting nodes into alphabetical order."
24403 #: ../src/guestfs-actions.pod:527 ../src/guestfs-actions.pod:543 ../src/guestfs-actions.pod:689 ../src/guestfs-actions.pod:1196 ../src/guestfs-actions.pod:1843 ../src/guestfs-actions.pod:1862 ../src/guestfs-actions.pod:1965 ../src/guestfs-actions.pod:1984 ../src/guestfs-actions.pod:2230 ../src/guestfs-actions.pod:2696 ../src/guestfs-actions.pod:2712 ../src/guestfs-actions.pod:2731 ../src/guestfs-actions.pod:2796 ../src/guestfs-actions.pod:2820 ../src/guestfs-actions.pod:2891 ../src/guestfs-actions.pod:2940 ../src/guestfs-actions.pod:3209 ../src/guestfs-actions.pod:3584 ../src/guestfs-actions.pod:3864 ../src/guestfs-actions.pod:4178 ../src/guestfs-actions.pod:4195 ../src/guestfs-actions.pod:4215 ../src/guestfs-actions.pod:4277 ../src/guestfs-actions.pod:4382 ../src/guestfs-actions.pod:4790 ../src/guestfs-actions.pod:5547 ../src/guestfs-actions.pod:6183 ../src/guestfs-actions.pod:6309 ../src/guestfs-actions.pod:6423 ../src/guestfs-actions.pod:7190 ../src/guestfs-actions.pod:7251 ../src/guestfs-actions.pod:7306 ../src/guestfs-actions.pod:7452 ../src/guestfs-actions.pod:7476 ../src/guestfs-actions.pod:7952 ../src/guestfs-actions.pod:7972 ../src/guestfs-actions.pod:8019 ../src/guestfs-actions.pod:8213 ../src/guestfs-actions.pod:8232 ../src/guestfs-actions.pod:8326 ../src/guestfs-actions.pod:8345 ../src/guestfs-actions.pod:8391 ../src/guestfs-actions.pod:8410
24405 "This function returns a NULL-terminated array of strings (like "
24406 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
24407 "strings and the array after use>."
24411 #: ../src/guestfs-actions.pod:531 ../src/guestfs-actions.pod:1121 ../src/guestfs-actions.pod:1139 ../src/guestfs-actions.pod:1900 ../src/guestfs-actions.pod:3942 ../src/guestfs-actions.pod:3973 ../src/guestfs-actions.pod:4631 ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:4868 ../src/guestfs-actions.pod:4901 ../src/guestfs-actions.pod:5064 ../src/guestfs-actions.pod:5551 ../src/guestfs-actions.pod:6124 ../src/guestfs-actions.pod:6521 ../src/guestfs-actions.pod:6535 ../src/guestfs-actions.pod:6547 ../src/guestfs-actions.pod:7031 ../src/guestfs-actions.pod:7690 ../src/guestfs-actions.pod:7703 ../src/guestfs-actions.pod:7936 ../src/guestfs-actions.pod:8201
24412 msgid "(Added in 0.8)"
24416 #: ../src/guestfs-actions.pod:533
24417 msgid "guestfs_aug_match"
24421 #: ../src/guestfs-actions.pod:535
24425 " guestfs_aug_match (guestfs_h *g,\n"
24426 " const char *augpath);\n"
24431 #: ../src/guestfs-actions.pod:549
24432 msgid "guestfs_aug_mv"
24436 #: ../src/guestfs-actions.pod:551
24440 " guestfs_aug_mv (guestfs_h *g,\n"
24441 " const char *src,\n"
24442 " const char *dest);\n"
24447 #: ../src/guestfs-actions.pod:563
24448 msgid "guestfs_aug_rm"
24452 #: ../src/guestfs-actions.pod:565
24456 " guestfs_aug_rm (guestfs_h *g,\n"
24457 " const char *augpath);\n"
24462 #: ../src/guestfs-actions.pod:577
24463 msgid "guestfs_aug_save"
24467 #: ../src/guestfs-actions.pod:579
24471 " guestfs_aug_save (guestfs_h *g);\n"
24476 #: ../src/guestfs-actions.pod:584
24478 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
24483 #: ../src/guestfs-actions.pod:591
24484 msgid "guestfs_aug_set"
24488 #: ../src/guestfs-actions.pod:593
24492 " guestfs_aug_set (guestfs_h *g,\n"
24493 " const char *augpath,\n"
24494 " const char *val);\n"
24499 #: ../src/guestfs-actions.pod:600
24501 "In the Augeas API, it is possible to clear a node by setting the value to "
24502 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
24503 "this call. Instead you must use the C<guestfs_aug_clear> call."
24507 #: ../src/guestfs-actions.pod:609
24508 msgid "guestfs_available"
24512 #: ../src/guestfs-actions.pod:611
24516 " guestfs_available (guestfs_h *g,\n"
24517 " char *const *groups);\n"
24522 #: ../src/guestfs-actions.pod:619
24524 "The libguestfs groups, and the functions that those groups correspond to, "
24525 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
24526 "runtime by calling C<guestfs_available_all_groups>."
24530 #: ../src/guestfs-actions.pod:643
24531 msgid "You must call C<guestfs_launch> before calling this function."
24535 #: ../src/guestfs-actions.pod:665
24537 "This call was added in version C<1.0.80>. In previous versions of "
24538 "libguestfs all you could do would be to speculatively execute a command to "
24539 "find out if the daemon implemented it. See also C<guestfs_version>."
24543 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:1645
24544 msgid "(Added in 1.0.80)"
24548 #: ../src/guestfs-actions.pod:676
24549 msgid "guestfs_available_all_groups"
24553 #: ../src/guestfs-actions.pod:678
24557 " guestfs_available_all_groups (guestfs_h *g);\n"
24562 #: ../src/guestfs-actions.pod:681
24564 "This command returns a list of all optional groups that this daemon knows "
24565 "about. Note this returns both supported and unsupported groups. To find "
24566 "out which ones the daemon can actually support you have to call "
24567 "C<guestfs_available> on each member of the returned list."
24571 #: ../src/guestfs-actions.pod:687
24572 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
24576 #: ../src/guestfs-actions.pod:693
24577 msgid "(Added in 1.3.15)"
24581 #: ../src/guestfs-actions.pod:695
24582 msgid "guestfs_base64_in"
24586 #: ../src/guestfs-actions.pod:697
24590 " guestfs_base64_in (guestfs_h *g,\n"
24591 " const char *base64file,\n"
24592 " const char *filename);\n"
24597 #: ../src/guestfs-actions.pod:707 ../src/guestfs-actions.pod:721
24598 msgid "(Added in 1.3.5)"
24602 #: ../src/guestfs-actions.pod:709
24603 msgid "guestfs_base64_out"
24607 #: ../src/guestfs-actions.pod:711
24611 " guestfs_base64_out (guestfs_h *g,\n"
24612 " const char *filename,\n"
24613 " const char *base64file);\n"
24618 #: ../src/guestfs-actions.pod:723
24619 msgid "guestfs_blockdev_flushbufs"
24623 #: ../src/guestfs-actions.pod:725
24627 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
24628 " const char *device);\n"
24633 #: ../src/guestfs-actions.pod:736 ../src/guestfs-actions.pod:753 ../src/guestfs-actions.pod:768 ../src/guestfs-actions.pod:784 ../src/guestfs-actions.pod:802 ../src/guestfs-actions.pod:821 ../src/guestfs-actions.pod:835 ../src/guestfs-actions.pod:853 ../src/guestfs-actions.pod:867 ../src/guestfs-actions.pod:881
24634 msgid "(Added in 0.9.3)"
24638 #: ../src/guestfs-actions.pod:738
24639 msgid "guestfs_blockdev_getbsz"
24643 #: ../src/guestfs-actions.pod:740
24647 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
24648 " const char *device);\n"
24653 #: ../src/guestfs-actions.pod:755
24654 msgid "guestfs_blockdev_getro"
24658 #: ../src/guestfs-actions.pod:757
24662 " guestfs_blockdev_getro (guestfs_h *g,\n"
24663 " const char *device);\n"
24668 #: ../src/guestfs-actions.pod:766 ../src/guestfs-actions.pod:1883 ../src/guestfs-actions.pod:1898 ../src/guestfs-actions.pod:2387 ../src/guestfs-actions.pod:2398 ../src/guestfs-actions.pod:2470 ../src/guestfs-actions.pod:2496 ../src/guestfs-actions.pod:2536 ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:2587 ../src/guestfs-actions.pod:2610 ../src/guestfs-actions.pod:3685 ../src/guestfs-actions.pod:3701 ../src/guestfs-actions.pod:3719 ../src/guestfs-actions.pod:3881 ../src/guestfs-actions.pod:3895 ../src/guestfs-actions.pod:3910 ../src/guestfs-actions.pod:3924 ../src/guestfs-actions.pod:3940 ../src/guestfs-actions.pod:3955 ../src/guestfs-actions.pod:3971 ../src/guestfs-actions.pod:3985 ../src/guestfs-actions.pod:3998 ../src/guestfs-actions.pod:4012 ../src/guestfs-actions.pod:4027 ../src/guestfs-actions.pod:4042 ../src/guestfs-actions.pod:4055 ../src/guestfs-actions.pod:4069 ../src/guestfs-actions.pod:5788
24669 msgid "This function returns a C truth value on success or -1 on error."
24673 #: ../src/guestfs-actions.pod:770
24674 msgid "guestfs_blockdev_getsize64"
24678 #: ../src/guestfs-actions.pod:772
24682 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
24683 " const char *device);\n"
24688 #: ../src/guestfs-actions.pod:778
24689 msgid "See also C<guestfs_blockdev_getsz>."
24693 #: ../src/guestfs-actions.pod:786
24694 msgid "guestfs_blockdev_getss"
24698 #: ../src/guestfs-actions.pod:788
24702 " guestfs_blockdev_getss (guestfs_h *g,\n"
24703 " const char *device);\n"
24708 #: ../src/guestfs-actions.pod:795
24710 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
24715 #: ../src/guestfs-actions.pod:804
24716 msgid "guestfs_blockdev_getsz"
24720 #: ../src/guestfs-actions.pod:806
24724 " guestfs_blockdev_getsz (guestfs_h *g,\n"
24725 " const char *device);\n"
24730 #: ../src/guestfs-actions.pod:813
24732 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
24733 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
24737 #: ../src/guestfs-actions.pod:823
24738 msgid "guestfs_blockdev_rereadpt"
24742 #: ../src/guestfs-actions.pod:825
24746 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
24747 " const char *device);\n"
24752 #: ../src/guestfs-actions.pod:837
24753 msgid "guestfs_blockdev_setbsz"
24757 #: ../src/guestfs-actions.pod:839
24761 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
24762 " const char *device,\n"
24763 " int blocksize);\n"
24768 #: ../src/guestfs-actions.pod:855
24769 msgid "guestfs_blockdev_setro"
24773 #: ../src/guestfs-actions.pod:857
24777 " guestfs_blockdev_setro (guestfs_h *g,\n"
24778 " const char *device);\n"
24783 #: ../src/guestfs-actions.pod:869
24784 msgid "guestfs_blockdev_setrw"
24788 #: ../src/guestfs-actions.pod:871
24792 " guestfs_blockdev_setrw (guestfs_h *g,\n"
24793 " const char *device);\n"
24798 #: ../src/guestfs-actions.pod:883
24799 msgid "guestfs_btrfs_filesystem_resize"
24803 #: ../src/guestfs-actions.pod:885
24807 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
24808 " const char *mountpoint,\n"
24814 #: ../src/guestfs-actions.pod:895
24817 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
24822 #: ../src/guestfs-actions.pod:918
24823 msgid "(Added in 1.11.17)"
24827 #: ../src/guestfs-actions.pod:920
24828 msgid "guestfs_btrfs_filesystem_resize_va"
24832 #: ../src/guestfs-actions.pod:922
24836 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
24837 " const char *mountpoint,\n"
24838 " va_list args);\n"
24843 #: ../src/guestfs-actions.pod:927
24844 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
24848 #: ../src/guestfs-actions.pod:931
24849 msgid "guestfs_btrfs_filesystem_resize_argv"
24853 #: ../src/guestfs-actions.pod:933
24857 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
24858 " const char *mountpoint,\n"
24860 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
24865 #: ../src/guestfs-actions.pod:938
24866 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
24870 #: ../src/guestfs-actions.pod:942
24871 msgid "guestfs_case_sensitive_path"
24875 #: ../src/guestfs-actions.pod:944
24879 " guestfs_case_sensitive_path (guestfs_h *g,\n"
24880 " const char *path);\n"
24885 #: ../src/guestfs-actions.pod:970
24887 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
24888 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
24889 "how the directories were originally created under Windows)."
24893 #: ../src/guestfs-actions.pod:978
24894 msgid "See also C<guestfs_realpath>."
24898 #: ../src/guestfs-actions.pod:983 ../src/guestfs-actions.pod:7870
24899 msgid "(Added in 1.0.75)"
24903 #: ../src/guestfs-actions.pod:985
24904 msgid "guestfs_cat"
24908 #: ../src/guestfs-actions.pod:987
24912 " guestfs_cat (guestfs_h *g,\n"
24913 " const char *path);\n"
24918 #: ../src/guestfs-actions.pod:993
24920 "Note that this function cannot correctly handle binary files (specifically, "
24921 "files containing C<\\0> character which is treated as end of string). For "
24922 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
24923 "functions which have a more complex interface."
24927 #: ../src/guestfs-actions.pod:1004 ../src/guestfs-actions.pod:4199 ../src/guestfs-actions.pod:4281 ../src/guestfs-actions.pod:4298 ../src/guestfs-actions.pod:4386 ../src/guestfs-actions.pod:4794 ../src/guestfs-actions.pod:4808 ../src/guestfs-actions.pod:6187 ../src/guestfs-actions.pod:6201 ../src/guestfs-actions.pod:8023 ../src/guestfs-actions.pod:8037
24928 msgid "(Added in 0.4)"
24932 #: ../src/guestfs-actions.pod:1006
24933 msgid "guestfs_checksum"
24937 #: ../src/guestfs-actions.pod:1008
24941 " guestfs_checksum (guestfs_h *g,\n"
24942 " const char *csumtype,\n"
24943 " const char *path);\n"
24948 #: ../src/guestfs-actions.pod:1054
24949 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
24953 #: ../src/guestfs-actions.pod:1056
24954 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
24958 #: ../src/guestfs-actions.pod:1061 ../src/guestfs-actions.pod:1720 ../src/guestfs-actions.pod:2578 ../src/guestfs-actions.pod:3897 ../src/guestfs-actions.pod:3926 ../src/guestfs-actions.pod:3987 ../src/guestfs-actions.pod:4014 ../src/guestfs-actions.pod:7726
24959 msgid "(Added in 1.0.2)"
24963 #: ../src/guestfs-actions.pod:1063
24964 msgid "guestfs_checksum_device"
24968 #: ../src/guestfs-actions.pod:1065
24972 " guestfs_checksum_device (guestfs_h *g,\n"
24973 " const char *csumtype,\n"
24974 " const char *device);\n"
24979 #: ../src/guestfs-actions.pod:1070
24981 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
24982 "device named C<device>. For the types of checksums supported see the "
24983 "C<guestfs_checksum> command."
24987 #: ../src/guestfs-actions.pod:1077 ../src/guestfs-actions.pod:5618 ../src/guestfs-actions.pod:5753 ../src/guestfs-actions.pod:5790 ../src/guestfs-actions.pod:5808 ../src/guestfs-actions.pod:5990 ../src/guestfs-actions.pod:7635 ../src/guestfs-actions.pod:7649 ../src/guestfs-actions.pod:8049
24988 msgid "(Added in 1.3.2)"
24992 #: ../src/guestfs-actions.pod:1079
24993 msgid "guestfs_checksums_out"
24997 #: ../src/guestfs-actions.pod:1081
25001 " guestfs_checksums_out (guestfs_h *g,\n"
25002 " const char *csumtype,\n"
25003 " const char *directory,\n"
25004 " const char *sumsfile);\n"
25009 #: ../src/guestfs-actions.pod:1101
25010 msgid "(Added in 1.3.7)"
25014 #: ../src/guestfs-actions.pod:1103
25015 msgid "guestfs_chmod"
25019 #: ../src/guestfs-actions.pod:1105
25023 " guestfs_chmod (guestfs_h *g,\n"
25025 " const char *path);\n"
25030 #: ../src/guestfs-actions.pod:1123
25031 msgid "guestfs_chown"
25035 #: ../src/guestfs-actions.pod:1125
25039 " guestfs_chown (guestfs_h *g,\n"
25042 " const char *path);\n"
25047 #: ../src/guestfs-actions.pod:1141
25048 msgid "guestfs_command"
25052 #: ../src/guestfs-actions.pod:1143
25056 " guestfs_command (guestfs_h *g,\n"
25057 " char *const *arguments);\n"
25062 #: ../src/guestfs-actions.pod:1152
25064 "The single parameter is an argv-style list of arguments. The first element "
25065 "is the name of the program to run. Subsequent elements are parameters. The "
25066 "list must be non-empty (ie. must contain a program name). Note that the "
25067 "command runs directly, and is I<not> invoked via the shell (see "
25072 #: ../src/guestfs-actions.pod:1183 ../src/guestfs-actions.pod:1203 ../src/guestfs-actions.pod:2019
25073 msgid "(Added in 0.9.1)"
25077 #: ../src/guestfs-actions.pod:1185
25078 msgid "guestfs_command_lines"
25082 #: ../src/guestfs-actions.pod:1187
25086 " guestfs_command_lines (guestfs_h *g,\n"
25087 " char *const *arguments);\n"
25092 #: ../src/guestfs-actions.pod:1191
25094 "This is the same as C<guestfs_command>, but splits the result into a list of "
25099 #: ../src/guestfs-actions.pod:1194
25100 msgid "See also: C<guestfs_sh_lines>"
25104 #: ../src/guestfs-actions.pod:1205
25105 msgid "guestfs_compress_device_out"
25109 #: ../src/guestfs-actions.pod:1207
25113 " guestfs_compress_device_out (guestfs_h *g,\n"
25114 " const char *ctype,\n"
25115 " const char *device,\n"
25116 " const char *zdevice,\n"
25122 #: ../src/guestfs-actions.pod:1219
25125 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
25130 #: ../src/guestfs-actions.pod:1224
25132 "The C<ctype> and optional C<level> parameters have the same meaning as in "
25133 "C<guestfs_compress_out>."
25137 #: ../src/guestfs-actions.pod:1229 ../src/guestfs-actions.pod:1288 ../src/guestfs-actions.pod:2564 ../src/guestfs-actions.pod:6907
25138 msgid "(Added in 1.13.15)"
25142 #: ../src/guestfs-actions.pod:1231
25143 msgid "guestfs_compress_device_out_va"
25147 #: ../src/guestfs-actions.pod:1233
25151 " guestfs_compress_device_out_va (guestfs_h *g,\n"
25152 " const char *ctype,\n"
25153 " const char *device,\n"
25154 " const char *zdevice,\n"
25155 " va_list args);\n"
25160 #: ../src/guestfs-actions.pod:1240
25161 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
25165 #: ../src/guestfs-actions.pod:1244
25166 msgid "guestfs_compress_device_out_argv"
25170 #: ../src/guestfs-actions.pod:1246
25174 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
25175 " const char *ctype,\n"
25176 " const char *device,\n"
25177 " const char *zdevice,\n"
25179 "guestfs_compress_device_out_argv *optargs);\n"
25184 #: ../src/guestfs-actions.pod:1253
25185 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
25189 #: ../src/guestfs-actions.pod:1257
25190 msgid "guestfs_compress_out"
25194 #: ../src/guestfs-actions.pod:1259
25198 " guestfs_compress_out (guestfs_h *g,\n"
25199 " const char *ctype,\n"
25200 " const char *file,\n"
25201 " const char *zfile,\n"
25207 #: ../src/guestfs-actions.pod:1271
25210 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
25215 #: ../src/guestfs-actions.pod:1290
25216 msgid "guestfs_compress_out_va"
25220 #: ../src/guestfs-actions.pod:1292
25224 " guestfs_compress_out_va (guestfs_h *g,\n"
25225 " const char *ctype,\n"
25226 " const char *file,\n"
25227 " const char *zfile,\n"
25228 " va_list args);\n"
25233 #: ../src/guestfs-actions.pod:1299
25234 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
25238 #: ../src/guestfs-actions.pod:1303
25239 msgid "guestfs_compress_out_argv"
25243 #: ../src/guestfs-actions.pod:1305
25247 " guestfs_compress_out_argv (guestfs_h *g,\n"
25248 " const char *ctype,\n"
25249 " const char *file,\n"
25250 " const char *zfile,\n"
25251 " const struct guestfs_compress_out_argv "
25257 #: ../src/guestfs-actions.pod:1312
25258 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
25262 #: ../src/guestfs-actions.pod:1316
25263 msgid "guestfs_config"
25267 #: ../src/guestfs-actions.pod:1318
25271 " guestfs_config (guestfs_h *g,\n"
25272 " const char *qemuparam,\n"
25273 " const char *qemuvalue);\n"
25278 #: ../src/guestfs-actions.pod:1336
25279 msgid "guestfs_copy_device_to_device"
25283 #: ../src/guestfs-actions.pod:1338
25287 " guestfs_copy_device_to_device (guestfs_h *g,\n"
25288 " const char *src,\n"
25289 " const char *dest,\n"
25295 #: ../src/guestfs-actions.pod:1349
25298 " GUESTFS_COPY_DEVICE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
25299 " GUESTFS_COPY_DEVICE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
25300 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, int64_t size,\n"
25305 #: ../src/guestfs-actions.pod:1353
25307 "The four calls C<guestfs_copy_device_to_device>, "
25308 "C<guestfs_copy_device_to_file>, C<guestfs_copy_file_to_device>, and "
25309 "C<guestfs_copy_file_to_file> let you copy from a source (device|file) to a "
25310 "destination (device|file)."
25314 #: ../src/guestfs-actions.pod:1374 ../src/guestfs-actions.pod:1425 ../src/guestfs-actions.pod:1476 ../src/guestfs-actions.pod:1532 ../src/guestfs-actions.pod:1584 ../src/guestfs-actions.pod:1715 ../src/guestfs-actions.pod:1746 ../src/guestfs-actions.pod:1791 ../src/guestfs-actions.pod:2168 ../src/guestfs-actions.pod:2190 ../src/guestfs-actions.pod:4097 ../src/guestfs-actions.pod:7721 ../src/guestfs-actions.pod:7755 ../src/guestfs-actions.pod:8262 ../src/guestfs-actions.pod:8285
25316 "This long-running command can generate progress notification messages so "
25317 "that the caller can display a progress bar or indicator. To receive these "
25318 "messages, the caller must register a progress event callback. See "
25319 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
25323 #: ../src/guestfs-actions.pod:1379
25324 msgid "guestfs_copy_device_to_device_va"
25328 #: ../src/guestfs-actions.pod:1381
25332 " guestfs_copy_device_to_device_va (guestfs_h *g,\n"
25333 " const char *src,\n"
25334 " const char *dest,\n"
25335 " va_list args);\n"
25340 #: ../src/guestfs-actions.pod:1387
25341 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_device>."
25345 #: ../src/guestfs-actions.pod:1391
25346 msgid "guestfs_copy_device_to_device_argv"
25350 #: ../src/guestfs-actions.pod:1393
25354 " guestfs_copy_device_to_device_argv (guestfs_h *g,\n"
25355 " const char *src,\n"
25356 " const char *dest,\n"
25358 "guestfs_copy_device_to_device_argv *optargs);\n"
25363 #: ../src/guestfs-actions.pod:1399
25364 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_device>."
25368 #: ../src/guestfs-actions.pod:1403
25369 msgid "guestfs_copy_device_to_file"
25373 #: ../src/guestfs-actions.pod:1405
25377 " guestfs_copy_device_to_file (guestfs_h *g,\n"
25378 " const char *src,\n"
25379 " const char *dest,\n"
25385 #: ../src/guestfs-actions.pod:1416
25388 " GUESTFS_COPY_DEVICE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
25389 " GUESTFS_COPY_DEVICE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
25390 " GUESTFS_COPY_DEVICE_TO_FILE_SIZE, int64_t size,\n"
25395 #: ../src/guestfs-actions.pod:1420 ../src/guestfs-actions.pod:1471 ../src/guestfs-actions.pod:1522
25396 msgid "See C<guestfs_copy_device_to_device> for a general overview of this call."
25400 #: ../src/guestfs-actions.pod:1430
25401 msgid "guestfs_copy_device_to_file_va"
25405 #: ../src/guestfs-actions.pod:1432
25409 " guestfs_copy_device_to_file_va (guestfs_h *g,\n"
25410 " const char *src,\n"
25411 " const char *dest,\n"
25412 " va_list args);\n"
25417 #: ../src/guestfs-actions.pod:1438
25418 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_file>."
25422 #: ../src/guestfs-actions.pod:1442
25423 msgid "guestfs_copy_device_to_file_argv"
25427 #: ../src/guestfs-actions.pod:1444
25431 " guestfs_copy_device_to_file_argv (guestfs_h *g,\n"
25432 " const char *src,\n"
25433 " const char *dest,\n"
25435 "guestfs_copy_device_to_file_argv *optargs);\n"
25440 #: ../src/guestfs-actions.pod:1450
25441 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_file>."
25445 #: ../src/guestfs-actions.pod:1454
25446 msgid "guestfs_copy_file_to_device"
25450 #: ../src/guestfs-actions.pod:1456
25454 " guestfs_copy_file_to_device (guestfs_h *g,\n"
25455 " const char *src,\n"
25456 " const char *dest,\n"
25462 #: ../src/guestfs-actions.pod:1467
25465 " GUESTFS_COPY_FILE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
25466 " GUESTFS_COPY_FILE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
25467 " GUESTFS_COPY_FILE_TO_DEVICE_SIZE, int64_t size,\n"
25472 #: ../src/guestfs-actions.pod:1481
25473 msgid "guestfs_copy_file_to_device_va"
25477 #: ../src/guestfs-actions.pod:1483
25481 " guestfs_copy_file_to_device_va (guestfs_h *g,\n"
25482 " const char *src,\n"
25483 " const char *dest,\n"
25484 " va_list args);\n"
25489 #: ../src/guestfs-actions.pod:1489
25490 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_device>."
25494 #: ../src/guestfs-actions.pod:1493
25495 msgid "guestfs_copy_file_to_device_argv"
25499 #: ../src/guestfs-actions.pod:1495
25503 " guestfs_copy_file_to_device_argv (guestfs_h *g,\n"
25504 " const char *src,\n"
25505 " const char *dest,\n"
25507 "guestfs_copy_file_to_device_argv *optargs);\n"
25512 #: ../src/guestfs-actions.pod:1501
25513 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_device>."
25517 #: ../src/guestfs-actions.pod:1505
25518 msgid "guestfs_copy_file_to_file"
25522 #: ../src/guestfs-actions.pod:1507
25526 " guestfs_copy_file_to_file (guestfs_h *g,\n"
25527 " const char *src,\n"
25528 " const char *dest,\n"
25534 #: ../src/guestfs-actions.pod:1518
25537 " GUESTFS_COPY_FILE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
25538 " GUESTFS_COPY_FILE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
25539 " GUESTFS_COPY_FILE_TO_FILE_SIZE, int64_t size,\n"
25544 #: ../src/guestfs-actions.pod:1525
25546 "This is B<not> the function you want for copying files. This is for copying "
25547 "blocks within existing files. See C<guestfs_cp>, C<guestfs_cp_a> and "
25548 "C<guestfs_mv> for general file copying and moving functions."
25552 #: ../src/guestfs-actions.pod:1537
25553 msgid "guestfs_copy_file_to_file_va"
25557 #: ../src/guestfs-actions.pod:1539
25561 " guestfs_copy_file_to_file_va (guestfs_h *g,\n"
25562 " const char *src,\n"
25563 " const char *dest,\n"
25564 " va_list args);\n"
25569 #: ../src/guestfs-actions.pod:1545
25570 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_file>."
25574 #: ../src/guestfs-actions.pod:1549
25575 msgid "guestfs_copy_file_to_file_argv"
25579 #: ../src/guestfs-actions.pod:1551
25583 " guestfs_copy_file_to_file_argv (guestfs_h *g,\n"
25584 " const char *src,\n"
25585 " const char *dest,\n"
25586 " const struct guestfs_copy_file_to_file_argv "
25592 #: ../src/guestfs-actions.pod:1557
25593 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_file>."
25597 #: ../src/guestfs-actions.pod:1561
25598 msgid "guestfs_copy_size"
25602 #: ../src/guestfs-actions.pod:1563
25606 " guestfs_copy_size (guestfs_h *g,\n"
25607 " const char *src,\n"
25608 " const char *dest,\n"
25609 " int64_t size);\n"
25614 #: ../src/guestfs-actions.pod:1569 ../src/guestfs-actions.pod:1626
25616 "I<This function is deprecated.> In new code, use the "
25617 "L</guestfs_copy_device_to_device> call instead."
25621 #: ../src/guestfs-actions.pod:1589 ../src/guestfs-actions.pod:4821 ../src/guestfs-actions.pod:6214 ../src/guestfs-actions.pod:7956 ../src/guestfs-actions.pod:7976 ../src/guestfs-actions.pod:8062
25622 msgid "(Added in 1.0.87)"
25626 #: ../src/guestfs-actions.pod:1591
25631 #: ../src/guestfs-actions.pod:1593
25635 " guestfs_cp (guestfs_h *g,\n"
25636 " const char *src,\n"
25637 " const char *dest);\n"
25642 #: ../src/guestfs-actions.pod:1603 ../src/guestfs-actions.pod:1617 ../src/guestfs-actions.pod:1697 ../src/guestfs-actions.pod:1771 ../src/guestfs-actions.pod:1885 ../src/guestfs-actions.pod:5565 ../src/guestfs-actions.pod:6058
25643 msgid "(Added in 1.0.18)"
25647 #: ../src/guestfs-actions.pod:1605
25648 msgid "guestfs_cp_a"
25652 #: ../src/guestfs-actions.pod:1607
25656 " guestfs_cp_a (guestfs_h *g,\n"
25657 " const char *src,\n"
25658 " const char *dest);\n"
25663 #: ../src/guestfs-actions.pod:1619
25668 #: ../src/guestfs-actions.pod:1621
25672 " guestfs_dd (guestfs_h *g,\n"
25673 " const char *src,\n"
25674 " const char *dest);\n"
25679 #: ../src/guestfs-actions.pod:1638
25681 "If the destination is a device, it must be as large or larger than the "
25682 "source file or device, otherwise the copy will fail. This command cannot do "
25683 "partial copies (see C<guestfs_copy_device_to_device>)."
25687 #: ../src/guestfs-actions.pod:1647
25692 #: ../src/guestfs-actions.pod:1649
25696 " guestfs_df (guestfs_h *g);\n"
25701 #: ../src/guestfs-actions.pod:1654 ../src/guestfs-actions.pod:1671
25703 "This command is mostly useful for interactive sessions. It is I<not> "
25704 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
25709 #: ../src/guestfs-actions.pod:1661 ../src/guestfs-actions.pod:1678 ../src/guestfs-actions.pod:1796 ../src/guestfs-actions.pod:2803 ../src/guestfs-actions.pod:2827 ../src/guestfs-actions.pod:2895 ../src/guestfs-actions.pod:4931 ../src/guestfs-actions.pod:5465 ../src/guestfs-actions.pod:7459 ../src/guestfs-actions.pod:7483 ../src/guestfs-actions.pod:8102 ../src/guestfs-actions.pod:8115 ../src/guestfs-actions.pod:8128
25710 msgid "(Added in 1.0.54)"
25714 #: ../src/guestfs-actions.pod:1663
25715 msgid "guestfs_df_h"
25719 #: ../src/guestfs-actions.pod:1665
25723 " guestfs_df_h (guestfs_h *g);\n"
25728 #: ../src/guestfs-actions.pod:1680
25729 msgid "guestfs_dmesg"
25733 #: ../src/guestfs-actions.pod:1682
25737 " guestfs_dmesg (guestfs_h *g);\n"
25742 #: ../src/guestfs-actions.pod:1689
25744 "Another way to get the same information is to enable verbose messages with "
25745 "C<guestfs_set_verbose> or by setting the environment variable "
25746 "C<LIBGUESTFS_DEBUG=1> before running the program."
25750 #: ../src/guestfs-actions.pod:1699
25751 msgid "guestfs_download"
25755 #: ../src/guestfs-actions.pod:1701
25759 " guestfs_download (guestfs_h *g,\n"
25760 " const char *remotefilename,\n"
25761 " const char *filename);\n"
25766 #: ../src/guestfs-actions.pod:1711
25767 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
25771 #: ../src/guestfs-actions.pod:1722
25772 msgid "guestfs_download_offset"
25776 #: ../src/guestfs-actions.pod:1724
25780 " guestfs_download_offset (guestfs_h *g,\n"
25781 " const char *remotefilename,\n"
25782 " const char *filename,\n"
25783 " int64_t offset,\n"
25784 " int64_t size);\n"
25789 #: ../src/guestfs-actions.pod:1737
25791 "Note that there is no limit on the amount of data that can be downloaded "
25792 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
25793 "full amount unless an error occurs."
25797 #: ../src/guestfs-actions.pod:1742
25798 msgid "See also C<guestfs_download>, C<guestfs_pread>."
25802 #: ../src/guestfs-actions.pod:1751 ../src/guestfs-actions.pod:7760
25803 msgid "(Added in 1.5.17)"
25807 #: ../src/guestfs-actions.pod:1753
25808 msgid "guestfs_drop_caches"
25812 #: ../src/guestfs-actions.pod:1755
25816 " guestfs_drop_caches (guestfs_h *g,\n"
25817 " int whattodrop);\n"
25822 #: ../src/guestfs-actions.pod:1773
25827 #: ../src/guestfs-actions.pod:1775
25831 " guestfs_du (guestfs_h *g,\n"
25832 " const char *path);\n"
25837 #: ../src/guestfs-actions.pod:1798
25838 msgid "guestfs_e2fsck_f"
25842 #: ../src/guestfs-actions.pod:1800
25846 " guestfs_e2fsck_f (guestfs_h *g,\n"
25847 " const char *device);\n"
25852 #: ../src/guestfs-actions.pod:1808
25854 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
25855 "Normally you should use C<guestfs_fsck>."
25859 #: ../src/guestfs-actions.pod:1813
25860 msgid "(Added in 1.0.29)"
25864 #: ../src/guestfs-actions.pod:1815
25865 msgid "guestfs_echo_daemon"
25869 #: ../src/guestfs-actions.pod:1817
25873 " guestfs_echo_daemon (guestfs_h *g,\n"
25874 " char *const *words);\n"
25879 #: ../src/guestfs-actions.pod:1826
25880 msgid "See also C<guestfs_ping_daemon>."
25884 #: ../src/guestfs-actions.pod:1831 ../src/guestfs-actions.pod:2589 ../src/guestfs-actions.pod:6931
25885 msgid "(Added in 1.0.69)"
25889 #: ../src/guestfs-actions.pod:1833
25890 msgid "guestfs_egrep"
25894 #: ../src/guestfs-actions.pod:1835
25898 " guestfs_egrep (guestfs_h *g,\n"
25899 " const char *regex,\n"
25900 " const char *path);\n"
25905 #: ../src/guestfs-actions.pod:1850 ../src/guestfs-actions.pod:1869 ../src/guestfs-actions.pod:1926 ../src/guestfs-actions.pod:1972 ../src/guestfs-actions.pod:1991 ../src/guestfs-actions.pod:2719 ../src/guestfs-actions.pod:2738 ../src/guestfs-actions.pod:2916 ../src/guestfs-actions.pod:2929 ../src/guestfs-actions.pod:2944 ../src/guestfs-actions.pod:2990 ../src/guestfs-actions.pod:3012 ../src/guestfs-actions.pod:3025 ../src/guestfs-actions.pod:4311 ../src/guestfs-actions.pod:4325 ../src/guestfs-actions.pod:4338 ../src/guestfs-actions.pod:4352 ../src/guestfs-actions.pod:5353 ../src/guestfs-actions.pod:6392 ../src/guestfs-actions.pod:6441 ../src/guestfs-actions.pod:7327 ../src/guestfs-actions.pod:7339 ../src/guestfs-actions.pod:7352 ../src/guestfs-actions.pod:7365 ../src/guestfs-actions.pod:7387 ../src/guestfs-actions.pod:7400 ../src/guestfs-actions.pod:7413 ../src/guestfs-actions.pod:7426 ../src/guestfs-actions.pod:8220 ../src/guestfs-actions.pod:8239 ../src/guestfs-actions.pod:8333 ../src/guestfs-actions.pod:8352 ../src/guestfs-actions.pod:8398 ../src/guestfs-actions.pod:8417
25906 msgid "(Added in 1.0.66)"
25910 #: ../src/guestfs-actions.pod:1852
25911 msgid "guestfs_egrepi"
25915 #: ../src/guestfs-actions.pod:1854
25919 " guestfs_egrepi (guestfs_h *g,\n"
25920 " const char *regex,\n"
25921 " const char *path);\n"
25926 #: ../src/guestfs-actions.pod:1871
25927 msgid "guestfs_equal"
25931 #: ../src/guestfs-actions.pod:1873
25935 " guestfs_equal (guestfs_h *g,\n"
25936 " const char *file1,\n"
25937 " const char *file2);\n"
25942 #: ../src/guestfs-actions.pod:1887
25943 msgid "guestfs_exists"
25947 #: ../src/guestfs-actions.pod:1889
25951 " guestfs_exists (guestfs_h *g,\n"
25952 " const char *path);\n"
25957 #: ../src/guestfs-actions.pod:1896
25958 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
25962 #: ../src/guestfs-actions.pod:1902
25963 msgid "guestfs_fallocate"
25967 #: ../src/guestfs-actions.pod:1904
25971 " guestfs_fallocate (guestfs_h *g,\n"
25972 " const char *path,\n"
25978 #: ../src/guestfs-actions.pod:1909
25980 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
25985 #: ../src/guestfs-actions.pod:1928
25986 msgid "guestfs_fallocate64"
25990 #: ../src/guestfs-actions.pod:1930
25994 " guestfs_fallocate64 (guestfs_h *g,\n"
25995 " const char *path,\n"
26001 #: ../src/guestfs-actions.pod:1939
26003 "Note that this call allocates disk blocks for the file. To create a sparse "
26004 "file use C<guestfs_truncate_size> instead."
26008 #: ../src/guestfs-actions.pod:1942
26010 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
26011 "oversight it only allowed 30 bit lengths to be specified, effectively "
26012 "limiting the maximum size of files created through that call to 1GB."
26016 #: ../src/guestfs-actions.pod:1953
26017 msgid "(Added in 1.3.17)"
26021 #: ../src/guestfs-actions.pod:1955
26022 msgid "guestfs_fgrep"
26026 #: ../src/guestfs-actions.pod:1957
26030 " guestfs_fgrep (guestfs_h *g,\n"
26031 " const char *pattern,\n"
26032 " const char *path);\n"
26037 #: ../src/guestfs-actions.pod:1974
26038 msgid "guestfs_fgrepi"
26042 #: ../src/guestfs-actions.pod:1976
26046 " guestfs_fgrepi (guestfs_h *g,\n"
26047 " const char *pattern,\n"
26048 " const char *path);\n"
26053 #: ../src/guestfs-actions.pod:1993
26054 msgid "guestfs_file"
26058 #: ../src/guestfs-actions.pod:1995
26062 " guestfs_file (guestfs_h *g,\n"
26063 " const char *path);\n"
26068 #: ../src/guestfs-actions.pod:2013
26070 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
26071 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
26075 #: ../src/guestfs-actions.pod:2021
26076 msgid "guestfs_file_architecture"
26080 #: ../src/guestfs-actions.pod:2023
26084 " guestfs_file_architecture (guestfs_h *g,\n"
26085 " const char *filename);\n"
26090 #: ../src/guestfs-actions.pod:2131 ../src/guestfs-actions.pod:2294 ../src/guestfs-actions.pod:2311 ../src/guestfs-actions.pod:3045 ../src/guestfs-actions.pod:3147 ../src/guestfs-actions.pod:3213 ../src/guestfs-actions.pod:3400 ../src/guestfs-actions.pod:3418 ../src/guestfs-actions.pod:3458 ../src/guestfs-actions.pod:3534 ../src/guestfs-actions.pod:3631 ../src/guestfs-actions.pod:3868 ../src/guestfs-actions.pod:4000
26091 msgid "(Added in 1.5.3)"
26095 #: ../src/guestfs-actions.pod:2133
26096 msgid "guestfs_filesize"
26100 #: ../src/guestfs-actions.pod:2135
26104 " guestfs_filesize (guestfs_h *g,\n"
26105 " const char *file);\n"
26110 #: ../src/guestfs-actions.pod:2141
26112 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
26113 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
26114 "devices, use C<guestfs_blockdev_getsize64>."
26118 #: ../src/guestfs-actions.pod:2147
26119 msgid "(Added in 1.0.82)"
26123 #: ../src/guestfs-actions.pod:2149
26124 msgid "guestfs_fill"
26128 #: ../src/guestfs-actions.pod:2151
26132 " guestfs_fill (guestfs_h *g,\n"
26135 " const char *path);\n"
26140 #: ../src/guestfs-actions.pod:2161
26142 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
26143 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
26144 "bytes use C<guestfs_fill_pattern>."
26148 #: ../src/guestfs-actions.pod:2173
26149 msgid "(Added in 1.0.79)"
26153 #: ../src/guestfs-actions.pod:2175
26154 msgid "guestfs_fill_pattern"
26158 #: ../src/guestfs-actions.pod:2177
26162 " guestfs_fill_pattern (guestfs_h *g,\n"
26163 " const char *pattern,\n"
26165 " const char *path);\n"
26170 #: ../src/guestfs-actions.pod:2183
26172 "This function is like C<guestfs_fill> except that it creates a new file of "
26173 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
26174 "pattern is truncated if necessary to ensure the length of the file is "
26175 "exactly C<len> bytes."
26179 #: ../src/guestfs-actions.pod:2195
26180 msgid "(Added in 1.3.12)"
26184 #: ../src/guestfs-actions.pod:2197
26185 msgid "guestfs_find"
26189 #: ../src/guestfs-actions.pod:2199
26193 " guestfs_find (guestfs_h *g,\n"
26194 " const char *directory);\n"
26199 #: ../src/guestfs-actions.pod:2215
26200 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
26204 #: ../src/guestfs-actions.pod:2228
26205 msgid "See also C<guestfs_find0>."
26209 #: ../src/guestfs-actions.pod:2237 ../src/guestfs-actions.pod:4758 ../src/guestfs-actions.pod:6476
26210 msgid "(Added in 1.0.27)"
26214 #: ../src/guestfs-actions.pod:2239
26215 msgid "guestfs_find0"
26219 #: ../src/guestfs-actions.pod:2241
26223 " guestfs_find0 (guestfs_h *g,\n"
26224 " const char *directory,\n"
26225 " const char *files);\n"
26230 #: ../src/guestfs-actions.pod:2250
26232 "This command works the same way as C<guestfs_find> with the following "
26237 #: ../src/guestfs-actions.pod:2277
26238 msgid "(Added in 1.0.74)"
26242 #: ../src/guestfs-actions.pod:2279
26243 msgid "guestfs_findfs_label"
26247 #: ../src/guestfs-actions.pod:2281
26251 " guestfs_findfs_label (guestfs_h *g,\n"
26252 " const char *label);\n"
26257 #: ../src/guestfs-actions.pod:2289
26258 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
26262 #: ../src/guestfs-actions.pod:2296
26263 msgid "guestfs_findfs_uuid"
26267 #: ../src/guestfs-actions.pod:2298
26271 " guestfs_findfs_uuid (guestfs_h *g,\n"
26272 " const char *uuid);\n"
26277 #: ../src/guestfs-actions.pod:2306
26278 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
26282 #: ../src/guestfs-actions.pod:2313
26283 msgid "guestfs_fsck"
26287 #: ../src/guestfs-actions.pod:2315
26291 " guestfs_fsck (guestfs_h *g,\n"
26292 " const char *fstype,\n"
26293 " const char *device);\n"
26298 #: ../src/guestfs-actions.pod:2350 ../src/guestfs-actions.pod:8267
26299 msgid "(Added in 1.0.16)"
26303 #: ../src/guestfs-actions.pod:2352
26304 msgid "guestfs_get_append"
26308 #: ../src/guestfs-actions.pod:2354
26312 " guestfs_get_append (guestfs_h *g);\n"
26317 #: ../src/guestfs-actions.pod:2362
26319 "This function returns a string which may be NULL. There is no way to return "
26320 "an error from this function. The string is owned by the guest handle and "
26321 "must I<not> be freed."
26325 #: ../src/guestfs-actions.pod:2366 ../src/guestfs-actions.pod:6154 ../src/guestfs-actions.pod:6636 ../src/guestfs-actions.pod:7094 ../src/guestfs-actions.pod:7113 ../src/guestfs-actions.pod:7129 ../src/guestfs-actions.pod:7153 ../src/guestfs-actions.pod:7907 ../src/guestfs-actions.pod:7922 ../src/guestfs-actions.pod:8314
26326 msgid "(Added in 1.0.26)"
26330 #: ../src/guestfs-actions.pod:2368
26331 msgid "guestfs_get_attach_method"
26335 #: ../src/guestfs-actions.pod:2370
26339 " guestfs_get_attach_method (guestfs_h *g);\n"
26344 #: ../src/guestfs-actions.pod:2373
26345 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
26349 #: ../src/guestfs-actions.pod:2378 ../src/guestfs-actions.pod:6666
26350 msgid "(Added in 1.9.8)"
26354 #: ../src/guestfs-actions.pod:2380
26355 msgid "guestfs_get_autosync"
26359 #: ../src/guestfs-actions.pod:2382
26363 " guestfs_get_autosync (guestfs_h *g);\n"
26368 #: ../src/guestfs-actions.pod:2391
26369 msgid "guestfs_get_direct"
26373 #: ../src/guestfs-actions.pod:2393
26377 " guestfs_get_direct (guestfs_h *g);\n"
26382 #: ../src/guestfs-actions.pod:2400 ../src/guestfs-actions.pod:6707
26383 msgid "(Added in 1.0.72)"
26387 #: ../src/guestfs-actions.pod:2402
26388 msgid "guestfs_get_e2label"
26392 #: ../src/guestfs-actions.pod:2404
26396 " guestfs_get_e2label (guestfs_h *g,\n"
26397 " const char *device);\n"
26402 #: ../src/guestfs-actions.pod:2408
26404 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
26409 #: ../src/guestfs-actions.pod:2421 ../src/guestfs-actions.pod:2442 ../src/guestfs-actions.pod:6725 ../src/guestfs-actions.pod:6744
26410 msgid "(Added in 1.0.15)"
26414 #: ../src/guestfs-actions.pod:2423
26415 msgid "guestfs_get_e2uuid"
26419 #: ../src/guestfs-actions.pod:2425
26423 " guestfs_get_e2uuid (guestfs_h *g,\n"
26424 " const char *device);\n"
26429 #: ../src/guestfs-actions.pod:2429
26431 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
26436 #: ../src/guestfs-actions.pod:2444
26437 msgid "guestfs_get_memsize"
26441 #: ../src/guestfs-actions.pod:2446
26445 " guestfs_get_memsize (guestfs_h *g);\n"
26450 #: ../src/guestfs-actions.pod:2452
26452 "If C<guestfs_set_memsize> was not called on this handle, and if "
26453 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
26454 "value for memsize."
26458 #: ../src/guestfs-actions.pod:2461 ../src/guestfs-actions.pod:5049 ../src/guestfs-actions.pod:5258 ../src/guestfs-actions.pod:5277 ../src/guestfs-actions.pod:5296 ../src/guestfs-actions.pod:5308 ../src/guestfs-actions.pod:5325 ../src/guestfs-actions.pod:5338 ../src/guestfs-actions.pod:6379 ../src/guestfs-actions.pod:6765 ../src/guestfs-actions.pod:7061 ../src/guestfs-actions.pod:7676
26459 msgid "(Added in 1.0.55)"
26463 #: ../src/guestfs-actions.pod:2463
26464 msgid "guestfs_get_network"
26468 #: ../src/guestfs-actions.pod:2465
26472 " guestfs_get_network (guestfs_h *g);\n"
26477 #: ../src/guestfs-actions.pod:2472 ../src/guestfs-actions.pod:6784
26478 msgid "(Added in 1.5.4)"
26482 #: ../src/guestfs-actions.pod:2474
26483 msgid "guestfs_get_path"
26487 #: ../src/guestfs-actions.pod:2476
26491 " guestfs_get_path (guestfs_h *g);\n"
26496 #: ../src/guestfs-actions.pod:2484 ../src/guestfs-actions.pod:2524
26498 "This function returns a string, or NULL on error. The string is owned by "
26499 "the guest handle and must I<not> be freed."
26503 #: ../src/guestfs-actions.pod:2489
26504 msgid "guestfs_get_pgroup"
26508 #: ../src/guestfs-actions.pod:2491
26512 " guestfs_get_pgroup (guestfs_h *g);\n"
26517 #: ../src/guestfs-actions.pod:2498 ../src/guestfs-actions.pod:6820 ../src/guestfs-actions.pod:8168
26518 msgid "(Added in 1.11.18)"
26522 #: ../src/guestfs-actions.pod:2500
26523 msgid "guestfs_get_pid"
26527 #: ../src/guestfs-actions.pod:2502
26531 " guestfs_get_pid (guestfs_h *g);\n"
26536 #: ../src/guestfs-actions.pod:2512
26537 msgid "(Added in 1.0.56)"
26541 #: ../src/guestfs-actions.pod:2514
26542 msgid "guestfs_get_qemu"
26546 #: ../src/guestfs-actions.pod:2516
26550 " guestfs_get_qemu (guestfs_h *g);\n"
26555 #: ../src/guestfs-actions.pod:2527 ../src/guestfs-actions.pod:6848
26556 msgid "(Added in 1.0.6)"
26560 #: ../src/guestfs-actions.pod:2529
26561 msgid "guestfs_get_recovery_proc"
26565 #: ../src/guestfs-actions.pod:2531
26569 " guestfs_get_recovery_proc (guestfs_h *g);\n"
26574 #: ../src/guestfs-actions.pod:2538 ../src/guestfs-actions.pod:4122 ../src/guestfs-actions.pod:4453 ../src/guestfs-actions.pod:4856 ../src/guestfs-actions.pod:4888 ../src/guestfs-actions.pod:6084 ../src/guestfs-actions.pod:6427 ../src/guestfs-actions.pod:6872 ../src/guestfs-actions.pod:7579 ../src/guestfs-actions.pod:7599 ../src/guestfs-actions.pod:7791
26575 msgid "(Added in 1.0.77)"
26579 #: ../src/guestfs-actions.pod:2540
26580 msgid "guestfs_get_selinux"
26584 #: ../src/guestfs-actions.pod:2542
26588 " guestfs_get_selinux (guestfs_h *g);\n"
26593 #: ../src/guestfs-actions.pod:2545
26595 "This returns the current setting of the selinux flag which is passed to the "
26596 "appliance at boot time. See C<guestfs_set_selinux>."
26600 #: ../src/guestfs-actions.pod:2553 ../src/guestfs-actions.pod:2627 ../src/guestfs-actions.pod:6891 ../src/guestfs-actions.pod:6965
26601 msgid "(Added in 1.0.67)"
26605 #: ../src/guestfs-actions.pod:2555
26606 msgid "guestfs_get_smp"
26610 #: ../src/guestfs-actions.pod:2557
26614 " guestfs_get_smp (guestfs_h *g);\n"
26619 #: ../src/guestfs-actions.pod:2566
26620 msgid "guestfs_get_state"
26624 #: ../src/guestfs-actions.pod:2568
26628 " guestfs_get_state (guestfs_h *g);\n"
26633 #: ../src/guestfs-actions.pod:2580
26634 msgid "guestfs_get_trace"
26638 #: ../src/guestfs-actions.pod:2582
26642 " guestfs_get_trace (guestfs_h *g);\n"
26647 #: ../src/guestfs-actions.pod:2591
26648 msgid "guestfs_get_umask"
26652 #: ../src/guestfs-actions.pod:2593
26656 " guestfs_get_umask (guestfs_h *g);\n"
26661 #: ../src/guestfs-actions.pod:2596
26663 "Return the current umask. By default the umask is C<022> unless it has been "
26664 "set by calling C<guestfs_umask>."
26668 #: ../src/guestfs-actions.pod:2603
26669 msgid "guestfs_get_verbose"
26673 #: ../src/guestfs-actions.pod:2605
26677 " guestfs_get_verbose (guestfs_h *g);\n"
26682 #: ../src/guestfs-actions.pod:2614
26683 msgid "guestfs_getcon"
26687 #: ../src/guestfs-actions.pod:2616
26691 " guestfs_getcon (guestfs_h *g);\n"
26696 #: ../src/guestfs-actions.pod:2621
26697 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
26701 #: ../src/guestfs-actions.pod:2629
26702 msgid "guestfs_getxattr"
26706 #: ../src/guestfs-actions.pod:2631
26710 " guestfs_getxattr (guestfs_h *g,\n"
26711 " const char *path,\n"
26712 " const char *name,\n"
26713 " size_t *size_r);\n"
26718 #: ../src/guestfs-actions.pod:2637
26720 "Get a single extended attribute from file C<path> named C<name>. This call "
26721 "follows symlinks. If you want to lookup an extended attribute for the "
26722 "symlink itself, use C<guestfs_lgetxattr>."
26726 #: ../src/guestfs-actions.pod:2641 ../src/guestfs-actions.pod:4136
26728 "Normally it is better to get all extended attributes from a file in one go "
26729 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
26730 "implementations are buggy and do not provide a way to list out attributes. "
26731 "For these filesystems (notably ntfs-3g) you have to know the names of the "
26732 "extended attributes you want in advance and call this function."
26736 #: ../src/guestfs-actions.pod:2651
26737 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
26741 #: ../src/guestfs-actions.pod:2653 ../src/guestfs-actions.pod:2866 ../src/guestfs-actions.pod:3348 ../src/guestfs-actions.pod:4148 ../src/guestfs-actions.pod:6077 ../src/guestfs-actions.pod:6103 ../src/guestfs-actions.pod:6284
26743 "This function returns a buffer, or NULL on error. The size of the returned "
26744 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
26749 #: ../src/guestfs-actions.pod:2657 ../src/guestfs-actions.pod:4152
26750 msgid "(Added in 1.7.24)"
26754 #: ../src/guestfs-actions.pod:2659
26755 msgid "guestfs_getxattrs"
26759 #: ../src/guestfs-actions.pod:2661
26762 " struct guestfs_xattr_list *\n"
26763 " guestfs_getxattrs (guestfs_h *g,\n"
26764 " const char *path);\n"
26769 #: ../src/guestfs-actions.pod:2671
26770 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
26774 #: ../src/guestfs-actions.pod:2673 ../src/guestfs-actions.pod:4164 ../src/guestfs-actions.pod:4852
26776 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
26777 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
26781 #: ../src/guestfs-actions.pod:2677 ../src/guestfs-actions.pod:4168 ../src/guestfs-actions.pod:4367 ../src/guestfs-actions.pod:4403 ../src/guestfs-actions.pod:6457 ../src/guestfs-actions.pod:6984 ../src/guestfs-actions.pod:8379
26782 msgid "(Added in 1.0.59)"
26786 #: ../src/guestfs-actions.pod:2679
26787 msgid "guestfs_glob_expand"
26791 #: ../src/guestfs-actions.pod:2681
26795 " guestfs_glob_expand (guestfs_h *g,\n"
26796 " const char *pattern);\n"
26801 #: ../src/guestfs-actions.pod:2700 ../src/guestfs-actions.pod:7177 ../src/guestfs-actions.pod:7194
26802 msgid "(Added in 1.0.50)"
26806 #: ../src/guestfs-actions.pod:2702
26807 msgid "guestfs_grep"
26811 #: ../src/guestfs-actions.pod:2704
26815 " guestfs_grep (guestfs_h *g,\n"
26816 " const char *regex,\n"
26817 " const char *path);\n"
26822 #: ../src/guestfs-actions.pod:2721
26823 msgid "guestfs_grepi"
26827 #: ../src/guestfs-actions.pod:2723
26831 " guestfs_grepi (guestfs_h *g,\n"
26832 " const char *regex,\n"
26833 " const char *path);\n"
26838 #: ../src/guestfs-actions.pod:2740
26839 msgid "guestfs_grub_install"
26843 #: ../src/guestfs-actions.pod:2742
26847 " guestfs_grub_install (guestfs_h *g,\n"
26848 " const char *root,\n"
26849 " const char *device);\n"
26854 #: ../src/guestfs-actions.pod:2785
26855 msgid "(Added in 1.0.17)"
26859 #: ../src/guestfs-actions.pod:2787
26860 msgid "guestfs_head"
26864 #: ../src/guestfs-actions.pod:2789
26868 " guestfs_head (guestfs_h *g,\n"
26869 " const char *path);\n"
26874 #: ../src/guestfs-actions.pod:2805
26875 msgid "guestfs_head_n"
26879 #: ../src/guestfs-actions.pod:2807
26883 " guestfs_head_n (guestfs_h *g,\n"
26885 " const char *path);\n"
26890 #: ../src/guestfs-actions.pod:2829
26891 msgid "guestfs_hexdump"
26895 #: ../src/guestfs-actions.pod:2831
26899 " guestfs_hexdump (guestfs_h *g,\n"
26900 " const char *path);\n"
26905 #: ../src/guestfs-actions.pod:2844 ../src/guestfs-actions.pod:7258 ../src/guestfs-actions.pod:7313
26906 msgid "(Added in 1.0.22)"
26910 #: ../src/guestfs-actions.pod:2846
26911 msgid "guestfs_initrd_cat"
26915 #: ../src/guestfs-actions.pod:2848
26919 " guestfs_initrd_cat (guestfs_h *g,\n"
26920 " const char *initrdpath,\n"
26921 " const char *filename,\n"
26922 " size_t *size_r);\n"
26927 #: ../src/guestfs-actions.pod:2864
26928 msgid "See also C<guestfs_initrd_list>."
26932 #: ../src/guestfs-actions.pod:2875
26933 msgid "guestfs_initrd_list"
26937 #: ../src/guestfs-actions.pod:2877
26941 " guestfs_initrd_list (guestfs_h *g,\n"
26942 " const char *path);\n"
26947 #: ../src/guestfs-actions.pod:2897
26948 msgid "guestfs_inotify_add_watch"
26952 #: ../src/guestfs-actions.pod:2899
26956 " guestfs_inotify_add_watch (guestfs_h *g,\n"
26957 " const char *path,\n"
26963 #: ../src/guestfs-actions.pod:2918
26964 msgid "guestfs_inotify_close"
26968 #: ../src/guestfs-actions.pod:2920
26972 " guestfs_inotify_close (guestfs_h *g);\n"
26977 #: ../src/guestfs-actions.pod:2931
26978 msgid "guestfs_inotify_files"
26982 #: ../src/guestfs-actions.pod:2933
26986 " guestfs_inotify_files (guestfs_h *g);\n"
26991 #: ../src/guestfs-actions.pod:2936
26993 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
26994 "returns a list of pathnames of objects that were touched. The returned "
26995 "pathnames are sorted and deduplicated."
26999 #: ../src/guestfs-actions.pod:2946
27000 msgid "guestfs_inotify_init"
27004 #: ../src/guestfs-actions.pod:2948
27008 " guestfs_inotify_init (guestfs_h *g,\n"
27009 " int maxevents);\n"
27014 #: ../src/guestfs-actions.pod:2956
27016 "C<maxevents> is the maximum number of events which will be queued up between "
27017 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
27018 "passed as C<0>, then the kernel (or previously set) default is used. For "
27019 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
27020 "throws away events, but records the fact that it threw them away by setting "
27021 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
27022 "C<guestfs_inotify_read>)."
27026 #: ../src/guestfs-actions.pod:2966
27028 "Before any events are generated, you have to add some watches to the "
27029 "internal watch list. See: C<guestfs_inotify_add_watch>, "
27030 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
27034 #: ../src/guestfs-actions.pod:2972
27036 "Queued up events should be read periodically by calling "
27037 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
27038 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
27039 "often enough then you risk the internal queue overflowing."
27043 #: ../src/guestfs-actions.pod:2979
27045 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
27046 "This also removes any watches automatically."
27050 #: ../src/guestfs-actions.pod:2992
27051 msgid "guestfs_inotify_read"
27055 #: ../src/guestfs-actions.pod:2994
27058 " struct guestfs_inotify_event_list *\n"
27059 " guestfs_inotify_read (guestfs_h *g);\n"
27064 #: ../src/guestfs-actions.pod:3008
27066 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
27067 "there was an error. I<The caller must call "
27068 "C<guestfs_free_inotify_event_list> after use>."
27072 #: ../src/guestfs-actions.pod:3014
27073 msgid "guestfs_inotify_rm_watch"
27077 #: ../src/guestfs-actions.pod:3016
27081 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
27087 #: ../src/guestfs-actions.pod:3020
27089 "Remove a previously defined inotify watch. See "
27090 "C<guestfs_inotify_add_watch>."
27094 #: ../src/guestfs-actions.pod:3027
27095 msgid "guestfs_inspect_get_arch"
27099 #: ../src/guestfs-actions.pod:3029
27103 " guestfs_inspect_get_arch (guestfs_h *g,\n"
27104 " const char *root);\n"
27109 #: ../src/guestfs-actions.pod:3033
27111 "This returns the architecture of the inspected operating system. The "
27112 "possible return values are listed under C<guestfs_file_architecture>."
27116 #: ../src/guestfs-actions.pod:3047
27117 msgid "guestfs_inspect_get_distro"
27121 #: ../src/guestfs-actions.pod:3049
27125 " guestfs_inspect_get_distro (guestfs_h *g,\n"
27126 " const char *root);\n"
27131 #: ../src/guestfs-actions.pod:3149
27132 msgid "guestfs_inspect_get_drive_mappings"
27136 #: ../src/guestfs-actions.pod:3151
27140 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
27141 " const char *root);\n"
27146 #: ../src/guestfs-actions.pod:3180
27148 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27149 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
27153 #: ../src/guestfs-actions.pod:3184 ../src/guestfs-actions.pod:3452 ../src/guestfs-actions.pod:4255 ../src/guestfs-actions.pod:5527 ../src/guestfs-actions.pod:7615
27155 "This function returns a NULL-terminated array of strings, or NULL if there "
27156 "was an error. The array of strings will always have length C<2n+1>, where "
27157 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
27158 "caller must free the strings and the array after use>."
27162 #: ../src/guestfs-actions.pod:3190 ../src/guestfs-actions.pod:3651
27163 msgid "(Added in 1.9.17)"
27167 #: ../src/guestfs-actions.pod:3192
27168 msgid "guestfs_inspect_get_filesystems"
27172 #: ../src/guestfs-actions.pod:3194
27176 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
27177 " const char *root);\n"
27182 #: ../src/guestfs-actions.pod:3206
27184 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27185 "C<guestfs_inspect_get_mountpoints>."
27189 #: ../src/guestfs-actions.pod:3215
27190 msgid "guestfs_inspect_get_format"
27194 #: ../src/guestfs-actions.pod:3217
27198 " guestfs_inspect_get_format (guestfs_h *g,\n"
27199 " const char *root);\n"
27204 #: ../src/guestfs-actions.pod:3251 ../src/guestfs-actions.pod:3687 ../src/guestfs-actions.pod:3703 ../src/guestfs-actions.pod:3721 ../src/guestfs-actions.pod:6495
27205 msgid "(Added in 1.9.4)"
27209 #: ../src/guestfs-actions.pod:3253
27210 msgid "guestfs_inspect_get_hostname"
27214 #: ../src/guestfs-actions.pod:3255
27218 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
27219 " const char *root);\n"
27224 #: ../src/guestfs-actions.pod:3270
27225 msgid "(Added in 1.7.9)"
27229 #: ../src/guestfs-actions.pod:3272
27230 msgid "guestfs_inspect_get_icon"
27234 #: ../src/guestfs-actions.pod:3274
27238 " guestfs_inspect_get_icon (guestfs_h *g,\n"
27239 " const char *root,\n"
27240 " size_t *size_r,\n"
27246 #: ../src/guestfs-actions.pod:3285
27249 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
27250 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
27255 #: ../src/guestfs-actions.pod:3352 ../src/guestfs-actions.pod:4182 ../src/guestfs-actions.pod:5426
27256 msgid "(Added in 1.11.12)"
27260 #: ../src/guestfs-actions.pod:3354
27261 msgid "guestfs_inspect_get_icon_va"
27265 #: ../src/guestfs-actions.pod:3356
27269 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
27270 " const char *root,\n"
27271 " size_t *size_r,\n"
27272 " va_list args);\n"
27277 #: ../src/guestfs-actions.pod:3362
27278 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
27282 #: ../src/guestfs-actions.pod:3366
27283 msgid "guestfs_inspect_get_icon_argv"
27287 #: ../src/guestfs-actions.pod:3368
27291 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
27292 " const char *root,\n"
27293 " size_t *size_r,\n"
27294 " const struct guestfs_inspect_get_icon_argv "
27300 #: ../src/guestfs-actions.pod:3374
27301 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
27305 #: ../src/guestfs-actions.pod:3378
27306 msgid "guestfs_inspect_get_major_version"
27310 #: ../src/guestfs-actions.pod:3380
27314 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
27315 " const char *root);\n"
27320 #: ../src/guestfs-actions.pod:3402
27321 msgid "guestfs_inspect_get_minor_version"
27325 #: ../src/guestfs-actions.pod:3404
27329 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
27330 " const char *root);\n"
27335 #: ../src/guestfs-actions.pod:3413
27337 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27338 "C<guestfs_inspect_get_major_version>."
27342 #: ../src/guestfs-actions.pod:3420
27343 msgid "guestfs_inspect_get_mountpoints"
27347 #: ../src/guestfs-actions.pod:3422
27351 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
27352 " const char *root);\n"
27357 #: ../src/guestfs-actions.pod:3443
27359 "For operating systems like Windows which still use drive letters, this call "
27360 "will only return an entry for the first drive \"mounted on\" C</>. For "
27361 "information about the mapping of drive letters to partitions, see "
27362 "C<guestfs_inspect_get_drive_mappings>."
27366 #: ../src/guestfs-actions.pod:3449
27368 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27369 "C<guestfs_inspect_get_filesystems>."
27373 #: ../src/guestfs-actions.pod:3460
27374 msgid "guestfs_inspect_get_package_format"
27378 #: ../src/guestfs-actions.pod:3462
27382 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
27383 " const char *root);\n"
27388 #: ../src/guestfs-actions.pod:3466
27390 "This function and C<guestfs_inspect_get_package_management> return the "
27391 "package format and package management tool used by the inspected operating "
27392 "system. For example for Fedora these functions would return C<rpm> (package "
27393 "format) and C<yum> (package management)."
27397 #: ../src/guestfs-actions.pod:3485 ../src/guestfs-actions.pod:3513
27398 msgid "(Added in 1.7.5)"
27402 #: ../src/guestfs-actions.pod:3487
27403 msgid "guestfs_inspect_get_package_management"
27407 #: ../src/guestfs-actions.pod:3489
27411 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
27412 " const char *root);\n"
27417 #: ../src/guestfs-actions.pod:3493
27419 "C<guestfs_inspect_get_package_format> and this function return the package "
27420 "format and package management tool used by the inspected operating system. "
27421 "For example for Fedora these functions would return C<rpm> (package format) "
27422 "and C<yum> (package management)."
27426 #: ../src/guestfs-actions.pod:3515
27427 msgid "guestfs_inspect_get_product_name"
27431 #: ../src/guestfs-actions.pod:3517
27435 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
27436 " const char *root);\n"
27441 #: ../src/guestfs-actions.pod:3536
27442 msgid "guestfs_inspect_get_product_variant"
27446 #: ../src/guestfs-actions.pod:3538
27450 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
27451 " const char *root);\n"
27456 #: ../src/guestfs-actions.pod:3561
27458 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27459 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
27463 #: ../src/guestfs-actions.pod:3568
27464 msgid "(Added in 1.9.13)"
27468 #: ../src/guestfs-actions.pod:3570
27469 msgid "guestfs_inspect_get_roots"
27473 #: ../src/guestfs-actions.pod:3572
27477 " guestfs_inspect_get_roots (guestfs_h *g);\n"
27482 #: ../src/guestfs-actions.pod:3575
27484 "This function is a convenient way to get the list of root devices, as "
27485 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
27486 "the whole inspection process."
27490 #: ../src/guestfs-actions.pod:3579
27492 "This returns an empty list if either no root devices were found or the "
27493 "caller has not called C<guestfs_inspect_os>."
27497 #: ../src/guestfs-actions.pod:3588
27498 msgid "(Added in 1.7.3)"
27502 #: ../src/guestfs-actions.pod:3590
27503 msgid "guestfs_inspect_get_type"
27507 #: ../src/guestfs-actions.pod:3592
27511 " guestfs_inspect_get_type (guestfs_h *g,\n"
27512 " const char *root);\n"
27517 #: ../src/guestfs-actions.pod:3633
27518 msgid "guestfs_inspect_get_windows_current_control_set"
27522 #: ../src/guestfs-actions.pod:3635
27526 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
27527 " const char *root);\n"
27532 #: ../src/guestfs-actions.pod:3653
27533 msgid "guestfs_inspect_get_windows_systemroot"
27537 #: ../src/guestfs-actions.pod:3655
27541 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
27542 " const char *root);\n"
27547 #: ../src/guestfs-actions.pod:3671
27548 msgid "(Added in 1.5.25)"
27552 #: ../src/guestfs-actions.pod:3673
27553 msgid "guestfs_inspect_is_live"
27557 #: ../src/guestfs-actions.pod:3675
27561 " guestfs_inspect_is_live (guestfs_h *g,\n"
27562 " const char *root);\n"
27567 #: ../src/guestfs-actions.pod:3679
27569 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27570 "disk), then this returns true if a live image was detected on the disk."
27574 #: ../src/guestfs-actions.pod:3689
27575 msgid "guestfs_inspect_is_multipart"
27579 #: ../src/guestfs-actions.pod:3691
27583 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
27584 " const char *root);\n"
27589 #: ../src/guestfs-actions.pod:3695
27591 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27592 "disk), then this returns true if the disk is part of a set."
27596 #: ../src/guestfs-actions.pod:3705
27597 msgid "guestfs_inspect_is_netinst"
27601 #: ../src/guestfs-actions.pod:3707
27605 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
27606 " const char *root);\n"
27611 #: ../src/guestfs-actions.pod:3711
27613 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27614 "disk), then this returns true if the disk is a network installer, ie. not a "
27615 "self-contained install CD but one which is likely to require network access "
27616 "to complete the install."
27620 #: ../src/guestfs-actions.pod:3723
27621 msgid "guestfs_inspect_list_applications"
27625 #: ../src/guestfs-actions.pod:3725
27628 " struct guestfs_application_list *\n"
27629 " guestfs_inspect_list_applications (guestfs_h *g,\n"
27630 " const char *root);\n"
27635 #: ../src/guestfs-actions.pod:3731
27637 "I<Note:> This call works differently from other parts of the inspection "
27638 "API. You have to call C<guestfs_inspect_os>, then "
27639 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
27640 "this. Listing applications is a significantly more difficult operation "
27641 "which requires access to the full filesystem. Also note that unlike the "
27642 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
27643 "the libguestfs handle, this call actually reads parts of the mounted "
27644 "filesystems during the call."
27648 #: ../src/guestfs-actions.pod:3821
27650 "This function returns a C<struct guestfs_application_list *>, or NULL if "
27651 "there was an error. I<The caller must call C<guestfs_free_application_list> "
27656 #: ../src/guestfs-actions.pod:3825
27657 msgid "(Added in 1.7.8)"
27661 #: ../src/guestfs-actions.pod:3827
27662 msgid "guestfs_inspect_os"
27666 #: ../src/guestfs-actions.pod:3829
27670 " guestfs_inspect_os (guestfs_h *g);\n"
27675 #: ../src/guestfs-actions.pod:3845
27677 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
27678 "functions in order to query further information about each operating system, "
27679 "such as the name and version."
27683 #: ../src/guestfs-actions.pod:3850
27685 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
27686 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
27687 "the contents. This should be called with no disks currently mounted. The "
27688 "function may also use Augeas, so any existing Augeas handle will be closed."
27692 #: ../src/guestfs-actions.pod:3862 ../src/guestfs-actions.pod:4193 ../src/guestfs-actions.pod:4275
27693 msgid "See also C<guestfs_list_filesystems>."
27697 #: ../src/guestfs-actions.pod:3870
27698 msgid "guestfs_is_blockdev"
27702 #: ../src/guestfs-actions.pod:3872
27706 " guestfs_is_blockdev (guestfs_h *g,\n"
27707 " const char *path);\n"
27712 #: ../src/guestfs-actions.pod:3879 ../src/guestfs-actions.pod:3908 ../src/guestfs-actions.pod:3938 ../src/guestfs-actions.pod:3953 ../src/guestfs-actions.pod:3969 ../src/guestfs-actions.pod:4025 ../src/guestfs-actions.pod:4040
27713 msgid "See also C<guestfs_stat>."
27717 #: ../src/guestfs-actions.pod:3883 ../src/guestfs-actions.pod:3912 ../src/guestfs-actions.pod:3957 ../src/guestfs-actions.pod:4029 ../src/guestfs-actions.pod:4044
27718 msgid "(Added in 1.5.10)"
27722 #: ../src/guestfs-actions.pod:3885
27723 msgid "guestfs_is_busy"
27727 #: ../src/guestfs-actions.pod:3887
27731 " guestfs_is_busy (guestfs_h *g);\n"
27736 #: ../src/guestfs-actions.pod:3899
27737 msgid "guestfs_is_chardev"
27741 #: ../src/guestfs-actions.pod:3901
27745 " guestfs_is_chardev (guestfs_h *g,\n"
27746 " const char *path);\n"
27751 #: ../src/guestfs-actions.pod:3914
27752 msgid "guestfs_is_config"
27756 #: ../src/guestfs-actions.pod:3916
27760 " guestfs_is_config (guestfs_h *g);\n"
27765 #: ../src/guestfs-actions.pod:3928
27766 msgid "guestfs_is_dir"
27770 #: ../src/guestfs-actions.pod:3930
27774 " guestfs_is_dir (guestfs_h *g,\n"
27775 " const char *path);\n"
27780 #: ../src/guestfs-actions.pod:3944
27781 msgid "guestfs_is_fifo"
27785 #: ../src/guestfs-actions.pod:3946
27789 " guestfs_is_fifo (guestfs_h *g,\n"
27790 " const char *path);\n"
27795 #: ../src/guestfs-actions.pod:3959
27796 msgid "guestfs_is_file"
27800 #: ../src/guestfs-actions.pod:3961
27804 " guestfs_is_file (guestfs_h *g,\n"
27805 " const char *path);\n"
27810 #: ../src/guestfs-actions.pod:3975
27811 msgid "guestfs_is_launching"
27815 #: ../src/guestfs-actions.pod:3977
27819 " guestfs_is_launching (guestfs_h *g);\n"
27824 #: ../src/guestfs-actions.pod:3989
27825 msgid "guestfs_is_lv"
27829 #: ../src/guestfs-actions.pod:3991
27833 " guestfs_is_lv (guestfs_h *g,\n"
27834 " const char *device);\n"
27839 #: ../src/guestfs-actions.pod:4002
27840 msgid "guestfs_is_ready"
27844 #: ../src/guestfs-actions.pod:4004
27848 " guestfs_is_ready (guestfs_h *g);\n"
27853 #: ../src/guestfs-actions.pod:4016
27854 msgid "guestfs_is_socket"
27858 #: ../src/guestfs-actions.pod:4018
27862 " guestfs_is_socket (guestfs_h *g,\n"
27863 " const char *path);\n"
27868 #: ../src/guestfs-actions.pod:4031
27869 msgid "guestfs_is_symlink"
27873 #: ../src/guestfs-actions.pod:4033
27877 " guestfs_is_symlink (guestfs_h *g,\n"
27878 " const char *path);\n"
27883 #: ../src/guestfs-actions.pod:4046
27884 msgid "guestfs_is_zero"
27888 #: ../src/guestfs-actions.pod:4048
27892 " guestfs_is_zero (guestfs_h *g,\n"
27893 " const char *path);\n"
27898 #: ../src/guestfs-actions.pod:4057 ../src/guestfs-actions.pod:4071
27899 msgid "(Added in 1.11.8)"
27903 #: ../src/guestfs-actions.pod:4059
27904 msgid "guestfs_is_zero_device"
27908 #: ../src/guestfs-actions.pod:4061
27912 " guestfs_is_zero_device (guestfs_h *g,\n"
27913 " const char *device);\n"
27918 #: ../src/guestfs-actions.pod:4073
27919 msgid "guestfs_kill_subprocess"
27923 #: ../src/guestfs-actions.pod:4075
27927 " guestfs_kill_subprocess (guestfs_h *g);\n"
27932 #: ../src/guestfs-actions.pod:4084
27933 msgid "guestfs_launch"
27937 #: ../src/guestfs-actions.pod:4086
27941 " guestfs_launch (guestfs_h *g);\n"
27946 #: ../src/guestfs-actions.pod:4104
27947 msgid "guestfs_lchown"
27951 #: ../src/guestfs-actions.pod:4106
27955 " guestfs_lchown (guestfs_h *g,\n"
27958 " const char *path);\n"
27963 #: ../src/guestfs-actions.pod:4112
27965 "Change the file owner to C<owner> and group to C<group>. This is like "
27966 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
27967 "changed, not the target."
27971 #: ../src/guestfs-actions.pod:4124
27972 msgid "guestfs_lgetxattr"
27976 #: ../src/guestfs-actions.pod:4126
27980 " guestfs_lgetxattr (guestfs_h *g,\n"
27981 " const char *path,\n"
27982 " const char *name,\n"
27983 " size_t *size_r);\n"
27988 #: ../src/guestfs-actions.pod:4146
27989 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
27993 #: ../src/guestfs-actions.pod:4154
27994 msgid "guestfs_lgetxattrs"
27998 #: ../src/guestfs-actions.pod:4156
28001 " struct guestfs_xattr_list *\n"
28002 " guestfs_lgetxattrs (guestfs_h *g,\n"
28003 " const char *path);\n"
28008 #: ../src/guestfs-actions.pod:4160
28010 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
28011 "then it returns the extended attributes of the link itself."
28015 #: ../src/guestfs-actions.pod:4170
28016 msgid "guestfs_list_9p"
28020 #: ../src/guestfs-actions.pod:4172
28024 " guestfs_list_9p (guestfs_h *g);\n"
28029 #: ../src/guestfs-actions.pod:4184
28030 msgid "guestfs_list_devices"
28034 #: ../src/guestfs-actions.pod:4186
28038 " guestfs_list_devices (guestfs_h *g);\n"
28043 #: ../src/guestfs-actions.pod:4201
28044 msgid "guestfs_list_dm_devices"
28048 #: ../src/guestfs-actions.pod:4203
28052 " guestfs_list_dm_devices (guestfs_h *g);\n"
28057 #: ../src/guestfs-actions.pod:4208
28059 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
28060 "previous call to C<guestfs_luks_open>."
28064 #: ../src/guestfs-actions.pod:4211
28066 "Device mapper devices which correspond to logical volumes are I<not> "
28067 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
28072 #: ../src/guestfs-actions.pod:4219 ../src/guestfs-actions.pod:5665
28073 msgid "(Added in 1.11.15)"
28077 #: ../src/guestfs-actions.pod:4221
28078 msgid "guestfs_list_filesystems"
28082 #: ../src/guestfs-actions.pod:4223
28086 " guestfs_list_filesystems (guestfs_h *g);\n"
28091 #: ../src/guestfs-actions.pod:4243
28093 "This command runs other libguestfs commands, which might include "
28094 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
28095 "soon after launch and only when nothing is mounted."
28099 #: ../src/guestfs-actions.pod:4247
28101 "Not all of the filesystems returned will be mountable. In particular, swap "
28102 "partitions are returned in the list. Also this command does not check that "
28103 "each filesystem found is valid and mountable, and some filesystems might be "
28104 "mountable but require special options. Filesystems may not all belong to a "
28105 "single logical operating system (use C<guestfs_inspect_os> to look for "
28110 #: ../src/guestfs-actions.pod:4261 ../src/guestfs-actions.pod:6028
28111 msgid "(Added in 1.5.15)"
28115 #: ../src/guestfs-actions.pod:4263
28116 msgid "guestfs_list_partitions"
28120 #: ../src/guestfs-actions.pod:4265
28124 " guestfs_list_partitions (guestfs_h *g);\n"
28129 #: ../src/guestfs-actions.pod:4272
28131 "This does not return logical volumes. For that you will need to call "
28136 #: ../src/guestfs-actions.pod:4283
28141 #: ../src/guestfs-actions.pod:4285
28145 " guestfs_ll (guestfs_h *g,\n"
28146 " const char *directory);\n"
28151 #: ../src/guestfs-actions.pod:4300
28156 #: ../src/guestfs-actions.pod:4302
28160 " guestfs_ln (guestfs_h *g,\n"
28161 " const char *target,\n"
28162 " const char *linkname);\n"
28167 #: ../src/guestfs-actions.pod:4313
28168 msgid "guestfs_ln_f"
28172 #: ../src/guestfs-actions.pod:4315
28176 " guestfs_ln_f (guestfs_h *g,\n"
28177 " const char *target,\n"
28178 " const char *linkname);\n"
28183 #: ../src/guestfs-actions.pod:4327
28184 msgid "guestfs_ln_s"
28188 #: ../src/guestfs-actions.pod:4329
28192 " guestfs_ln_s (guestfs_h *g,\n"
28193 " const char *target,\n"
28194 " const char *linkname);\n"
28199 #: ../src/guestfs-actions.pod:4340
28200 msgid "guestfs_ln_sf"
28204 #: ../src/guestfs-actions.pod:4342
28208 " guestfs_ln_sf (guestfs_h *g,\n"
28209 " const char *target,\n"
28210 " const char *linkname);\n"
28215 #: ../src/guestfs-actions.pod:4354
28216 msgid "guestfs_lremovexattr"
28220 #: ../src/guestfs-actions.pod:4356
28224 " guestfs_lremovexattr (guestfs_h *g,\n"
28225 " const char *xattr,\n"
28226 " const char *path);\n"
28231 #: ../src/guestfs-actions.pod:4361
28233 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
28234 "link, then it removes an extended attribute of the link itself."
28238 #: ../src/guestfs-actions.pod:4369
28243 #: ../src/guestfs-actions.pod:4371
28247 " guestfs_ls (guestfs_h *g,\n"
28248 " const char *directory);\n"
28253 #: ../src/guestfs-actions.pod:4379
28255 "This command is mostly useful for interactive sessions. Programs should "
28256 "probably use C<guestfs_readdir> instead."
28260 #: ../src/guestfs-actions.pod:4388
28261 msgid "guestfs_lsetxattr"
28265 #: ../src/guestfs-actions.pod:4390
28269 " guestfs_lsetxattr (guestfs_h *g,\n"
28270 " const char *xattr,\n"
28271 " const char *val,\n"
28273 " const char *path);\n"
28278 #: ../src/guestfs-actions.pod:4397
28280 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
28281 "then it sets an extended attribute of the link itself."
28285 #: ../src/guestfs-actions.pod:4405
28286 msgid "guestfs_lstat"
28290 #: ../src/guestfs-actions.pod:4407
28293 " struct guestfs_stat *\n"
28294 " guestfs_lstat (guestfs_h *g,\n"
28295 " const char *path);\n"
28300 #: ../src/guestfs-actions.pod:4413
28302 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
28303 "link, then the link is stat-ed, not the file it refers to."
28307 #: ../src/guestfs-actions.pod:4419 ../src/guestfs-actions.pod:7218
28309 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
28310 "error. I<The caller must call C<guestfs_free_stat> after use>."
28314 #: ../src/guestfs-actions.pod:4423 ../src/guestfs-actions.pod:7222 ../src/guestfs-actions.pod:7240 ../src/guestfs-actions.pod:7621
28315 msgid "(Added in 0.9.2)"
28319 #: ../src/guestfs-actions.pod:4425
28320 msgid "guestfs_lstatlist"
28324 #: ../src/guestfs-actions.pod:4427
28327 " struct guestfs_stat_list *\n"
28328 " guestfs_lstatlist (guestfs_h *g,\n"
28329 " const char *path,\n"
28330 " char *const *names);\n"
28335 #: ../src/guestfs-actions.pod:4432
28337 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
28338 "files, where all files are in the directory C<path>. C<names> is the list "
28339 "of files from this directory."
28343 #: ../src/guestfs-actions.pod:4441
28345 "This call is intended for programs that want to efficiently list a directory "
28346 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
28347 "for a similarly efficient call for getting extended attributes. Very long "
28348 "directory listings might cause the protocol message size to be exceeded, "
28349 "causing this call to fail. The caller must split up such requests into "
28350 "smaller groups of names."
28354 #: ../src/guestfs-actions.pod:4449
28356 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
28357 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
28361 #: ../src/guestfs-actions.pod:4455
28362 msgid "guestfs_luks_add_key"
28366 #: ../src/guestfs-actions.pod:4457
28370 " guestfs_luks_add_key (guestfs_h *g,\n"
28371 " const char *device,\n"
28372 " const char *key,\n"
28373 " const char *newkey,\n"
28379 #: ../src/guestfs-actions.pod:4469
28381 "Note that if C<keyslot> already contains a key, then this command will "
28382 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
28386 #: ../src/guestfs-actions.pod:4475 ../src/guestfs-actions.pod:4515 ../src/guestfs-actions.pod:4538 ../src/guestfs-actions.pod:4558 ../src/guestfs-actions.pod:4593 ../src/guestfs-actions.pod:4612
28388 "This function takes a key or passphrase parameter which could contain "
28389 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
28394 #: ../src/guestfs-actions.pod:4479 ../src/guestfs-actions.pod:4519 ../src/guestfs-actions.pod:4542 ../src/guestfs-actions.pod:4562
28395 msgid "(Added in 1.5.2)"
28399 #: ../src/guestfs-actions.pod:4481
28400 msgid "guestfs_luks_close"
28404 #: ../src/guestfs-actions.pod:4483
28408 " guestfs_luks_close (guestfs_h *g,\n"
28409 " const char *device);\n"
28414 #: ../src/guestfs-actions.pod:4487
28416 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
28417 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
28418 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
28419 "underlying block device."
28423 #: ../src/guestfs-actions.pod:4495 ../src/guestfs-actions.pod:4597 ../src/guestfs-actions.pod:4616 ../src/guestfs-actions.pod:4666 ../src/guestfs-actions.pod:4714
28424 msgid "(Added in 1.5.1)"
28428 #: ../src/guestfs-actions.pod:4497
28429 msgid "guestfs_luks_format"
28433 #: ../src/guestfs-actions.pod:4499
28437 " guestfs_luks_format (guestfs_h *g,\n"
28438 " const char *device,\n"
28439 " const char *key,\n"
28445 #: ../src/guestfs-actions.pod:4521
28446 msgid "guestfs_luks_format_cipher"
28450 #: ../src/guestfs-actions.pod:4523
28454 " guestfs_luks_format_cipher (guestfs_h *g,\n"
28455 " const char *device,\n"
28456 " const char *key,\n"
28458 " const char *cipher);\n"
28463 #: ../src/guestfs-actions.pod:4530
28465 "This command is the same as C<guestfs_luks_format> but it also allows you to "
28466 "set the C<cipher> used."
28470 #: ../src/guestfs-actions.pod:4544
28471 msgid "guestfs_luks_kill_slot"
28475 #: ../src/guestfs-actions.pod:4546
28479 " guestfs_luks_kill_slot (guestfs_h *g,\n"
28480 " const char *device,\n"
28481 " const char *key,\n"
28487 #: ../src/guestfs-actions.pod:4564
28488 msgid "guestfs_luks_open"
28492 #: ../src/guestfs-actions.pod:4566
28496 " guestfs_luks_open (guestfs_h *g,\n"
28497 " const char *device,\n"
28498 " const char *key,\n"
28499 " const char *mapname);\n"
28504 #: ../src/guestfs-actions.pod:4584
28506 "If this block device contains LVM volume groups, then calling "
28507 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
28512 #: ../src/guestfs-actions.pod:4588
28513 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
28517 #: ../src/guestfs-actions.pod:4599
28518 msgid "guestfs_luks_open_ro"
28522 #: ../src/guestfs-actions.pod:4601
28526 " guestfs_luks_open_ro (guestfs_h *g,\n"
28527 " const char *device,\n"
28528 " const char *key,\n"
28529 " const char *mapname);\n"
28534 #: ../src/guestfs-actions.pod:4607
28536 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
28541 #: ../src/guestfs-actions.pod:4618
28542 msgid "guestfs_lvcreate"
28546 #: ../src/guestfs-actions.pod:4620
28550 " guestfs_lvcreate (guestfs_h *g,\n"
28551 " const char *logvol,\n"
28552 " const char *volgroup,\n"
28558 #: ../src/guestfs-actions.pod:4633
28559 msgid "guestfs_lvm_canonical_lv_name"
28563 #: ../src/guestfs-actions.pod:4635
28567 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
28568 " const char *lvname);\n"
28573 #: ../src/guestfs-actions.pod:4646
28574 msgid "See also C<guestfs_is_lv>."
28578 #: ../src/guestfs-actions.pod:4651
28579 msgid "(Added in 1.5.24)"
28583 #: ../src/guestfs-actions.pod:4653
28584 msgid "guestfs_lvm_clear_filter"
28588 #: ../src/guestfs-actions.pod:4655
28592 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
28597 #: ../src/guestfs-actions.pod:4658
28599 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
28600 "see every block device."
28604 #: ../src/guestfs-actions.pod:4668
28605 msgid "guestfs_lvm_remove_all"
28609 #: ../src/guestfs-actions.pod:4670
28613 " guestfs_lvm_remove_all (guestfs_h *g);\n"
28618 #: ../src/guestfs-actions.pod:4683
28619 msgid "guestfs_lvm_set_filter"
28623 #: ../src/guestfs-actions.pod:4685
28627 " guestfs_lvm_set_filter (guestfs_h *g,\n"
28628 " char *const *devices);\n"
28633 #: ../src/guestfs-actions.pod:4716
28634 msgid "guestfs_lvremove"
28638 #: ../src/guestfs-actions.pod:4718
28642 " guestfs_lvremove (guestfs_h *g,\n"
28643 " const char *device);\n"
28648 #: ../src/guestfs-actions.pod:4730 ../src/guestfs-actions.pod:6141 ../src/guestfs-actions.pod:7991
28649 msgid "(Added in 1.0.13)"
28653 #: ../src/guestfs-actions.pod:4732
28654 msgid "guestfs_lvrename"
28658 #: ../src/guestfs-actions.pod:4734
28662 " guestfs_lvrename (guestfs_h *g,\n"
28663 " const char *logvol,\n"
28664 " const char *newlogvol);\n"
28669 #: ../src/guestfs-actions.pod:4743 ../src/guestfs-actions.pod:8004
28670 msgid "(Added in 1.0.83)"
28674 #: ../src/guestfs-actions.pod:4745
28675 msgid "guestfs_lvresize"
28679 #: ../src/guestfs-actions.pod:4747
28683 " guestfs_lvresize (guestfs_h *g,\n"
28684 " const char *device,\n"
28690 #: ../src/guestfs-actions.pod:4760
28691 msgid "guestfs_lvresize_free"
28695 #: ../src/guestfs-actions.pod:4762
28699 " guestfs_lvresize_free (guestfs_h *g,\n"
28700 " const char *lv,\n"
28706 #: ../src/guestfs-actions.pod:4775
28707 msgid "(Added in 1.3.3)"
28711 #: ../src/guestfs-actions.pod:4777
28712 msgid "guestfs_lvs"
28716 #: ../src/guestfs-actions.pod:4779
28720 " guestfs_lvs (guestfs_h *g);\n"
28725 #: ../src/guestfs-actions.pod:4788
28726 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
28730 #: ../src/guestfs-actions.pod:4796
28731 msgid "guestfs_lvs_full"
28735 #: ../src/guestfs-actions.pod:4798
28738 " struct guestfs_lvm_lv_list *\n"
28739 " guestfs_lvs_full (guestfs_h *g);\n"
28744 #: ../src/guestfs-actions.pod:4804
28746 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
28747 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
28752 #: ../src/guestfs-actions.pod:4810
28753 msgid "guestfs_lvuuid"
28757 #: ../src/guestfs-actions.pod:4812
28761 " guestfs_lvuuid (guestfs_h *g,\n"
28762 " const char *device);\n"
28767 #: ../src/guestfs-actions.pod:4823
28768 msgid "guestfs_lxattrlist"
28772 #: ../src/guestfs-actions.pod:4825
28775 " struct guestfs_xattr_list *\n"
28776 " guestfs_lxattrlist (guestfs_h *g,\n"
28777 " const char *path,\n"
28778 " char *const *names);\n"
28783 #: ../src/guestfs-actions.pod:4844
28785 "This call is intended for programs that want to efficiently list a directory "
28786 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
28787 "a similarly efficient call for getting standard stats. Very long directory "
28788 "listings might cause the protocol message size to be exceeded, causing this "
28789 "call to fail. The caller must split up such requests into smaller groups of "
28794 #: ../src/guestfs-actions.pod:4858
28795 msgid "guestfs_mkdir"
28799 #: ../src/guestfs-actions.pod:4860
28803 " guestfs_mkdir (guestfs_h *g,\n"
28804 " const char *path);\n"
28809 #: ../src/guestfs-actions.pod:4870
28810 msgid "guestfs_mkdir_mode"
28814 #: ../src/guestfs-actions.pod:4872
28818 " guestfs_mkdir_mode (guestfs_h *g,\n"
28819 " const char *path,\n"
28825 #: ../src/guestfs-actions.pod:4884
28826 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
28830 #: ../src/guestfs-actions.pod:4890
28831 msgid "guestfs_mkdir_p"
28835 #: ../src/guestfs-actions.pod:4892
28839 " guestfs_mkdir_p (guestfs_h *g,\n"
28840 " const char *path);\n"
28845 #: ../src/guestfs-actions.pod:4903
28846 msgid "guestfs_mkdtemp"
28850 #: ../src/guestfs-actions.pod:4905
28854 " guestfs_mkdtemp (guestfs_h *g,\n"
28855 " const char *template);\n"
28860 #: ../src/guestfs-actions.pod:4933
28861 msgid "guestfs_mke2fs_J"
28865 #: ../src/guestfs-actions.pod:4935
28869 " guestfs_mke2fs_J (guestfs_h *g,\n"
28870 " const char *fstype,\n"
28871 " int blocksize,\n"
28872 " const char *device,\n"
28873 " const char *journal);\n"
28878 #: ../src/guestfs-actions.pod:4948
28879 msgid "See also C<guestfs_mke2journal>."
28883 #: ../src/guestfs-actions.pod:4952 ../src/guestfs-actions.pod:4970 ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5004 ../src/guestfs-actions.pod:5018 ../src/guestfs-actions.pod:5032 ../src/guestfs-actions.pod:5091 ../src/guestfs-actions.pod:5368
28884 msgid "(Added in 1.0.68)"
28888 #: ../src/guestfs-actions.pod:4954
28889 msgid "guestfs_mke2fs_JL"
28893 #: ../src/guestfs-actions.pod:4956
28897 " guestfs_mke2fs_JL (guestfs_h *g,\n"
28898 " const char *fstype,\n"
28899 " int blocksize,\n"
28900 " const char *device,\n"
28901 " const char *label);\n"
28906 #: ../src/guestfs-actions.pod:4966
28907 msgid "See also C<guestfs_mke2journal_L>."
28911 #: ../src/guestfs-actions.pod:4972
28912 msgid "guestfs_mke2fs_JU"
28916 #: ../src/guestfs-actions.pod:4974
28920 " guestfs_mke2fs_JU (guestfs_h *g,\n"
28921 " const char *fstype,\n"
28922 " int blocksize,\n"
28923 " const char *device,\n"
28924 " const char *uuid);\n"
28929 #: ../src/guestfs-actions.pod:4984
28930 msgid "See also C<guestfs_mke2journal_U>."
28934 #: ../src/guestfs-actions.pod:4990
28935 msgid "guestfs_mke2journal"
28939 #: ../src/guestfs-actions.pod:4992
28943 " guestfs_mke2journal (guestfs_h *g,\n"
28944 " int blocksize,\n"
28945 " const char *device);\n"
28950 #: ../src/guestfs-actions.pod:5006
28951 msgid "guestfs_mke2journal_L"
28955 #: ../src/guestfs-actions.pod:5008
28959 " guestfs_mke2journal_L (guestfs_h *g,\n"
28960 " int blocksize,\n"
28961 " const char *label,\n"
28962 " const char *device);\n"
28967 #: ../src/guestfs-actions.pod:5020
28968 msgid "guestfs_mke2journal_U"
28972 #: ../src/guestfs-actions.pod:5022
28976 " guestfs_mke2journal_U (guestfs_h *g,\n"
28977 " int blocksize,\n"
28978 " const char *uuid,\n"
28979 " const char *device);\n"
28984 #: ../src/guestfs-actions.pod:5034
28985 msgid "guestfs_mkfifo"
28989 #: ../src/guestfs-actions.pod:5036
28993 " guestfs_mkfifo (guestfs_h *g,\n"
28995 " const char *path);\n"
29000 #: ../src/guestfs-actions.pod:5041
29002 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
29003 "is just a convenient wrapper around C<guestfs_mknod>."
29007 #: ../src/guestfs-actions.pod:5051
29008 msgid "guestfs_mkfs"
29012 #: ../src/guestfs-actions.pod:5053
29016 " guestfs_mkfs (guestfs_h *g,\n"
29017 " const char *fstype,\n"
29018 " const char *device);\n"
29023 #: ../src/guestfs-actions.pod:5066
29024 msgid "guestfs_mkfs_b"
29028 #: ../src/guestfs-actions.pod:5068
29032 " guestfs_mkfs_b (guestfs_h *g,\n"
29033 " const char *fstype,\n"
29034 " int blocksize,\n"
29035 " const char *device);\n"
29040 #: ../src/guestfs-actions.pod:5074
29042 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
29047 #: ../src/guestfs-actions.pod:5081
29049 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
29050 "block size of the resulting filesystem. Supported block sizes depend on the "
29051 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
29055 #: ../src/guestfs-actions.pod:5093
29056 msgid "guestfs_mkfs_opts"
29060 #: ../src/guestfs-actions.pod:5095
29064 " guestfs_mkfs_opts (guestfs_h *g,\n"
29065 " const char *fstype,\n"
29066 " const char *device,\n"
29072 #: ../src/guestfs-actions.pod:5106
29075 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
29076 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
29077 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
29078 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
29083 #: ../src/guestfs-actions.pod:5154
29084 msgid "(Added in 1.7.19)"
29088 #: ../src/guestfs-actions.pod:5156
29089 msgid "guestfs_mkfs_opts_va"
29093 #: ../src/guestfs-actions.pod:5158
29097 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
29098 " const char *fstype,\n"
29099 " const char *device,\n"
29100 " va_list args);\n"
29105 #: ../src/guestfs-actions.pod:5164
29106 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
29110 #: ../src/guestfs-actions.pod:5168
29111 msgid "guestfs_mkfs_opts_argv"
29115 #: ../src/guestfs-actions.pod:5170
29119 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
29120 " const char *fstype,\n"
29121 " const char *device,\n"
29122 " const struct guestfs_mkfs_opts_argv *optargs);\n"
29127 #: ../src/guestfs-actions.pod:5176
29128 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
29132 #: ../src/guestfs-actions.pod:5180
29133 msgid "guestfs_mkmountpoint"
29137 #: ../src/guestfs-actions.pod:5182
29141 " guestfs_mkmountpoint (guestfs_h *g,\n"
29142 " const char *exemptpath);\n"
29147 #: ../src/guestfs-actions.pod:5186
29149 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
29150 "that can be used to create extra mountpoints before mounting the first "
29155 #: ../src/guestfs-actions.pod:5210
29157 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
29158 "may get unexpected errors if you try to mix these calls. It is safest to "
29159 "manually unmount filesystems and remove mountpoints after use."
29163 #: ../src/guestfs-actions.pod:5214
29165 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
29166 "first, so for this to work for manual mountpoints, you must ensure that the "
29167 "innermost mountpoints have the longest pathnames, as in the example code "
29172 #: ../src/guestfs-actions.pod:5221
29174 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
29175 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
29176 "can also trigger these issues."
29180 #: ../src/guestfs-actions.pod:5227 ../src/guestfs-actions.pod:5533 ../src/guestfs-actions.pod:6561
29181 msgid "(Added in 1.0.62)"
29185 #: ../src/guestfs-actions.pod:5229
29186 msgid "guestfs_mknod"
29190 #: ../src/guestfs-actions.pod:5231
29194 " guestfs_mknod (guestfs_h *g,\n"
29198 " const char *path);\n"
29203 #: ../src/guestfs-actions.pod:5246
29205 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
29206 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
29207 "regular file). These constants are available in the standard Linux header "
29208 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
29209 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
29210 "the appropriate constant for you."
29214 #: ../src/guestfs-actions.pod:5260
29215 msgid "guestfs_mknod_b"
29219 #: ../src/guestfs-actions.pod:5262
29223 " guestfs_mknod_b (guestfs_h *g,\n"
29227 " const char *path);\n"
29232 #: ../src/guestfs-actions.pod:5269
29234 "This call creates a block device node called C<path> with mode C<mode> and "
29235 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29236 "wrapper around C<guestfs_mknod>."
29240 #: ../src/guestfs-actions.pod:5279
29241 msgid "guestfs_mknod_c"
29245 #: ../src/guestfs-actions.pod:5281
29249 " guestfs_mknod_c (guestfs_h *g,\n"
29253 " const char *path);\n"
29258 #: ../src/guestfs-actions.pod:5288
29260 "This call creates a char device node called C<path> with mode C<mode> and "
29261 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29262 "wrapper around C<guestfs_mknod>."
29266 #: ../src/guestfs-actions.pod:5298
29267 msgid "guestfs_mkswap"
29271 #: ../src/guestfs-actions.pod:5300
29275 " guestfs_mkswap (guestfs_h *g,\n"
29276 " const char *device);\n"
29281 #: ../src/guestfs-actions.pod:5310
29282 msgid "guestfs_mkswap_L"
29286 #: ../src/guestfs-actions.pod:5312
29290 " guestfs_mkswap_L (guestfs_h *g,\n"
29291 " const char *label,\n"
29292 " const char *device);\n"
29297 #: ../src/guestfs-actions.pod:5327
29298 msgid "guestfs_mkswap_U"
29302 #: ../src/guestfs-actions.pod:5329
29306 " guestfs_mkswap_U (guestfs_h *g,\n"
29307 " const char *uuid,\n"
29308 " const char *device);\n"
29313 #: ../src/guestfs-actions.pod:5340
29314 msgid "guestfs_mkswap_file"
29318 #: ../src/guestfs-actions.pod:5342
29322 " guestfs_mkswap_file (guestfs_h *g,\n"
29323 " const char *path);\n"
29328 #: ../src/guestfs-actions.pod:5348
29330 "This command just writes a swap file signature to an existing file. To "
29331 "create the file itself, use something like C<guestfs_fallocate>."
29335 #: ../src/guestfs-actions.pod:5355
29336 msgid "guestfs_modprobe"
29340 #: ../src/guestfs-actions.pod:5357
29344 " guestfs_modprobe (guestfs_h *g,\n"
29345 " const char *modulename);\n"
29350 #: ../src/guestfs-actions.pod:5370
29351 msgid "guestfs_mount"
29355 #: ../src/guestfs-actions.pod:5372
29359 " guestfs_mount (guestfs_h *g,\n"
29360 " const char *device,\n"
29361 " const char *mountpoint);\n"
29366 #: ../src/guestfs-actions.pod:5391
29368 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
29369 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
29370 "problems for users. If your program might need to work with older versions "
29371 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
29372 "for the first parameter if you don't want any options)."
29376 #: ../src/guestfs-actions.pod:5402
29377 msgid "guestfs_mount_9p"
29381 #: ../src/guestfs-actions.pod:5404
29385 " guestfs_mount_9p (guestfs_h *g,\n"
29386 " const char *mounttag,\n"
29387 " const char *mountpoint,\n"
29393 #: ../src/guestfs-actions.pod:5415
29396 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
29401 #: ../src/guestfs-actions.pod:5428
29402 msgid "guestfs_mount_9p_va"
29406 #: ../src/guestfs-actions.pod:5430
29410 " guestfs_mount_9p_va (guestfs_h *g,\n"
29411 " const char *mounttag,\n"
29412 " const char *mountpoint,\n"
29413 " va_list args);\n"
29418 #: ../src/guestfs-actions.pod:5436
29419 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
29423 #: ../src/guestfs-actions.pod:5440
29424 msgid "guestfs_mount_9p_argv"
29428 #: ../src/guestfs-actions.pod:5442
29432 " guestfs_mount_9p_argv (guestfs_h *g,\n"
29433 " const char *mounttag,\n"
29434 " const char *mountpoint,\n"
29435 " const struct guestfs_mount_9p_argv *optargs);\n"
29440 #: ../src/guestfs-actions.pod:5448
29441 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
29445 #: ../src/guestfs-actions.pod:5452
29446 msgid "guestfs_mount_loop"
29450 #: ../src/guestfs-actions.pod:5454
29454 " guestfs_mount_loop (guestfs_h *g,\n"
29455 " const char *file,\n"
29456 " const char *mountpoint);\n"
29461 #: ../src/guestfs-actions.pod:5467
29462 msgid "guestfs_mount_options"
29466 #: ../src/guestfs-actions.pod:5469
29470 " guestfs_mount_options (guestfs_h *g,\n"
29471 " const char *options,\n"
29472 " const char *device,\n"
29473 " const char *mountpoint);\n"
29478 #: ../src/guestfs-actions.pod:5475
29480 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29481 "the mount options as for the L<mount(8)> I<-o> flag."
29485 #: ../src/guestfs-actions.pod:5485 ../src/guestfs-actions.pod:5499 ../src/guestfs-actions.pod:5516
29486 msgid "(Added in 1.0.10)"
29490 #: ../src/guestfs-actions.pod:5487
29491 msgid "guestfs_mount_ro"
29495 #: ../src/guestfs-actions.pod:5489
29499 " guestfs_mount_ro (guestfs_h *g,\n"
29500 " const char *device,\n"
29501 " const char *mountpoint);\n"
29506 #: ../src/guestfs-actions.pod:5494
29508 "This is the same as the C<guestfs_mount> command, but it mounts the "
29509 "filesystem with the read-only (I<-o ro>) flag."
29513 #: ../src/guestfs-actions.pod:5501
29514 msgid "guestfs_mount_vfs"
29518 #: ../src/guestfs-actions.pod:5503
29522 " guestfs_mount_vfs (guestfs_h *g,\n"
29523 " const char *options,\n"
29524 " const char *vfstype,\n"
29525 " const char *device,\n"
29526 " const char *mountpoint);\n"
29531 #: ../src/guestfs-actions.pod:5510
29533 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29534 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
29539 #: ../src/guestfs-actions.pod:5518
29540 msgid "guestfs_mountpoints"
29544 #: ../src/guestfs-actions.pod:5520
29548 " guestfs_mountpoints (guestfs_h *g);\n"
29553 #: ../src/guestfs-actions.pod:5523
29555 "This call is similar to C<guestfs_mounts>. That call returns a list of "
29556 "devices. This one returns a hash table (map) of device name to directory "
29557 "where the device is mounted."
29561 #: ../src/guestfs-actions.pod:5535
29562 msgid "guestfs_mounts"
29566 #: ../src/guestfs-actions.pod:5537
29570 " guestfs_mounts (guestfs_h *g);\n"
29575 #: ../src/guestfs-actions.pod:5545
29576 msgid "See also: C<guestfs_mountpoints>"
29580 #: ../src/guestfs-actions.pod:5553
29585 #: ../src/guestfs-actions.pod:5555
29589 " guestfs_mv (guestfs_h *g,\n"
29590 " const char *src,\n"
29591 " const char *dest);\n"
29596 #: ../src/guestfs-actions.pod:5567
29597 msgid "guestfs_ntfs_3g_probe"
29601 #: ../src/guestfs-actions.pod:5569
29605 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
29607 " const char *device);\n"
29612 #: ../src/guestfs-actions.pod:5588
29613 msgid "(Added in 1.0.43)"
29617 #: ../src/guestfs-actions.pod:5590
29618 msgid "guestfs_ntfsresize"
29622 #: ../src/guestfs-actions.pod:5592
29626 " guestfs_ntfsresize (guestfs_h *g,\n"
29627 " const char *device);\n"
29632 #: ../src/guestfs-actions.pod:5596 ../src/guestfs-actions.pod:5696
29634 "I<This function is deprecated.> In new code, use the "
29635 "L</guestfs_ntfsresize_opts> call instead."
29639 #: ../src/guestfs-actions.pod:5620
29640 msgid "guestfs_ntfsresize_opts"
29644 #: ../src/guestfs-actions.pod:5622
29648 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
29649 " const char *device,\n"
29655 #: ../src/guestfs-actions.pod:5632
29658 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
29659 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
29664 #: ../src/guestfs-actions.pod:5652
29666 "After the resize operation, the filesystem is always marked as requiring a "
29667 "consistency check (for safety). You have to boot into Windows to perform "
29668 "this check and clear this condition. If you I<don't> set the C<force> "
29669 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
29670 "times on a single filesystem without booting into Windows between each "
29675 #: ../src/guestfs-actions.pod:5667
29676 msgid "guestfs_ntfsresize_opts_va"
29680 #: ../src/guestfs-actions.pod:5669
29684 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
29685 " const char *device,\n"
29686 " va_list args);\n"
29691 #: ../src/guestfs-actions.pod:5674
29692 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
29696 #: ../src/guestfs-actions.pod:5678
29697 msgid "guestfs_ntfsresize_opts_argv"
29701 #: ../src/guestfs-actions.pod:5680
29705 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
29706 " const char *device,\n"
29707 " const struct guestfs_ntfsresize_opts_argv "
29713 #: ../src/guestfs-actions.pod:5685
29714 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
29718 #: ../src/guestfs-actions.pod:5689
29719 msgid "guestfs_ntfsresize_size"
29723 #: ../src/guestfs-actions.pod:5691
29727 " guestfs_ntfsresize_size (guestfs_h *g,\n"
29728 " const char *device,\n"
29729 " int64_t size);\n"
29734 #: ../src/guestfs-actions.pod:5703
29736 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
29737 "to specify the new size (in bytes) explicitly."
29741 #: ../src/guestfs-actions.pod:5708 ../src/guestfs-actions.pod:6168 ../src/guestfs-actions.pod:6241 ../src/guestfs-actions.pod:6509 ../src/guestfs-actions.pod:8148
29742 msgid "(Added in 1.3.14)"
29746 #: ../src/guestfs-actions.pod:5710
29747 msgid "guestfs_part_add"
29751 #: ../src/guestfs-actions.pod:5712
29755 " guestfs_part_add (guestfs_h *g,\n"
29756 " const char *device,\n"
29757 " const char *prlogex,\n"
29758 " int64_t startsect,\n"
29759 " int64_t endsect);\n"
29764 #: ../src/guestfs-actions.pod:5719
29766 "This command adds a partition to C<device>. If there is no partition table "
29767 "on the device, call C<guestfs_part_init> first."
29771 #: ../src/guestfs-actions.pod:5731
29773 "Creating a partition which covers the whole disk is not so easy. Use "
29774 "C<guestfs_part_disk> to do that."
29778 #: ../src/guestfs-actions.pod:5736 ../src/guestfs-actions.pod:5774 ../src/guestfs-actions.pod:5827 ../src/guestfs-actions.pod:5911 ../src/guestfs-actions.pod:5949 ../src/guestfs-actions.pod:5968 ../src/guestfs-actions.pod:6008
29779 msgid "(Added in 1.0.78)"
29783 #: ../src/guestfs-actions.pod:5738
29784 msgid "guestfs_part_del"
29788 #: ../src/guestfs-actions.pod:5740
29792 " guestfs_part_del (guestfs_h *g,\n"
29793 " const char *device,\n"
29799 #: ../src/guestfs-actions.pod:5755
29800 msgid "guestfs_part_disk"
29804 #: ../src/guestfs-actions.pod:5757
29808 " guestfs_part_disk (guestfs_h *g,\n"
29809 " const char *device,\n"
29810 " const char *parttype);\n"
29815 #: ../src/guestfs-actions.pod:5762
29817 "This command is simply a combination of C<guestfs_part_init> followed by "
29818 "C<guestfs_part_add> to create a single primary partition covering the whole "
29823 #: ../src/guestfs-actions.pod:5766
29825 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
29826 "possible values are described in C<guestfs_part_init>."
29830 #: ../src/guestfs-actions.pod:5776
29831 msgid "guestfs_part_get_bootable"
29835 #: ../src/guestfs-actions.pod:5778
29839 " guestfs_part_get_bootable (guestfs_h *g,\n"
29840 " const char *device,\n"
29846 #: ../src/guestfs-actions.pod:5786
29847 msgid "See also C<guestfs_part_set_bootable>."
29851 #: ../src/guestfs-actions.pod:5792
29852 msgid "guestfs_part_get_mbr_id"
29856 #: ../src/guestfs-actions.pod:5794
29860 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
29861 " const char *device,\n"
29867 #: ../src/guestfs-actions.pod:5802 ../src/guestfs-actions.pod:5984
29869 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
29870 "undefined results for other partition table types (see "
29871 "C<guestfs_part_get_parttype>)."
29875 #: ../src/guestfs-actions.pod:5810
29876 msgid "guestfs_part_get_parttype"
29880 #: ../src/guestfs-actions.pod:5812
29884 " guestfs_part_get_parttype (guestfs_h *g,\n"
29885 " const char *device);\n"
29890 #: ../src/guestfs-actions.pod:5819
29892 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
29893 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
29894 "possible, although unusual. See C<guestfs_part_init> for a full list."
29898 #: ../src/guestfs-actions.pod:5829
29899 msgid "guestfs_part_init"
29903 #: ../src/guestfs-actions.pod:5831
29907 " guestfs_part_init (guestfs_h *g,\n"
29908 " const char *device,\n"
29909 " const char *parttype);\n"
29914 #: ../src/guestfs-actions.pod:5840
29916 "Initially there are no partitions. Following this, you should call "
29917 "C<guestfs_part_add> for each partition required."
29921 #: ../src/guestfs-actions.pod:5913
29922 msgid "guestfs_part_list"
29926 #: ../src/guestfs-actions.pod:5915
29929 " struct guestfs_partition_list *\n"
29930 " guestfs_part_list (guestfs_h *g,\n"
29931 " const char *device);\n"
29936 #: ../src/guestfs-actions.pod:5932
29938 "Start of the partition I<in bytes>. To get sectors you have to divide by "
29939 "the device's sector size, see C<guestfs_blockdev_getss>."
29943 #: ../src/guestfs-actions.pod:5945
29945 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
29946 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
29951 #: ../src/guestfs-actions.pod:5951
29952 msgid "guestfs_part_set_bootable"
29956 #: ../src/guestfs-actions.pod:5953
29960 " guestfs_part_set_bootable (guestfs_h *g,\n"
29961 " const char *device,\n"
29963 " int bootable);\n"
29968 #: ../src/guestfs-actions.pod:5970
29969 msgid "guestfs_part_set_mbr_id"
29973 #: ../src/guestfs-actions.pod:5972
29977 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
29978 " const char *device,\n"
29985 #: ../src/guestfs-actions.pod:5992
29986 msgid "guestfs_part_set_name"
29990 #: ../src/guestfs-actions.pod:5994
29994 " guestfs_part_set_name (guestfs_h *g,\n"
29995 " const char *device,\n"
29997 " const char *name);\n"
30002 #: ../src/guestfs-actions.pod:6010
30003 msgid "guestfs_part_to_dev"
30007 #: ../src/guestfs-actions.pod:6012
30011 " guestfs_part_to_dev (guestfs_h *g,\n"
30012 " const char *partition);\n"
30017 #: ../src/guestfs-actions.pod:6020 ../src/guestfs-actions.pod:6039
30019 "The named partition must exist, for example as a string returned from "
30020 "C<guestfs_list_partitions>."
30024 #: ../src/guestfs-actions.pod:6023
30025 msgid "See also C<guestfs_part_to_partnum>."
30029 #: ../src/guestfs-actions.pod:6030
30030 msgid "guestfs_part_to_partnum"
30034 #: ../src/guestfs-actions.pod:6032
30038 " guestfs_part_to_partnum (guestfs_h *g,\n"
30039 " const char *partition);\n"
30044 #: ../src/guestfs-actions.pod:6042
30045 msgid "See also C<guestfs_part_to_dev>."
30049 #: ../src/guestfs-actions.pod:6046
30050 msgid "guestfs_ping_daemon"
30054 #: ../src/guestfs-actions.pod:6048
30058 " guestfs_ping_daemon (guestfs_h *g);\n"
30063 #: ../src/guestfs-actions.pod:6060
30064 msgid "guestfs_pread"
30068 #: ../src/guestfs-actions.pod:6062
30072 " guestfs_pread (guestfs_h *g,\n"
30073 " const char *path,\n"
30075 " int64_t offset,\n"
30076 " size_t *size_r);\n"
30081 #: ../src/guestfs-actions.pod:6075
30082 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
30086 #: ../src/guestfs-actions.pod:6086
30087 msgid "guestfs_pread_device"
30091 #: ../src/guestfs-actions.pod:6088
30095 " guestfs_pread_device (guestfs_h *g,\n"
30096 " const char *device,\n"
30098 " int64_t offset,\n"
30099 " size_t *size_r);\n"
30104 #: ../src/guestfs-actions.pod:6101
30105 msgid "See also C<guestfs_pread>."
30109 #: ../src/guestfs-actions.pod:6110
30110 msgid "(Added in 1.5.21)"
30114 #: ../src/guestfs-actions.pod:6112
30115 msgid "guestfs_pvcreate"
30119 #: ../src/guestfs-actions.pod:6114
30123 " guestfs_pvcreate (guestfs_h *g,\n"
30124 " const char *device);\n"
30129 #: ../src/guestfs-actions.pod:6126
30130 msgid "guestfs_pvremove"
30134 #: ../src/guestfs-actions.pod:6128
30138 " guestfs_pvremove (guestfs_h *g,\n"
30139 " const char *device);\n"
30144 #: ../src/guestfs-actions.pod:6143
30145 msgid "guestfs_pvresize"
30149 #: ../src/guestfs-actions.pod:6145
30153 " guestfs_pvresize (guestfs_h *g,\n"
30154 " const char *device);\n"
30159 #: ../src/guestfs-actions.pod:6156
30160 msgid "guestfs_pvresize_size"
30164 #: ../src/guestfs-actions.pod:6158
30168 " guestfs_pvresize_size (guestfs_h *g,\n"
30169 " const char *device,\n"
30170 " int64_t size);\n"
30175 #: ../src/guestfs-actions.pod:6163
30177 "This command is the same as C<guestfs_pvresize> except that it allows you to "
30178 "specify the new size (in bytes) explicitly."
30182 #: ../src/guestfs-actions.pod:6170
30183 msgid "guestfs_pvs"
30187 #: ../src/guestfs-actions.pod:6172
30191 " guestfs_pvs (guestfs_h *g);\n"
30196 #: ../src/guestfs-actions.pod:6181
30197 msgid "See also C<guestfs_pvs_full>."
30201 #: ../src/guestfs-actions.pod:6189
30202 msgid "guestfs_pvs_full"
30206 #: ../src/guestfs-actions.pod:6191
30209 " struct guestfs_lvm_pv_list *\n"
30210 " guestfs_pvs_full (guestfs_h *g);\n"
30215 #: ../src/guestfs-actions.pod:6197
30217 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
30218 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
30223 #: ../src/guestfs-actions.pod:6203
30224 msgid "guestfs_pvuuid"
30228 #: ../src/guestfs-actions.pod:6205
30232 " guestfs_pvuuid (guestfs_h *g,\n"
30233 " const char *device);\n"
30238 #: ../src/guestfs-actions.pod:6216
30239 msgid "guestfs_pwrite"
30243 #: ../src/guestfs-actions.pod:6218
30247 " guestfs_pwrite (guestfs_h *g,\n"
30248 " const char *path,\n"
30249 " const char *content,\n"
30250 " size_t content_size,\n"
30251 " int64_t offset);\n"
30256 #: ../src/guestfs-actions.pod:6234
30257 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
30261 #: ../src/guestfs-actions.pod:6243
30262 msgid "guestfs_pwrite_device"
30266 #: ../src/guestfs-actions.pod:6245
30270 " guestfs_pwrite_device (guestfs_h *g,\n"
30271 " const char *device,\n"
30272 " const char *content,\n"
30273 " size_t content_size,\n"
30274 " int64_t offset);\n"
30279 #: ../src/guestfs-actions.pod:6260
30280 msgid "See also C<guestfs_pwrite>."
30284 #: ../src/guestfs-actions.pod:6267
30285 msgid "(Added in 1.5.20)"
30289 #: ../src/guestfs-actions.pod:6269
30290 msgid "guestfs_read_file"
30294 #: ../src/guestfs-actions.pod:6271
30298 " guestfs_read_file (guestfs_h *g,\n"
30299 " const char *path,\n"
30300 " size_t *size_r);\n"
30305 #: ../src/guestfs-actions.pod:6279
30307 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
30308 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
30309 "function is limited in the total size of file that can be handled."
30313 #: ../src/guestfs-actions.pod:6291
30314 msgid "(Added in 1.0.63)"
30318 #: ../src/guestfs-actions.pod:6293
30319 msgid "guestfs_read_lines"
30323 #: ../src/guestfs-actions.pod:6295
30327 " guestfs_read_lines (guestfs_h *g,\n"
30328 " const char *path);\n"
30333 #: ../src/guestfs-actions.pod:6304
30335 "Note that this function cannot correctly handle binary files (specifically, "
30336 "files containing C<\\0> character which is treated as end of line). For "
30337 "those you need to use the C<guestfs_read_file> function which has a more "
30338 "complex interface."
30342 #: ../src/guestfs-actions.pod:6315
30343 msgid "guestfs_readdir"
30347 #: ../src/guestfs-actions.pod:6317
30350 " struct guestfs_dirent_list *\n"
30351 " guestfs_readdir (guestfs_h *g,\n"
30352 " const char *dir);\n"
30357 #: ../src/guestfs-actions.pod:6371
30359 "This function is primarily intended for use by programs. To get a simple "
30360 "list of names, use C<guestfs_ls>. To get a printable directory for human "
30361 "consumption, use C<guestfs_ll>."
30365 #: ../src/guestfs-actions.pod:6375
30367 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
30368 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
30373 #: ../src/guestfs-actions.pod:6381
30374 msgid "guestfs_readlink"
30378 #: ../src/guestfs-actions.pod:6383
30382 " guestfs_readlink (guestfs_h *g,\n"
30383 " const char *path);\n"
30388 #: ../src/guestfs-actions.pod:6394
30389 msgid "guestfs_readlinklist"
30393 #: ../src/guestfs-actions.pod:6396
30397 " guestfs_readlinklist (guestfs_h *g,\n"
30398 " const char *path,\n"
30399 " char *const *names);\n"
30404 #: ../src/guestfs-actions.pod:6429
30405 msgid "guestfs_realpath"
30409 #: ../src/guestfs-actions.pod:6431
30413 " guestfs_realpath (guestfs_h *g,\n"
30414 " const char *path);\n"
30419 #: ../src/guestfs-actions.pod:6443
30420 msgid "guestfs_removexattr"
30424 #: ../src/guestfs-actions.pod:6445
30428 " guestfs_removexattr (guestfs_h *g,\n"
30429 " const char *xattr,\n"
30430 " const char *path);\n"
30435 #: ../src/guestfs-actions.pod:6453
30436 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
30440 #: ../src/guestfs-actions.pod:6459
30441 msgid "guestfs_resize2fs"
30445 #: ../src/guestfs-actions.pod:6461
30449 " guestfs_resize2fs (guestfs_h *g,\n"
30450 " const char *device);\n"
30455 #: ../src/guestfs-actions.pod:6468
30457 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
30458 "C<device> before calling this command. For unknown reasons C<resize2fs> "
30459 "sometimes gives an error about this and sometimes not. In any case, it is "
30460 "always safe to call C<guestfs_e2fsck_f> before calling this function."
30464 #: ../src/guestfs-actions.pod:6478
30465 msgid "guestfs_resize2fs_M"
30469 #: ../src/guestfs-actions.pod:6480
30473 " guestfs_resize2fs_M (guestfs_h *g,\n"
30474 " const char *device);\n"
30479 #: ../src/guestfs-actions.pod:6484
30481 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
30482 "resized to its minimum size. This works like the I<-M> option to the "
30483 "C<resize2fs> command."
30487 #: ../src/guestfs-actions.pod:6488
30489 "To get the resulting size of the filesystem you should call "
30490 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
30491 "These two numbers, multiplied together, give the resulting size of the "
30492 "minimal filesystem in bytes."
30496 #: ../src/guestfs-actions.pod:6497
30497 msgid "guestfs_resize2fs_size"
30501 #: ../src/guestfs-actions.pod:6499
30505 " guestfs_resize2fs_size (guestfs_h *g,\n"
30506 " const char *device,\n"
30507 " int64_t size);\n"
30512 #: ../src/guestfs-actions.pod:6504
30514 "This command is the same as C<guestfs_resize2fs> except that it allows you "
30515 "to specify the new size (in bytes) explicitly."
30519 #: ../src/guestfs-actions.pod:6511
30524 #: ../src/guestfs-actions.pod:6513
30528 " guestfs_rm (guestfs_h *g,\n"
30529 " const char *path);\n"
30534 #: ../src/guestfs-actions.pod:6523
30535 msgid "guestfs_rm_rf"
30539 #: ../src/guestfs-actions.pod:6525
30543 " guestfs_rm_rf (guestfs_h *g,\n"
30544 " const char *path);\n"
30549 #: ../src/guestfs-actions.pod:6537
30550 msgid "guestfs_rmdir"
30554 #: ../src/guestfs-actions.pod:6539
30558 " guestfs_rmdir (guestfs_h *g,\n"
30559 " const char *path);\n"
30564 #: ../src/guestfs-actions.pod:6549
30565 msgid "guestfs_rmmountpoint"
30569 #: ../src/guestfs-actions.pod:6551
30573 " guestfs_rmmountpoint (guestfs_h *g,\n"
30574 " const char *exemptpath);\n"
30579 #: ../src/guestfs-actions.pod:6555
30581 "This calls removes a mountpoint that was previously created with "
30582 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
30586 #: ../src/guestfs-actions.pod:6563
30587 msgid "guestfs_scrub_device"
30591 #: ../src/guestfs-actions.pod:6565
30595 " guestfs_scrub_device (guestfs_h *g,\n"
30596 " const char *device);\n"
30601 #: ../src/guestfs-actions.pod:6580 ../src/guestfs-actions.pod:6598 ../src/guestfs-actions.pod:6617
30602 msgid "(Added in 1.0.52)"
30606 #: ../src/guestfs-actions.pod:6582
30607 msgid "guestfs_scrub_file"
30611 #: ../src/guestfs-actions.pod:6584
30615 " guestfs_scrub_file (guestfs_h *g,\n"
30616 " const char *file);\n"
30621 #: ../src/guestfs-actions.pod:6600
30622 msgid "guestfs_scrub_freespace"
30626 #: ../src/guestfs-actions.pod:6602
30630 " guestfs_scrub_freespace (guestfs_h *g,\n"
30631 " const char *dir);\n"
30636 #: ../src/guestfs-actions.pod:6606
30638 "This command creates the directory C<dir> and then fills it with files until "
30639 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
30640 "and deletes them. The intention is to scrub any free space on the partition "
30641 "containing C<dir>."
30645 #: ../src/guestfs-actions.pod:6619
30646 msgid "guestfs_set_append"
30650 #: ../src/guestfs-actions.pod:6621
30654 " guestfs_set_append (guestfs_h *g,\n"
30655 " const char *append);\n"
30660 #: ../src/guestfs-actions.pod:6638
30661 msgid "guestfs_set_attach_method"
30665 #: ../src/guestfs-actions.pod:6640
30669 " guestfs_set_attach_method (guestfs_h *g,\n"
30670 " const char *attachmethod);\n"
30675 #: ../src/guestfs-actions.pod:6668
30676 msgid "guestfs_set_autosync"
30680 #: ../src/guestfs-actions.pod:6670
30684 " guestfs_set_autosync (guestfs_h *g,\n"
30685 " int autosync);\n"
30690 #: ../src/guestfs-actions.pod:6686
30691 msgid "guestfs_set_direct"
30695 #: ../src/guestfs-actions.pod:6688
30699 " guestfs_set_direct (guestfs_h *g,\n"
30705 #: ../src/guestfs-actions.pod:6696
30707 "One consequence of this is that log messages aren't caught by the library "
30708 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
30713 #: ../src/guestfs-actions.pod:6709
30714 msgid "guestfs_set_e2label"
30718 #: ../src/guestfs-actions.pod:6711
30722 " guestfs_set_e2label (guestfs_h *g,\n"
30723 " const char *device,\n"
30724 " const char *label);\n"
30729 #: ../src/guestfs-actions.pod:6720
30731 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
30732 "the existing label on a filesystem."
30736 #: ../src/guestfs-actions.pod:6727
30737 msgid "guestfs_set_e2uuid"
30741 #: ../src/guestfs-actions.pod:6729
30745 " guestfs_set_e2uuid (guestfs_h *g,\n"
30746 " const char *device,\n"
30747 " const char *uuid);\n"
30752 #: ../src/guestfs-actions.pod:6739
30754 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
30755 "the existing UUID of a filesystem."
30759 #: ../src/guestfs-actions.pod:6746
30760 msgid "guestfs_set_memsize"
30764 #: ../src/guestfs-actions.pod:6748
30768 " guestfs_set_memsize (guestfs_h *g,\n"
30774 #: ../src/guestfs-actions.pod:6752
30776 "This sets the memory size in megabytes allocated to the qemu subprocess. "
30777 "This only has any effect if called before C<guestfs_launch>."
30781 #: ../src/guestfs-actions.pod:6767
30782 msgid "guestfs_set_network"
30786 #: ../src/guestfs-actions.pod:6769
30790 " guestfs_set_network (guestfs_h *g,\n"
30796 #: ../src/guestfs-actions.pod:6779
30798 "You must call this before calling C<guestfs_launch>, otherwise it has no "
30803 #: ../src/guestfs-actions.pod:6786
30804 msgid "guestfs_set_path"
30808 #: ../src/guestfs-actions.pod:6788
30812 " guestfs_set_path (guestfs_h *g,\n"
30813 " const char *searchpath);\n"
30818 #: ../src/guestfs-actions.pod:6803
30819 msgid "guestfs_set_pgroup"
30823 #: ../src/guestfs-actions.pod:6805
30827 " guestfs_set_pgroup (guestfs_h *g,\n"
30833 #: ../src/guestfs-actions.pod:6822
30834 msgid "guestfs_set_qemu"
30838 #: ../src/guestfs-actions.pod:6824
30842 " guestfs_set_qemu (guestfs_h *g,\n"
30843 " const char *qemu);\n"
30848 #: ../src/guestfs-actions.pod:6850
30849 msgid "guestfs_set_recovery_proc"
30853 #: ../src/guestfs-actions.pod:6852
30857 " guestfs_set_recovery_proc (guestfs_h *g,\n"
30858 " int recoveryproc);\n"
30863 #: ../src/guestfs-actions.pod:6856
30865 "If this is called with the parameter C<false> then C<guestfs_launch> does "
30866 "not create a recovery process. The purpose of the recovery process is to "
30867 "stop runaway qemu processes in the case where the main program aborts "
30872 #: ../src/guestfs-actions.pod:6861
30874 "This only has any effect if called before C<guestfs_launch>, and the default "
30879 #: ../src/guestfs-actions.pod:6874
30880 msgid "guestfs_set_selinux"
30884 #: ../src/guestfs-actions.pod:6876
30888 " guestfs_set_selinux (guestfs_h *g,\n"
30894 #: ../src/guestfs-actions.pod:6893
30895 msgid "guestfs_set_smp"
30899 #: ../src/guestfs-actions.pod:6895
30903 " guestfs_set_smp (guestfs_h *g,\n"
30909 #: ../src/guestfs-actions.pod:6903
30910 msgid "This function must be called before C<guestfs_launch>."
30914 #: ../src/guestfs-actions.pod:6909
30915 msgid "guestfs_set_trace"
30919 #: ../src/guestfs-actions.pod:6911
30923 " guestfs_set_trace (guestfs_h *g,\n"
30929 #: ../src/guestfs-actions.pod:6925
30931 "Trace messages are normally sent to C<stderr>, unless you register a "
30932 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30936 #: ../src/guestfs-actions.pod:6933
30937 msgid "guestfs_set_verbose"
30941 #: ../src/guestfs-actions.pod:6935
30945 " guestfs_set_verbose (guestfs_h *g,\n"
30951 #: ../src/guestfs-actions.pod:6944
30953 "Verbose messages are normally sent to C<stderr>, unless you register a "
30954 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30958 #: ../src/guestfs-actions.pod:6952
30959 msgid "guestfs_setcon"
30963 #: ../src/guestfs-actions.pod:6954
30967 " guestfs_setcon (guestfs_h *g,\n"
30968 " const char *context);\n"
30973 #: ../src/guestfs-actions.pod:6967
30974 msgid "guestfs_setxattr"
30978 #: ../src/guestfs-actions.pod:6969
30982 " guestfs_setxattr (guestfs_h *g,\n"
30983 " const char *xattr,\n"
30984 " const char *val,\n"
30986 " const char *path);\n"
30991 #: ../src/guestfs-actions.pod:6980
30992 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
30996 #: ../src/guestfs-actions.pod:6986
30997 msgid "guestfs_sfdisk"
31001 #: ../src/guestfs-actions.pod:6988
31005 " guestfs_sfdisk (guestfs_h *g,\n"
31006 " const char *device,\n"
31010 " char *const *lines);\n"
31015 #: ../src/guestfs-actions.pod:6996 ../src/guestfs-actions.pod:7040 ../src/guestfs-actions.pod:7074
31017 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
31022 #: ../src/guestfs-actions.pod:7023
31023 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
31027 #: ../src/guestfs-actions.pod:7033
31028 msgid "guestfs_sfdiskM"
31032 #: ../src/guestfs-actions.pod:7035
31036 " guestfs_sfdiskM (guestfs_h *g,\n"
31037 " const char *device,\n"
31038 " char *const *lines);\n"
31043 #: ../src/guestfs-actions.pod:7047
31045 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
31046 "partition sizes are specified in megabytes only (rounded to the nearest "
31047 "cylinder) and you don't need to specify the cyls, heads and sectors "
31048 "parameters which were rarely if ever used anyway."
31052 #: ../src/guestfs-actions.pod:7053
31054 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
31055 "C<guestfs_part_disk>"
31059 #: ../src/guestfs-actions.pod:7063
31060 msgid "guestfs_sfdisk_N"
31064 #: ../src/guestfs-actions.pod:7065
31068 " guestfs_sfdisk_N (guestfs_h *g,\n"
31069 " const char *device,\n"
31074 " const char *line);\n"
31079 #: ../src/guestfs-actions.pod:7084
31081 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
31082 "for the cyls/heads/sectors parameters."
31086 #: ../src/guestfs-actions.pod:7087
31087 msgid "See also: C<guestfs_part_add>"
31091 #: ../src/guestfs-actions.pod:7096
31092 msgid "guestfs_sfdisk_disk_geometry"
31096 #: ../src/guestfs-actions.pod:7098
31100 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
31101 " const char *device);\n"
31106 #: ../src/guestfs-actions.pod:7102
31108 "This displays the disk geometry of C<device> read from the partition table. "
31109 "Especially in the case where the underlying block device has been resized, "
31110 "this can be different from the kernel's idea of the geometry (see "
31111 "C<guestfs_sfdisk_kernel_geometry>)."
31115 #: ../src/guestfs-actions.pod:7115
31116 msgid "guestfs_sfdisk_kernel_geometry"
31120 #: ../src/guestfs-actions.pod:7117
31124 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
31125 " const char *device);\n"
31130 #: ../src/guestfs-actions.pod:7131
31131 msgid "guestfs_sfdisk_l"
31135 #: ../src/guestfs-actions.pod:7133
31139 " guestfs_sfdisk_l (guestfs_h *g,\n"
31140 " const char *device);\n"
31145 #: ../src/guestfs-actions.pod:7137
31147 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
31152 #: ../src/guestfs-actions.pod:7148
31153 msgid "See also: C<guestfs_part_list>"
31157 #: ../src/guestfs-actions.pod:7155
31162 #: ../src/guestfs-actions.pod:7157
31166 " guestfs_sh (guestfs_h *g,\n"
31167 " const char *command);\n"
31172 #: ../src/guestfs-actions.pod:7164
31173 msgid "This is like C<guestfs_command>, but passes the command to:"
31177 #: ../src/guestfs-actions.pod:7172
31178 msgid "All the provisos about C<guestfs_command> apply to this call."
31182 #: ../src/guestfs-actions.pod:7179
31183 msgid "guestfs_sh_lines"
31187 #: ../src/guestfs-actions.pod:7181
31191 " guestfs_sh_lines (guestfs_h *g,\n"
31192 " const char *command);\n"
31197 #: ../src/guestfs-actions.pod:7185
31199 "This is the same as C<guestfs_sh>, but splits the result into a list of "
31204 #: ../src/guestfs-actions.pod:7188
31205 msgid "See also: C<guestfs_command_lines>"
31209 #: ../src/guestfs-actions.pod:7196
31210 msgid "guestfs_sleep"
31214 #: ../src/guestfs-actions.pod:7198
31218 " guestfs_sleep (guestfs_h *g,\n"
31224 #: ../src/guestfs-actions.pod:7206
31225 msgid "(Added in 1.0.41)"
31229 #: ../src/guestfs-actions.pod:7208 ../src/guestfs-structs.pod:109
31230 msgid "guestfs_stat"
31234 #: ../src/guestfs-actions.pod:7210
31237 " struct guestfs_stat *\n"
31238 " guestfs_stat (guestfs_h *g,\n"
31239 " const char *path);\n"
31244 #: ../src/guestfs-actions.pod:7224 ../src/guestfs-structs.pod:135
31245 msgid "guestfs_statvfs"
31249 #: ../src/guestfs-actions.pod:7226
31252 " struct guestfs_statvfs *\n"
31253 " guestfs_statvfs (guestfs_h *g,\n"
31254 " const char *path);\n"
31259 #: ../src/guestfs-actions.pod:7236
31261 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
31262 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
31266 #: ../src/guestfs-actions.pod:7242
31267 msgid "guestfs_strings"
31271 #: ../src/guestfs-actions.pod:7244
31275 " guestfs_strings (guestfs_h *g,\n"
31276 " const char *path);\n"
31281 #: ../src/guestfs-actions.pod:7260
31282 msgid "guestfs_strings_e"
31286 #: ../src/guestfs-actions.pod:7262
31290 " guestfs_strings_e (guestfs_h *g,\n"
31291 " const char *encoding,\n"
31292 " const char *path);\n"
31297 #: ../src/guestfs-actions.pod:7267
31299 "This is like the C<guestfs_strings> command, but allows you to specify the "
31300 "encoding of strings that are looked for in the source file C<path>."
31304 #: ../src/guestfs-actions.pod:7277
31306 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
31307 "ISO-8859-X (this is what C<guestfs_strings> uses)."
31311 #: ../src/guestfs-actions.pod:7315
31312 msgid "guestfs_swapoff_device"
31316 #: ../src/guestfs-actions.pod:7317
31320 " guestfs_swapoff_device (guestfs_h *g,\n"
31321 " const char *device);\n"
31326 #: ../src/guestfs-actions.pod:7321
31328 "This command disables the libguestfs appliance swap device or partition "
31329 "named C<device>. See C<guestfs_swapon_device>."
31333 #: ../src/guestfs-actions.pod:7329
31334 msgid "guestfs_swapoff_file"
31338 #: ../src/guestfs-actions.pod:7331
31342 " guestfs_swapoff_file (guestfs_h *g,\n"
31343 " const char *file);\n"
31348 #: ../src/guestfs-actions.pod:7341
31349 msgid "guestfs_swapoff_label"
31353 #: ../src/guestfs-actions.pod:7343
31357 " guestfs_swapoff_label (guestfs_h *g,\n"
31358 " const char *label);\n"
31363 #: ../src/guestfs-actions.pod:7354
31364 msgid "guestfs_swapoff_uuid"
31368 #: ../src/guestfs-actions.pod:7356
31372 " guestfs_swapoff_uuid (guestfs_h *g,\n"
31373 " const char *uuid);\n"
31378 #: ../src/guestfs-actions.pod:7367
31379 msgid "guestfs_swapon_device"
31383 #: ../src/guestfs-actions.pod:7369
31387 " guestfs_swapon_device (guestfs_h *g,\n"
31388 " const char *device);\n"
31393 #: ../src/guestfs-actions.pod:7373
31395 "This command enables the libguestfs appliance to use the swap device or "
31396 "partition named C<device>. The increased memory is made available for all "
31397 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
31401 #: ../src/guestfs-actions.pod:7389
31402 msgid "guestfs_swapon_file"
31406 #: ../src/guestfs-actions.pod:7391
31410 " guestfs_swapon_file (guestfs_h *g,\n"
31411 " const char *file);\n"
31416 #: ../src/guestfs-actions.pod:7395
31418 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
31423 #: ../src/guestfs-actions.pod:7402
31424 msgid "guestfs_swapon_label"
31428 #: ../src/guestfs-actions.pod:7404
31432 " guestfs_swapon_label (guestfs_h *g,\n"
31433 " const char *label);\n"
31438 #: ../src/guestfs-actions.pod:7408
31440 "This command enables swap to a labeled swap partition. See "
31441 "C<guestfs_swapon_device> for other notes."
31445 #: ../src/guestfs-actions.pod:7415
31446 msgid "guestfs_swapon_uuid"
31450 #: ../src/guestfs-actions.pod:7417
31454 " guestfs_swapon_uuid (guestfs_h *g,\n"
31455 " const char *uuid);\n"
31460 #: ../src/guestfs-actions.pod:7421
31462 "This command enables swap to a swap partition with the given UUID. See "
31463 "C<guestfs_swapon_device> for other notes."
31467 #: ../src/guestfs-actions.pod:7428
31468 msgid "guestfs_sync"
31472 #: ../src/guestfs-actions.pod:7430
31476 " guestfs_sync (guestfs_h *g);\n"
31481 #: ../src/guestfs-actions.pod:7443
31482 msgid "guestfs_tail"
31486 #: ../src/guestfs-actions.pod:7445
31490 " guestfs_tail (guestfs_h *g,\n"
31491 " const char *path);\n"
31496 #: ../src/guestfs-actions.pod:7461
31497 msgid "guestfs_tail_n"
31501 #: ../src/guestfs-actions.pod:7463
31505 " guestfs_tail_n (guestfs_h *g,\n"
31507 " const char *path);\n"
31512 #: ../src/guestfs-actions.pod:7485
31513 msgid "guestfs_tar_in"
31517 #: ../src/guestfs-actions.pod:7487
31521 " guestfs_tar_in (guestfs_h *g,\n"
31522 " const char *tarfile,\n"
31523 " const char *directory);\n"
31528 #: ../src/guestfs-actions.pod:7495
31529 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
31533 #: ../src/guestfs-actions.pod:7500 ../src/guestfs-actions.pod:7517 ../src/guestfs-actions.pod:7533 ../src/guestfs-actions.pod:7549
31534 msgid "(Added in 1.0.3)"
31538 #: ../src/guestfs-actions.pod:7502
31539 msgid "guestfs_tar_out"
31543 #: ../src/guestfs-actions.pod:7504
31547 " guestfs_tar_out (guestfs_h *g,\n"
31548 " const char *directory,\n"
31549 " const char *tarfile);\n"
31554 #: ../src/guestfs-actions.pod:7512
31556 "To download a compressed tarball, use C<guestfs_tgz_out> or "
31557 "C<guestfs_txz_out>."
31561 #: ../src/guestfs-actions.pod:7519
31562 msgid "guestfs_tgz_in"
31566 #: ../src/guestfs-actions.pod:7521
31570 " guestfs_tgz_in (guestfs_h *g,\n"
31571 " const char *tarball,\n"
31572 " const char *directory);\n"
31577 #: ../src/guestfs-actions.pod:7529
31578 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
31582 #: ../src/guestfs-actions.pod:7535
31583 msgid "guestfs_tgz_out"
31587 #: ../src/guestfs-actions.pod:7537
31591 " guestfs_tgz_out (guestfs_h *g,\n"
31592 " const char *directory,\n"
31593 " const char *tarball);\n"
31598 #: ../src/guestfs-actions.pod:7545
31599 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
31603 #: ../src/guestfs-actions.pod:7551
31604 msgid "guestfs_touch"
31608 #: ../src/guestfs-actions.pod:7553
31612 " guestfs_touch (guestfs_h *g,\n"
31613 " const char *path);\n"
31618 #: ../src/guestfs-actions.pod:7568
31619 msgid "guestfs_truncate"
31623 #: ../src/guestfs-actions.pod:7570
31627 " guestfs_truncate (guestfs_h *g,\n"
31628 " const char *path);\n"
31633 #: ../src/guestfs-actions.pod:7581
31634 msgid "guestfs_truncate_size"
31638 #: ../src/guestfs-actions.pod:7583
31642 " guestfs_truncate_size (guestfs_h *g,\n"
31643 " const char *path,\n"
31644 " int64_t size);\n"
31649 #: ../src/guestfs-actions.pod:7591
31651 "If the current file size is less than C<size> then the file is extended to "
31652 "the required size with zero bytes. This creates a sparse file (ie. disk "
31653 "blocks are not allocated for the file until you write to it). To create a "
31654 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
31658 #: ../src/guestfs-actions.pod:7601
31659 msgid "guestfs_tune2fs_l"
31663 #: ../src/guestfs-actions.pod:7603
31667 " guestfs_tune2fs_l (guestfs_h *g,\n"
31668 " const char *device);\n"
31673 #: ../src/guestfs-actions.pod:7623
31674 msgid "guestfs_txz_in"
31678 #: ../src/guestfs-actions.pod:7625
31682 " guestfs_txz_in (guestfs_h *g,\n"
31683 " const char *tarball,\n"
31684 " const char *directory);\n"
31689 #: ../src/guestfs-actions.pod:7637
31690 msgid "guestfs_txz_out"
31694 #: ../src/guestfs-actions.pod:7639
31698 " guestfs_txz_out (guestfs_h *g,\n"
31699 " const char *directory,\n"
31700 " const char *tarball);\n"
31705 #: ../src/guestfs-actions.pod:7651
31706 msgid "guestfs_umask"
31710 #: ../src/guestfs-actions.pod:7653
31714 " guestfs_umask (guestfs_h *g,\n"
31720 #: ../src/guestfs-actions.pod:7669
31722 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
31723 "C<guestfs_mkdir>."
31727 #: ../src/guestfs-actions.pod:7678
31728 msgid "guestfs_umount"
31732 #: ../src/guestfs-actions.pod:7680
31736 " guestfs_umount (guestfs_h *g,\n"
31737 " const char *pathordevice);\n"
31742 #: ../src/guestfs-actions.pod:7692
31743 msgid "guestfs_umount_all"
31747 #: ../src/guestfs-actions.pod:7694
31751 " guestfs_umount_all (guestfs_h *g);\n"
31756 #: ../src/guestfs-actions.pod:7705
31757 msgid "guestfs_upload"
31761 #: ../src/guestfs-actions.pod:7707
31765 " guestfs_upload (guestfs_h *g,\n"
31766 " const char *filename,\n"
31767 " const char *remotefilename);\n"
31772 #: ../src/guestfs-actions.pod:7717
31773 msgid "See also C<guestfs_download>."
31777 #: ../src/guestfs-actions.pod:7728
31778 msgid "guestfs_upload_offset"
31782 #: ../src/guestfs-actions.pod:7730
31786 " guestfs_upload_offset (guestfs_h *g,\n"
31787 " const char *filename,\n"
31788 " const char *remotefilename,\n"
31789 " int64_t offset);\n"
31794 #: ../src/guestfs-actions.pod:7746
31796 "Note that there is no limit on the amount of data that can be uploaded with "
31797 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
31798 "full amount unless an error occurs."
31802 #: ../src/guestfs-actions.pod:7751
31803 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
31807 #: ../src/guestfs-actions.pod:7762
31808 msgid "guestfs_utimens"
31812 #: ../src/guestfs-actions.pod:7764
31816 " guestfs_utimens (guestfs_h *g,\n"
31817 " const char *path,\n"
31818 " int64_t atsecs,\n"
31819 " int64_t atnsecs,\n"
31820 " int64_t mtsecs,\n"
31821 " int64_t mtnsecs);\n"
31826 #: ../src/guestfs-actions.pod:7793 ../src/guestfs-structs.pod:175
31827 msgid "guestfs_version"
31831 #: ../src/guestfs-actions.pod:7795
31834 " struct guestfs_version *\n"
31835 " guestfs_version (guestfs_h *g);\n"
31840 #: ../src/guestfs-actions.pod:7823
31842 "I<Note:> Don't use this call to test for availability of features. In "
31843 "enterprise distributions we backport features from later versions into "
31844 "earlier versions, making this an unreliable way to test for features. Use "
31845 "C<guestfs_available> instead."
31849 #: ../src/guestfs-actions.pod:7829
31851 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
31852 "error. I<The caller must call C<guestfs_free_version> after use>."
31856 #: ../src/guestfs-actions.pod:7833
31857 msgid "(Added in 1.0.58)"
31861 #: ../src/guestfs-actions.pod:7835
31862 msgid "guestfs_vfs_label"
31866 #: ../src/guestfs-actions.pod:7837
31870 " guestfs_vfs_label (guestfs_h *g,\n"
31871 " const char *device);\n"
31876 #: ../src/guestfs-actions.pod:7846
31877 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
31881 #: ../src/guestfs-actions.pod:7851 ../src/guestfs-actions.pod:7888
31882 msgid "(Added in 1.3.18)"
31886 #: ../src/guestfs-actions.pod:7853
31887 msgid "guestfs_vfs_type"
31891 #: ../src/guestfs-actions.pod:7855
31895 " guestfs_vfs_type (guestfs_h *g,\n"
31896 " const char *device);\n"
31901 #: ../src/guestfs-actions.pod:7872
31902 msgid "guestfs_vfs_uuid"
31906 #: ../src/guestfs-actions.pod:7874
31910 " guestfs_vfs_uuid (guestfs_h *g,\n"
31911 " const char *device);\n"
31916 #: ../src/guestfs-actions.pod:7883
31917 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
31921 #: ../src/guestfs-actions.pod:7890
31922 msgid "guestfs_vg_activate"
31926 #: ../src/guestfs-actions.pod:7892
31930 " guestfs_vg_activate (guestfs_h *g,\n"
31932 " char *const *volgroups);\n"
31937 #: ../src/guestfs-actions.pod:7909
31938 msgid "guestfs_vg_activate_all"
31942 #: ../src/guestfs-actions.pod:7911
31946 " guestfs_vg_activate_all (guestfs_h *g,\n"
31947 " int activate);\n"
31952 #: ../src/guestfs-actions.pod:7924
31953 msgid "guestfs_vgcreate"
31957 #: ../src/guestfs-actions.pod:7926
31961 " guestfs_vgcreate (guestfs_h *g,\n"
31962 " const char *volgroup,\n"
31963 " char *const *physvols);\n"
31968 #: ../src/guestfs-actions.pod:7938
31969 msgid "guestfs_vglvuuids"
31973 #: ../src/guestfs-actions.pod:7940
31977 " guestfs_vglvuuids (guestfs_h *g,\n"
31978 " const char *vgname);\n"
31983 #: ../src/guestfs-actions.pod:7947
31985 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
31986 "associate logical volumes and volume groups."
31990 #: ../src/guestfs-actions.pod:7950
31991 msgid "See also C<guestfs_vgpvuuids>."
31995 #: ../src/guestfs-actions.pod:7958
31996 msgid "guestfs_vgpvuuids"
32000 #: ../src/guestfs-actions.pod:7960
32004 " guestfs_vgpvuuids (guestfs_h *g,\n"
32005 " const char *vgname);\n"
32010 #: ../src/guestfs-actions.pod:7967
32012 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
32013 "associate physical volumes and volume groups."
32017 #: ../src/guestfs-actions.pod:7970
32018 msgid "See also C<guestfs_vglvuuids>."
32022 #: ../src/guestfs-actions.pod:7978
32023 msgid "guestfs_vgremove"
32027 #: ../src/guestfs-actions.pod:7980
32031 " guestfs_vgremove (guestfs_h *g,\n"
32032 " const char *vgname);\n"
32037 #: ../src/guestfs-actions.pod:7993
32038 msgid "guestfs_vgrename"
32042 #: ../src/guestfs-actions.pod:7995
32046 " guestfs_vgrename (guestfs_h *g,\n"
32047 " const char *volgroup,\n"
32048 " const char *newvolgroup);\n"
32053 #: ../src/guestfs-actions.pod:8006
32054 msgid "guestfs_vgs"
32058 #: ../src/guestfs-actions.pod:8008
32062 " guestfs_vgs (guestfs_h *g);\n"
32067 #: ../src/guestfs-actions.pod:8017
32068 msgid "See also C<guestfs_vgs_full>."
32072 #: ../src/guestfs-actions.pod:8025
32073 msgid "guestfs_vgs_full"
32077 #: ../src/guestfs-actions.pod:8027
32080 " struct guestfs_lvm_vg_list *\n"
32081 " guestfs_vgs_full (guestfs_h *g);\n"
32086 #: ../src/guestfs-actions.pod:8033
32088 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
32089 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
32094 #: ../src/guestfs-actions.pod:8039
32095 msgid "guestfs_vgscan"
32099 #: ../src/guestfs-actions.pod:8041
32103 " guestfs_vgscan (guestfs_h *g);\n"
32108 #: ../src/guestfs-actions.pod:8051
32109 msgid "guestfs_vguuid"
32113 #: ../src/guestfs-actions.pod:8053
32117 " guestfs_vguuid (guestfs_h *g,\n"
32118 " const char *vgname);\n"
32123 #: ../src/guestfs-actions.pod:8064
32124 msgid "guestfs_wait_ready"
32128 #: ../src/guestfs-actions.pod:8066
32132 " guestfs_wait_ready (guestfs_h *g);\n"
32137 #: ../src/guestfs-actions.pod:8069
32139 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
32144 #: ../src/guestfs-actions.pod:8076
32145 msgid "This function is a no op."
32149 #: ../src/guestfs-actions.pod:8078
32151 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
32152 "calling C<guestfs_launch> to wait for the launch to complete. However this "
32153 "is no longer necessary because C<guestfs_launch> now does the waiting."
32157 #: ../src/guestfs-actions.pod:8083
32159 "If you see any calls to this function in code then you can just remove them, "
32160 "unless you want to retain compatibility with older versions of the API."
32164 #: ../src/guestfs-actions.pod:8091
32165 msgid "guestfs_wc_c"
32169 #: ../src/guestfs-actions.pod:8093
32173 " guestfs_wc_c (guestfs_h *g,\n"
32174 " const char *path);\n"
32179 #: ../src/guestfs-actions.pod:8104
32180 msgid "guestfs_wc_l"
32184 #: ../src/guestfs-actions.pod:8106
32188 " guestfs_wc_l (guestfs_h *g,\n"
32189 " const char *path);\n"
32194 #: ../src/guestfs-actions.pod:8117
32195 msgid "guestfs_wc_w"
32199 #: ../src/guestfs-actions.pod:8119
32203 " guestfs_wc_w (guestfs_h *g,\n"
32204 " const char *path);\n"
32209 #: ../src/guestfs-actions.pod:8130
32210 msgid "guestfs_write"
32214 #: ../src/guestfs-actions.pod:8132
32218 " guestfs_write (guestfs_h *g,\n"
32219 " const char *path,\n"
32220 " const char *content,\n"
32221 " size_t content_size);\n"
32226 #: ../src/guestfs-actions.pod:8141
32227 msgid "See also C<guestfs_write_append>."
32231 #: ../src/guestfs-actions.pod:8150
32232 msgid "guestfs_write_append"
32236 #: ../src/guestfs-actions.pod:8152
32240 " guestfs_write_append (guestfs_h *g,\n"
32241 " const char *path,\n"
32242 " const char *content,\n"
32243 " size_t content_size);\n"
32248 #: ../src/guestfs-actions.pod:8161
32249 msgid "See also C<guestfs_write>."
32253 #: ../src/guestfs-actions.pod:8170
32254 msgid "guestfs_write_file"
32258 #: ../src/guestfs-actions.pod:8172
32262 " guestfs_write_file (guestfs_h *g,\n"
32263 " const char *path,\n"
32264 " const char *content,\n"
32270 #: ../src/guestfs-actions.pod:8178
32272 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
32277 #: ../src/guestfs-actions.pod:8203
32278 msgid "guestfs_zegrep"
32282 #: ../src/guestfs-actions.pod:8205
32286 " guestfs_zegrep (guestfs_h *g,\n"
32287 " const char *regex,\n"
32288 " const char *path);\n"
32293 #: ../src/guestfs-actions.pod:8222
32294 msgid "guestfs_zegrepi"
32298 #: ../src/guestfs-actions.pod:8224
32302 " guestfs_zegrepi (guestfs_h *g,\n"
32303 " const char *regex,\n"
32304 " const char *path);\n"
32309 #: ../src/guestfs-actions.pod:8241
32310 msgid "guestfs_zero"
32314 #: ../src/guestfs-actions.pod:8243
32318 " guestfs_zero (guestfs_h *g,\n"
32319 " const char *device);\n"
32324 #: ../src/guestfs-actions.pod:8257
32326 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
32327 "C<guestfs_is_zero_device>"
32331 #: ../src/guestfs-actions.pod:8269
32332 msgid "guestfs_zero_device"
32336 #: ../src/guestfs-actions.pod:8271
32340 " guestfs_zero_device (guestfs_h *g,\n"
32341 " const char *device);\n"
32346 #: ../src/guestfs-actions.pod:8275
32348 "This command writes zeroes over the entire C<device>. Compare with "
32349 "C<guestfs_zero> which just zeroes the first few blocks of a device."
32353 #: ../src/guestfs-actions.pod:8293
32354 msgid "(Added in 1.3.1)"
32358 #: ../src/guestfs-actions.pod:8295
32359 msgid "guestfs_zerofree"
32363 #: ../src/guestfs-actions.pod:8297
32367 " guestfs_zerofree (guestfs_h *g,\n"
32368 " const char *device);\n"
32373 #: ../src/guestfs-actions.pod:8316
32374 msgid "guestfs_zfgrep"
32378 #: ../src/guestfs-actions.pod:8318
32382 " guestfs_zfgrep (guestfs_h *g,\n"
32383 " const char *pattern,\n"
32384 " const char *path);\n"
32389 #: ../src/guestfs-actions.pod:8335
32390 msgid "guestfs_zfgrepi"
32394 #: ../src/guestfs-actions.pod:8337
32398 " guestfs_zfgrepi (guestfs_h *g,\n"
32399 " const char *pattern,\n"
32400 " const char *path);\n"
32405 #: ../src/guestfs-actions.pod:8354
32406 msgid "guestfs_zfile"
32410 #: ../src/guestfs-actions.pod:8356
32414 " guestfs_zfile (guestfs_h *g,\n"
32415 " const char *meth,\n"
32416 " const char *path);\n"
32421 #: ../src/guestfs-actions.pod:8361
32423 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
32428 #: ../src/guestfs-actions.pod:8373
32430 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
32435 #: ../src/guestfs-actions.pod:8381
32436 msgid "guestfs_zgrep"
32440 #: ../src/guestfs-actions.pod:8383
32444 " guestfs_zgrep (guestfs_h *g,\n"
32445 " const char *regex,\n"
32446 " const char *path);\n"
32451 #: ../src/guestfs-actions.pod:8400
32452 msgid "guestfs_zgrepi"
32456 #: ../src/guestfs-actions.pod:8402
32460 " guestfs_zgrepi (guestfs_h *g,\n"
32461 " const char *regex,\n"
32462 " const char *path);\n"
32467 #: ../src/guestfs-availability.pod:3
32472 #: ../src/guestfs-availability.pod:5
32474 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
32475 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
32476 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
32477 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
32478 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
32482 #: ../src/guestfs-availability.pod:21
32487 #: ../src/guestfs-availability.pod:23
32488 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
32492 #: ../src/guestfs-availability.pod:26
32497 #: ../src/guestfs-availability.pod:28
32498 msgid "The following functions: L</guestfs_grub_install>"
32502 #: ../src/guestfs-availability.pod:31
32507 #: ../src/guestfs-availability.pod:33
32509 "The following functions: L</guestfs_inotify_add_watch> "
32510 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
32511 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
32515 #: ../src/guestfs-availability.pod:41
32516 msgid "B<linuxfsuuid>"
32520 #: ../src/guestfs-availability.pod:43
32522 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
32523 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
32527 #: ../src/guestfs-availability.pod:50
32528 msgid "B<linuxmodules>"
32532 #: ../src/guestfs-availability.pod:52
32533 msgid "The following functions: L</guestfs_modprobe>"
32537 #: ../src/guestfs-availability.pod:55
32538 msgid "B<linuxxattrs>"
32542 #: ../src/guestfs-availability.pod:57
32544 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
32545 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
32546 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
32547 "L</guestfs_setxattr>"
32551 #: ../src/guestfs-availability.pod:68
32556 #: ../src/guestfs-availability.pod:70
32558 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
32559 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
32560 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
32564 #: ../src/guestfs-availability.pod:79
32569 #: ../src/guestfs-availability.pod:81
32571 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
32572 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
32573 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
32574 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
32575 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
32576 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
32577 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
32578 "L</guestfs_vgs_full>"
32582 #: ../src/guestfs-availability.pod:104
32587 #: ../src/guestfs-availability.pod:106
32589 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
32590 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
32594 #: ../src/guestfs-availability.pod:112
32599 #: ../src/guestfs-availability.pod:114
32600 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
32604 #: ../src/guestfs-availability.pod:117
32605 msgid "B<ntfsprogs>"
32609 #: ../src/guestfs-availability.pod:119
32611 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
32612 "L</guestfs_ntfsresize_size>"
32616 #: ../src/guestfs-availability.pod:124
32617 msgid "B<realpath>"
32621 #: ../src/guestfs-availability.pod:126
32622 msgid "The following functions: L</guestfs_realpath>"
32626 #: ../src/guestfs-availability.pod:129
32631 #: ../src/guestfs-availability.pod:131
32633 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
32634 "L</guestfs_scrub_freespace>"
32638 #: ../src/guestfs-availability.pod:136
32643 #: ../src/guestfs-availability.pod:138
32644 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
32648 #: ../src/guestfs-availability.pod:142
32653 #: ../src/guestfs-availability.pod:144
32654 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
32658 #: ../src/guestfs-availability.pod:148
32659 msgid "B<zerofree>"
32663 #: ../src/guestfs-availability.pod:150
32664 msgid "The following functions: L</guestfs_zerofree>"
32668 #: ../src/guestfs-structs.pod:1
32669 msgid "guestfs_int_bool"
32673 #: ../src/guestfs-structs.pod:3
32676 " struct guestfs_int_bool {\n"
32684 #: ../src/guestfs-structs.pod:8
32687 " struct guestfs_int_bool_list {\n"
32688 " uint32_t len; /* Number of elements in list. */\n"
32689 " struct guestfs_int_bool *val; /* Elements. */\n"
32695 #: ../src/guestfs-structs.pod:13
32698 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
32699 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
32704 #: ../src/guestfs-structs.pod:16
32705 msgid "guestfs_lvm_pv"
32709 #: ../src/guestfs-structs.pod:18
32712 " struct guestfs_lvm_pv {\n"
32713 " char *pv_name;\n"
32714 " /* The next field is NOT nul-terminated, be careful when printing it: "
32716 " char pv_uuid[32];\n"
32718 " uint64_t pv_size;\n"
32719 " uint64_t dev_size;\n"
32720 " uint64_t pv_free;\n"
32721 " uint64_t pv_used;\n"
32722 " char *pv_attr;\n"
32723 " int64_t pv_pe_count;\n"
32724 " int64_t pv_pe_alloc_count;\n"
32725 " char *pv_tags;\n"
32726 " uint64_t pe_start;\n"
32727 " int64_t pv_mda_count;\n"
32728 " uint64_t pv_mda_free;\n"
32734 #: ../src/guestfs-structs.pod:36
32737 " struct guestfs_lvm_pv_list {\n"
32738 " uint32_t len; /* Number of elements in list. */\n"
32739 " struct guestfs_lvm_pv *val; /* Elements. */\n"
32745 #: ../src/guestfs-structs.pod:41
32748 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
32749 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
32754 #: ../src/guestfs-structs.pod:44
32755 msgid "guestfs_lvm_vg"
32759 #: ../src/guestfs-structs.pod:46
32762 " struct guestfs_lvm_vg {\n"
32763 " char *vg_name;\n"
32764 " /* The next field is NOT nul-terminated, be careful when printing it: "
32766 " char vg_uuid[32];\n"
32768 " char *vg_attr;\n"
32769 " uint64_t vg_size;\n"
32770 " uint64_t vg_free;\n"
32771 " char *vg_sysid;\n"
32772 " uint64_t vg_extent_size;\n"
32773 " int64_t vg_extent_count;\n"
32774 " int64_t vg_free_count;\n"
32775 " int64_t max_lv;\n"
32776 " int64_t max_pv;\n"
32777 " int64_t pv_count;\n"
32778 " int64_t lv_count;\n"
32779 " int64_t snap_count;\n"
32780 " int64_t vg_seqno;\n"
32781 " char *vg_tags;\n"
32782 " int64_t vg_mda_count;\n"
32783 " uint64_t vg_mda_free;\n"
32789 #: ../src/guestfs-structs.pod:69
32792 " struct guestfs_lvm_vg_list {\n"
32793 " uint32_t len; /* Number of elements in list. */\n"
32794 " struct guestfs_lvm_vg *val; /* Elements. */\n"
32800 #: ../src/guestfs-structs.pod:74
32803 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
32804 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
32809 #: ../src/guestfs-structs.pod:77
32810 msgid "guestfs_lvm_lv"
32814 #: ../src/guestfs-structs.pod:79
32817 " struct guestfs_lvm_lv {\n"
32818 " char *lv_name;\n"
32819 " /* The next field is NOT nul-terminated, be careful when printing it: "
32821 " char lv_uuid[32];\n"
32822 " char *lv_attr;\n"
32823 " int64_t lv_major;\n"
32824 " int64_t lv_minor;\n"
32825 " int64_t lv_kernel_major;\n"
32826 " int64_t lv_kernel_minor;\n"
32827 " uint64_t lv_size;\n"
32828 " int64_t seg_count;\n"
32830 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32831 " float snap_percent;\n"
32832 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32833 " float copy_percent;\n"
32834 " char *move_pv;\n"
32835 " char *lv_tags;\n"
32836 " char *mirror_log;\n"
32837 " char *modules;\n"
32843 #: ../src/guestfs-structs.pod:101
32846 " struct guestfs_lvm_lv_list {\n"
32847 " uint32_t len; /* Number of elements in list. */\n"
32848 " struct guestfs_lvm_lv *val; /* Elements. */\n"
32854 #: ../src/guestfs-structs.pod:106
32857 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
32858 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
32863 #: ../src/guestfs-structs.pod:111
32866 " struct guestfs_stat {\n"
32870 " int64_t nlink;\n"
32875 " int64_t blksize;\n"
32876 " int64_t blocks;\n"
32877 " int64_t atime;\n"
32878 " int64_t mtime;\n"
32879 " int64_t ctime;\n"
32885 #: ../src/guestfs-structs.pod:127
32888 " struct guestfs_stat_list {\n"
32889 " uint32_t len; /* Number of elements in list. */\n"
32890 " struct guestfs_stat *val; /* Elements. */\n"
32896 #: ../src/guestfs-structs.pod:132
32899 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
32900 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
32905 #: ../src/guestfs-structs.pod:137
32908 " struct guestfs_statvfs {\n"
32909 " int64_t bsize;\n"
32910 " int64_t frsize;\n"
32911 " int64_t blocks;\n"
32912 " int64_t bfree;\n"
32913 " int64_t bavail;\n"
32914 " int64_t files;\n"
32915 " int64_t ffree;\n"
32916 " int64_t favail;\n"
32919 " int64_t namemax;\n"
32925 #: ../src/guestfs-structs.pod:151
32928 " struct guestfs_statvfs_list {\n"
32929 " uint32_t len; /* Number of elements in list. */\n"
32930 " struct guestfs_statvfs *val; /* Elements. */\n"
32936 #: ../src/guestfs-structs.pod:156
32939 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
32940 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
32945 #: ../src/guestfs-structs.pod:159
32946 msgid "guestfs_dirent"
32950 #: ../src/guestfs-structs.pod:161
32953 " struct guestfs_dirent {\n"
32962 #: ../src/guestfs-structs.pod:167
32965 " struct guestfs_dirent_list {\n"
32966 " uint32_t len; /* Number of elements in list. */\n"
32967 " struct guestfs_dirent *val; /* Elements. */\n"
32973 #: ../src/guestfs-structs.pod:172
32976 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
32977 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
32982 #: ../src/guestfs-structs.pod:177
32985 " struct guestfs_version {\n"
32986 " int64_t major;\n"
32987 " int64_t minor;\n"
32988 " int64_t release;\n"
32995 #: ../src/guestfs-structs.pod:184
32998 " struct guestfs_version_list {\n"
32999 " uint32_t len; /* Number of elements in list. */\n"
33000 " struct guestfs_version *val; /* Elements. */\n"
33006 #: ../src/guestfs-structs.pod:189
33009 " void guestfs_free_version (struct guestfs_free_version *);\n"
33010 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
33015 #: ../src/guestfs-structs.pod:192
33016 msgid "guestfs_xattr"
33020 #: ../src/guestfs-structs.pod:194
33023 " struct guestfs_xattr {\n"
33024 " char *attrname;\n"
33025 " /* The next two fields describe a byte array. */\n"
33026 " uint32_t attrval_len;\n"
33027 " char *attrval;\n"
33033 #: ../src/guestfs-structs.pod:201
33036 " struct guestfs_xattr_list {\n"
33037 " uint32_t len; /* Number of elements in list. */\n"
33038 " struct guestfs_xattr *val; /* Elements. */\n"
33044 #: ../src/guestfs-structs.pod:206
33047 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
33048 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
33053 #: ../src/guestfs-structs.pod:209
33054 msgid "guestfs_inotify_event"
33058 #: ../src/guestfs-structs.pod:211
33061 " struct guestfs_inotify_event {\n"
33062 " int64_t in_wd;\n"
33063 " uint32_t in_mask;\n"
33064 " uint32_t in_cookie;\n"
33065 " char *in_name;\n"
33071 #: ../src/guestfs-structs.pod:218
33074 " struct guestfs_inotify_event_list {\n"
33075 " uint32_t len; /* Number of elements in list. */\n"
33076 " struct guestfs_inotify_event *val; /* Elements. */\n"
33082 #: ../src/guestfs-structs.pod:223
33085 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
33086 " void guestfs_free_inotify_event_list (struct "
33087 "guestfs_free_inotify_event_list *);\n"
33092 #: ../src/guestfs-structs.pod:226
33093 msgid "guestfs_partition"
33097 #: ../src/guestfs-structs.pod:228
33100 " struct guestfs_partition {\n"
33101 " int32_t part_num;\n"
33102 " uint64_t part_start;\n"
33103 " uint64_t part_end;\n"
33104 " uint64_t part_size;\n"
33110 #: ../src/guestfs-structs.pod:235
33113 " struct guestfs_partition_list {\n"
33114 " uint32_t len; /* Number of elements in list. */\n"
33115 " struct guestfs_partition *val; /* Elements. */\n"
33121 #: ../src/guestfs-structs.pod:240
33124 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
33125 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
33130 #: ../src/guestfs-structs.pod:243
33131 msgid "guestfs_application"
33135 #: ../src/guestfs-structs.pod:245
33138 " struct guestfs_application {\n"
33139 " char *app_name;\n"
33140 " char *app_display_name;\n"
33141 " int32_t app_epoch;\n"
33142 " char *app_version;\n"
33143 " char *app_release;\n"
33144 " char *app_install_path;\n"
33145 " char *app_trans_path;\n"
33146 " char *app_publisher;\n"
33147 " char *app_url;\n"
33148 " char *app_source_package;\n"
33149 " char *app_summary;\n"
33150 " char *app_description;\n"
33156 #: ../src/guestfs-structs.pod:260
33159 " struct guestfs_application_list {\n"
33160 " uint32_t len; /* Number of elements in list. */\n"
33161 " struct guestfs_application *val; /* Elements. */\n"
33167 #: ../src/guestfs-structs.pod:265
33170 " void guestfs_free_application (struct guestfs_free_application *);\n"
33171 " void guestfs_free_application_list (struct guestfs_free_application_list "
33177 #: ../src/guestfs.pod:5
33178 msgid "guestfs - Library for accessing and modifying virtual machine images"
33182 #: ../src/guestfs.pod:11
33185 " guestfs_h *g = guestfs_create ();\n"
33186 " guestfs_add_drive (g, \"guest.img\");\n"
33187 " guestfs_launch (g);\n"
33188 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33189 " guestfs_touch (g, \"/hello\");\n"
33190 " guestfs_umount (g, \"/\");\n"
33191 " guestfs_close (g);\n"
33196 #: ../src/guestfs.pod:25
33198 "Libguestfs is a library for accessing and modifying guest disk images. "
33199 "Amongst the things this is good for: making batch configuration changes to "
33200 "guests, getting disk used/free statistics (see also: virt-df), migrating "
33201 "between virtualization systems (see also: virt-p2v), performing partial "
33202 "backups, performing partial guest clones, cloning guests and changing "
33203 "registry/UUID/hostname info, and much else besides."
33207 #: ../src/guestfs.pod:33
33209 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
33210 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
33211 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
33216 #: ../src/guestfs.pod:38
33218 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
33219 "what filesystem is in each LV, etc.). It can also run commands in the "
33220 "context of the guest. Also you can access filesystems over FUSE."
33224 #: ../src/guestfs.pod:43
33226 "Libguestfs is a library that can be linked with C and C++ management "
33227 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
33228 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
33233 #: ../src/guestfs.pod:48
33235 "You don't need to be root to use libguestfs, although obviously you do need "
33236 "enough permissions to access the disk images."
33240 #: ../src/guestfs.pod:51
33242 "Libguestfs is a large API because it can do many things. For a gentle "
33243 "introduction, please read the L</API OVERVIEW> section next."
33247 #: ../src/guestfs.pod:54
33249 "There are also some example programs in the L<guestfs-examples(3)> manual "
33254 #: ../src/guestfs.pod:57
33255 msgid "API OVERVIEW"
33259 #: ../src/guestfs.pod:59
33261 "This section provides a gentler overview of the libguestfs API. We also try "
33262 "to group API calls together, where that may not be obvious from reading "
33263 "about the individual calls in the main section of this manual."
33267 #: ../src/guestfs.pod:64
33272 #: ../src/guestfs.pod:66
33274 "Before you can use libguestfs calls, you have to create a handle. Then you "
33275 "must add at least one disk image to the handle, followed by launching the "
33276 "handle, then performing whatever operations you want, and finally closing "
33277 "the handle. By convention we use the single letter C<g> for the name of the "
33278 "handle variable, although of course you can use any name you want."
33282 #: ../src/guestfs.pod:73
33283 msgid "The general structure of all libguestfs-using programs looks like this:"
33287 #: ../src/guestfs.pod:76
33290 " guestfs_h *g = guestfs_create ();\n"
33295 #: ../src/guestfs.pod:78
33298 " /* Call guestfs_add_drive additional times if there are\n"
33299 " * multiple disk images.\n"
33301 " guestfs_add_drive (g, \"guest.img\");\n"
33306 #: ../src/guestfs.pod:83
33309 " /* Most manipulation calls won't work until you've launched\n"
33310 " * the handle 'g'. You have to do this _after_ adding drives\n"
33311 " * and _before_ other commands.\n"
33313 " guestfs_launch (g);\n"
33318 #: ../src/guestfs.pod:89
33321 " /* Now you can examine what partitions, LVs etc are available.\n"
33323 " char **partitions = guestfs_list_partitions (g);\n"
33324 " char **logvols = guestfs_lvs (g);\n"
33329 #: ../src/guestfs.pod:94
33332 " /* To access a filesystem in the image, you must mount it.\n"
33334 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33339 #: ../src/guestfs.pod:98
33342 " /* Now you can perform filesystem actions on the guest\n"
33345 " guestfs_touch (g, \"/hello\");\n"
33350 #: ../src/guestfs.pod:103
33353 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
33354 " * it is done automatically when you close the handle. See\n"
33355 " * discussion of autosync in this page.\n"
33357 " guestfs_sync (g);\n"
33362 #: ../src/guestfs.pod:109
33365 " /* Close the handle 'g'. */\n"
33366 " guestfs_close (g);\n"
33371 #: ../src/guestfs.pod:112
33373 "The code above doesn't include any error checking. In real code you should "
33374 "check return values carefully for errors. In general all functions that "
33375 "return integers return C<-1> on error, and all functions that return "
33376 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
33377 "how to handle errors, and consult the documentation for each function call "
33378 "below to see precisely how they return error indications. See "
33379 "L<guestfs-examples(3)> for fully worked examples."
33383 #: ../src/guestfs.pod:121
33384 msgid "DISK IMAGES"
33388 #: ../src/guestfs.pod:123
33390 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
33391 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
33392 "actual block device, or simply an empty file of zeroes that you have created "
33393 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
33398 #: ../src/guestfs.pod:129
33400 "The call you should use in modern code for adding drives is "
33401 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
33402 "specifying that the format is raw, do:"
33406 #: ../src/guestfs.pod:133
33409 " guestfs_add_drive_opts (g, filename,\n"
33410 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33416 #: ../src/guestfs.pod:137
33417 msgid "You can add a disk read-only using:"
33421 #: ../src/guestfs.pod:139
33424 " guestfs_add_drive_opts (g, filename,\n"
33425 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33426 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
33432 #: ../src/guestfs.pod:144
33434 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
33435 "libguestfs won't modify the file."
33439 #: ../src/guestfs.pod:147
33441 "Be extremely cautious if the disk image is in use, eg. if it is being used "
33442 "by a virtual machine. Adding it read-write will almost certainly cause disk "
33443 "corruption, but adding it read-only is safe."
33447 #: ../src/guestfs.pod:151
33449 "You must add at least one disk image, and you may add multiple disk images. "
33450 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
33451 "first one you added), C</dev/sdb> (for the second one you added), etc."
33455 #: ../src/guestfs.pod:156
33457 "Once L</guestfs_launch> has been called you cannot add any more images. You "
33458 "can call L</guestfs_list_devices> to get a list of the device names, in the "
33459 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
33463 #: ../src/guestfs.pod:161
33468 #: ../src/guestfs.pod:163
33470 "Before you can read or write files, create directories and so on in a disk "
33471 "image that contains filesystems, you have to mount those filesystems using "
33472 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
33473 "a disk image contains (for example) one partition with a filesystem on that "
33474 "partition, then you can mount it directly:"
33478 #: ../src/guestfs.pod:170
33481 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
33486 #: ../src/guestfs.pod:172
33488 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
33489 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
33490 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
33491 "that these are libguestfs virtual devices, and are nothing to do with host "
33496 #: ../src/guestfs.pod:178
33498 "If you are given a disk image and you don't know what it contains then you "
33499 "have to find out. Libguestfs can do that too: use "
33500 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
33501 "and LVs, and either try mounting each to see what is mountable, or else "
33502 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
33503 "filesystems, use L</guestfs_list_filesystems>."
33507 #: ../src/guestfs.pod:186
33509 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
33510 "L</INSPECTION> below). But you might find it easier to look at higher level "
33511 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
33515 #: ../src/guestfs.pod:191
33517 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
33518 "several other variations of the C<guestfs_mount_*> call."
33522 #: ../src/guestfs.pod:194
33523 msgid "FILESYSTEM ACCESS AND MODIFICATION"
33527 #: ../src/guestfs.pod:196
33529 "The majority of the libguestfs API consists of fairly low-level calls for "
33530 "accessing and modifying the files, directories, symlinks etc on mounted "
33531 "filesystems. There are over a hundred such calls which you can find listed "
33532 "in detail below in this man page, and we don't even pretend to cover them "
33533 "all in this overview."
33537 #: ../src/guestfs.pod:202
33539 "Specify filenames as full paths, starting with C<\"/\"> and including the "
33544 #: ../src/guestfs.pod:205
33546 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
33547 "the file called C<\"etc/passwd\"> then you could do:"
33551 #: ../src/guestfs.pod:208
33554 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
33559 #: ../src/guestfs.pod:210
33561 "This would return C<data> as a newly allocated buffer containing the full "
33562 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
33563 "or C<NULL> if there was an error."
33567 #: ../src/guestfs.pod:214
33569 "As another example, to create a top-level directory on that filesystem "
33570 "called C<\"var\"> you would do:"
33574 #: ../src/guestfs.pod:217
33577 " guestfs_mkdir (g, \"/var\");\n"
33582 #: ../src/guestfs.pod:219
33583 msgid "To create a symlink you could do:"
33587 #: ../src/guestfs.pod:221
33590 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
33591 " \"/etc/rc3.d/S30portmap\");\n"
33596 #: ../src/guestfs.pod:224
33598 "Libguestfs will reject attempts to use relative paths and there is no "
33599 "concept of a current working directory."
33603 #: ../src/guestfs.pod:227
33605 "Libguestfs can return errors in many situations: for example if the "
33606 "filesystem isn't writable, or if a file or directory that you requested "
33607 "doesn't exist. If you are using the C API (documented here) you have to "
33608 "check for those error conditions after each call. (Other language bindings "
33609 "turn these errors into exceptions)."
33613 #: ../src/guestfs.pod:233
33615 "File writes are affected by the per-handle umask, set by calling "
33616 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
33620 #: ../src/guestfs.pod:236
33621 msgid "PARTITIONING"
33625 #: ../src/guestfs.pod:238
33627 "Libguestfs contains API calls to read, create and modify partition tables on "
33632 #: ../src/guestfs.pod:241
33634 "In the common case where you want to create a single partition covering the "
33635 "whole disk, you should use the L</guestfs_part_disk> call:"
33639 #: ../src/guestfs.pod:245
33642 " const char *parttype = \"mbr\";\n"
33643 " if (disk_is_larger_than_2TB)\n"
33644 " parttype = \"gpt\";\n"
33645 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
33650 #: ../src/guestfs.pod:250
33652 "Obviously this effectively wipes anything that was on that disk image "
33657 #: ../src/guestfs.pod:253
33662 #: ../src/guestfs.pod:255
33664 "Libguestfs provides access to a large part of the LVM2 API, such as "
33665 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
33666 "unless you familiarize yourself with the concepts of physical volumes, "
33667 "volume groups and logical volumes."
33671 #: ../src/guestfs.pod:260
33673 "This author strongly recommends reading the LVM HOWTO, online at "
33674 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
33678 #: ../src/guestfs.pod:263
33679 msgid "DOWNLOADING"
33683 #: ../src/guestfs.pod:265
33685 "Use L</guestfs_cat> to download small, text only files. This call is "
33686 "limited to files which are less than 2 MB and which cannot contain any ASCII "
33687 "NUL (C<\\0>) characters. However the API is very simple to use."
33691 #: ../src/guestfs.pod:269
33693 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
33694 "bit data, since it returns a (pointer, size) pair. However it is still "
33695 "limited to \"small\" files, less than 2 MB."
33699 #: ../src/guestfs.pod:273
33701 "L</guestfs_download> can be used to download any file, with no limits on "
33702 "content or size (even files larger than 4 GB)."
33706 #: ../src/guestfs.pod:276
33707 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
33711 #: ../src/guestfs.pod:279
33716 #: ../src/guestfs.pod:281
33718 "It's often the case that you want to write a file or files to the disk "
33723 #: ../src/guestfs.pod:284
33725 "To write a small file with fixed content, use L</guestfs_write>. To create "
33726 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
33727 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
33728 "variety of other functions for creating test files, for example "
33729 "L</guestfs_fill> and L</guestfs_fill_pattern>."
33733 #: ../src/guestfs.pod:290
33735 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
33736 "file content or size (even files larger than 4 GB)."
33740 #: ../src/guestfs.pod:293
33741 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
33745 #: ../src/guestfs.pod:295
33747 "However the fastest way to upload I<large numbers of arbitrary files> is to "
33748 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
33749 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
33750 "the drive in a predictable way (eg. adding it last after all other drives) "
33751 "then you can get the device name from L</guestfs_list_devices> and mount it "
33752 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
33753 "sometimes non-portable between kernel versions, and they don't support "
33754 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
33755 "using a label or UUID, use an ISO image instead."
33759 #: ../src/guestfs.pod:306
33764 #: ../src/guestfs.pod:308
33766 "There are various different commands for copying between files and devices "
33767 "and in and out of the guest filesystem. These are summarised in the table "
33772 #: ../src/guestfs.pod:314
33773 msgid "B<file> to B<file>"
33777 #: ../src/guestfs.pod:316
33779 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
33780 "directories recursively."
33784 #: ../src/guestfs.pod:319
33785 msgid "To copy part of a file (offset and size) use L</guestfs_copy_file_to_file>."
33789 #: ../src/guestfs.pod:322
33790 msgid "B<file> to B<device>"
33794 #: ../src/guestfs.pod:324
33795 msgid "B<device> to B<file>"
33799 #: ../src/guestfs.pod:326
33800 msgid "B<device> to B<device>"
33804 #: ../src/guestfs.pod:328
33806 "Use L</guestfs_copy_file_to_device>, L</guestfs_copy_device_to_file>, or "
33807 "L</guestfs_copy_device_to_device>."
33811 #: ../src/guestfs.pod:331
33812 msgid "Example: duplicate the contents of an LV:"
33816 #: ../src/guestfs.pod:333
33819 " guestfs_copy_device_to_device (g,\n"
33820 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
33821 " /* -1 marks the end of the list of optional parameters */\n"
33827 #: ../src/guestfs.pod:338
33829 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
33830 "(C</dev/VG/Original>). To copy less than the whole source device, use the "
33831 "optional C<size> parameter:"
33835 #: ../src/guestfs.pod:342
33838 " guestfs_copy_device_to_device (g,\n"
33839 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
33840 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, 10000,\n"
33846 #: ../src/guestfs.pod:347
33847 msgid "B<file on the host> to B<file or device>"
33851 #: ../src/guestfs.pod:349
33852 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
33856 #: ../src/guestfs.pod:351
33857 msgid "B<file or device> to B<file on the host>"
33861 #: ../src/guestfs.pod:353
33862 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
33866 #: ../src/guestfs.pod:357
33867 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
33871 #: ../src/guestfs.pod:359
33873 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
33874 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
33875 "appears you can only upload and download to files. However many Un*x-like "
33876 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
33877 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
33878 "stderr, and arbitrary file descriptor N."
33882 #: ../src/guestfs.pod:367
33883 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
33887 #: ../src/guestfs.pod:370
33890 " guestfs_download (g, filename, \"/dev/stdout\");\n"
33895 #: ../src/guestfs.pod:372
33896 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
33900 #: ../src/guestfs.pod:374
33903 " char devfd[64];\n"
33904 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
33905 " guestfs_tar_out (g, \"/\", devfd);\n"
33910 #: ../src/guestfs.pod:378
33911 msgid "LISTING FILES"
33915 #: ../src/guestfs.pod:380
33917 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
33918 "L<guestfish(1)>-equivalent command C<ll>)."
33922 #: ../src/guestfs.pod:383
33924 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
33925 "programs, as a flat list of strings."
33929 #: ../src/guestfs.pod:386
33931 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
33932 "directory, plus additional information about each one. It is more "
33933 "equivalent to using the L<readdir(3)> call on a local filesystem."
33937 #: ../src/guestfs.pod:390
33939 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
33944 #: ../src/guestfs.pod:393
33945 msgid "RUNNING COMMANDS"
33949 #: ../src/guestfs.pod:395
33951 "Although libguestfs is primarily an API for manipulating files inside guest "
33952 "images, we also provide some limited facilities for running commands inside "
33957 #: ../src/guestfs.pod:399
33958 msgid "There are many limitations to this:"
33962 #: ../src/guestfs.pod:405
33964 "The kernel version that the command runs under will be different from what "
33969 #: ../src/guestfs.pod:410
33971 "If the command needs to communicate with daemons, then most likely they "
33972 "won't be running."
33976 #: ../src/guestfs.pod:415
33977 msgid "The command will be running in limited memory."
33981 #: ../src/guestfs.pod:419
33983 "The network may not be available unless you enable it (see "
33984 "L</guestfs_set_network>)."
33988 #: ../src/guestfs.pod:424
33989 msgid "Only supports Linux guests (not Windows, BSD, etc)."
33993 #: ../src/guestfs.pod:428
33994 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
33998 #: ../src/guestfs.pod:433
34000 "For SELinux guests, you may need to enable SELinux and load policy first. "
34001 "See L</SELINUX> in this manpage."
34005 #: ../src/guestfs.pod:438
34007 "I<Security:> It is not safe to run commands from untrusted, possibly "
34008 "malicious guests. These commands may attempt to exploit your program by "
34009 "sending unexpected output. They could also try to exploit the Linux kernel "
34010 "or qemu provided by the libguestfs appliance. They could use the network "
34011 "provided by the libguestfs appliance to bypass ordinary network partitions "
34012 "and firewalls. They could use the elevated privileges or different SELinux "
34013 "context of your program to their advantage."
34017 #: ../src/guestfs.pod:447
34019 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
34020 "(a script which runs when the guest next boots normally), and to have this "
34021 "script run the commands you want in the normal context of the running guest, "
34022 "network security and so on. For information about other security issues, "
34023 "see L</SECURITY>."
34027 #: ../src/guestfs.pod:455
34029 "The two main API calls to run commands are L</guestfs_command> and "
34030 "L</guestfs_sh> (there are also variations)."
34034 #: ../src/guestfs.pod:458
34036 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
34037 "shell globs, redirections, etc will work."
34041 #: ../src/guestfs.pod:461
34042 msgid "CONFIGURATION FILES"
34046 #: ../src/guestfs.pod:463
34048 "To read and write configuration files in Linux guest filesystems, we "
34049 "strongly recommend using Augeas. For example, Augeas understands how to "
34050 "read and write, say, a Linux shadow password file or X.org configuration "
34051 "file, and so avoids you having to write that code."
34055 #: ../src/guestfs.pod:468
34057 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
34058 "document Augeas itself here because there is excellent documentation on the "
34059 "L<http://augeas.net/> website."
34063 #: ../src/guestfs.pod:472
34065 "If you don't want to use Augeas (you fool!) then try calling "
34066 "L</guestfs_read_lines> to get the file as a list of lines which you can "
34071 #: ../src/guestfs.pod:476
34076 #: ../src/guestfs.pod:478
34078 "We support SELinux guests. To ensure that labeling happens correctly in "
34079 "SELinux guests, you need to enable SELinux and load the guest's policy:"
34083 #: ../src/guestfs.pod:486
34084 msgid "Before launching, do:"
34088 #: ../src/guestfs.pod:488
34091 " guestfs_set_selinux (g, 1);\n"
34096 #: ../src/guestfs.pod:492
34098 "After mounting the guest's filesystem(s), load the policy. This is best "
34099 "done by running the L<load_policy(8)> command in the guest itself:"
34103 #: ../src/guestfs.pod:496
34106 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
34111 #: ../src/guestfs.pod:498
34113 "(Older versions of C<load_policy> require you to specify the name of the "
34118 #: ../src/guestfs.pod:503
34120 "Optionally, set the security context for the API. The correct security "
34121 "context to use can only be known by inspecting the guest. As an example:"
34125 #: ../src/guestfs.pod:507
34128 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
34133 #: ../src/guestfs.pod:511
34134 msgid "This will work for running commands and editing existing files."
34138 #: ../src/guestfs.pod:513
34140 "When new files are created, you may need to label them explicitly, for "
34141 "example by running the external command C<restorecon pathname>."
34145 #: ../src/guestfs.pod:517
34150 #: ../src/guestfs.pod:519
34152 "Certain calls are affected by the current file mode creation mask (the "
34153 "\"umask\"). In particular ones which create files or directories, such as "
34154 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
34155 "either the default mode that the file is created with or modifies the mode "
34160 #: ../src/guestfs.pod:525
34162 "The default umask is C<022>, so files are created with modes such as C<0644> "
34163 "and directories with C<0755>."
34167 #: ../src/guestfs.pod:528
34169 "There are two ways to avoid being affected by umask. Either set umask to 0 "
34170 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
34171 "L</guestfs_chmod> after creating each file or directory."
34175 #: ../src/guestfs.pod:532
34176 msgid "For more information about umask, see L<umask(2)>."
34180 #: ../src/guestfs.pod:536
34182 "Libguestfs allows you to access Linux guests which have been encrypted using "
34183 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
34184 "standard. This includes nearly all whole disk encryption systems used by "
34185 "modern Linux guests."
34189 #: ../src/guestfs.pod:542
34191 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
34192 "returns the string C<crypto_LUKS>)."
34196 #: ../src/guestfs.pod:545
34198 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
34199 "will require the passphrase!"
34203 #: ../src/guestfs.pod:548
34205 "Opening a LUKS device creates a new device mapper device called "
34206 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
34207 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
34208 "decrypted from and encrypted to the underlying block device respectively."
34212 #: ../src/guestfs.pod:554
34214 "LVM volume groups on the device can be made visible by calling "
34215 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
34216 "volume(s) can now be mounted in the usual way."
34220 #: ../src/guestfs.pod:558
34222 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
34223 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
34224 "[\"/dev/VG\"])>. Then close the mapper device by calling "
34225 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
34226 "underlying encrypted block device)."
34230 #: ../src/guestfs.pod:565
34235 #: ../src/guestfs.pod:567
34237 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
34238 "contains operating systems, an install CD or a live CD. (These APIs used to "
34239 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
34240 "version 1.5.3 the most frequently used part of this library has been "
34241 "rewritten in C and moved into the core code)."
34245 #: ../src/guestfs.pod:574
34247 "Add all disks belonging to the unknown virtual machine and call "
34248 "L</guestfs_launch> in the usual way."
34252 #: ../src/guestfs.pod:577
34254 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
34255 "and certain heuristics, and returns a list of operating systems that were "
34256 "found. An empty list means none were found. A single element is the root "
34257 "filesystem of the operating system. For dual- or multi-boot guests, "
34258 "multiple roots can be returned, each one corresponding to a separate "
34259 "operating system. (Multi-boot virtual machines are extremely rare in the "
34260 "world of virtualization, but since this scenario can happen, we have built "
34261 "libguestfs to deal with it.)"
34265 #: ../src/guestfs.pod:586
34267 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
34268 "to get additional details about that operating system. For example, call "
34269 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
34270 "Windows and Linux-based operating systems respectively."
34274 #: ../src/guestfs.pod:592
34276 "Un*x-like and Linux-based operating systems usually consist of several "
34277 "filesystems which are mounted at boot time (for example, a separate boot "
34278 "partition mounted on C</boot>). The inspection rules are able to detect how "
34279 "filesystems correspond to mount points. Call "
34280 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
34281 "hash table like this example:"
34285 #: ../src/guestfs.pod:599
34288 " /boot => /dev/sda1\n"
34289 " / => /dev/vg_guest/lv_root\n"
34290 " /usr => /dev/vg_guest/lv_usr\n"
34295 #: ../src/guestfs.pod:603
34297 "The caller can then make calls to L</guestfs_mount_options> to mount the "
34298 "filesystems as suggested."
34302 #: ../src/guestfs.pod:606
34304 "Be careful to mount filesystems in the right order (eg. C</> before "
34305 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
34310 #: ../src/guestfs.pod:610
34312 "Inspection currently only works for some common operating systems. "
34313 "Contributors are welcome to send patches for other operating systems that we "
34314 "currently cannot detect."
34318 #: ../src/guestfs.pod:614
34320 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
34321 "for more details. The L</guestfs_inspect_os> function just ignores any "
34322 "encrypted devices."
34326 #: ../src/guestfs.pod:618
34328 "A note on the implementation: The call L</guestfs_inspect_os> performs "
34329 "inspection and caches the results in the guest handle. Subsequent calls to "
34330 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
34331 "re-read the disks. If you change the content of the guest disks, you can "
34332 "redo inspection by calling L</guestfs_inspect_os> again. "
34333 "(L</guestfs_inspect_list_applications> works a little differently from the "
34334 "other calls and does read the disks. See documentation for that function "
34339 #: ../src/guestfs.pod:627
34340 msgid "INSPECTING INSTALL DISKS"
34344 #: ../src/guestfs.pod:629
34346 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
34351 #: ../src/guestfs.pod:632
34353 "Call L</guestfs_inspect_get_format> to return the format of the operating "
34354 "system, which currently can be C<installed> (a regular operating system) or "
34355 "C<installer> (some sort of install disk)."
34359 #: ../src/guestfs.pod:636
34361 "Further information is available about the operating system that can be "
34362 "installed using the regular inspection APIs like "
34363 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
34368 #: ../src/guestfs.pod:641
34370 "Some additional information specific to installer disks is also available "
34371 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
34372 "L</guestfs_inspect_is_multipart> calls."
34376 #: ../src/guestfs.pod:646
34377 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
34381 #: ../src/guestfs.pod:648
34383 "Libguestfs can mount NTFS partitions. It does this using the "
34384 "L<http://www.ntfs-3g.org/> driver."
34388 #: ../src/guestfs.pod:651
34389 msgid "DRIVE LETTERS AND PATHS"
34393 #: ../src/guestfs.pod:653
34395 "DOS and Windows still use drive letters, and the filesystems are always "
34396 "treated as case insensitive by Windows itself, and therefore you might find "
34397 "a Windows configuration file referring to a path like "
34398 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
34399 "that directory might be referred to as C</WINDOWS/System32>."
34403 #: ../src/guestfs.pod:659
34405 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
34406 "L</guestfs_inspect_get_drive_mappings>)"
34410 #: ../src/guestfs.pod:662
34412 "Dealing with separator characters (backslash vs forward slash) is outside "
34413 "the scope of libguestfs, but usually a simple character replacement will "
34418 #: ../src/guestfs.pod:666
34420 "To resolve the case insensitivity of paths, call "
34421 "L</guestfs_case_sensitive_path>."
34425 #: ../src/guestfs.pod:669
34426 msgid "ACCESSING THE WINDOWS REGISTRY"
34430 #: ../src/guestfs.pod:671
34432 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
34433 "files, through the library C<hivex> which is part of the libguestfs project "
34434 "although ships as a separate tarball. You have to locate and download the "
34435 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
34436 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
34437 "L<virt-win-reg(1)> for more help on this issue."
34441 #: ../src/guestfs.pod:679
34442 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
34446 #: ../src/guestfs.pod:681
34448 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
34449 "provide something which looks like a Linux symlink. The way it tries to do "
34450 "the rewriting is described here:"
34454 #: ../src/guestfs.pod:685
34455 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
34459 #: ../src/guestfs.pod:687
34461 "The essential problem is that ntfs-3g simply does not have enough "
34462 "information to do a correct job. NTFS links can contain drive letters and "
34463 "references to external device GUIDs that ntfs-3g has no way of resolving. "
34464 "It is almost certainly the case that libguestfs callers should ignore what "
34465 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
34469 #: ../src/guestfs.pod:694
34471 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
34472 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
34473 "attribute, and read the raw reparse data from that (you can find the format "
34474 "documented in various places around the web)."
34478 #: ../src/guestfs.pod:699
34479 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
34483 #: ../src/guestfs.pod:701
34485 "There are other useful extended attributes that can be read from ntfs-3g "
34486 "filesystems (using L</guestfs_getxattr>). See:"
34490 #: ../src/guestfs.pod:704
34491 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
34495 #: ../src/guestfs.pod:706
34496 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
34500 #: ../src/guestfs.pod:708
34502 "Although we don't want to discourage you from using the C API, we will "
34503 "mention here that the same API is also available in other languages."
34507 #: ../src/guestfs.pod:711
34509 "The API is broadly identical in all supported languages. This means that "
34510 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
34511 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
34512 "OCaml. In other words, a straightforward, predictable isomorphism between "
34517 #: ../src/guestfs.pod:717
34519 "Error messages are automatically transformed into exceptions if the language "
34524 #: ../src/guestfs.pod:720
34526 "We don't try to \"object orientify\" parts of the API in OO languages, "
34527 "although contributors are welcome to write higher level APIs above what we "
34528 "provide in their favourite languages if they wish."
34532 #: ../src/guestfs.pod:726
34537 #: ../src/guestfs.pod:728
34539 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
34540 "identical to the C API. C++ classes and exceptions are not used."
34544 #: ../src/guestfs.pod:732
34549 #: ../src/guestfs.pod:734
34551 "The C# bindings are highly experimental. Please read the warnings at the "
34552 "top of C<csharp/Libguestfs.cs>."
34556 #: ../src/guestfs.pod:737
34561 #: ../src/guestfs.pod:739
34562 msgid "See L<guestfs-erlang(3)>."
34566 #: ../src/guestfs.pod:741
34571 #: ../src/guestfs.pod:743
34573 "This is the only language binding that is working but incomplete. Only "
34574 "calls which return simple integers have been bound in Haskell, and we are "
34575 "looking for help to complete this binding."
34579 #: ../src/guestfs.pod:747
34584 #: ../src/guestfs.pod:749
34586 "Full documentation is contained in the Javadoc which is distributed with "
34587 "libguestfs. For examples, see L<guestfs-java(3)>."
34591 #: ../src/guestfs.pod:752
34596 #: ../src/guestfs.pod:754
34597 msgid "See L<guestfs-ocaml(3)>."
34601 #: ../src/guestfs.pod:756
34606 #: ../src/guestfs.pod:758
34607 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
34611 #: ../src/guestfs.pod:760
34616 #: ../src/guestfs.pod:762
34618 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
34619 "the php-libguestfs package for your distribution."
34623 #: ../src/guestfs.pod:765
34624 msgid "The PHP binding only works correctly on 64 bit machines."
34628 #: ../src/guestfs.pod:767
34633 #: ../src/guestfs.pod:769
34634 msgid "See L<guestfs-python(3)>."
34638 #: ../src/guestfs.pod:771
34643 #: ../src/guestfs.pod:773
34644 msgid "See L<guestfs-ruby(3)>."
34648 #: ../src/guestfs.pod:775
34649 msgid "B<shell scripts>"
34653 #: ../src/guestfs.pod:777
34654 msgid "See L<guestfish(1)>."
34658 #: ../src/guestfs.pod:781
34659 msgid "LIBGUESTFS GOTCHAS"
34663 #: ../src/guestfs.pod:783
34665 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
34666 "system [...] that works in the way it is documented but is counterintuitive "
34667 "and almost invites mistakes.\""
34671 #: ../src/guestfs.pod:787
34673 "Since we developed libguestfs and the associated tools, there are several "
34674 "things we would have designed differently, but are now stuck with for "
34675 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
34676 "release, you can expect these to change. Beware of them."
34680 #: ../src/guestfs.pod:795
34681 msgid "Autosync / forgetting to sync."
34685 #: ../src/guestfs.pod:797
34687 "I<Update:> Autosync is enabled by default for all API users starting from "
34688 "libguestfs 1.5.24. This section only applies to older versions."
34692 #: ../src/guestfs.pod:800
34694 "When modifying a filesystem from C or another language, you B<must> unmount "
34695 "all filesystems and call L</guestfs_sync> explicitly before you close the "
34696 "libguestfs handle. You can also call:"
34700 #: ../src/guestfs.pod:804
34703 " guestfs_set_autosync (g, 1);\n"
34708 #: ../src/guestfs.pod:806
34710 "to have the unmount/sync done automatically for you when the handle 'g' is "
34711 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
34716 #: ../src/guestfs.pod:810
34718 "If you forget to do this, then it is entirely possible that your changes "
34719 "won't be written out, or will be partially written, or (very rarely) that "
34720 "you'll get disk corruption."
34724 #: ../src/guestfs.pod:814
34726 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
34727 "guestfish scripts that forget to sync will work just fine, which can make "
34728 "this very puzzling if you are trying to debug a problem."
34732 #: ../src/guestfs.pod:818
34733 msgid "Mount option C<-o sync> should not be the default."
34737 #: ../src/guestfs.pod:820
34739 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
34740 "libguestfs 1.13.16. This section only applies to older versions."
34744 #: ../src/guestfs.pod:823
34746 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
34747 "However C<-o sync> does not add any reliability benefit, but does have a "
34748 "very large performance impact."
34752 #: ../src/guestfs.pod:827
34754 "The work around is to use L</guestfs_mount_options> and set the mount "
34755 "options that you actually want to use."
34759 #: ../src/guestfs.pod:830
34760 msgid "Read-only should be the default."
34764 #: ../src/guestfs.pod:832
34766 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
34767 "specify I<--rw> if you want to make changes to the image."
34771 #: ../src/guestfs.pod:835
34772 msgid "This would reduce the potential to corrupt live VM images."
34776 #: ../src/guestfs.pod:837
34778 "Note that many filesystems change the disk when you just mount and unmount, "
34779 "even if you didn't perform any writes. You need to use "
34780 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
34784 #: ../src/guestfs.pod:841
34785 msgid "guestfish command line is hard to use."
34789 #: ../src/guestfs.pod:843
34791 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
34792 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
34793 "exist, so it fails. In earlier versions of guestfish the error message was "
34794 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
34795 "we should have used C<guestfish -c command> to run commands."
34799 #: ../src/guestfs.pod:850
34800 msgid "guestfish megabyte modifiers don't work right on all commands"
34804 #: ../src/guestfs.pod:852
34806 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
34807 "other modifiers). What guestfish actually does is to multiply the number "
34808 "part by the modifier part and pass the result to the C API. However this "
34809 "doesn't work for a few APIs which aren't expecting bytes, but are already "
34810 "expecting some other unit (eg. megabytes)."
34814 #: ../src/guestfs.pod:859
34815 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
34819 #: ../src/guestfs.pod:861
34822 " lvcreate LV VG 100M\n"
34827 #: ../src/guestfs.pod:863
34829 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
34830 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
34831 "megabytes * megabytes) logical volume. The error message you get from this "
34832 "is also a little obscure."
34836 #: ../src/guestfs.pod:868
34838 "This could be fixed in the generator by specially marking parameters and "
34839 "return values which take bytes or other units."
34843 #: ../src/guestfs.pod:871
34844 msgid "Ambiguity between devices and paths"
34848 #: ../src/guestfs.pod:873
34850 "There is a subtle ambiguity in the API between a device name "
34851 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
34852 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
34856 #: ../src/guestfs.pod:878
34858 "In the current API we usually resolve this ambiguity by having two separate "
34859 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
34860 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
34861 "detecting if the path supplied begins with C</dev/>."
34865 #: ../src/guestfs.pod:884
34867 "To avoid both the ambiguity and the need to duplicate some calls, we could "
34868 "make paths/devices into structured names. One way to do this would be to "
34869 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
34870 "aspect of grub. Another way would be to use a structured type, equivalent "
34871 "to this OCaml type:"
34875 #: ../src/guestfs.pod:890
34878 " type path = Path of string | Device of int | Partition of int * int\n"
34883 #: ../src/guestfs.pod:892
34884 msgid "which would allow you to pass arguments like:"
34888 #: ../src/guestfs.pod:894
34891 " Path \"/foo/bar\"\n"
34892 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
34893 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
34894 " Path \"/dev/sdb2\" (* not a device *)\n"
34899 #: ../src/guestfs.pod:899
34901 "As you can see there are still problems to resolve even with this "
34902 "representation. Also consider how it might work in guestfish."
34906 #: ../src/guestfs.pod:904
34907 msgid "KEYS AND PASSPHRASES"
34911 #: ../src/guestfs.pod:906
34913 "Certain libguestfs calls take a parameter that contains sensitive key "
34914 "material, passed in as a C string."
34918 #: ../src/guestfs.pod:909
34920 "In the future we would hope to change the libguestfs implementation so that "
34921 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
34922 "swap. However this is I<not> done at the moment, because of the complexity "
34923 "of such an implementation."
34927 #: ../src/guestfs.pod:914
34929 "Therefore you should be aware that any key parameter you pass to libguestfs "
34930 "might end up being written out to the swap partition. If this is a concern, "
34931 "scrub the swap partition or don't use libguestfs on encrypted devices."
34935 #: ../src/guestfs.pod:919
34936 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
34940 #: ../src/guestfs.pod:921
34942 "All high-level libguestfs actions are synchronous. If you want to use "
34943 "libguestfs asynchronously then you must create a thread."
34947 #: ../src/guestfs.pod:924
34949 "Only use the handle from a single thread. Either use the handle exclusively "
34950 "from one thread, or provide your own mutex so that two threads cannot issue "
34951 "calls on the same handle at the same time."
34955 #: ../src/guestfs.pod:928
34957 "See the graphical program guestfs-browser for one possible architecture for "
34958 "multithreaded programs using libvirt and libguestfs."
34962 #: ../src/guestfs.pod:931
34967 #: ../src/guestfs.pod:933
34969 "Libguestfs needs a supermin appliance, which it finds by looking along an "
34974 #: ../src/guestfs.pod:936
34976 "By default it looks for these in the directory C<$libdir/guestfs> "
34977 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
34981 #: ../src/guestfs.pod:939
34983 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
34984 "to change the directories that libguestfs will search in. The value is a "
34985 "colon-separated list of paths. The current directory is I<not> searched "
34986 "unless the path contains an empty element or C<.>. For example "
34987 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
34988 "then C</usr/lib/guestfs>."
34992 #: ../src/guestfs.pod:946
34993 msgid "QEMU WRAPPERS"
34997 #: ../src/guestfs.pod:948
34999 "If you want to compile your own qemu, run qemu from a non-standard location, "
35000 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
35005 #: ../src/guestfs.pod:952
35007 "There is one important rule to remember: you I<must C<exec qemu>> as the "
35008 "last command in the shell script (so that qemu replaces the shell and "
35009 "becomes the direct child of the libguestfs-using program). If you don't do "
35010 "this, then the qemu process won't be cleaned up correctly."
35014 #: ../src/guestfs.pod:957
35016 "Here is an example of a wrapper, where I have built my own copy of qemu from "
35021 #: ../src/guestfs.pod:960
35025 " qemudir=/home/rjones/d/qemu\n"
35026 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
35032 #: ../src/guestfs.pod:964
35034 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
35035 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
35040 #: ../src/guestfs.pod:968
35043 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
35048 #: ../src/guestfs.pod:970
35050 "Note that libguestfs also calls qemu with the -help and -version options in "
35051 "order to determine features."
35055 #: ../src/guestfs.pod:973
35057 "Wrappers can also be used to edit the options passed to qemu. In the "
35058 "following example, the C<-machine ...> option (C<-machine> and the following "
35059 "argument) are removed from the command line and replaced with C<-machine "
35060 "pc,accel=tcg>. The while loop iterates over the options until it finds the "
35061 "right one to remove, putting the remaining options into the C<args> array."
35065 #: ../src/guestfs.pod:982
35069 " while [ $# -gt 0 ]; do\n"
35070 " case \"$1\" in\n"
35074 " args[i]=\"$1\"\n"
35083 #: ../src/guestfs.pod:994
35086 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
35091 #: ../src/guestfs.pod:996
35092 msgid "ATTACHING TO RUNNING DAEMONS"
35096 #: ../src/guestfs.pod:998
35098 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
35099 "babies. Use with caution."
35103 #: ../src/guestfs.pod:1001
35105 "I<Note (2):> This section explains how to attach to a running daemon from a "
35106 "low level perspective. For most users, simply using virt tools such as "
35107 "L<guestfish(1)> with the I<--live> option will \"just work\"."
35111 #: ../src/guestfs.pod:1005
35112 msgid "Using guestfs_set_attach_method"
35116 #: ../src/guestfs.pod:1007
35118 "By calling L</guestfs_set_attach_method> you can change how the library "
35119 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
35120 "L</ARCHITECTURE> for some background)."
35124 #: ../src/guestfs.pod:1011
35126 "The normal attach method is C<appliance>, where a small appliance is created "
35127 "containing the daemon, and then the library connects to this."
35131 #: ../src/guestfs.pod:1014
35133 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
35134 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
35135 "daemon over the Unix domain socket."
35139 #: ../src/guestfs.pod:1018
35141 "The normal use for this is to connect to a running virtual machine that "
35142 "contains a C<guestfsd> daemon, and send commands so you can read and write "
35143 "files inside the live virtual machine."
35147 #: ../src/guestfs.pod:1022
35148 msgid "Using guestfs_add_domain with live flag"
35152 #: ../src/guestfs.pod:1024
35154 "L</guestfs_add_domain> provides some help for getting the correct attach "
35155 "method. If you pass the C<live> option to this function, then (if the "
35156 "virtual machine is running) it will examine the libvirt XML looking for a "
35157 "virtio-serial channel to connect to:"
35161 #: ../src/guestfs.pod:1030
35168 " <channel type='unix'>\n"
35169 " <source mode='bind' path='/path/to/socket'/>\n"
35170 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
35179 #: ../src/guestfs.pod:1042
35181 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
35182 "method to C<unix:/path/to/socket>."
35186 #: ../src/guestfs.pod:1045
35188 "Some of the libguestfs tools (including guestfish) support a I<--live> "
35189 "option which is passed through to L</guestfs_add_domain> thus allowing you "
35190 "to attach to and modify live virtual machines."
35194 #: ../src/guestfs.pod:1049
35196 "The virtual machine needs to have been set up beforehand so that it has the "
35197 "virtio-serial channel and so that guestfsd is running inside it."
35201 #: ../src/guestfs.pod:1053
35202 msgid "ABI GUARANTEE"
35206 #: ../src/guestfs.pod:1055
35208 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
35209 "actions as outlined in this section. Although we will deprecate some "
35210 "actions, for example if they get replaced by newer calls, we will keep the "
35211 "old actions forever. This allows you the developer to program in confidence "
35212 "against the libguestfs API."
35216 #: ../src/guestfs.pod:1061
35217 msgid "BLOCK DEVICE NAMING"
35221 #: ../src/guestfs.pod:1063
35223 "In the kernel there is now quite a profusion of schemata for naming block "
35224 "devices (in this context, by I<block device> I mean a physical or virtual "
35225 "hard drive). The original Linux IDE driver used names starting with "
35226 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
35227 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
35228 "replacement for the old IDE driver (particularly for SATA devices) those "
35229 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
35230 "machines with paravirtualized drivers. This has created several different "
35231 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
35236 #: ../src/guestfs.pod:1075
35238 "As discussed above, libguestfs uses a qemu appliance running an embedded "
35239 "Linux kernel to access block devices. We can run a variety of appliances "
35240 "based on a variety of Linux kernels."
35244 #: ../src/guestfs.pod:1079
35246 "This causes a problem for libguestfs because many API calls use device or "
35247 "partition names. Working scripts and the recipe (example) scripts that we "
35248 "make available over the internet could fail if the naming scheme changes."
35252 #: ../src/guestfs.pod:1084
35254 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
35255 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
35256 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
35257 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
35261 #: ../src/guestfs.pod:1090
35263 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
35264 "L</guestfs_list_partitions> and similar calls return the true names of the "
35265 "devices and partitions as known to the appliance."
35269 #: ../src/guestfs.pod:1095
35270 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
35274 #: ../src/guestfs.pod:1097
35276 "Usually this translation is transparent. However in some (very rare) cases "
35277 "you may need to know the exact algorithm. Such cases include where you use "
35278 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
35279 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
35284 #: ../src/guestfs.pod:1103
35286 "The algorithm is applied only to I<parameters> which are known to be either "
35287 "device or partition names. Return values from functions such as "
35288 "L</guestfs_list_devices> are never changed."
35292 #: ../src/guestfs.pod:1111
35293 msgid "Is the string a parameter which is a device or partition name?"
35297 #: ../src/guestfs.pod:1115
35298 msgid "Does the string begin with C</dev/sd>?"
35302 #: ../src/guestfs.pod:1119
35304 "Does the named device exist? If so, we use that device. However if I<not> "
35305 "then we continue with this algorithm."
35309 #: ../src/guestfs.pod:1124
35310 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
35314 #: ../src/guestfs.pod:1126
35315 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
35319 #: ../src/guestfs.pod:1128
35320 msgid "If that named device exists, use it. If not, continue."
35324 #: ../src/guestfs.pod:1132
35325 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
35329 #: ../src/guestfs.pod:1134
35330 msgid "If that named device exists, use it. If not, return an error."
35334 #: ../src/guestfs.pod:1138
35335 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
35339 #: ../src/guestfs.pod:1140
35341 "Although the standard naming scheme and automatic translation is useful for "
35342 "simple programs and guestfish scripts, for larger programs it is best not to "
35343 "rely on this mechanism."
35347 #: ../src/guestfs.pod:1144
35349 "Where possible for maximum future portability programs using libguestfs "
35350 "should use these future-proof techniques:"
35354 #: ../src/guestfs.pod:1151
35356 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
35357 "device names, and then use those names directly."
35361 #: ../src/guestfs.pod:1154
35362 msgid "Since those device names exist by definition, they will never be translated."
35366 #: ../src/guestfs.pod:1159
35368 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
35369 "filesystem labels."
35373 #: ../src/guestfs.pod:1166
35375 "This section discusses security implications of using libguestfs, "
35376 "particularly with untrusted or malicious guests or disk images."
35380 #: ../src/guestfs.pod:1169
35381 msgid "GENERAL SECURITY CONSIDERATIONS"
35385 #: ../src/guestfs.pod:1171
35387 "Be careful with any files or data that you download from a guest (by "
35388 "\"download\" we mean not just the L</guestfs_download> command but any "
35389 "command that reads files, filenames, directories or anything else from a "
35390 "disk image). An attacker could manipulate the data to fool your program "
35391 "into doing the wrong thing. Consider cases such as:"
35395 #: ../src/guestfs.pod:1181
35396 msgid "the data (file etc) not being present"
35400 #: ../src/guestfs.pod:1185
35401 msgid "being present but empty"
35405 #: ../src/guestfs.pod:1189
35406 msgid "being much larger than normal"
35410 #: ../src/guestfs.pod:1193
35411 msgid "containing arbitrary 8 bit data"
35415 #: ../src/guestfs.pod:1197
35416 msgid "being in an unexpected character encoding"
35420 #: ../src/guestfs.pod:1201
35421 msgid "containing homoglyphs."
35425 #: ../src/guestfs.pod:1205
35426 msgid "SECURITY OF MOUNTING FILESYSTEMS"
35430 #: ../src/guestfs.pod:1207
35432 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
35433 "(VFS) module can sometimes be escalated into exploits by deliberately "
35434 "creating a malicious, malformed filesystem. These exploits are very severe "
35435 "for two reasons. Firstly there are very many filesystem drivers in the "
35436 "kernel, and many of them are infrequently used and not much developer "
35437 "attention has been paid to the code. Linux userspace helps potential "
35438 "crackers by detecting the filesystem type and automatically choosing the "
35439 "right VFS driver, even if that filesystem type is obscure or unexpected for "
35440 "the administrator. Secondly, a kernel-level exploit is like a local root "
35441 "exploit (worse in some ways), giving immediate and total access to the "
35442 "system right down to the hardware level."
35446 #: ../src/guestfs.pod:1220
35448 "That explains why you should never mount a filesystem from an untrusted "
35449 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
35450 "inside a qemu virtual machine, usually running as a non-root user. The "
35451 "attacker would need to write a filesystem which first exploited the kernel, "
35452 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
35453 "the libguestfs protocol, and finally to be as serious as the host kernel "
35454 "exploit it would need to escalate its privileges to root. This multi-step "
35455 "escalation, performed by a static piece of data, is thought to be extremely "
35456 "hard to do, although we never say 'never' about security issues."
35460 #: ../src/guestfs.pod:1231
35462 "In any case callers can reduce the attack surface by forcing the filesystem "
35463 "type when mounting (use L</guestfs_mount_vfs>)."
35467 #: ../src/guestfs.pod:1234
35468 msgid "PROTOCOL SECURITY"
35472 #: ../src/guestfs.pod:1236
35474 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
35475 "defined upper message size. However a program that uses libguestfs must "
35476 "also take care - for example you can write a program that downloads a binary "
35477 "from a disk image and executes it locally, and no amount of protocol "
35478 "security will save you from the consequences."
35482 #: ../src/guestfs.pod:1242
35483 msgid "INSPECTION SECURITY"
35487 #: ../src/guestfs.pod:1244
35489 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
35490 "directly from the guest, and these could contain any 8 bit data. Callers "
35491 "should be careful to escape these before printing them to a structured file "
35492 "(for example, use HTML escaping if creating a web page)."
35496 #: ../src/guestfs.pod:1250
35498 "Guest configuration may be altered in unusual ways by the administrator of "
35499 "the virtual machine, and may not reflect reality (particularly for untrusted "
35500 "or actively malicious guests). For example we parse the hostname from "
35501 "configuration files like C</etc/sysconfig/network> that we find in the "
35502 "guest, but the guest administrator can easily manipulate these files to "
35503 "provide the wrong hostname."
35507 #: ../src/guestfs.pod:1258
35509 "The inspection API parses guest configuration using two external libraries: "
35510 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
35511 "designed to be robust in the face of malicious data, although denial of "
35512 "service attacks are still possible, for example with oversized configuration "
35517 #: ../src/guestfs.pod:1264
35518 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
35522 #: ../src/guestfs.pod:1266
35524 "Be very cautious about running commands from the guest. By running a "
35525 "command in the guest, you are giving CPU time to a binary that you do not "
35526 "control, under the same user account as the library, albeit wrapped in qemu "
35527 "virtualization. More information and alternatives can be found in the "
35528 "section L</RUNNING COMMANDS>."
35532 #: ../src/guestfs.pod:1272
35533 msgid "CVE-2010-3851"
35537 #: ../src/guestfs.pod:1274
35538 msgid "https://bugzilla.redhat.com/642934"
35542 #: ../src/guestfs.pod:1276
35544 "This security bug concerns the automatic disk format detection that qemu "
35545 "does on disk images."
35549 #: ../src/guestfs.pod:1279
35551 "A raw disk image is just the raw bytes, there is no header. Other disk "
35552 "images like qcow2 contain a special header. Qemu deals with this by looking "
35553 "for one of the known headers, and if none is found then assuming the disk "
35554 "image must be raw."
35558 #: ../src/guestfs.pod:1284
35560 "This allows a guest which has been given a raw disk image to write some "
35561 "other header. At next boot (or when the disk image is accessed by "
35562 "libguestfs) qemu would do autodetection and think the disk image format was, "
35563 "say, qcow2 based on the header written by the guest."
35567 #: ../src/guestfs.pod:1289
35569 "This in itself would not be a problem, but qcow2 offers many features, one "
35570 "of which is to allow a disk image to refer to another image (called the "
35571 "\"backing disk\"). It does this by placing the path to the backing disk "
35572 "into the qcow2 header. This path is not validated and could point to any "
35573 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
35574 "\"holes\" in the qcow2 disk image, which of course is completely under the "
35575 "control of the attacker."
35579 #: ../src/guestfs.pod:1297
35580 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
35584 #: ../src/guestfs.pod:1304
35585 msgid "You have enabled the network or have opened the disk in write mode."
35589 #: ../src/guestfs.pod:1308
35591 "You are also running untrusted code from the guest (see L</RUNNING "
35596 #: ../src/guestfs.pod:1313
35598 "The way to avoid this is to specify the expected disk format when adding "
35599 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
35600 "should always do this if the disk is raw format, and it's a good idea for "
35605 #: ../src/guestfs.pod:1318
35607 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
35608 "format is fetched from libvirt and passed through."
35612 #: ../src/guestfs.pod:1321
35614 "For libguestfs tools, use the I<--format> command line parameter as "
35619 #: ../src/guestfs.pod:1324
35620 msgid "CONNECTION MANAGEMENT"
35624 #: ../src/guestfs.pod:1326
35625 msgid "guestfs_h *"
35629 #: ../src/guestfs.pod:1328
35631 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
35632 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
35633 "handle and release all resources used."
35637 #: ../src/guestfs.pod:1332
35639 "For information on using multiple handles and threads, see the section "
35640 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
35644 #: ../src/guestfs.pod:1335
35645 msgid "guestfs_create"
35649 #: ../src/guestfs.pod:1337
35652 " guestfs_h *guestfs_create (void);\n"
35657 #: ../src/guestfs.pod:1339
35658 msgid "Create a connection handle."
35662 #: ../src/guestfs.pod:1341
35664 "On success this returns a non-NULL pointer to a handle. On error it returns "
35669 #: ../src/guestfs.pod:1344
35671 "You have to \"configure\" the handle after creating it. This includes "
35672 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
35673 "handle at least once."
35677 #: ../src/guestfs.pod:1348
35678 msgid "After configuring the handle, you have to call L</guestfs_launch>."
35682 #: ../src/guestfs.pod:1350
35684 "You may also want to configure error handling for the handle. See the "
35685 "L</ERROR HANDLING> section below."
35689 #: ../src/guestfs.pod:1353
35690 msgid "guestfs_close"
35694 #: ../src/guestfs.pod:1355
35697 " void guestfs_close (guestfs_h *g);\n"
35702 #: ../src/guestfs.pod:1357
35703 msgid "This closes the connection handle and frees up all resources used."
35707 #: ../src/guestfs.pod:1359
35709 "If autosync was set on the handle and the handle was launched, then this "
35710 "implicitly calls various functions to unmount filesystems and sync the "
35711 "disk. See L</guestfs_set_autosync> for more details."
35715 #: ../src/guestfs.pod:1363
35716 msgid "If a close callback was set on the handle, then it is called."
35720 #: ../src/guestfs.pod:1365
35721 msgid "ERROR HANDLING"
35725 #: ../src/guestfs.pod:1367
35727 "API functions can return errors. For example, almost all functions that "
35728 "return C<int> will return C<-1> to indicate an error."
35732 #: ../src/guestfs.pod:1370
35734 "Additional information is available for errors: an error message string and "
35735 "optionally an error number (errno) if the thing that failed was a system "
35740 #: ../src/guestfs.pod:1374
35742 "You can get at the additional information about the last error on the handle "
35743 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
35744 "up an error handler with L</guestfs_set_error_handler>."
35748 #: ../src/guestfs.pod:1379
35750 "When the handle is created, a default error handler is installed which "
35751 "prints the error message string to C<stderr>. For small short-running "
35752 "command line programs it is sufficient to do:"
35756 #: ../src/guestfs.pod:1383
35759 " if (guestfs_launch (g) == -1)\n"
35760 " exit (EXIT_FAILURE);\n"
35765 #: ../src/guestfs.pod:1386
35767 "since the default error handler will ensure that an error message has been "
35768 "printed to C<stderr> before the program exits."
35772 #: ../src/guestfs.pod:1389
35774 "For other programs the caller will almost certainly want to install an "
35775 "alternate error handler or do error handling in-line like this:"
35779 #: ../src/guestfs.pod:1392
35782 " /* This disables the default behaviour of printing errors\n"
35784 " guestfs_set_error_handler (g, NULL, NULL);\n"
35789 #: ../src/guestfs.pod:1396
35792 " if (guestfs_launch (g) == -1) {\n"
35793 " /* Examine the error message and print it etc. */\n"
35794 " char *msg = guestfs_last_error (g);\n"
35795 " int errnum = guestfs_last_errno (g);\n"
35796 " fprintf (stderr, \"%s\", msg);\n"
35797 " if (errnum != 0)\n"
35798 " fprintf (stderr, \": %s\", strerror (errnum));\n"
35799 " fprintf (stderr, \"\\n\");\n"
35806 #: ../src/guestfs.pod:1407
35808 "Out of memory errors are handled differently. The default action is to call "
35809 "L<abort(3)>. If this is undesirable, then you can set a handler using "
35810 "L</guestfs_set_out_of_memory_handler>."
35814 #: ../src/guestfs.pod:1411
35816 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
35817 "because there is no handle if this happens there is no way to get additional "
35818 "error information. However L</guestfs_create> is supposed to be a "
35819 "lightweight operation which can only fail because of insufficient memory (it "
35820 "returns NULL in this case)."
35824 #: ../src/guestfs.pod:1417
35825 msgid "guestfs_last_error"
35829 #: ../src/guestfs.pod:1419
35832 " const char *guestfs_last_error (guestfs_h *g);\n"
35837 #: ../src/guestfs.pod:1421
35839 "This returns the last error message that happened on C<g>. If there has not "
35840 "been an error since the handle was created, then this returns C<NULL>."
35844 #: ../src/guestfs.pod:1425
35846 "The lifetime of the returned string is until the next error occurs, or "
35847 "L</guestfs_close> is called."
35851 #: ../src/guestfs.pod:1428
35852 msgid "guestfs_last_errno"
35856 #: ../src/guestfs.pod:1430
35859 " int guestfs_last_errno (guestfs_h *g);\n"
35864 #: ../src/guestfs.pod:1432
35865 msgid "This returns the last error number (errno) that happened on C<g>."
35869 #: ../src/guestfs.pod:1434
35870 msgid "If successful, an errno integer not equal to zero is returned."
35874 #: ../src/guestfs.pod:1436
35875 msgid "If no error, this returns 0. This call can return 0 in three situations:"
35879 #: ../src/guestfs.pod:1443
35880 msgid "There has not been any error on the handle."
35884 #: ../src/guestfs.pod:1447
35886 "There has been an error but the errno was meaningless. This corresponds to "
35887 "the case where the error did not come from a failed system call, but for "
35888 "some other reason."
35892 #: ../src/guestfs.pod:1453
35894 "There was an error from a failed system call, but for some reason the errno "
35895 "was not captured and returned. This usually indicates a bug in libguestfs."
35899 #: ../src/guestfs.pod:1459
35901 "Libguestfs tries to convert the errno from inside the applicance into a "
35902 "corresponding errno for the caller (not entirely trivial: the appliance "
35903 "might be running a completely different operating system from the library "
35904 "and error numbers are not standardized across Un*xen). If this could not be "
35905 "done, then the error is translated to C<EINVAL>. In practice this should "
35906 "only happen in very rare circumstances."
35910 #: ../src/guestfs.pod:1467
35911 msgid "guestfs_set_error_handler"
35915 #: ../src/guestfs.pod:1469
35918 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
35920 " const char *msg);\n"
35921 " void guestfs_set_error_handler (guestfs_h *g,\n"
35922 " guestfs_error_handler_cb cb,\n"
35923 " void *opaque);\n"
35928 #: ../src/guestfs.pod:1476
35930 "The callback C<cb> will be called if there is an error. The parameters "
35931 "passed to the callback are an opaque data pointer and the error message "
35936 #: ../src/guestfs.pod:1480
35938 "C<errno> is not passed to the callback. To get that the callback must call "
35939 "L</guestfs_last_errno>."
35943 #: ../src/guestfs.pod:1483
35945 "Note that the message string C<msg> is freed as soon as the callback "
35946 "function returns, so if you want to stash it somewhere you must make your "
35951 #: ../src/guestfs.pod:1487
35952 msgid "The default handler prints messages on C<stderr>."
35956 #: ../src/guestfs.pod:1489
35957 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
35961 #: ../src/guestfs.pod:1491
35962 msgid "guestfs_get_error_handler"
35966 #: ../src/guestfs.pod:1493
35969 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
35970 " void **opaque_rtn);\n"
35975 #: ../src/guestfs.pod:1496
35976 msgid "Returns the current error handler callback."
35980 #: ../src/guestfs.pod:1498
35981 msgid "guestfs_set_out_of_memory_handler"
35985 #: ../src/guestfs.pod:1500
35988 " typedef void (*guestfs_abort_cb) (void);\n"
35989 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
35990 " guestfs_abort_cb);\n"
35995 #: ../src/guestfs.pod:1504
35997 "The callback C<cb> will be called if there is an out of memory situation. "
35998 "I<Note this callback must not return>."
36002 #: ../src/guestfs.pod:1507
36003 msgid "The default is to call L<abort(3)>."
36007 #: ../src/guestfs.pod:1509
36008 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
36012 #: ../src/guestfs.pod:1512
36013 msgid "guestfs_get_out_of_memory_handler"
36017 #: ../src/guestfs.pod:1514
36020 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
36025 #: ../src/guestfs.pod:1516
36026 msgid "This returns the current out of memory handler."
36030 #: ../src/guestfs.pod:1518
36035 #: ../src/guestfs.pod:1522
36040 #: ../src/guestfs.pod:1524
36045 #: ../src/guestfs.pod:1526
36046 msgid "AVAILABILITY"
36050 #: ../src/guestfs.pod:1528
36051 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
36055 #: ../src/guestfs.pod:1530
36057 "Using L</guestfs_available> you can test availability of the following "
36058 "groups of functions. This test queries the appliance to see if the "
36059 "appliance you are currently using supports the functionality."
36063 #: ../src/guestfs.pod:1535
36064 msgid "@AVAILABILITY@"
36068 #: ../src/guestfs.pod:1537
36069 msgid "GUESTFISH supported COMMAND"
36073 #: ../src/guestfs.pod:1539
36075 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
36076 "prints out the available groups and whether they are supported by this build "
36077 "of libguestfs. Note however that you have to do C<run> first."
36081 #: ../src/guestfs.pod:1544
36082 msgid "SINGLE CALLS AT COMPILE TIME"
36086 #: ../src/guestfs.pod:1546
36088 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
36089 "function, such as:"
36093 #: ../src/guestfs.pod:1549
36096 " #define LIBGUESTFS_HAVE_DD 1\n"
36101 #: ../src/guestfs.pod:1551
36102 msgid "if L</guestfs_dd> is available."
36106 #: ../src/guestfs.pod:1553
36108 "Before version 1.5.8, if you needed to test whether a single libguestfs "
36109 "function is available at compile time, we recommended using build tools such "
36110 "as autoconf or cmake. For example in autotools you could use:"
36114 #: ../src/guestfs.pod:1558
36117 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
36118 " AC_CHECK_FUNCS([guestfs_dd])\n"
36123 #: ../src/guestfs.pod:1561
36125 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
36130 #: ../src/guestfs.pod:1564
36131 msgid "SINGLE CALLS AT RUN TIME"
36135 #: ../src/guestfs.pod:1566
36137 "Testing at compile time doesn't guarantee that a function really exists in "
36138 "the library. The reason is that you might be dynamically linked against a "
36139 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
36140 "This situation unfortunately results in a segmentation fault, which is a "
36141 "shortcoming of the C dynamic linking system itself."
36145 #: ../src/guestfs.pod:1573
36147 "You can use L<dlopen(3)> to test if a function is available at run time, as "
36148 "in this example program (note that you still need the compile time check as "
36153 #: ../src/guestfs.pod:1577
36156 " #include <stdio.h>\n"
36157 " #include <stdlib.h>\n"
36158 " #include <unistd.h>\n"
36159 " #include <dlfcn.h>\n"
36160 " #include <guestfs.h>\n"
36165 #: ../src/guestfs.pod:1583
36170 " #ifdef LIBGUESTFS_HAVE_DD\n"
36172 " int has_function;\n"
36177 #: ../src/guestfs.pod:1589
36180 " /* Test if the function guestfs_dd is really available. */\n"
36181 " dl = dlopen (NULL, RTLD_LAZY);\n"
36183 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
36184 " exit (EXIT_FAILURE);\n"
36186 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
36192 #: ../src/guestfs.pod:1598
36195 " if (!has_function)\n"
36196 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
36198 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
36199 " /* Now it's safe to call\n"
36200 " guestfs_dd (g, \"foo\", \"bar\");\n"
36204 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
36211 #: ../src/guestfs.pod:1611
36213 "You may think the above is an awful lot of hassle, and it is. There are "
36214 "other ways outside of the C linking system to ensure that this kind of "
36215 "incompatibility never arises, such as using package versioning:"
36219 #: ../src/guestfs.pod:1616
36222 " Requires: libguestfs >= 1.0.80\n"
36227 #: ../src/guestfs.pod:1618
36228 msgid "CALLS WITH OPTIONAL ARGUMENTS"
36232 #: ../src/guestfs.pod:1620
36234 "A recent feature of the API is the introduction of calls which take optional "
36235 "arguments. In C these are declared 3 ways. The main way is as a call which "
36236 "takes variable arguments (ie. C<...>), as in this example:"
36240 #: ../src/guestfs.pod:1625
36243 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
36248 #: ../src/guestfs.pod:1627
36250 "Call this with a list of optional arguments, terminated by C<-1>. So to "
36251 "call with no optional arguments specified:"
36255 #: ../src/guestfs.pod:1630
36258 " guestfs_add_drive_opts (g, filename, -1);\n"
36263 #: ../src/guestfs.pod:1632
36264 msgid "With a single optional argument:"
36268 #: ../src/guestfs.pod:1634
36271 " guestfs_add_drive_opts (g, filename,\n"
36272 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36278 #: ../src/guestfs.pod:1638
36283 #: ../src/guestfs.pod:1640
36286 " guestfs_add_drive_opts (g, filename,\n"
36287 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36288 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
36294 #: ../src/guestfs.pod:1645
36296 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
36301 #: ../src/guestfs.pod:1648
36302 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
36306 #: ../src/guestfs.pod:1650
36308 "The second variant has the same name with the suffix C<_va>, which works the "
36309 "same way but takes a C<va_list>. See the C manual for details. For the "
36310 "example function, this is declared:"
36314 #: ../src/guestfs.pod:1654
36317 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
36318 " va_list args);\n"
36323 #: ../src/guestfs.pod:1657
36324 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
36328 #: ../src/guestfs.pod:1659
36330 "The third variant is useful where you need to construct these calls. You "
36331 "pass in a structure where you fill in the optional fields. The structure "
36332 "has a bitmask as the first element which you must set to indicate which "
36333 "fields you have filled in. For our example function the structure and call "
36338 #: ../src/guestfs.pod:1665
36341 " struct guestfs_add_drive_opts_argv {\n"
36342 " uint64_t bitmask;\n"
36344 " const char *format;\n"
36347 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
36348 " const struct guestfs_add_drive_opts_argv *optargs);\n"
36353 #: ../src/guestfs.pod:1674
36354 msgid "You could call it like this:"
36358 #: ../src/guestfs.pod:1676
36361 " struct guestfs_add_drive_opts_argv optargs = {\n"
36362 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
36363 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
36364 " .readonly = 1,\n"
36365 " .format = \"qcow2\"\n"
36371 #: ../src/guestfs.pod:1683
36374 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
36379 #: ../src/guestfs.pod:1691
36380 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
36384 #: ../src/guestfs.pod:1696
36385 msgid "You do not need to fill in all fields of the structure."
36389 #: ../src/guestfs.pod:1700
36391 "There must be a one-to-one correspondence between fields of the structure "
36392 "that are filled in, and bits set in the bitmask."
36396 #: ../src/guestfs.pod:1705
36397 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
36401 #: ../src/guestfs.pod:1707
36403 "In other languages, optional arguments are expressed in the way that is "
36404 "natural for that language. We refer you to the language-specific "
36405 "documentation for more details on that."
36409 #: ../src/guestfs.pod:1711
36410 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
36414 #: ../src/guestfs.pod:1713
36415 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
36419 #: ../src/guestfs.pod:1715
36421 "B<Note:> This section documents the generic event mechanism introduced in "
36422 "libguestfs 1.10, which you should use in new code if possible. The old "
36423 "functions C<guestfs_set_log_message_callback>, "
36424 "C<guestfs_set_subprocess_quit_callback>, "
36425 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
36426 "C<guestfs_set_progress_callback> are no longer documented in this manual "
36427 "page. Because of the ABI guarantee, the old functions continue to work."
36431 #: ../src/guestfs.pod:1724
36433 "Handles generate events when certain things happen, such as log messages "
36434 "being generated, progress messages during long-running operations, or the "
36435 "handle being closed. The API calls described below let you register a "
36436 "callback to be called when events happen. You can register multiple "
36437 "callbacks (for the same, different or overlapping sets of events), and "
36438 "individually remove callbacks. If callbacks are not removed, then they "
36439 "remain in force until the handle is closed."
36443 #: ../src/guestfs.pod:1732
36445 "In the current implementation, events are only generated synchronously: that "
36446 "means that events (and hence callbacks) can only happen while you are in the "
36447 "middle of making another libguestfs call. The callback is called in the "
36452 #: ../src/guestfs.pod:1737
36454 "Events may contain a payload, usually nothing (void), an array of 64 bit "
36455 "unsigned integers, or a message buffer. Payloads are discussed later on."
36459 #: ../src/guestfs.pod:1741
36460 msgid "CLASSES OF EVENTS"
36464 #: ../src/guestfs.pod:1745
36465 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
36469 #: ../src/guestfs.pod:1748
36471 "The callback function will be called while the handle is being closed "
36472 "(synchronously from L</guestfs_close>)."
36476 #: ../src/guestfs.pod:1751
36478 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
36479 "handles that are open when the program exits. This means that this callback "
36480 "might be called indirectly from L<exit(3)>, which can cause unexpected "
36481 "problems in higher-level languages (eg. if your HLL interpreter has already "
36482 "been cleaned up by the time this is called, and if your callback then jumps "
36483 "into some HLL function)."
36487 #: ../src/guestfs.pod:1758
36489 "If no callback is registered: the handle is closed without any callback "
36494 #: ../src/guestfs.pod:1761
36495 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
36499 #: ../src/guestfs.pod:1764
36501 "The callback function will be called when the child process quits, either "
36502 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
36503 "corresponds to a transition from any state to the CONFIG state)."
36507 #: ../src/guestfs.pod:1768 ../src/guestfs.pod:1777 ../src/guestfs.pod:1894
36508 msgid "If no callback is registered: the event is ignored."
36512 #: ../src/guestfs.pod:1770
36513 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
36517 #: ../src/guestfs.pod:1773
36519 "The callback function will be called when the child process becomes ready "
36520 "first time after it has been launched. (This corresponds to a transition "
36521 "from LAUNCHING to the READY state)."
36525 #: ../src/guestfs.pod:1779
36526 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
36530 #: ../src/guestfs.pod:1782
36532 "Some long-running operations can generate progress messages. If this "
36533 "callback is registered, then it will be called each time a progress message "
36534 "is generated (usually two seconds after the operation started, and three "
36535 "times per second thereafter until it completes, although the frequency may "
36536 "change in future versions)."
36540 #: ../src/guestfs.pod:1788
36542 "The callback receives in the payload four unsigned 64 bit numbers which are "
36543 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
36547 #: ../src/guestfs.pod:1791
36549 "The units of C<total> are not defined, although for some operations C<total> "
36550 "may relate in some way to the amount of data to be transferred (eg. in bytes "
36551 "or megabytes), and C<position> may be the portion which has been "
36556 #: ../src/guestfs.pod:1796
36557 msgid "The only defined and stable parts of the API are:"
36561 #: ../src/guestfs.pod:1802
36563 "The callback can display to the user some type of progress bar or indicator "
36564 "which shows the ratio of C<position>:C<total>."
36568 #: ../src/guestfs.pod:1807
36569 msgid "0 E<lt>= C<position> E<lt>= C<total>"
36573 #: ../src/guestfs.pod:1811
36575 "If any progress notification is sent during a call, then a final progress "
36576 "notification is always sent when C<position> = C<total> (I<unless> the call "
36577 "fails with an error)."
36581 #: ../src/guestfs.pod:1815
36583 "This is to simplify caller code, so callers can easily set the progress "
36584 "indicator to \"100%\" at the end of the operation, without requiring special "
36585 "code to detect this case."
36589 #: ../src/guestfs.pod:1821
36591 "For some calls we are unable to estimate the progress of the call, but we "
36592 "can still generate progress messages to indicate activity. This is known as "
36593 "\"pulse mode\", and is directly supported by certain progress bar "
36594 "implementations (eg. GtkProgressBar)."
36598 #: ../src/guestfs.pod:1826
36600 "For these calls, zero or more progress messages are generated with "
36601 "C<position = 0> and C<total = 1>, followed by a final message with "
36602 "C<position = total = 1>."
36606 #: ../src/guestfs.pod:1830
36608 "As noted above, if the call fails with an error then the final message may "
36609 "not be generated."
36613 #: ../src/guestfs.pod:1835
36615 "The callback also receives the procedure number (C<proc_nr>) and serial "
36616 "number (C<serial>) of the call. These are only useful for debugging "
36617 "protocol issues, and the callback can normally ignore them. The callback "
36618 "may want to print these numbers in error messages or debugging messages."
36622 #: ../src/guestfs.pod:1841
36623 msgid "If no callback is registered: progress messages are discarded."
36627 #: ../src/guestfs.pod:1843
36628 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
36632 #: ../src/guestfs.pod:1846
36634 "The callback function is called whenever a log message is generated by qemu, "
36635 "the appliance kernel, guestfsd (daemon), or utility programs."
36639 #: ../src/guestfs.pod:1849
36641 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
36642 "(L</guestfs_launch>) then additional debug messages are generated."
36646 #: ../src/guestfs.pod:1852 ../src/guestfs.pod:1866
36648 "If no callback is registered: the messages are discarded unless the verbose "
36649 "flag is set in which case they are sent to stderr. You can override the "
36650 "printing of verbose messages to stderr by setting up a callback."
36654 #: ../src/guestfs.pod:1857
36655 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
36659 #: ../src/guestfs.pod:1860
36661 "The callback function is called whenever a log message is generated by the "
36662 "library part of libguestfs."
36666 #: ../src/guestfs.pod:1863
36668 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
36669 "messages are generated."
36673 #: ../src/guestfs.pod:1871
36674 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
36678 #: ../src/guestfs.pod:1874
36680 "The callback function is called whenever a trace message is generated. This "
36681 "only applies if the trace flag (L</guestfs_set_trace>) is set."
36685 #: ../src/guestfs.pod:1877
36687 "If no callback is registered: the messages are sent to stderr. You can "
36688 "override the printing of trace messages to stderr by setting up a callback."
36692 #: ../src/guestfs.pod:1881
36693 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
36697 #: ../src/guestfs.pod:1884
36698 msgid "The callback function is called whenever a libguestfs function is entered."
36702 #: ../src/guestfs.pod:1887
36704 "The payload is a string which contains the name of the function that we are "
36705 "entering (not including C<guestfs_> prefix)."
36709 #: ../src/guestfs.pod:1890
36711 "Note that libguestfs functions can call themselves, so you may see many "
36712 "events from a single call. A few libguestfs functions do not generate this "
36717 #: ../src/guestfs.pod:1898
36718 msgid "guestfs_set_event_callback"
36722 #: ../src/guestfs.pod:1900
36725 " int guestfs_set_event_callback (guestfs_h *g,\n"
36726 " guestfs_event_callback cb,\n"
36727 " uint64_t event_bitmask,\n"
36729 " void *opaque);\n"
36734 #: ../src/guestfs.pod:1906
36736 "This function registers a callback (C<cb>) for all event classes in the "
36737 "C<event_bitmask>."
36741 #: ../src/guestfs.pod:1909
36743 "For example, to register for all log message events, you could call this "
36744 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
36745 "To register a single callback for all possible classes of events, use "
36746 "C<GUESTFS_EVENT_ALL>."
36750 #: ../src/guestfs.pod:1915
36751 msgid "C<flags> should always be passed as 0."
36755 #: ../src/guestfs.pod:1917
36757 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
36758 "it for any purpose."
36762 #: ../src/guestfs.pod:1920
36764 "The return value is the event handle (an integer) which you can use to "
36765 "delete the callback (see below)."
36769 #: ../src/guestfs.pod:1923
36771 "If there is an error, this function returns C<-1>, and sets the error in the "
36772 "handle in the usual way (see L</guestfs_last_error> etc.)"
36776 #: ../src/guestfs.pod:1926
36778 "Callbacks remain in effect until they are deleted, or until the handle is "
36783 #: ../src/guestfs.pod:1929
36785 "In the case where multiple callbacks are registered for a particular event "
36786 "class, all of the callbacks are called. The order in which multiple "
36787 "callbacks are called is not defined."
36791 #: ../src/guestfs.pod:1933
36792 msgid "guestfs_delete_event_callback"
36796 #: ../src/guestfs.pod:1935
36799 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
36804 #: ../src/guestfs.pod:1937
36806 "Delete a callback that was previously registered. C<event_handle> should be "
36807 "the integer that was returned by a previous call to "
36808 "C<guestfs_set_event_callback> on the same handle."
36812 #: ../src/guestfs.pod:1941
36813 msgid "guestfs_event_callback"
36817 #: ../src/guestfs.pod:1943
36820 " typedef void (*guestfs_event_callback) (\n"
36823 " uint64_t event,\n"
36824 " int event_handle,\n"
36826 " const char *buf, size_t buf_len,\n"
36827 " const uint64_t *array, size_t array_len);\n"
36832 #: ../src/guestfs.pod:1952
36833 msgid "This is the type of the event callback function that you have to provide."
36837 #: ../src/guestfs.pod:1955
36839 "The basic parameters are: the handle (C<g>), the opaque user pointer "
36840 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
36841 "handle, and C<flags> which in the current API you should ignore."
36845 #: ../src/guestfs.pod:1959
36847 "The remaining parameters contain the event payload (if any). Each event may "
36848 "contain a payload, which usually relates to the event class, but for future "
36849 "proofing your code should be written to handle any payload for any event "
36854 #: ../src/guestfs.pod:1964
36856 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
36857 "there is no message buffer). Note that this message buffer can contain "
36858 "arbitrary 8 bit data, including NUL bytes."
36862 #: ../src/guestfs.pod:1968
36864 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
36865 "moment this is only used for progress messages."
36869 #: ../src/guestfs.pod:1971
36870 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
36874 #: ../src/guestfs.pod:1973
36876 "One motivation for the generic event API was to allow GUI programs to "
36877 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
36878 "unconditionally to C<stderr>."
36882 #: ../src/guestfs.pod:1977
36884 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
36885 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
36886 "messages are not events; you must capture error messages separately)."
36890 #: ../src/guestfs.pod:1982
36892 "Programs have to set up a callback to capture the classes of events of "
36897 #: ../src/guestfs.pod:1985
36901 " guestfs_set_event_callback\n"
36902 " (g, message_callback,\n"
36903 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
36904 " GUESTFS_EVENT_TRACE,\n"
36905 " 0, NULL) == -1)\n"
36906 " if (eh == -1) {\n"
36907 " // handle error in the usual way\n"
36913 #: ../src/guestfs.pod:1995
36915 "The callback can then direct messages to the appropriate place. In this "
36916 "example, messages are directed to syslog:"
36920 #: ../src/guestfs.pod:1998
36924 " message_callback (\n"
36927 " uint64_t event,\n"
36928 " int event_handle,\n"
36930 " const char *buf, size_t buf_len,\n"
36931 " const uint64_t *array, size_t array_len)\n"
36933 " const int priority = LOG_USER|LOG_INFO;\n"
36934 " if (buf_len > 0)\n"
36935 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
36941 #: ../src/guestfs.pod:2013
36942 msgid "CANCELLING LONG TRANSFERS"
36946 #: ../src/guestfs.pod:2015
36948 "Some operations can be cancelled by the caller while they are in progress. "
36949 "Currently only operations that involve uploading or downloading data can be "
36950 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
36951 "parameters in the generator)."
36955 #: ../src/guestfs.pod:2020
36956 msgid "guestfs_user_cancel"
36960 #: ../src/guestfs.pod:2022
36963 " void guestfs_user_cancel (guestfs_h *g);\n"
36968 #: ../src/guestfs.pod:2024
36969 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
36973 #: ../src/guestfs.pod:2027
36975 "Unlike most other libguestfs calls, this function is signal safe and thread "
36976 "safe. You can call it from a signal handler or from another thread, without "
36977 "needing to do any locking."
36981 #: ../src/guestfs.pod:2031
36983 "The transfer that was in progress (if there is one) will stop shortly "
36984 "afterwards, and will return an error. The errno (see "
36985 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
36986 "out if the operation was cancelled or failed because of another error."
36990 #: ../src/guestfs.pod:2037
36992 "No cleanup is performed: for example, if a file was being uploaded then "
36993 "after cancellation there may be a partially uploaded file. It is the "
36994 "caller's responsibility to clean up if necessary."
36998 #: ../src/guestfs.pod:2041
36999 msgid "There are two common places that you might call C<guestfs_user_cancel>."
37003 #: ../src/guestfs.pod:2043
37005 "In an interactive text-based program, you might call it from a C<SIGINT> "
37006 "signal handler so that pressing C<^C> cancels the current operation. (You "
37007 "also need to call L</guestfs_set_pgroup> so that child processes don't "
37008 "receive the C<^C> signal)."
37012 #: ../src/guestfs.pod:2048
37014 "In a graphical program, when the main thread is displaying a progress bar "
37015 "with a cancel button, wire up the cancel button to call this function."
37019 #: ../src/guestfs.pod:2052
37020 msgid "PRIVATE DATA AREA"
37024 #: ../src/guestfs.pod:2054
37026 "You can attach named pieces of private data to the libguestfs handle, fetch "
37027 "them by name, and walk over them, for the lifetime of the handle. This is "
37028 "called the private data area and is only available from the C API."
37032 #: ../src/guestfs.pod:2059
37033 msgid "To attach a named piece of data, use the following call:"
37037 #: ../src/guestfs.pod:2061
37040 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
37045 #: ../src/guestfs.pod:2063
37047 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
37048 "pointer (which can be C<NULL>). Any previous item with the same key is "
37053 #: ../src/guestfs.pod:2067
37055 "You can use any C<key> you want, but your key should I<not> start with an "
37056 "underscore character. Keys beginning with an underscore character are "
37057 "reserved for internal libguestfs purposes (eg. for implementing language "
37058 "bindings). It is recommended that you prefix the key with some unique "
37059 "string to avoid collisions with other users."
37063 #: ../src/guestfs.pod:2073
37064 msgid "To retrieve the pointer, use:"
37068 #: ../src/guestfs.pod:2075
37071 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
37076 #: ../src/guestfs.pod:2077
37078 "This function returns C<NULL> if either no data is found associated with "
37079 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
37084 #: ../src/guestfs.pod:2081
37086 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
37087 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
37088 "all. In particular, libguestfs does I<not> try to free the data when the "
37089 "handle is closed. If the data must be freed, then the caller must either "
37090 "free it before calling L</guestfs_close> or must set up a close callback to "
37091 "do it (see L</GUESTFS_EVENT_CLOSE>)."
37095 #: ../src/guestfs.pod:2088
37096 msgid "To walk over all entries, use these two functions:"
37100 #: ../src/guestfs.pod:2090
37103 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
37108 #: ../src/guestfs.pod:2092
37111 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
37116 #: ../src/guestfs.pod:2094
37118 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
37119 "not have any particular meaning -- keys are not returned in any defined "
37120 "order). A pointer to the key is returned in C<*key_rtn> and the "
37121 "corresponding data pointer is returned from the function. C<NULL> is "
37122 "returned if there are no keys stored in the handle."
37126 #: ../src/guestfs.pod:2100
37128 "C<guestfs_next_private> returns the next key, pointer pair. The return "
37129 "value of this function is also C<NULL> is there are no further entries to "
37134 #: ../src/guestfs.pod:2104
37135 msgid "Notes about walking over entries:"
37139 #: ../src/guestfs.pod:2110
37140 msgid "You must not call C<guestfs_set_private> while walking over the entries."
37144 #: ../src/guestfs.pod:2115
37146 "The handle maintains an internal iterator which is reset when you call "
37147 "C<guestfs_first_private>. This internal iterator is invalidated when you "
37148 "call C<guestfs_set_private>."
37152 #: ../src/guestfs.pod:2121
37153 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
37157 #: ../src/guestfs.pod:2123
37160 " guestfs_set_private (g, key, NULL);\n"
37165 #: ../src/guestfs.pod:2125
37166 msgid "then that C<key> is not returned when walking."
37170 #: ../src/guestfs.pod:2129
37172 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
37173 "C<guestfs_next_private> or C<guestfs_set_private>."
37177 #: ../src/guestfs.pod:2135
37179 "The following example code shows how to print all keys and data pointers "
37180 "that are associated with the handle C<g>:"
37184 #: ../src/guestfs.pod:2138
37187 " const char *key;\n"
37188 " void *data = guestfs_first_private (g, &key);\n"
37189 " while (data != NULL)\n"
37191 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37192 " data = guestfs_next_private (g, &key);\n"
37198 #: ../src/guestfs.pod:2146
37200 "More commonly you are only interested in keys that begin with an "
37201 "application-specific prefix C<foo_>. Modify the loop like so:"
37205 #: ../src/guestfs.pod:2149
37208 " const char *key;\n"
37209 " void *data = guestfs_first_private (g, &key);\n"
37210 " while (data != NULL)\n"
37212 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37213 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37214 " data = guestfs_next_private (g, &key);\n"
37220 #: ../src/guestfs.pod:2158
37222 "If you need to modify keys while walking, then you have to jump back to the "
37223 "beginning of the loop. For example, to delete all keys prefixed with "
37228 #: ../src/guestfs.pod:2162
37231 " const char *key;\n"
37234 " data = guestfs_first_private (g, &key);\n"
37235 " while (data != NULL)\n"
37237 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37239 " guestfs_set_private (g, key, NULL);\n"
37240 " /* note that 'key' pointer is now invalid, and so is\n"
37241 " the internal iterator */\n"
37244 " data = guestfs_next_private (g, &key);\n"
37250 #: ../src/guestfs.pod:2178
37252 "Note that the above loop is guaranteed to terminate because the keys are "
37253 "being deleted, but other manipulations of keys within the loop might not "
37254 "terminate unless you also maintain an indication of which keys have been "
37259 #: ../src/guestfs.pod:2183
37264 #: ../src/guestfs.pod:2185
37266 "The libguestfs C library can be probed using systemtap or DTrace. This is "
37267 "true of any library, not just libguestfs. However libguestfs also contains "
37268 "static markers to help in probing internal operations."
37272 #: ../src/guestfs.pod:2189
37273 msgid "You can list all the static markers by doing:"
37277 #: ../src/guestfs.pod:2191
37280 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
37281 " .provider(\"guestfs\").mark(\"*\")'\n"
37286 #: ../src/guestfs.pod:2194
37288 "B<Note:> These static markers are I<not> part of the stable API and may "
37289 "change in future versions."
37293 #: ../src/guestfs.pod:2197
37294 msgid "SYSTEMTAP SCRIPT EXAMPLE"
37298 #: ../src/guestfs.pod:2199
37300 "This script contains examples of displaying both the static markers and some "
37301 "ordinary C entry points:"
37305 #: ../src/guestfs.pod:2202
37313 #: ../src/guestfs.pod:2204
37316 " function display_time () {\n"
37317 " now = gettimeofday_us ();\n"
37320 " delta = now - last;\n"
37326 #: ../src/guestfs.pod:2211
37329 " printf (\"%d (+%d):\", now, delta);\n"
37335 #: ../src/guestfs.pod:2214
37340 " printf (\"ready\\n\");\n"
37346 #: ../src/guestfs.pod:2219
37349 " /* Display all calls to static markers. */\n"
37350 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37351 " .provider(\"guestfs\").mark(\"*\") ? {\n"
37352 " display_time();\n"
37353 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
37359 #: ../src/guestfs.pod:2226
37362 " /* Display all calls to guestfs_mkfs* functions. */\n"
37363 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37364 " .function(\"guestfs_mkfs*\") ? {\n"
37365 " display_time();\n"
37366 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
37372 #: ../src/guestfs.pod:2233
37374 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
37375 "program. Note that you either have to be root, or you have to add yourself "
37376 "to several special stap groups. Consult the systemtap documentation for "
37377 "more information."
37381 #: ../src/guestfs.pod:2238
37384 " # stap /tmp/test.stap\n"
37390 #: ../src/guestfs.pod:2241
37391 msgid "In another terminal, run a guestfish command such as this:"
37395 #: ../src/guestfs.pod:2245
37396 msgid "In the first terminal, stap trace output similar to this is shown:"
37400 #: ../src/guestfs.pod:2247
37403 " 1318248056692655 (+0):\tlaunch_start\n"
37404 " 1318248056692850 (+195): launch_build_appliance_start\n"
37405 " 1318248056818285 (+125435): launch_build_appliance_end\n"
37406 " 1318248056838059 (+19774): launch_run_qemu\n"
37407 " 1318248061071167 (+4233108): launch_end\n"
37408 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f "
37409 "device=0x1024e60\n"
37414 #: ../src/guestfs.pod:2254 ../src/guestfs.pod:2259
37419 #: ../src/guestfs.pod:2256
37421 "<!-- old anchor for the next section --> <a "
37422 "name=\"state_machine_and_low_level_event_api\"/>"
37426 #: ../src/guestfs.pod:2261
37427 msgid "ARCHITECTURE"
37431 #: ../src/guestfs.pod:2263
37433 "Internally, libguestfs is implemented by running an appliance (a special "
37434 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
37435 "process of the main program."
37439 #: ../src/guestfs.pod:2267
37442 " ___________________\n"
37444 " | main program |\n"
37446 " | | child process / appliance\n"
37447 " | | __________________________\n"
37449 " +-------------------+ RPC | +-----------------+ |\n"
37450 " | libguestfs <--------------------> guestfsd | |\n"
37451 " | | | +-----------------+ |\n"
37452 " \\___________________/ | | Linux kernel | |\n"
37453 " | +--^--------------+ |\n"
37454 " \\_________|________________/\n"
37456 " _______v______\n"
37459 " | disk image |\n"
37460 " \\______________/\n"
37465 #: ../src/guestfs.pod:2287
37467 "The library, linked to the main program, creates the child process and hence "
37468 "the appliance in the L</guestfs_launch> function."
37472 #: ../src/guestfs.pod:2290
37474 "Inside the appliance is a Linux kernel and a complete stack of userspace "
37475 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
37476 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
37477 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
37478 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
37479 "attached to the qemu process which translates device access by the "
37480 "appliance's Linux kernel into accesses to the image."
37484 #: ../src/guestfs.pod:2299
37486 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
37487 "Although the disk image you are attached to might also be used by some "
37488 "virtual machine, libguestfs doesn't know or care about this. (But you will "
37489 "care if both libguestfs's qemu process and your virtual machine are trying "
37490 "to update the disk image at the same time, since these usually results in "
37491 "massive disk corruption)."
37495 #: ../src/guestfs.pod:2306
37496 msgid "STATE MACHINE"
37500 #: ../src/guestfs.pod:2308
37501 msgid "libguestfs uses a state machine to model the child process:"
37505 #: ../src/guestfs.pod:2310
37509 " guestfs_create\n"
37517 " / | \\ \\ guestfs_launch\n"
37518 " / | _\\__V______\n"
37520 " / | | LAUNCHING |\n"
37521 " / | \\___________/\n"
37523 " / | guestfs_launch\n"
37525 " ______ / __|____V\n"
37526 " / \\ ------> / \\\n"
37527 " | BUSY | | READY |\n"
37528 " \\______/ <------ \\________/\n"
37533 #: ../src/guestfs.pod:2332
37535 "The normal transitions are (1) CONFIG (when the handle is created, but there "
37536 "is no child process), (2) LAUNCHING (when the child process is booting up), "
37537 "(3) alternating between READY and BUSY as commands are issued to, and "
37538 "carried out by, the child process."
37542 #: ../src/guestfs.pod:2337
37544 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
37545 "asynchronously at any time (eg. due to some internal error), and that causes "
37546 "the state to transition back to CONFIG."
37550 #: ../src/guestfs.pod:2341
37552 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
37553 "issued when in the CONFIG state."
37557 #: ../src/guestfs.pod:2344
37559 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
37560 "L</guestfs_launch> blocks until the child process is READY to accept "
37561 "commands (or until some failure or timeout). L</guestfs_launch> internally "
37562 "moves the state from CONFIG to LAUNCHING while it is running."
37566 #: ../src/guestfs.pod:2350
37568 "API actions such as L</guestfs_mount> can only be issued when in the READY "
37569 "state. These API calls block waiting for the command to be carried out "
37570 "(ie. the state to transition to BUSY and then back to READY). There are no "
37571 "non-blocking versions, and no way to issue more than one command per handle "
37572 "at the same time."
37576 #: ../src/guestfs.pod:2356
37578 "Finally, the child process sends asynchronous messages back to the main "
37579 "program, such as kernel log messages. You can register a callback to "
37580 "receive these messages."
37584 #: ../src/guestfs.pod:2360
37589 #: ../src/guestfs.pod:2362
37590 msgid "APPLIANCE BOOT PROCESS"
37594 #: ../src/guestfs.pod:2364
37596 "This process has evolved and continues to evolve. The description here "
37597 "corresponds only to the current version of libguestfs and is provided for "
37598 "information only."
37602 #: ../src/guestfs.pod:2368
37604 "In order to follow the stages involved below, enable libguestfs debugging "
37605 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
37609 #: ../src/guestfs.pod:2373
37610 msgid "Create the appliance"
37614 #: ../src/guestfs.pod:2375
37616 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
37617 "initrd and the appliance."
37621 #: ../src/guestfs.pod:2378
37623 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
37624 "directory if C<TMPDIR> is set)."
37628 #: ../src/guestfs.pod:2381
37630 "For a complete description of how the appliance is created and cached, read "
37631 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
37635 #: ../src/guestfs.pod:2385
37636 msgid "Start qemu and boot the kernel"
37640 #: ../src/guestfs.pod:2387
37641 msgid "qemu is invoked to boot the kernel."
37645 #: ../src/guestfs.pod:2389
37646 msgid "Run the initrd"
37650 #: ../src/guestfs.pod:2391
37652 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
37653 "appliance. The purpose of the initrd is to load enough kernel modules in "
37654 "order that the appliance itself can be mounted and started."
37658 #: ../src/guestfs.pod:2395
37660 "The initrd is a cpio archive called "
37661 "C</var/tmp/.guestfs-E<lt>UIDE<gt>/initrd>."
37665 #: ../src/guestfs.pod:2398
37667 "When the initrd has started you will see messages showing that kernel "
37668 "modules are being loaded, similar to this:"
37672 #: ../src/guestfs.pod:2401
37675 " febootstrap: ext2 mini initrd starting up\n"
37676 " febootstrap: mounting /sys\n"
37677 " febootstrap: internal insmod libcrc32c.ko\n"
37678 " febootstrap: internal insmod crc32c-intel.ko\n"
37683 #: ../src/guestfs.pod:2406
37684 msgid "Find and mount the appliance device"
37688 #: ../src/guestfs.pod:2408
37690 "The appliance is a sparse file containing an ext2 filesystem which contains "
37691 "a familiar (although reduced in size) Linux operating system. It would "
37692 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
37696 #: ../src/guestfs.pod:2412
37698 "The regular disks being inspected by libguestfs are the first devices "
37699 "exposed by qemu (eg. as C</dev/vda>)."
37703 #: ../src/guestfs.pod:2415
37705 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
37706 "there was only one regular disk)."
37710 #: ../src/guestfs.pod:2418
37712 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
37713 "and switch root into the appliance, and run C</init> from the appliance."
37717 #: ../src/guestfs.pod:2422
37718 msgid "If this works successfully you will see messages such as:"
37722 #: ../src/guestfs.pod:2424
37725 " febootstrap: picked /sys/block/vdb/dev as root device\n"
37726 " febootstrap: creating /dev/root as block special 252:16\n"
37727 " febootstrap: mounting new root on /root\n"
37728 " febootstrap: chroot\n"
37729 " Starting /init script ...\n"
37734 #: ../src/guestfs.pod:2430
37736 "Note that C<Starting /init script ...> indicates that the appliance's init "
37737 "script is now running."
37741 #: ../src/guestfs.pod:2433
37742 msgid "Initialize the appliance"
37746 #: ../src/guestfs.pod:2435
37748 "The appliance itself now initializes itself. This involves starting certain "
37749 "processes like C<udev>, possibly printing some debug information, and "
37750 "finally running the daemon (C<guestfsd>)."
37754 #: ../src/guestfs.pod:2439
37759 #: ../src/guestfs.pod:2441
37761 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
37766 #: ../src/guestfs.pod:2444
37769 " verbose daemon enabled\n"
37774 #: ../src/guestfs.pod:2446
37776 "The daemon expects to see a named virtio-serial port exposed by qemu and "
37777 "connected on the other end to the library."
37781 #: ../src/guestfs.pod:2449
37783 "The daemon connects to this port (and hence to the library) and sends a four "
37784 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
37785 "protocol (see below)."
37789 #: ../src/guestfs.pod:2455
37790 msgid "COMMUNICATION PROTOCOL"
37794 #: ../src/guestfs.pod:2457
37796 "Don't rely on using this protocol directly. This section documents how it "
37797 "currently works, but it may change at any time."
37801 #: ../src/guestfs.pod:2460
37803 "The protocol used to talk between the library and the daemon running inside "
37804 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
37805 "1014, RFC 1832, RFC 4506)."
37809 #: ../src/guestfs.pod:2464
37811 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
37812 "this file is automatically generated)."
37816 #: ../src/guestfs.pod:2467
37818 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
37819 "and C<FileOut> parameters, which are handled with very simple request/reply "
37820 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
37821 "parameters, which use the same request and reply messages, but they may also "
37822 "be followed by files sent using a chunked encoding."
37826 #: ../src/guestfs.pod:2474
37827 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
37831 #: ../src/guestfs.pod:2476
37832 msgid "For ordinary functions, the request message is:"
37836 #: ../src/guestfs.pod:2478
37839 " total length (header + arguments,\n"
37840 " but not including the length word itself)\n"
37841 " struct guestfs_message_header (encoded as XDR)\n"
37842 " struct guestfs_<foo>_args (encoded as XDR)\n"
37847 #: ../src/guestfs.pod:2483
37849 "The total length field allows the daemon to allocate a fixed size buffer "
37850 "into which it slurps the rest of the message. As a result, the total length "
37851 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
37852 "effective size of any request is limited to somewhere under this size."
37856 #: ../src/guestfs.pod:2489
37858 "Note also that many functions don't take any arguments, in which case the "
37859 "C<guestfs_I<foo>_args> is completely omitted."
37863 #: ../src/guestfs.pod:2492
37865 "The header contains the procedure number (C<guestfs_proc>) which is how the "
37866 "receiver knows what type of args structure to expect, or none at all."
37870 #: ../src/guestfs.pod:2496
37872 "For functions that take optional arguments, the optional arguments are "
37873 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
37874 "arguments. A bitmask in the header indicates which optional arguments are "
37875 "meaningful. The bitmask is also checked to see if it contains bits set "
37876 "which the daemon does not know about (eg. if more optional arguments were "
37877 "added in a later version of the library), and this causes the call to be "
37882 #: ../src/guestfs.pod:2504
37883 msgid "The reply message for ordinary functions is:"
37887 #: ../src/guestfs.pod:2506
37890 " total length (header + ret,\n"
37891 " but not including the length word itself)\n"
37892 " struct guestfs_message_header (encoded as XDR)\n"
37893 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37898 #: ../src/guestfs.pod:2511
37900 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
37901 "functions that return no formal return values."
37905 #: ../src/guestfs.pod:2514
37906 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
37910 #: ../src/guestfs.pod:2517
37912 "In the case of an error, a flag is set in the header, and the reply message "
37913 "is slightly changed:"
37917 #: ../src/guestfs.pod:2520
37920 " total length (header + error,\n"
37921 " but not including the length word itself)\n"
37922 " struct guestfs_message_header (encoded as XDR)\n"
37923 " struct guestfs_message_error (encoded as XDR)\n"
37928 #: ../src/guestfs.pod:2525
37930 "The C<guestfs_message_error> structure contains the error message as a "
37935 #: ../src/guestfs.pod:2528
37936 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
37940 #: ../src/guestfs.pod:2530
37942 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
37943 "The normal request message is sent (see above). However this is followed by "
37944 "a sequence of file chunks."
37948 #: ../src/guestfs.pod:2534
37951 " total length (header + arguments,\n"
37952 " but not including the length word itself,\n"
37953 " and not including the chunks)\n"
37954 " struct guestfs_message_header (encoded as XDR)\n"
37955 " struct guestfs_<foo>_args (encoded as XDR)\n"
37956 " sequence of chunks for FileIn param #0\n"
37957 " sequence of chunks for FileIn param #1 etc.\n"
37962 #: ../src/guestfs.pod:2542
37963 msgid "The \"sequence of chunks\" is:"
37967 #: ../src/guestfs.pod:2544
37970 " length of chunk (not including length word itself)\n"
37971 " struct guestfs_chunk (encoded as XDR)\n"
37972 " length of chunk\n"
37973 " struct guestfs_chunk (encoded as XDR)\n"
37975 " length of chunk\n"
37976 " struct guestfs_chunk (with data.data_len == 0)\n"
37981 #: ../src/guestfs.pod:2552
37983 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
37984 "is set in the final chunk to indicate either successful completion or early "
37989 #: ../src/guestfs.pod:2556
37991 "At time of writing there are no functions that have more than one FileIn "
37992 "parameter. However this is (theoretically) supported, by sending the "
37993 "sequence of chunks for each FileIn parameter one after another (from left to "
37998 #: ../src/guestfs.pod:2561
38000 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
38001 "transfer. The library does this by sending a chunk with a special flag set "
38002 "to indicate cancellation. When the daemon sees this, it cancels the whole "
38003 "RPC, does I<not> send any reply, and goes back to reading the next request."
38007 #: ../src/guestfs.pod:2567
38009 "The daemon may also cancel. It does this by writing a special word "
38010 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
38011 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
38012 "cancel chunk). The special word is chosen so that even if cancellation "
38013 "happens right at the end of the transfer (after the library has finished "
38014 "writing and has started listening for the reply), the \"spurious\" cancel "
38015 "flag will not be confused with the reply message."
38019 #: ../src/guestfs.pod:2576
38021 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
38022 "limit), and also files where the size is not known in advance (eg. from "
38023 "pipes or sockets). However the chunks are rather small "
38024 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
38025 "to keep much in memory."
38029 #: ../src/guestfs.pod:2582
38030 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
38034 #: ../src/guestfs.pod:2584
38036 "The protocol for FileOut parameters is exactly the same as for FileIn "
38037 "parameters, but with the roles of daemon and library reversed."
38041 #: ../src/guestfs.pod:2587
38044 " total length (header + ret,\n"
38045 " but not including the length word itself,\n"
38046 " and not including the chunks)\n"
38047 " struct guestfs_message_header (encoded as XDR)\n"
38048 " struct guestfs_<foo>_ret (encoded as XDR)\n"
38049 " sequence of chunks for FileOut param #0\n"
38050 " sequence of chunks for FileOut param #1 etc.\n"
38055 #: ../src/guestfs.pod:2595
38056 msgid "INITIAL MESSAGE"
38060 #: ../src/guestfs.pod:2597
38062 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
38063 "which indicates that the guest and daemon is alive. This is what "
38064 "L</guestfs_launch> waits for."
38068 #: ../src/guestfs.pod:2601
38069 msgid "PROGRESS NOTIFICATION MESSAGES"
38073 #: ../src/guestfs.pod:2603
38075 "The daemon may send progress notification messages at any time. These are "
38076 "distinguished by the normal length word being replaced by "
38077 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
38081 #: ../src/guestfs.pod:2607
38083 "The library turns them into progress callbacks (see "
38084 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
38089 #: ../src/guestfs.pod:2611
38091 "The daemon self-limits the frequency of progress messages it sends (see "
38092 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
38097 #: ../src/guestfs.pod:2615
38098 msgid "LIBGUESTFS VERSION NUMBERS"
38102 #: ../src/guestfs.pod:2617
38104 "Since April 2010, libguestfs has started to make separate development and "
38105 "stable releases, along with corresponding branches in our git repository. "
38106 "These separate releases can be identified by version number:"
38110 #: ../src/guestfs.pod:2622
38113 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
38114 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
38120 " | `-------- sub-version\n"
38122 " `------ always '1' because we don't change the ABI\n"
38127 #: ../src/guestfs.pod:2633
38128 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
38132 #: ../src/guestfs.pod:2635
38134 "As time passes we cherry pick fixes from the development branch and backport "
38135 "those into the stable branch, the effect being that the stable branch should "
38136 "get more stable and less buggy over time. So the stable releases are ideal "
38137 "for people who don't need new features but would just like the software to "
38142 #: ../src/guestfs.pod:2641
38143 msgid "Our criteria for backporting changes are:"
38147 #: ../src/guestfs.pod:2647
38149 "Documentation changes which don't affect any code are backported unless the "
38150 "documentation refers to a future feature which is not in stable."
38154 #: ../src/guestfs.pod:2653
38156 "Bug fixes which are not controversial, fix obvious problems, and have been "
38157 "well tested are backported."
38161 #: ../src/guestfs.pod:2658
38163 "Simple rearrangements of code which shouldn't affect how it works get "
38164 "backported. This is so that the code in the two branches doesn't get too "
38165 "far out of step, allowing us to backport future fixes more easily."
38169 #: ../src/guestfs.pod:2664
38171 "We I<don't> backport new features, new APIs, new tools etc, except in one "
38172 "exceptional case: the new feature is required in order to implement an "
38173 "important bug fix."
38177 #: ../src/guestfs.pod:2670
38179 "A new stable branch starts when we think the new features in development are "
38180 "substantial and compelling enough over the current stable branch to warrant "
38181 "it. When that happens we create new stable and development versions 1.N.0 "
38182 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
38183 "stable at this point, but by backporting fixes from development, that branch "
38184 "will stabilize over time."
38188 #: ../src/guestfs.pod:2678
38189 msgid "EXTENDING LIBGUESTFS"
38193 #: ../src/guestfs.pod:2680
38194 msgid "ADDING A NEW API ACTION"
38198 #: ../src/guestfs.pod:2682
38200 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
38201 "documentation) are generated, and this makes it easy to extend the "
38206 #: ../src/guestfs.pod:2686
38207 msgid "To add a new API action there are two changes:"
38211 #: ../src/guestfs.pod:2692
38213 "You need to add a description of the call (name, parameters, return type, "
38214 "tests, documentation) to C<generator/generator_actions.ml>."
38218 #: ../src/guestfs.pod:2695
38220 "There are two sorts of API action, depending on whether the call goes "
38221 "through to the daemon in the appliance, or is serviced entirely by the "
38222 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
38223 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
38224 "an example of the latter, since a trace flag is maintained in the handle and "
38225 "all tracing is done on the library side."
38229 #: ../src/guestfs.pod:2703
38231 "Most new actions are of the first type, and get added to the "
38232 "C<daemon_functions> list. Each function has a unique procedure number used "
38233 "in the RPC protocol which is assigned to that action when we publish "
38234 "libguestfs and cannot be reused. Take the latest procedure number and "
38239 #: ../src/guestfs.pod:2709
38241 "For library-only actions of the second type, add to the "
38242 "C<non_daemon_functions> list. Since these functions are serviced by the "
38243 "library and do not travel over the RPC mechanism to the daemon, these "
38244 "functions do not need a procedure number, and so the procedure number is set "
38249 #: ../src/guestfs.pod:2717
38250 msgid "Implement the action (in C):"
38254 #: ../src/guestfs.pod:2719
38256 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
38257 "C<daemon/> directory."
38261 #: ../src/guestfs.pod:2722
38263 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
38264 "(note: double underscore) in the C<src/> directory."
38268 #: ../src/guestfs.pod:2725
38269 msgid "In either case, use another function as an example of what to do."
38273 #: ../src/guestfs.pod:2729
38274 msgid "After making these changes, use C<make> to compile."
38278 #: ../src/guestfs.pod:2731
38280 "Note that you don't need to implement the RPC, language bindings, manual "
38281 "pages or anything else. It's all automatically generated from the OCaml "
38286 #: ../src/guestfs.pod:2735
38287 msgid "ADDING TESTS FOR AN API ACTION"
38291 #: ../src/guestfs.pod:2737
38293 "You can supply zero or as many tests as you want per API call. The tests "
38294 "can either be added as part of the API description "
38295 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
38296 "drop a script into C<regressions/>. Note that adding a script to "
38297 "C<regressions/> is slower, so if possible use the first method."
38301 #: ../src/guestfs.pod:2743
38303 "The following describes the test environment used when you add an API test "
38304 "in C<generator_actions.ml>."
38308 #: ../src/guestfs.pod:2746
38309 msgid "The test environment has 4 block devices:"
38313 #: ../src/guestfs.pod:2750
38314 msgid "C</dev/sda> 500MB"
38318 #: ../src/guestfs.pod:2752
38319 msgid "General block device for testing."
38323 #: ../src/guestfs.pod:2754
38324 msgid "C</dev/sdb> 50MB"
38328 #: ../src/guestfs.pod:2756
38330 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
38335 #: ../src/guestfs.pod:2759
38336 msgid "C</dev/sdc> 10MB"
38340 #: ../src/guestfs.pod:2761
38341 msgid "Used in a few tests where two block devices are needed."
38345 #: ../src/guestfs.pod:2763
38346 msgid "C</dev/sdd>"
38350 #: ../src/guestfs.pod:2765
38351 msgid "ISO with fixed content (see C<images/test.iso>)."
38355 #: ../src/guestfs.pod:2769
38357 "To be able to run the tests in a reasonable amount of time, the libguestfs "
38358 "appliance and block devices are reused between tests. So don't try testing "
38359 "L</guestfs_kill_subprocess> :-x"
38363 #: ../src/guestfs.pod:2773
38365 "Each test starts with an initial scenario, selected using one of the "
38366 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
38367 "initialize the disks mentioned above in a particular way as documented in "
38368 "C<generator_types.ml>. You should not assume anything about the previous "
38369 "contents of other disks that are not initialized."
38373 #: ../src/guestfs.pod:2779
38375 "You can add a prerequisite clause to any individual test. This is a "
38376 "run-time check, which, if it fails, causes the test to be skipped. Useful "
38377 "if testing a command which might not work on all variations of libguestfs "
38378 "builds. A test that has prerequisite of C<Always> means to run "
38383 #: ../src/guestfs.pod:2785
38385 "In addition, packagers can skip individual tests by setting environment "
38386 "variables before running C<make check>."
38390 #: ../src/guestfs.pod:2788
38393 " SKIP_TEST_<CMD>_<NUM>=1\n"
38398 #: ../src/guestfs.pod:2790
38399 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
38403 #: ../src/guestfs.pod:2792
38408 #: ../src/guestfs.pod:2794
38411 " SKIP_TEST_<CMD>=1\n"
38416 #: ../src/guestfs.pod:2796
38417 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
38421 #: ../src/guestfs.pod:2798
38422 msgid "Packagers can run only certain tests by setting for example:"
38426 #: ../src/guestfs.pod:2800
38429 " TEST_ONLY=\"vfs_type zerofree\"\n"
38434 #: ../src/guestfs.pod:2802
38436 "See C<capitests/tests.c> for more details of how these environment variables "
38441 #: ../src/guestfs.pod:2805
38442 msgid "DEBUGGING NEW API ACTIONS"
38446 #: ../src/guestfs.pod:2807
38447 msgid "Test new actions work before submitting them."
38451 #: ../src/guestfs.pod:2809
38452 msgid "You can use guestfish to try out new commands."
38456 #: ../src/guestfs.pod:2811
38458 "Debugging the daemon is a problem because it runs inside a minimal "
38459 "environment. However you can fprintf messages in the daemon to stderr, and "
38460 "they will show up if you use C<guestfish -v>."
38464 #: ../src/guestfs.pod:2815
38465 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
38469 #: ../src/guestfs.pod:2817
38471 "Our C source code generally adheres to some basic code-formatting "
38472 "conventions. The existing code base is not totally consistent on this "
38473 "front, but we do prefer that contributed code be formatted similarly. In "
38474 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
38475 "indentation level, and other than that, follow the K&R style."
38479 #: ../src/guestfs.pod:2823
38481 "If you use Emacs, add the following to one of one of your start-up files "
38482 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
38486 #: ../src/guestfs.pod:2826
38489 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
38490 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
38491 " (add-hook 'find-file-hook\n"
38492 " '(lambda () (if (and buffer-file-name\n"
38493 " (string-match \"/libguestfs\\\\>\"\n"
38494 " (buffer-file-name))\n"
38495 " (not (string-equal mode-name \"Change Log\"))\n"
38496 " (not (string-equal mode-name \"Makefile\")))\n"
38497 " (setq indent-tabs-mode nil))))\n"
38502 #: ../src/guestfs.pod:2836
38505 " ;;; When editing C sources in libguestfs, use this style.\n"
38506 " (defun libguestfs-c-mode ()\n"
38507 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
38509 " (c-set-style \"K&R\")\n"
38510 " (setq c-indent-level 2)\n"
38511 " (setq c-basic-offset 2))\n"
38512 " (add-hook 'c-mode-hook\n"
38513 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
38514 " (buffer-file-name))\n"
38515 " (libguestfs-c-mode))))\n"
38520 #: ../src/guestfs.pod:2848
38521 msgid "Enable warnings when compiling (and fix any problems this finds):"
38525 #: ../src/guestfs.pod:2851
38528 " ./configure --enable-gcc-warnings\n"
38533 #: ../src/guestfs.pod:2853
38534 msgid "Useful targets are:"
38538 #: ../src/guestfs.pod:2855
38541 " make syntax-check # checks the syntax of the C code\n"
38542 " make check # runs the test suite\n"
38547 #: ../src/guestfs.pod:2858
38548 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
38552 #: ../src/guestfs.pod:2860
38554 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
38555 "which are used to do shell quoting."
38559 #: ../src/guestfs.pod:2865
38564 #: ../src/guestfs.pod:2867
38566 "Simple shell quoted string. Any spaces or other shell characters are "
38571 #: ../src/guestfs.pod:2870
38576 #: ../src/guestfs.pod:2872
38578 "Same as C<%Q> except the string is treated as a path which is prefixed by "
38583 #: ../src/guestfs.pod:2879
38586 " asprintf (&cmd, \"cat %R\", path);\n"
38591 #: ../src/guestfs.pod:2881
38592 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
38596 #: ../src/guestfs.pod:2883
38598 "I<Note:> Do I<not> use these when you are passing parameters to the "
38599 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
38600 "because they are not passed via the shell (instead, straight to exec). You "
38601 "probably want to use the C<sysroot_path()> function however."
38605 #: ../src/guestfs.pod:2889
38606 msgid "SUBMITTING YOUR NEW API ACTIONS"
38610 #: ../src/guestfs.pod:2891
38612 "Submit patches to the mailing list: "
38613 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
38614 "L<rjones@redhat.com>."
38618 #: ../src/guestfs.pod:2895
38619 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
38623 #: ../src/guestfs.pod:2897
38624 msgid "We support i18n (gettext anyhow) in the library."
38628 #: ../src/guestfs.pod:2899
38630 "However many messages come from the daemon, and we don't translate those at "
38631 "the moment. One reason is that the appliance generally has all locale files "
38632 "removed from it, because they take up a lot of space. So we'd have to readd "
38633 "some of those, as well as copying our PO files into the appliance."
38637 #: ../src/guestfs.pod:2905
38639 "Debugging messages are never translated, since they are intended for the "
38644 #: ../src/guestfs.pod:2908
38645 msgid "SOURCE CODE SUBDIRECTORIES"
38649 #: ../src/guestfs.pod:2912
38654 #: ../src/guestfs.pod:2914
38655 msgid "L<virt-alignment-scan(1)> command and documentation."
38659 #: ../src/guestfs.pod:2918
38660 msgid "The libguestfs appliance, build scripts and so on."
38664 #: ../src/guestfs.pod:2920
38665 msgid "C<capitests>"
38669 #: ../src/guestfs.pod:2922
38670 msgid "Automated tests of the C API."
38674 #: ../src/guestfs.pod:2924
38679 #: ../src/guestfs.pod:2926
38681 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
38686 #: ../src/guestfs.pod:2929
38691 #: ../src/guestfs.pod:2931
38693 "Safety and liveness tests of components that libguestfs depends upon (not of "
38694 "libguestfs itself). Mainly this is for qemu and the kernel."
38698 #: ../src/guestfs.pod:2934
38703 #: ../src/guestfs.pod:2936
38705 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
38706 "command and documentation."
38710 #: ../src/guestfs.pod:2939
38715 #: ../src/guestfs.pod:2941
38716 msgid "Outside contributions, experimental parts."
38720 #: ../src/guestfs.pod:2943
38725 #: ../src/guestfs.pod:2945
38727 "The daemon that runs inside the libguestfs appliance and carries out "
38732 #: ../src/guestfs.pod:2948
38737 #: ../src/guestfs.pod:2950
38738 msgid "L<virt-df(1)> command and documentation."
38742 #: ../src/guestfs.pod:2952
38747 #: ../src/guestfs.pod:2954
38748 msgid "L<virt-edit(1)> command and documentation."
38752 #: ../src/guestfs.pod:2956
38753 msgid "C<examples>"
38757 #: ../src/guestfs.pod:2958
38758 msgid "C API example code."
38762 #: ../src/guestfs.pod:2960
38767 #: ../src/guestfs.pod:2962
38769 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
38770 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
38771 "L<virt-tar-out(1)>."
38775 #: ../src/guestfs.pod:2966
38780 #: ../src/guestfs.pod:2968
38781 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
38785 #: ../src/guestfs.pod:2970
38786 msgid "C<generator>"
38790 #: ../src/guestfs.pod:2972
38792 "The crucially important generator, used to automatically generate large "
38793 "amounts of boilerplate C code for things like RPC and bindings."
38797 #: ../src/guestfs.pod:2975
38802 #: ../src/guestfs.pod:2977
38803 msgid "Files used by the test suite."
38807 #: ../src/guestfs.pod:2979
38808 msgid "Some \"phony\" guest images which we test against."
38812 #: ../src/guestfs.pod:2981
38813 msgid "C<inspector>"
38817 #: ../src/guestfs.pod:2983
38818 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
38822 #: ../src/guestfs.pod:2985
38827 #: ../src/guestfs.pod:2987
38828 msgid "Logo used on the website. The fish is called Arthur by the way."
38832 #: ../src/guestfs.pod:2989
38837 #: ../src/guestfs.pod:2991
38838 msgid "M4 macros used by autoconf."
38842 #: ../src/guestfs.pod:2993
38847 #: ../src/guestfs.pod:2995
38848 msgid "Translations of simple gettext strings."
38852 #: ../src/guestfs.pod:2997
38857 #: ../src/guestfs.pod:2999
38859 "The build infrastructure and PO files for translations of manpages and POD "
38860 "files. Eventually this will be combined with the C<po> directory, but that "
38861 "is rather complicated."
38865 #: ../src/guestfs.pod:3003
38866 msgid "C<regressions>"
38870 #: ../src/guestfs.pod:3005
38871 msgid "Regression tests."
38875 #: ../src/guestfs.pod:3007
38880 #: ../src/guestfs.pod:3009
38881 msgid "L<virt-rescue(1)> command and documentation."
38885 #: ../src/guestfs.pod:3011
38890 #: ../src/guestfs.pod:3013
38891 msgid "L<virt-resize(1)> command and documentation."
38895 #: ../src/guestfs.pod:3015
38896 msgid "C<sparsify>"
38900 #: ../src/guestfs.pod:3017
38901 msgid "L<virt-sparsify(1)> command and documentation."
38905 #: ../src/guestfs.pod:3019
38910 #: ../src/guestfs.pod:3021
38911 msgid "Source code to the C library."
38915 #: ../src/guestfs.pod:3023
38920 #: ../src/guestfs.pod:3025
38921 msgid "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
38925 #: ../src/guestfs.pod:3027
38926 msgid "C<test-tool>"
38930 #: ../src/guestfs.pod:3029
38932 "Test tool for end users to test if their qemu/kernel combination will work "
38937 #: ../src/guestfs.pod:3032
38942 #: ../src/guestfs.pod:3034
38947 #: ../src/guestfs.pod:3036
38952 #: ../src/guestfs.pod:3038
38957 #: ../src/guestfs.pod:3040
38962 #: ../src/guestfs.pod:3042
38967 #: ../src/guestfs.pod:3044
38972 #: ../src/guestfs.pod:3046
38977 #: ../src/guestfs.pod:3048
38982 #: ../src/guestfs.pod:3050
38983 msgid "Language bindings."
38987 #: ../src/guestfs.pod:3054
38988 msgid "MAKING A STABLE RELEASE"
38992 #: ../src/guestfs.pod:3056
38994 "When we make a stable release, there are several steps documented here. See "
38995 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
39000 #: ../src/guestfs.pod:3064
39001 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
39005 #: ../src/guestfs.pod:3069
39006 msgid "Finalize RELEASE-NOTES."
39010 #: ../src/guestfs.pod:3073
39011 msgid "Update ROADMAP."
39015 #: ../src/guestfs.pod:3077
39016 msgid "Run C<src/api-support/update-from-tarballs.sh>."
39020 #: ../src/guestfs.pod:3081
39021 msgid "Push and pull from Transifex."
39025 #: ../src/guestfs.pod:3083
39030 #: ../src/guestfs.pod:3085
39038 #: ../src/guestfs.pod:3087
39039 msgid "to push the latest POT files to Transifex. Then run:"
39043 #: ../src/guestfs.pod:3089
39051 #: ../src/guestfs.pod:3091
39052 msgid "which is a wrapper to pull the latest translated C<*.po> files."
39056 #: ../src/guestfs.pod:3095
39058 "Create new stable and development directories under "
39059 "L<http://libguestfs.org/download>."
39063 #: ../src/guestfs.pod:3100
39064 msgid "Create the branch in git:"
39068 #: ../src/guestfs.pod:3102
39071 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
39072 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
39073 " git branch stable-1.XX\n"
39074 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
39079 #: ../src/guestfs.pod:3109
39084 #: ../src/guestfs.pod:3111
39085 msgid "PROTOCOL LIMITS"
39089 #: ../src/guestfs.pod:3113
39091 "Internally libguestfs uses a message-based protocol to pass API calls and "
39092 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
39093 "plenty more detail about this). The maximum message size used by the "
39094 "protocol is slightly less than 4 MB. For some API calls you may need to be "
39095 "aware of this limit. The API calls which may be affected are individually "
39096 "documented, with a link back to this section of the documentation."
39100 #: ../src/guestfs.pod:3121
39102 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
39103 "a simple string. Because this string is at some point internally encoded as "
39104 "a message, the maximum size that it can return is slightly under 4 MB. If "
39105 "the requested file is larger than this then you will get an error."
39109 #: ../src/guestfs.pod:3127
39111 "In order to transfer large files into and out of the guest filesystem, you "
39112 "need to use particular calls that support this. The sections L</UPLOADING> "
39113 "and L</DOWNLOADING> document how to do this."
39117 #: ../src/guestfs.pod:3131
39119 "You might also consider mounting the disk image using our FUSE filesystem "
39120 "support (L<guestmount(1)>)."
39124 #: ../src/guestfs.pod:3134
39125 msgid "MAXIMUM NUMBER OF DISKS"
39129 #: ../src/guestfs.pod:3136
39130 msgid "When using virtio disks (the default) the current limit is B<25> disks."
39134 #: ../src/guestfs.pod:3139
39136 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
39137 "slots. However febootstrap only understands disks with names C</dev/vda> "
39138 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
39143 #: ../src/guestfs.pod:3144
39145 "We are working to substantially raise this limit in future versions but it "
39146 "requires complex changes to qemu."
39150 #: ../src/guestfs.pod:3147
39152 "In future versions of libguestfs it should also be possible to \"hot plug\" "
39153 "disks (add and remove disks after calling L</guestfs_launch>). This also "
39154 "requires changes to qemu."
39158 #: ../src/guestfs.pod:3151
39159 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
39163 #: ../src/guestfs.pod:3153
39164 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
39168 #: ../src/guestfs.pod:3155
39170 "This is because it reserves 4 bits for the minor device number (thus "
39171 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
39175 #: ../src/guestfs.pod:3158
39177 "If you attach a disk with more than 15 partitions, the extra partitions are "
39178 "ignored by libguestfs."
39182 #: ../src/guestfs.pod:3161
39183 msgid "MAXIMUM SIZE OF A DISK"
39187 #: ../src/guestfs.pod:3163
39188 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
39192 #: ../src/guestfs.pod:3165
39194 "We have tested block devices up to 1 exabyte (2**60 or "
39195 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
39200 #: ../src/guestfs.pod:3169
39202 "Although libguestfs probably does not impose any limit, the underlying host "
39203 "storage will. If you store disk images on a host ext4 filesystem, then the "
39204 "maximum size will be limited by the maximum ext4 file size (currently 16 "
39205 "TB). If you store disk images as host logical volumes then you are limited "
39206 "by the maximum size of an LV."
39210 #: ../src/guestfs.pod:3175
39212 "For the hugest disk image files, we recommend using XFS on the host for "
39217 #: ../src/guestfs.pod:3178
39218 msgid "MAXIMUM SIZE OF A PARTITION"
39222 #: ../src/guestfs.pod:3180
39224 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
39225 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
39226 "address a partition located beyond 2 TB on the disk."
39230 #: ../src/guestfs.pod:3184
39232 "It is recommended that you use GPT partitions on disks which are larger than "
39233 "this size. GPT uses 64 bit sector numbers and so can address partitions "
39234 "which are theoretically larger than the largest disk we could support."
39238 #: ../src/guestfs.pod:3189
39239 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
39243 #: ../src/guestfs.pod:3191
39245 "This depends on the filesystem type. libguestfs itself does not impose any "
39246 "known limit. Consult Wikipedia or the filesystem documentation to find out "
39247 "what these limits are."
39251 #: ../src/guestfs.pod:3195
39252 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
39256 #: ../src/guestfs.pod:3197
39258 "The API functions L</guestfs_upload>, L</guestfs_download>, "
39259 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
39260 "uploads and downloads."
39264 #: ../src/guestfs.pod:3201
39265 msgid "INSPECTION LIMITS"
39269 #: ../src/guestfs.pod:3203
39271 "The inspection code has several arbitrary limits on things like the size of "
39272 "Windows Registry hive it will read, and the length of product name. These "
39273 "are intended to stop a malicious guest from consuming arbitrary amounts of "
39274 "memory and disk space on the host, and should not be reached in practice. "
39275 "See the source code for more information."
39279 #: ../src/guestfs.pod:3229
39281 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
39282 "effect as calling C<guestfs_set_verbose (g, 1)>."
39286 #: ../src/guestfs.pod:3241
39288 "Set the path that libguestfs uses to search for a supermin appliance. See "
39289 "the discussion of paths in section L</PATH> above."
39293 #: ../src/guestfs.pod:3250
39294 msgid "See also L</QEMU WRAPPERS> above."
39298 #: ../src/guestfs.pod:3254
39300 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
39301 "effect as calling C<guestfs_set_trace (g, 1)>."
39305 #: ../src/guestfs.pod:3272
39307 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
39308 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
39309 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, "
39310 "L<virt-alignment-scan(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
39311 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
39312 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
39313 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
39314 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, "
39315 "L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
39316 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
39317 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)>, "
39318 "L<http://libguestfs.org/>."
39322 #: ../src/guestfs.pod:3308
39324 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
39325 "L<lvm(8)>, L<disktype(1)>."
39329 #: ../src/guestfs.pod:3315 ../tools/virt-make-fs.pl:571 ../tools/virt-win-reg.pl:772
39334 #: ../src/guestfs.pod:3317
39335 msgid "To get a list of bugs against libguestfs use this link:"
39339 #: ../src/guestfs.pod:3319
39340 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
39344 #: ../src/guestfs.pod:3321
39345 msgid "To report a new bug against libguestfs use this link:"
39349 #: ../src/guestfs.pod:3323
39350 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
39354 #: ../src/guestfs.pod:3325
39355 msgid "When reporting a bug, please check:"
39359 #: ../src/guestfs.pod:3331
39360 msgid "That the bug hasn't been reported already."
39364 #: ../src/guestfs.pod:3335
39365 msgid "That you are testing a recent version."
39369 #: ../src/guestfs.pod:3339
39370 msgid "Describe the bug accurately, and give a way to reproduce it."
39374 #: ../src/guestfs.pod:3343
39376 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
39381 #: ../test-tool/libguestfs-test-tool.pod:5
39382 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
39386 #: ../test-tool/libguestfs-test-tool.pod:9
39389 " libguestfs-test-tool [--options]\n"
39394 #: ../test-tool/libguestfs-test-tool.pod:13
39396 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
39397 "to check basic libguestfs functionality is working. This is needed because "
39398 "libguestfs occasionally breaks for reasons beyond our control: usually "
39399 "because of changes in the underlying qemu or kernel packages, or the host "
39404 #: ../test-tool/libguestfs-test-tool.pod:19
39405 msgid "If you suspect a problem in libguestfs, then just run:"
39409 #: ../test-tool/libguestfs-test-tool.pod:21
39412 " libguestfs-test-tool\n"
39417 #: ../test-tool/libguestfs-test-tool.pod:23
39418 msgid "It will print lots of diagnostic messages."
39422 #: ../test-tool/libguestfs-test-tool.pod:25
39423 msgid "If it runs to completion successfully, you will see this near the end:"
39427 #: ../test-tool/libguestfs-test-tool.pod:27
39430 " ===== TEST FINISHED OK =====\n"
39435 #: ../test-tool/libguestfs-test-tool.pod:29
39436 msgid "and the test tool will exit with code 0."
39440 #: ../test-tool/libguestfs-test-tool.pod:31
39442 "If it fails (and/or exits with non-zero error code), please paste the "
39443 "I<complete, unedited> output of the test tool into a bug report. More "
39444 "information about reporting bugs can be found on the "
39445 "L<http://libguestfs.org/> website."
39449 #: ../test-tool/libguestfs-test-tool.pod:42
39450 msgid "Display short usage information and exit."
39454 #: ../test-tool/libguestfs-test-tool.pod:44
39455 msgid "B<--qemu qemu_binary>"
39459 #: ../test-tool/libguestfs-test-tool.pod:46
39461 "If you have downloaded another qemu binary, point this option at the full "
39462 "path of the binary to try it."
39466 #: ../test-tool/libguestfs-test-tool.pod:49
39467 msgid "B<--qemudir qemu_source_dir>"
39471 #: ../test-tool/libguestfs-test-tool.pod:51
39473 "If you have compiled qemu from source, point this option at the source "
39474 "directory to try it."
39478 #: ../test-tool/libguestfs-test-tool.pod:54
39483 #: ../test-tool/libguestfs-test-tool.pod:56
39484 msgid "B<--timeout N>"
39488 #: ../test-tool/libguestfs-test-tool.pod:58
39490 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
39491 "minutes) which does not usually need to be adjusted."
39495 #: ../test-tool/libguestfs-test-tool.pod:63
39496 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
39500 #: ../test-tool/libguestfs-test-tool.pod:65
39502 "If you have compiled another version of qemu from source and would like to "
39503 "try that, then you can use the I<--qemudir> option to point to the qemu "
39504 "source directory."
39508 #: ../test-tool/libguestfs-test-tool.pod:69
39510 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
39511 "option to point to the binary."
39515 #: ../test-tool/libguestfs-test-tool.pod:72
39517 "Note when using these options, you can ignore the business of qemu wrapper "
39518 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
39519 "wrapper script for you if one is needed."
39523 #: ../test-tool/libguestfs-test-tool.pod:76
39524 msgid "TRYING OUT A DIFFERENT KERNEL"
39528 #: ../test-tool/libguestfs-test-tool.pod:78
39530 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
39531 "libguestfs tries. You do this by setting the environment variables "
39532 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
39536 #: ../test-tool/libguestfs-test-tool.pod:82
39538 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
39543 #: ../test-tool/libguestfs-test-tool.pod:85
39544 msgid "SELF-DIAGNOSIS"
39548 #: ../test-tool/libguestfs-test-tool.pod:87
39550 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
39551 "produced by libguestfs-test-tool and/or possible errors."
39555 #: ../test-tool/libguestfs-test-tool.pod:92
39557 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
39558 "I<1> if there was an error."
39562 #: ../test-tool/libguestfs-test-tool.pod:97
39564 "For the full list of environment variables which may affect libguestfs, "
39565 "please see the L<guestfs(3)> manual page."
39569 #: ../test-tool/libguestfs-test-tool.pod:102
39570 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
39574 #: ../tools/virt-list-filesystems.pl:32
39575 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
39579 #: ../tools/virt-list-filesystems.pl:36
39582 " virt-list-filesystems [--options] domname\n"
39587 #: ../tools/virt-list-filesystems.pl:38
39590 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
39595 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
39597 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
39602 #: ../tools/virt-list-filesystems.pl:45
39604 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
39605 "are contained in a virtual machine or disk image."
39609 #: ../tools/virt-list-filesystems.pl:49
39611 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
39612 "functionality. For more complex cases you should look at the "
39613 "L<guestfish(1)> tool."
39617 #: ../tools/virt-list-filesystems.pl:112
39619 "With this option, C<virt-list-filesystems> displays the type of each "
39620 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
39624 #: ../tools/virt-list-filesystems.pl:119
39629 #: ../tools/virt-list-filesystems.pl:123
39631 "Normally we only show mountable filesystems. If this option is given then "
39632 "swap devices are shown too."
39636 #: ../tools/virt-list-filesystems.pl:197
39638 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
39639 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
39640 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39644 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
39645 msgid "Copyright (C) 2009 Red Hat Inc."
39649 #: ../tools/virt-list-partitions.pl:32
39650 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
39654 #: ../tools/virt-list-partitions.pl:36
39657 " virt-list-partitions [--options] domname\n"
39662 #: ../tools/virt-list-partitions.pl:38
39665 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
39670 #: ../tools/virt-list-partitions.pl:45
39672 "C<virt-list-partitions> is a command line tool to list the partitions that "
39673 "are contained in a virtual machine or disk image. It is mainly useful as a "
39674 "first step to using L<virt-resize(1)>."
39678 #: ../tools/virt-list-partitions.pl:50
39680 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
39681 "functionality. For more complex cases you should look at the "
39682 "L<guestfish(1)> tool."
39686 #: ../tools/virt-list-partitions.pl:113
39687 msgid "Show sizes in human-readable form (eg. \"1G\")."
39691 #: ../tools/virt-list-partitions.pl:123
39693 "With this option, C<virt-list-partitions> displays the type and size of each "
39694 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
39698 #: ../tools/virt-list-partitions.pl:130
39703 #: ../tools/virt-list-partitions.pl:132
39708 #: ../tools/virt-list-partitions.pl:134
39709 msgid "Display the total size of each block device (as a separate row or rows)."
39713 #: ../tools/virt-list-partitions.pl:267
39715 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
39716 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
39717 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39721 #: ../tools/virt-list-partitions.pl:283
39722 msgid "Copyright (C) 2009-2010 Red Hat Inc."
39726 #: ../tools/virt-make-fs.pl:37
39727 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
39731 #: ../tools/virt-make-fs.pl:41
39734 " virt-make-fs [--options] input.tar output.img\n"
39739 #: ../tools/virt-make-fs.pl:43
39742 " virt-make-fs [--options] input.tar.gz output.img\n"
39747 #: ../tools/virt-make-fs.pl:45
39750 " virt-make-fs [--options] directory output.img\n"
39755 #: ../tools/virt-make-fs.pl:49
39757 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
39758 "archive or some files in a directory. It is similar to tools like "
39759 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
39760 "it can create common filesystem types like ext2/3 or NTFS, which can be "
39761 "useful if you want to attach these filesystems to existing virtual machines "
39762 "(eg. to import large amounts of read-only data to a VM)."
39766 #: ../tools/virt-make-fs.pl:57
39767 msgid "Basic usage is:"
39771 #: ../tools/virt-make-fs.pl:59
39774 " virt-make-fs input output.img\n"
39779 #: ../tools/virt-make-fs.pl:61
39781 "where C<input> is either a directory containing files that you want to add, "
39782 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
39783 "C<output.img> is a disk image. The input type is detected automatically. "
39784 "The output disk image defaults to a raw ext2 sparse image unless you specify "
39785 "extra flags (see L</OPTIONS> below)."
39789 #: ../tools/virt-make-fs.pl:67
39790 msgid "FILESYSTEM TYPE"
39794 #: ../tools/virt-make-fs.pl:69
39796 "The default filesystem type is C<ext2>. Just about any filesystem type that "
39797 "libguestfs supports can be used (but I<not> read-only formats like "
39798 "ISO9660). Here are some of the more common choices:"
39802 #: ../tools/virt-make-fs.pl:75
39807 #: ../tools/virt-make-fs.pl:77
39809 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
39810 "you are not going to use the filesystem in a way that requires the journal, "
39811 "then this is just wasted overhead."
39815 #: ../tools/virt-make-fs.pl:81
39816 msgid "I<ntfs> or I<vfat>"
39820 #: ../tools/virt-make-fs.pl:83
39821 msgid "Useful if exporting data to a Windows guest."
39825 #: ../tools/virt-make-fs.pl:85
39827 "I<Note for vfat>: The tar archive or local directory must only contain files "
39828 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
39829 "program running within libguestfs is unable to change the ownership of "
39830 "non-root files, since vfat itself does not support this."
39834 #: ../tools/virt-make-fs.pl:90
39839 #: ../tools/virt-make-fs.pl:92
39841 "Lower overhead than C<ext2>, but certain limitations on filename length and "
39842 "total filesystem size."
39846 #: ../tools/virt-make-fs.pl:97 ../tools/virt-make-fs.pl:116 ../tools/virt-make-fs.pl:149
39851 #: ../tools/virt-make-fs.pl:99
39854 " virt-make-fs --type=minix input minixfs.img\n"
39859 #: ../tools/virt-make-fs.pl:101
39860 msgid "TO PARTITION OR NOT TO PARTITION"
39864 #: ../tools/virt-make-fs.pl:103
39865 msgid "Optionally virt-make-fs can add a partition table to the output disk."
39869 #: ../tools/virt-make-fs.pl:105
39871 "Adding a partition can make the disk image more compatible with certain "
39872 "virtualized operating systems which don't expect to see a filesystem "
39873 "directly located on a block device (Linux doesn't care and will happily "
39874 "handle both types)."
39878 #: ../tools/virt-make-fs.pl:110
39880 "On the other hand, if you have a partition table then the output image is no "
39881 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
39882 "directly on a partitioned disk image. (However libguestfs tools such as "
39883 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
39887 #: ../tools/virt-make-fs.pl:118
39888 msgid "Add an MBR partition:"
39892 #: ../tools/virt-make-fs.pl:120
39895 " virt-make-fs --partition -- input disk.img\n"
39900 #: ../tools/virt-make-fs.pl:122
39902 "If the output disk image could be terabyte-sized or larger, it's better to "
39903 "use an EFI/GPT-compatible partition table:"
39907 #: ../tools/virt-make-fs.pl:125
39910 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
39915 #: ../tools/virt-make-fs.pl:127
39916 msgid "EXTRA SPACE"
39920 #: ../tools/virt-make-fs.pl:129
39922 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
39923 "the files that it contains, but might have extra space. Depending on how "
39924 "you are going to use the output, you might think this extra space is wasted "
39925 "and want to minimize it, or you might want to leave space so that more files "
39926 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
39927 "but you can use the I<--size> flag to leave space in the filesystem if you "
39932 #: ../tools/virt-make-fs.pl:137
39934 "An alternative way to leave extra space but not make the output image any "
39935 "bigger is to use an alternative disk image format (instead of the default "
39936 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
39937 "image format (check your hypervisor supports this before using it). This "
39938 "allows you to choose a large I<--size> but the extra space won't actually be "
39939 "allocated in the image until you try to store something in it."
39943 #: ../tools/virt-make-fs.pl:145
39945 "Don't forget that you can also use local commands including L<resize2fs(8)> "
39946 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
39947 "to build another image from scratch."
39951 #: ../tools/virt-make-fs.pl:151
39954 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
39959 #: ../tools/virt-make-fs.pl:179
39960 msgid "Enable debugging information."
39964 #: ../tools/virt-make-fs.pl:185
39965 msgid "B<--size=E<lt>NE<gt>>"
39969 #: ../tools/virt-make-fs.pl:187
39970 msgid "B<--size=+E<lt>NE<gt>>"
39974 #: ../tools/virt-make-fs.pl:189
39975 msgid "B<-s E<lt>NE<gt>>"
39979 #: ../tools/virt-make-fs.pl:191
39980 msgid "B<-s +E<lt>NE<gt>>"
39984 #: ../tools/virt-make-fs.pl:193
39985 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
39989 #: ../tools/virt-make-fs.pl:196
39991 "If this option is I<not> given, then the output image will be just large "
39992 "enough to contain all the files, with not much wasted space."
39996 #: ../tools/virt-make-fs.pl:199
39998 "To choose a fixed size output disk, specify an absolute number followed by "
39999 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
40000 "Petabytes or Exabytes. This must be large enough to contain all the input "
40001 "files, else you will get an error."
40005 #: ../tools/virt-make-fs.pl:204
40007 "To leave extra space, specify C<+> (plus sign) and a number followed by "
40008 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
40009 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
40010 "the input files, and (approximately) an extra 200 MB free space."
40014 #: ../tools/virt-make-fs.pl:210
40016 "Note that virt-make-fs estimates free space, and therefore will not produce "
40017 "filesystems containing precisely the free space requested. (It is much more "
40018 "expensive and time-consuming to produce a filesystem which has precisely the "
40019 "desired free space)."
40023 #: ../tools/virt-make-fs.pl:219
40024 msgid "B<--format=E<lt>fmtE<gt>>"
40028 #: ../tools/virt-make-fs.pl:221
40029 msgid "B<-F E<lt>fmtE<gt>>"
40033 #: ../tools/virt-make-fs.pl:223
40034 msgid "Choose the output disk image format."
40038 #: ../tools/virt-make-fs.pl:225
40039 msgid "The default is C<raw> (raw sparse disk image)."
40043 #: ../tools/virt-make-fs.pl:227
40045 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
40046 "that would really make sense here is C<qcow2>."
40050 #: ../tools/virt-make-fs.pl:234
40051 msgid "B<--type=E<lt>fsE<gt>>"
40055 #: ../tools/virt-make-fs.pl:236
40056 msgid "B<-t E<lt>fsE<gt>>"
40060 #: ../tools/virt-make-fs.pl:238
40061 msgid "Choose the output filesystem type."
40065 #: ../tools/virt-make-fs.pl:240
40066 msgid "The default is C<ext2>."
40070 #: ../tools/virt-make-fs.pl:242
40071 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
40075 #: ../tools/virt-make-fs.pl:249
40076 msgid "B<--partition>"
40080 #: ../tools/virt-make-fs.pl:251
40081 msgid "B<--partition=E<lt>parttypeE<gt>>"
40085 #: ../tools/virt-make-fs.pl:253
40087 "If specified, this flag adds an MBR partition table to the output disk "
40092 #: ../tools/virt-make-fs.pl:256
40094 "You can change the partition table type, eg. I<--partition=gpt> for large "
40099 #: ../tools/virt-make-fs.pl:259
40101 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
40102 "might consider the next parameter to be the partition type. For example:"
40106 #: ../tools/virt-make-fs.pl:263
40109 " virt-make-fs --partition input.tar output.img\n"
40114 #: ../tools/virt-make-fs.pl:265
40116 "would cause virt-make-fs to think you wanted to use a partition type of "
40117 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
40118 "dash) between options and the input and output arguments:"
40122 #: ../tools/virt-make-fs.pl:269
40125 " virt-make-fs --partition -- input.tar output.img\n"
40130 #: ../tools/virt-make-fs.pl:271
40131 msgid "For MBR, virt-make-fs sets the partition type byte automatically."
40135 #: ../tools/virt-make-fs.pl:559
40137 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
40138 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
40139 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
40143 #: ../tools/virt-make-fs.pl:573 ../tools/virt-win-reg.pl:774
40145 "When reporting bugs, please enable debugging and capture the I<complete> "
40150 #: ../tools/virt-make-fs.pl:576
40153 " export LIBGUESTFS_DEBUG=1\n"
40154 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
40159 #: ../tools/virt-make-fs.pl:579
40161 "Attach /tmp/virt-make-fs.log to a new bug report at "
40162 "L<https://bugzilla.redhat.com/>"
40166 #: ../tools/virt-tar.pl:33
40167 msgid "virt-tar - Extract or upload files to a virtual machine"
40171 #: ../tools/virt-tar.pl:37
40174 " virt-tar [--options] -x domname directory tarball\n"
40179 #: ../tools/virt-tar.pl:39
40182 " virt-tar [--options] -u domname tarball directory\n"
40187 #: ../tools/virt-tar.pl:41
40190 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
40195 #: ../tools/virt-tar.pl:43
40198 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
40203 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
40208 #: ../tools/virt-tar.pl:47
40210 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
40211 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
40215 #: ../tools/virt-tar.pl:52
40216 msgid "Download C</home> from the VM into a local tarball:"
40220 #: ../tools/virt-tar.pl:54
40223 " virt-tar -x domname /home home.tar\n"
40228 #: ../tools/virt-tar.pl:56
40231 " virt-tar -zx domname /home home.tar.gz\n"
40236 #: ../tools/virt-tar.pl:58
40237 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
40241 #: ../tools/virt-tar.pl:60
40244 " virt-tar -u domname uploadstuff.tar /tmp\n"
40249 #: ../tools/virt-tar.pl:62
40252 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
40257 #: ../tools/virt-tar.pl:66
40259 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
40260 "virtual machines. If you do this, you risk disk corruption in the VM. "
40261 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
40265 #: ../tools/virt-tar.pl:71
40267 "You can use I<-x> (extract) on live virtual machines, but you might get "
40268 "inconsistent results or errors if there is filesystem activity inside the "
40269 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
40270 "work, but the only way to guarantee consistent results is if the virtual "
40271 "machine is shut down."
40275 #: ../tools/virt-tar.pl:79
40277 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
40278 "parts of a guest filesystem. There are many possibilities: making backups, "
40279 "uploading data files, snooping on guest activity, fixing or customizing "
40284 #: ../tools/virt-tar.pl:84
40286 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
40287 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
40288 "should look at the L<guestfish(1)> tool."
40292 #: ../tools/virt-tar.pl:88
40294 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
40295 "its contents (recursively) from the virtual machine into a local tarball. "
40296 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
40297 "virtual machine. You cannot use these two options together."
40301 #: ../tools/virt-tar.pl:94
40303 "In addition, you may need to use the I<-z> (gZip) option to enable "
40304 "compression. When uploading, you have to specify I<-z> if the upload file "
40305 "is compressed because virt-tar won't detect this on its own."
40309 #: ../tools/virt-tar.pl:98
40311 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
40312 "example it cannot do PKZip files or bzip2 compression. If you want that "
40313 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
40314 "the L<libguestfs(3)> API)."
40318 #: ../tools/virt-tar.pl:160
40319 msgid "B<--extract>"
40323 #: ../tools/virt-tar.pl:162
40324 msgid "B<--download>"
40328 #: ../tools/virt-tar.pl:164
40333 #: ../tools/virt-tar.pl:166
40334 msgid "B<--upload>"
40338 #: ../tools/virt-tar.pl:168
40340 "Use I<-x> to extract (download) a directory from a virtual machine to a "
40345 #: ../tools/virt-tar.pl:171
40347 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
40348 "Please read the L</WARNING> section above before using this option."
40352 #: ../tools/virt-tar.pl:175
40353 msgid "You must specify exactly one of these options."
40357 #: ../tools/virt-tar.pl:181
40362 #: ../tools/virt-tar.pl:183
40367 #: ../tools/virt-tar.pl:185
40368 msgid "Specify that the input or output tarball is gzip-compressed."
40372 #: ../tools/virt-tar.pl:298
40374 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
40375 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
40376 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
40377 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40381 #: ../tools/virt-win-reg.pl:37
40383 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
40388 #: ../tools/virt-win-reg.pl:41
40391 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
40396 #: ../tools/virt-win-reg.pl:43
40399 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
40404 #: ../tools/virt-win-reg.pl:45
40407 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
40412 #: ../tools/virt-win-reg.pl:47
40415 " virt-win-reg --merge domname [input.reg ...]\n"
40420 #: ../tools/virt-win-reg.pl:49
40423 " virt-win-reg [--options] disk.img ... # instead of domname\n"
40428 #: ../tools/virt-win-reg.pl:53
40430 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
40431 "virtual machines. If you do this, you I<will> get irreversible disk "
40432 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
40433 "but doesn't catch all cases."
40437 #: ../tools/virt-win-reg.pl:58
40439 "Modifying the Windows Registry is an inherently risky operation. The format "
40440 "is deliberately obscure and undocumented, and Registry changes can leave the "
40441 "system unbootable. Therefore when using the I<--merge> option, make sure "
40442 "you have a reliable backup first."
40446 #: ../tools/virt-win-reg.pl:65
40448 "This program can export and merge Windows Registry entries from a Windows "
40453 #: ../tools/virt-win-reg.pl:68
40455 "The first parameter is the libvirt guest name or the raw disk image of a "
40460 #: ../tools/virt-win-reg.pl:71
40462 "If I<--merge> is I<not> specified, then the chosen registry key is "
40463 "displayed/exported (recursively). For example:"
40467 #: ../tools/virt-win-reg.pl:74
40470 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
40475 #: ../tools/virt-win-reg.pl:76
40476 msgid "You can also display single values from within registry keys, for example:"
40480 #: ../tools/virt-win-reg.pl:79
40483 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
40484 " $ virt-win-reg Windows7 $cvkey ProductName\n"
40485 " Windows 7 Enterprise\n"
40490 #: ../tools/virt-win-reg.pl:83
40492 "With I<--merge>, you can merge a textual regedit file into the Windows "
40497 #: ../tools/virt-win-reg.pl:86
40500 " $ virt-win-reg --merge Windows7 changes.reg\n"
40505 #: ../tools/virt-win-reg.pl:90
40507 "This program is only meant for simple access to the registry. If you want "
40508 "to do complicated things with the registry, we suggest you download the "
40509 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
40510 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
40511 "L<hivexregedit(1)>."
40515 #: ../tools/virt-win-reg.pl:159
40520 #: ../tools/virt-win-reg.pl:161
40522 "In merge mode, this merges a textual regedit file into the Windows Registry "
40523 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
40524 "displays or exports Registry entries instead."
40528 #: ../tools/virt-win-reg.pl:165
40530 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
40531 "result in disk corruption. However exporting (without this flag) is always "
40536 #: ../tools/virt-win-reg.pl:173
40537 msgid "B<--encoding> UTF-16LE|ASCII"
40541 #: ../tools/virt-win-reg.pl:175
40543 "When merging (only), you may need to specify the encoding for strings to be "
40544 "used in the hive file. This is explained in detail in "
40545 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
40549 #: ../tools/virt-win-reg.pl:179
40551 "The default is to use UTF-16LE, which should work with recent versions of "
40556 #: ../tools/virt-win-reg.pl:186
40557 msgid "B<--unsafe-printable-strings>"
40561 #: ../tools/virt-win-reg.pl:188
40563 "When exporting (only), assume strings are UTF-16LE and print them as strings "
40564 "instead of hex sequences. Remove the final zero codepoint from strings if "
40569 #: ../tools/virt-win-reg.pl:192
40571 "This is unsafe and does not preserve the fidelity of strings in the original "
40572 "Registry for various reasons:"
40576 #: ../tools/virt-win-reg.pl:199
40578 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
40579 "other encodings will be corrupted by this transformation."
40583 #: ../tools/virt-win-reg.pl:204
40585 "Assumes that everything which has type 1 or 2 is really a string and that "
40586 "everything else is not a string, but the type field in real Registries is "
40591 #: ../tools/virt-win-reg.pl:210
40593 "Loses information about whether a zero codepoint followed the string in the "
40598 #: ../tools/virt-win-reg.pl:215
40600 "This all happens because the Registry itself contains no information about "
40601 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
40605 #: ../tools/virt-win-reg.pl:219
40607 "You should only use this option for quick hacking and debugging of the "
40608 "Registry contents, and I<never> use it if the output is going to be passed "
40609 "into another program or stored in another Registry."
40613 #: ../tools/virt-win-reg.pl:556
40614 msgid "SUPPORTED SYSTEMS"
40618 #: ../tools/virt-win-reg.pl:558
40620 "The program currently supports Windows NT-derived guests starting with "
40621 "Windows XP through to at least Windows 7."
40625 #: ../tools/virt-win-reg.pl:561
40626 msgid "The following Registry keys are supported:"
40630 #: ../tools/virt-win-reg.pl:565
40631 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
40635 #: ../tools/virt-win-reg.pl:567
40636 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
40640 #: ../tools/virt-win-reg.pl:569
40641 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
40645 #: ../tools/virt-win-reg.pl:571
40646 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
40650 #: ../tools/virt-win-reg.pl:573
40651 msgid "C<HKEY_USERS\\.DEFAULT>"
40655 #: ../tools/virt-win-reg.pl:575
40656 msgid "C<HKEY_USERS\\I<SID>>"
40660 #: ../tools/virt-win-reg.pl:577
40661 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
40665 #: ../tools/virt-win-reg.pl:579
40666 msgid "C<HKEY_USERS\\I<username>>"
40670 #: ../tools/virt-win-reg.pl:581
40671 msgid "where I<username> is a local user name (this is a libguestfs extension)."
40675 #: ../tools/virt-win-reg.pl:585
40677 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
40682 #: ../tools/virt-win-reg.pl:588
40684 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
40685 "supported (there is no \"current user\")."
40689 #: ../tools/virt-win-reg.pl:591
40694 #: ../tools/virt-win-reg.pl:593
40696 "C<virt-win-reg> expects that regedit files have already been reencoded in "
40697 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
40698 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
40699 "with Windows-style line endings, you may need to reencode the whole file "
40700 "before or after processing."
40704 #: ../tools/virt-win-reg.pl:599
40706 "To reencode a file from Windows format to Linux (before processing it with "
40707 "the I<--merge> option), you would do something like this:"
40711 #: ../tools/virt-win-reg.pl:602
40714 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
40719 #: ../tools/virt-win-reg.pl:604
40721 "To go in the opposite direction, after exporting and before sending the file "
40722 "to a Windows user, do something like this:"
40726 #: ../tools/virt-win-reg.pl:607
40729 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
40734 #: ../tools/virt-win-reg.pl:609
40735 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
40739 #: ../tools/virt-win-reg.pl:611
40741 "If you are unsure about the current encoding, use the L<file(1)> command. "
40742 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
40743 "Windows-style (CRLF) line endings, like this:"
40747 #: ../tools/virt-win-reg.pl:615
40750 " $ file software.reg\n"
40751 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
40752 " with CRLF line terminators\n"
40757 #: ../tools/virt-win-reg.pl:619
40758 msgid "This file would need conversion before you could I<--merge> it."
40762 #: ../tools/virt-win-reg.pl:621
40763 msgid "CurrentControlSet etc."
40767 #: ../tools/virt-win-reg.pl:623
40769 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
40770 "Registry at the level of the hive file, and therefore you cannot modify "
40775 #: ../tools/virt-win-reg.pl:627
40777 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
40778 "circumstances it might refer to another control set. The way to find out is "
40779 "to look at the C<HKLM\\SYSTEM\\Select> key:"
40783 #: ../tools/virt-win-reg.pl:631
40786 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
40787 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
40788 " \"Current\"=dword:00000001\n"
40789 " \"Default\"=dword:00000001\n"
40790 " \"Failed\"=dword:00000000\n"
40791 " \"LastKnownGood\"=dword:00000002\n"
40796 #: ../tools/virt-win-reg.pl:638
40797 msgid "\"Current\" is the one which Windows will choose when it boots."
40801 #: ../tools/virt-win-reg.pl:640
40802 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
40806 #: ../tools/virt-win-reg.pl:643
40807 msgid "DELETING REGISTRY KEYS AND VALUES"
40811 #: ../tools/virt-win-reg.pl:645
40812 msgid "To delete a whole registry key, use the syntax:"
40816 #: ../tools/virt-win-reg.pl:647
40819 " [-HKEY_LOCAL_MACHINE\\Foo]\n"
40824 #: ../tools/virt-win-reg.pl:649
40825 msgid "To delete a single value within a key, use the syntax:"
40829 #: ../tools/virt-win-reg.pl:651
40832 " [HKEY_LOCAL_MACHINE\\Foo]\n"
40838 #: ../tools/virt-win-reg.pl:654
40839 msgid "WINDOWS TIPS"
40843 #: ../tools/virt-win-reg.pl:656
40845 "Note that some of these tips modify the guest disk image. The guest I<must> "
40846 "be shut off, else you will get disk corruption."
40850 #: ../tools/virt-win-reg.pl:659
40851 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
40855 #: ../tools/virt-win-reg.pl:661
40857 "Prepare a DOS batch script, VBScript or executable. Upload this using "
40858 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
40859 "is uploaded into C<C:\\>:"
40863 #: ../tools/virt-win-reg.pl:665
40866 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
40871 #: ../tools/virt-win-reg.pl:667
40872 msgid "Prepare a regedit file containing the registry change:"
40876 #: ../tools/virt-win-reg.pl:669
40879 " cat > test.reg <<'EOF'\n"
40880 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
40881 " \"Test\"=\"c:\\\\test.bat\"\n"
40887 #: ../tools/virt-win-reg.pl:674
40889 "In this example we use the key C<RunOnce> which means that the script will "
40890 "run precisely once when the first user logs in. If you want it to run every "
40891 "time a user logs in, replace C<RunOnce> with C<Run>."
40895 #: ../tools/virt-win-reg.pl:678
40896 msgid "Now update the registry:"
40900 #: ../tools/virt-win-reg.pl:680
40903 " virt-win-reg --merge WindowsGuest test.reg\n"
40908 #: ../tools/virt-win-reg.pl:682
40909 msgid "INSTALLING A SERVICE"
40913 #: ../tools/virt-win-reg.pl:684
40915 "This section assumes you are familiar with Windows services, and you either "
40916 "have a program which handles the Windows Service Control Protocol directly "
40917 "or you want to run any program using a service wrapper like SrvAny or the "
40922 #: ../tools/virt-win-reg.pl:689
40924 "First upload the program and optionally the service wrapper. In this case "
40925 "the test program is called C<test.exe> and we are using the RHSrvAny "
40930 #: ../tools/virt-win-reg.pl:693
40933 " guestfish -i -d WindowsGuest <<EOF\n"
40934 " upload rhsrvany.exe /rhsrvany.exe\n"
40935 " upload test.exe /test.exe\n"
40941 #: ../tools/virt-win-reg.pl:698
40943 "Prepare a regedit file containing the registry changes. In this example, "
40944 "the first registry change is needed for the service itself or the service "
40945 "wrapper (if used). The second registry change is only needed because I am "
40946 "using the RHSrvAny service wrapper."
40950 #: ../tools/virt-win-reg.pl:703
40953 " cat > service.reg <<'EOF'\n"
40954 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
40955 " \"Type\"=dword:00000010\n"
40956 " \"Start\"=dword:00000002\n"
40957 " \"ErrorControl\"=dword:00000001\n"
40958 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
40959 " \"DisplayName\"=\"RHSrvAny\"\n"
40960 " \"ObjectName\"=\"NetworkService\"\n"
40965 #: ../tools/virt-win-reg.pl:712
40968 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
40969 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
40970 " \"PWD\"=\"c:\\\\Temp\"\n"
40976 #: ../tools/virt-win-reg.pl:723
40978 "For use of C<ControlSet001> see the section above in this manual page. You "
40979 "may need to adjust this according to the control set that is in use by the "
40984 #: ../tools/virt-win-reg.pl:729
40986 "C<\"ObjectName\"> controls the privileges that the service will have. An "
40987 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
40988 "privileged account."
40992 #: ../tools/virt-win-reg.pl:735
40994 "For the meaning of the magic numbers, see this Microsoft KB article: "
40995 "L<http://support.microsoft.com/kb/103000>."
40999 #: ../tools/virt-win-reg.pl:740
41000 msgid "Update the registry:"
41004 #: ../tools/virt-win-reg.pl:742
41007 " virt-win-reg --merge WindowsGuest service.reg\n"
41012 #: ../tools/virt-win-reg.pl:746
41014 "Be careful when passing parameters containing C<\\> (backslash) in the "
41015 "shell. Usually you will have to use 'single quotes' or double backslashes "
41016 "(but not both) to protect them from the shell."
41020 #: ../tools/virt-win-reg.pl:750
41021 msgid "Paths and value names are case-insensitive."
41025 #: ../tools/virt-win-reg.pl:759
41027 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
41028 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
41029 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
41030 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
41034 #: ../tools/virt-win-reg.pl:777
41037 " export LIBGUESTFS_DEBUG=1\n"
41038 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
41043 #: ../tools/virt-win-reg.pl:780
41045 "Attach /tmp/virt-win-reg.log to a new bug report at "
41046 "L<https://bugzilla.redhat.com/>"