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.25\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-10-26 14:08+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:395 ../fish/guestfish-actions.pod:403 ../fish/guestfish-actions.pod:410 ../fish/guestfish-actions.pod:417 ../fish/guestfish-actions.pod:1216 ../fish/guestfish-actions.pod:1220 ../fish/guestfish-actions.pod:1224 ../fish/guestfish-actions.pod:1228 ../fish/guestfish-actions.pod:1236 ../fish/guestfish-actions.pod:1240 ../fish/guestfish-actions.pod:1244 ../fish/guestfish-actions.pod:1254 ../fish/guestfish-actions.pod:1258 ../fish/guestfish-actions.pod:1262 ../fish/guestfish-actions.pod:1352 ../fish/guestfish-actions.pod:1356 ../fish/guestfish-actions.pod:1361 ../fish/guestfish-actions.pod:1366 ../fish/guestfish-actions.pod:1408 ../fish/guestfish-actions.pod:1412 ../fish/guestfish-actions.pod:1417 ../fish/guestfish-actions.pod:1673 ../fish/guestfish-actions.pod:1680 ../fish/guestfish-actions.pod:1687 ../fish/guestfish-actions.pod:2090 ../fish/guestfish-actions.pod:2096 ../fish/guestfish-actions.pod:2104 ../fish/guestfish-actions.pod:2111 ../fish/guestfish-actions.pod:2118 ../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:594 ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:609 ../src/guestfs-actions.pod:616 ../src/guestfs-actions.pod:2024 ../src/guestfs-actions.pod:2028 ../src/guestfs-actions.pod:2032 ../src/guestfs-actions.pod:2036 ../src/guestfs-actions.pod:2044 ../src/guestfs-actions.pod:2048 ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:2062 ../src/guestfs-actions.pod:2066 ../src/guestfs-actions.pod:2070 ../src/guestfs-actions.pod:2208 ../src/guestfs-actions.pod:2212 ../src/guestfs-actions.pod:2217 ../src/guestfs-actions.pod:2222 ../src/guestfs-actions.pod:2283 ../src/guestfs-actions.pod:2287 ../src/guestfs-actions.pod:2292 ../src/guestfs-actions.pod:2707 ../src/guestfs-actions.pod:2714 ../src/guestfs-actions.pod:2721 ../src/guestfs-actions.pod:3266 ../src/guestfs-actions.pod:3272 ../src/guestfs-actions.pod:3280 ../src/guestfs-actions.pod:3287 ../src/guestfs-actions.pod:3294 ../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:4349
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:1404 ../fish/guestfish-actions.pod:1669 ../fish/guestfish-actions.pod:2086 ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:2279 ../src/guestfs-actions.pod:2703 ../src/guestfs-actions.pod:3262 ../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:168 ../fish/guestfish-actions.pod:182
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:171 ../fish/guestfish-actions.pod:185 ../fish/guestfish-actions.pod:895 ../fish/guestfish-actions.pod:930 ../fish/guestfish-actions.pod:1103 ../fish/guestfish-actions.pod:1463 ../fish/guestfish-actions.pod:1477 ../fish/guestfish-actions.pod:3247 ../fish/guestfish-actions.pod:3558 ../fish/guestfish-actions.pod:3606 ../fish/guestfish-actions.pod:4533 ../fish/guestfish-actions.pod:4556 ../fish/guestfish-actions.pod:4578 ../fish/guestfish-actions.pod:4616 ../fish/guestfish-actions.pod:5265 ../fish/guestfish-actions.pod:5371 ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:258 ../src/guestfs-actions.pod:279 ../src/guestfs-actions.pod:1525 ../src/guestfs-actions.pod:1582 ../src/guestfs-actions.pod:1865 ../src/guestfs-actions.pod:2364 ../src/guestfs-actions.pod:2385 ../src/guestfs-actions.pod:5030 ../src/guestfs-actions.pod:5552 ../src/guestfs-actions.pod:5652 ../src/guestfs-actions.pod:6952 ../src/guestfs-actions.pod:6996 ../src/guestfs-actions.pod:7030 ../src/guestfs-actions.pod:7093 ../src/guestfs-actions.pod:8025 ../src/guestfs-actions.pod:8134 ../src/guestfs-actions.pod:8317
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:..] "
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:64
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:67
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:71
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:76
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:82
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:89
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
5371 "The other optional parameters are passed directly through to "
5372 "L</add-drive-opts>."
5376 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:148 ../fish/guestfish-actions.pod:578 ../fish/guestfish-actions.pod:789 ../fish/guestfish-actions.pod:810 ../fish/guestfish-actions.pod:848 ../fish/guestfish-actions.pod:857 ../fish/guestfish-actions.pod:866 ../fish/guestfish-actions.pod:880 ../fish/guestfish-actions.pod:2125 ../fish/guestfish-actions.pod:3296 ../fish/guestfish-actions.pod:3459 ../fish/guestfish-actions.pod:3594
5378 "This command has one or more optional arguments. See L</OPTIONAL "
5383 #: ../fish/guestfish-actions.pod:81
5388 #: ../fish/guestfish-actions.pod:83
5391 " add-drive filename\n"
5396 #: ../fish/guestfish-actions.pod:85
5398 "This function is the equivalent of calling L</add-drive-opts> with no "
5399 "optional parameters, so the disk is added writable, with the format being "
5400 "detected automatically."
5404 #: ../fish/guestfish-actions.pod:89
5406 "Automatic detection of the format opens you up to a potential security hole "
5407 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5408 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5409 "you should think about replacing calls to this function with calls to "
5410 "L</add-drive-opts>, and specifying the format."
5414 #: ../fish/guestfish-actions.pod:96
5415 msgid "add-drive-opts"
5419 #: ../fish/guestfish-actions.pod:98
5424 #: ../fish/guestfish-actions.pod:100
5427 " add-drive-opts filename [readonly:..] [format:..] [iface:..] [name:..]\n"
5432 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:161
5434 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5435 "The first time you call this function, the disk appears as C</dev/sda>, the "
5436 "second time as C</dev/sdb>, and so on."
5440 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:166
5442 "You don't necessarily need to be root when using libguestfs. However you "
5443 "obviously do need sufficient permissions to access the filename for whatever "
5444 "operations you want to perform (ie. read access if you just want to read the "
5445 "image or write access if you want to modify the image)."
5449 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:172
5450 msgid "This call checks that C<filename> exists."
5454 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3258 ../src/guestfs-actions.pod:174 ../src/guestfs-actions.pod:5067
5455 msgid "The optional arguments are:"
5459 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:178
5464 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:180
5466 "If true then the image is treated as read-only. Writes are still allowed, "
5467 "but they are stored in a temporary snapshot overlay which is discarded at "
5468 "the end. The disk that you add is not modified."
5472 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:184
5477 #: ../fish/guestfish-actions.pod:127
5479 "This forces the image format. If you omit this (or use L</add-drive> or "
5480 "L</add-drive-ro>) then the format is automatically detected. Possible "
5481 "formats include C<raw> and C<qcow2>."
5485 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:190
5487 "Automatic detection of the format opens you up to a potential security hole "
5488 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5489 "RHBZ#642934. Specifying the format closes this security hole."
5493 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:195
5498 #: ../fish/guestfish-actions.pod:138
5500 "This rarely-used option lets you emulate the behaviour of the deprecated "
5501 "L</add-drive-with-if> call (q.v.)"
5505 #: ../fish/guestfish-actions.pod:141 ../src/guestfs-actions.pod:200
5510 #: ../fish/guestfish-actions.pod:143 ../src/guestfs-actions.pod:202
5512 "The name the drive had in the original guest, e.g. /dev/sdb. This is used as "
5513 "a hint to the guest inspection process if it is available."
5517 #: ../fish/guestfish-actions.pod:150
5518 msgid "add-drive-ro"
5522 #: ../fish/guestfish-actions.pod:152
5527 #: ../fish/guestfish-actions.pod:154
5530 " add-drive-ro filename\n"
5535 #: ../fish/guestfish-actions.pod:156
5537 "This function is the equivalent of calling L</add-drive-opts> with the "
5538 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
5539 "is added read-only, with the format being detected automatically."
5543 #: ../fish/guestfish-actions.pod:161
5544 msgid "add-drive-ro-with-if"
5548 #: ../fish/guestfish-actions.pod:163
5551 " add-drive-ro-with-if filename iface\n"
5556 #: ../fish/guestfish-actions.pod:165
5558 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
5559 "interface emulation to use at run time."
5563 #: ../fish/guestfish-actions.pod:175
5564 msgid "add-drive-with-if"
5568 #: ../fish/guestfish-actions.pod:177
5571 " add-drive-with-if filename iface\n"
5576 #: ../fish/guestfish-actions.pod:179
5578 "This is the same as L</add-drive> but it allows you to specify the QEMU "
5579 "interface emulation to use at run time."
5583 #: ../fish/guestfish-actions.pod:189
5588 #: ../fish/guestfish-actions.pod:191
5591 " aug-clear augpath\n"
5596 #: ../fish/guestfish-actions.pod:193 ../src/guestfs-actions.pod:296
5598 "Set the value associated with C<path> to C<NULL>. This is the same as the "
5599 "L<augtool(1)> C<clear> command."
5603 #: ../fish/guestfish-actions.pod:196
5608 #: ../fish/guestfish-actions.pod:198
5616 #: ../fish/guestfish-actions.pod:200
5618 "Close the current Augeas handle and free up any resources used by it. After "
5619 "calling this, you have to call L</aug-init> again before you can use any "
5620 "other Augeas functions."
5624 #: ../fish/guestfish-actions.pod:205
5629 #: ../fish/guestfish-actions.pod:207
5632 " aug-defnode name expr val\n"
5637 #: ../fish/guestfish-actions.pod:209 ../src/guestfs-actions.pod:325
5638 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
5642 #: ../fish/guestfish-actions.pod:212
5644 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
5645 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
5646 "containing that single node."
5650 #: ../fish/guestfish-actions.pod:216 ../src/guestfs-actions.pod:332
5652 "On success this returns a pair containing the number of nodes in the "
5653 "nodeset, and a boolean flag if a node was created."
5657 #: ../fish/guestfish-actions.pod:220
5662 #: ../fish/guestfish-actions.pod:222
5665 " aug-defvar name expr\n"
5670 #: ../fish/guestfish-actions.pod:224 ../src/guestfs-actions.pod:349
5672 "Defines an Augeas variable C<name> whose value is the result of evaluating "
5673 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
5677 #: ../fish/guestfish-actions.pod:228 ../src/guestfs-actions.pod:353
5679 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
5680 "evaluates to something which is not a nodeset."
5684 #: ../fish/guestfish-actions.pod:231
5689 #: ../fish/guestfish-actions.pod:233
5692 " aug-get augpath\n"
5697 #: ../fish/guestfish-actions.pod:235 ../src/guestfs-actions.pod:366
5699 "Look up the value associated with C<path>. If C<path> matches exactly one "
5700 "node, the C<value> is returned."
5704 #: ../fish/guestfish-actions.pod:238
5709 #: ../fish/guestfish-actions.pod:240
5712 " aug-init root flags\n"
5717 #: ../fish/guestfish-actions.pod:242 ../src/guestfs-actions.pod:381
5719 "Create a new Augeas handle for editing configuration files. If there was "
5720 "any previous Augeas handle associated with this guestfs session, then it is "
5725 #: ../fish/guestfish-actions.pod:246
5726 msgid "You must call this before using any other L</aug-*> commands."
5730 #: ../fish/guestfish-actions.pod:249 ../src/guestfs-actions.pod:388
5731 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5735 #: ../fish/guestfish-actions.pod:252 ../src/guestfs-actions.pod:391
5737 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5738 "logical I<or> of the following integers:"
5742 #: ../fish/guestfish-actions.pod:258 ../src/guestfs-actions.pod:397
5743 msgid "C<AUG_SAVE_BACKUP> = 1"
5747 #: ../fish/guestfish-actions.pod:260 ../src/guestfs-actions.pod:399
5748 msgid "Keep the original file with a C<.augsave> extension."
5752 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:401
5753 msgid "C<AUG_SAVE_NEWFILE> = 2"
5757 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:403
5759 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5760 "original. Overrides C<AUG_SAVE_BACKUP>."
5764 #: ../fish/guestfish-actions.pod:267 ../src/guestfs-actions.pod:406
5765 msgid "C<AUG_TYPE_CHECK> = 4"
5769 #: ../fish/guestfish-actions.pod:269 ../src/guestfs-actions.pod:408
5770 msgid "Typecheck lenses."
5774 #: ../fish/guestfish-actions.pod:271
5776 "This option is only useful when debugging Augeas lenses. Use of this option "
5777 "may require additional memory for the libguestfs appliance. You may need to "
5778 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
5782 #: ../fish/guestfish-actions.pod:276 ../src/guestfs-actions.pod:415
5783 msgid "C<AUG_NO_STDINC> = 8"
5787 #: ../fish/guestfish-actions.pod:278 ../src/guestfs-actions.pod:417
5788 msgid "Do not use standard load path for modules."
5792 #: ../fish/guestfish-actions.pod:280 ../src/guestfs-actions.pod:419
5793 msgid "C<AUG_SAVE_NOOP> = 16"
5797 #: ../fish/guestfish-actions.pod:282 ../src/guestfs-actions.pod:421
5798 msgid "Make save a no-op, just record what would have been changed."
5802 #: ../fish/guestfish-actions.pod:284 ../src/guestfs-actions.pod:423
5803 msgid "C<AUG_NO_LOAD> = 32"
5807 #: ../fish/guestfish-actions.pod:286
5808 msgid "Do not load the tree in L</aug-init>."
5812 #: ../fish/guestfish-actions.pod:290
5813 msgid "To close the handle, you can call L</aug-close>."
5817 #: ../fish/guestfish-actions.pod:292 ../src/guestfs-actions.pod:431
5818 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5822 #: ../fish/guestfish-actions.pod:294
5827 #: ../fish/guestfish-actions.pod:296
5830 " aug-insert augpath label true|false\n"
5835 #: ../fish/guestfish-actions.pod:298 ../src/guestfs-actions.pod:445
5837 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5838 "or after C<path> (depending on the boolean flag C<before>)."
5842 #: ../fish/guestfish-actions.pod:302 ../src/guestfs-actions.pod:449
5844 "C<path> must match exactly one existing node in the tree, and C<label> must "
5845 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5849 #: ../fish/guestfish-actions.pod:306
5854 #: ../fish/guestfish-actions.pod:308
5862 #: ../fish/guestfish-actions.pod:310 ../src/guestfs-actions.pod:462
5863 msgid "Load files into the tree."
5867 #: ../fish/guestfish-actions.pod:312 ../src/guestfs-actions.pod:464
5868 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5872 #: ../fish/guestfish-actions.pod:315
5877 #: ../fish/guestfish-actions.pod:317
5885 #: ../fish/guestfish-actions.pod:319
5887 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
5888 "resulting nodes into alphabetical order."
5892 #: ../fish/guestfish-actions.pod:322
5897 #: ../fish/guestfish-actions.pod:324
5900 " aug-match augpath\n"
5905 #: ../fish/guestfish-actions.pod:326 ../src/guestfs-actions.pod:492
5907 "Returns a list of paths which match the path expression C<path>. The "
5908 "returned paths are sufficiently qualified so that they match exactly one "
5909 "node in the current tree."
5913 #: ../fish/guestfish-actions.pod:330
5918 #: ../fish/guestfish-actions.pod:332
5921 " aug-mv src dest\n"
5926 #: ../fish/guestfish-actions.pod:334 ../src/guestfs-actions.pod:509
5928 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5929 "C<dest> is overwritten if it exists."
5933 #: ../fish/guestfish-actions.pod:337
5938 #: ../fish/guestfish-actions.pod:339
5946 #: ../fish/guestfish-actions.pod:341 ../src/guestfs-actions.pod:522
5947 msgid "Remove C<path> and all of its children."
5951 #: ../fish/guestfish-actions.pod:343 ../src/guestfs-actions.pod:524
5952 msgid "On success this returns the number of entries which were removed."
5956 #: ../fish/guestfish-actions.pod:345
5961 #: ../fish/guestfish-actions.pod:347
5969 #: ../fish/guestfish-actions.pod:349 ../src/guestfs-actions.pod:535
5970 msgid "This writes all pending changes to disk."
5974 #: ../fish/guestfish-actions.pod:351
5976 "The flags which were passed to L</aug-init> affect exactly how files are "
5981 #: ../fish/guestfish-actions.pod:354
5986 #: ../fish/guestfish-actions.pod:356
5989 " aug-set augpath val\n"
5994 #: ../fish/guestfish-actions.pod:358 ../src/guestfs-actions.pod:551
5995 msgid "Set the value associated with C<path> to C<val>."
5999 #: ../fish/guestfish-actions.pod:360
6001 "In the Augeas API, it is possible to clear a node by setting the value to "
6002 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6003 "this call. Instead you must use the L</aug-clear> call."
6007 #: ../fish/guestfish-actions.pod:365
6012 #: ../fish/guestfish-actions.pod:367
6015 " available 'groups ...'\n"
6020 #: ../fish/guestfish-actions.pod:369 ../src/guestfs-actions.pod:568
6022 "This command is used to check the availability of some groups of "
6023 "functionality in the appliance, which not all builds of the libguestfs "
6024 "appliance will be able to provide."
6028 #: ../fish/guestfish-actions.pod:373
6030 "The libguestfs groups, and the functions that those groups correspond to, "
6031 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6032 "runtime by calling L</available-all-groups>."
6036 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:577
6038 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
6039 "\"augeas\"]> would check for the availability of the Linux inotify functions "
6040 "and Augeas (configuration file editing) functions."
6044 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:582
6045 msgid "The command returns no error if I<all> requested groups are available."
6049 #: ../fish/guestfish-actions.pod:385 ../src/guestfs-actions.pod:584
6051 "It fails with an error if one or more of the requested groups is unavailable "
6056 #: ../fish/guestfish-actions.pod:388 ../src/guestfs-actions.pod:587
6058 "If an unknown group name is included in the list of groups then an error is "
6063 #: ../fish/guestfish-actions.pod:391 ../src/guestfs-actions.pod:590
6068 #: ../fish/guestfish-actions.pod:397
6069 msgid "You must call L</launch> before calling this function."
6073 #: ../fish/guestfish-actions.pod:399 ../src/guestfs-actions.pod:598
6075 "The reason is because we don't know what groups are supported by the "
6076 "appliance/daemon until it is running and can be queried."
6080 #: ../fish/guestfish-actions.pod:405 ../src/guestfs-actions.pod:604
6082 "If a group of functions is available, this does not necessarily mean that "
6083 "they will work. You still have to check for errors when calling individual "
6084 "API functions even if they are available."
6088 #: ../fish/guestfish-actions.pod:412 ../src/guestfs-actions.pod:611
6090 "It is usually the job of distro packagers to build complete functionality "
6091 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6092 "with all requirements satisfied, will support everything."
6096 #: ../fish/guestfish-actions.pod:419
6098 "This call was added in version C<1.0.80>. In previous versions of "
6099 "libguestfs all you could do would be to speculatively execute a command to "
6100 "find out if the daemon implemented it. See also L</version>."
6104 #: ../fish/guestfish-actions.pod:426
6105 msgid "available-all-groups"
6109 #: ../fish/guestfish-actions.pod:428
6112 " available-all-groups\n"
6117 #: ../fish/guestfish-actions.pod:430
6119 "This command returns a list of all optional groups that this daemon knows "
6120 "about. Note this returns both supported and unsupported groups. To find "
6121 "out which ones the daemon can actually support you have to call "
6122 "L</available> on each member of the returned list."
6126 #: ../fish/guestfish-actions.pod:436
6127 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6131 #: ../fish/guestfish-actions.pod:438
6136 #: ../fish/guestfish-actions.pod:440
6139 " base64-in (base64file|-) filename\n"
6144 #: ../fish/guestfish-actions.pod:442 ../src/guestfs-actions.pod:655
6145 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
6149 #: ../fish/guestfish-actions.pod:445 ../fish/guestfish-actions.pod:454 ../fish/guestfish-actions.pod:703 ../fish/guestfish-actions.pod:787 ../fish/guestfish-actions.pod:808 ../fish/guestfish-actions.pod:979 ../fish/guestfish-actions.pod:998 ../fish/guestfish-actions.pod:1372 ../fish/guestfish-actions.pod:4836 ../fish/guestfish-actions.pod:4848 ../fish/guestfish-actions.pod:4859 ../fish/guestfish-actions.pod:4870 ../fish/guestfish-actions.pod:4922 ../fish/guestfish-actions.pod:4931 ../fish/guestfish-actions.pod:4985 ../fish/guestfish-actions.pod:5008
6150 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6154 #: ../fish/guestfish-actions.pod:447
6159 #: ../fish/guestfish-actions.pod:449
6162 " base64-out filename (base64file|-)\n"
6167 #: ../fish/guestfish-actions.pod:451 ../src/guestfs-actions.pod:669
6169 "This command downloads the contents of C<filename>, writing it out to local "
6170 "file C<base64file> encoded as base64."
6174 #: ../fish/guestfish-actions.pod:456
6175 msgid "blockdev-flushbufs"
6179 #: ../fish/guestfish-actions.pod:458
6182 " blockdev-flushbufs device\n"
6187 #: ../fish/guestfish-actions.pod:460 ../src/guestfs-actions.pod:682
6188 msgid "This tells the kernel to flush internal buffers associated with C<device>."
6192 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:474 ../fish/guestfish-actions.pod:483 ../fish/guestfish-actions.pod:493 ../fish/guestfish-actions.pod:505 ../fish/guestfish-actions.pod:518 ../fish/guestfish-actions.pod:526 ../fish/guestfish-actions.pod:537 ../fish/guestfish-actions.pod:545 ../fish/guestfish-actions.pod:553 ../src/guestfs-actions.pod:685 ../src/guestfs-actions.pod:702 ../src/guestfs-actions.pod:717 ../src/guestfs-actions.pod:733 ../src/guestfs-actions.pod:751 ../src/guestfs-actions.pod:770 ../src/guestfs-actions.pod:784 ../src/guestfs-actions.pod:802 ../src/guestfs-actions.pod:816 ../src/guestfs-actions.pod:830
6193 msgid "This uses the L<blockdev(8)> command."
6197 #: ../fish/guestfish-actions.pod:465
6198 msgid "blockdev-getbsz"
6202 #: ../fish/guestfish-actions.pod:467
6205 " blockdev-getbsz device\n"
6210 #: ../fish/guestfish-actions.pod:469 ../src/guestfs-actions.pod:697
6211 msgid "This returns the block size of a device."
6215 #: ../fish/guestfish-actions.pod:471 ../fish/guestfish-actions.pod:534 ../src/guestfs-actions.pod:699 ../src/guestfs-actions.pod:799
6217 "(Note this is different from both I<size in blocks> and I<filesystem block "
6222 #: ../fish/guestfish-actions.pod:476
6223 msgid "blockdev-getro"
6227 #: ../fish/guestfish-actions.pod:478
6230 " blockdev-getro device\n"
6235 #: ../fish/guestfish-actions.pod:480 ../src/guestfs-actions.pod:714
6237 "Returns a boolean indicating if the block device is read-only (true if "
6238 "read-only, false if not)."
6242 #: ../fish/guestfish-actions.pod:485
6243 msgid "blockdev-getsize64"
6247 #: ../fish/guestfish-actions.pod:487
6250 " blockdev-getsize64 device\n"
6255 #: ../fish/guestfish-actions.pod:489 ../src/guestfs-actions.pod:729
6256 msgid "This returns the size of the device in bytes."
6260 #: ../fish/guestfish-actions.pod:491
6261 msgid "See also L</blockdev-getsz>."
6265 #: ../fish/guestfish-actions.pod:495
6266 msgid "blockdev-getss"
6270 #: ../fish/guestfish-actions.pod:497
6273 " blockdev-getss device\n"
6278 #: ../fish/guestfish-actions.pod:499 ../src/guestfs-actions.pod:745
6280 "This returns the size of sectors on a block device. Usually 512, but can be "
6281 "larger for modern devices."
6285 #: ../fish/guestfish-actions.pod:502
6286 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
6290 #: ../fish/guestfish-actions.pod:507
6291 msgid "blockdev-getsz"
6295 #: ../fish/guestfish-actions.pod:509
6298 " blockdev-getsz device\n"
6303 #: ../fish/guestfish-actions.pod:511 ../src/guestfs-actions.pod:763
6305 "This returns the size of the device in units of 512-byte sectors (even if "
6306 "the sectorsize isn't 512 bytes ... weird)."
6310 #: ../fish/guestfish-actions.pod:514
6312 "See also L</blockdev-getss> for the real sector size of the device, and "
6313 "L</blockdev-getsize64> for the more useful I<size in bytes>."
6317 #: ../fish/guestfish-actions.pod:520
6318 msgid "blockdev-rereadpt"
6322 #: ../fish/guestfish-actions.pod:522
6325 " blockdev-rereadpt device\n"
6330 #: ../fish/guestfish-actions.pod:524 ../src/guestfs-actions.pod:782
6331 msgid "Reread the partition table on C<device>."
6335 #: ../fish/guestfish-actions.pod:528
6336 msgid "blockdev-setbsz"
6340 #: ../fish/guestfish-actions.pod:530
6343 " blockdev-setbsz device blocksize\n"
6348 #: ../fish/guestfish-actions.pod:532 ../src/guestfs-actions.pod:797
6349 msgid "This sets the block size of a device."
6353 #: ../fish/guestfish-actions.pod:539
6354 msgid "blockdev-setro"
6358 #: ../fish/guestfish-actions.pod:541
6361 " blockdev-setro device\n"
6366 #: ../fish/guestfish-actions.pod:543 ../src/guestfs-actions.pod:814
6367 msgid "Sets the block device named C<device> to read-only."
6371 #: ../fish/guestfish-actions.pod:547
6372 msgid "blockdev-setrw"
6376 #: ../fish/guestfish-actions.pod:549
6379 " blockdev-setrw device\n"
6384 #: ../fish/guestfish-actions.pod:551 ../src/guestfs-actions.pod:828
6385 msgid "Sets the block device named C<device> to read-write."
6389 #: ../fish/guestfish-actions.pod:555
6390 msgid "btrfs-filesystem-resize"
6394 #: ../fish/guestfish-actions.pod:557
6397 " btrfs-filesystem-resize mountpoint [size:..]\n"
6402 #: ../fish/guestfish-actions.pod:559 ../src/guestfs-actions.pod:850
6403 msgid "This command resizes a btrfs filesystem."
6407 #: ../fish/guestfish-actions.pod:561 ../src/guestfs-actions.pod:852
6409 "Note that unlike other resize calls, the filesystem has to be mounted and "
6410 "the parameter is the mountpoint not the device (this is a requirement of "
6415 #: ../fish/guestfish-actions.pod:565 ../fish/guestfish-actions.pod:3569 ../src/guestfs-actions.pod:856 ../src/guestfs-actions.pod:5591
6416 msgid "The optional parameters are:"
6420 #: ../fish/guestfish-actions.pod:569 ../fish/guestfish-actions.pod:3573 ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:5595
6425 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:862
6427 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
6428 "resized to the maximum size."
6432 #: ../fish/guestfish-actions.pod:576 ../src/guestfs-actions.pod:867
6433 msgid "See also L<btrfs(8)>."
6437 #: ../fish/guestfish-actions.pod:580
6438 msgid "case-sensitive-path"
6442 #: ../fish/guestfish-actions.pod:582
6445 " case-sensitive-path path\n"
6450 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:901
6452 "This can be used to resolve case insensitive paths on a filesystem which is "
6453 "case sensitive. The use case is to resolve paths which you have read from "
6454 "Windows configuration files or the Windows Registry, to the true path."
6458 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:906
6460 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6461 "(and probably others), which is that although the underlying filesystem is "
6462 "case-insensitive, the driver exports the filesystem to Linux as "
6467 #: ../fish/guestfish-actions.pod:594 ../src/guestfs-actions.pod:911
6469 "One consequence of this is that special directories such as C<c:\\windows> "
6470 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6471 "precise details of how they were created. In Windows itself this would not "
6476 #: ../fish/guestfish-actions.pod:600 ../src/guestfs-actions.pod:917
6478 "Bug or feature? You decide: "
6479 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
6483 #: ../fish/guestfish-actions.pod:603 ../src/guestfs-actions.pod:920
6485 "This function resolves the true case of each element in the path and returns "
6486 "the case-sensitive path."
6490 #: ../fish/guestfish-actions.pod:606
6492 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
6493 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
6494 "how the directories were originally created under Windows)."
6498 #: ../fish/guestfish-actions.pod:611 ../src/guestfs-actions.pod:928
6499 msgid "I<Note>: This function does not handle drive names, backslashes etc."
6503 #: ../fish/guestfish-actions.pod:614
6504 msgid "See also L</realpath>."
6508 #: ../fish/guestfish-actions.pod:616
6513 #: ../fish/guestfish-actions.pod:618
6521 #: ../fish/guestfish-actions.pod:620 ../fish/guestfish-actions.pod:4003 ../src/guestfs-actions.pod:944 ../src/guestfs-actions.pod:6252
6522 msgid "Return the contents of the file named C<path>."
6526 #: ../fish/guestfish-actions.pod:622
6528 "Note that this function cannot correctly handle binary files (specifically, "
6529 "files containing C<\\0> character which is treated as end of string). For "
6530 "those you need to use the L</read-file> or L</download> functions which have "
6531 "a more complex interface."
6535 #: ../fish/guestfish-actions.pod:627 ../fish/guestfish-actions.pod:762 ../fish/guestfish-actions.pod:774 ../fish/guestfish-actions.pod:1057 ../fish/guestfish-actions.pod:1067 ../fish/guestfish-actions.pod:1134 ../fish/guestfish-actions.pod:1144 ../fish/guestfish-actions.pod:1336 ../fish/guestfish-actions.pod:1649 ../fish/guestfish-actions.pod:1659 ../fish/guestfish-actions.pod:1709 ../fish/guestfish-actions.pod:1724 ../fish/guestfish-actions.pod:1734 ../fish/guestfish-actions.pod:1753 ../fish/guestfish-actions.pod:3873 ../fish/guestfish-actions.pod:3888 ../fish/guestfish-actions.pod:3964 ../fish/guestfish-actions.pod:3981 ../fish/guestfish-actions.pod:3996 ../fish/guestfish-actions.pod:4677 ../fish/guestfish-actions.pod:4723 ../fish/guestfish-actions.pod:4808 ../fish/guestfish-actions.pod:4823 ../fish/guestfish-actions.pod:5229 ../fish/guestfish-actions.pod:5241 ../fish/guestfish-actions.pod:5259 ../fish/guestfish-actions.pod:5276 ../fish/guestfish-actions.pod:5286 ../fish/guestfish-actions.pod:5343 ../fish/guestfish-actions.pod:5353 ../fish/guestfish-actions.pod:5382 ../fish/guestfish-actions.pod:5392 ../src/guestfs-actions.pod:954 ../src/guestfs-actions.pod:1133 ../src/guestfs-actions.pod:1153 ../src/guestfs-actions.pod:1800 ../src/guestfs-actions.pod:1819 ../src/guestfs-actions.pod:1922 ../src/guestfs-actions.pod:1941 ../src/guestfs-actions.pod:2187 ../src/guestfs-actions.pod:2669 ../src/guestfs-actions.pod:2688 ../src/guestfs-actions.pod:2753 ../src/guestfs-actions.pod:2777 ../src/guestfs-actions.pod:2794 ../src/guestfs-actions.pod:2823 ../src/guestfs-actions.pod:6034 ../src/guestfs-actions.pod:6060 ../src/guestfs-actions.pod:6191 ../src/guestfs-actions.pod:6217 ../src/guestfs-actions.pod:6241 ../src/guestfs-actions.pod:7208 ../src/guestfs-actions.pod:7263 ../src/guestfs-actions.pod:7409 ../src/guestfs-actions.pod:7433 ../src/guestfs-actions.pod:8098 ../src/guestfs-actions.pod:8118 ../src/guestfs-actions.pod:8151 ../src/guestfs-actions.pod:8170 ../src/guestfs-actions.pod:8189 ../src/guestfs-actions.pod:8283 ../src/guestfs-actions.pod:8302 ../src/guestfs-actions.pod:8348 ../src/guestfs-actions.pod:8367
6537 "Because of the message protocol, there is a transfer limit of somewhere "
6538 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6542 #: ../fish/guestfish-actions.pod:630
6547 #: ../fish/guestfish-actions.pod:632
6550 " checksum csumtype path\n"
6555 #: ../fish/guestfish-actions.pod:634 ../src/guestfs-actions.pod:966
6556 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6560 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:969
6562 "The type of checksum to compute is given by the C<csumtype> parameter which "
6563 "must have one of the following values:"
6567 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:974
6572 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:976
6574 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6579 #: ../fish/guestfish-actions.pod:647 ../src/guestfs-actions.pod:979
6584 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:981
6585 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6589 #: ../fish/guestfish-actions.pod:651 ../src/guestfs-actions.pod:983
6594 #: ../fish/guestfish-actions.pod:653 ../src/guestfs-actions.pod:985
6595 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6599 #: ../fish/guestfish-actions.pod:655 ../src/guestfs-actions.pod:987
6604 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:989
6605 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6609 #: ../fish/guestfish-actions.pod:659 ../src/guestfs-actions.pod:991
6614 #: ../fish/guestfish-actions.pod:661 ../src/guestfs-actions.pod:993
6615 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6619 #: ../fish/guestfish-actions.pod:663 ../src/guestfs-actions.pod:995
6624 #: ../fish/guestfish-actions.pod:665 ../src/guestfs-actions.pod:997
6625 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6629 #: ../fish/guestfish-actions.pod:667 ../src/guestfs-actions.pod:999
6634 #: ../fish/guestfish-actions.pod:669 ../src/guestfs-actions.pod:1001
6635 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6639 #: ../fish/guestfish-actions.pod:673 ../src/guestfs-actions.pod:1005
6640 msgid "The checksum is returned as a printable string."
6644 #: ../fish/guestfish-actions.pod:675
6645 msgid "To get the checksum for a device, use L</checksum-device>."
6649 #: ../fish/guestfish-actions.pod:677
6650 msgid "To get the checksums for many files, use L</checksums-out>."
6654 #: ../fish/guestfish-actions.pod:679
6655 msgid "checksum-device"
6659 #: ../fish/guestfish-actions.pod:681
6662 " checksum-device csumtype device\n"
6667 #: ../fish/guestfish-actions.pod:683
6669 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6670 "device named C<device>. For the types of checksums supported see the "
6671 "L</checksum> command."
6675 #: ../fish/guestfish-actions.pod:687
6676 msgid "checksums-out"
6680 #: ../fish/guestfish-actions.pod:689
6683 " checksums-out csumtype directory (sumsfile|-)\n"
6688 #: ../fish/guestfish-actions.pod:691 ../src/guestfs-actions.pod:1040
6690 "This command computes the checksums of all regular files in C<directory> and "
6691 "then emits a list of those checksums to the local output file C<sumsfile>."
6695 #: ../fish/guestfish-actions.pod:695 ../src/guestfs-actions.pod:1044
6697 "This can be used for verifying the integrity of a virtual machine. However "
6698 "to be properly secure you should pay attention to the output of the checksum "
6699 "command (it uses the ones from GNU coreutils). In particular when the "
6700 "filename is not printable, coreutils uses a special backslash syntax. For "
6701 "more information, see the GNU coreutils info file."
6705 #: ../fish/guestfish-actions.pod:705
6710 #: ../fish/guestfish-actions.pod:707
6713 " chmod mode path\n"
6718 #: ../fish/guestfish-actions.pod:709 ../src/guestfs-actions.pod:1063
6720 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6725 #: ../fish/guestfish-actions.pod:712 ../src/guestfs-actions.pod:1066
6727 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6728 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6733 #: ../fish/guestfish-actions.pod:716 ../fish/guestfish-actions.pod:3222 ../fish/guestfish-actions.pod:3361 ../fish/guestfish-actions.pod:3371 ../fish/guestfish-actions.pod:3381 ../src/guestfs-actions.pod:1070 ../src/guestfs-actions.pod:4998 ../src/guestfs-actions.pod:5207 ../src/guestfs-actions.pod:5226 ../src/guestfs-actions.pod:5245
6734 msgid "The mode actually set is affected by the umask."
6738 #: ../fish/guestfish-actions.pod:718
6743 #: ../fish/guestfish-actions.pod:720
6746 " chown owner group path\n"
6751 #: ../fish/guestfish-actions.pod:722 ../src/guestfs-actions.pod:1084
6752 msgid "Change the file owner to C<owner> and group to C<group>."
6756 #: ../fish/guestfish-actions.pod:724 ../fish/guestfish-actions.pod:2657 ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:4069
6758 "Only numeric uid and gid are supported. If you want to use names, you will "
6759 "need to locate and parse the password file yourself (Augeas support makes "
6760 "this relatively easy)."
6764 #: ../fish/guestfish-actions.pod:728
6769 #: ../fish/guestfish-actions.pod:730
6772 " command 'arguments ...'\n"
6777 #: ../fish/guestfish-actions.pod:732 ../src/guestfs-actions.pod:1100
6779 "This call runs a command from the guest filesystem. The filesystem must be "
6780 "mounted, and must contain a compatible operating system (ie. something "
6781 "Linux, with the same or compatible processor architecture)."
6785 #: ../fish/guestfish-actions.pod:737
6787 "The single parameter is an argv-style list of arguments. The first element "
6788 "is the name of the program to run. Subsequent elements are parameters. The "
6789 "list must be non-empty (ie. must contain a program name). Note that the "
6790 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
6794 #: ../fish/guestfish-actions.pod:744 ../src/guestfs-actions.pod:1112
6795 msgid "The return value is anything printed to I<stdout> by the command."
6799 #: ../fish/guestfish-actions.pod:747 ../src/guestfs-actions.pod:1115
6801 "If the command returns a non-zero exit status, then this function returns an "
6802 "error message. The error message string is the content of I<stderr> from "
6807 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1119
6809 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
6810 "C</bin>. If you require a program from another location, you should provide "
6811 "the full path in the first parameter."
6815 #: ../fish/guestfish-actions.pod:756 ../src/guestfs-actions.pod:1124
6817 "Shared libraries and data files required by the program must be available on "
6818 "filesystems which are mounted in the correct places. It is the caller's "
6819 "responsibility to ensure all filesystems that are needed are mounted at the "
6824 #: ../fish/guestfish-actions.pod:765
6825 msgid "command-lines"
6829 #: ../fish/guestfish-actions.pod:767
6832 " command-lines 'arguments ...'\n"
6837 #: ../fish/guestfish-actions.pod:769
6838 msgid "This is the same as L</command>, but splits the result into a list of lines."
6842 #: ../fish/guestfish-actions.pod:772
6843 msgid "See also: L</sh-lines>"
6847 #: ../fish/guestfish-actions.pod:777
6848 msgid "compress-device-out"
6852 #: ../fish/guestfish-actions.pod:779
6855 " compress-device-out ctype device (zdevice|-) [level:..]\n"
6860 #: ../fish/guestfish-actions.pod:781 ../src/guestfs-actions.pod:1174
6862 "This command compresses C<device> and writes it out to the local file "
6867 #: ../fish/guestfish-actions.pod:784
6869 "The C<ctype> and optional C<level> parameters have the same meaning as in "
6874 #: ../fish/guestfish-actions.pod:791
6875 msgid "compress-out"
6879 #: ../fish/guestfish-actions.pod:793
6882 " compress-out ctype file (zfile|-) [level:..]\n"
6887 #: ../fish/guestfish-actions.pod:795 ../src/guestfs-actions.pod:1226
6889 "This command compresses C<file> and writes it out to the local file "
6894 #: ../fish/guestfish-actions.pod:798 ../src/guestfs-actions.pod:1229
6896 "The compression program used is controlled by the C<ctype> parameter. "
6897 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
6898 "Some compression types may not be supported by particular builds of "
6899 "libguestfs, in which case you will get an error containing the substring "
6900 "\"not supported\"."
6904 #: ../fish/guestfish-actions.pod:804 ../src/guestfs-actions.pod:1235
6906 "The optional C<level> parameter controls compression level. The meaning and "
6907 "default for this parameter depends on the compression program being used."
6911 #: ../fish/guestfish-actions.pod:812
6916 #: ../fish/guestfish-actions.pod:814
6919 " config qemuparam qemuvalue\n"
6924 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1276
6926 "This can be used to add arbitrary qemu command line parameters of the form "
6927 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
6928 "setting some parameters which would interfere with parameters that we use."
6932 #: ../fish/guestfish-actions.pod:821 ../src/guestfs-actions.pod:1281
6933 msgid "The first character of C<param> string must be a C<-> (dash)."
6937 #: ../fish/guestfish-actions.pod:823 ../src/guestfs-actions.pod:1283
6938 msgid "C<value> can be NULL."
6942 #: ../fish/guestfish-actions.pod:825
6943 msgid "copy-device-to-device"
6947 #: ../fish/guestfish-actions.pod:827
6950 " copy-device-to-device src dest [srcoffset:..] [destoffset:..] [size:..]\n"
6955 #: ../fish/guestfish-actions.pod:829
6957 "The four calls L</copy-device-to-device>, L</copy-device-to-file>, "
6958 "L</copy-file-to-device>, and L</copy-file-to-file> let you copy from a "
6959 "source (device|file) to a destination (device|file)."
6963 #: ../fish/guestfish-actions.pod:836 ../src/guestfs-actions.pod:1313
6965 "Partial copies can be made since you can specify optionally the source "
6966 "offset, destination offset and size to copy. These values are all specified "
6967 "in bytes. If not given, the offsets both default to zero, and the size "
6968 "defaults to copying as much as possible until we hit the end of the source."
6972 #: ../fish/guestfish-actions.pod:842 ../src/guestfs-actions.pod:1319
6974 "The source and destination may be the same object. However overlapping "
6975 "regions may not be copied correctly."
6979 #: ../fish/guestfish-actions.pod:845 ../src/guestfs-actions.pod:1322
6981 "If the destination is a file, it is created if required. If the destination "
6982 "file is not large enough, it is extended."
6986 #: ../fish/guestfish-actions.pod:850
6987 msgid "copy-device-to-file"
6991 #: ../fish/guestfish-actions.pod:852
6994 " copy-device-to-file src dest [srcoffset:..] [destoffset:..] [size:..]\n"
6999 #: ../fish/guestfish-actions.pod:854 ../fish/guestfish-actions.pod:863 ../fish/guestfish-actions.pod:872
7000 msgid "See L</copy-device-to-device> for a general overview of this call."
7004 #: ../fish/guestfish-actions.pod:859
7005 msgid "copy-file-to-device"
7009 #: ../fish/guestfish-actions.pod:861
7012 " copy-file-to-device src dest [srcoffset:..] [destoffset:..] [size:..]\n"
7017 #: ../fish/guestfish-actions.pod:868
7018 msgid "copy-file-to-file"
7022 #: ../fish/guestfish-actions.pod:870
7025 " copy-file-to-file src dest [srcoffset:..] [destoffset:..] [size:..]\n"
7030 #: ../fish/guestfish-actions.pod:875
7032 "This is B<not> the function you want for copying files. This is for copying "
7033 "blocks within existing files. See L</cp>, L</cp-a> and L</mv> for general "
7034 "file copying and moving functions."
7038 #: ../fish/guestfish-actions.pod:882
7043 #: ../fish/guestfish-actions.pod:884
7046 " copy-size src dest size\n"
7051 #: ../fish/guestfish-actions.pod:886 ../src/guestfs-actions.pod:1529
7053 "This command copies exactly C<size> bytes from one source device or file "
7054 "C<src> to another destination device or file C<dest>."
7058 #: ../fish/guestfish-actions.pod:889 ../src/guestfs-actions.pod:1532
7060 "Note this will fail if the source is too short or if the destination is not "
7065 #: ../fish/guestfish-actions.pod:892 ../fish/guestfish-actions.pod:927
7067 "I<This function is deprecated.> In new code, use the "
7068 "L</copy_device_to_device> call instead."
7072 #: ../fish/guestfish-actions.pod:899
7077 #: ../fish/guestfish-actions.pod:901
7085 #: ../fish/guestfish-actions.pod:903 ../src/guestfs-actions.pod:1551
7087 "This copies a file from C<src> to C<dest> where C<dest> is either a "
7088 "destination filename or destination directory."
7092 #: ../fish/guestfish-actions.pod:906
7097 #: ../fish/guestfish-actions.pod:908
7105 #: ../fish/guestfish-actions.pod:910 ../src/guestfs-actions.pod:1565
7107 "This copies a file or directory from C<src> to C<dest> recursively using the "
7112 #: ../fish/guestfish-actions.pod:913
7117 #: ../fish/guestfish-actions.pod:915
7125 #: ../fish/guestfish-actions.pod:917 ../src/guestfs-actions.pod:1586
7127 "This command copies from one source device or file C<src> to another "
7128 "destination device or file C<dest>. Normally you would use this to copy to "
7129 "or from a device or partition, for example to duplicate a filesystem."
7133 #: ../fish/guestfish-actions.pod:922
7135 "If the destination is a device, it must be as large or larger than the "
7136 "source file or device, otherwise the copy will fail. This command cannot do "
7137 "partial copies (see L</copy-device-to-device>)."
7141 #: ../fish/guestfish-actions.pod:934
7146 #: ../fish/guestfish-actions.pod:936
7154 #: ../fish/guestfish-actions.pod:938 ../src/guestfs-actions.pod:1605
7155 msgid "This command runs the C<df> command to report disk space used."
7159 #: ../fish/guestfish-actions.pod:940 ../fish/guestfish-actions.pod:951
7161 "This command is mostly useful for interactive sessions. It is I<not> "
7162 "intended that you try to parse the output string. Use L</statvfs> from "
7167 #: ../fish/guestfish-actions.pod:944
7172 #: ../fish/guestfish-actions.pod:946
7180 #: ../fish/guestfish-actions.pod:948 ../src/guestfs-actions.pod:1621
7182 "This command runs the C<df -h> command to report disk space used in "
7183 "human-readable format."
7187 #: ../fish/guestfish-actions.pod:955
7192 #: ../fish/guestfish-actions.pod:957
7200 #: ../fish/guestfish-actions.pod:959 ../src/guestfs-actions.pod:1638
7202 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7203 "This is sometimes useful for extended debugging of problems."
7207 #: ../fish/guestfish-actions.pod:963
7209 "Another way to get the same information is to enable verbose messages with "
7210 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
7211 "before running the program."
7215 #: ../fish/guestfish-actions.pod:968
7220 #: ../fish/guestfish-actions.pod:970
7223 " download remotefilename (filename|-)\n"
7228 #: ../fish/guestfish-actions.pod:972 ../fish/guestfish-actions.pod:985 ../src/guestfs-actions.pod:1659 ../src/guestfs-actions.pod:1684
7230 "Download file C<remotefilename> and save it as C<filename> on the local "
7235 #: ../fish/guestfish-actions.pod:975 ../fish/guestfish-actions.pod:4981 ../src/guestfs-actions.pod:1662 ../src/guestfs-actions.pod:7668
7236 msgid "C<filename> can also be a named pipe."
7240 #: ../fish/guestfish-actions.pod:977
7241 msgid "See also L</upload>, L</cat>."
7245 #: ../fish/guestfish-actions.pod:981
7246 msgid "download-offset"
7250 #: ../fish/guestfish-actions.pod:983
7253 " download-offset remotefilename (filename|-) offset size\n"
7258 #: ../fish/guestfish-actions.pod:988 ../src/guestfs-actions.pod:1687
7260 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7261 "region must be within the file or device)."
7265 #: ../fish/guestfish-actions.pod:991
7267 "Note that there is no limit on the amount of data that can be downloaded "
7268 "with this call, unlike with L</pread>, and this call always reads the full "
7269 "amount unless an error occurs."
7273 #: ../fish/guestfish-actions.pod:996
7274 msgid "See also L</download>, L</pread>."
7278 #: ../fish/guestfish-actions.pod:1000
7283 #: ../fish/guestfish-actions.pod:1002
7286 " drop-caches whattodrop\n"
7291 #: ../fish/guestfish-actions.pod:1004 ../src/guestfs-actions.pod:1712
7293 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7294 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7295 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7299 #: ../fish/guestfish-actions.pod:1009 ../src/guestfs-actions.pod:1717
7300 msgid "Setting C<whattodrop> to 3 should drop everything."
7304 #: ../fish/guestfish-actions.pod:1011 ../src/guestfs-actions.pod:1719
7306 "This automatically calls L<sync(2)> before the operation, so that the "
7307 "maximum guest memory is freed."
7311 #: ../fish/guestfish-actions.pod:1014
7316 #: ../fish/guestfish-actions.pod:1016
7324 #: ../fish/guestfish-actions.pod:1018 ../src/guestfs-actions.pod:1732
7326 "This command runs the C<du -s> command to estimate file space usage for "
7331 #: ../fish/guestfish-actions.pod:1021 ../src/guestfs-actions.pod:1735
7333 "C<path> can be a file or a directory. If C<path> is a directory then the "
7334 "estimate includes the contents of the directory and all subdirectories "
7339 #: ../fish/guestfish-actions.pod:1025 ../src/guestfs-actions.pod:1739
7340 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7344 #: ../fish/guestfish-actions.pod:1028
7349 #: ../fish/guestfish-actions.pod:1030
7352 " e2fsck-f device\n"
7357 #: ../fish/guestfish-actions.pod:1032 ../src/guestfs-actions.pod:1757
7359 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7360 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
7365 #: ../fish/guestfish-actions.pod:1036
7367 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
7368 "should use L</fsck>."
7372 #: ../fish/guestfish-actions.pod:1039
7377 #: ../fish/guestfish-actions.pod:1041
7380 " echo-daemon 'words ...'\n"
7385 #: ../fish/guestfish-actions.pod:1043 ../src/guestfs-actions.pod:1774
7387 "This command concatenates the list of C<words> passed with single spaces "
7388 "between them and returns the resulting string."
7392 #: ../fish/guestfish-actions.pod:1046 ../src/guestfs-actions.pod:1777
7393 msgid "You can use this command to test the connection through to the daemon."
7397 #: ../fish/guestfish-actions.pod:1048
7398 msgid "See also L</ping-daemon>."
7402 #: ../fish/guestfish-actions.pod:1050
7407 #: ../fish/guestfish-actions.pod:1052
7410 " egrep regex path\n"
7415 #: ../fish/guestfish-actions.pod:1054 ../src/guestfs-actions.pod:1793
7416 msgid "This calls the external C<egrep> program and returns the matching lines."
7420 #: ../fish/guestfish-actions.pod:1060
7425 #: ../fish/guestfish-actions.pod:1062
7428 " egrepi regex path\n"
7433 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1812
7434 msgid "This calls the external C<egrep -i> program and returns the matching lines."
7438 #: ../fish/guestfish-actions.pod:1070
7443 #: ../fish/guestfish-actions.pod:1072
7446 " equal file1 file2\n"
7451 #: ../fish/guestfish-actions.pod:1074 ../src/guestfs-actions.pod:1831
7453 "This compares the two files C<file1> and C<file2> and returns true if their "
7454 "content is exactly equal, or false otherwise."
7458 #: ../fish/guestfish-actions.pod:1077 ../src/guestfs-actions.pod:1834
7459 msgid "The external L<cmp(1)> program is used for the comparison."
7463 #: ../fish/guestfish-actions.pod:1079
7468 #: ../fish/guestfish-actions.pod:1081
7476 #: ../fish/guestfish-actions.pod:1083 ../src/guestfs-actions.pod:1846
7478 "This returns C<true> if and only if there is a file, directory (or anything) "
7479 "with the given C<path> name."
7483 #: ../fish/guestfish-actions.pod:1086
7484 msgid "See also L</is-file>, L</is-dir>, L</stat>."
7488 #: ../fish/guestfish-actions.pod:1088
7493 #: ../fish/guestfish-actions.pod:1090
7496 " fallocate path len\n"
7501 #: ../fish/guestfish-actions.pod:1092 ../fish/guestfish-actions.pod:1111 ../src/guestfs-actions.pod:1869 ../src/guestfs-actions.pod:1888
7503 "This command preallocates a file (containing zero bytes) named C<path> of "
7504 "size C<len> bytes. If the file exists already, it is overwritten."
7508 #: ../fish/guestfish-actions.pod:1096 ../src/guestfs-actions.pod:1873
7510 "Do not confuse this with the guestfish-specific C<alloc> command which "
7511 "allocates a file in the host and attaches it as a device."
7515 #: ../fish/guestfish-actions.pod:1100
7517 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
7522 #: ../fish/guestfish-actions.pod:1107
7527 #: ../fish/guestfish-actions.pod:1109
7530 " fallocate64 path len\n"
7535 #: ../fish/guestfish-actions.pod:1115
7537 "Note that this call allocates disk blocks for the file. To create a sparse "
7538 "file use L</truncate-size> instead."
7542 #: ../fish/guestfish-actions.pod:1118
7544 "The deprecated call L</fallocate> does the same, but owing to an oversight "
7545 "it only allowed 30 bit lengths to be specified, effectively limiting the "
7546 "maximum size of files created through that call to 1GB."
7550 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1900
7552 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
7553 "commands which create a file in the host and attach it as a device."
7557 #: ../fish/guestfish-actions.pod:1127
7562 #: ../fish/guestfish-actions.pod:1129
7565 " fgrep pattern path\n"
7570 #: ../fish/guestfish-actions.pod:1131 ../src/guestfs-actions.pod:1915
7571 msgid "This calls the external C<fgrep> program and returns the matching lines."
7575 #: ../fish/guestfish-actions.pod:1137
7580 #: ../fish/guestfish-actions.pod:1139
7583 " fgrepi pattern path\n"
7588 #: ../fish/guestfish-actions.pod:1141 ../src/guestfs-actions.pod:1934
7589 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
7593 #: ../fish/guestfish-actions.pod:1147
7598 #: ../fish/guestfish-actions.pod:1149
7606 #: ../fish/guestfish-actions.pod:1151 ../src/guestfs-actions.pod:1952
7608 "This call uses the standard L<file(1)> command to determine the type or "
7609 "contents of the file."
7613 #: ../fish/guestfish-actions.pod:1154 ../src/guestfs-actions.pod:1955
7615 "This call will also transparently look inside various types of compressed "
7620 #: ../fish/guestfish-actions.pod:1157 ../src/guestfs-actions.pod:1958
7622 "The exact command which runs is C<file -zb path>. Note in particular that "
7623 "the filename is not prepended to the output (the I<-b> option)."
7627 #: ../fish/guestfish-actions.pod:1161 ../src/guestfs-actions.pod:1962
7629 "The output depends on the output of the underlying L<file(1)> command and it "
7630 "can change in future in ways beyond our control. In other words, the output "
7631 "is not guaranteed by the ABI."
7635 #: ../fish/guestfish-actions.pod:1165
7637 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
7638 "(etc), L</is-zero>."
7642 #: ../fish/guestfish-actions.pod:1168
7643 msgid "file-architecture"
7647 #: ../fish/guestfish-actions.pod:1170
7650 " file-architecture filename\n"
7655 #: ../fish/guestfish-actions.pod:1172 ../src/guestfs-actions.pod:1980
7657 "This detects the architecture of the binary C<filename>, and returns it if "
7662 #: ../fish/guestfish-actions.pod:1175 ../src/guestfs-actions.pod:1983
7663 msgid "Currently defined architectures are:"
7667 #: ../fish/guestfish-actions.pod:1179 ../src/guestfs-actions.pod:1987
7672 #: ../fish/guestfish-actions.pod:1181 ../src/guestfs-actions.pod:1989
7674 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7675 "irrespective of the precise processor requirements of the binary."
7679 #: ../fish/guestfish-actions.pod:1184 ../src/guestfs-actions.pod:1992
7684 #: ../fish/guestfish-actions.pod:1186 ../src/guestfs-actions.pod:1994
7685 msgid "64 bit x86-64."
7689 #: ../fish/guestfish-actions.pod:1188 ../src/guestfs-actions.pod:1996
7694 #: ../fish/guestfish-actions.pod:1190 ../src/guestfs-actions.pod:1998
7695 msgid "32 bit SPARC."
7699 #: ../fish/guestfish-actions.pod:1192 ../src/guestfs-actions.pod:2000
7704 #: ../fish/guestfish-actions.pod:1194 ../src/guestfs-actions.pod:2002
7705 msgid "64 bit SPARC V9 and above."
7709 #: ../fish/guestfish-actions.pod:1196 ../src/guestfs-actions.pod:2004
7714 #: ../fish/guestfish-actions.pod:1198 ../src/guestfs-actions.pod:2006
7715 msgid "Intel Itanium."
7719 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:2008
7724 #: ../fish/guestfish-actions.pod:1202 ../src/guestfs-actions.pod:2010
7725 msgid "32 bit Power PC."
7729 #: ../fish/guestfish-actions.pod:1204 ../src/guestfs-actions.pod:2012
7734 #: ../fish/guestfish-actions.pod:1206 ../src/guestfs-actions.pod:2014
7735 msgid "64 bit Power PC."
7739 #: ../fish/guestfish-actions.pod:1210 ../src/guestfs-actions.pod:2018
7740 msgid "Libguestfs may return other architecture strings in future."
7744 #: ../fish/guestfish-actions.pod:1212 ../src/guestfs-actions.pod:2020
7745 msgid "The function works on at least the following types of files:"
7749 #: ../fish/guestfish-actions.pod:1218 ../src/guestfs-actions.pod:2026
7750 msgid "many types of Un*x and Linux binary"
7754 #: ../fish/guestfish-actions.pod:1222 ../src/guestfs-actions.pod:2030
7755 msgid "many types of Un*x and Linux shared library"
7759 #: ../fish/guestfish-actions.pod:1226 ../src/guestfs-actions.pod:2034
7760 msgid "Windows Win32 and Win64 binaries"
7764 #: ../fish/guestfish-actions.pod:1230 ../src/guestfs-actions.pod:2038
7765 msgid "Windows Win32 and Win64 DLLs"
7769 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:2040
7770 msgid "Win32 binaries and DLLs return C<i386>."
7774 #: ../fish/guestfish-actions.pod:1234 ../src/guestfs-actions.pod:2042
7775 msgid "Win64 binaries and DLLs return C<x86_64>."
7779 #: ../fish/guestfish-actions.pod:1238 ../src/guestfs-actions.pod:2046
7780 msgid "Linux kernel modules"
7784 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:2050
7785 msgid "Linux new-style initrd images"
7789 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:2054
7790 msgid "some non-x86 Linux vmlinuz kernels"
7794 #: ../fish/guestfish-actions.pod:1250 ../src/guestfs-actions.pod:2058
7795 msgid "What it can't do currently:"
7799 #: ../fish/guestfish-actions.pod:1256 ../src/guestfs-actions.pod:2064
7800 msgid "static libraries (libfoo.a)"
7804 #: ../fish/guestfish-actions.pod:1260 ../src/guestfs-actions.pod:2068
7805 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7809 #: ../fish/guestfish-actions.pod:1264 ../src/guestfs-actions.pod:2072
7810 msgid "x86 Linux vmlinuz kernels"
7814 #: ../fish/guestfish-actions.pod:1266 ../src/guestfs-actions.pod:2074
7816 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7817 "compressed code, and are horribly hard to unpack. If you want to find the "
7818 "architecture of a kernel, use the architecture of the associated initrd or "
7819 "kernel module(s) instead."
7823 #: ../fish/guestfish-actions.pod:1273
7828 #: ../fish/guestfish-actions.pod:1275
7836 #: ../fish/guestfish-actions.pod:1277 ../src/guestfs-actions.pod:2092
7837 msgid "This command returns the size of C<file> in bytes."
7841 #: ../fish/guestfish-actions.pod:1279
7843 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
7844 "L</is-file> etc. To get the size of block devices, use "
7845 "L</blockdev-getsize64>."
7849 #: ../fish/guestfish-actions.pod:1283
7854 #: ../fish/guestfish-actions.pod:1285
7857 " fill c len path\n"
7862 #: ../fish/guestfish-actions.pod:1287 ../src/guestfs-actions.pod:2110
7864 "This command creates a new file called C<path>. The initial content of the "
7865 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
7870 #: ../fish/guestfish-actions.pod:1291
7872 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7873 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
7878 #: ../fish/guestfish-actions.pod:1296
7879 msgid "fill-pattern"
7883 #: ../fish/guestfish-actions.pod:1298
7886 " fill-pattern pattern len path\n"
7891 #: ../fish/guestfish-actions.pod:1300
7893 "This function is like L</fill> except that it creates a new file of length "
7894 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
7895 "is truncated if necessary to ensure the length of the file is exactly C<len> "
7900 #: ../fish/guestfish-actions.pod:1305
7905 #: ../fish/guestfish-actions.pod:1307
7913 #: ../fish/guestfish-actions.pod:1309 ../src/guestfs-actions.pod:2156
7915 "This command lists out all files and directories, recursively, starting at "
7916 "C<directory>. It is essentially equivalent to running the shell command "
7917 "C<find directory -print> but some post-processing happens on the output, "
7922 #: ../fish/guestfish-actions.pod:1314 ../src/guestfs-actions.pod:2161
7924 "This returns a list of strings I<without any prefix>. Thus if the directory "
7929 #: ../fish/guestfish-actions.pod:1317 ../src/guestfs-actions.pod:2164
7939 #: ../fish/guestfish-actions.pod:1321
7940 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
7944 #: ../fish/guestfish-actions.pod:1324 ../src/guestfs-actions.pod:2171
7955 #: ../fish/guestfish-actions.pod:1329 ../src/guestfs-actions.pod:2176
7956 msgid "If C<directory> is not a directory, then this command returns an error."
7960 #: ../fish/guestfish-actions.pod:1332 ../src/guestfs-actions.pod:2179
7961 msgid "The returned list is sorted."
7965 #: ../fish/guestfish-actions.pod:1334
7966 msgid "See also L</find0>."
7970 #: ../fish/guestfish-actions.pod:1339
7975 #: ../fish/guestfish-actions.pod:1341
7978 " find0 directory (files|-)\n"
7983 #: ../fish/guestfish-actions.pod:1343 ../src/guestfs-actions.pod:2199
7985 "This command lists out all files and directories, recursively, starting at "
7986 "C<directory>, placing the resulting list in the external file called "
7991 #: ../fish/guestfish-actions.pod:1347
7992 msgid "This command works the same way as L</find> with the following exceptions:"
7996 #: ../fish/guestfish-actions.pod:1354 ../src/guestfs-actions.pod:2210
7997 msgid "The resulting list is written to an external file."
8001 #: ../fish/guestfish-actions.pod:1358 ../src/guestfs-actions.pod:2214
8003 "Items (filenames) in the result are separated by C<\\0> characters. See "
8004 "L<find(1)> option I<-print0>."
8008 #: ../fish/guestfish-actions.pod:1363 ../src/guestfs-actions.pod:2219
8009 msgid "This command is not limited in the number of names that it can return."
8013 #: ../fish/guestfish-actions.pod:1368 ../src/guestfs-actions.pod:2224
8014 msgid "The result list is not sorted."
8018 #: ../fish/guestfish-actions.pod:1374
8019 msgid "findfs-label"
8023 #: ../fish/guestfish-actions.pod:1376
8026 " findfs-label label\n"
8031 #: ../fish/guestfish-actions.pod:1378 ../src/guestfs-actions.pod:2238
8033 "This command searches the filesystems and returns the one which has the "
8034 "given label. An error is returned if no such filesystem can be found."
8038 #: ../fish/guestfish-actions.pod:1382
8039 msgid "To find the label of a filesystem, use L</vfs-label>."
8043 #: ../fish/guestfish-actions.pod:1384
8048 #: ../fish/guestfish-actions.pod:1386
8051 " findfs-uuid uuid\n"
8056 #: ../fish/guestfish-actions.pod:1388 ../src/guestfs-actions.pod:2255
8058 "This command searches the filesystems and returns the one which has the "
8059 "given UUID. An error is returned if no such filesystem can be found."
8063 #: ../fish/guestfish-actions.pod:1392
8064 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
8068 #: ../fish/guestfish-actions.pod:1394
8073 #: ../fish/guestfish-actions.pod:1396
8076 " fsck fstype device\n"
8081 #: ../fish/guestfish-actions.pod:1398 ../src/guestfs-actions.pod:2273
8083 "This runs the filesystem checker (fsck) on C<device> which should have "
8084 "filesystem type C<fstype>."
8088 #: ../fish/guestfish-actions.pod:1401 ../src/guestfs-actions.pod:2276
8090 "The returned integer is the status. See L<fsck(8)> for the list of status "
8091 "codes from C<fsck>."
8095 #: ../fish/guestfish-actions.pod:1410 ../src/guestfs-actions.pod:2285
8096 msgid "Multiple status codes can be summed together."
8100 #: ../fish/guestfish-actions.pod:1414 ../src/guestfs-actions.pod:2289
8102 "A non-zero return code can mean \"success\", for example if errors have been "
8103 "corrected on the filesystem."
8107 #: ../fish/guestfish-actions.pod:1419 ../src/guestfs-actions.pod:2294
8108 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
8112 #: ../fish/guestfish-actions.pod:1424 ../src/guestfs-actions.pod:2299
8113 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
8117 #: ../fish/guestfish-actions.pod:1426
8122 #: ../fish/guestfish-actions.pod:1428
8130 #: ../fish/guestfish-actions.pod:1430 ../src/guestfs-actions.pod:2310
8132 "Return the additional kernel options which are added to the guest kernel "
8137 #: ../fish/guestfish-actions.pod:1433 ../src/guestfs-actions.pod:2313
8138 msgid "If C<NULL> then no options are added."
8142 #: ../fish/guestfish-actions.pod:1435
8143 msgid "get-attach-method"
8147 #: ../fish/guestfish-actions.pod:1437
8150 " get-attach-method\n"
8155 #: ../fish/guestfish-actions.pod:1439
8156 msgid "Return the current attach method. See L</set-attach-method>."
8160 #: ../fish/guestfish-actions.pod:1441
8161 msgid "get-autosync"
8165 #: ../fish/guestfish-actions.pod:1443
8173 #: ../fish/guestfish-actions.pod:1445 ../src/guestfs-actions.pod:2338
8174 msgid "Get the autosync flag."
8178 #: ../fish/guestfish-actions.pod:1447
8183 #: ../fish/guestfish-actions.pod:1449
8191 #: ../fish/guestfish-actions.pod:1451 ../src/guestfs-actions.pod:2349
8192 msgid "Return the direct appliance mode flag."
8196 #: ../fish/guestfish-actions.pod:1453
8201 #: ../fish/guestfish-actions.pod:1455
8204 " get-e2label device\n"
8209 #: ../fish/guestfish-actions.pod:1457 ../src/guestfs-actions.pod:2368
8210 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8214 #: ../fish/guestfish-actions.pod:1460
8216 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
8221 #: ../fish/guestfish-actions.pod:1467
8226 #: ../fish/guestfish-actions.pod:1469
8229 " get-e2uuid device\n"
8234 #: ../fish/guestfish-actions.pod:1471 ../src/guestfs-actions.pod:2389
8235 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8239 #: ../fish/guestfish-actions.pod:1474
8241 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
8246 #: ../fish/guestfish-actions.pod:1481
8251 #: ../fish/guestfish-actions.pod:1483
8259 #: ../fish/guestfish-actions.pod:1485 ../src/guestfs-actions.pod:2402
8260 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
8264 #: ../fish/guestfish-actions.pod:1488
8266 "If L</set-memsize> was not called on this handle, and if "
8267 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8268 "value for memsize."
8272 #: ../fish/guestfish-actions.pod:1492 ../fish/guestfish-actions.pod:1549 ../fish/guestfish-actions.pod:4329 ../fish/guestfish-actions.pod:4431 ../src/guestfs-actions.pod:2409 ../src/guestfs-actions.pod:2501 ../src/guestfs-actions.pod:6713 ../src/guestfs-actions.pod:6839
8273 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8277 #: ../fish/guestfish-actions.pod:1495
8282 #: ../fish/guestfish-actions.pod:1497
8290 #: ../fish/guestfish-actions.pod:1499 ../src/guestfs-actions.pod:2421
8291 msgid "This returns the enable network flag."
8295 #: ../fish/guestfish-actions.pod:1501
8300 #: ../fish/guestfish-actions.pod:1503
8308 #: ../fish/guestfish-actions.pod:1505 ../src/guestfs-actions.pod:2432
8309 msgid "Return the current search path."
8313 #: ../fish/guestfish-actions.pod:1507 ../src/guestfs-actions.pod:2434
8315 "This is always non-NULL. If it wasn't set already, then this will return "
8320 #: ../fish/guestfish-actions.pod:1510
8325 #: ../fish/guestfish-actions.pod:1512
8333 #: ../fish/guestfish-actions.pod:1514 ../src/guestfs-actions.pod:2447
8334 msgid "This returns the process group flag."
8338 #: ../fish/guestfish-actions.pod:1516
8343 #: ../fish/guestfish-actions.pod:1518
8348 #: ../fish/guestfish-actions.pod:1520
8356 #: ../fish/guestfish-actions.pod:1522 ../src/guestfs-actions.pod:2458
8358 "Return the process ID of the qemu subprocess. If there is no qemu "
8359 "subprocess, then this will return an error."
8363 #: ../fish/guestfish-actions.pod:1525 ../src/guestfs-actions.pod:2461
8364 msgid "This is an internal call used for debugging and testing."
8368 #: ../fish/guestfish-actions.pod:1527
8373 #: ../fish/guestfish-actions.pod:1529
8381 #: ../fish/guestfish-actions.pod:1531 ../src/guestfs-actions.pod:2472
8382 msgid "Return the current qemu binary."
8386 #: ../fish/guestfish-actions.pod:1533 ../src/guestfs-actions.pod:2474
8388 "This is always non-NULL. If it wasn't set already, then this will return "
8389 "the default qemu binary name."
8393 #: ../fish/guestfish-actions.pod:1536
8394 msgid "get-recovery-proc"
8398 #: ../fish/guestfish-actions.pod:1538
8401 " get-recovery-proc\n"
8406 #: ../fish/guestfish-actions.pod:1540 ../src/guestfs-actions.pod:2487
8407 msgid "Return the recovery process enabled flag."
8411 #: ../fish/guestfish-actions.pod:1542
8416 #: ../fish/guestfish-actions.pod:1544
8424 #: ../fish/guestfish-actions.pod:1546
8426 "This returns the current setting of the selinux flag which is passed to the "
8427 "appliance at boot time. See L</set-selinux>."
8431 #: ../fish/guestfish-actions.pod:1552
8436 #: ../fish/guestfish-actions.pod:1554
8444 #: ../fish/guestfish-actions.pod:1556 ../src/guestfs-actions.pod:2513
8445 msgid "This returns the number of virtual CPUs assigned to the appliance."
8449 #: ../fish/guestfish-actions.pod:1558
8454 #: ../fish/guestfish-actions.pod:1560
8462 #: ../fish/guestfish-actions.pod:1562 ../src/guestfs-actions.pod:2524
8464 "This returns the current state as an opaque integer. This is only useful "
8465 "for printing debug and internal error messages."
8469 #: ../fish/guestfish-actions.pod:1565 ../fish/guestfish-actions.pod:2524 ../fish/guestfish-actions.pod:2542 ../fish/guestfish-actions.pod:2580 ../fish/guestfish-actions.pod:2596 ../src/guestfs-actions.pod:2527 ../src/guestfs-actions.pod:3846 ../src/guestfs-actions.pod:3875 ../src/guestfs-actions.pod:3936 ../src/guestfs-actions.pod:3963
8470 msgid "For more information on states, see L<guestfs(3)>."
8474 #: ../fish/guestfish-actions.pod:1567
8479 #: ../fish/guestfish-actions.pod:1569
8487 #: ../fish/guestfish-actions.pod:1571 ../src/guestfs-actions.pod:2538
8488 msgid "Return the command trace flag."
8492 #: ../fish/guestfish-actions.pod:1573
8497 #: ../fish/guestfish-actions.pod:1575
8505 #: ../fish/guestfish-actions.pod:1577
8507 "Return the current umask. By default the umask is C<022> unless it has been "
8508 "set by calling L</umask>."
8512 #: ../fish/guestfish-actions.pod:1580
8517 #: ../fish/guestfish-actions.pod:1582
8525 #: ../fish/guestfish-actions.pod:1584 ../src/guestfs-actions.pod:2561
8526 msgid "This returns the verbose messages flag."
8530 #: ../fish/guestfish-actions.pod:1586
8535 #: ../fish/guestfish-actions.pod:1588
8543 #: ../fish/guestfish-actions.pod:1590 ../src/guestfs-actions.pod:2572
8544 msgid "This gets the SELinux security context of the daemon."
8548 #: ../fish/guestfish-actions.pod:1592
8549 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
8553 #: ../fish/guestfish-actions.pod:1595
8558 #: ../fish/guestfish-actions.pod:1597
8561 " getxattr path name\n"
8566 #: ../fish/guestfish-actions.pod:1599
8568 "Get a single extended attribute from file C<path> named C<name>. This call "
8569 "follows symlinks. If you want to lookup an extended attribute for the "
8570 "symlink itself, use L</lgetxattr>."
8574 #: ../fish/guestfish-actions.pod:1603 ../fish/guestfish-actions.pod:2669
8576 "Normally it is better to get all extended attributes from a file in one go "
8577 "by calling L</getxattrs>. However some Linux filesystem implementations are "
8578 "buggy and do not provide a way to list out attributes. For these "
8579 "filesystems (notably ntfs-3g) you have to know the names of the extended "
8580 "attributes you want in advance and call this function."
8584 #: ../fish/guestfish-actions.pod:1610 ../fish/guestfish-actions.pod:2676 ../src/guestfs-actions.pod:2601 ../src/guestfs-actions.pod:4096
8586 "Extended attribute values are blobs of binary data. If there is no extended "
8587 "attribute named C<name>, this returns an error."
8591 #: ../fish/guestfish-actions.pod:1613
8592 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
8596 #: ../fish/guestfish-actions.pod:1615
8601 #: ../fish/guestfish-actions.pod:1617
8609 #: ../fish/guestfish-actions.pod:1619 ../src/guestfs-actions.pod:2618
8610 msgid "This call lists the extended attributes of the file or directory C<path>."
8614 #: ../fish/guestfish-actions.pod:1622 ../src/guestfs-actions.pod:2621
8616 "At the system call level, this is a combination of the L<listxattr(2)> and "
8617 "L<getxattr(2)> calls."
8621 #: ../fish/guestfish-actions.pod:1625
8622 msgid "See also: L</lgetxattrs>, L<attr(5)>."
8626 #: ../fish/guestfish-actions.pod:1627
8631 #: ../fish/guestfish-actions.pod:1629
8634 " glob-expand pattern\n"
8639 #: ../fish/guestfish-actions.pod:1631 ../src/guestfs-actions.pod:2638
8641 "This command searches for all the pathnames matching C<pattern> according to "
8642 "the wildcard expansion rules used by the shell."
8646 #: ../fish/guestfish-actions.pod:1635 ../src/guestfs-actions.pod:2642
8647 msgid "If no paths match, then this returns an empty list (note: not an error)."
8651 #: ../fish/guestfish-actions.pod:1638 ../src/guestfs-actions.pod:2645
8653 "It is just a wrapper around the C L<glob(3)> function with flags "
8654 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
8658 #: ../fish/guestfish-actions.pod:1642
8663 #: ../fish/guestfish-actions.pod:1644
8666 " grep regex path\n"
8671 #: ../fish/guestfish-actions.pod:1646 ../src/guestfs-actions.pod:2662
8672 msgid "This calls the external C<grep> program and returns the matching lines."
8676 #: ../fish/guestfish-actions.pod:1652
8681 #: ../fish/guestfish-actions.pod:1654
8684 " grepi regex path\n"
8689 #: ../fish/guestfish-actions.pod:1656 ../src/guestfs-actions.pod:2681
8690 msgid "This calls the external C<grep -i> program and returns the matching lines."
8694 #: ../fish/guestfish-actions.pod:1662
8695 msgid "grub-install"
8699 #: ../fish/guestfish-actions.pod:1664
8702 " grub-install root device\n"
8707 #: ../fish/guestfish-actions.pod:1666 ../src/guestfs-actions.pod:2700
8709 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
8710 "with the root directory being C<root>."
8714 #: ../fish/guestfish-actions.pod:1675 ../src/guestfs-actions.pod:2709
8716 "There is currently no way in the API to install grub2, which is used by most "
8717 "modern Linux guests. It is possible to run the grub2 command from the "
8718 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
8722 #: ../fish/guestfish-actions.pod:1682 ../src/guestfs-actions.pod:2716
8724 "This uses C<grub-install> from the host. Unfortunately grub is not always "
8725 "compatible with itself, so this only works in rather narrow circumstances. "
8726 "Careful testing with each guest version is advisable."
8730 #: ../fish/guestfish-actions.pod:1689 ../src/guestfs-actions.pod:2723
8732 "If grub-install reports the error \"No suitable drive was found in the "
8733 "generated device map.\" it may be that you need to create a "
8734 "C</boot/grub/device.map> file first that contains the mapping between grub "
8735 "device names and Linux device names. It is usually sufficient to create a "
8740 #: ../fish/guestfish-actions.pod:1696 ../src/guestfs-actions.pod:2730
8748 #: ../fish/guestfish-actions.pod:1698 ../src/guestfs-actions.pod:2732
8749 msgid "replacing C</dev/vda> with the name of the installation device."
8753 #: ../fish/guestfish-actions.pod:1702
8758 #: ../fish/guestfish-actions.pod:1704
8766 #: ../fish/guestfish-actions.pod:1706 ../src/guestfs-actions.pod:2746
8768 "This command returns up to the first 10 lines of a file as a list of "
8773 #: ../fish/guestfish-actions.pod:1712
8778 #: ../fish/guestfish-actions.pod:1714
8781 " head-n nrlines path\n"
8786 #: ../fish/guestfish-actions.pod:1716 ../src/guestfs-actions.pod:2765
8788 "If the parameter C<nrlines> is a positive number, this returns the first "
8789 "C<nrlines> lines of the file C<path>."
8793 #: ../fish/guestfish-actions.pod:1719 ../src/guestfs-actions.pod:2768
8795 "If the parameter C<nrlines> is a negative number, this returns lines from "
8796 "the file C<path>, excluding the last C<nrlines> lines."
8800 #: ../fish/guestfish-actions.pod:1722 ../fish/guestfish-actions.pod:4821 ../src/guestfs-actions.pod:2771 ../src/guestfs-actions.pod:7427
8801 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8805 #: ../fish/guestfish-actions.pod:1727
8810 #: ../fish/guestfish-actions.pod:1729
8818 #: ../fish/guestfish-actions.pod:1731 ../src/guestfs-actions.pod:2788
8820 "This runs C<hexdump -C> on the given C<path>. The result is the "
8821 "human-readable, canonical hex dump of the file."
8825 #: ../fish/guestfish-actions.pod:1737
8830 #: ../fish/guestfish-actions.pod:1739
8833 " initrd-cat initrdpath filename\n"
8838 #: ../fish/guestfish-actions.pod:1741 ../src/guestfs-actions.pod:2807
8840 "This command unpacks the file C<filename> from the initrd file called "
8841 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8846 #: ../fish/guestfish-actions.pod:1745 ../src/guestfs-actions.pod:2811
8848 "For example, in guestfish you could use the following command to examine the "
8849 "boot script (usually called C</init>) contained in a Linux initrd or "
8854 #: ../fish/guestfish-actions.pod:1749 ../src/guestfs-actions.pod:2815
8857 " initrd-cat /boot/initrd-<version>.img init\n"
8862 #: ../fish/guestfish-actions.pod:1751
8863 msgid "See also L</initrd-list>."
8867 #: ../fish/guestfish-actions.pod:1756
8872 #: ../fish/guestfish-actions.pod:1758
8875 " initrd-list path\n"
8880 #: ../fish/guestfish-actions.pod:1760 ../src/guestfs-actions.pod:2834
8881 msgid "This command lists out files contained in an initrd."
8885 #: ../fish/guestfish-actions.pod:1762 ../src/guestfs-actions.pod:2836
8887 "The files are listed without any initial C</> character. The files are "
8888 "listed in the order they appear (not necessarily alphabetical). Directory "
8889 "names are listed as separate items."
8893 #: ../fish/guestfish-actions.pod:1766 ../src/guestfs-actions.pod:2840
8895 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8896 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8901 #: ../fish/guestfish-actions.pod:1770
8902 msgid "inotify-add-watch"
8906 #: ../fish/guestfish-actions.pod:1772
8909 " inotify-add-watch path mask\n"
8914 #: ../fish/guestfish-actions.pod:1774 ../src/guestfs-actions.pod:2857
8915 msgid "Watch C<path> for the events listed in C<mask>."
8919 #: ../fish/guestfish-actions.pod:1776 ../src/guestfs-actions.pod:2859
8921 "Note that if C<path> is a directory then events within that directory are "
8922 "watched, but this does I<not> happen recursively (in subdirectories)."
8926 #: ../fish/guestfish-actions.pod:1780 ../src/guestfs-actions.pod:2863
8928 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8929 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8933 #: ../fish/guestfish-actions.pod:1784
8934 msgid "inotify-close"
8938 #: ../fish/guestfish-actions.pod:1786
8946 #: ../fish/guestfish-actions.pod:1788 ../src/guestfs-actions.pod:2876
8948 "This closes the inotify handle which was previously opened by inotify_init. "
8949 "It removes all watches, throws away any pending events, and deallocates all "
8954 #: ../fish/guestfish-actions.pod:1792
8955 msgid "inotify-files"
8959 #: ../fish/guestfish-actions.pod:1794
8967 #: ../fish/guestfish-actions.pod:1796
8969 "This function is a helpful wrapper around L</inotify-read> which just "
8970 "returns a list of pathnames of objects that were touched. The returned "
8971 "pathnames are sorted and deduplicated."
8975 #: ../fish/guestfish-actions.pod:1800
8976 msgid "inotify-init"
8980 #: ../fish/guestfish-actions.pod:1802
8983 " inotify-init maxevents\n"
8988 #: ../fish/guestfish-actions.pod:1804 ../src/guestfs-actions.pod:2905
8990 "This command creates a new inotify handle. The inotify subsystem can be "
8991 "used to notify events which happen to objects in the guest filesystem."
8995 #: ../fish/guestfish-actions.pod:1808
8997 "C<maxevents> is the maximum number of events which will be queued up between "
8998 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
8999 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
9000 "default was 16384 events. Beyond this limit, the kernel throws away events, "
9001 "but records the fact that it threw them away by setting a flag "
9002 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
9006 #: ../fish/guestfish-actions.pod:1818
9008 "Before any events are generated, you have to add some watches to the "
9009 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
9010 "L</inotify-watch-all>."
9014 #: ../fish/guestfish-actions.pod:1824
9016 "Queued up events should be read periodically by calling L</inotify-read> (or "
9017 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
9018 "If you don't read the events out often enough then you risk the internal "
9019 "queue overflowing."
9023 #: ../fish/guestfish-actions.pod:1831
9025 "The handle should be closed after use by calling L</inotify-close>. This "
9026 "also removes any watches automatically."
9030 #: ../fish/guestfish-actions.pod:1835 ../src/guestfs-actions.pod:2936
9032 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9033 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9034 "that there is one global inotify handle per libguestfs instance."
9038 #: ../fish/guestfish-actions.pod:1840
9039 msgid "inotify-read"
9043 #: ../fish/guestfish-actions.pod:1842
9051 #: ../fish/guestfish-actions.pod:1844 ../src/guestfs-actions.pod:2950
9053 "Return the complete queue of events that have happened since the previous "
9058 #: ../fish/guestfish-actions.pod:1847 ../src/guestfs-actions.pod:2953
9059 msgid "If no events have happened, this returns an empty list."
9063 #: ../fish/guestfish-actions.pod:1849 ../src/guestfs-actions.pod:2955
9065 "I<Note>: In order to make sure that all events have been read, you must call "
9066 "this function repeatedly until it returns an empty list. The reason is that "
9067 "the call will read events up to the maximum appliance-to-host message size "
9068 "and leave remaining events in the queue."
9072 #: ../fish/guestfish-actions.pod:1855
9073 msgid "inotify-rm-watch"
9077 #: ../fish/guestfish-actions.pod:1857
9080 " inotify-rm-watch wd\n"
9085 #: ../fish/guestfish-actions.pod:1859
9086 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
9090 #: ../fish/guestfish-actions.pod:1862
9091 msgid "inspect-get-arch"
9095 #: ../fish/guestfish-actions.pod:1864
9098 " inspect-get-arch root\n"
9103 #: ../fish/guestfish-actions.pod:1866
9105 "This returns the architecture of the inspected operating system. The "
9106 "possible return values are listed under L</file-architecture>."
9110 #: ../fish/guestfish-actions.pod:1870 ../src/guestfs-actions.pod:2990
9112 "If the architecture could not be determined, then the string C<unknown> is "
9117 #: ../fish/guestfish-actions.pod:1873 ../fish/guestfish-actions.pod:1968 ../fish/guestfish-actions.pod:2047 ../fish/guestfish-actions.pod:2059 ../fish/guestfish-actions.pod:2143 ../fish/guestfish-actions.pod:2205 ../fish/guestfish-actions.pod:2226 ../fish/guestfish-actions.pod:2240 ../fish/guestfish-actions.pod:2280 ../fish/guestfish-actions.pod:2316 ../fish/guestfish-actions.pod:2329 ../fish/guestfish-actions.pod:2342 ../fish/guestfish-actions.pod:2352 ../fish/guestfish-actions.pod:2362 ../fish/guestfish-actions.pod:2374 ../fish/guestfish-actions.pod:2470 ../fish/guestfish-actions.pod:2504 ../src/guestfs-actions.pod:2993 ../src/guestfs-actions.pod:3095 ../src/guestfs-actions.pod:3199 ../src/guestfs-actions.pod:3218 ../src/guestfs-actions.pod:3349 ../src/guestfs-actions.pod:3433 ../src/guestfs-actions.pod:3461 ../src/guestfs-actions.pod:3482 ../src/guestfs-actions.pod:3535 ../src/guestfs-actions.pod:3579 ../src/guestfs-actions.pod:3599 ../src/guestfs-actions.pod:3619 ../src/guestfs-actions.pod:3636 ../src/guestfs-actions.pod:3652 ../src/guestfs-actions.pod:3670 ../src/guestfs-actions.pod:3772 ../src/guestfs-actions.pod:3813
9118 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
9122 #: ../fish/guestfish-actions.pod:1875
9123 msgid "inspect-get-distro"
9127 #: ../fish/guestfish-actions.pod:1877
9130 " inspect-get-distro root\n"
9135 #: ../fish/guestfish-actions.pod:1879 ../src/guestfs-actions.pod:3006
9136 msgid "This returns the distro (distribution) of the inspected operating system."
9140 #: ../fish/guestfish-actions.pod:1882 ../src/guestfs-actions.pod:3009
9141 msgid "Currently defined distros are:"
9145 #: ../fish/guestfish-actions.pod:1886 ../src/guestfs-actions.pod:3013
9146 msgid "\"archlinux\""
9150 #: ../fish/guestfish-actions.pod:1888 ../src/guestfs-actions.pod:3015
9155 #: ../fish/guestfish-actions.pod:1890 ../src/guestfs-actions.pod:3017
9160 #: ../fish/guestfish-actions.pod:1892 ../src/guestfs-actions.pod:3019
9165 #: ../fish/guestfish-actions.pod:1894 ../src/guestfs-actions.pod:3021
9170 #: ../fish/guestfish-actions.pod:1896 ../src/guestfs-actions.pod:3023
9175 #: ../fish/guestfish-actions.pod:1898 ../src/guestfs-actions.pod:3025
9180 #: ../fish/guestfish-actions.pod:1900 ../src/guestfs-actions.pod:3027
9185 #: ../fish/guestfish-actions.pod:1902 ../src/guestfs-actions.pod:3029
9190 #: ../fish/guestfish-actions.pod:1904 ../src/guestfs-actions.pod:3031
9195 #: ../fish/guestfish-actions.pod:1906 ../src/guestfs-actions.pod:3033
9196 msgid "\"linuxmint\""
9200 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:3035
9205 #: ../fish/guestfish-actions.pod:1910 ../src/guestfs-actions.pod:3037
9210 #: ../fish/guestfish-actions.pod:1912 ../src/guestfs-actions.pod:3039
9215 #: ../fish/guestfish-actions.pod:1914 ../src/guestfs-actions.pod:3041
9216 msgid "\"mandriva\""
9220 #: ../fish/guestfish-actions.pod:1916 ../src/guestfs-actions.pod:3043
9225 #: ../fish/guestfish-actions.pod:1918 ../src/guestfs-actions.pod:3045
9230 #: ../fish/guestfish-actions.pod:1920 ../src/guestfs-actions.pod:3047
9235 #: ../fish/guestfish-actions.pod:1922 ../src/guestfs-actions.pod:3049
9236 msgid "\"opensuse\""
9240 #: ../fish/guestfish-actions.pod:1924 ../src/guestfs-actions.pod:3051
9245 #: ../fish/guestfish-actions.pod:1926 ../src/guestfs-actions.pod:3053
9250 #: ../fish/guestfish-actions.pod:1928 ../src/guestfs-actions.pod:3055
9255 #: ../fish/guestfish-actions.pod:1930 ../src/guestfs-actions.pod:3057
9256 msgid "\"redhat-based\""
9260 #: ../fish/guestfish-actions.pod:1932 ../src/guestfs-actions.pod:3059
9261 msgid "Some Red Hat-derived distro."
9265 #: ../fish/guestfish-actions.pod:1934 ../src/guestfs-actions.pod:3061
9270 #: ../fish/guestfish-actions.pod:1936 ../src/guestfs-actions.pod:3063
9271 msgid "Red Hat Enterprise Linux."
9275 #: ../fish/guestfish-actions.pod:1938 ../src/guestfs-actions.pod:3065
9276 msgid "\"scientificlinux\""
9280 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:3067
9281 msgid "Scientific Linux."
9285 #: ../fish/guestfish-actions.pod:1942 ../src/guestfs-actions.pod:3069
9286 msgid "\"slackware\""
9290 #: ../fish/guestfish-actions.pod:1944 ../src/guestfs-actions.pod:3071
9295 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:3073
9296 msgid "\"ttylinux\""
9300 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:3075
9305 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:3077
9310 #: ../fish/guestfish-actions.pod:1952 ../src/guestfs-actions.pod:3079
9315 #: ../fish/guestfish-actions.pod:1954 ../fish/guestfish-actions.pod:2038 ../fish/guestfish-actions.pod:2307 ../src/guestfs-actions.pod:3081 ../src/guestfs-actions.pod:3190 ../src/guestfs-actions.pod:3570
9320 #: ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:3083
9321 msgid "The distro could not be determined."
9325 #: ../fish/guestfish-actions.pod:1958 ../fish/guestfish-actions.pod:2295 ../src/guestfs-actions.pod:3085 ../src/guestfs-actions.pod:3558
9330 #: ../fish/guestfish-actions.pod:1960 ../src/guestfs-actions.pod:3087
9332 "Windows does not have distributions. This string is returned if the OS type "
9337 #: ../fish/guestfish-actions.pod:1965 ../fish/guestfish-actions.pod:2044 ../fish/guestfish-actions.pod:2313 ../src/guestfs-actions.pod:3092 ../src/guestfs-actions.pod:3196 ../src/guestfs-actions.pod:3576
9339 "Future versions of libguestfs may return other strings here. The caller "
9340 "should be prepared to handle any string."
9344 #: ../fish/guestfish-actions.pod:1970
9345 msgid "inspect-get-drive-mappings"
9349 #: ../fish/guestfish-actions.pod:1972
9352 " inspect-get-drive-mappings root\n"
9357 #: ../fish/guestfish-actions.pod:1974 ../src/guestfs-actions.pod:3108
9359 "This call is useful for Windows which uses a primitive system of assigning "
9360 "drive letters (like \"C:\") to partitions. This inspection API examines the "
9361 "Windows Registry to find out how disks/partitions are mapped to drive "
9362 "letters, and returns a hash table as in the example below:"
9366 #: ../fish/guestfish-actions.pod:1980 ../src/guestfs-actions.pod:3114
9376 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:3118
9378 "Note that keys are drive letters. For Windows, the key is case insensitive "
9379 "and just contains the drive letter, without the customary colon separator "
9384 #: ../fish/guestfish-actions.pod:1988 ../src/guestfs-actions.pod:3122
9386 "In future we may support other operating systems that also used drive "
9387 "letters, but the keys for those might not be case insensitive and might be "
9388 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
9393 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:3127
9395 "For Windows guests, currently only hard drive mappings are returned. "
9396 "Removable disks (eg. DVD-ROMs) are ignored."
9400 #: ../fish/guestfish-actions.pod:1996 ../src/guestfs-actions.pod:3130
9402 "For guests that do not use drive mappings, or if the drive mappings could "
9403 "not be determined, this returns an empty hash table."
9407 #: ../fish/guestfish-actions.pod:1999
9409 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9410 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
9414 #: ../fish/guestfish-actions.pod:2003
9415 msgid "inspect-get-filesystems"
9419 #: ../fish/guestfish-actions.pod:2005
9422 " inspect-get-filesystems root\n"
9427 #: ../fish/guestfish-actions.pod:2007 ../src/guestfs-actions.pod:3151
9429 "This returns a list of all the filesystems that we think are associated with "
9430 "this operating system. This includes the root filesystem, other ordinary "
9431 "filesystems, and non-mounted devices like swap partitions."
9435 #: ../fish/guestfish-actions.pod:2012 ../src/guestfs-actions.pod:3156
9437 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9438 "to be shared between operating systems."
9442 #: ../fish/guestfish-actions.pod:2015
9444 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9445 "L</inspect-get-mountpoints>."
9449 #: ../fish/guestfish-actions.pod:2018
9450 msgid "inspect-get-format"
9454 #: ../fish/guestfish-actions.pod:2020
9457 " inspect-get-format root\n"
9462 #: ../fish/guestfish-actions.pod:2022 ../src/guestfs-actions.pod:3174
9464 "This returns the format of the inspected operating system. You can use it "
9465 "to detect install images, live CDs and similar."
9469 #: ../fish/guestfish-actions.pod:2025 ../src/guestfs-actions.pod:3177
9470 msgid "Currently defined formats are:"
9474 #: ../fish/guestfish-actions.pod:2029 ../src/guestfs-actions.pod:3181
9475 msgid "\"installed\""
9479 #: ../fish/guestfish-actions.pod:2031 ../src/guestfs-actions.pod:3183
9480 msgid "This is an installed operating system."
9484 #: ../fish/guestfish-actions.pod:2033 ../src/guestfs-actions.pod:3185
9485 msgid "\"installer\""
9489 #: ../fish/guestfish-actions.pod:2035 ../src/guestfs-actions.pod:3187
9491 "The disk image being inspected is not an installed operating system, but a "
9492 "I<bootable> install disk, live CD, or similar."
9496 #: ../fish/guestfish-actions.pod:2040 ../src/guestfs-actions.pod:3192
9497 msgid "The format of this disk image is not known."
9501 #: ../fish/guestfish-actions.pod:2049
9502 msgid "inspect-get-hostname"
9506 #: ../fish/guestfish-actions.pod:2051
9509 " inspect-get-hostname root\n"
9514 #: ../fish/guestfish-actions.pod:2053 ../src/guestfs-actions.pod:3212
9516 "This function returns the hostname of the operating system as found by "
9517 "inspection of the guest's configuration files."
9521 #: ../fish/guestfish-actions.pod:2056 ../src/guestfs-actions.pod:3215
9523 "If the hostname could not be determined, then the string C<unknown> is "
9528 #: ../fish/guestfish-actions.pod:2061
9529 msgid "inspect-get-icon"
9533 #: ../fish/guestfish-actions.pod:2063
9536 " inspect-get-icon root [favicon:..] [highquality:..]\n"
9541 #: ../fish/guestfish-actions.pod:2065 ../src/guestfs-actions.pod:3241
9543 "This function returns an icon corresponding to the inspected operating "
9544 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
9545 "to PNG if necessary)."
9549 #: ../fish/guestfish-actions.pod:2069 ../src/guestfs-actions.pod:3245
9551 "If it was not possible to get an icon this function returns a zero-length "
9552 "(non-NULL) buffer. I<Callers must check for this case>."
9556 #: ../fish/guestfish-actions.pod:2072 ../src/guestfs-actions.pod:3248
9558 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
9559 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
9560 "this file will be returned. You can disable favicons by passing the "
9561 "optional C<favicon> boolean as false (default is true)."
9565 #: ../fish/guestfish-actions.pod:2078 ../src/guestfs-actions.pod:3254
9567 "If finding the favicon fails, then we look in other places in the guest for "
9572 #: ../fish/guestfish-actions.pod:2081 ../src/guestfs-actions.pod:3257
9574 "If the optional C<highquality> boolean is true then only high quality icons "
9575 "are returned, which means only icons of high resolution with an alpha "
9576 "channel. The default (false) is to return any icon we can, even if it is of "
9577 "substandard quality."
9581 #: ../fish/guestfish-actions.pod:2092 ../src/guestfs-actions.pod:3268
9583 "Unlike most other inspection API calls, the guest's disks must be mounted up "
9584 "before you call this, since it needs to read information from the guest "
9585 "filesystem during the call."
9589 #: ../fish/guestfish-actions.pod:2098 ../src/guestfs-actions.pod:3274
9591 "B<Security:> The icon data comes from the untrusted guest, and should be "
9592 "treated with caution. PNG files have been known to contain exploits. "
9593 "Ensure that libpng (or other relevant libraries) are fully up to date before "
9594 "trying to process or display the icon."
9598 #: ../fish/guestfish-actions.pod:2106 ../src/guestfs-actions.pod:3282
9600 "The PNG image returned can be any size. It might not be square. Libguestfs "
9601 "tries to return the largest, highest quality icon available. The "
9602 "application must scale the icon to the required size."
9606 #: ../fish/guestfish-actions.pod:2113 ../src/guestfs-actions.pod:3289
9608 "Extracting icons from Windows guests requires the external C<wrestool> "
9609 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
9610 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
9611 "installed separately."
9615 #: ../fish/guestfish-actions.pod:2120 ../src/guestfs-actions.pod:3296
9617 "Operating system icons are usually trademarks. Seek legal advice before "
9618 "using trademarks in applications."
9622 #: ../fish/guestfish-actions.pod:2127
9623 msgid "inspect-get-major-version"
9627 #: ../fish/guestfish-actions.pod:2129
9630 " inspect-get-major-version root\n"
9635 #: ../fish/guestfish-actions.pod:2131 ../src/guestfs-actions.pod:3337
9636 msgid "This returns the major version number of the inspected operating system."
9640 #: ../fish/guestfish-actions.pod:2134 ../src/guestfs-actions.pod:3340
9642 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9643 "popular public names used by the operating system. Notably the operating "
9644 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9645 "1). You can find out the real versions corresponding to releases of Windows "
9646 "by consulting Wikipedia or MSDN."
9650 #: ../fish/guestfish-actions.pod:2141 ../fish/guestfish-actions.pod:2152 ../src/guestfs-actions.pod:3347 ../src/guestfs-actions.pod:3364
9651 msgid "If the version could not be determined, then C<0> is returned."
9655 #: ../fish/guestfish-actions.pod:2145
9656 msgid "inspect-get-minor-version"
9660 #: ../fish/guestfish-actions.pod:2147
9663 " inspect-get-minor-version root\n"
9668 #: ../fish/guestfish-actions.pod:2149 ../src/guestfs-actions.pod:3361
9669 msgid "This returns the minor version number of the inspected operating system."
9673 #: ../fish/guestfish-actions.pod:2154
9675 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9676 "L</inspect-get-major-version>."
9680 #: ../fish/guestfish-actions.pod:2157
9681 msgid "inspect-get-mountpoints"
9685 #: ../fish/guestfish-actions.pod:2159
9688 " inspect-get-mountpoints root\n"
9693 #: ../fish/guestfish-actions.pod:2161 ../src/guestfs-actions.pod:3379
9695 "This returns a hash of where we think the filesystems associated with this "
9696 "operating system should be mounted. Callers should note that this is at "
9697 "best an educated guess made by reading configuration files such as "
9698 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
9699 "are non-existent or not mountable and callers should be prepared to handle "
9700 "or ignore failures if they try to mount them."
9704 #: ../fish/guestfish-actions.pod:2170 ../src/guestfs-actions.pod:3388
9706 "Each element in the returned hashtable has a key which is the path of the "
9707 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9708 "mounted there (eg. C</dev/sda1>)."
9712 #: ../fish/guestfish-actions.pod:2175 ../src/guestfs-actions.pod:3393
9713 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
9717 #: ../fish/guestfish-actions.pod:2178
9719 "For operating systems like Windows which still use drive letters, this call "
9720 "will only return an entry for the first drive \"mounted on\" C</>. For "
9721 "information about the mapping of drive letters to partitions, see "
9722 "L</inspect-get-drive-mappings>."
9726 #: ../fish/guestfish-actions.pod:2184
9728 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9729 "L</inspect-get-filesystems>."
9733 #: ../fish/guestfish-actions.pod:2187
9734 msgid "inspect-get-package-format"
9738 #: ../fish/guestfish-actions.pod:2189
9741 " inspect-get-package-format root\n"
9746 #: ../fish/guestfish-actions.pod:2191
9748 "This function and L</inspect-get-package-management> return the package "
9749 "format and package management tool used by the inspected operating system. "
9750 "For example for Fedora these functions would return C<rpm> (package format) "
9751 "and C<yum> (package management)."
9755 #: ../fish/guestfish-actions.pod:2197 ../src/guestfs-actions.pod:3425
9757 "This returns the string C<unknown> if we could not determine the package "
9758 "format I<or> if the operating system does not have a real packaging system "
9763 #: ../fish/guestfish-actions.pod:2201 ../src/guestfs-actions.pod:3429
9765 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
9766 "C<pkgsrc>. Future versions of libguestfs may return other strings."
9770 #: ../fish/guestfish-actions.pod:2207
9771 msgid "inspect-get-package-management"
9775 #: ../fish/guestfish-actions.pod:2209
9778 " inspect-get-package-management root\n"
9783 #: ../fish/guestfish-actions.pod:2211
9785 "L</inspect-get-package-format> and this function return the package format "
9786 "and package management tool used by the inspected operating system. For "
9787 "example for Fedora these functions would return C<rpm> (package format) and "
9788 "C<yum> (package management)."
9792 #: ../fish/guestfish-actions.pod:2217 ../src/guestfs-actions.pod:3452
9794 "This returns the string C<unknown> if we could not determine the package "
9795 "management tool I<or> if the operating system does not have a real packaging "
9796 "system (eg. Windows)."
9800 #: ../fish/guestfish-actions.pod:2221 ../src/guestfs-actions.pod:3456
9802 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9803 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
9804 "versions of libguestfs may return other strings."
9808 #: ../fish/guestfish-actions.pod:2228
9809 msgid "inspect-get-product-name"
9813 #: ../fish/guestfish-actions.pod:2230
9816 " inspect-get-product-name root\n"
9821 #: ../fish/guestfish-actions.pod:2232 ../src/guestfs-actions.pod:3474
9823 "This returns the product name of the inspected operating system. The "
9824 "product name is generally some freeform string which can be displayed to the "
9825 "user, but should not be parsed by programs."
9829 #: ../fish/guestfish-actions.pod:2237 ../src/guestfs-actions.pod:3479
9831 "If the product name could not be determined, then the string C<unknown> is "
9836 #: ../fish/guestfish-actions.pod:2242
9837 msgid "inspect-get-product-variant"
9841 #: ../fish/guestfish-actions.pod:2244
9844 " inspect-get-product-variant root\n"
9849 #: ../fish/guestfish-actions.pod:2246 ../src/guestfs-actions.pod:3495
9850 msgid "This returns the product variant of the inspected operating system."
9854 #: ../fish/guestfish-actions.pod:2249 ../src/guestfs-actions.pod:3498
9856 "For Windows guests, this returns the contents of the Registry key "
9857 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
9858 "which is usually a string such as C<Client> or C<Server> (other values are "
9859 "possible). This can be used to distinguish consumer and enterprise versions "
9860 "of Windows that have the same version number (for example, Windows 7 and "
9861 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
9862 "the latter is C<Server>)."
9866 #: ../fish/guestfish-actions.pod:2258 ../src/guestfs-actions.pod:3507
9868 "For enterprise Linux guests, in future we intend this to return the product "
9869 "variant such as C<Desktop>, C<Server> and so on. But this is not "
9870 "implemented at present."
9874 #: ../fish/guestfish-actions.pod:2262 ../src/guestfs-actions.pod:3511
9876 "If the product variant could not be determined, then the string C<unknown> "
9881 #: ../fish/guestfish-actions.pod:2265
9883 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9884 "L</inspect-get-product-name>, L</inspect-get-major-version>."
9888 #: ../fish/guestfish-actions.pod:2269
9889 msgid "inspect-get-roots"
9893 #: ../fish/guestfish-actions.pod:2271
9896 " inspect-get-roots\n"
9901 #: ../fish/guestfish-actions.pod:2273
9903 "This function is a convenient way to get the list of root devices, as "
9904 "returned from a previous call to L</inspect-os>, but without redoing the "
9905 "whole inspection process."
9909 #: ../fish/guestfish-actions.pod:2277
9911 "This returns an empty list if either no root devices were found or the "
9912 "caller has not called L</inspect-os>."
9916 #: ../fish/guestfish-actions.pod:2282
9917 msgid "inspect-get-type"
9921 #: ../fish/guestfish-actions.pod:2284
9924 " inspect-get-type root\n"
9929 #: ../fish/guestfish-actions.pod:2286 ../src/guestfs-actions.pod:3549
9931 "This returns the type of the inspected operating system. Currently defined "
9936 #: ../fish/guestfish-actions.pod:2291 ../src/guestfs-actions.pod:3554
9941 #: ../fish/guestfish-actions.pod:2293 ../src/guestfs-actions.pod:3556
9942 msgid "Any Linux-based operating system."
9946 #: ../fish/guestfish-actions.pod:2297 ../src/guestfs-actions.pod:3560
9947 msgid "Any Microsoft Windows operating system."
9951 #: ../fish/guestfish-actions.pod:2299 ../src/guestfs-actions.pod:3562
9956 #: ../fish/guestfish-actions.pod:2301 ../src/guestfs-actions.pod:3564
9961 #: ../fish/guestfish-actions.pod:2303 ../src/guestfs-actions.pod:3566
9966 #: ../fish/guestfish-actions.pod:2305 ../src/guestfs-actions.pod:3568
9971 #: ../fish/guestfish-actions.pod:2309 ../src/guestfs-actions.pod:3572
9972 msgid "The operating system type could not be determined."
9976 #: ../fish/guestfish-actions.pod:2318
9977 msgid "inspect-get-windows-current-control-set"
9981 #: ../fish/guestfish-actions.pod:2320
9984 " inspect-get-windows-current-control-set root\n"
9989 #: ../fish/guestfish-actions.pod:2322 ../src/guestfs-actions.pod:3592
9991 "This returns the Windows CurrentControlSet of the inspected guest. The "
9992 "CurrentControlSet is a registry key name such as C<ControlSet001>."
9996 #: ../fish/guestfish-actions.pod:2325 ../src/guestfs-actions.pod:3595
9998 "This call assumes that the guest is Windows and that the Registry could be "
9999 "examined by inspection. If this is not the case then an error is returned."
10003 #: ../fish/guestfish-actions.pod:2331
10004 msgid "inspect-get-windows-systemroot"
10008 #: ../fish/guestfish-actions.pod:2333
10011 " inspect-get-windows-systemroot root\n"
10016 #: ../fish/guestfish-actions.pod:2335 ../src/guestfs-actions.pod:3612
10018 "This returns the Windows systemroot of the inspected guest. The systemroot "
10019 "is a directory path such as C</WINDOWS>."
10023 #: ../fish/guestfish-actions.pod:2338 ../src/guestfs-actions.pod:3615
10025 "This call assumes that the guest is Windows and that the systemroot could be "
10026 "determined by inspection. If this is not the case then an error is "
10031 #: ../fish/guestfish-actions.pod:2344
10032 msgid "inspect-is-live"
10036 #: ../fish/guestfish-actions.pod:2346
10039 " inspect-is-live root\n"
10044 #: ../fish/guestfish-actions.pod:2348
10046 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10047 "then this returns true if a live image was detected on the disk."
10051 #: ../fish/guestfish-actions.pod:2354
10052 msgid "inspect-is-multipart"
10056 #: ../fish/guestfish-actions.pod:2356
10059 " inspect-is-multipart root\n"
10064 #: ../fish/guestfish-actions.pod:2358
10066 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10067 "then this returns true if the disk is part of a set."
10071 #: ../fish/guestfish-actions.pod:2364
10072 msgid "inspect-is-netinst"
10076 #: ../fish/guestfish-actions.pod:2366
10079 " inspect-is-netinst root\n"
10084 #: ../fish/guestfish-actions.pod:2368
10086 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10087 "then this returns true if the disk is a network installer, ie. not a "
10088 "self-contained install CD but one which is likely to require network access "
10089 "to complete the install."
10093 #: ../fish/guestfish-actions.pod:2376
10094 msgid "inspect-list-applications"
10098 #: ../fish/guestfish-actions.pod:2378
10101 " inspect-list-applications root\n"
10106 #: ../fish/guestfish-actions.pod:2380 ../src/guestfs-actions.pod:3682
10107 msgid "Return the list of applications installed in the operating system."
10111 #: ../fish/guestfish-actions.pod:2382
10113 "I<Note:> This call works differently from other parts of the inspection "
10114 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
10115 "then mount up the disks, before calling this. Listing applications is a "
10116 "significantly more difficult operation which requires access to the full "
10117 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
10118 "are just returning data cached in the libguestfs handle, this call actually "
10119 "reads parts of the mounted filesystems during the call."
10123 #: ../fish/guestfish-actions.pod:2392 ../src/guestfs-actions.pod:3694
10125 "This returns an empty list if the inspection code was not able to determine "
10126 "the list of applications."
10130 #: ../fish/guestfish-actions.pod:2395 ../src/guestfs-actions.pod:3697
10131 msgid "The application structure contains the following fields:"
10135 #: ../fish/guestfish-actions.pod:2399 ../src/guestfs-actions.pod:3701
10136 msgid "C<app_name>"
10140 #: ../fish/guestfish-actions.pod:2401 ../src/guestfs-actions.pod:3703
10142 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10143 "guests, this is the package name."
10147 #: ../fish/guestfish-actions.pod:2404 ../src/guestfs-actions.pod:3706
10148 msgid "C<app_display_name>"
10152 #: ../fish/guestfish-actions.pod:2406 ../src/guestfs-actions.pod:3708
10154 "The display name of the application, sometimes localized to the install "
10155 "language of the guest operating system."
10159 #: ../fish/guestfish-actions.pod:2409 ../src/guestfs-actions.pod:3711
10161 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10162 "to display something can use C<app_name> instead."
10166 #: ../fish/guestfish-actions.pod:2412 ../src/guestfs-actions.pod:3714
10167 msgid "C<app_epoch>"
10171 #: ../fish/guestfish-actions.pod:2414 ../src/guestfs-actions.pod:3716
10173 "For package managers which use epochs, this contains the epoch of the "
10174 "package (an integer). If unavailable, this is returned as C<0>."
10178 #: ../fish/guestfish-actions.pod:2417 ../src/guestfs-actions.pod:3719
10179 msgid "C<app_version>"
10183 #: ../fish/guestfish-actions.pod:2419 ../src/guestfs-actions.pod:3721
10185 "The version string of the application or package. If unavailable this is "
10186 "returned as an empty string C<\"\">."
10190 #: ../fish/guestfish-actions.pod:2422 ../src/guestfs-actions.pod:3724
10191 msgid "C<app_release>"
10195 #: ../fish/guestfish-actions.pod:2424 ../src/guestfs-actions.pod:3726
10197 "The release string of the application or package, for package managers that "
10198 "use this. If unavailable this is returned as an empty string C<\"\">."
10202 #: ../fish/guestfish-actions.pod:2428 ../src/guestfs-actions.pod:3730
10203 msgid "C<app_install_path>"
10207 #: ../fish/guestfish-actions.pod:2430 ../src/guestfs-actions.pod:3732
10209 "The installation path of the application (on operating systems such as "
10210 "Windows which use installation paths). This path is in the format used by "
10211 "the guest operating system, it is not a libguestfs path."
10215 #: ../fish/guestfish-actions.pod:2435 ../src/guestfs-actions.pod:3737
10216 msgid "If unavailable this is returned as an empty string C<\"\">."
10220 #: ../fish/guestfish-actions.pod:2437 ../src/guestfs-actions.pod:3739
10221 msgid "C<app_trans_path>"
10225 #: ../fish/guestfish-actions.pod:2439 ../src/guestfs-actions.pod:3741
10227 "The install path translated into a libguestfs path. If unavailable this is "
10228 "returned as an empty string C<\"\">."
10232 #: ../fish/guestfish-actions.pod:2442 ../src/guestfs-actions.pod:3744
10233 msgid "C<app_publisher>"
10237 #: ../fish/guestfish-actions.pod:2444 ../src/guestfs-actions.pod:3746
10239 "The name of the publisher of the application, for package managers that use "
10240 "this. If unavailable this is returned as an empty string C<\"\">."
10244 #: ../fish/guestfish-actions.pod:2448 ../src/guestfs-actions.pod:3750
10249 #: ../fish/guestfish-actions.pod:2450 ../src/guestfs-actions.pod:3752
10251 "The URL (eg. upstream URL) of the application. If unavailable this is "
10252 "returned as an empty string C<\"\">."
10256 #: ../fish/guestfish-actions.pod:2453 ../src/guestfs-actions.pod:3755
10257 msgid "C<app_source_package>"
10261 #: ../fish/guestfish-actions.pod:2455 ../src/guestfs-actions.pod:3757
10263 "For packaging systems which support this, the name of the source package. "
10264 "If unavailable this is returned as an empty string C<\"\">."
10268 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3760
10269 msgid "C<app_summary>"
10273 #: ../fish/guestfish-actions.pod:2460 ../src/guestfs-actions.pod:3762
10275 "A short (usually one line) description of the application or package. If "
10276 "unavailable this is returned as an empty string C<\"\">."
10280 #: ../fish/guestfish-actions.pod:2463 ../src/guestfs-actions.pod:3765
10281 msgid "C<app_description>"
10285 #: ../fish/guestfish-actions.pod:2465 ../src/guestfs-actions.pod:3767
10287 "A longer description of the application or package. If unavailable this is "
10288 "returned as an empty string C<\"\">."
10292 #: ../fish/guestfish-actions.pod:2472
10297 #: ../fish/guestfish-actions.pod:2474
10305 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3785
10307 "This function uses other libguestfs functions and certain heuristics to "
10308 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10309 "for operating systems."
10313 #: ../fish/guestfish-actions.pod:2480 ../src/guestfs-actions.pod:3789
10314 msgid "The list returned is empty if no operating systems were found."
10318 #: ../fish/guestfish-actions.pod:2482 ../src/guestfs-actions.pod:3791
10320 "If one operating system was found, then this returns a list with a single "
10321 "element, which is the name of the root filesystem of this operating system. "
10322 "It is also possible for this function to return a list containing more than "
10323 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10324 "element being the root filesystem of one of the operating systems."
10328 #: ../fish/guestfish-actions.pod:2489
10330 "You can pass the root string(s) returned to other L</inspect-get-*> "
10331 "functions in order to query further information about each operating system, "
10332 "such as the name and version."
10336 #: ../fish/guestfish-actions.pod:2494
10338 "This function uses other libguestfs features such as L</mount-ro> and "
10339 "L</umount-all> in order to mount and unmount filesystems and look at the "
10340 "contents. This should be called with no disks currently mounted. The "
10341 "function may also use Augeas, so any existing Augeas handle will be closed."
10345 #: ../fish/guestfish-actions.pod:2500 ../src/guestfs-actions.pod:3809
10347 "This function cannot decrypt encrypted disks. The caller must do that first "
10348 "(supplying the necessary keys) if the disk is encrypted."
10352 #: ../fish/guestfish-actions.pod:2506 ../fish/guestfish-actions.pod:2704 ../fish/guestfish-actions.pod:2763
10353 msgid "See also L</list-filesystems>."
10357 #: ../fish/guestfish-actions.pod:2508
10358 msgid "is-blockdev"
10362 #: ../fish/guestfish-actions.pod:2510
10365 " is-blockdev path\n"
10370 #: ../fish/guestfish-actions.pod:2512 ../src/guestfs-actions.pod:3829
10372 "This returns C<true> if and only if there is a block device with the given "
10377 #: ../fish/guestfish-actions.pod:2515 ../fish/guestfish-actions.pod:2533 ../fish/guestfish-actions.pod:2552 ../fish/guestfish-actions.pod:2561 ../fish/guestfish-actions.pod:2571 ../fish/guestfish-actions.pod:2605 ../fish/guestfish-actions.pod:2614
10378 msgid "See also L</stat>."
10382 #: ../fish/guestfish-actions.pod:2517
10387 #: ../fish/guestfish-actions.pod:2519
10395 #: ../fish/guestfish-actions.pod:2521 ../src/guestfs-actions.pod:3843
10397 "This returns true iff this handle is busy processing a command (in the "
10402 #: ../fish/guestfish-actions.pod:2526
10407 #: ../fish/guestfish-actions.pod:2528
10410 " is-chardev path\n"
10415 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3858
10417 "This returns C<true> if and only if there is a character device with the "
10418 "given C<path> name."
10422 #: ../fish/guestfish-actions.pod:2535
10427 #: ../fish/guestfish-actions.pod:2537
10435 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3872
10437 "This returns true iff this handle is being configured (in the C<CONFIG> "
10442 #: ../fish/guestfish-actions.pod:2544
10447 #: ../fish/guestfish-actions.pod:2546
10455 #: ../fish/guestfish-actions.pod:2548 ../src/guestfs-actions.pod:3887
10457 "This returns C<true> if and only if there is a directory with the given "
10458 "C<path> name. Note that it returns false for other objects like files."
10462 #: ../fish/guestfish-actions.pod:2554
10467 #: ../fish/guestfish-actions.pod:2556
10475 #: ../fish/guestfish-actions.pod:2558 ../src/guestfs-actions.pod:3903
10477 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
10478 "given C<path> name."
10482 #: ../fish/guestfish-actions.pod:2563
10487 #: ../fish/guestfish-actions.pod:2565
10495 #: ../fish/guestfish-actions.pod:2567 ../src/guestfs-actions.pod:3918
10497 "This returns C<true> if and only if there is a regular file with the given "
10498 "C<path> name. Note that it returns false for other objects like "
10503 #: ../fish/guestfish-actions.pod:2573
10504 msgid "is-launching"
10508 #: ../fish/guestfish-actions.pod:2575
10516 #: ../fish/guestfish-actions.pod:2577 ../src/guestfs-actions.pod:3933
10518 "This returns true iff this handle is launching the subprocess (in the "
10519 "C<LAUNCHING> state)."
10523 #: ../fish/guestfish-actions.pod:2582
10528 #: ../fish/guestfish-actions.pod:2584
10536 #: ../fish/guestfish-actions.pod:2586 ../src/guestfs-actions.pod:3948
10538 "This command tests whether C<device> is a logical volume, and returns true "
10539 "iff this is the case."
10543 #: ../fish/guestfish-actions.pod:2589
10548 #: ../fish/guestfish-actions.pod:2591
10556 #: ../fish/guestfish-actions.pod:2593 ../src/guestfs-actions.pod:3960
10558 "This returns true iff this handle is ready to accept commands (in the "
10563 #: ../fish/guestfish-actions.pod:2598
10568 #: ../fish/guestfish-actions.pod:2600
10571 " is-socket path\n"
10576 #: ../fish/guestfish-actions.pod:2602 ../src/guestfs-actions.pod:3975
10578 "This returns C<true> if and only if there is a Unix domain socket with the "
10579 "given C<path> name."
10583 #: ../fish/guestfish-actions.pod:2607
10588 #: ../fish/guestfish-actions.pod:2609
10591 " is-symlink path\n"
10596 #: ../fish/guestfish-actions.pod:2611 ../src/guestfs-actions.pod:3990
10598 "This returns C<true> if and only if there is a symbolic link with the given "
10603 #: ../fish/guestfish-actions.pod:2616
10608 #: ../fish/guestfish-actions.pod:2618
10616 #: ../fish/guestfish-actions.pod:2620 ../src/guestfs-actions.pod:4005
10618 "This returns true iff the file exists and the file is empty or it contains "
10623 #: ../fish/guestfish-actions.pod:2623
10624 msgid "is-zero-device"
10628 #: ../fish/guestfish-actions.pod:2625
10631 " is-zero-device device\n"
10636 #: ../fish/guestfish-actions.pod:2627 ../src/guestfs-actions.pod:4018
10637 msgid "This returns true iff the device exists and contains all zero bytes."
10641 #: ../fish/guestfish-actions.pod:2629 ../src/guestfs-actions.pod:4020
10642 msgid "Note that for large devices this can take a long time to run."
10646 #: ../fish/guestfish-actions.pod:2631
10647 msgid "kill-subprocess"
10651 #: ../fish/guestfish-actions.pod:2633
10654 " kill-subprocess\n"
10659 #: ../fish/guestfish-actions.pod:2635 ../src/guestfs-actions.pod:4031
10660 msgid "This kills the qemu subprocess. You should never need to call this."
10664 #: ../fish/guestfish-actions.pod:2637
10669 #: ../fish/guestfish-actions.pod:2639
10674 #: ../fish/guestfish-actions.pod:2641
10682 #: ../fish/guestfish-actions.pod:2643 ../src/guestfs-actions.pod:4042
10684 "Internally libguestfs is implemented by running a virtual machine using "
10689 #: ../fish/guestfish-actions.pod:2646 ../src/guestfs-actions.pod:4045
10691 "You should call this after configuring the handle (eg. adding drives) but "
10692 "before performing any actions."
10696 #: ../fish/guestfish-actions.pod:2649
10701 #: ../fish/guestfish-actions.pod:2651
10704 " lchown owner group path\n"
10709 #: ../fish/guestfish-actions.pod:2653
10711 "Change the file owner to C<owner> and group to C<group>. This is like "
10712 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
10717 #: ../fish/guestfish-actions.pod:2661
10722 #: ../fish/guestfish-actions.pod:2663
10725 " lgetxattr path name\n"
10730 #: ../fish/guestfish-actions.pod:2665 ../src/guestfs-actions.pod:4085
10732 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10733 "is a symlink, then this call returns an extended attribute from the symlink."
10737 #: ../fish/guestfish-actions.pod:2679
10738 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
10742 #: ../fish/guestfish-actions.pod:2681
10747 #: ../fish/guestfish-actions.pod:2683
10750 " lgetxattrs path\n"
10755 #: ../fish/guestfish-actions.pod:2685
10757 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
10758 "it returns the extended attributes of the link itself."
10762 #: ../fish/guestfish-actions.pod:2689
10767 #: ../fish/guestfish-actions.pod:2691
10775 #: ../fish/guestfish-actions.pod:2693 ../src/guestfs-actions.pod:4128
10777 "List all 9p filesystems attached to the guest. A list of mount tags is "
10782 #: ../fish/guestfish-actions.pod:2696
10783 msgid "list-devices"
10787 #: ../fish/guestfish-actions.pod:2698
10795 #: ../fish/guestfish-actions.pod:2700 ../src/guestfs-actions.pod:4142
10796 msgid "List all the block devices."
10800 #: ../fish/guestfish-actions.pod:2702 ../src/guestfs-actions.pod:4144
10801 msgid "The full block device names are returned, eg. C</dev/sda>."
10805 #: ../fish/guestfish-actions.pod:2706
10806 msgid "list-dm-devices"
10810 #: ../fish/guestfish-actions.pod:2708
10813 " list-dm-devices\n"
10818 #: ../fish/guestfish-actions.pod:2710 ../src/guestfs-actions.pod:4159
10819 msgid "List all device mapper devices."
10823 #: ../fish/guestfish-actions.pod:2712
10825 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
10826 "previous call to L</luks-open>."
10830 #: ../fish/guestfish-actions.pod:2715
10832 "Device mapper devices which correspond to logical volumes are I<not> "
10833 "returned in this list. Call L</lvs> if you want to list logical volumes."
10837 #: ../fish/guestfish-actions.pod:2719
10838 msgid "list-filesystems"
10842 #: ../fish/guestfish-actions.pod:2721
10845 " list-filesystems\n"
10850 #: ../fish/guestfish-actions.pod:2723 ../src/guestfs-actions.pod:4179
10852 "This inspection command looks for filesystems on partitions, block devices "
10853 "and logical volumes, returning a list of devices containing filesystems and "
10858 #: ../fish/guestfish-actions.pod:2727 ../src/guestfs-actions.pod:4183
10860 "The return value is a hash, where the keys are the devices containing "
10861 "filesystems, and the values are the filesystem types. For example:"
10865 #: ../fish/guestfish-actions.pod:2731 ../src/guestfs-actions.pod:4187
10868 " \"/dev/sda1\" => \"ntfs\"\n"
10869 " \"/dev/sda2\" => \"ext2\"\n"
10870 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10871 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10876 #: ../fish/guestfish-actions.pod:2736 ../src/guestfs-actions.pod:4192
10878 "The value can have the special value \"unknown\", meaning the content of the "
10879 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10883 #: ../fish/guestfish-actions.pod:2740
10885 "This command runs other libguestfs commands, which might include L</mount> "
10886 "and L</umount>, and therefore you should use this soon after launch and only "
10887 "when nothing is mounted."
10891 #: ../fish/guestfish-actions.pod:2744
10893 "Not all of the filesystems returned will be mountable. In particular, swap "
10894 "partitions are returned in the list. Also this command does not check that "
10895 "each filesystem found is valid and mountable, and some filesystems might be "
10896 "mountable but require special options. Filesystems may not all belong to a "
10897 "single logical operating system (use L</inspect-os> to look for OSes)."
10901 #: ../fish/guestfish-actions.pod:2752
10902 msgid "list-partitions"
10906 #: ../fish/guestfish-actions.pod:2754
10909 " list-partitions\n"
10914 #: ../fish/guestfish-actions.pod:2756 ../src/guestfs-actions.pod:4221
10915 msgid "List all the partitions detected on all block devices."
10919 #: ../fish/guestfish-actions.pod:2758 ../src/guestfs-actions.pod:4223
10920 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10924 #: ../fish/guestfish-actions.pod:2760
10926 "This does not return logical volumes. For that you will need to call "
10931 #: ../fish/guestfish-actions.pod:2765
10936 #: ../fish/guestfish-actions.pod:2767
10944 #: ../fish/guestfish-actions.pod:2769 ../src/guestfs-actions.pod:4242
10946 "List the files in C<directory> (relative to the root directory, there is no "
10947 "cwd) in the format of 'ls -la'."
10951 #: ../fish/guestfish-actions.pod:2772 ../src/guestfs-actions.pod:4245
10953 "This command is mostly useful for interactive sessions. It is I<not> "
10954 "intended that you try to parse the output string."
10958 #: ../fish/guestfish-actions.pod:2775
10963 #: ../fish/guestfish-actions.pod:2777
10966 " ln target linkname\n"
10971 #: ../fish/guestfish-actions.pod:2779 ../src/guestfs-actions.pod:4260
10972 msgid "This command creates a hard link using the C<ln> command."
10976 #: ../fish/guestfish-actions.pod:2781
10981 #: ../fish/guestfish-actions.pod:2783
10984 " ln-f target linkname\n"
10989 #: ../fish/guestfish-actions.pod:2785 ../src/guestfs-actions.pod:4273
10991 "This command creates a hard link using the C<ln -f> command. The I<-f> "
10992 "option removes the link (C<linkname>) if it exists already."
10996 #: ../fish/guestfish-actions.pod:2788
11001 #: ../fish/guestfish-actions.pod:2790
11004 " ln-s target linkname\n"
11009 #: ../fish/guestfish-actions.pod:2792 ../src/guestfs-actions.pod:4287
11010 msgid "This command creates a symbolic link using the C<ln -s> command."
11014 #: ../fish/guestfish-actions.pod:2794
11019 #: ../fish/guestfish-actions.pod:2796
11022 " ln-sf target linkname\n"
11027 #: ../fish/guestfish-actions.pod:2798 ../src/guestfs-actions.pod:4300
11029 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
11030 "option removes the link (C<linkname>) if it exists already."
11034 #: ../fish/guestfish-actions.pod:2801
11035 msgid "lremovexattr"
11039 #: ../fish/guestfish-actions.pod:2803
11042 " lremovexattr xattr path\n"
11047 #: ../fish/guestfish-actions.pod:2805
11049 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
11050 "it removes an extended attribute of the link itself."
11054 #: ../fish/guestfish-actions.pod:2809
11059 #: ../fish/guestfish-actions.pod:2811
11067 #: ../fish/guestfish-actions.pod:2813 ../src/guestfs-actions.pod:4328
11069 "List the files in C<directory> (relative to the root directory, there is no "
11070 "cwd). The '.' and '..' entries are not returned, but hidden files are "
11075 #: ../fish/guestfish-actions.pod:2817
11077 "This command is mostly useful for interactive sessions. Programs should "
11078 "probably use L</readdir> instead."
11082 #: ../fish/guestfish-actions.pod:2820
11087 #: ../fish/guestfish-actions.pod:2822
11090 " lsetxattr xattr val vallen path\n"
11095 #: ../fish/guestfish-actions.pod:2824
11097 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
11098 "sets an extended attribute of the link itself."
11102 #: ../fish/guestfish-actions.pod:2828
11107 #: ../fish/guestfish-actions.pod:2830
11115 #: ../fish/guestfish-actions.pod:2832 ../fish/guestfish-actions.pod:4656 ../src/guestfs-actions.pod:4364 ../src/guestfs-actions.pod:7167
11116 msgid "Returns file information for the given C<path>."
11120 #: ../fish/guestfish-actions.pod:2834
11122 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
11123 "the link is stat-ed, not the file it refers to."
11127 #: ../fish/guestfish-actions.pod:2838 ../src/guestfs-actions.pod:4370
11128 msgid "This is the same as the C<lstat(2)> system call."
11132 #: ../fish/guestfish-actions.pod:2840
11137 #: ../fish/guestfish-actions.pod:2842
11140 " lstatlist path 'names ...'\n"
11145 #: ../fish/guestfish-actions.pod:2844
11147 "This call allows you to perform the L</lstat> operation on multiple files, "
11148 "where all files are in the directory C<path>. C<names> is the list of files "
11149 "from this directory."
11153 #: ../fish/guestfish-actions.pod:2848 ../src/guestfs-actions.pod:4389
11155 "On return you get a list of stat structs, with a one-to-one correspondence "
11156 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11157 "then the C<ino> field of that structure is set to C<-1>."
11161 #: ../fish/guestfish-actions.pod:2853
11163 "This call is intended for programs that want to efficiently list a directory "
11164 "contents without making many round-trips. See also L</lxattrlist> for a "
11165 "similarly efficient call for getting extended attributes. Very long "
11166 "directory listings might cause the protocol message size to be exceeded, "
11167 "causing this call to fail. The caller must split up such requests into "
11168 "smaller groups of names."
11172 #: ../fish/guestfish-actions.pod:2861
11173 msgid "luks-add-key"
11177 #: ../fish/guestfish-actions.pod:2863
11180 " luks-add-key device keyslot\n"
11185 #: ../fish/guestfish-actions.pod:2865 ../src/guestfs-actions.pod:4417
11187 "This command adds a new key on LUKS device C<device>. C<key> is any "
11188 "existing key, and is used to access the device. C<newkey> is the new key to "
11189 "add. C<keyslot> is the key slot that will be replaced."
11193 #: ../fish/guestfish-actions.pod:2870
11195 "Note that if C<keyslot> already contains a key, then this command will "
11196 "fail. You have to use L</luks-kill-slot> first to remove that key."
11200 #: ../fish/guestfish-actions.pod:2874 ../fish/guestfish-actions.pod:2896 ../fish/guestfish-actions.pod:2909 ../fish/guestfish-actions.pod:2923 ../fish/guestfish-actions.pod:2949 ../fish/guestfish-actions.pod:2959
11202 "This command has one or more key or passphrase parameters. Guestfish will "
11203 "prompt for these separately."
11207 #: ../fish/guestfish-actions.pod:2877
11212 #: ../fish/guestfish-actions.pod:2879
11215 " luks-close device\n"
11220 #: ../fish/guestfish-actions.pod:2881
11222 "This closes a LUKS device that was created earlier by L</luks-open> or "
11223 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
11224 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
11225 "underlying block device."
11229 #: ../fish/guestfish-actions.pod:2887
11230 msgid "luks-format"
11234 #: ../fish/guestfish-actions.pod:2889
11237 " luks-format device keyslot\n"
11242 #: ../fish/guestfish-actions.pod:2891 ../src/guestfs-actions.pod:4458
11244 "This command erases existing data on C<device> and formats the device as a "
11245 "LUKS encrypted device. C<key> is the initial key, which is added to key "
11246 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
11250 #: ../fish/guestfish-actions.pod:2899 ../fish/guestfish-actions.pod:2912 ../fish/guestfish-actions.pod:2999 ../fish/guestfish-actions.pod:3650 ../fish/guestfish-actions.pod:4190 ../fish/guestfish-actions.pod:4527 ../fish/guestfish-actions.pod:4550 ../fish/guestfish-actions.pod:4572 ../fish/guestfish-actions.pod:5318 ../src/guestfs-actions.pod:4465 ../src/guestfs-actions.pod:4488 ../src/guestfs-actions.pod:4631 ../src/guestfs-actions.pod:5724 ../src/guestfs-actions.pod:6530 ../src/guestfs-actions.pod:6981 ../src/guestfs-actions.pod:7011 ../src/guestfs-actions.pod:7044 ../src/guestfs-actions.pod:8243
11252 "B<This command is dangerous. Without careful use you can easily destroy all "
11257 #: ../fish/guestfish-actions.pod:2902
11258 msgid "luks-format-cipher"
11262 #: ../fish/guestfish-actions.pod:2904
11265 " luks-format-cipher device keyslot cipher\n"
11270 #: ../fish/guestfish-actions.pod:2906
11272 "This command is the same as L</luks-format> but it also allows you to set "
11273 "the C<cipher> used."
11277 #: ../fish/guestfish-actions.pod:2915
11278 msgid "luks-kill-slot"
11282 #: ../fish/guestfish-actions.pod:2917
11285 " luks-kill-slot device keyslot\n"
11290 #: ../fish/guestfish-actions.pod:2919 ../src/guestfs-actions.pod:4505
11292 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11293 "device C<device>. C<key> must be one of the I<other> keys."
11297 #: ../fish/guestfish-actions.pod:2926
11302 #: ../fish/guestfish-actions.pod:2928
11305 " luks-open device mapname\n"
11310 #: ../fish/guestfish-actions.pod:2930 ../src/guestfs-actions.pod:4525
11312 "This command opens a block device which has been encrypted according to the "
11313 "Linux Unified Key Setup (LUKS) standard."
11317 #: ../fish/guestfish-actions.pod:2933 ../src/guestfs-actions.pod:4528
11318 msgid "C<device> is the encrypted block device or partition."
11322 #: ../fish/guestfish-actions.pod:2935 ../src/guestfs-actions.pod:4530
11324 "The caller must supply one of the keys associated with the LUKS block "
11325 "device, in the C<key> parameter."
11329 #: ../fish/guestfish-actions.pod:2938 ../src/guestfs-actions.pod:4533
11331 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
11332 "writes to this block device are decrypted from and encrypted to the "
11333 "underlying C<device> respectively."
11337 #: ../fish/guestfish-actions.pod:2942
11339 "If this block device contains LVM volume groups, then calling L</vgscan> "
11340 "followed by L</vg-activate-all> will make them visible."
11344 #: ../fish/guestfish-actions.pod:2946
11345 msgid "Use L</list-dm-devices> to list all device mapper devices."
11349 #: ../fish/guestfish-actions.pod:2952
11350 msgid "luks-open-ro"
11354 #: ../fish/guestfish-actions.pod:2954
11357 " luks-open-ro device mapname\n"
11362 #: ../fish/guestfish-actions.pod:2956
11364 "This is the same as L</luks-open> except that a read-only mapping is "
11369 #: ../fish/guestfish-actions.pod:2962
11374 #: ../fish/guestfish-actions.pod:2964
11377 " lvcreate logvol volgroup mbytes\n"
11382 #: ../fish/guestfish-actions.pod:2966 ../src/guestfs-actions.pod:4579
11384 "This creates an LVM logical volume called C<logvol> on the volume group "
11385 "C<volgroup>, with C<size> megabytes."
11389 #: ../fish/guestfish-actions.pod:2969
11390 msgid "lvm-canonical-lv-name"
11394 #: ../fish/guestfish-actions.pod:2971
11397 " lvm-canonical-lv-name lvname\n"
11402 #: ../fish/guestfish-actions.pod:2973 ../src/guestfs-actions.pod:4592
11404 "This converts alternative naming schemes for LVs that you might find to the "
11405 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
11410 #: ../fish/guestfish-actions.pod:2977 ../src/guestfs-actions.pod:4596
11412 "This command returns an error if the C<lvname> parameter does not refer to a "
11417 #: ../fish/guestfish-actions.pod:2980
11418 msgid "See also L</is-lv>."
11422 #: ../fish/guestfish-actions.pod:2982
11423 msgid "lvm-clear-filter"
11427 #: ../fish/guestfish-actions.pod:2984
11430 " lvm-clear-filter\n"
11435 #: ../fish/guestfish-actions.pod:2986
11437 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
11442 #: ../fish/guestfish-actions.pod:2989 ../fish/guestfish-actions.pod:3020 ../src/guestfs-actions.pod:4614 ../src/guestfs-actions.pod:4656
11443 msgid "This command also clears the LVM cache and performs a volume group scan."
11447 #: ../fish/guestfish-actions.pod:2992
11448 msgid "lvm-remove-all"
11452 #: ../fish/guestfish-actions.pod:2994
11455 " lvm-remove-all\n"
11460 #: ../fish/guestfish-actions.pod:2996 ../src/guestfs-actions.pod:4626
11462 "This command removes all LVM logical volumes, volume groups and physical "
11467 #: ../fish/guestfish-actions.pod:3002
11468 msgid "lvm-set-filter"
11472 #: ../fish/guestfish-actions.pod:3004
11475 " lvm-set-filter 'devices ...'\n"
11480 #: ../fish/guestfish-actions.pod:3006 ../src/guestfs-actions.pod:4642
11482 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
11483 "block devices in the list C<devices>, and will ignore all other attached "
11488 #: ../fish/guestfish-actions.pod:3010 ../src/guestfs-actions.pod:4646
11490 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
11491 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
11492 "there are two types of duplication possible: either cloned PVs/VGs which "
11493 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
11494 "same name. In normal operation you cannot create this situation, but you "
11495 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
11496 "inside the LVM metadata."
11500 #: ../fish/guestfish-actions.pod:3023 ../src/guestfs-actions.pod:4659
11501 msgid "You can filter whole block devices or individual partitions."
11505 #: ../fish/guestfish-actions.pod:3025 ../src/guestfs-actions.pod:4661
11507 "You cannot use this if any VG is currently in use (eg. contains a mounted "
11508 "filesystem), even if you are not filtering out that VG."
11512 #: ../fish/guestfish-actions.pod:3029
11517 #: ../fish/guestfish-actions.pod:3031
11520 " lvremove device\n"
11525 #: ../fish/guestfish-actions.pod:3033 ../src/guestfs-actions.pod:4675
11527 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
11528 "LV, such as C</dev/VG/LV>."
11532 #: ../fish/guestfish-actions.pod:3036 ../src/guestfs-actions.pod:4678
11534 "You can also remove all LVs in a volume group by specifying the VG name, "
11539 #: ../fish/guestfish-actions.pod:3039
11544 #: ../fish/guestfish-actions.pod:3041
11547 " lvrename logvol newlogvol\n"
11552 #: ../fish/guestfish-actions.pod:3043 ../src/guestfs-actions.pod:4692
11553 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
11557 #: ../fish/guestfish-actions.pod:3045
11562 #: ../fish/guestfish-actions.pod:3047
11565 " lvresize device mbytes\n"
11570 #: ../fish/guestfish-actions.pod:3049 ../src/guestfs-actions.pod:4705
11572 "This resizes (expands or shrinks) an existing LVM logical volume to "
11573 "C<mbytes>. When reducing, data in the reduced part is lost."
11577 #: ../fish/guestfish-actions.pod:3053
11578 msgid "lvresize-free"
11582 #: ../fish/guestfish-actions.pod:3055
11585 " lvresize-free lv percent\n"
11590 #: ../fish/guestfish-actions.pod:3057 ../src/guestfs-actions.pod:4720
11592 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
11593 "remaining free space in the volume group. Commonly you would call this with "
11594 "pc = 100 which expands the logical volume as much as possible, using all "
11595 "remaining free space in the volume group."
11599 #: ../fish/guestfish-actions.pod:3063
11604 #: ../fish/guestfish-actions.pod:3065
11612 #: ../fish/guestfish-actions.pod:3067 ../src/guestfs-actions.pod:4735
11614 "List all the logical volumes detected. This is the equivalent of the "
11615 "L<lvs(8)> command."
11619 #: ../fish/guestfish-actions.pod:3070 ../src/guestfs-actions.pod:4738
11621 "This returns a list of the logical volume device names "
11622 "(eg. C</dev/VolGroup00/LogVol00>)."
11626 #: ../fish/guestfish-actions.pod:3073
11627 msgid "See also L</lvs-full>, L</list-filesystems>."
11631 #: ../fish/guestfish-actions.pod:3075
11636 #: ../fish/guestfish-actions.pod:3077
11644 #: ../fish/guestfish-actions.pod:3079 ../src/guestfs-actions.pod:4754
11646 "List all the logical volumes detected. This is the equivalent of the "
11647 "L<lvs(8)> command. The \"full\" version includes all fields."
11651 #: ../fish/guestfish-actions.pod:3082
11656 #: ../fish/guestfish-actions.pod:3084
11664 #: ../fish/guestfish-actions.pod:3086 ../src/guestfs-actions.pod:4769
11665 msgid "This command returns the UUID of the LVM LV C<device>."
11669 #: ../fish/guestfish-actions.pod:3088
11674 #: ../fish/guestfish-actions.pod:3090
11677 " lxattrlist path 'names ...'\n"
11682 #: ../fish/guestfish-actions.pod:3092 ../src/guestfs-actions.pod:4783
11684 "This call allows you to get the extended attributes of multiple files, where "
11685 "all files are in the directory C<path>. C<names> is the list of files from "
11690 #: ../fish/guestfish-actions.pod:3096 ../src/guestfs-actions.pod:4787
11692 "On return you get a flat list of xattr structs which must be interpreted "
11693 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11694 "C<attrval> in this struct is zero-length to indicate there was an error "
11695 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11696 "number (the number of following attributes for this file, which could be "
11697 "C<\"0\">). Then after the first xattr struct are the zero or more "
11698 "attributes for the first named file. This repeats for the second and "
11699 "subsequent files."
11703 #: ../fish/guestfish-actions.pod:3106
11705 "This call is intended for programs that want to efficiently list a directory "
11706 "contents without making many round-trips. See also L</lstatlist> for a "
11707 "similarly efficient call for getting standard stats. Very long directory "
11708 "listings might cause the protocol message size to be exceeded, causing this "
11709 "call to fail. The caller must split up such requests into smaller groups of "
11714 #: ../fish/guestfish-actions.pod:3114
11719 #: ../fish/guestfish-actions.pod:3116
11727 #: ../fish/guestfish-actions.pod:3118 ../src/guestfs-actions.pod:4817
11728 msgid "Create a directory named C<path>."
11732 #: ../fish/guestfish-actions.pod:3120
11737 #: ../fish/guestfish-actions.pod:3122
11740 " mkdir-mode path mode\n"
11745 #: ../fish/guestfish-actions.pod:3124 ../src/guestfs-actions.pod:4830
11747 "This command creates a directory, setting the initial permissions of the "
11748 "directory to C<mode>."
11752 #: ../fish/guestfish-actions.pod:3127 ../src/guestfs-actions.pod:4833
11754 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11755 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11760 #: ../fish/guestfish-actions.pod:3131
11761 msgid "See also L</mkdir>, L</umask>"
11765 #: ../fish/guestfish-actions.pod:3133
11770 #: ../fish/guestfish-actions.pod:3135
11778 #: ../fish/guestfish-actions.pod:3137 ../src/guestfs-actions.pod:4849
11780 "Create a directory named C<path>, creating any parent directories as "
11781 "necessary. This is like the C<mkdir -p> shell command."
11785 #: ../fish/guestfish-actions.pod:3140
11790 #: ../fish/guestfish-actions.pod:3142
11793 " mkdtemp template\n"
11798 #: ../fish/guestfish-actions.pod:3144 ../src/guestfs-actions.pod:4862
11800 "This command creates a temporary directory. The C<template> parameter "
11801 "should be a full pathname for the temporary directory name with the final "
11802 "six characters being \"XXXXXX\"."
11806 #: ../fish/guestfish-actions.pod:3149 ../src/guestfs-actions.pod:4867
11808 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11809 "being suitable for Windows filesystems."
11813 #: ../fish/guestfish-actions.pod:3152 ../src/guestfs-actions.pod:4870
11814 msgid "The name of the temporary directory that was created is returned."
11818 #: ../fish/guestfish-actions.pod:3155 ../src/guestfs-actions.pod:4873
11819 msgid "The temporary directory is created with mode 0700 and is owned by root."
11823 #: ../fish/guestfish-actions.pod:3158 ../src/guestfs-actions.pod:4876
11825 "The caller is responsible for deleting the temporary directory and its "
11826 "contents after use."
11830 #: ../fish/guestfish-actions.pod:3161 ../src/guestfs-actions.pod:4879
11831 msgid "See also: L<mkdtemp(3)>"
11835 #: ../fish/guestfish-actions.pod:3163
11840 #: ../fish/guestfish-actions.pod:3165
11843 " mke2fs-J fstype blocksize device journal\n"
11848 #: ../fish/guestfish-actions.pod:3167 ../src/guestfs-actions.pod:4895
11850 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11851 "C<journal>. It is equivalent to the command:"
11855 #: ../fish/guestfish-actions.pod:3171 ../src/guestfs-actions.pod:4899
11858 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11863 #: ../fish/guestfish-actions.pod:3173
11864 msgid "See also L</mke2journal>."
11868 #: ../fish/guestfish-actions.pod:3175
11873 #: ../fish/guestfish-actions.pod:3177
11876 " mke2fs-JL fstype blocksize device label\n"
11881 #: ../fish/guestfish-actions.pod:3179 ../src/guestfs-actions.pod:4916
11883 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11884 "the journal labeled C<label>."
11888 #: ../fish/guestfish-actions.pod:3182
11889 msgid "See also L</mke2journal-L>."
11893 #: ../fish/guestfish-actions.pod:3184
11898 #: ../fish/guestfish-actions.pod:3186
11901 " mke2fs-JU fstype blocksize device uuid\n"
11906 #: ../fish/guestfish-actions.pod:3188 ../src/guestfs-actions.pod:4934
11908 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11909 "the journal with UUID C<uuid>."
11913 #: ../fish/guestfish-actions.pod:3191
11914 msgid "See also L</mke2journal-U>."
11918 #: ../fish/guestfish-actions.pod:3193
11919 msgid "mke2journal"
11923 #: ../fish/guestfish-actions.pod:3195
11926 " mke2journal blocksize device\n"
11931 #: ../fish/guestfish-actions.pod:3197 ../src/guestfs-actions.pod:4950
11933 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11938 #: ../fish/guestfish-actions.pod:3200 ../src/guestfs-actions.pod:4953
11941 " mke2fs -O journal_dev -b blocksize device\n"
11946 #: ../fish/guestfish-actions.pod:3202
11947 msgid "mke2journal-L"
11951 #: ../fish/guestfish-actions.pod:3204
11954 " mke2journal-L blocksize label device\n"
11959 #: ../fish/guestfish-actions.pod:3206 ../src/guestfs-actions.pod:4967
11960 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11964 #: ../fish/guestfish-actions.pod:3208
11965 msgid "mke2journal-U"
11969 #: ../fish/guestfish-actions.pod:3210
11972 " mke2journal-U blocksize uuid device\n"
11977 #: ../fish/guestfish-actions.pod:3212 ../src/guestfs-actions.pod:4981
11978 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11982 #: ../fish/guestfish-actions.pod:3214
11987 #: ../fish/guestfish-actions.pod:3216
11990 " mkfifo mode path\n"
11995 #: ../fish/guestfish-actions.pod:3218
11997 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11998 "is just a convenient wrapper around L</mknod>."
12002 #: ../fish/guestfish-actions.pod:3224
12007 #: ../fish/guestfish-actions.pod:3226
12010 " mkfs fstype device\n"
12015 #: ../fish/guestfish-actions.pod:3228 ../src/guestfs-actions.pod:5011
12017 "This creates a filesystem on C<device> (usually a partition or LVM logical "
12018 "volume). The filesystem type is C<fstype>, for example C<ext3>."
12022 #: ../fish/guestfish-actions.pod:3232
12027 #: ../fish/guestfish-actions.pod:3234
12030 " mkfs-b fstype blocksize device\n"
12035 #: ../fish/guestfish-actions.pod:3236
12037 "This call is similar to L</mkfs>, but it allows you to control the block "
12038 "size of the resulting filesystem. Supported block sizes depend on the "
12039 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
12043 #: ../fish/guestfish-actions.pod:3241 ../fish/guestfish-actions.pod:3268 ../src/guestfs-actions.pod:5039 ../src/guestfs-actions.pod:5077
12045 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
12050 #: ../fish/guestfish-actions.pod:3244
12052 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
12057 #: ../fish/guestfish-actions.pod:3251
12062 #: ../fish/guestfish-actions.pod:3253
12065 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] "
12066 "[sectorsize:..]\n"
12071 #: ../fish/guestfish-actions.pod:3255 ../src/guestfs-actions.pod:5064
12073 "This function creates a filesystem on C<device>. The filesystem type is "
12074 "C<fstype>, for example C<ext3>."
12078 #: ../fish/guestfish-actions.pod:3262 ../src/guestfs-actions.pod:5071
12079 msgid "C<blocksize>"
12083 #: ../fish/guestfish-actions.pod:3264 ../src/guestfs-actions.pod:5073
12085 "The filesystem block size. Supported block sizes depend on the filesystem "
12086 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
12091 #: ../fish/guestfish-actions.pod:3271 ../src/guestfs-actions.pod:5080
12092 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
12096 #: ../fish/guestfish-actions.pod:3273 ../src/guestfs-actions.pod:5082
12097 msgid "C<features>"
12101 #: ../fish/guestfish-actions.pod:3275 ../src/guestfs-actions.pod:5084
12102 msgid "This passes the I<-O> parameter to the external mkfs program."
12106 #: ../fish/guestfish-actions.pod:3277 ../src/guestfs-actions.pod:5086
12108 "For certain filesystem types, this allows extra filesystem features to be "
12109 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
12113 #: ../fish/guestfish-actions.pod:3281 ../src/guestfs-actions.pod:5090
12115 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
12120 #: ../fish/guestfish-actions.pod:3284 ../src/guestfs-actions.pod:5093
12125 #: ../fish/guestfish-actions.pod:3286 ../src/guestfs-actions.pod:5095
12127 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
12128 "sets the inode size (only for ext2/3/4 filesystems at present)."
12132 #: ../fish/guestfish-actions.pod:3289 ../src/guestfs-actions.pod:5098
12133 msgid "C<sectorsize>"
12137 #: ../fish/guestfish-actions.pod:3291 ../src/guestfs-actions.pod:5100
12139 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
12140 "sets sector size for ufs filesystem."
12144 #: ../fish/guestfish-actions.pod:3298
12145 msgid "mkmountpoint"
12149 #: ../fish/guestfish-actions.pod:3300
12152 " mkmountpoint exemptpath\n"
12157 #: ../fish/guestfish-actions.pod:3302
12159 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
12160 "to create extra mountpoints before mounting the first filesystem."
12164 #: ../fish/guestfish-actions.pod:3306 ../src/guestfs-actions.pod:5143
12166 "These calls are I<only> necessary in some very limited circumstances, mainly "
12167 "the case where you want to mount a mix of unrelated and/or read-only "
12168 "filesystems together."
12172 #: ../fish/guestfish-actions.pod:3310 ../src/guestfs-actions.pod:5147
12174 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
12175 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
12176 "inside that. You can unpack this as follows in guestfish:"
12180 #: ../fish/guestfish-actions.pod:3315 ../src/guestfs-actions.pod:5152
12183 " add-ro Fedora-11-i686-Live.iso\n"
12185 " mkmountpoint /cd\n"
12186 " mkmountpoint /sqsh\n"
12187 " mkmountpoint /ext3fs\n"
12188 " mount /dev/sda /cd\n"
12189 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
12190 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
12195 #: ../fish/guestfish-actions.pod:3324 ../src/guestfs-actions.pod:5161
12196 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
12200 #: ../fish/guestfish-actions.pod:3326
12202 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
12203 "unexpected errors if you try to mix these calls. It is safest to manually "
12204 "unmount filesystems and remove mountpoints after use."
12208 #: ../fish/guestfish-actions.pod:3330
12210 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
12211 "for this to work for manual mountpoints, you must ensure that the innermost "
12212 "mountpoints have the longest pathnames, as in the example code above."
12216 #: ../fish/guestfish-actions.pod:3335 ../src/guestfs-actions.pod:5172
12217 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
12221 #: ../fish/guestfish-actions.pod:3337
12223 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
12224 "L</umount-all> to be called when the handle is closed which can also trigger "
12229 #: ../fish/guestfish-actions.pod:3341
12234 #: ../fish/guestfish-actions.pod:3343
12237 " mknod mode devmajor devminor path\n"
12242 #: ../fish/guestfish-actions.pod:3345 ../src/guestfs-actions.pod:5191
12244 "This call creates block or character special devices, or named pipes "
12249 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5194
12251 "The C<mode> parameter should be the mode, using the standard constants. "
12252 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
12253 "used when creating block and character special devices."
12257 #: ../fish/guestfish-actions.pod:3353
12259 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
12260 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
12261 "regular file). These constants are available in the standard Linux header "
12262 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
12263 "wrappers around this command which bitwise OR in the appropriate constant "
12268 #: ../fish/guestfish-actions.pod:3363
12273 #: ../fish/guestfish-actions.pod:3365
12276 " mknod-b mode devmajor devminor path\n"
12281 #: ../fish/guestfish-actions.pod:3367
12283 "This call creates a block device node called C<path> with mode C<mode> and "
12284 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12285 "wrapper around L</mknod>."
12289 #: ../fish/guestfish-actions.pod:3373
12294 #: ../fish/guestfish-actions.pod:3375
12297 " mknod-c mode devmajor devminor path\n"
12302 #: ../fish/guestfish-actions.pod:3377
12304 "This call creates a char device node called C<path> with mode C<mode> and "
12305 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12306 "wrapper around L</mknod>."
12310 #: ../fish/guestfish-actions.pod:3383
12315 #: ../fish/guestfish-actions.pod:3385
12323 #: ../fish/guestfish-actions.pod:3387 ../src/guestfs-actions.pod:5257
12324 msgid "Create a swap partition on C<device>."
12328 #: ../fish/guestfish-actions.pod:3389
12333 #: ../fish/guestfish-actions.pod:3391
12336 " mkswap-L label device\n"
12341 #: ../fish/guestfish-actions.pod:3393 ../src/guestfs-actions.pod:5270
12342 msgid "Create a swap partition on C<device> with label C<label>."
12346 #: ../fish/guestfish-actions.pod:3395 ../src/guestfs-actions.pod:5272
12348 "Note that you cannot attach a swap label to a block device "
12349 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
12350 "the kernel or swap tools."
12354 #: ../fish/guestfish-actions.pod:3399
12359 #: ../fish/guestfish-actions.pod:3401
12362 " mkswap-U uuid device\n"
12367 #: ../fish/guestfish-actions.pod:3403 ../src/guestfs-actions.pod:5287
12368 msgid "Create a swap partition on C<device> with UUID C<uuid>."
12372 #: ../fish/guestfish-actions.pod:3405
12373 msgid "mkswap-file"
12377 #: ../fish/guestfish-actions.pod:3407
12380 " mkswap-file path\n"
12385 #: ../fish/guestfish-actions.pod:3409 ../src/guestfs-actions.pod:5299
12386 msgid "Create a swap file."
12390 #: ../fish/guestfish-actions.pod:3411
12392 "This command just writes a swap file signature to an existing file. To "
12393 "create the file itself, use something like L</fallocate>."
12397 #: ../fish/guestfish-actions.pod:3414
12402 #: ../fish/guestfish-actions.pod:3416
12405 " modprobe modulename\n"
12410 #: ../fish/guestfish-actions.pod:3418 ../src/guestfs-actions.pod:5314
12411 msgid "This loads a kernel module in the appliance."
12415 #: ../fish/guestfish-actions.pod:3420 ../src/guestfs-actions.pod:5316
12417 "The kernel module must have been whitelisted when libguestfs was built (see "
12418 "C<appliance/kmod.whitelist.in> in the source)."
12422 #: ../fish/guestfish-actions.pod:3423
12427 #: ../fish/guestfish-actions.pod:3425
12430 " mount device mountpoint\n"
12435 #: ../fish/guestfish-actions.pod:3427 ../src/guestfs-actions.pod:5330
12437 "Mount a guest disk at a position in the filesystem. Block devices are named "
12438 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12439 "those block devices contain partitions, they will have the usual names "
12440 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12444 #: ../fish/guestfish-actions.pod:3433 ../src/guestfs-actions.pod:5336
12446 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12447 "mounted on C</> before others can be mounted. Other filesystems can only be "
12448 "mounted on directories which already exist."
12452 #: ../fish/guestfish-actions.pod:3438 ../src/guestfs-actions.pod:5341
12454 "The mounted filesystem is writable, if we have sufficient permissions on the "
12455 "underlying device."
12459 #: ../fish/guestfish-actions.pod:3441
12461 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
12462 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
12463 "problems for users. If your program might need to work with older versions "
12464 "of libguestfs, use L</mount-options> instead (using an empty string for the "
12465 "first parameter if you don't want any options)."
12469 #: ../fish/guestfish-actions.pod:3448
12474 #: ../fish/guestfish-actions.pod:3450
12477 " mount-9p mounttag mountpoint [options:..]\n"
12482 #: ../fish/guestfish-actions.pod:3452 ../src/guestfs-actions.pod:5370
12484 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
12489 #: ../fish/guestfish-actions.pod:3455 ../src/guestfs-actions.pod:5373
12491 "If required, C<trans=virtio> will be automatically added to the options. "
12492 "Any other options required can be passed in the optional C<options> "
12497 #: ../fish/guestfish-actions.pod:3461
12502 #: ../fish/guestfish-actions.pod:3463
12505 " mount-loop file mountpoint\n"
12510 #: ../fish/guestfish-actions.pod:3465 ../src/guestfs-actions.pod:5412
12512 "This command lets you mount C<file> (a filesystem image in a file) on a "
12513 "mount point. It is entirely equivalent to the command C<mount -o loop file "
12518 #: ../fish/guestfish-actions.pod:3469
12519 msgid "mount-options"
12523 #: ../fish/guestfish-actions.pod:3471
12526 " mount-options options device mountpoint\n"
12531 #: ../fish/guestfish-actions.pod:3473
12533 "This is the same as the L</mount> command, but it allows you to set the "
12534 "mount options as for the L<mount(8)> I<-o> flag."
12538 #: ../fish/guestfish-actions.pod:3477 ../src/guestfs-actions.pod:5432
12540 "If the C<options> parameter is an empty string, then no options are passed "
12541 "(all options default to whatever the filesystem uses)."
12545 #: ../fish/guestfish-actions.pod:3481
12550 #: ../fish/guestfish-actions.pod:3483
12553 " mount-ro device mountpoint\n"
12558 #: ../fish/guestfish-actions.pod:3485
12560 "This is the same as the L</mount> command, but it mounts the filesystem with "
12561 "the read-only (I<-o ro>) flag."
12565 #: ../fish/guestfish-actions.pod:3488
12570 #: ../fish/guestfish-actions.pod:3490
12573 " mount-vfs options vfstype device mountpoint\n"
12578 #: ../fish/guestfish-actions.pod:3492
12580 "This is the same as the L</mount> command, but it allows you to set both the "
12581 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
12585 #: ../fish/guestfish-actions.pod:3496
12586 msgid "mountpoints"
12590 #: ../fish/guestfish-actions.pod:3498
12598 #: ../fish/guestfish-actions.pod:3500
12600 "This call is similar to L</mounts>. That call returns a list of devices. "
12601 "This one returns a hash table (map) of device name to directory where the "
12602 "device is mounted."
12606 #: ../fish/guestfish-actions.pod:3504
12611 #: ../fish/guestfish-actions.pod:3506
12619 #: ../fish/guestfish-actions.pod:3508 ../src/guestfs-actions.pod:5493
12621 "This returns the list of currently mounted filesystems. It returns the list "
12622 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12626 #: ../fish/guestfish-actions.pod:3511 ../src/guestfs-actions.pod:5496
12627 msgid "Some internal mounts are not shown."
12631 #: ../fish/guestfish-actions.pod:3513
12632 msgid "See also: L</mountpoints>"
12636 #: ../fish/guestfish-actions.pod:3515
12641 #: ../fish/guestfish-actions.pod:3517
12649 #: ../fish/guestfish-actions.pod:3519 ../src/guestfs-actions.pod:5513
12651 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12652 "destination filename or destination directory."
12656 #: ../fish/guestfish-actions.pod:3522
12657 msgid "ntfs-3g-probe"
12661 #: ../fish/guestfish-actions.pod:3524
12664 " ntfs-3g-probe true|false device\n"
12669 #: ../fish/guestfish-actions.pod:3526 ../src/guestfs-actions.pod:5527
12671 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12672 "C<device> for mountability. (Not all NTFS volumes can be mounted "
12673 "read-write, and some cannot be mounted at all)."
12677 #: ../fish/guestfish-actions.pod:3530 ../src/guestfs-actions.pod:5531
12679 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12680 "can be mounted read-write. Set it to false if you want to test if the "
12681 "volume can be mounted read-only."
12685 #: ../fish/guestfish-actions.pod:3534 ../src/guestfs-actions.pod:5535
12687 "The return value is an integer which C<0> if the operation would succeed, or "
12688 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12692 #: ../fish/guestfish-actions.pod:3538
12697 #: ../fish/guestfish-actions.pod:3540
12700 " ntfsresize device\n"
12705 #: ../fish/guestfish-actions.pod:3542 ../fish/guestfish-actions.pod:3566 ../src/guestfs-actions.pod:5556 ../src/guestfs-actions.pod:5588
12707 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12708 "size of the underlying device."
12712 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5559
12714 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
12715 "consistency check (for safety). You have to boot into Windows to perform "
12716 "this check and clear this condition. Furthermore, ntfsresize refuses to "
12717 "resize filesystems which have been marked in this way. So in effect it is "
12718 "not possible to call ntfsresize multiple times on a single filesystem "
12719 "without booting into Windows between each resize."
12723 #: ../fish/guestfish-actions.pod:3553 ../fish/guestfish-actions.pod:3592 ../src/guestfs-actions.pod:5567 ../src/guestfs-actions.pod:5614
12724 msgid "See also L<ntfsresize(8)>."
12728 #: ../fish/guestfish-actions.pod:3555 ../fish/guestfish-actions.pod:3603
12730 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
12735 #: ../fish/guestfish-actions.pod:3562
12736 msgid "ntfsresize-opts"
12740 #: ../fish/guestfish-actions.pod:3564
12743 " ntfsresize-opts device [size:..] [force:..]\n"
12748 #: ../fish/guestfish-actions.pod:3575 ../src/guestfs-actions.pod:5597
12750 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
12751 "resized to fit the container (eg. partition)."
12755 #: ../fish/guestfish-actions.pod:3578 ../src/guestfs-actions.pod:5600
12760 #: ../fish/guestfish-actions.pod:3580 ../src/guestfs-actions.pod:5602
12762 "If this option is true, then force the resize of the filesystem even if the "
12763 "filesystem is marked as requiring a consistency check."
12767 #: ../fish/guestfish-actions.pod:3583
12769 "After the resize operation, the filesystem is always marked as requiring a "
12770 "consistency check (for safety). You have to boot into Windows to perform "
12771 "this check and clear this condition. If you I<don't> set the C<force> "
12772 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
12773 "a single filesystem without booting into Windows between each resize."
12777 #: ../fish/guestfish-actions.pod:3596
12778 msgid "ntfsresize-size"
12782 #: ../fish/guestfish-actions.pod:3598
12785 " ntfsresize-size device size\n"
12790 #: ../fish/guestfish-actions.pod:3600
12792 "This command is the same as L</ntfsresize> except that it allows you to "
12793 "specify the new size (in bytes) explicitly."
12797 #: ../fish/guestfish-actions.pod:3610
12802 #: ../fish/guestfish-actions.pod:3612
12805 " part-add device prlogex startsect endsect\n"
12810 #: ../fish/guestfish-actions.pod:3614
12812 "This command adds a partition to C<device>. If there is no partition table "
12813 "on the device, call L</part-init> first."
12817 #: ../fish/guestfish-actions.pod:3617 ../src/guestfs-actions.pod:5675
12819 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12820 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12821 "C<logical>) and C<e> (or C<extended>) partition types."
12825 #: ../fish/guestfish-actions.pod:3622 ../src/guestfs-actions.pod:5680
12827 "C<startsect> and C<endsect> are the start and end of the partition in "
12828 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12829 "from the end of the disk (C<-1> is the last sector)."
12833 #: ../fish/guestfish-actions.pod:3626
12835 "Creating a partition which covers the whole disk is not so easy. Use "
12836 "L</part-disk> to do that."
12840 #: ../fish/guestfish-actions.pod:3629
12845 #: ../fish/guestfish-actions.pod:3631
12848 " part-del device partnum\n"
12853 #: ../fish/guestfish-actions.pod:3633 ../src/guestfs-actions.pod:5698
12854 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12858 #: ../fish/guestfish-actions.pod:3635 ../src/guestfs-actions.pod:5700
12860 "Note that in the case of MBR partitioning, deleting an extended partition "
12861 "also deletes any logical partitions it contains."
12865 #: ../fish/guestfish-actions.pod:3639
12870 #: ../fish/guestfish-actions.pod:3641
12873 " part-disk device parttype\n"
12878 #: ../fish/guestfish-actions.pod:3643
12880 "This command is simply a combination of L</part-init> followed by "
12881 "L</part-add> to create a single primary partition covering the whole disk."
12885 #: ../fish/guestfish-actions.pod:3647
12887 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12888 "possible values are described in L</part-init>."
12892 #: ../fish/guestfish-actions.pod:3653
12893 msgid "part-get-bootable"
12897 #: ../fish/guestfish-actions.pod:3655
12900 " part-get-bootable device partnum\n"
12905 #: ../fish/guestfish-actions.pod:3657 ../src/guestfs-actions.pod:5736
12907 "This command returns true if the partition C<partnum> on C<device> has the "
12908 "bootable flag set."
12912 #: ../fish/guestfish-actions.pod:3660
12913 msgid "See also L</part-set-bootable>."
12917 #: ../fish/guestfish-actions.pod:3662
12918 msgid "part-get-mbr-id"
12922 #: ../fish/guestfish-actions.pod:3664
12925 " part-get-mbr-id device partnum\n"
12930 #: ../fish/guestfish-actions.pod:3666 ../src/guestfs-actions.pod:5752
12932 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12933 "partition C<partnum>."
12937 #: ../fish/guestfish-actions.pod:3669 ../fish/guestfish-actions.pod:3813
12939 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12940 "undefined results for other partition table types (see "
12941 "L</part-get-parttype>)."
12945 #: ../fish/guestfish-actions.pod:3673
12946 msgid "part-get-parttype"
12950 #: ../fish/guestfish-actions.pod:3675
12953 " part-get-parttype device\n"
12958 #: ../fish/guestfish-actions.pod:3677 ../src/guestfs-actions.pod:5769
12960 "This command examines the partition table on C<device> and returns the "
12961 "partition table type (format) being used."
12965 #: ../fish/guestfish-actions.pod:3680
12967 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12968 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12969 "possible, although unusual. See L</part-init> for a full list."
12973 #: ../fish/guestfish-actions.pod:3685
12978 #: ../fish/guestfish-actions.pod:3687
12981 " part-init device parttype\n"
12986 #: ../fish/guestfish-actions.pod:3689 ../src/guestfs-actions.pod:5789
12988 "This creates an empty partition table on C<device> of one of the partition "
12989 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12990 "(for large disks)."
12994 #: ../fish/guestfish-actions.pod:3693
12996 "Initially there are no partitions. Following this, you should call "
12997 "L</part-add> for each partition required."
13001 #: ../fish/guestfish-actions.pod:3696 ../src/guestfs-actions.pod:5796
13002 msgid "Possible values for C<parttype> are:"
13006 #: ../fish/guestfish-actions.pod:3700 ../src/guestfs-actions.pod:5800
13011 #: ../fish/guestfish-actions.pod:3702 ../src/guestfs-actions.pod:5802
13016 #: ../fish/guestfish-actions.pod:3704 ../src/guestfs-actions.pod:5804
13017 msgid "Intel EFI / GPT partition table."
13021 #: ../fish/guestfish-actions.pod:3706 ../src/guestfs-actions.pod:5806
13023 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
13024 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
13025 "the C<mbr> format."
13029 #: ../fish/guestfish-actions.pod:3710 ../src/guestfs-actions.pod:5810
13034 #: ../fish/guestfish-actions.pod:3712 ../src/guestfs-actions.pod:5812
13039 #: ../fish/guestfish-actions.pod:3714 ../src/guestfs-actions.pod:5814
13041 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
13042 "Windows. This partition type will B<only> work for device sizes up to 2 "
13043 "TB. For large disks we recommend using C<gpt>."
13047 #: ../fish/guestfish-actions.pod:3721 ../src/guestfs-actions.pod:5821
13048 msgid "Other partition table types that may work but are not supported include:"
13052 #: ../fish/guestfish-actions.pod:3726 ../src/guestfs-actions.pod:5826
13057 #: ../fish/guestfish-actions.pod:3728 ../src/guestfs-actions.pod:5828
13058 msgid "AIX disk labels."
13062 #: ../fish/guestfish-actions.pod:3730 ../src/guestfs-actions.pod:5830
13067 #: ../fish/guestfish-actions.pod:3732 ../src/guestfs-actions.pod:5832
13072 #: ../fish/guestfish-actions.pod:3734 ../src/guestfs-actions.pod:5834
13073 msgid "Amiga \"Rigid Disk Block\" format."
13077 #: ../fish/guestfish-actions.pod:3736 ../src/guestfs-actions.pod:5836
13082 #: ../fish/guestfish-actions.pod:3738 ../src/guestfs-actions.pod:5838
13083 msgid "BSD disk labels."
13087 #: ../fish/guestfish-actions.pod:3740 ../src/guestfs-actions.pod:5840
13092 #: ../fish/guestfish-actions.pod:3742 ../src/guestfs-actions.pod:5842
13093 msgid "DASD, used on IBM mainframes."
13097 #: ../fish/guestfish-actions.pod:3744 ../src/guestfs-actions.pod:5844
13102 #: ../fish/guestfish-actions.pod:3746 ../src/guestfs-actions.pod:5846
13103 msgid "MIPS/SGI volumes."
13107 #: ../fish/guestfish-actions.pod:3748 ../src/guestfs-actions.pod:5848
13112 #: ../fish/guestfish-actions.pod:3750 ../src/guestfs-actions.pod:5850
13113 msgid "Old Mac partition format. Modern Macs use C<gpt>."
13117 #: ../fish/guestfish-actions.pod:3752 ../src/guestfs-actions.pod:5852
13122 #: ../fish/guestfish-actions.pod:3754 ../src/guestfs-actions.pod:5854
13123 msgid "NEC PC-98 format, common in Japan apparently."
13127 #: ../fish/guestfish-actions.pod:3756 ../src/guestfs-actions.pod:5856
13132 #: ../fish/guestfish-actions.pod:3758 ../src/guestfs-actions.pod:5858
13133 msgid "Sun disk labels."
13137 #: ../fish/guestfish-actions.pod:3762
13142 #: ../fish/guestfish-actions.pod:3764
13145 " part-list device\n"
13150 #: ../fish/guestfish-actions.pod:3766 ../src/guestfs-actions.pod:5872
13152 "This command parses the partition table on C<device> and returns the list of "
13153 "partitions found."
13157 #: ../fish/guestfish-actions.pod:3769 ../src/guestfs-actions.pod:5875
13158 msgid "The fields in the returned structure are:"
13162 #: ../fish/guestfish-actions.pod:3773 ../src/guestfs-actions.pod:5879
13163 msgid "B<part_num>"
13167 #: ../fish/guestfish-actions.pod:3775 ../src/guestfs-actions.pod:5881
13168 msgid "Partition number, counting from 1."
13172 #: ../fish/guestfish-actions.pod:3777 ../src/guestfs-actions.pod:5883
13173 msgid "B<part_start>"
13177 #: ../fish/guestfish-actions.pod:3779
13179 "Start of the partition I<in bytes>. To get sectors you have to divide by "
13180 "the device's sector size, see L</blockdev-getss>."
13184 #: ../fish/guestfish-actions.pod:3782 ../src/guestfs-actions.pod:5888
13185 msgid "B<part_end>"
13189 #: ../fish/guestfish-actions.pod:3784 ../src/guestfs-actions.pod:5890
13190 msgid "End of the partition in bytes."
13194 #: ../fish/guestfish-actions.pod:3786 ../src/guestfs-actions.pod:5892
13195 msgid "B<part_size>"
13199 #: ../fish/guestfish-actions.pod:3788 ../src/guestfs-actions.pod:5894
13200 msgid "Size of the partition in bytes."
13204 #: ../fish/guestfish-actions.pod:3792
13205 msgid "part-set-bootable"
13209 #: ../fish/guestfish-actions.pod:3794
13212 " part-set-bootable device partnum true|false\n"
13217 #: ../fish/guestfish-actions.pod:3796 ../src/guestfs-actions.pod:5912
13219 "This sets the bootable flag on partition numbered C<partnum> on device "
13220 "C<device>. Note that partitions are numbered from 1."
13224 #: ../fish/guestfish-actions.pod:3799 ../src/guestfs-actions.pod:5915
13226 "The bootable flag is used by some operating systems (notably Windows) to "
13227 "determine which partition to boot from. It is by no means universally "
13232 #: ../fish/guestfish-actions.pod:3803
13233 msgid "part-set-mbr-id"
13237 #: ../fish/guestfish-actions.pod:3805
13240 " part-set-mbr-id device partnum idbyte\n"
13245 #: ../fish/guestfish-actions.pod:3807 ../src/guestfs-actions.pod:5931
13247 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
13248 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
13249 "documentation are in fact hexadecimal numbers, but usually documented "
13250 "without any leading \"0x\" which might be confusing."
13254 #: ../fish/guestfish-actions.pod:3817
13255 msgid "part-set-name"
13259 #: ../fish/guestfish-actions.pod:3819
13262 " part-set-name device partnum name\n"
13267 #: ../fish/guestfish-actions.pod:3821 ../src/guestfs-actions.pod:5953
13269 "This sets the partition name on partition numbered C<partnum> on device "
13270 "C<device>. Note that partitions are numbered from 1."
13274 #: ../fish/guestfish-actions.pod:3824 ../src/guestfs-actions.pod:5956
13276 "The partition name can only be set on certain types of partition table. "
13277 "This works on C<gpt> but not on C<mbr> partitions."
13281 #: ../fish/guestfish-actions.pod:3827
13282 msgid "part-to-dev"
13286 #: ../fish/guestfish-actions.pod:3829
13289 " part-to-dev partition\n"
13294 #: ../fish/guestfish-actions.pod:3831 ../src/guestfs-actions.pod:5969
13296 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
13297 "partition number, returning the device name (eg. \"/dev/sdb\")."
13301 #: ../fish/guestfish-actions.pod:3835 ../fish/guestfish-actions.pod:3847
13303 "The named partition must exist, for example as a string returned from "
13304 "L</list-partitions>."
13308 #: ../fish/guestfish-actions.pod:3838
13309 msgid "See also L</part-to-partnum>."
13313 #: ../fish/guestfish-actions.pod:3840
13314 msgid "part-to-partnum"
13318 #: ../fish/guestfish-actions.pod:3842
13321 " part-to-partnum partition\n"
13326 #: ../fish/guestfish-actions.pod:3844 ../src/guestfs-actions.pod:5989
13328 "This function takes a partition name (eg. \"/dev/sdb1\") and returns the "
13329 "partition number (eg. C<1>)."
13333 #: ../fish/guestfish-actions.pod:3850
13334 msgid "See also L</part-to-dev>."
13338 #: ../fish/guestfish-actions.pod:3852
13339 msgid "ping-daemon"
13343 #: ../fish/guestfish-actions.pod:3854
13351 #: ../fish/guestfish-actions.pod:3856 ../src/guestfs-actions.pod:6004
13353 "This is a test probe into the guestfs daemon running inside the qemu "
13354 "subprocess. Calling this function checks that the daemon responds to the "
13355 "ping message, without affecting the daemon or attached block device(s) in "
13360 #: ../fish/guestfish-actions.pod:3861
13365 #: ../fish/guestfish-actions.pod:3863
13368 " pread path count offset\n"
13373 #: ../fish/guestfish-actions.pod:3865 ../src/guestfs-actions.pod:6022
13375 "This command lets you read part of a file. It reads C<count> bytes of the "
13376 "file, starting at C<offset>, from file C<path>."
13380 #: ../fish/guestfish-actions.pod:3868 ../fish/guestfish-actions.pod:3883 ../src/guestfs-actions.pod:6025 ../src/guestfs-actions.pod:6051
13382 "This may read fewer bytes than requested. For further details see the "
13383 "L<pread(2)> system call."
13387 #: ../fish/guestfish-actions.pod:3871
13388 msgid "See also L</pwrite>, L</pread-device>."
13392 #: ../fish/guestfish-actions.pod:3876
13393 msgid "pread-device"
13397 #: ../fish/guestfish-actions.pod:3878
13400 " pread-device device count offset\n"
13405 #: ../fish/guestfish-actions.pod:3880 ../src/guestfs-actions.pod:6048
13407 "This command lets you read part of a file. It reads C<count> bytes of "
13408 "C<device>, starting at C<offset>."
13412 #: ../fish/guestfish-actions.pod:3886
13413 msgid "See also L</pread>."
13417 #: ../fish/guestfish-actions.pod:3891
13422 #: ../fish/guestfish-actions.pod:3893
13425 " pvcreate device\n"
13430 #: ../fish/guestfish-actions.pod:3895 ../src/guestfs-actions.pod:6071
13432 "This creates an LVM physical volume on the named C<device>, where C<device> "
13433 "should usually be a partition name such as C</dev/sda1>."
13437 #: ../fish/guestfish-actions.pod:3899
13442 #: ../fish/guestfish-actions.pod:3901
13445 " pvremove device\n"
13450 #: ../fish/guestfish-actions.pod:3903 ../src/guestfs-actions.pod:6085
13452 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13457 #: ../fish/guestfish-actions.pod:3906 ../src/guestfs-actions.pod:6088
13459 "The implementation uses the C<pvremove> command which refuses to wipe "
13460 "physical volumes that contain any volume groups, so you have to remove those "
13465 #: ../fish/guestfish-actions.pod:3910
13470 #: ../fish/guestfish-actions.pod:3912
13473 " pvresize device\n"
13478 #: ../fish/guestfish-actions.pod:3914 ../src/guestfs-actions.pod:6102
13480 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13481 "the new size of the underlying device."
13485 #: ../fish/guestfish-actions.pod:3917
13486 msgid "pvresize-size"
13490 #: ../fish/guestfish-actions.pod:3919
13493 " pvresize-size device size\n"
13498 #: ../fish/guestfish-actions.pod:3921
13500 "This command is the same as L</pvresize> except that it allows you to "
13501 "specify the new size (in bytes) explicitly."
13505 #: ../fish/guestfish-actions.pod:3924
13510 #: ../fish/guestfish-actions.pod:3926
13518 #: ../fish/guestfish-actions.pod:3928 ../src/guestfs-actions.pod:6128
13520 "List all the physical volumes detected. This is the equivalent of the "
13521 "L<pvs(8)> command."
13525 #: ../fish/guestfish-actions.pod:3931 ../src/guestfs-actions.pod:6131
13527 "This returns a list of just the device names that contain PVs "
13528 "(eg. C</dev/sda2>)."
13532 #: ../fish/guestfish-actions.pod:3934
13533 msgid "See also L</pvs-full>."
13537 #: ../fish/guestfish-actions.pod:3936
13542 #: ../fish/guestfish-actions.pod:3938
13550 #: ../fish/guestfish-actions.pod:3940 ../src/guestfs-actions.pod:6147
13552 "List all the physical volumes detected. This is the equivalent of the "
13553 "L<pvs(8)> command. The \"full\" version includes all fields."
13557 #: ../fish/guestfish-actions.pod:3943
13562 #: ../fish/guestfish-actions.pod:3945
13570 #: ../fish/guestfish-actions.pod:3947 ../src/guestfs-actions.pod:6162
13571 msgid "This command returns the UUID of the LVM PV C<device>."
13575 #: ../fish/guestfish-actions.pod:3949
13580 #: ../fish/guestfish-actions.pod:3951
13583 " pwrite path content offset\n"
13588 #: ../fish/guestfish-actions.pod:3953 ../src/guestfs-actions.pod:6178
13590 "This command writes to part of a file. It writes the data buffer C<content> "
13591 "to the file C<path> starting at offset C<offset>."
13595 #: ../fish/guestfish-actions.pod:3956 ../src/guestfs-actions.pod:6181
13597 "This command implements the L<pwrite(2)> system call, and like that system "
13598 "call it may not write the full data requested. The return value is the "
13599 "number of bytes that were actually written to the file. This could even be "
13600 "0, although short writes are unlikely for regular files in ordinary "
13605 #: ../fish/guestfish-actions.pod:3962
13606 msgid "See also L</pread>, L</pwrite-device>."
13610 #: ../fish/guestfish-actions.pod:3967
13611 msgid "pwrite-device"
13615 #: ../fish/guestfish-actions.pod:3969
13618 " pwrite-device device content offset\n"
13623 #: ../fish/guestfish-actions.pod:3971 ../src/guestfs-actions.pod:6205
13625 "This command writes to part of a device. It writes the data buffer "
13626 "C<content> to C<device> starting at offset C<offset>."
13630 #: ../fish/guestfish-actions.pod:3974 ../src/guestfs-actions.pod:6208
13632 "This command implements the L<pwrite(2)> system call, and like that system "
13633 "call it may not write the full data requested (although short writes to disk "
13634 "devices and partitions are probably impossible with standard Linux kernels)."
13638 #: ../fish/guestfish-actions.pod:3979
13639 msgid "See also L</pwrite>."
13643 #: ../fish/guestfish-actions.pod:3984
13648 #: ../fish/guestfish-actions.pod:3986
13651 " read-file path\n"
13656 #: ../fish/guestfish-actions.pod:3988 ../src/guestfs-actions.pod:6229
13657 msgid "This calls returns the contents of the file C<path> as a buffer."
13661 #: ../fish/guestfish-actions.pod:3991
13663 "Unlike L</cat>, this function can correctly handle files that contain "
13664 "embedded ASCII NUL characters. However unlike L</download>, this function "
13665 "is limited in the total size of file that can be handled."
13669 #: ../fish/guestfish-actions.pod:3999
13674 #: ../fish/guestfish-actions.pod:4001
13677 " read-lines path\n"
13682 #: ../fish/guestfish-actions.pod:4005 ../src/guestfs-actions.pod:6254
13684 "The file contents are returned as a list of lines. Trailing C<LF> and "
13685 "C<CRLF> character sequences are I<not> returned."
13689 #: ../fish/guestfish-actions.pod:4008
13691 "Note that this function cannot correctly handle binary files (specifically, "
13692 "files containing C<\\0> character which is treated as end of line). For "
13693 "those you need to use the L</read-file> function which has a more complex "
13698 #: ../fish/guestfish-actions.pod:4013
13703 #: ../fish/guestfish-actions.pod:4015
13711 #: ../fish/guestfish-actions.pod:4017 ../src/guestfs-actions.pod:6274
13712 msgid "This returns the list of directory entries in directory C<dir>."
13716 #: ../fish/guestfish-actions.pod:4019 ../src/guestfs-actions.pod:6276
13718 "All entries in the directory are returned, including C<.> and C<..>. The "
13719 "entries are I<not> sorted, but returned in the same order as the underlying "
13724 #: ../fish/guestfish-actions.pod:4023 ../src/guestfs-actions.pod:6280
13726 "Also this call returns basic file type information about each file. The "
13727 "C<ftyp> field will contain one of the following characters:"
13731 #: ../fish/guestfish-actions.pod:4028 ../src/guestfs-actions.pod:6285
13736 #: ../fish/guestfish-actions.pod:4030 ../src/guestfs-actions.pod:6287
13737 msgid "Block special"
13741 #: ../fish/guestfish-actions.pod:4032 ../src/guestfs-actions.pod:6289
13746 #: ../fish/guestfish-actions.pod:4034 ../src/guestfs-actions.pod:6291
13747 msgid "Char special"
13751 #: ../fish/guestfish-actions.pod:4036 ../src/guestfs-actions.pod:6293
13756 #: ../fish/guestfish-actions.pod:4038 ../src/guestfs-actions.pod:6295
13761 #: ../fish/guestfish-actions.pod:4040 ../src/guestfs-actions.pod:6297
13766 #: ../fish/guestfish-actions.pod:4042 ../src/guestfs-actions.pod:6299
13767 msgid "FIFO (named pipe)"
13771 #: ../fish/guestfish-actions.pod:4044 ../src/guestfs-actions.pod:6301
13776 #: ../fish/guestfish-actions.pod:4046 ../src/guestfs-actions.pod:6303
13777 msgid "Symbolic link"
13781 #: ../fish/guestfish-actions.pod:4048 ../src/guestfs-actions.pod:6305
13786 #: ../fish/guestfish-actions.pod:4050 ../src/guestfs-actions.pod:6307
13787 msgid "Regular file"
13791 #: ../fish/guestfish-actions.pod:4052 ../src/guestfs-actions.pod:6309
13796 #: ../fish/guestfish-actions.pod:4054 ../src/guestfs-actions.pod:6311
13801 #: ../fish/guestfish-actions.pod:4056 ../src/guestfs-actions.pod:6313
13806 #: ../fish/guestfish-actions.pod:4058 ../src/guestfs-actions.pod:6315
13807 msgid "Unknown file type"
13811 #: ../fish/guestfish-actions.pod:4060 ../src/guestfs-actions.pod:6317
13816 #: ../fish/guestfish-actions.pod:4062 ../src/guestfs-actions.pod:6319
13817 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13821 #: ../fish/guestfish-actions.pod:4067
13823 "This function is primarily intended for use by programs. To get a simple "
13824 "list of names, use L</ls>. To get a printable directory for human "
13825 "consumption, use L</ll>."
13829 #: ../fish/guestfish-actions.pod:4071
13834 #: ../fish/guestfish-actions.pod:4073
13842 #: ../fish/guestfish-actions.pod:4075 ../src/guestfs-actions.pod:6340
13843 msgid "This command reads the target of a symbolic link."
13847 #: ../fish/guestfish-actions.pod:4077
13848 msgid "readlinklist"
13852 #: ../fish/guestfish-actions.pod:4079
13855 " readlinklist path 'names ...'\n"
13860 #: ../fish/guestfish-actions.pod:4081 ../src/guestfs-actions.pod:6354
13862 "This call allows you to do a C<readlink> operation on multiple files, where "
13863 "all files are in the directory C<path>. C<names> is the list of files from "
13868 #: ../fish/guestfish-actions.pod:4085 ../src/guestfs-actions.pod:6358
13870 "On return you get a list of strings, with a one-to-one correspondence to the "
13871 "C<names> list. Each string is the value of the symbolic link."
13875 #: ../fish/guestfish-actions.pod:4089 ../src/guestfs-actions.pod:6362
13877 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13878 "result string is the empty string C<\"\">. However the whole operation is "
13879 "completed even if there were C<readlink(2)> errors, and so you can call this "
13880 "function with names where you don't know if they are symbolic links already "
13881 "(albeit slightly less efficient)."
13885 #: ../fish/guestfish-actions.pod:4096 ../src/guestfs-actions.pod:6369
13887 "This call is intended for programs that want to efficiently list a directory "
13888 "contents without making many round-trips. Very long directory listings "
13889 "might cause the protocol message size to be exceeded, causing this call to "
13890 "fail. The caller must split up such requests into smaller groups of names."
13894 #: ../fish/guestfish-actions.pod:4103
13899 #: ../fish/guestfish-actions.pod:4105
13907 #: ../fish/guestfish-actions.pod:4107 ../src/guestfs-actions.pod:6388
13909 "Return the canonicalized absolute pathname of C<path>. The returned path "
13910 "has no C<.>, C<..> or symbolic link path elements."
13914 #: ../fish/guestfish-actions.pod:4110
13915 msgid "removexattr"
13919 #: ../fish/guestfish-actions.pod:4112
13922 " removexattr xattr path\n"
13927 #: ../fish/guestfish-actions.pod:4114 ../src/guestfs-actions.pod:6403
13928 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
13932 #: ../fish/guestfish-actions.pod:4117
13933 msgid "See also: L</lremovexattr>, L<attr(5)>."
13937 #: ../fish/guestfish-actions.pod:4119
13942 #: ../fish/guestfish-actions.pod:4121
13945 " resize2fs device\n"
13950 #: ../fish/guestfish-actions.pod:4123 ../src/guestfs-actions.pod:6418
13952 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13953 "underlying device."
13957 #: ../fish/guestfish-actions.pod:4126
13959 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
13960 "before calling this command. For unknown reasons C<resize2fs> sometimes "
13961 "gives an error about this and sometimes not. In any case, it is always safe "
13962 "to call L</e2fsck-f> before calling this function."
13966 #: ../fish/guestfish-actions.pod:4132
13967 msgid "resize2fs-M"
13971 #: ../fish/guestfish-actions.pod:4134
13974 " resize2fs-M device\n"
13979 #: ../fish/guestfish-actions.pod:4136
13981 "This command is the same as L</resize2fs>, but the filesystem is resized to "
13982 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
13987 #: ../fish/guestfish-actions.pod:4140
13989 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
13990 "and read the C<Block size> and C<Block count> values. These two numbers, "
13991 "multiplied together, give the resulting size of the minimal filesystem in "
13996 #: ../fish/guestfish-actions.pod:4145
13997 msgid "resize2fs-size"
14001 #: ../fish/guestfish-actions.pod:4147
14004 " resize2fs-size device size\n"
14009 #: ../fish/guestfish-actions.pod:4149
14011 "This command is the same as L</resize2fs> except that it allows you to "
14012 "specify the new size (in bytes) explicitly."
14016 #: ../fish/guestfish-actions.pod:4152
14021 #: ../fish/guestfish-actions.pod:4154
14029 #: ../fish/guestfish-actions.pod:4156 ../src/guestfs-actions.pod:6470
14030 msgid "Remove the single file C<path>."
14034 #: ../fish/guestfish-actions.pod:4158
14039 #: ../fish/guestfish-actions.pod:4160
14047 #: ../fish/guestfish-actions.pod:4162 ../src/guestfs-actions.pod:6482
14049 "Remove the file or directory C<path>, recursively removing the contents if "
14050 "its a directory. This is like the C<rm -rf> shell command."
14054 #: ../fish/guestfish-actions.pod:4166
14059 #: ../fish/guestfish-actions.pod:4168
14067 #: ../fish/guestfish-actions.pod:4170 ../src/guestfs-actions.pod:6496
14068 msgid "Remove the single directory C<path>."
14072 #: ../fish/guestfish-actions.pod:4172
14073 msgid "rmmountpoint"
14077 #: ../fish/guestfish-actions.pod:4174
14080 " rmmountpoint exemptpath\n"
14085 #: ../fish/guestfish-actions.pod:4176
14087 "This calls removes a mountpoint that was previously created with "
14088 "L</mkmountpoint>. See L</mkmountpoint> for full details."
14092 #: ../fish/guestfish-actions.pod:4180
14093 msgid "scrub-device"
14097 #: ../fish/guestfish-actions.pod:4182
14100 " scrub-device device\n"
14105 #: ../fish/guestfish-actions.pod:4184 ../src/guestfs-actions.pod:6522
14107 "This command writes patterns over C<device> to make data retrieval more "
14112 #: ../fish/guestfish-actions.pod:4187 ../fish/guestfish-actions.pod:4202 ../fish/guestfish-actions.pod:4215 ../src/guestfs-actions.pod:6525 ../src/guestfs-actions.pod:6546 ../src/guestfs-actions.pod:6565
14114 "It is an interface to the L<scrub(1)> program. See that manual page for "
14119 #: ../fish/guestfish-actions.pod:4193
14124 #: ../fish/guestfish-actions.pod:4195
14127 " scrub-file file\n"
14132 #: ../fish/guestfish-actions.pod:4197 ../src/guestfs-actions.pod:6541
14134 "This command writes patterns over a file to make data retrieval more "
14139 #: ../fish/guestfish-actions.pod:4200 ../src/guestfs-actions.pod:6544
14140 msgid "The file is I<removed> after scrubbing."
14144 #: ../fish/guestfish-actions.pod:4205
14145 msgid "scrub-freespace"
14149 #: ../fish/guestfish-actions.pod:4207
14152 " scrub-freespace dir\n"
14157 #: ../fish/guestfish-actions.pod:4209
14159 "This command creates the directory C<dir> and then fills it with files until "
14160 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
14161 "deletes them. The intention is to scrub any free space on the partition "
14162 "containing C<dir>."
14166 #: ../fish/guestfish-actions.pod:4218
14171 #: ../fish/guestfish-actions.pod:4220
14176 #: ../fish/guestfish-actions.pod:4222
14179 " set-append append\n"
14184 #: ../fish/guestfish-actions.pod:4224 ../src/guestfs-actions.pod:6578
14186 "This function is used to add additional options to the guest kernel command "
14191 #: ../fish/guestfish-actions.pod:4227 ../src/guestfs-actions.pod:6581
14193 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
14194 "environment variable."
14198 #: ../fish/guestfish-actions.pod:4230 ../src/guestfs-actions.pod:6584
14200 "Setting C<append> to C<NULL> means I<no> additional options are passed "
14201 "(libguestfs always adds a few of its own)."
14205 #: ../fish/guestfish-actions.pod:4233
14206 msgid "set-attach-method"
14210 #: ../fish/guestfish-actions.pod:4235
14211 msgid "attach-method"
14215 #: ../fish/guestfish-actions.pod:4237
14218 " set-attach-method attachmethod\n"
14223 #: ../fish/guestfish-actions.pod:4239 ../src/guestfs-actions.pod:6597
14225 "Set the method that libguestfs uses to connect to the back end guestfsd "
14226 "daemon. Possible methods are:"
14230 #: ../fish/guestfish-actions.pod:4244 ../src/guestfs-actions.pod:6602 ../src/guestfs.pod:2916
14231 msgid "C<appliance>"
14235 #: ../fish/guestfish-actions.pod:4246 ../src/guestfs-actions.pod:6604
14237 "Launch an appliance and connect to it. This is the ordinary method and the "
14242 #: ../fish/guestfish-actions.pod:4249 ../src/guestfs-actions.pod:6607
14243 msgid "C<unix:I<path>>"
14247 #: ../fish/guestfish-actions.pod:4251 ../src/guestfs-actions.pod:6609
14248 msgid "Connect to the Unix domain socket I<path>."
14252 #: ../fish/guestfish-actions.pod:4253 ../src/guestfs-actions.pod:6611
14254 "This method lets you connect to an existing daemon or (using virtio-serial) "
14255 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
14256 "RUNNING DAEMONS>."
14260 #: ../fish/guestfish-actions.pod:4259
14261 msgid "set-autosync"
14265 #: ../fish/guestfish-actions.pod:4261
14270 #: ../fish/guestfish-actions.pod:4263
14273 " set-autosync true|false\n"
14278 #: ../fish/guestfish-actions.pod:4265 ../src/guestfs-actions.pod:6627
14280 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
14281 "effort attempt to make filesystems consistent and synchronized when the "
14282 "handle is closed (also if the program exits without closing handles)."
14286 #: ../fish/guestfish-actions.pod:4270 ../src/guestfs-actions.pod:6632
14288 "This is enabled by default (since libguestfs 1.5.24, previously it was "
14289 "disabled by default)."
14293 #: ../fish/guestfish-actions.pod:4273
14298 #: ../fish/guestfish-actions.pod:4275
14303 #: ../fish/guestfish-actions.pod:4277
14306 " set-direct true|false\n"
14311 #: ../fish/guestfish-actions.pod:4279 ../src/guestfs-actions.pod:6645
14313 "If the direct appliance mode flag is enabled, then stdin and stdout are "
14314 "passed directly through to the appliance once it is launched."
14318 #: ../fish/guestfish-actions.pod:4283
14320 "One consequence of this is that log messages aren't caught by the library "
14321 "and handled by L</set-log-message-callback>, but go straight to stdout."
14325 #: ../fish/guestfish-actions.pod:4287 ../src/guestfs-actions.pod:6653
14326 msgid "You probably don't want to use this unless you know what you are doing."
14330 #: ../fish/guestfish-actions.pod:4290 ../src/guestfs-actions.pod:6656
14331 msgid "The default is disabled."
14335 #: ../fish/guestfish-actions.pod:4292
14336 msgid "set-e2label"
14340 #: ../fish/guestfish-actions.pod:4294
14343 " set-e2label device label\n"
14348 #: ../fish/guestfish-actions.pod:4296 ../src/guestfs-actions.pod:6669
14350 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
14351 "C<label>. Filesystem labels are limited to 16 characters."
14355 #: ../fish/guestfish-actions.pod:4300
14357 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
14358 "label on a filesystem."
14362 #: ../fish/guestfish-actions.pod:4303
14367 #: ../fish/guestfish-actions.pod:4305
14370 " set-e2uuid device uuid\n"
14375 #: ../fish/guestfish-actions.pod:4307 ../src/guestfs-actions.pod:6687
14377 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
14378 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
14379 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
14383 #: ../fish/guestfish-actions.pod:4312
14385 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
14386 "UUID of a filesystem."
14390 #: ../fish/guestfish-actions.pod:4315
14391 msgid "set-memsize"
14395 #: ../fish/guestfish-actions.pod:4317
14400 #: ../fish/guestfish-actions.pod:4319
14403 " set-memsize memsize\n"
14408 #: ../fish/guestfish-actions.pod:4321
14410 "This sets the memory size in megabytes allocated to the qemu subprocess. "
14411 "This only has any effect if called before L</launch>."
14415 #: ../fish/guestfish-actions.pod:4325 ../src/guestfs-actions.pod:6709
14417 "You can also change this by setting the environment variable "
14418 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
14422 #: ../fish/guestfish-actions.pod:4332
14423 msgid "set-network"
14427 #: ../fish/guestfish-actions.pod:4334
14432 #: ../fish/guestfish-actions.pod:4336
14435 " set-network true|false\n"
14440 #: ../fish/guestfish-actions.pod:4338 ../src/guestfs-actions.pod:6726
14442 "If C<network> is true, then the network is enabled in the libguestfs "
14443 "appliance. The default is false."
14447 #: ../fish/guestfish-actions.pod:4341 ../src/guestfs-actions.pod:6729
14449 "This affects whether commands are able to access the network (see "
14450 "L<guestfs(3)/RUNNING COMMANDS>)."
14454 #: ../fish/guestfish-actions.pod:4344
14455 msgid "You must call this before calling L</launch>, otherwise it has no effect."
14459 #: ../fish/guestfish-actions.pod:4347
14464 #: ../fish/guestfish-actions.pod:4351
14467 " set-path searchpath\n"
14472 #: ../fish/guestfish-actions.pod:4353 ../src/guestfs-actions.pod:6745
14473 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14477 #: ../fish/guestfish-actions.pod:4355 ../src/guestfs-actions.pod:6747
14479 "The default is C<$libdir/guestfs> unless overridden by setting "
14480 "C<LIBGUESTFS_PATH> environment variable."
14484 #: ../fish/guestfish-actions.pod:4358 ../src/guestfs-actions.pod:6750
14485 msgid "Setting C<path> to C<NULL> restores the default path."
14489 #: ../fish/guestfish-actions.pod:4360
14494 #: ../fish/guestfish-actions.pod:4362
14499 #: ../fish/guestfish-actions.pod:4364
14502 " set-pgroup true|false\n"
14507 #: ../fish/guestfish-actions.pod:4366 ../src/guestfs-actions.pod:6762
14509 "If C<pgroup> is true, child processes are placed into their own process "
14514 #: ../fish/guestfish-actions.pod:4369 ../src/guestfs-actions.pod:6765
14516 "The practical upshot of this is that signals like C<SIGINT> (from users "
14517 "pressing C<^C>) won't be received by the child process."
14521 #: ../fish/guestfish-actions.pod:4372 ../src/guestfs-actions.pod:6768
14523 "The default for this flag is false, because usually you want C<^C> to kill "
14528 #: ../fish/guestfish-actions.pod:4375
14533 #: ../fish/guestfish-actions.pod:4377
14538 #: ../fish/guestfish-actions.pod:4379
14546 #: ../fish/guestfish-actions.pod:4381 ../src/guestfs-actions.pod:6781
14547 msgid "Set the qemu binary that we will use."
14551 #: ../fish/guestfish-actions.pod:4383 ../src/guestfs-actions.pod:6783
14552 msgid "The default is chosen when the library was compiled by the configure script."
14556 #: ../fish/guestfish-actions.pod:4386 ../src/guestfs-actions.pod:6786
14558 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
14563 #: ../fish/guestfish-actions.pod:4389 ../src/guestfs-actions.pod:6789
14564 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
14568 #: ../fish/guestfish-actions.pod:4391 ../src/guestfs-actions.pod:6791
14570 "Note that you should call this function as early as possible after creating "
14571 "the handle. This is because some pre-launch operations depend on testing "
14572 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
14573 "don't retest features, and so you might see inconsistent results. Using the "
14574 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
14575 "the qemu binary at the same time as the handle is created."
14579 #: ../fish/guestfish-actions.pod:4399
14580 msgid "set-recovery-proc"
14584 #: ../fish/guestfish-actions.pod:4401
14585 msgid "recovery-proc"
14589 #: ../fish/guestfish-actions.pod:4403
14592 " set-recovery-proc true|false\n"
14597 #: ../fish/guestfish-actions.pod:4405
14599 "If this is called with the parameter C<false> then L</launch> does not "
14600 "create a recovery process. The purpose of the recovery process is to stop "
14601 "runaway qemu processes in the case where the main program aborts abruptly."
14605 #: ../fish/guestfish-actions.pod:4410
14607 "This only has any effect if called before L</launch>, and the default is "
14612 #: ../fish/guestfish-actions.pod:4413 ../src/guestfs-actions.pod:6817
14614 "About the only time when you would want to disable this is if the main "
14615 "process will fork itself into the background (\"daemonize\" itself). In "
14616 "this case the recovery process thinks that the main program has disappeared "
14617 "and so kills qemu, which is not very helpful."
14621 #: ../fish/guestfish-actions.pod:4419
14622 msgid "set-selinux"
14626 #: ../fish/guestfish-actions.pod:4421
14631 #: ../fish/guestfish-actions.pod:4423
14634 " set-selinux true|false\n"
14639 #: ../fish/guestfish-actions.pod:4425 ../src/guestfs-actions.pod:6833
14641 "This sets the selinux flag that is passed to the appliance at boot time. "
14642 "The default is C<selinux=0> (disabled)."
14646 #: ../fish/guestfish-actions.pod:4428 ../src/guestfs-actions.pod:6836
14648 "Note that if SELinux is enabled, it is always in Permissive mode "
14649 "(C<enforcing=0>)."
14653 #: ../fish/guestfish-actions.pod:4434
14658 #: ../fish/guestfish-actions.pod:4436
14663 #: ../fish/guestfish-actions.pod:4438
14671 #: ../fish/guestfish-actions.pod:4440 ../src/guestfs-actions.pod:6852
14673 "Change the number of virtual CPUs assigned to the appliance. The default is "
14674 "C<1>. Increasing this may improve performance, though often it has no "
14679 #: ../fish/guestfish-actions.pod:4444
14680 msgid "This function must be called before L</launch>."
14684 #: ../fish/guestfish-actions.pod:4446
14689 #: ../fish/guestfish-actions.pod:4448
14694 #: ../fish/guestfish-actions.pod:4450
14697 " set-trace true|false\n"
14702 #: ../fish/guestfish-actions.pod:4452 ../src/guestfs-actions.pod:6868
14704 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
14705 "return values are traced."
14709 #: ../fish/guestfish-actions.pod:4455 ../src/guestfs-actions.pod:6871
14711 "If you want to trace C API calls into libguestfs (and other libraries) then "
14712 "possibly a better way is to use the external ltrace(1) command."
14716 #: ../fish/guestfish-actions.pod:4459 ../src/guestfs-actions.pod:6875
14718 "Command traces are disabled unless the environment variable "
14719 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14723 #: ../fish/guestfish-actions.pod:4462
14725 "Trace messages are normally sent to C<stderr>, unless you register a "
14726 "callback to send them somewhere else (see L</set-event-callback>)."
14730 #: ../fish/guestfish-actions.pod:4466
14731 msgid "set-verbose"
14735 #: ../fish/guestfish-actions.pod:4468
14740 #: ../fish/guestfish-actions.pod:4470
14743 " set-verbose true|false\n"
14748 #: ../fish/guestfish-actions.pod:4472 ../src/guestfs-actions.pod:6892
14749 msgid "If C<verbose> is true, this turns on verbose messages."
14753 #: ../fish/guestfish-actions.pod:4474 ../src/guestfs-actions.pod:6894
14755 "Verbose messages are disabled unless the environment variable "
14756 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14760 #: ../fish/guestfish-actions.pod:4477
14762 "Verbose messages are normally sent to C<stderr>, unless you register a "
14763 "callback to send them somewhere else (see L</set-event-callback>)."
14767 #: ../fish/guestfish-actions.pod:4481
14772 #: ../fish/guestfish-actions.pod:4483
14775 " setcon context\n"
14780 #: ../fish/guestfish-actions.pod:4485 ../src/guestfs-actions.pod:6911
14782 "This sets the SELinux security context of the daemon to the string "
14787 #: ../fish/guestfish-actions.pod:4488 ../src/guestfs-actions.pod:6914
14788 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14792 #: ../fish/guestfish-actions.pod:4490
14797 #: ../fish/guestfish-actions.pod:4492
14800 " setxattr xattr val vallen path\n"
14805 #: ../fish/guestfish-actions.pod:4494 ../src/guestfs-actions.pod:6929
14807 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14808 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14812 #: ../fish/guestfish-actions.pod:4498
14813 msgid "See also: L</lsetxattr>, L<attr(5)>."
14817 #: ../fish/guestfish-actions.pod:4500
14822 #: ../fish/guestfish-actions.pod:4502
14825 " sfdisk device cyls heads sectors 'lines ...'\n"
14830 #: ../fish/guestfish-actions.pod:4504 ../src/guestfs-actions.pod:6956
14832 "This is a direct interface to the L<sfdisk(8)> program for creating "
14833 "partitions on block devices."
14837 #: ../fish/guestfish-actions.pod:4507 ../src/guestfs-actions.pod:6959
14838 msgid "C<device> should be a block device, for example C</dev/sda>."
14842 #: ../fish/guestfish-actions.pod:4509 ../src/guestfs-actions.pod:6961
14844 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14845 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
14846 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14847 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14848 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14849 "the kernel) cannot work out the right geometry and you will need to tell it."
14853 #: ../fish/guestfish-actions.pod:4517 ../src/guestfs-actions.pod:6969
14855 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14856 "refer to the L<sfdisk(8)> manpage."
14860 #: ../fish/guestfish-actions.pod:4520 ../src/guestfs-actions.pod:6972
14862 "To create a single partition occupying the whole disk, you would pass "
14863 "C<lines> as a single element list, when the single element being the string "
14868 #: ../fish/guestfish-actions.pod:4524
14869 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
14873 #: ../fish/guestfish-actions.pod:4530 ../fish/guestfish-actions.pod:4553 ../fish/guestfish-actions.pod:4575
14875 "I<This function is deprecated.> In new code, use the L</part_add> call "
14880 #: ../fish/guestfish-actions.pod:4537
14885 #: ../fish/guestfish-actions.pod:4539
14888 " sfdiskM device 'lines ...'\n"
14893 #: ../fish/guestfish-actions.pod:4541
14895 "This is a simplified interface to the L</sfdisk> command, where partition "
14896 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
14897 "you don't need to specify the cyls, heads and sectors parameters which were "
14898 "rarely if ever used anyway."
14902 #: ../fish/guestfish-actions.pod:4547
14903 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
14907 #: ../fish/guestfish-actions.pod:4560
14912 #: ../fish/guestfish-actions.pod:4562
14915 " sfdisk-N device partnum cyls heads sectors line\n"
14920 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:7034
14922 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14923 "(note: C<n> counts from 1)."
14927 #: ../fish/guestfish-actions.pod:4567
14929 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
14930 "cyls/heads/sectors parameters."
14934 #: ../fish/guestfish-actions.pod:4570
14935 msgid "See also: L</part-add>"
14939 #: ../fish/guestfish-actions.pod:4582
14940 msgid "sfdisk-disk-geometry"
14944 #: ../fish/guestfish-actions.pod:4584
14947 " sfdisk-disk-geometry device\n"
14952 #: ../fish/guestfish-actions.pod:4586
14954 "This displays the disk geometry of C<device> read from the partition table. "
14955 "Especially in the case where the underlying block device has been resized, "
14956 "this can be different from the kernel's idea of the geometry (see "
14957 "L</sfdisk-kernel-geometry>)."
14961 #: ../fish/guestfish-actions.pod:4591 ../fish/guestfish-actions.pod:4600 ../src/guestfs-actions.pod:7060 ../src/guestfs-actions.pod:7076
14962 msgid "The result is in human-readable format, and not designed to be parsed."
14966 #: ../fish/guestfish-actions.pod:4594
14967 msgid "sfdisk-kernel-geometry"
14971 #: ../fish/guestfish-actions.pod:4596
14974 " sfdisk-kernel-geometry device\n"
14979 #: ../fish/guestfish-actions.pod:4598 ../src/guestfs-actions.pod:7074
14980 msgid "This displays the kernel's idea of the geometry of C<device>."
14984 #: ../fish/guestfish-actions.pod:4603
14989 #: ../fish/guestfish-actions.pod:4605
14992 " sfdisk-l device\n"
14997 #: ../fish/guestfish-actions.pod:4607 ../src/guestfs-actions.pod:7097
14999 "This displays the partition table on C<device>, in the human-readable output "
15000 "of the L<sfdisk(8)> command. It is not intended to be parsed."
15004 #: ../fish/guestfish-actions.pod:4611
15005 msgid "See also: L</part-list>"
15009 #: ../fish/guestfish-actions.pod:4613
15011 "I<This function is deprecated.> In new code, use the L</part_list> call "
15016 #: ../fish/guestfish-actions.pod:4620
15021 #: ../fish/guestfish-actions.pod:4622
15029 #: ../fish/guestfish-actions.pod:4624 ../src/guestfs-actions.pod:7114
15031 "This call runs a command from the guest filesystem via the guest's "
15036 #: ../fish/guestfish-actions.pod:4627
15037 msgid "This is like L</command>, but passes the command to:"
15041 #: ../fish/guestfish-actions.pod:4629 ../src/guestfs-actions.pod:7119
15044 " /bin/sh -c \"command\"\n"
15049 #: ../fish/guestfish-actions.pod:4631 ../src/guestfs-actions.pod:7121
15051 "Depending on the guest's shell, this usually results in wildcards being "
15052 "expanded, shell expressions being interpolated and so on."
15056 #: ../fish/guestfish-actions.pod:4635
15057 msgid "All the provisos about L</command> apply to this call."
15061 #: ../fish/guestfish-actions.pod:4637
15066 #: ../fish/guestfish-actions.pod:4639
15069 " sh-lines command\n"
15074 #: ../fish/guestfish-actions.pod:4641
15075 msgid "This is the same as L</sh>, but splits the result into a list of lines."
15079 #: ../fish/guestfish-actions.pod:4644
15080 msgid "See also: L</command-lines>"
15084 #: ../fish/guestfish-actions.pod:4646
15089 #: ../fish/guestfish-actions.pod:4648
15097 #: ../fish/guestfish-actions.pod:4650 ../src/guestfs-actions.pod:7155
15098 msgid "Sleep for C<secs> seconds."
15102 #: ../fish/guestfish-actions.pod:4652
15107 #: ../fish/guestfish-actions.pod:4654
15115 #: ../fish/guestfish-actions.pod:4658 ../src/guestfs-actions.pod:7169
15116 msgid "This is the same as the C<stat(2)> system call."
15120 #: ../fish/guestfish-actions.pod:4660
15125 #: ../fish/guestfish-actions.pod:4662
15133 #: ../fish/guestfish-actions.pod:4664 ../src/guestfs-actions.pod:7183
15135 "Returns file system statistics for any mounted file system. C<path> should "
15136 "be a file or directory in the mounted file system (typically it is the mount "
15137 "point itself, but it doesn't need to be)."
15141 #: ../fish/guestfish-actions.pod:4668 ../src/guestfs-actions.pod:7187
15142 msgid "This is the same as the C<statvfs(2)> system call."
15146 #: ../fish/guestfish-actions.pod:4670
15151 #: ../fish/guestfish-actions.pod:4672
15159 #: ../fish/guestfish-actions.pod:4674 ../src/guestfs-actions.pod:7201
15161 "This runs the L<strings(1)> command on a file and returns the list of "
15162 "printable strings found."
15166 #: ../fish/guestfish-actions.pod:4680
15171 #: ../fish/guestfish-actions.pod:4682
15174 " strings-e encoding path\n"
15179 #: ../fish/guestfish-actions.pod:4684
15181 "This is like the L</strings> command, but allows you to specify the encoding "
15182 "of strings that are looked for in the source file C<path>."
15186 #: ../fish/guestfish-actions.pod:4688 ../src/guestfs-actions.pod:7224
15187 msgid "Allowed encodings are:"
15191 #: ../fish/guestfish-actions.pod:4692 ../src/guestfs-actions.pod:7228
15196 #: ../fish/guestfish-actions.pod:4694
15198 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
15199 "ISO-8859-X (this is what L</strings> uses)."
15203 #: ../fish/guestfish-actions.pod:4697 ../src/guestfs-actions.pod:7233
15208 #: ../fish/guestfish-actions.pod:4699 ../src/guestfs-actions.pod:7235
15209 msgid "Single 8-bit-byte characters."
15213 #: ../fish/guestfish-actions.pod:4701 ../src/guestfs-actions.pod:7237
15218 #: ../fish/guestfish-actions.pod:4703 ../src/guestfs-actions.pod:7239
15219 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
15223 #: ../fish/guestfish-actions.pod:4706 ../src/guestfs-actions.pod:7242
15224 msgid "l (lower case letter L)"
15228 #: ../fish/guestfish-actions.pod:4708 ../src/guestfs-actions.pod:7244
15230 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
15231 "examining binaries in Windows guests."
15235 #: ../fish/guestfish-actions.pod:4711 ../src/guestfs-actions.pod:7247
15240 #: ../fish/guestfish-actions.pod:4713 ../src/guestfs-actions.pod:7249
15241 msgid "32-bit big endian such as UCS-4BE."
15245 #: ../fish/guestfish-actions.pod:4715 ../src/guestfs-actions.pod:7251
15250 #: ../fish/guestfish-actions.pod:4717 ../src/guestfs-actions.pod:7253
15251 msgid "32-bit little endian such as UCS-4LE."
15255 #: ../fish/guestfish-actions.pod:4721 ../src/guestfs-actions.pod:7257
15256 msgid "The returned strings are transcoded to UTF-8."
15260 #: ../fish/guestfish-actions.pod:4726
15261 msgid "swapoff-device"
15265 #: ../fish/guestfish-actions.pod:4728
15268 " swapoff-device device\n"
15273 #: ../fish/guestfish-actions.pod:4730
15275 "This command disables the libguestfs appliance swap device or partition "
15276 "named C<device>. See L</swapon-device>."
15280 #: ../fish/guestfish-actions.pod:4734
15281 msgid "swapoff-file"
15285 #: ../fish/guestfish-actions.pod:4736
15288 " swapoff-file file\n"
15293 #: ../fish/guestfish-actions.pod:4738 ../src/guestfs-actions.pod:7288
15294 msgid "This command disables the libguestfs appliance swap on file."
15298 #: ../fish/guestfish-actions.pod:4740
15299 msgid "swapoff-label"
15303 #: ../fish/guestfish-actions.pod:4742
15306 " swapoff-label label\n"
15311 #: ../fish/guestfish-actions.pod:4744 ../src/guestfs-actions.pod:7300
15313 "This command disables the libguestfs appliance swap on labeled swap "
15318 #: ../fish/guestfish-actions.pod:4747
15319 msgid "swapoff-uuid"
15323 #: ../fish/guestfish-actions.pod:4749
15326 " swapoff-uuid uuid\n"
15331 #: ../fish/guestfish-actions.pod:4751 ../src/guestfs-actions.pod:7313
15333 "This command disables the libguestfs appliance swap partition with the given "
15338 #: ../fish/guestfish-actions.pod:4754
15339 msgid "swapon-device"
15343 #: ../fish/guestfish-actions.pod:4756
15346 " swapon-device device\n"
15351 #: ../fish/guestfish-actions.pod:4758
15353 "This command enables the libguestfs appliance to use the swap device or "
15354 "partition named C<device>. The increased memory is made available for all "
15355 "commands, for example those run using L</command> or L</sh>."
15359 #: ../fish/guestfish-actions.pod:4763 ../src/guestfs-actions.pod:7331
15361 "Note that you should not swap to existing guest swap partitions unless you "
15362 "know what you are doing. They may contain hibernation information, or other "
15363 "information that the guest doesn't want you to trash. You also risk leaking "
15364 "information about the host to the guest this way. Instead, attach a new "
15365 "host device to the guest and swap on that."
15369 #: ../fish/guestfish-actions.pod:4770
15370 msgid "swapon-file"
15374 #: ../fish/guestfish-actions.pod:4772
15377 " swapon-file file\n"
15382 #: ../fish/guestfish-actions.pod:4774
15383 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
15387 #: ../fish/guestfish-actions.pod:4777
15388 msgid "swapon-label"
15392 #: ../fish/guestfish-actions.pod:4779
15395 " swapon-label label\n"
15400 #: ../fish/guestfish-actions.pod:4781
15402 "This command enables swap to a labeled swap partition. See "
15403 "L</swapon-device> for other notes."
15407 #: ../fish/guestfish-actions.pod:4784
15408 msgid "swapon-uuid"
15412 #: ../fish/guestfish-actions.pod:4786
15415 " swapon-uuid uuid\n"
15420 #: ../fish/guestfish-actions.pod:4788
15422 "This command enables swap to a swap partition with the given UUID. See "
15423 "L</swapon-device> for other notes."
15427 #: ../fish/guestfish-actions.pod:4791
15432 #: ../fish/guestfish-actions.pod:4793
15440 #: ../fish/guestfish-actions.pod:4795 ../src/guestfs-actions.pod:7386
15442 "This syncs the disk, so that any writes are flushed through to the "
15443 "underlying disk image."
15447 #: ../fish/guestfish-actions.pod:4798 ../src/guestfs-actions.pod:7389
15449 "You should always call this if you have modified a disk image, before "
15450 "closing the handle."
15454 #: ../fish/guestfish-actions.pod:4801
15459 #: ../fish/guestfish-actions.pod:4803
15467 #: ../fish/guestfish-actions.pod:4805 ../src/guestfs-actions.pod:7402
15468 msgid "This command returns up to the last 10 lines of a file as a list of strings."
15472 #: ../fish/guestfish-actions.pod:4811
15477 #: ../fish/guestfish-actions.pod:4813
15480 " tail-n nrlines path\n"
15485 #: ../fish/guestfish-actions.pod:4815 ../src/guestfs-actions.pod:7421
15487 "If the parameter C<nrlines> is a positive number, this returns the last "
15488 "C<nrlines> lines of the file C<path>."
15492 #: ../fish/guestfish-actions.pod:4818 ../src/guestfs-actions.pod:7424
15494 "If the parameter C<nrlines> is a negative number, this returns lines from "
15495 "the file C<path>, starting with the C<-nrlines>th line."
15499 #: ../fish/guestfish-actions.pod:4826
15504 #: ../fish/guestfish-actions.pod:4828
15507 " tar-in (tarfile|-) directory\n"
15512 #: ../fish/guestfish-actions.pod:4830 ../src/guestfs-actions.pod:7445
15514 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
15515 "tar file) into C<directory>."
15519 #: ../fish/guestfish-actions.pod:4833
15520 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
15524 #: ../fish/guestfish-actions.pod:4838
15529 #: ../fish/guestfish-actions.pod:4840
15532 " tar-out directory (tarfile|-)\n"
15537 #: ../fish/guestfish-actions.pod:4842 ../src/guestfs-actions.pod:7462
15539 "This command packs the contents of C<directory> and downloads it to local "
15544 #: ../fish/guestfish-actions.pod:4845
15545 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
15549 #: ../fish/guestfish-actions.pod:4850
15554 #: ../fish/guestfish-actions.pod:4852
15557 " tgz-in (tarball|-) directory\n"
15562 #: ../fish/guestfish-actions.pod:4854 ../src/guestfs-actions.pod:7479
15564 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
15565 "tar file) into C<directory>."
15569 #: ../fish/guestfish-actions.pod:4857
15570 msgid "To upload an uncompressed tarball, use L</tar-in>."
15574 #: ../fish/guestfish-actions.pod:4861
15579 #: ../fish/guestfish-actions.pod:4863
15582 " tgz-out directory (tarball|-)\n"
15587 #: ../fish/guestfish-actions.pod:4865 ../src/guestfs-actions.pod:7495
15589 "This command packs the contents of C<directory> and downloads it to local "
15594 #: ../fish/guestfish-actions.pod:4868
15595 msgid "To download an uncompressed tarball, use L</tar-out>."
15599 #: ../fish/guestfish-actions.pod:4872
15604 #: ../fish/guestfish-actions.pod:4874
15612 #: ../fish/guestfish-actions.pod:4876 ../src/guestfs-actions.pod:7510
15614 "Touch acts like the L<touch(1)> command. It can be used to update the "
15615 "timestamps on a file, or, if the file does not exist, to create a new "
15616 "zero-length file."
15620 #: ../fish/guestfish-actions.pod:4880 ../src/guestfs-actions.pod:7514
15622 "This command only works on regular files, and will fail on other file types "
15623 "such as directories, symbolic links, block special etc."
15627 #: ../fish/guestfish-actions.pod:4883
15632 #: ../fish/guestfish-actions.pod:4885
15640 #: ../fish/guestfish-actions.pod:4887 ../src/guestfs-actions.pod:7527
15642 "This command truncates C<path> to a zero-length file. The file must exist "
15647 #: ../fish/guestfish-actions.pod:4890
15648 msgid "truncate-size"
15652 #: ../fish/guestfish-actions.pod:4892
15655 " truncate-size path size\n"
15660 #: ../fish/guestfish-actions.pod:4894 ../src/guestfs-actions.pod:7541
15662 "This command truncates C<path> to size C<size> bytes. The file must exist "
15667 #: ../fish/guestfish-actions.pod:4897
15669 "If the current file size is less than C<size> then the file is extended to "
15670 "the required size with zero bytes. This creates a sparse file (ie. disk "
15671 "blocks are not allocated for the file until you write to it). To create a "
15672 "non-sparse file of zeroes, use L</fallocate64> instead."
15676 #: ../fish/guestfish-actions.pod:4903
15681 #: ../fish/guestfish-actions.pod:4905
15684 " tune2fs-l device\n"
15689 #: ../fish/guestfish-actions.pod:4907 ../src/guestfs-actions.pod:7560
15691 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15696 #: ../fish/guestfish-actions.pod:4910 ../src/guestfs-actions.pod:7563
15698 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15699 "for more details. The list of fields returned isn't clearly defined, and "
15700 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15701 "and the filesystem itself."
15705 #: ../fish/guestfish-actions.pod:4915
15710 #: ../fish/guestfish-actions.pod:4917
15713 " txz-in (tarball|-) directory\n"
15718 #: ../fish/guestfish-actions.pod:4919 ../src/guestfs-actions.pod:7583
15720 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15721 "tar file) into C<directory>."
15725 #: ../fish/guestfish-actions.pod:4924
15730 #: ../fish/guestfish-actions.pod:4926
15733 " txz-out directory (tarball|-)\n"
15738 #: ../fish/guestfish-actions.pod:4928 ../src/guestfs-actions.pod:7597
15740 "This command packs the contents of C<directory> and downloads it to local "
15741 "file C<tarball> (as an xz compressed tar archive)."
15745 #: ../fish/guestfish-actions.pod:4933
15750 #: ../fish/guestfish-actions.pod:4935
15758 #: ../fish/guestfish-actions.pod:4937 ../src/guestfs-actions.pod:7610
15760 "This function sets the mask used for creating new files and device nodes to "
15765 #: ../fish/guestfish-actions.pod:4940 ../src/guestfs-actions.pod:7613
15767 "Typical umask values would be C<022> which creates new files with "
15768 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15769 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15773 #: ../fish/guestfish-actions.pod:4945 ../src/guestfs-actions.pod:7618
15775 "The default umask is C<022>. This is important because it means that "
15776 "directories and device nodes will be created with C<0644> or C<0755> mode "
15777 "even if you specify C<0777>."
15781 #: ../fish/guestfish-actions.pod:4949
15782 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
15786 #: ../fish/guestfish-actions.pod:4952 ../src/guestfs-actions.pod:7625
15787 msgid "This call returns the previous umask."
15791 #: ../fish/guestfish-actions.pod:4954
15796 #: ../fish/guestfish-actions.pod:4956
15801 #: ../fish/guestfish-actions.pod:4958
15804 " umount pathordevice\n"
15809 #: ../fish/guestfish-actions.pod:4960 ../src/guestfs-actions.pod:7637
15811 "This unmounts the given filesystem. The filesystem may be specified either "
15812 "by its mountpoint (path) or the device which contains the filesystem."
15816 #: ../fish/guestfish-actions.pod:4964
15821 #: ../fish/guestfish-actions.pod:4966
15822 msgid "unmount-all"
15826 #: ../fish/guestfish-actions.pod:4968
15834 #: ../fish/guestfish-actions.pod:4970 ../src/guestfs-actions.pod:7650
15835 msgid "This unmounts all mounted filesystems."
15839 #: ../fish/guestfish-actions.pod:4972 ../src/guestfs-actions.pod:7652
15840 msgid "Some internal mounts are not unmounted by this call."
15844 #: ../fish/guestfish-actions.pod:4974
15849 #: ../fish/guestfish-actions.pod:4976
15852 " upload (filename|-) remotefilename\n"
15857 #: ../fish/guestfish-actions.pod:4978 ../fish/guestfish-actions.pod:4991 ../src/guestfs-actions.pod:7665 ../src/guestfs-actions.pod:7689
15858 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15862 #: ../fish/guestfish-actions.pod:4983
15863 msgid "See also L</download>."
15867 #: ../fish/guestfish-actions.pod:4987
15868 msgid "upload-offset"
15872 #: ../fish/guestfish-actions.pod:4989
15875 " upload-offset (filename|-) remotefilename offset\n"
15880 #: ../fish/guestfish-actions.pod:4994 ../src/guestfs-actions.pod:7692
15882 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15883 "The intention is to overwrite parts of existing files or devices, although "
15884 "if a non-existant file is specified then it is created with a \"hole\" "
15885 "before C<offset>. The size of the data written is implicit in the size of "
15886 "the source C<filename>."
15890 #: ../fish/guestfish-actions.pod:5001
15892 "Note that there is no limit on the amount of data that can be uploaded with "
15893 "this call, unlike with L</pwrite>, and this call always writes the full "
15894 "amount unless an error occurs."
15898 #: ../fish/guestfish-actions.pod:5006
15899 msgid "See also L</upload>, L</pwrite>."
15903 #: ../fish/guestfish-actions.pod:5010
15908 #: ../fish/guestfish-actions.pod:5012
15911 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
15916 #: ../fish/guestfish-actions.pod:5014 ../src/guestfs-actions.pod:7725
15917 msgid "This command sets the timestamps of a file with nanosecond precision."
15921 #: ../fish/guestfish-actions.pod:5017 ../src/guestfs-actions.pod:7728
15923 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15928 #: ../fish/guestfish-actions.pod:5020 ../src/guestfs-actions.pod:7731
15930 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15931 "nanoseconds from the epoch."
15935 #: ../fish/guestfish-actions.pod:5023 ../src/guestfs-actions.pod:7734
15937 "If the C<*nsecs> field contains the special value C<-1> then the "
15938 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15939 "ignored in this case)."
15943 #: ../fish/guestfish-actions.pod:5027 ../src/guestfs-actions.pod:7738
15945 "If the C<*nsecs> field contains the special value C<-2> then the "
15946 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15951 #: ../fish/guestfish-actions.pod:5031
15956 #: ../fish/guestfish-actions.pod:5033
15964 #: ../fish/guestfish-actions.pod:5035 ../src/guestfs-actions.pod:7751
15965 msgid "Return the libguestfs version number that the program is linked against."
15969 #: ../fish/guestfish-actions.pod:5038 ../src/guestfs-actions.pod:7754
15971 "Note that because of dynamic linking this is not necessarily the version of "
15972 "libguestfs that you compiled against. You can compile the program, and then "
15973 "at runtime dynamically link against a completely different C<libguestfs.so> "
15978 #: ../fish/guestfish-actions.pod:5043 ../src/guestfs-actions.pod:7759
15980 "This call was added in version C<1.0.58>. In previous versions of "
15981 "libguestfs there was no way to get the version number. From C code you can "
15982 "use dynamic linker functions to find out if this symbol exists (if it "
15983 "doesn't, then it's an earlier version)."
15987 #: ../fish/guestfish-actions.pod:5049 ../src/guestfs-actions.pod:7765
15989 "The call returns a structure with four elements. The first three (C<major>, "
15990 "C<minor> and C<release>) are numbers and correspond to the usual version "
15991 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15992 "but may be used for distro-specific information."
15996 #: ../fish/guestfish-actions.pod:5055 ../src/guestfs-actions.pod:7771
15997 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
16001 #: ../fish/guestfish-actions.pod:5058 ../src/guestfs-actions.pod:7774
16002 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
16006 #: ../fish/guestfish-actions.pod:5060
16008 "I<Note:> Don't use this call to test for availability of features. In "
16009 "enterprise distributions we backport features from later versions into "
16010 "earlier versions, making this an unreliable way to test for features. Use "
16011 "L</available> instead."
16015 #: ../fish/guestfish-actions.pod:5066
16020 #: ../fish/guestfish-actions.pod:5068
16023 " vfs-label device\n"
16028 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7794
16029 msgid "This returns the filesystem label of the filesystem on C<device>."
16033 #: ../fish/guestfish-actions.pod:5073 ../src/guestfs-actions.pod:7797
16034 msgid "If the filesystem is unlabeled, this returns the empty string."
16038 #: ../fish/guestfish-actions.pod:5075
16039 msgid "To find a filesystem from the label, use L</findfs-label>."
16043 #: ../fish/guestfish-actions.pod:5077
16048 #: ../fish/guestfish-actions.pod:5079
16051 " vfs-type device\n"
16056 #: ../fish/guestfish-actions.pod:5081 ../src/guestfs-actions.pod:7812
16058 "This command gets the filesystem type corresponding to the filesystem on "
16063 #: ../fish/guestfish-actions.pod:5084 ../src/guestfs-actions.pod:7815
16065 "For most filesystems, the result is the name of the Linux VFS module which "
16066 "would be used to mount this filesystem if you mounted it without specifying "
16067 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
16071 #: ../fish/guestfish-actions.pod:5089
16076 #: ../fish/guestfish-actions.pod:5091
16079 " vfs-uuid device\n"
16084 #: ../fish/guestfish-actions.pod:5093 ../src/guestfs-actions.pod:7831
16085 msgid "This returns the filesystem UUID of the filesystem on C<device>."
16089 #: ../fish/guestfish-actions.pod:5096 ../src/guestfs-actions.pod:7834
16090 msgid "If the filesystem does not have a UUID, this returns the empty string."
16094 #: ../fish/guestfish-actions.pod:5098
16095 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
16099 #: ../fish/guestfish-actions.pod:5100
16100 msgid "vg-activate"
16104 #: ../fish/guestfish-actions.pod:5102
16107 " vg-activate true|false 'volgroups ...'\n"
16112 #: ../fish/guestfish-actions.pod:5104 ../src/guestfs-actions.pod:7850
16114 "This command activates or (if C<activate> is false) deactivates all logical "
16115 "volumes in the listed volume groups C<volgroups>."
16119 #: ../fish/guestfish-actions.pod:5107 ../src/guestfs-actions.pod:7853
16120 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
16124 #: ../fish/guestfish-actions.pod:5109 ../src/guestfs-actions.pod:7855
16126 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
16127 "activated or deactivated."
16131 #: ../fish/guestfish-actions.pod:5112
16132 msgid "vg-activate-all"
16136 #: ../fish/guestfish-actions.pod:5114
16139 " vg-activate-all true|false\n"
16144 #: ../fish/guestfish-actions.pod:5116 ../src/guestfs-actions.pod:7868
16146 "This command activates or (if C<activate> is false) deactivates all logical "
16147 "volumes in all volume groups."
16151 #: ../fish/guestfish-actions.pod:5119 ../src/guestfs-actions.pod:7871
16152 msgid "This command is the same as running C<vgchange -a y|n>"
16156 #: ../fish/guestfish-actions.pod:5121
16161 #: ../fish/guestfish-actions.pod:5123
16164 " vgcreate volgroup 'physvols ...'\n"
16169 #: ../fish/guestfish-actions.pod:5125 ../src/guestfs-actions.pod:7884
16171 "This creates an LVM volume group called C<volgroup> from the non-empty list "
16172 "of physical volumes C<physvols>."
16176 #: ../fish/guestfish-actions.pod:5128
16181 #: ../fish/guestfish-actions.pod:5130
16184 " vglvuuids vgname\n"
16189 #: ../fish/guestfish-actions.pod:5132 ../src/guestfs-actions.pod:7897
16191 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
16192 "volumes created in this volume group."
16196 #: ../fish/guestfish-actions.pod:5135
16198 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
16199 "logical volumes and volume groups."
16203 #: ../fish/guestfish-actions.pod:5138
16204 msgid "See also L</vgpvuuids>."
16208 #: ../fish/guestfish-actions.pod:5140
16213 #: ../fish/guestfish-actions.pod:5142
16216 " vgpvuuids vgname\n"
16221 #: ../fish/guestfish-actions.pod:5144 ../src/guestfs-actions.pod:7917
16223 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
16224 "volumes that this volume group resides on."
16228 #: ../fish/guestfish-actions.pod:5147
16230 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
16231 "physical volumes and volume groups."
16235 #: ../fish/guestfish-actions.pod:5150
16236 msgid "See also L</vglvuuids>."
16240 #: ../fish/guestfish-actions.pod:5152
16245 #: ../fish/guestfish-actions.pod:5154
16248 " vgremove vgname\n"
16253 #: ../fish/guestfish-actions.pod:5156 ../src/guestfs-actions.pod:7937
16254 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
16258 #: ../fish/guestfish-actions.pod:5158 ../src/guestfs-actions.pod:7939
16259 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
16263 #: ../fish/guestfish-actions.pod:5161
16268 #: ../fish/guestfish-actions.pod:5163
16271 " vgrename volgroup newvolgroup\n"
16276 #: ../fish/guestfish-actions.pod:5165 ../src/guestfs-actions.pod:7953
16277 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
16281 #: ../fish/guestfish-actions.pod:5167
16286 #: ../fish/guestfish-actions.pod:5169
16294 #: ../fish/guestfish-actions.pod:5171 ../src/guestfs-actions.pod:7964
16296 "List all the volumes groups detected. This is the equivalent of the "
16297 "L<vgs(8)> command."
16301 #: ../fish/guestfish-actions.pod:5174 ../src/guestfs-actions.pod:7967
16303 "This returns a list of just the volume group names that were detected "
16304 "(eg. C<VolGroup00>)."
16308 #: ../fish/guestfish-actions.pod:5177
16309 msgid "See also L</vgs-full>."
16313 #: ../fish/guestfish-actions.pod:5179
16318 #: ../fish/guestfish-actions.pod:5181
16326 #: ../fish/guestfish-actions.pod:5183 ../src/guestfs-actions.pod:7983
16328 "List all the volumes groups detected. This is the equivalent of the "
16329 "L<vgs(8)> command. The \"full\" version includes all fields."
16333 #: ../fish/guestfish-actions.pod:5186
16338 #: ../fish/guestfish-actions.pod:5188
16346 #: ../fish/guestfish-actions.pod:5190 ../src/guestfs-actions.pod:7997
16348 "This rescans all block devices and rebuilds the list of LVM physical "
16349 "volumes, volume groups and logical volumes."
16353 #: ../fish/guestfish-actions.pod:5193
16358 #: ../fish/guestfish-actions.pod:5195
16366 #: ../fish/guestfish-actions.pod:5197 ../src/guestfs-actions.pod:8010
16367 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16371 #: ../fish/guestfish-actions.pod:5199
16376 #: ../fish/guestfish-actions.pod:5201
16384 #: ../fish/guestfish-actions.pod:5203 ../src/guestfs-actions.pod:8050
16386 "This command counts the characters in a file, using the C<wc -c> external "
16391 #: ../fish/guestfish-actions.pod:5206
16396 #: ../fish/guestfish-actions.pod:5208
16404 #: ../fish/guestfish-actions.pod:5210 ../src/guestfs-actions.pod:8063
16406 "This command counts the lines in a file, using the C<wc -l> external "
16411 #: ../fish/guestfish-actions.pod:5213
16416 #: ../fish/guestfish-actions.pod:5215
16424 #: ../fish/guestfish-actions.pod:5217 ../src/guestfs-actions.pod:8076
16426 "This command counts the words in a file, using the C<wc -w> external "
16431 #: ../fish/guestfish-actions.pod:5220
16436 #: ../fish/guestfish-actions.pod:5222
16439 " write path content\n"
16444 #: ../fish/guestfish-actions.pod:5224 ../src/guestfs-actions.pod:8091
16446 "This call creates a file called C<path>. The content of the file is the "
16447 "string C<content> (which can contain any 8 bit data)."
16451 #: ../fish/guestfish-actions.pod:5227
16452 msgid "See also L</write-append>."
16456 #: ../fish/guestfish-actions.pod:5232
16457 msgid "write-append"
16461 #: ../fish/guestfish-actions.pod:5234
16464 " write-append path content\n"
16469 #: ../fish/guestfish-actions.pod:5236 ../src/guestfs-actions.pod:8111
16471 "This call appends C<content> to the end of file C<path>. If C<path> does "
16472 "not exist, then a new file is created."
16476 #: ../fish/guestfish-actions.pod:5239
16477 msgid "See also L</write>."
16481 #: ../fish/guestfish-actions.pod:5244
16486 #: ../fish/guestfish-actions.pod:5246
16489 " write-file path content size\n"
16494 #: ../fish/guestfish-actions.pod:5248 ../src/guestfs-actions.pod:8138
16496 "This call creates a file called C<path>. The contents of the file is the "
16497 "string C<content> (which can contain any 8 bit data), with length C<size>."
16501 #: ../fish/guestfish-actions.pod:5252 ../src/guestfs-actions.pod:8142
16503 "As a special case, if C<size> is C<0> then the length is calculated using "
16504 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16508 #: ../fish/guestfish-actions.pod:5256 ../src/guestfs-actions.pod:8146
16510 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16511 "I<not> work, even if the length is specified."
16515 #: ../fish/guestfish-actions.pod:5262
16516 msgid "I<This function is deprecated.> In new code, use the L</write> call instead."
16520 #: ../fish/guestfish-actions.pod:5269
16525 #: ../fish/guestfish-actions.pod:5271
16528 " zegrep regex path\n"
16533 #: ../fish/guestfish-actions.pod:5273 ../src/guestfs-actions.pod:8163
16534 msgid "This calls the external C<zegrep> program and returns the matching lines."
16538 #: ../fish/guestfish-actions.pod:5279
16543 #: ../fish/guestfish-actions.pod:5281
16546 " zegrepi regex path\n"
16551 #: ../fish/guestfish-actions.pod:5283 ../src/guestfs-actions.pod:8182
16552 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
16556 #: ../fish/guestfish-actions.pod:5289
16561 #: ../fish/guestfish-actions.pod:5291
16569 #: ../fish/guestfish-actions.pod:5293 ../src/guestfs-actions.pod:8200
16570 msgid "This command writes zeroes over the first few blocks of C<device>."
16574 #: ../fish/guestfish-actions.pod:5295 ../src/guestfs-actions.pod:8202
16576 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16577 "securely wipe the device). It should be sufficient to remove any partition "
16578 "tables, filesystem superblocks and so on."
16582 #: ../fish/guestfish-actions.pod:5299 ../fish/guestfish-actions.pod:5314 ../src/guestfs-actions.pod:8206 ../src/guestfs-actions.pod:8232
16584 "If blocks are already zero, then this command avoids writing zeroes. This "
16585 "prevents the underlying device from becoming non-sparse or growing "
16590 #: ../fish/guestfish-actions.pod:5303
16591 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
16595 #: ../fish/guestfish-actions.pod:5306
16596 msgid "zero-device"
16600 #: ../fish/guestfish-actions.pod:5308
16603 " zero-device device\n"
16608 #: ../fish/guestfish-actions.pod:5310
16610 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
16611 "which just zeroes the first few blocks of a device."
16615 #: ../fish/guestfish-actions.pod:5321
16620 #: ../fish/guestfish-actions.pod:5323
16623 " zerofree device\n"
16628 #: ../fish/guestfish-actions.pod:5325 ../src/guestfs-actions.pod:8254
16630 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16631 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16632 "possible to compress the filesystem more effectively."
16636 #: ../fish/guestfish-actions.pod:5330 ../src/guestfs-actions.pod:8259
16637 msgid "You should B<not> run this program if the filesystem is mounted."
16641 #: ../fish/guestfish-actions.pod:5333 ../src/guestfs-actions.pod:8262
16643 "It is possible that using this program can damage the filesystem or data on "
16648 #: ../fish/guestfish-actions.pod:5336
16653 #: ../fish/guestfish-actions.pod:5338
16656 " zfgrep pattern path\n"
16661 #: ../fish/guestfish-actions.pod:5340 ../src/guestfs-actions.pod:8276
16662 msgid "This calls the external C<zfgrep> program and returns the matching lines."
16666 #: ../fish/guestfish-actions.pod:5346
16671 #: ../fish/guestfish-actions.pod:5348
16674 " zfgrepi pattern path\n"
16679 #: ../fish/guestfish-actions.pod:5350 ../src/guestfs-actions.pod:8295
16680 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
16684 #: ../fish/guestfish-actions.pod:5356
16689 #: ../fish/guestfish-actions.pod:5358
16692 " zfile meth path\n"
16697 #: ../fish/guestfish-actions.pod:5360 ../src/guestfs-actions.pod:8321
16698 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
16702 #: ../fish/guestfish-actions.pod:5363 ../src/guestfs-actions.pod:8324
16703 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16707 #: ../fish/guestfish-actions.pod:5365
16708 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
16712 #: ../fish/guestfish-actions.pod:5368
16713 msgid "I<This function is deprecated.> In new code, use the L</file> call instead."
16717 #: ../fish/guestfish-actions.pod:5375
16722 #: ../fish/guestfish-actions.pod:5377
16725 " zgrep regex path\n"
16730 #: ../fish/guestfish-actions.pod:5379 ../src/guestfs-actions.pod:8341
16731 msgid "This calls the external C<zgrep> program and returns the matching lines."
16735 #: ../fish/guestfish-actions.pod:5385
16740 #: ../fish/guestfish-actions.pod:5387
16743 " zgrepi regex path\n"
16748 #: ../fish/guestfish-actions.pod:5389 ../src/guestfs-actions.pod:8360
16749 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
16753 #: ../fish/guestfish-commands.pod:1
16758 #: ../fish/guestfish-commands.pod:3
16763 #: ../fish/guestfish-commands.pod:5
16766 " alloc filename size\n"
16771 #: ../fish/guestfish-commands.pod:7
16773 "This creates an empty (zeroed) file of the given size, and then adds so it "
16774 "can be further examined."
16778 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
16779 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
16783 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
16784 msgid "Size can be specified using standard suffixes, eg. C<1M>."
16788 #: ../fish/guestfish-commands.pod:14
16790 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
16791 "image, see L</PREPARED DISK IMAGES>."
16795 #: ../fish/guestfish-commands.pod:17
16800 #: ../fish/guestfish-commands.pod:19
16803 " copy-in local [local ...] /remotedir\n"
16808 #: ../fish/guestfish-commands.pod:21
16810 "C<copy-in> copies local files or directories recursively into the disk "
16811 "image, placing them in the directory called C</remotedir> (which must "
16812 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
16813 "other commands as necessary."
16817 #: ../fish/guestfish-commands.pod:26
16819 "Multiple local files and directories can be specified, but the last "
16820 "parameter must always be a remote directory. Wildcards cannot be used."
16824 #: ../fish/guestfish-commands.pod:30
16829 #: ../fish/guestfish-commands.pod:32
16832 " copy-out remote [remote ...] localdir\n"
16837 #: ../fish/guestfish-commands.pod:34
16839 "C<copy-out> copies remote files or directories recursively out of the disk "
16840 "image, placing them on the host disk in a local directory called C<localdir> "
16841 "(which must exist). This guestfish meta-command turns into a sequence of "
16842 "L</download>, L</tar-out> and other commands as necessary."
16846 #: ../fish/guestfish-commands.pod:40
16848 "Multiple remote files and directories can be specified, but the last "
16849 "parameter must always be a local directory. To download to the current "
16850 "directory, use C<.> as in:"
16854 #: ../fish/guestfish-commands.pod:44
16857 " copy-out /home .\n"
16862 #: ../fish/guestfish-commands.pod:46
16864 "Wildcards cannot be used in the ordinary command, but you can use them with "
16865 "the help of L</glob> like this:"
16869 #: ../fish/guestfish-commands.pod:49
16872 " glob copy-out /home/* .\n"
16877 #: ../fish/guestfish-commands.pod:51
16882 #: ../fish/guestfish-commands.pod:53
16885 " display filename\n"
16890 #: ../fish/guestfish-commands.pod:55
16892 "Use C<display> (a graphical display program) to display an image file. It "
16893 "downloads the file, and runs C<display> on it."
16897 #: ../fish/guestfish-commands.pod:58
16899 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
16900 "environment variable. For example to use the GNOME display program:"
16904 #: ../fish/guestfish-commands.pod:61
16907 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
16912 #: ../fish/guestfish-commands.pod:63
16913 msgid "See also L<display(1)>."
16917 #: ../fish/guestfish-commands.pod:65
16922 #: ../fish/guestfish-commands.pod:67
16925 " echo [params ...]\n"
16930 #: ../fish/guestfish-commands.pod:69
16931 msgid "This echos the parameters to the terminal."
16935 #: ../fish/guestfish-commands.pod:71
16940 #: ../fish/guestfish-commands.pod:73
16945 #: ../fish/guestfish-commands.pod:75
16950 #: ../fish/guestfish-commands.pod:77
16958 #: ../fish/guestfish-commands.pod:79
16960 "This is used to edit a file. It downloads the file, edits it locally using "
16961 "your editor, then uploads the result."
16965 #: ../fish/guestfish-commands.pod:82
16967 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
16968 "or C<emacs> you will get those corresponding editors."
16972 #: ../fish/guestfish-commands.pod:86
16977 #: ../fish/guestfish-commands.pod:88
16980 " glob command args...\n"
16985 #: ../fish/guestfish-commands.pod:90
16987 "Expand wildcards in any paths in the args list, and run C<command> "
16988 "repeatedly on each matching path."
16992 #: ../fish/guestfish-commands.pod:93
16993 msgid "See L</WILDCARDS AND GLOBBING>."
16997 #: ../fish/guestfish-commands.pod:95
17002 #: ../fish/guestfish-commands.pod:97
17005 " hexedit <filename|device>\n"
17006 " hexedit <filename|device> <max>\n"
17007 " hexedit <filename|device> <start> <max>\n"
17012 #: ../fish/guestfish-commands.pod:101
17014 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
17019 #: ../fish/guestfish-commands.pod:104
17021 "This command works by downloading potentially the whole file or device, "
17022 "editing it locally, then uploading it. If the file or device is large, you "
17023 "have to specify which part you wish to edit by using C<max> and/or C<start> "
17024 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
17025 "usual modifiers allowed such as C<1M> (1 megabyte)."
17029 #: ../fish/guestfish-commands.pod:111
17030 msgid "For example to edit the first few sectors of a disk you might do:"
17034 #: ../fish/guestfish-commands.pod:114
17037 " hexedit /dev/sda 1M\n"
17042 #: ../fish/guestfish-commands.pod:116
17044 "which would allow you to edit anywhere within the first megabyte of the "
17049 #: ../fish/guestfish-commands.pod:119
17050 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
17054 #: ../fish/guestfish-commands.pod:121
17057 " hexedit /dev/sda1 0x400 0x400\n"
17062 #: ../fish/guestfish-commands.pod:123
17063 msgid "(assuming the superblock is in the standard location)."
17067 #: ../fish/guestfish-commands.pod:125
17069 "This command requires the external L<hexedit(1)> program. You can specify "
17070 "another program to use by setting the C<HEXEDITOR> environment variable."
17074 #: ../fish/guestfish-commands.pod:129
17075 msgid "See also L</hexdump>."
17079 #: ../fish/guestfish-commands.pod:131
17084 #: ../fish/guestfish-commands.pod:133
17092 #: ../fish/guestfish-commands.pod:135
17093 msgid "Change the local directory, ie. the current directory of guestfish itself."
17097 #: ../fish/guestfish-commands.pod:138
17098 msgid "Note that C<!cd> won't do what you might expect."
17102 #: ../fish/guestfish-commands.pod:140
17107 #: ../fish/guestfish-commands.pod:142
17112 #: ../fish/guestfish-commands.pod:144
17120 #: ../fish/guestfish-commands.pod:146
17121 msgid "Opens the manual page for guestfish."
17125 #: ../fish/guestfish-commands.pod:148
17130 #: ../fish/guestfish-commands.pod:150
17135 #: ../fish/guestfish-commands.pod:152
17143 #: ../fish/guestfish-commands.pod:154
17151 #: ../fish/guestfish-commands.pod:156
17152 msgid "This is used to view a file."
17156 #: ../fish/guestfish-commands.pod:158
17158 "The default viewer is C<$PAGER>. However if you use the alternate command "
17159 "C<less> you will get the C<less> command specifically."
17163 #: ../fish/guestfish-commands.pod:161
17168 #: ../fish/guestfish-commands.pod:163
17176 #: ../fish/guestfish-commands.pod:165
17178 "Close and reopen the libguestfs handle. It is not necessary to use this "
17179 "normally, because the handle is closed properly when guestfish exits. "
17180 "However this is occasionally useful for testing."
17184 #: ../fish/guestfish-commands.pod:169
17189 #: ../fish/guestfish-commands.pod:171
17192 " setenv VAR value\n"
17197 #: ../fish/guestfish-commands.pod:173
17198 msgid "Set the environment variable C<VAR> to the string C<value>."
17202 #: ../fish/guestfish-commands.pod:175
17203 msgid "To print the value of an environment variable use a shell command such as:"
17207 #: ../fish/guestfish-commands.pod:178
17215 #: ../fish/guestfish-commands.pod:180
17220 #: ../fish/guestfish-commands.pod:182
17223 " sparse filename size\n"
17228 #: ../fish/guestfish-commands.pod:184
17230 "This creates an empty sparse file of the given size, and then adds so it can "
17231 "be further examined."
17235 #: ../fish/guestfish-commands.pod:187
17237 "In all respects it works the same as the L</alloc> command, except that the "
17238 "image file is allocated sparsely, which means that disk blocks are not "
17239 "assigned to the file until they are needed. Sparse disk files only use "
17240 "space when written to, but they are slower and there is a danger you could "
17241 "run out of real disk space during a write operation."
17245 #: ../fish/guestfish-commands.pod:197
17250 #: ../fish/guestfish-commands.pod:199
17258 #: ../fish/guestfish-commands.pod:201
17260 "This command returns a list of the optional groups known to the daemon, and "
17261 "indicates which ones are supported by this build of the libguestfs "
17266 #: ../fish/guestfish-commands.pod:205
17267 msgid "See also L<guestfs(3)/AVAILABILITY>."
17271 #: ../fish/guestfish-commands.pod:207
17276 #: ../fish/guestfish-commands.pod:209
17279 " time command args...\n"
17284 #: ../fish/guestfish-commands.pod:211
17286 "Run the command as usual, but print the elapsed time afterwards. This can "
17287 "be useful for benchmarking operations."
17291 #: ../fish/guestfish-commands.pod:214
17296 #: ../fish/guestfish-commands.pod:216
17304 #: ../fish/guestfish-commands.pod:218
17305 msgid "Remove C<VAR> from the environment."
17309 #: ../fish/guestfish.pod:5
17310 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17314 #: ../fish/guestfish.pod:9
17317 " guestfish [--options] [commands]\n"
17322 #: ../fish/guestfish.pod:11
17330 #: ../fish/guestfish.pod:13
17333 " guestfish [--ro|--rw] -a disk.img\n"
17338 #: ../fish/guestfish.pod:15
17341 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17346 #: ../fish/guestfish.pod:17
17349 " guestfish -d libvirt-domain\n"
17354 #: ../fish/guestfish.pod:19
17357 " guestfish [--ro|--rw] -a disk.img -i\n"
17362 #: ../fish/guestfish.pod:21
17365 " guestfish -d libvirt-domain -i\n"
17370 #: ../fish/guestfish.pod:25
17372 "Using guestfish in read/write mode on live virtual machines can be "
17373 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17374 "option to use guestfish safely if the disk image or virtual machine might be "
17379 #: ../fish/guestfish.pod:32
17381 "Guestfish is a shell and command-line tool for examining and modifying "
17382 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17383 "functionality of the guestfs API, see L<guestfs(3)>."
17387 #: ../fish/guestfish.pod:36
17389 "Guestfish gives you structured access to the libguestfs API, from shell "
17390 "scripts or the command line or interactively. If you want to rescue a "
17391 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17396 #: ../fish/guestfish.pod:43
17397 msgid "As an interactive shell"
17401 #: ../fish/guestfish.pod:45
17409 #: ../fish/guestfish.pod:47
17412 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17413 " editing virtual machine filesystems.\n"
17418 #: ../fish/guestfish.pod:50
17421 " Type: 'help' for a list of commands\n"
17422 " 'man' to read the manual\n"
17423 " 'quit' to quit the shell\n"
17428 #: ../fish/guestfish.pod:54
17431 " ><fs> add-ro disk.img\n"
17433 " ><fs> list-filesystems\n"
17434 " /dev/sda1: ext4\n"
17435 " /dev/vg_guest/lv_root: ext4\n"
17436 " /dev/vg_guest/lv_swap: swap\n"
17437 " ><fs> mount /dev/vg_guest/lv_root /\n"
17438 " ><fs> cat /etc/fstab\n"
17440 " # Created by anaconda\n"
17447 #: ../fish/guestfish.pod:67
17448 msgid "From shell scripts"
17452 #: ../fish/guestfish.pod:69
17453 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17457 #: ../fish/guestfish.pod:71
17460 " guestfish <<_EOF_\n"
17463 " mount /dev/vg_guest/lv_root /\n"
17464 " write /etc/motd \"Welcome, new users\"\n"
17470 #: ../fish/guestfish.pod:78
17471 msgid "List the LVM logical volumes in a disk image:"
17475 #: ../fish/guestfish.pod:80
17478 " guestfish -a disk.img --ro <<_EOF_\n"
17486 #: ../fish/guestfish.pod:85
17487 msgid "List all the filesystems in a disk image:"
17491 #: ../fish/guestfish.pod:87
17494 " guestfish -a disk.img --ro <<_EOF_\n"
17496 " list-filesystems\n"
17502 #: ../fish/guestfish.pod:92
17503 msgid "On one command line"
17507 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
17508 msgid "Update C</etc/resolv.conf> in a guest:"
17512 #: ../fish/guestfish.pod:96
17516 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17517 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17522 #: ../fish/guestfish.pod:100
17523 msgid "Edit C</boot/grub/grub.conf> interactively:"
17527 #: ../fish/guestfish.pod:102
17530 " guestfish --rw --add disk.img \\\n"
17531 " --mount /dev/vg_guest/lv_root \\\n"
17532 " --mount /dev/sda1:/boot \\\n"
17533 " edit /boot/grub/grub.conf\n"
17538 #: ../fish/guestfish.pod:107
17539 msgid "Mount disks automatically"
17543 #: ../fish/guestfish.pod:109
17545 "Use the I<-i> option to automatically mount the disks from a virtual "
17550 #: ../fish/guestfish.pod:112
17553 " guestfish --ro -a disk.img -i cat /etc/group\n"
17558 #: ../fish/guestfish.pod:114
17561 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17566 #: ../fish/guestfish.pod:116
17567 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17571 #: ../fish/guestfish.pod:118
17574 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17579 #: ../fish/guestfish.pod:120
17580 msgid "As a script interpreter"
17584 #: ../fish/guestfish.pod:122
17585 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17589 #: ../fish/guestfish.pod:124
17592 " #!/usr/bin/guestfish -f\n"
17593 " sparse test1.img 100M\n"
17595 " part-disk /dev/sda mbr\n"
17596 " mkfs ext2 /dev/sda1\n"
17601 #: ../fish/guestfish.pod:130
17602 msgid "Start with a prepared disk"
17606 #: ../fish/guestfish.pod:132
17608 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17609 "single ext2-formatted partition:"
17613 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2243
17616 " guestfish -N fs\n"
17621 #: ../fish/guestfish.pod:137
17622 msgid "To list what is available do:"
17626 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
17629 " guestfish -N help | less\n"
17634 #: ../fish/guestfish.pod:141
17635 msgid "Remote control"
17639 #: ../fish/guestfish.pod:143
17642 " eval \"`guestfish --listen`\"\n"
17643 " guestfish --remote add-ro disk.img\n"
17644 " guestfish --remote run\n"
17645 " guestfish --remote lvs\n"
17650 #: ../fish/guestfish.pod:154
17651 msgid "Displays general help on options."
17655 #: ../fish/guestfish.pod:158
17656 msgid "B<--cmd-help>"
17660 #: ../fish/guestfish.pod:160
17661 msgid "Lists all available guestfish commands."
17665 #: ../fish/guestfish.pod:162
17670 #: ../fish/guestfish.pod:164
17671 msgid "B<--cmd-help cmd>"
17675 #: ../fish/guestfish.pod:166
17676 msgid "Displays detailed help on a single command C<cmd>."
17680 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
17681 msgid "B<-a image>"
17685 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
17686 msgid "B<--add image>"
17690 #: ../fish/guestfish.pod:172
17691 msgid "Add a block device or virtual machine image to the shell."
17695 #: ../fish/guestfish.pod:177
17697 "Using this flag is mostly equivalent to using the C<add> command, with "
17698 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17699 "the I<--format=...> flag was given."
17703 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
17705 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17706 "URI to use. The default is to use the default libvirt connection."
17710 #: ../fish/guestfish.pod:189
17715 #: ../fish/guestfish.pod:191
17717 "If using the I<--listen> option and a csh-like shell, use this option. See "
17718 "section L</REMOTE CONTROL AND CSH> below."
17722 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
17723 msgid "B<-d libvirt-domain>"
17727 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
17728 msgid "B<--domain libvirt-domain>"
17732 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
17734 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17735 "used, then any libvirt domain can be used. However in write mode, only "
17736 "libvirt domains which are shut down can be named here."
17740 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
17741 msgid "Domain UUIDs can be used instead of names."
17745 #: ../fish/guestfish.pod:204
17747 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17748 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17749 "if the I<--format:...> flag was given."
17753 #: ../fish/guestfish.pod:208
17758 #: ../fish/guestfish.pod:210
17759 msgid "B<--no-dest-paths>"
17763 #: ../fish/guestfish.pod:212
17765 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17766 "to hit the tab key to complete paths on the guest filesystem, but this "
17767 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17768 "allow this feature to be disabled."
17772 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
17774 "When prompting for keys and passphrases, guestfish normally turns echoing "
17775 "off so you cannot see what you are typing. If you are not worried about "
17776 "Tempest attacks and there is no one else in the room you can specify this "
17777 "flag to see what you are typing."
17781 #: ../fish/guestfish.pod:224
17786 #: ../fish/guestfish.pod:226
17787 msgid "B<--file file>"
17791 #: ../fish/guestfish.pod:228
17792 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17796 #: ../fish/guestfish.pod:231
17799 " #!/usr/bin/guestfish -f\n"
17804 #: ../fish/guestfish.pod:244
17807 " guestfish --format=raw -a disk.img\n"
17812 #: ../fish/guestfish.pod:248
17815 " guestfish --format=raw -a disk.img --format -a another.img\n"
17820 #: ../fish/guestfish.pod:253
17822 "If you have untrusted raw-format guest disk images, you should use this "
17823 "option to specify the disk format. This avoids a possible security problem "
17824 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17828 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
17829 msgid "B<--inspector>"
17833 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
17835 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17836 "system and mount filesystems as they would be mounted on the real virtual "
17841 #: ../fish/guestfish.pod:266
17842 msgid "Typical usage is either:"
17846 #: ../fish/guestfish.pod:268
17849 " guestfish -d myguest -i\n"
17854 #: ../fish/guestfish.pod:270
17855 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17859 #: ../fish/guestfish.pod:272
17862 " guestfish --ro -d myguest -i\n"
17867 #: ../fish/guestfish.pod:274
17868 msgid "(for active domains, readonly), or specify the block device directly:"
17872 #: ../fish/guestfish.pod:276
17875 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17880 #: ../fish/guestfish.pod:278
17882 "Note that the command line syntax changed slightly over older versions of "
17883 "guestfish. You can still use the old syntax:"
17887 #: ../fish/guestfish.pod:281
17890 " guestfish [--ro] -i disk.img\n"
17895 #: ../fish/guestfish.pod:283
17898 " guestfish [--ro] -i libvirt-domain\n"
17903 #: ../fish/guestfish.pod:285
17905 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
17906 "then using other commands to mount the filesystems that were found."
17910 #: ../fish/guestfish.pod:294
17911 msgid "B<--listen>"
17915 #: ../fish/guestfish.pod:296
17917 "Fork into the background and listen for remote commands. See section "
17918 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17922 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
17927 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
17929 "Connect to a live virtual machine. (Experimental, see "
17930 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
17934 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
17935 msgid "B<-m dev[:mountpoint[:options]]>"
17939 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
17940 msgid "B<--mount dev[:mountpoint[:options]]>"
17944 #: ../fish/guestfish.pod:308
17945 msgid "Mount the named partition or logical volume on the given mountpoint."
17949 #: ../fish/guestfish.pod:310
17950 msgid "If the mountpoint is omitted, it defaults to C</>."
17954 #: ../fish/guestfish.pod:312
17955 msgid "You have to mount something on C</> before most commands will work."
17959 #: ../fish/guestfish.pod:314
17961 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17966 #: ../fish/guestfish.pod:317
17968 "If you don't know what filesystems a disk image contains, you can either run "
17969 "guestfish without this option, then list the partitions, filesystems and LVs "
17970 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17971 "commands), or you can use the L<virt-filesystems(1)> program."
17975 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
17977 "The third (and rarely used) part of the mount parameter is the list of mount "
17978 "options used to mount the underlying filesystem. If this is not given, then "
17979 "the mount options are either the empty string or C<ro> (the latter if the "
17980 "I<--ro> flag is used). By specifying the mount options, you override this "
17981 "default choice. Probably the only time you would use this is to enable ACLs "
17982 "and/or extended attributes if the filesystem can support them:"
17986 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
17989 " -m /dev/sda1:/:acl,user_xattr\n"
17994 #: ../fish/guestfish.pod:333
17995 msgid "Using this flag is equivalent to using the C<mount-options> command."
17999 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202 ../resize/virt-resize.pod:435
18004 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
18005 msgid "B<--no-sync>"
18009 #: ../fish/guestfish.pod:339
18011 "Disable autosync. This is enabled by default. See the discussion of "
18012 "autosync in the L<guestfs(3)> manpage."
18016 #: ../fish/guestfish.pod:342
18021 #: ../fish/guestfish.pod:344
18022 msgid "B<--new type>"
18026 #: ../fish/guestfish.pod:346
18031 #: ../fish/guestfish.pod:348
18033 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
18034 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
18035 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
18040 #: ../fish/guestfish.pod:353
18041 msgid "B<--progress-bars>"
18045 #: ../fish/guestfish.pod:355
18046 msgid "Enable progress bars, even when guestfish is used non-interactively."
18050 #: ../fish/guestfish.pod:357
18052 "Progress bars are enabled by default when guestfish is used as an "
18053 "interactive shell."
18057 #: ../fish/guestfish.pod:360
18058 msgid "B<--no-progress-bars>"
18062 #: ../fish/guestfish.pod:362
18063 msgid "Disable progress bars."
18067 #: ../fish/guestfish.pod:364
18068 msgid "B<--remote[=pid]>"
18072 #: ../fish/guestfish.pod:366
18074 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
18075 "CONTROL GUESTFISH OVER A SOCKET> below."
18079 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248 ../rescue/virt-rescue.pod:161
18084 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250 ../rescue/virt-rescue.pod:163
18089 #: ../fish/guestfish.pod:373
18091 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18092 "mounts are done read-only."
18096 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
18098 "The option must always be used if the disk image or virtual machine might be "
18099 "running, and is generally recommended in cases where you don't need write "
18100 "access to the disk."
18104 #: ../fish/guestfish.pod:380
18106 "Note that prepared disk images created with I<-N> are not affected by this "
18107 "option. Also commands like C<add> are not affected - you have to specify "
18108 "the C<readonly:true> option explicitly if you need it."
18112 #: ../fish/guestfish.pod:384
18113 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
18117 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262 ../rescue/virt-rescue.pod:173
18118 msgid "B<--selinux>"
18122 #: ../fish/guestfish.pod:388
18123 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
18127 #: ../fish/guestfish.pod:394
18129 "Enable very verbose messages. This is particularly useful if you find a "
18134 #: ../fish/guestfish.pod:401
18135 msgid "Display the guestfish / libguestfs version number and exit."
18139 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278 ../rescue/virt-rescue.pod:194
18144 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280 ../rescue/virt-rescue.pod:196
18149 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
18151 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18152 "mounts are done read-write."
18156 #: ../fish/guestfish.pod:410
18157 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
18161 #: ../fish/guestfish.pod:414
18162 msgid "Echo each command before executing it."
18166 #: ../fish/guestfish.pod:418
18167 msgid "COMMANDS ON COMMAND LINE"
18171 #: ../fish/guestfish.pod:420
18172 msgid "Any additional (non-option) arguments are treated as commands to execute."
18176 #: ../fish/guestfish.pod:423
18178 "Commands to execute should be separated by a colon (C<:>), where the colon "
18179 "is a separate parameter. Thus:"
18183 #: ../fish/guestfish.pod:426
18186 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18191 #: ../fish/guestfish.pod:428
18193 "If there are no additional arguments, then we enter a shell, either an "
18194 "interactive shell with a prompt (if the input is a terminal) or a "
18195 "non-interactive shell."
18199 #: ../fish/guestfish.pod:432
18201 "In either command line mode or non-interactive shell, the first command that "
18202 "gives an error causes the whole shell to exit. In interactive mode (with a "
18203 "prompt) if a command fails, you can continue to enter commands."
18207 #: ../fish/guestfish.pod:437
18208 msgid "USING launch (OR run)"
18212 #: ../fish/guestfish.pod:439
18214 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18215 "then launch it, then mount any disks you need, and finally issue "
18216 "actions/commands. So the general order of the day is:"
18220 #: ../fish/guestfish.pod:447
18221 msgid "add or -a/--add"
18225 #: ../fish/guestfish.pod:451
18226 msgid "launch (aka run)"
18230 #: ../fish/guestfish.pod:455
18231 msgid "mount or -m/--mount"
18235 #: ../fish/guestfish.pod:459
18236 msgid "any other commands"
18240 #: ../fish/guestfish.pod:463
18242 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18243 "guest before mounting or performing any other commands."
18247 #: ../fish/guestfish.pod:466
18249 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18250 "I<--new> options were given then C<run> is done automatically, simply "
18251 "because guestfish can't perform the action you asked for without doing this."
18255 #: ../fish/guestfish.pod:471
18256 msgid "OPENING DISKS FOR READ AND WRITE"
18260 #: ../fish/guestfish.pod:473
18262 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
18263 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
18264 "I<-i> and I<-m> open disk images read-only or for writing."
18268 #: ../fish/guestfish.pod:478
18270 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
18271 "opening disk images supplied on the command line for write. To open a disk "
18272 "image read-only you have to do I<-a image --ro>."
18276 #: ../fish/guestfish.pod:482
18278 "This matters: If you accidentally open a live VM disk image writable then "
18279 "you will cause irreversible disk corruption."
18283 #: ../fish/guestfish.pod:485
18285 "In a future libguestfs we intend to change the default the other way. Disk "
18286 "images will be opened read-only. You will have to either specify "
18287 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
18288 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
18289 "access for disk images specified by those other command line options."
18293 #: ../fish/guestfish.pod:492
18295 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
18296 "which does nothing (it is already the default). However it is highly "
18297 "recommended that you use this option to indicate that you need write access, "
18298 "and prepare your scripts for the day when this option will be required for "
18303 #: ../fish/guestfish.pod:498
18305 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18306 "other libguestfs program apart from guestfish and guestmount."
18310 #: ../fish/guestfish.pod:501
18315 #: ../fish/guestfish.pod:503
18317 "You can quote ordinary parameters using either single or double quotes. For "
18322 #: ../fish/guestfish.pod:506
18325 " add \"file with a space.img\"\n"
18330 #: ../fish/guestfish.pod:508
18333 " rm '/file name'\n"
18338 #: ../fish/guestfish.pod:510
18346 #: ../fish/guestfish.pod:512
18348 "A few commands require a list of strings to be passed. For these, use a "
18349 "whitespace-separated list, enclosed in quotes. Strings containing "
18350 "whitespace to be passed through must be enclosed in single quotes. A "
18351 "literal single quote must be escaped with a backslash."
18355 #: ../fish/guestfish.pod:517
18358 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18359 " command \"/bin/echo 'foo bar'\"\n"
18360 " command \"/bin/echo \\'foo\\'\"\n"
18365 #: ../fish/guestfish.pod:521
18366 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
18370 #: ../fish/guestfish.pod:523
18372 "In double-quoted arguments (only) use backslash to insert special "
18377 #: ../fish/guestfish.pod:528
18382 #: ../fish/guestfish.pod:530
18383 msgid "Alert (bell) character."
18387 #: ../fish/guestfish.pod:532
18392 #: ../fish/guestfish.pod:534
18393 msgid "Backspace character."
18397 #: ../fish/guestfish.pod:536
18402 #: ../fish/guestfish.pod:538
18403 msgid "Form feed character."
18407 #: ../fish/guestfish.pod:540
18412 #: ../fish/guestfish.pod:542
18413 msgid "Newline character."
18417 #: ../fish/guestfish.pod:544
18422 #: ../fish/guestfish.pod:546
18423 msgid "Carriage return character."
18427 #: ../fish/guestfish.pod:548
18432 #: ../fish/guestfish.pod:550
18433 msgid "Horizontal tab character."
18437 #: ../fish/guestfish.pod:552
18442 #: ../fish/guestfish.pod:554
18443 msgid "Vertical tab character."
18447 #: ../fish/guestfish.pod:556
18452 #: ../fish/guestfish.pod:558
18453 msgid "A literal double quote character."
18457 #: ../fish/guestfish.pod:560
18462 #: ../fish/guestfish.pod:562
18464 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
18469 #: ../fish/guestfish.pod:565
18474 #: ../fish/guestfish.pod:567
18475 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
18479 #: ../fish/guestfish.pod:570
18481 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
18486 #: ../fish/guestfish.pod:573
18491 #: ../fish/guestfish.pod:575
18492 msgid "A literal backslash character."
18496 #: ../fish/guestfish.pod:579
18497 msgid "OPTIONAL ARGUMENTS"
18501 #: ../fish/guestfish.pod:581
18503 "Some commands take optional arguments. These arguments appear in this "
18504 "documentation as C<[argname:..]>. You can use them as in these examples:"
18508 #: ../fish/guestfish.pod:585
18511 " add-drive-opts filename\n"
18516 #: ../fish/guestfish.pod:587
18519 " add-drive-opts filename readonly:true\n"
18524 #: ../fish/guestfish.pod:589
18527 " add-drive-opts filename format:qcow2 readonly:false\n"
18532 #: ../fish/guestfish.pod:591
18534 "Each optional argument can appear at most once. All optional arguments must "
18535 "appear after the required ones."
18539 #: ../fish/guestfish.pod:594
18544 #: ../fish/guestfish.pod:596
18545 msgid "This section applies to all commands which can take integers as parameters."
18549 #: ../fish/guestfish.pod:599
18550 msgid "SIZE SUFFIX"
18554 #: ../fish/guestfish.pod:601
18556 "When the command takes a parameter measured in bytes, you can use one of the "
18557 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18561 #: ../fish/guestfish.pod:607
18562 msgid "B<k> or B<K> or B<KiB>"
18566 #: ../fish/guestfish.pod:609
18567 msgid "The size in kilobytes (multiplied by 1024)."
18571 #: ../fish/guestfish.pod:611
18576 #: ../fish/guestfish.pod:613
18577 msgid "The size in SI 1000 byte units."
18581 #: ../fish/guestfish.pod:615
18582 msgid "B<M> or B<MiB>"
18586 #: ../fish/guestfish.pod:617
18587 msgid "The size in megabytes (multiplied by 1048576)."
18591 #: ../fish/guestfish.pod:619
18596 #: ../fish/guestfish.pod:621
18597 msgid "The size in SI 1000000 byte units."
18601 #: ../fish/guestfish.pod:623
18602 msgid "B<G> or B<GiB>"
18606 #: ../fish/guestfish.pod:625
18607 msgid "The size in gigabytes (multiplied by 2**30)."
18611 #: ../fish/guestfish.pod:627
18616 #: ../fish/guestfish.pod:629
18617 msgid "The size in SI 10**9 byte units."
18621 #: ../fish/guestfish.pod:631
18622 msgid "B<T> or B<TiB>"
18626 #: ../fish/guestfish.pod:633
18627 msgid "The size in terabytes (multiplied by 2**40)."
18631 #: ../fish/guestfish.pod:635
18636 #: ../fish/guestfish.pod:637
18637 msgid "The size in SI 10**12 byte units."
18641 #: ../fish/guestfish.pod:639
18642 msgid "B<P> or B<PiB>"
18646 #: ../fish/guestfish.pod:641
18647 msgid "The size in petabytes (multiplied by 2**50)."
18651 #: ../fish/guestfish.pod:643
18656 #: ../fish/guestfish.pod:645
18657 msgid "The size in SI 10**15 byte units."
18661 #: ../fish/guestfish.pod:647
18662 msgid "B<E> or B<EiB>"
18666 #: ../fish/guestfish.pod:649
18667 msgid "The size in exabytes (multiplied by 2**60)."
18671 #: ../fish/guestfish.pod:651
18676 #: ../fish/guestfish.pod:653
18677 msgid "The size in SI 10**18 byte units."
18681 #: ../fish/guestfish.pod:655
18682 msgid "B<Z> or B<ZiB>"
18686 #: ../fish/guestfish.pod:657
18687 msgid "The size in zettabytes (multiplied by 2**70)."
18691 #: ../fish/guestfish.pod:659
18696 #: ../fish/guestfish.pod:661
18697 msgid "The size in SI 10**21 byte units."
18701 #: ../fish/guestfish.pod:663
18702 msgid "B<Y> or B<YiB>"
18706 #: ../fish/guestfish.pod:665
18707 msgid "The size in yottabytes (multiplied by 2**80)."
18711 #: ../fish/guestfish.pod:667
18716 #: ../fish/guestfish.pod:669
18717 msgid "The size in SI 10**24 byte units."
18721 #: ../fish/guestfish.pod:675
18724 " truncate-size /file 1G\n"
18729 #: ../fish/guestfish.pod:677
18730 msgid "would truncate the file to 1 gigabyte."
18734 #: ../fish/guestfish.pod:679
18736 "Be careful because a few commands take sizes in kilobytes or megabytes "
18737 "(eg. the parameter to L</memsize> is specified in megabytes already). "
18738 "Adding a suffix will probably not do what you expect."
18742 #: ../fish/guestfish.pod:683
18743 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18747 #: ../fish/guestfish.pod:685
18749 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18750 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18754 #: ../fish/guestfish.pod:688
18757 " 1234 decimal number 1234\n"
18758 " 02322 octal number, equivalent to decimal 1234\n"
18759 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18764 #: ../fish/guestfish.pod:692
18766 "When using the C<chmod> command, you almost always want to specify an octal "
18767 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18768 "L<chmod(1)> program):"
18772 #: ../fish/guestfish.pod:696
18775 " chmod 0777 /public # OK\n"
18776 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18781 #: ../fish/guestfish.pod:699
18783 "Commands that return numbers usually print them in decimal, but some "
18784 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18785 "octal, preceeded by C<0>)."
18789 #: ../fish/guestfish.pod:703
18790 msgid "WILDCARDS AND GLOBBING"
18794 #: ../fish/guestfish.pod:705
18796 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18797 "(globbing) by default. So for example the following will not do what you "
18802 #: ../fish/guestfish.pod:709
18810 #: ../fish/guestfish.pod:711
18812 "Assuming you don't have a directory called literally C</home/*> then the "
18813 "above command will return an error."
18817 #: ../fish/guestfish.pod:714
18818 msgid "To perform wildcard expansion, use the C<glob> command."
18822 #: ../fish/guestfish.pod:716
18825 " glob rm-rf /home/*\n"
18830 #: ../fish/guestfish.pod:718
18832 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18833 "many times), equivalent to:"
18837 #: ../fish/guestfish.pod:721
18840 " rm-rf /home/jim\n"
18841 " rm-rf /home/joe\n"
18842 " rm-rf /home/mary\n"
18847 #: ../fish/guestfish.pod:725
18848 msgid "C<glob> only works on simple guest paths and not on device names."
18852 #: ../fish/guestfish.pod:727
18854 "If you have several parameters, each containing a wildcard, then glob will "
18855 "perform a Cartesian product."
18859 #: ../fish/guestfish.pod:730
18864 #: ../fish/guestfish.pod:732
18866 "Any line which starts with a I<#> character is treated as a comment and "
18867 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18868 "a command. For example:"
18872 #: ../fish/guestfish.pod:736
18875 " # this is a comment\n"
18876 " # this is a comment\n"
18877 " foo # NOT a comment\n"
18882 #: ../fish/guestfish.pod:740
18883 msgid "Blank lines are also ignored."
18887 #: ../fish/guestfish.pod:742
18888 msgid "RUNNING COMMANDS LOCALLY"
18892 #: ../fish/guestfish.pod:744
18894 "Any line which starts with a I<!> character is treated as a command sent to "
18895 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18899 #: ../fish/guestfish.pod:748
18903 " tgz-out /remote local/remote-data.tar.gz\n"
18908 #: ../fish/guestfish.pod:751
18910 "will create a directory C<local> on the host, and then export the contents "
18911 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18912 "(See C<tgz-out>)."
18916 #: ../fish/guestfish.pod:755
18918 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18919 "effect, due to the way that subprocesses work in Unix."
18923 #: ../fish/guestfish.pod:758
18924 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
18928 #: ../fish/guestfish.pod:760
18930 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
18931 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
18932 "and executed as guestfish commands."
18936 #: ../fish/guestfish.pod:764
18938 "Thus you can use shell script to construct arbitrary guestfish commands "
18939 "which are then parsed by guestfish."
18943 #: ../fish/guestfish.pod:767
18945 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
18946 "through C</foo.100>) using guestfish commands alone. However this is simple "
18947 "if we use a shell script to create the guestfish commands for us:"
18951 #: ../fish/guestfish.pod:772
18954 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
18959 #: ../fish/guestfish.pod:774
18960 msgid "or with names like C</foo.001>:"
18964 #: ../fish/guestfish.pod:776
18967 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
18972 #: ../fish/guestfish.pod:778
18974 "When using guestfish interactively it can be helpful to just run the shell "
18975 "script first (ie. remove the initial C<E<lt>> character so it is just an "
18976 "ordinary I<!> local command), see what guestfish commands it would run, and "
18977 "when you are happy with those prepend the C<E<lt>> character to run the "
18978 "guestfish commands for real."
18982 #: ../fish/guestfish.pod:784
18987 #: ../fish/guestfish.pod:786
18989 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18990 "command (a guestfish command) to the second command (any host command). For "
18995 #: ../fish/guestfish.pod:790
18998 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
19003 #: ../fish/guestfish.pod:792
19005 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
19006 "program). The above command would list all accounts in the guest filesystem "
19007 "which have UID 0, ie. root accounts including backdoors. Other examples:"
19011 #: ../fish/guestfish.pod:797
19014 " hexdump /bin/ls | head\n"
19015 " list-devices | tail -1\n"
19016 " tgz-out / - | tar ztf -\n"
19021 #: ../fish/guestfish.pod:801
19023 "The space before the pipe symbol is required, any space after the pipe "
19024 "symbol is optional. Everything after the pipe symbol is just passed "
19025 "straight to the host shell, so it can contain redirections, globs and "
19026 "anything else that makes sense on the host side."
19030 #: ../fish/guestfish.pod:806
19032 "To use a literal argument which begins with a pipe symbol, you have to quote "
19037 #: ../fish/guestfish.pod:809
19045 #: ../fish/guestfish.pod:811
19046 msgid "HOME DIRECTORIES"
19050 #: ../fish/guestfish.pod:813
19052 "If a parameter starts with the character C<~> then the tilde may be expanded "
19053 "as a home directory path (either C<~> for the current user's home directory, "
19054 "or C<~user> for another user)."
19058 #: ../fish/guestfish.pod:817
19060 "Note that home directory expansion happens for users known I<on the host>, "
19061 "not in the guest filesystem."
19065 #: ../fish/guestfish.pod:820
19067 "To use a literal argument which begins with a tilde, you have to quote it, "
19072 #: ../fish/guestfish.pod:823
19080 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:534
19081 msgid "ENCRYPTED DISKS"
19085 #: ../fish/guestfish.pod:827
19087 "Libguestfs has some support for Linux guests encrypted according to the "
19088 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
19089 "disk encryption systems used by modern Linux guests. Currently only "
19090 "LVM-on-LUKS is supported."
19094 #: ../fish/guestfish.pod:832
19095 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
19099 #: ../fish/guestfish.pod:834
19102 " ><fs> vfs-type /dev/sda2\n"
19108 #: ../fish/guestfish.pod:837
19110 "Then open those devices using L</luks-open>. This creates a device-mapper "
19111 "device called C</dev/mapper/luksdev>."
19115 #: ../fish/guestfish.pod:840
19118 " ><fs> luks-open /dev/sda2 luksdev\n"
19119 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
19124 #: ../fish/guestfish.pod:843
19126 "Finally you have to tell LVM to scan for volume groups on the newly created "
19131 #: ../fish/guestfish.pod:846
19135 " vg-activate-all true\n"
19140 #: ../fish/guestfish.pod:849
19141 msgid "The logical volume(s) can now be mounted in the usual way."
19145 #: ../fish/guestfish.pod:851
19147 "Before closing a LUKS device you must unmount any logical volumes on it and "
19148 "deactivate the volume groups by calling C<vg-activate false VG> on each "
19149 "one. Then you can close the mapper device:"
19153 #: ../fish/guestfish.pod:855
19156 " vg-activate false /dev/VG\n"
19157 " luks-close /dev/mapper/luksdev\n"
19162 #: ../fish/guestfish.pod:860
19164 "If a path is prefixed with C<win:> then you can use Windows-style drive "
19165 "letters and paths (with some limitations). The following commands are "
19170 #: ../fish/guestfish.pod:864
19173 " file /WINDOWS/system32/config/system.LOG\n"
19178 #: ../fish/guestfish.pod:866
19181 " file win:\\windows\\system32\\config\\system.log\n"
19186 #: ../fish/guestfish.pod:868
19189 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
19194 #: ../fish/guestfish.pod:870
19196 "The parameter is rewritten \"behind the scenes\" by looking up the position "
19197 "where the drive is mounted, prepending that to the path, changing all "
19198 "backslash characters to forward slash, then resolving the result using "
19199 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
19200 "then the parameter might be rewritten like this:"
19204 #: ../fish/guestfish.pod:876
19207 " win:e:\\foo\\bar => /e/FOO/bar\n"
19212 #: ../fish/guestfish.pod:878
19213 msgid "This only works in argument positions that expect a path."
19217 #: ../fish/guestfish.pod:880
19218 msgid "UPLOADING AND DOWNLOADING FILES"
19222 #: ../fish/guestfish.pod:882
19224 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19225 "others which upload from or download to a local file, you can use the "
19226 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19230 #: ../fish/guestfish.pod:886
19238 #: ../fish/guestfish.pod:888
19239 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
19243 #: ../fish/guestfish.pod:891
19246 " tar-out /etc - | tar tf -\n"
19251 #: ../fish/guestfish.pod:893
19253 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19254 "command (see L</PIPES>)."
19258 #: ../fish/guestfish.pod:896
19260 "When using C<-> to read from stdin, the input is read up to the end of "
19261 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19262 "some arbitrary end marker:"
19266 #: ../fish/guestfish.pod:900
19269 " upload -<<END /foo\n"
19278 #: ../fish/guestfish.pod:906
19280 "Any string of characters can be used instead of C<END>. The end marker must "
19281 "appear on a line of its own, without any preceeding or following characters "
19282 "(not even spaces)."
19286 #: ../fish/guestfish.pod:910
19288 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19289 "upload local files (so-called \"FileIn\" parameters in the generator)."
19293 #: ../fish/guestfish.pod:913
19294 msgid "EXIT ON ERROR BEHAVIOUR"
19298 #: ../fish/guestfish.pod:915
19300 "By default, guestfish will ignore any errors when in interactive mode "
19301 "(ie. taking commands from a human over a tty), and will exit on the first "
19302 "error in non-interactive mode (scripts, commands given on the command line)."
19306 #: ../fish/guestfish.pod:920
19308 "If you prefix a command with a I<-> character, then that command will not "
19309 "cause guestfish to exit, even if that (one) command returns an error."
19313 #: ../fish/guestfish.pod:924
19314 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19318 #: ../fish/guestfish.pod:926
19320 "Guestfish can be remote-controlled over a socket. This is useful "
19321 "particularly in shell scripts where you want to make several different "
19322 "changes to a filesystem, but you don't want the overhead of starting up a "
19323 "guestfish process each time."
19327 #: ../fish/guestfish.pod:931
19328 msgid "Start a guestfish server process using:"
19332 #: ../fish/guestfish.pod:933
19335 " eval \"`guestfish --listen`\"\n"
19340 #: ../fish/guestfish.pod:935
19341 msgid "and then send it commands by doing:"
19345 #: ../fish/guestfish.pod:937
19348 " guestfish --remote cmd [...]\n"
19353 #: ../fish/guestfish.pod:939
19354 msgid "To cause the server to exit, send it the exit command:"
19358 #: ../fish/guestfish.pod:943
19360 "Note that the server will normally exit if there is an error in a command. "
19361 "You can change this in the usual way. See section L</EXIT ON ERROR "
19366 #: ../fish/guestfish.pod:947
19367 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19371 #: ../fish/guestfish.pod:949
19373 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19374 "is how the I<--remote> option knows where to send the commands. You can "
19375 "have several guestfish listener processes running using:"
19379 #: ../fish/guestfish.pod:953
19382 " eval \"`guestfish --listen`\"\n"
19383 " pid1=$GUESTFISH_PID\n"
19384 " eval \"`guestfish --listen`\"\n"
19385 " pid2=$GUESTFISH_PID\n"
19387 " guestfish --remote=$pid1 cmd\n"
19388 " guestfish --remote=$pid2 cmd\n"
19393 #: ../fish/guestfish.pod:961
19394 msgid "REMOTE CONTROL AND CSH"
19398 #: ../fish/guestfish.pod:963
19400 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19405 #: ../fish/guestfish.pod:966
19408 " eval \"`guestfish --listen --csh`\"\n"
19413 #: ../fish/guestfish.pod:968
19414 msgid "REMOTE CONTROL DETAILS"
19418 #: ../fish/guestfish.pod:970
19420 "Remote control happens over a Unix domain socket called "
19421 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
19422 "of the process, and C<$PID> is the process ID of the server."
19426 #: ../fish/guestfish.pod:974
19427 msgid "Guestfish client and server versions must match exactly."
19431 #: ../fish/guestfish.pod:976
19432 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
19436 #: ../fish/guestfish.pod:978
19438 "From Bash, you can use the following code which creates a guestfish "
19439 "instance, correctly quotes the command line, handles failure to start, and "
19440 "cleans up guestfish when the script exits:"
19444 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:980
19452 #: ../fish/guestfish.pod:986
19455 " guestfish[0]=\"guestfish\"\n"
19456 " guestfish[1]=\"--listen\"\n"
19457 " guestfish[2]=\"--ro\"\n"
19458 " guestfish[3]=\"-a\"\n"
19459 " guestfish[4]=\"disk.img\"\n"
19464 #: ../fish/guestfish.pod:992
19467 " GUESTFISH_PID=\n"
19468 " eval $(\"${guestfish[@]}\")\n"
19469 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
19470 " echo \"error: guestfish didn't start up, see error messages above\"\n"
19477 #: ../fish/guestfish.pod:999
19480 " cleanup_guestfish ()\n"
19482 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
19484 " trap cleanup_guestfish EXIT ERR\n"
19489 #: ../fish/guestfish.pod:1005
19492 " guestfish --remote -- run\n"
19497 #: ../fish/guestfish.pod:1007
19505 #: ../fish/guestfish.pod:1009
19506 msgid "REMOTE CONTROL RUN COMMAND HANGING"
19510 #: ../fish/guestfish.pod:1011
19512 "Using the C<run> (or C<launch>) command remotely in a command substitution "
19513 "context hangs, ie. don't do (note the backquotes):"
19517 #: ../fish/guestfish.pod:1014
19520 " a=`guestfish --remote run`\n"
19525 #: ../fish/guestfish.pod:1016
19527 "Since the C<run> command produces no output on stdout, this is not useful "
19528 "anyway. For further information see "
19529 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
19533 #: ../fish/guestfish.pod:1020
19534 msgid "PREPARED DISK IMAGES"
19538 #: ../fish/guestfish.pod:1022
19540 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
19541 "preformatted disk images that guestfish can make for you to save typing. "
19542 "This is particularly useful for testing purposes. This option is used "
19543 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
19544 "can be mixed with I<-a>)."
19548 #: ../fish/guestfish.pod:1028
19550 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
19551 "the second and so on. Existing files in the current directory are "
19556 #: ../fish/guestfish.pod:1032
19558 "The type briefly describes how the disk should be sized, partitioned, how "
19559 "filesystem(s) should be created, and how content should be added. "
19560 "Optionally the type can be followed by extra parameters, separated by C<:> "
19561 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
19562 "sparsely-allocated disk, containing a single partition, with the partition "
19563 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
19564 "on a 1GB disk instead."
19568 #: ../fish/guestfish.pod:1040
19569 msgid "To list the available types and any extra parameters they take, run:"
19573 #: ../fish/guestfish.pod:1044
19575 "Note that the prepared filesystem is not mounted. You would usually have to "
19576 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
19580 #: ../fish/guestfish.pod:1048
19582 "If any I<-N> or I<--new> options are given, the guest is automatically "
19587 #: ../fish/guestfish.pod:1053
19588 msgid "Create a 100MB disk with an ext4-formatted partition:"
19592 #: ../fish/guestfish.pod:1055
19595 " guestfish -N fs:ext4\n"
19600 #: ../fish/guestfish.pod:1057
19601 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
19605 #: ../fish/guestfish.pod:1059
19608 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
19613 #: ../fish/guestfish.pod:1061
19614 msgid "Create a blank 200MB disk:"
19618 #: ../fish/guestfish.pod:1063
19621 " guestfish -N disk:200M\n"
19626 #: ../fish/guestfish.pod:1065
19627 msgid "PROGRESS BARS"
19631 #: ../fish/guestfish.pod:1067
19633 "Some (not all) long-running commands send progress notification messages as "
19634 "they are running. Guestfish turns these messages into progress bars."
19638 #: ../fish/guestfish.pod:1071
19640 "When a command that supports progress bars takes longer than two seconds to "
19641 "run, and if progress bars are enabled, then you will see one appearing below "
19646 #: ../fish/guestfish.pod:1075
19649 " ><fs> copy-size /large-file /another-file 2048M\n"
19650 " / 10% [#####-----------------------------------------] 00:30\n"
19655 #: ../fish/guestfish.pod:1078
19657 "The spinner on the left hand side moves round once for every progress "
19658 "notification received from the backend. This is a (reasonably) golden "
19659 "assurance that the command is \"doing something\" even if the progress bar "
19660 "is not moving, because the command is able to send the progress "
19661 "notifications. When the bar reaches 100% and the command finishes, the "
19662 "spinner disappears."
19666 #: ../fish/guestfish.pod:1085
19668 "Progress bars are enabled by default when guestfish is used interactively. "
19669 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19670 "and you can disable them completely using I<--no-progress-bars>."
19674 #: ../fish/guestfish.pod:1090
19675 msgid "GUESTFISH COMMANDS"
19679 #: ../fish/guestfish.pod:1092
19681 "The commands in this section are guestfish convenience commands, in other "
19682 "words, they are not part of the L<guestfs(3)> API."
19686 #: ../fish/guestfish.pod:1095
19691 #: ../fish/guestfish.pod:1097
19700 #: ../fish/guestfish.pod:1100
19701 msgid "Without any parameter, this provides general help."
19705 #: ../fish/guestfish.pod:1102
19706 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19710 #: ../fish/guestfish.pod:1104
19711 msgid "quit | exit"
19715 #: ../fish/guestfish.pod:1106
19716 msgid "This exits guestfish. You can also use C<^D> key."
19720 #: ../fish/guestfish.pod:1108
19721 msgid "@FISH_COMMANDS@"
19725 #: ../fish/guestfish.pod:1110
19730 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1520
19735 #: ../fish/guestfish.pod:1116
19737 "guestfish returns 0 if the commands completed without error, or 1 if there "
19742 #: ../fish/guestfish.pod:1123
19747 #: ../fish/guestfish.pod:1125
19749 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19754 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3213
19755 msgid "FEBOOTSTRAP_KERNEL"
19759 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3215
19760 msgid "FEBOOTSTRAP_MODULES"
19764 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3217
19766 "These two environment variables allow the kernel that libguestfs uses in the "
19767 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
19768 "most recent host kernel is chosen. For more information about kernel "
19769 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
19770 "available in febootstrap E<ge> 3.8."
19774 #: ../fish/guestfish.pod:1138
19775 msgid "GUESTFISH_DISPLAY_IMAGE"
19779 #: ../fish/guestfish.pod:1140
19781 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
19782 "If not set, it uses L<display(1)>."
19786 #: ../fish/guestfish.pod:1143
19787 msgid "GUESTFISH_PID"
19791 #: ../fish/guestfish.pod:1145
19793 "Used with the I<--remote> option to specify the remote guestfish process to "
19794 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19798 #: ../fish/guestfish.pod:1149
19803 #: ../fish/guestfish.pod:1151
19805 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19806 "not specified, the external L<hexedit(1)> program is used."
19810 #: ../fish/guestfish.pod:1155
19815 #: ../fish/guestfish.pod:1157
19817 "If compiled with GNU readline support, various files in the home directory "
19818 "can be used. See L</FILES>."
19822 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3223
19823 msgid "LIBGUESTFS_APPEND"
19827 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3225
19828 msgid "Pass additional options to the guest kernel."
19832 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3227
19833 msgid "LIBGUESTFS_DEBUG"
19837 #: ../fish/guestfish.pod:1166
19839 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19840 "effect as using the B<-v> option."
19844 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3232
19845 msgid "LIBGUESTFS_MEMSIZE"
19849 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3234
19850 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
19854 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3237
19857 " LIBGUESTFS_MEMSIZE=700\n"
19862 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3239
19863 msgid "LIBGUESTFS_PATH"
19867 #: ../fish/guestfish.pod:1178
19869 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19870 "the discussion of paths in L<guestfs(3)>."
19874 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3244
19875 msgid "LIBGUESTFS_QEMU"
19879 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3246
19881 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
19882 "which was found at compile time by the configure script is used."
19886 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3252
19887 msgid "LIBGUESTFS_TRACE"
19891 #: ../fish/guestfish.pod:1189
19892 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19896 #: ../fish/guestfish.pod:1191
19901 #: ../fish/guestfish.pod:1193
19903 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19908 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:236 ../src/guestfs.pod:3257
19913 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3259
19915 "Location of temporary directory, defaults to C</tmp> except for the cached "
19916 "supermin appliance which defaults to C</var/tmp>."
19920 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3262
19922 "If libguestfs was compiled to use the supermin appliance then the real "
19923 "appliance is cached in this directory, shared between all handles belonging "
19924 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
19925 "use in case C</var/tmp> is not large enough."
19929 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297 ../rescue/virt-rescue.pod:273
19934 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301 ../rescue/virt-rescue.pod:277
19935 msgid "$HOME/.libguestfs-tools.rc"
19939 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303 ../rescue/virt-rescue.pod:279
19940 msgid "/etc/libguestfs-tools.conf"
19944 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305 ../rescue/virt-rescue.pod:281
19946 "This configuration file controls the default read-only or read-write mode "
19947 "(I<--ro> or I<--rw>)."
19951 #: ../fish/guestfish.pod:1220
19952 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
19956 #: ../fish/guestfish.pod:1222
19957 msgid "$HOME/.guestfish"
19961 #: ../fish/guestfish.pod:1224
19963 "If compiled with GNU readline support, then the command history is saved in "
19968 #: ../fish/guestfish.pod:1227
19969 msgid "$HOME/.inputrc"
19973 #: ../fish/guestfish.pod:1229
19974 msgid "/etc/inputrc"
19978 #: ../fish/guestfish.pod:1231
19980 "If compiled with GNU readline support, then these files can be used to "
19981 "configure readline. For further information, please see "
19982 "L<readline(3)/INITIALIZATION FILE>."
19986 #: ../fish/guestfish.pod:1235
19987 msgid "To write rules which only apply to guestfish, use:"
19991 #: ../fish/guestfish.pod:1237
20001 #: ../fish/guestfish.pod:1241
20003 "Variables that you can set in inputrc that change the behaviour of guestfish "
20004 "in useful ways include:"
20008 #: ../fish/guestfish.pod:1246
20009 msgid "completion-ignore-case (default: on)"
20013 #: ../fish/guestfish.pod:1248
20015 "By default, guestfish will ignore case when tab-completing paths on the "
20020 #: ../fish/guestfish.pod:1251
20023 " set completion-ignore-case off\n"
20028 #: ../fish/guestfish.pod:1253
20029 msgid "to make guestfish case sensitive."
20033 #: ../fish/guestfish.pod:1257
20038 #: ../fish/guestfish.pod:1259
20039 msgid "test2.img (etc)"
20043 #: ../fish/guestfish.pod:1261
20045 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
20046 "will be created in the file C<test1.img> in the current directory. The "
20047 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
20048 "the same name will be overwritten."
20052 #: ../fish/guestfish.pod:1270
20054 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, "
20055 "L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, "
20056 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, "
20057 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
20058 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
20059 "L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
20060 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
20061 "L<febootstrap-supermin-helper(8)>."
20065 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3354 ../test-tool/libguestfs-test-tool.pod:112
20066 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
20070 #: ../fish/virt-copy-in.pod:5
20071 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
20075 #: ../fish/virt-copy-in.pod:9
20078 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
20083 #: ../fish/virt-copy-in.pod:11
20086 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
20091 #: ../fish/virt-copy-in.pod:15
20093 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
20094 "causing disk corruption. The virtual machine must be shut down before you "
20095 "use this command."
20099 #: ../fish/virt-copy-in.pod:21
20101 "C<virt-copy-in> copies files and directories from the local disk into a "
20102 "virtual machine disk image or named libvirt domain."
20106 #: ../fish/virt-copy-in.pod:24
20108 "You can give one of more filenames and directories on the command line. "
20109 "Directories are copied in recursively. The final parameter must be the "
20110 "destination directory in the disk image which must be an absolute path "
20111 "starting with a C</> character."
20115 #: ../fish/virt-copy-in.pod:33
20118 " virt-copy-in -d MyGuest resolv.conf /etc\n"
20123 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
20124 msgid "Upload a home directory to a guest:"
20128 #: ../fish/virt-copy-in.pod:37
20131 " virt-copy-in -d MyGuest skel /home\n"
20136 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
20137 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
20141 #: ../fish/virt-copy-in.pod:41
20143 "This command is just a simple shell script wrapper around the "
20144 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
20145 "trivial copy, you are probably better off using guestfish directly."
20149 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
20151 "Since the shell script just passes options straight to guestfish, read "
20152 "L<guestfish(1)> to see the full list of options."
20156 #: ../fish/virt-copy-in.pod:52
20158 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
20159 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20163 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
20164 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20168 #: ../fish/virt-copy-out.pod:5
20170 "virt-copy-out - Copy files and directories out of a virtual machine disk "
20175 #: ../fish/virt-copy-out.pod:9
20178 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
20183 #: ../fish/virt-copy-out.pod:11
20186 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
20191 #: ../fish/virt-copy-out.pod:15
20193 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
20194 "image or named libvirt domain."
20198 #: ../fish/virt-copy-out.pod:18
20200 "You can give one of more filenames and directories on the command line. "
20201 "Directories are copied out recursively."
20205 #: ../fish/virt-copy-out.pod:23
20206 msgid "Download the home directories from a virtual machine:"
20210 #: ../fish/virt-copy-out.pod:25
20214 " virt-copy-out -d MyGuest /home homes\n"
20219 #: ../fish/virt-copy-out.pod:30
20221 "This command is just a simple shell script wrapper around the "
20222 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
20223 "trivial copy, you are probably better off using guestfish directly."
20227 #: ../fish/virt-copy-out.pod:41
20229 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
20230 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20234 #: ../fish/virt-tar-in.pod:5
20235 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
20239 #: ../fish/virt-tar-in.pod:9
20242 " virt-tar-in -a disk.img data.tar /destination\n"
20247 #: ../fish/virt-tar-in.pod:11
20250 " virt-tar-in -d domain data.tar /destination\n"
20255 #: ../fish/virt-tar-in.pod:13
20258 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
20263 #: ../fish/virt-tar-in.pod:17
20265 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
20266 "causing disk corruption. The virtual machine must be shut down before you "
20267 "use this command."
20271 #: ../fish/virt-tar-in.pod:23
20273 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
20274 "image or named libvirt domain."
20278 #: ../fish/virt-tar-in.pod:26
20280 "The first parameter is the tar file. Use C<-> to read the tar file from "
20281 "standard input. The second parameter is the absolute target directory to "
20286 #: ../fish/virt-tar-in.pod:34
20289 " virt-tar-in -d MyGuest homes.tar /home\n"
20294 #: ../fish/virt-tar-in.pod:38
20296 "This command is just a simple shell script wrapper around the "
20297 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
20298 "copy, you are probably better off using guestfish directly."
20302 #: ../fish/virt-tar-in.pod:49
20304 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20305 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
20306 "L<http://libguestfs.org/>."
20310 #: ../fish/virt-tar-out.pod:5
20311 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
20315 #: ../fish/virt-tar-out.pod:9
20318 " virt-tar-out -a disk.img /dir files.tar\n"
20323 #: ../fish/virt-tar-out.pod:11
20326 " virt-tar-out -d domain /dir files.tar\n"
20331 #: ../fish/virt-tar-out.pod:13
20334 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
20339 #: ../fish/virt-tar-out.pod:17
20340 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
20344 #: ../fish/virt-tar-out.pod:20
20346 "The first parameter is the absolute path of the virtual machine directory. "
20347 "The second parameter is the tar file to write. Use C<-> to write to "
20352 #: ../fish/virt-tar-out.pod:26
20353 msgid "Download the home directories from a guest:"
20357 #: ../fish/virt-tar-out.pod:28
20360 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
20365 #: ../fish/virt-tar-out.pod:32
20367 "This command is just a simple shell script wrapper around the "
20368 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
20369 "trivial copy, you are probably better off using guestfish directly."
20373 #: ../fish/virt-tar-out.pod:43
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-tar-in(1)>, L<http://libguestfs.org/>."
20380 #: ../fuse/guestmount.pod:5
20381 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
20385 #: ../fuse/guestmount.pod:9
20388 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
20393 #: ../fuse/guestmount.pod:11
20396 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
20401 #: ../fuse/guestmount.pod:13
20404 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
20409 #: ../fuse/guestmount.pod:17
20411 "You must I<not> use C<guestmount> in read-write mode on live virtual "
20412 "machines. If you do this, you risk disk corruption in the VM."
20416 #: ../fuse/guestmount.pod:22
20418 "The guestmount program can be used to mount virtual machine filesystems and "
20419 "other disk images on the host. It uses libguestfs for access to the guest "
20420 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
20421 "a mountable device."
20425 #: ../fuse/guestmount.pod:27
20427 "Along with other options, you have to give at least one device (I<-a> "
20428 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
20429 "option) or use the I<-i> inspection option. How this works is better "
20430 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
20435 #: ../fuse/guestmount.pod:33
20437 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
20438 "by you, and the filesystem will not be visible to any other users unless you "
20439 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
20440 "the filesystem, use the C<fusermount -u> command."
20444 #: ../fuse/guestmount.pod:41
20446 "For a typical Windows guest which has its main filesystem on the first "
20451 #: ../fuse/guestmount.pod:44
20454 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
20459 #: ../fuse/guestmount.pod:46
20461 "For a typical Linux guest which has a /boot filesystem on the first "
20462 "partition, and the root filesystem on a logical volume:"
20466 #: ../fuse/guestmount.pod:49
20469 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
20474 #: ../fuse/guestmount.pod:51
20475 msgid "To get libguestfs to detect guest mountpoints for you:"
20479 #: ../fuse/guestmount.pod:53
20482 " guestmount -a guest.img -i --ro /mnt\n"
20487 #: ../fuse/guestmount.pod:55
20488 msgid "For a libvirt guest called \"Guest\" you could do:"
20492 #: ../fuse/guestmount.pod:57
20495 " guestmount -d Guest -i --ro /mnt\n"
20500 #: ../fuse/guestmount.pod:59
20502 "If you don't know what filesystems are contained in a guest or disk image, "
20503 "use L<virt-filesystems(1)> first:"
20507 #: ../fuse/guestmount.pod:62
20510 " virt-filesystems MyGuest\n"
20515 #: ../fuse/guestmount.pod:64
20517 "If you want to trace the libguestfs calls but without excessive debugging "
20518 "information, we recommend:"
20522 #: ../fuse/guestmount.pod:67
20525 " guestmount [...] --trace /mnt\n"
20530 #: ../fuse/guestmount.pod:69
20531 msgid "If you want to debug the program, we recommend:"
20535 #: ../fuse/guestmount.pod:71
20538 " guestmount [...] --trace --verbose /mnt\n"
20543 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68 ../resize/virt-resize.pod:621
20548 #: ../fuse/guestmount.pod:75
20549 msgid "Other users cannot see the filesystem by default"
20553 #: ../fuse/guestmount.pod:77
20555 "If you mount a filesystem as one user (eg. root), then other users will not "
20556 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
20557 "option when mounting:"
20561 #: ../fuse/guestmount.pod:81
20564 " sudo guestmount [...] -o allow_other /mnt\n"
20569 #: ../fuse/guestmount.pod:83
20570 msgid "Enabling FUSE"
20574 #: ../fuse/guestmount.pod:85
20576 "On some distros, you may need to add yourself to a special group "
20577 "(eg. C<fuse>) before you can use any FUSE filesystem. This is necessary on "
20578 "Debian and derivatives."
20582 #: ../fuse/guestmount.pod:89
20584 "On other distros, no special group is required. It is not necessary on "
20585 "Fedora or Red Hat Enterprise Linux."
20589 #: ../fuse/guestmount.pod:100
20590 msgid "Add a block device or virtual machine image."
20594 #: ../fuse/guestmount.pod:123
20595 msgid "B<--dir-cache-timeout N>"
20599 #: ../fuse/guestmount.pod:125
20601 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
20602 "seconds. The readdir cache [actually, there are several semi-independent "
20603 "caches] is populated after a readdir(2) call with the stat and extended "
20604 "attributes of the files in the directory, in anticipation that they will be "
20605 "requested soon after."
20609 #: ../fuse/guestmount.pod:131
20611 "There is also a different attribute cache implemented by FUSE (see the FUSE "
20612 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
20613 "requests, only cache existing ones."
20617 #: ../fuse/guestmount.pod:151
20619 "If you have untrusted raw-format guest disk images, you should use this "
20620 "option to specify the disk format. This avoids a possible security problem "
20621 "with malicious guests (CVE-2010-3851). See also "
20622 "L<guestfs(3)/guestfs_add_drive_opts>."
20626 #: ../fuse/guestmount.pod:156
20627 msgid "B<--fuse-help>"
20631 #: ../fuse/guestmount.pod:158
20632 msgid "Display help on special FUSE options (see I<-o> below)."
20636 #: ../fuse/guestmount.pod:162
20637 msgid "Display brief help and exit."
20641 #: ../fuse/guestmount.pod:186
20643 "Mount the named partition or logical volume on the given mountpoint B<in the "
20644 "guest> (this has nothing to do with mountpoints in the host)."
20648 #: ../fuse/guestmount.pod:189
20650 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
20651 "something on C</>."
20655 #: ../fuse/guestmount.pod:206
20657 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
20658 "unmounted. If you specify this option, then we don't attempt to sync the "
20659 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
20663 #: ../fuse/guestmount.pod:211
20664 msgid "B<-o option>"
20668 #: ../fuse/guestmount.pod:213
20669 msgid "B<--option option>"
20673 #: ../fuse/guestmount.pod:215
20674 msgid "Pass extra options to FUSE."
20678 #: ../fuse/guestmount.pod:217
20680 "To get a list of all the extra options supported by FUSE, use the command "
20681 "below. Note that only the FUSE I<-o> options can be passed, and only some "
20682 "of them are a good idea."
20686 #: ../fuse/guestmount.pod:221
20689 " guestmount --fuse-help\n"
20694 #: ../fuse/guestmount.pod:223
20695 msgid "Some potentially useful FUSE options:"
20699 #: ../fuse/guestmount.pod:227
20700 msgid "B<-o allow_other>"
20704 #: ../fuse/guestmount.pod:229
20705 msgid "Allow other users to see the filesystem."
20709 #: ../fuse/guestmount.pod:231
20710 msgid "B<-o attr_timeout=N>"
20714 #: ../fuse/guestmount.pod:233
20715 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
20719 #: ../fuse/guestmount.pod:235
20720 msgid "B<-o kernel_cache>"
20724 #: ../fuse/guestmount.pod:237
20726 "Allow the kernel to cache files (reduces the number of reads that have to go "
20727 "through the L<guestfs(3)> API). This is generally a good idea if you can "
20728 "afford the extra memory usage."
20732 #: ../fuse/guestmount.pod:241
20733 msgid "B<-o uid=N> B<-o gid=N>"
20737 #: ../fuse/guestmount.pod:243
20739 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
20740 "the chosen values."
20744 #: ../fuse/guestmount.pod:252
20746 "Add devices and mount everything read-only. Also disallow writes and make "
20747 "the disk appear read-only to FUSE."
20751 #: ../fuse/guestmount.pod:255
20753 "This is highly recommended if you are not going to edit the guest disk. If "
20754 "the guest is running and this option is I<not> supplied, then there is a "
20755 "strong risk of disk corruption in the guest. We try to prevent this from "
20756 "happening, but it is not always possible."
20760 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:171
20761 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20765 #: ../fuse/guestmount.pod:264
20766 msgid "Enable SELinux support for the guest."
20770 #: ../fuse/guestmount.pod:270
20771 msgid "Enable verbose messages from underlying libguestfs."
20775 #: ../fuse/guestmount.pod:276
20776 msgid "Display the program version and exit."
20780 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308 ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
20781 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20785 #: ../fuse/guestmount.pod:289
20790 #: ../fuse/guestmount.pod:291
20791 msgid "Trace libguestfs calls and entry into each FUSE function."
20795 #: ../fuse/guestmount.pod:293
20796 msgid "This also stops the daemon from forking into the background."
20800 #: ../fuse/guestmount.pod:319
20802 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
20803 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
20804 "L<http://fuse.sf.net/>."
20808 #: ../fuse/guestmount.pod:334
20809 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
20813 #: ../inspector/virt-inspector.pod:5
20815 "virt-inspector - Display operating system version and other information "
20816 "about a virtual machine"
20820 #: ../inspector/virt-inspector.pod:9
20823 " virt-inspector [--options] -d domname\n"
20828 #: ../inspector/virt-inspector.pod:11
20831 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
20836 #: ../inspector/virt-inspector.pod:15
20839 " virt-inspector domname\n"
20844 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
20847 " virt-inspector disk.img [disk.img ...]\n"
20852 #: ../inspector/virt-inspector.pod:21
20854 "B<virt-inspector> examines a virtual machine or disk image and tries to "
20855 "determine the version of the operating system and other information about "
20856 "the virtual machine."
20860 #: ../inspector/virt-inspector.pod:25
20861 msgid "Virt-inspector produces XML output for feeding into other programs."
20865 #: ../inspector/virt-inspector.pod:27
20867 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
20868 "the libvirt domain (see: C<virsh list --all>)."
20872 #: ../inspector/virt-inspector.pod:30
20874 "You can also run virt-inspector directly on disk images from a single "
20875 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
20876 "has several block devices, in which case you should list several I<-a> "
20877 "options one after another, with the first corresponding to the guest's "
20878 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
20882 #: ../inspector/virt-inspector.pod:37
20884 "You can also run virt-inspector on install disks, live CDs, bootable USB "
20885 "keys and similar."
20889 #: ../inspector/virt-inspector.pod:40
20891 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
20892 "inspect several virtual machines, you have to run virt-inspector several "
20893 "times (for example, from a shell script for-loop)."
20897 #: ../inspector/virt-inspector.pod:45
20899 "Because virt-inspector needs direct access to guest images, it won't "
20900 "normally work over remote libvirt connections."
20904 #: ../inspector/virt-inspector.pod:48
20906 "All of the information available from virt-inspector is also available "
20907 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
20908 "The same information can also be fetched using guestfish or via libguestfs "
20909 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
20910 "WITH OTHER PROGRAMMING LANGUAGES>)."
20914 #: ../inspector/virt-inspector.pod:81
20916 "Libvirt is only used if you specify a C<domname> on the command line. If "
20917 "you specify guest block devices directly (I<-a>), then libvirt is not used "
20922 #: ../inspector/virt-inspector.pod:94
20924 "When prompting for keys and passphrases, virt-inspector normally turns "
20925 "echoing off so you cannot see what you are typing. If you are not worried "
20926 "about Tempest attacks and there is no one else in the room you can specify "
20927 "this flag to see what you are typing."
20931 #: ../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
20933 "Specify the format of disk images given on the command line. If this is "
20934 "omitted then the format is autodetected from the content of the disk image."
20938 #: ../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
20940 "If disk images are requested from libvirt, then this program asks libvirt "
20941 "for this information. In this case, the value of the format parameter is "
20946 #: ../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
20948 "If working with untrusted raw-format guest disk images, you should ensure "
20949 "the format is always specified."
20953 #: ../inspector/virt-inspector.pod:139
20954 msgid "Previous versions of virt-inspector allowed you to write either:"
20958 #: ../inspector/virt-inspector.pod:145
20961 " virt-inspector guestname\n"
20966 #: ../inspector/virt-inspector.pod:153
20971 #: ../inspector/virt-inspector.pod:155
20973 "The virt-inspector XML is described precisely in a RELAX NG schema file "
20974 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
20975 "just an overview."
20979 #: ../inspector/virt-inspector.pod:159
20981 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
20982 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
20983 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
20984 "which is vanishingly rare in real world VMs."
20988 #: ../inspector/virt-inspector.pod:164
20989 msgid "E<lt>operatingsystemE<gt>"
20993 #: ../inspector/virt-inspector.pod:166
20995 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
20996 "describe the operating system, its architecture, the descriptive \"product "
20997 "name\" string, the type of OS and so on, as in this example:"
21001 #: ../inspector/virt-inspector.pod:170
21004 " <operatingsystems>\n"
21005 " <operatingsystem>\n"
21006 " <root>/dev/sda2</root>\n"
21007 " <name>windows</name>\n"
21008 " <arch>i386</arch>\n"
21009 " <distro>windows</distro>\n"
21010 " <product_name>Windows 7 Enterprise</product_name>\n"
21011 " <product_variant>Client</product_variant>\n"
21012 " <major_version>6</major_version>\n"
21013 " <minor_version>1</minor_version>\n"
21014 " <windows_systemroot>/Windows</windows_systemroot>\n"
21015 " <format>installed</format>\n"
21020 #: ../inspector/virt-inspector.pod:183
21022 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
21023 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
21024 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
21025 "architecture. The other fields are fairly self-explanatory, but because "
21026 "these fields are taken directly from the libguestfs inspection API you can "
21027 "find precise information from L<guestfs(3)/INSPECTION>."
21031 #: ../inspector/virt-inspector.pod:191
21033 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
21034 "of view of libguestfs (block devices may have completely different names "
21035 "inside the VM itself)."
21039 #: ../inspector/virt-inspector.pod:195
21040 msgid "E<lt>mountpointsE<gt>"
21044 #: ../inspector/virt-inspector.pod:197
21046 "Un*x-like guests typically have multiple filesystems which are mounted at "
21047 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
21048 "element which looks like this:"
21052 #: ../inspector/virt-inspector.pod:201
21055 " <operatingsystems>\n"
21056 " <operatingsystem>\n"
21059 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
21060 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
21061 " </mountpoints>\n"
21066 #: ../inspector/virt-inspector.pod:209
21068 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
21069 "and may have completely different names inside the guest. Only mountable "
21070 "filesystems appear in this list, not things like swap devices."
21074 #: ../inspector/virt-inspector.pod:214
21075 msgid "E<lt>filesystemsE<gt>"
21079 #: ../inspector/virt-inspector.pod:216
21081 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
21082 "filesystems belonging to the guest, including swap and empty partitions. "
21083 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
21084 "this OS or shared with this OS and other OSes)."
21088 #: ../inspector/virt-inspector.pod:222
21089 msgid "You might see something like this:"
21093 #: ../inspector/virt-inspector.pod:224
21096 " <operatingsystems>\n"
21097 " <operatingsystem>\n"
21100 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21101 " <type>ext4</type>\n"
21102 " <label>Fedora-13-x86_64</label>\n"
21103 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
21109 #: ../inspector/virt-inspector.pod:234
21111 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
21112 "the label, and the UUID."
21116 #: ../inspector/virt-inspector.pod:237
21117 msgid "E<lt>applicationsE<gt>"
21121 #: ../inspector/virt-inspector.pod:239
21123 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
21124 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
21129 #: ../inspector/virt-inspector.pod:243
21131 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
21132 "Typical values would be C<rpm> and C<deb>."
21136 #: ../inspector/virt-inspector.pod:246
21138 "E<lt>package_managementE<gt>, if present, describes the package manager. "
21139 "Typical values include C<yum>, C<up2date> and C<apt>"
21143 #: ../inspector/virt-inspector.pod:249
21144 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
21148 #: ../inspector/virt-inspector.pod:252
21151 " <operatingsystems>\n"
21152 " <operatingsystem>\n"
21154 " <applications>\n"
21156 " <name>coreutils</name>\n"
21157 " <version>8.5</version>\n"
21158 " <release>1</release>\n"
21159 " </application>\n"
21164 #: ../inspector/virt-inspector.pod:262
21166 "The version and release fields may not be available for some types guests. "
21167 "Other fields are possible, see "
21168 "L<guestfs(3)/guestfs_inspect_list_applications>."
21172 #: ../inspector/virt-inspector.pod:266
21173 msgid "E<lt>drive_mappingsE<gt>"
21177 #: ../inspector/virt-inspector.pod:268
21179 "For operating systems like Windows which use drive letters, virt-inspector "
21180 "is able to find out how drive letters map to filesystems."
21184 #: ../inspector/virt-inspector.pod:272
21187 " <operatingsystems>\n"
21188 " <operatingsystem>\n"
21190 " <drive_mappings>\n"
21191 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
21192 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
21193 " </drive_mappings>\n"
21198 #: ../inspector/virt-inspector.pod:280
21200 "In the example above, drive C maps to the filesystem on the second partition "
21201 "on the first disk, and drive E maps to the filesystem on the first partition "
21202 "on the second disk."
21206 #: ../inspector/virt-inspector.pod:284
21208 "Note that this only covers permanent local filesystem mappings, not things "
21209 "like network shares. Furthermore NTFS volume mount points may not be listed "
21214 #: ../inspector/virt-inspector.pod:288
21215 msgid "E<lt>iconE<gt>"
21219 #: ../inspector/virt-inspector.pod:290
21221 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
21222 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
21223 "very large and high quality."
21227 #: ../inspector/virt-inspector.pod:294
21230 " <operatingsystems>\n"
21231 " <operatingsystem>\n"
21234 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
21235 " [... many lines of base64 data ...]\n"
21241 #: ../inspector/virt-inspector.pod:302
21243 "To display the icon, you have to extract it and convert the base64 data back "
21244 "to a binary file. Use an XPath query or simply an editor to extract the "
21245 "data, then use the coreutils L<base64(1)> program to do the conversion back "
21250 #: ../inspector/virt-inspector.pod:307
21253 " base64 -i -d < icon.data > icon.png\n"
21258 #: ../inspector/virt-inspector.pod:309
21259 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
21263 #: ../inspector/virt-inspector.pod:311
21265 "Virt-inspector can detect some operating system installers on install disks, "
21266 "live CDs, bootable USB keys and more."
21270 #: ../inspector/virt-inspector.pod:314
21272 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
21273 "fields may be present to indicate a live CD, network installer, or one part "
21274 "of a multipart CD. For example:"
21278 #: ../inspector/virt-inspector.pod:318
21281 " <operatingsystems>\n"
21282 " <operatingsystem>\n"
21283 " <root>/dev/sda</root>\n"
21284 " <name>linux</name>\n"
21285 " <arch>i386</arch>\n"
21286 " <distro>ubuntu</distro>\n"
21287 " <product_name>Ubuntu 10.10 "Maverick "
21288 "Meerkat"</product_name>\n"
21289 " <major_version>10</major_version>\n"
21290 " <minor_version>10</minor_version>\n"
21291 " <format>installer</format>\n"
21297 #: ../inspector/virt-inspector.pod:330
21298 msgid "USING XPATH"
21302 #: ../inspector/virt-inspector.pod:332
21304 "You can use the XPath query language to select parts of the XML. We "
21305 "recommend using C<xmlstarlet> to perform XPath queries from the command "
21310 #: ../inspector/virt-inspector.pod:338
21313 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
21315 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21316 " <type>ext4</type>\n"
21322 #: ../inspector/virt-inspector.pod:344
21325 " $ virt-inspector -d Guest | \\\n"
21326 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
21332 #: ../inspector/virt-inspector.pod:348
21335 " $ virt-inspector -d Guest | \\\n"
21336 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
21337 " [displays the guest icon, if there is one]\n"
21342 #: ../inspector/virt-inspector.pod:359
21343 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
21347 #: ../inspector/virt-inspector.pod:361
21349 "Early versions of libguestfs shipped with a different virt-inspector program "
21350 "written in Perl (the current version is written in C). The XML output of "
21351 "the Perl virt-inspector was different and it could also output in other "
21352 "formats like text."
21356 #: ../inspector/virt-inspector.pod:366
21357 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
21361 #: ../inspector/virt-inspector.pod:369
21363 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
21364 "versions of virt-inspector with different names:"
21368 #: ../inspector/virt-inspector.pod:372
21371 " virt-inspector Old Perl version.\n"
21372 " virt-inspector2 New C version.\n"
21377 #: ../inspector/virt-inspector.pod:382
21379 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
21380 "L<base64(1)>, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
21384 #: ../inspector/virt-inspector.pod:399
21385 msgid "Matthew Booth L<mbooth@redhat.com>"
21389 #: ../java/examples/guestfs-java.pod:5
21390 msgid "guestfs-java - How to use libguestfs from Java"
21394 #: ../java/examples/guestfs-java.pod:9
21397 " import com.redhat.et.libguestfs.*;\n"
21402 #: ../java/examples/guestfs-java.pod:11
21405 " GuestFS g = new GuestFS ();\n"
21406 " g.add_drive_opts (\"disk.img\", null);\n"
21412 #: ../java/examples/guestfs-java.pod:17
21414 "This manual page documents how to call libguestfs from the Java programming "
21415 "language. This page just documents the differences from the C API and gives "
21416 "some examples. If you are not familiar with using libguestfs, you also need "
21417 "to read L<guestfs(3)>."
21421 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
21422 msgid "CLOSING THE HANDLE"
21426 #: ../java/examples/guestfs-java.pod:24
21428 "The handle is closed when it is reaped by the garbage collector. Because "
21429 "libguestfs handles include a lot of state, it is also possible to close (and "
21430 "hence free) them explicitly by calling the C<close> method."
21434 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
21439 #: ../java/examples/guestfs-java.pod:31
21441 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
21442 "exception. This has a single parameter which is the error message (a "
21447 #: ../java/examples/guestfs-java.pod:35
21448 msgid "Calling any method on a closed handle raises the same exception."
21452 #: ../java/examples/guestfs-java.pod:47
21454 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21455 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21456 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21457 "L<http://caml.inria.fr/>."
21461 #: ../ocaml/examples/guestfs-ocaml.pod:5
21462 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
21466 #: ../ocaml/examples/guestfs-ocaml.pod:9
21467 msgid "Module style:"
21471 #: ../ocaml/examples/guestfs-ocaml.pod:11
21474 " let g = Guestfs.create () in\n"
21475 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21476 " Guestfs.launch g;\n"
21481 #: ../ocaml/examples/guestfs-ocaml.pod:15
21482 msgid "Object-oriented style:"
21486 #: ../ocaml/examples/guestfs-ocaml.pod:17
21489 " let g = new Guestfs.guestfs () in\n"
21490 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21496 #: ../ocaml/examples/guestfs-ocaml.pod:21
21499 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
21501 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
21506 #: ../ocaml/examples/guestfs-ocaml.pod:27
21508 "This manual page documents how to call libguestfs from the OCaml programming "
21509 "language. This page just documents the differences from the C API and gives "
21510 "some examples. If you are not familiar with using libguestfs, you also need "
21511 "to read L<guestfs(3)>."
21515 #: ../ocaml/examples/guestfs-ocaml.pod:32
21516 msgid "PROGRAMMING STYLES"
21520 #: ../ocaml/examples/guestfs-ocaml.pod:34
21522 "There are two different programming styles supported by the OCaml bindings. "
21523 "You can use a module style, with each C function mapped to an OCaml "
21528 #: ../ocaml/examples/guestfs-ocaml.pod:38
21531 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
21536 #: ../ocaml/examples/guestfs-ocaml.pod:40
21541 #: ../ocaml/examples/guestfs-ocaml.pod:42
21544 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
21549 #: ../ocaml/examples/guestfs-ocaml.pod:44
21551 "Alternately you can use an object-oriented style, calling methods on the "
21552 "class C<Guestfs.guestfs>:"
21556 #: ../ocaml/examples/guestfs-ocaml.pod:47
21559 " method set_verbose : bool -> unit\n"
21564 #: ../ocaml/examples/guestfs-ocaml.pod:49
21566 "The object-oriented style is usually briefer, and the minor performance "
21567 "penalty isn't noticable in the general overhead of performing libguestfs "
21572 #: ../ocaml/examples/guestfs-ocaml.pod:55
21574 "The handle is closed when it is reaped by the garbage collector. Because "
21575 "libguestfs handles include a lot of state, it is also possible to close (and "
21576 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
21581 #: ../ocaml/examples/guestfs-ocaml.pod:62
21583 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
21584 "exception. This has a single parameter which is the error message (a "
21589 #: ../ocaml/examples/guestfs-ocaml.pod:66
21591 "Calling any function/method on a closed handle raises "
21592 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
21597 #: ../ocaml/examples/guestfs-ocaml.pod:80
21599 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21600 "L<guestfs-java(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21601 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21602 "L<http://caml.inria.fr/>."
21606 #: ../perl/examples/guestfs-perl.pod:5
21607 msgid "guestfs-perl - How to use libguestfs from Perl"
21611 #: ../perl/examples/guestfs-perl.pod:9
21614 " use Sys::Guestfs;\n"
21619 #: ../perl/examples/guestfs-perl.pod:11
21622 " my $h = Sys::Guestfs->new ();\n"
21623 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
21624 " $h->launch ();\n"
21625 " $h->mount_options ('', '/dev/sda1', '/');\n"
21626 " $h->touch ('/hello');\n"
21632 #: ../perl/examples/guestfs-perl.pod:20
21634 "This manual page documents how to call libguestfs from the Perl programming "
21635 "language. This page just documents the differences from the C API and gives "
21636 "some examples. If you are not familiar with using libguestfs, you also need "
21637 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
21641 #: ../perl/examples/guestfs-perl.pod:26
21646 #: ../perl/examples/guestfs-perl.pod:28
21648 "Errors from libguestfs functions turn into calls to C<croak> (see "
21653 #: ../perl/examples/guestfs-perl.pod:41
21655 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
21656 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
21657 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
21658 "L<http://libguestfs.org/>."
21662 #: ../python/examples/guestfs-python.pod:5
21663 msgid "guestfs-python - How to use libguestfs from Python"
21667 #: ../python/examples/guestfs-python.pod:9
21670 " import guestfs\n"
21671 " g = guestfs.GuestFS ()\n"
21672 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
21678 #: ../python/examples/guestfs-python.pod:16
21680 "This manual page documents how to call libguestfs from the Python "
21681 "programming language. This page just documents the differences from the C "
21682 "API and gives some examples. If you are not familiar with using libguestfs, "
21683 "you also need to read L<guestfs(3)>."
21687 #: ../python/examples/guestfs-python.pod:23
21689 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
21690 "single string argument which is the error message."
21694 #: ../python/examples/guestfs-python.pod:26
21695 msgid "MORE DOCUMENTATION"
21699 #: ../python/examples/guestfs-python.pod:28
21704 #: ../python/examples/guestfs-python.pod:30
21708 " >>> import guestfs\n"
21709 " >>> help (guestfs)\n"
21714 #: ../python/examples/guestfs-python.pod:44
21716 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21717 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
21718 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
21722 #: ../rescue/virt-rescue.pod:5
21723 msgid "virt-rescue - Run a rescue shell on a virtual machine"
21727 #: ../rescue/virt-rescue.pod:9
21730 " virt-rescue [--options] -d domname\n"
21735 #: ../rescue/virt-rescue.pod:11
21738 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
21743 #: ../rescue/virt-rescue.pod:15
21746 " virt-rescue [--options] domname\n"
21751 #: ../rescue/virt-rescue.pod:17
21754 " virt-rescue [--options] disk.img [disk.img ...]\n"
21759 #: ../rescue/virt-rescue.pod:21
21761 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
21762 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
21763 "you from doing this, but doesn't catch all cases."
21767 #: ../rescue/virt-rescue.pod:25
21769 "However if you use the I<--ro> (read only) option, then you can attach a "
21770 "shell to a live virtual machine. The results might be strange or "
21771 "inconsistent at times but you won't get disk corruption."
21775 #: ../rescue/virt-rescue.pod:31
21777 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
21778 "need for a CD. virt-rescue gives you a rescue shell and some simple "
21779 "recovery tools which you can use to examine or rescue a virtual machine or "
21784 #: ../rescue/virt-rescue.pod:36
21786 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
21787 "on disk image(s):"
21791 #: ../rescue/virt-rescue.pod:39
21794 " virt-rescue -d GuestName\n"
21799 #: ../rescue/virt-rescue.pod:41
21802 " virt-rescue --ro -a /path/to/disk.img\n"
21807 #: ../rescue/virt-rescue.pod:43
21810 " virt-rescue -a /dev/sdc\n"
21815 #: ../rescue/virt-rescue.pod:45
21816 msgid "For live VMs you I<must> use the --ro option."
21820 #: ../rescue/virt-rescue.pod:47
21822 "When you run virt-rescue on a virtual machine or disk image, you are placed "
21823 "in an interactive bash shell where you can use many ordinary Linux "
21824 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
21825 "appliance. You must mount the virtual machine's filesystems by hand. There "
21826 "is an empty directory called C</sysroot> where you can mount filesystems."
21830 #: ../rescue/virt-rescue.pod:54
21832 "In the example below, we list logical volumes, then choose one to mount "
21833 "under C</sysroot>:"
21837 #: ../rescue/virt-rescue.pod:57
21841 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
21842 " lv_root vg_f11x64 -wi-a- 8.83G\n"
21843 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
21844 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
21845 " ><rescue> ls /sysroot\n"
21850 #: ../rescue/virt-rescue.pod:64
21852 "If you don't know what filesystems are available on the virtual machine then "
21853 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
21857 #: ../rescue/virt-rescue.pod:70
21859 "Virt-rescue can be used on I<any> disk image file or device, not just a "
21860 "virtual machine. For example you can use it on a blank file if you want to "
21861 "partition that file (although we would recommend using L<guestfish(1)> "
21862 "instead as it is more suitable for this purpose). You can even use "
21863 "virt-rescue on things like SD cards."
21867 #: ../rescue/virt-rescue.pod:76
21869 "Virt-rescue does not require root. You only need to run it as root if you "
21870 "need root to open the disk image."
21874 #: ../rescue/virt-rescue.pod:79
21876 "This tool is just designed for quick interactive hacking on a virtual "
21877 "machine. For more structured access to a virtual machine disk image, you "
21878 "should use L<guestfs(3)>. To get a structured shell that you can use to "
21879 "make scripted changes to guests, use L<guestfish(1)>."
21883 #: ../rescue/virt-rescue.pod:103
21884 msgid "B<--append kernelopts>"
21888 #: ../rescue/virt-rescue.pod:105
21889 msgid "Pass additional options to the rescue kernel."
21893 #: ../rescue/virt-rescue.pod:135
21896 " virt-rescue --format=raw -a disk.img\n"
21901 #: ../rescue/virt-rescue.pod:139
21904 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
21909 #: ../rescue/virt-rescue.pod:148
21914 #: ../rescue/virt-rescue.pod:150
21915 msgid "B<--memsize MB>"
21919 #: ../rescue/virt-rescue.pod:152
21921 "Change the amount of memory allocated to the rescue system. The default is "
21922 "set by libguestfs and is small but adequate for running system tools. The "
21923 "occasional program might need more memory. The parameter is specified in "
21928 #: ../rescue/virt-rescue.pod:157
21929 msgid "B<--network>"
21933 #: ../rescue/virt-rescue.pod:159
21934 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
21938 #: ../rescue/virt-rescue.pod:165
21939 msgid "Open the image read-only."
21943 #: ../rescue/virt-rescue.pod:175
21945 "Enable SELinux in the rescue appliance. You should read "
21946 "L<guestfs(3)/SELINUX> before using this option."
21950 #: ../rescue/virt-rescue.pod:178
21955 #: ../rescue/virt-rescue.pod:180
21956 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
21960 #: ../rescue/virt-rescue.pod:198
21962 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
21963 "are done read-write."
21967 #: ../rescue/virt-rescue.pod:211
21968 msgid "Previous versions of virt-rescue allowed you to write either:"
21972 #: ../rescue/virt-rescue.pod:213
21975 " virt-rescue disk.img [disk.img ...]\n"
21980 #: ../rescue/virt-rescue.pod:217
21983 " virt-rescue guestname\n"
21988 #: ../rescue/virt-rescue.pod:225
21993 #: ../rescue/virt-rescue.pod:227
21995 "Adding the I<--network> option enables QEMU user networking in the rescue "
21996 "appliance. There are some differences between user networking and ordinary "
22001 #: ../rescue/virt-rescue.pod:233
22002 msgid "ping does not work"
22006 #: ../rescue/virt-rescue.pod:235
22008 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
22009 "send the ping packets, and because virt-rescue must be able to run as "
22010 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
22011 "command. The ping command will appear to resolve addresses but will not be "
22012 "able to send or receive any packets. This does not mean that the network is "
22017 #: ../rescue/virt-rescue.pod:242
22018 msgid "cannot receive connections"
22022 #: ../rescue/virt-rescue.pod:244
22023 msgid "QEMU user networking cannot receive incoming connections."
22027 #: ../rescue/virt-rescue.pod:246
22028 msgid "making TCP connections"
22032 #: ../rescue/virt-rescue.pod:248
22034 "The virt-rescue appliance needs to be small and so does not include many "
22035 "network tools. In particular there is no L<telnet(1)> command. You can "
22036 "make TCP connections from the shell using the magical "
22037 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
22041 #: ../rescue/virt-rescue.pod:253
22044 " exec 3<>/dev/tcp/redhat.com/80\n"
22045 " echo \"GET /\" >&3\n"
22051 #: ../rescue/virt-rescue.pod:257
22052 msgid "See L<bash(1)> for more details."
22056 #: ../rescue/virt-rescue.pod:263
22058 "Several environment variables affect virt-rescue. See "
22059 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
22063 #: ../rescue/virt-rescue.pod:290
22065 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
22066 "L<http://libguestfs.org/>."
22070 #: ../resize/virt-resize.pod:5
22071 msgid "virt-resize - Resize a virtual machine disk"
22075 #: ../resize/virt-resize.pod:9
22078 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
22079 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
22080 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
22085 #: ../resize/virt-resize.pod:15
22087 "Virt-resize is a tool which can resize a virtual machine disk, making it "
22088 "larger or smaller overall, and resizing or deleting any partitions contained "
22093 #: ../resize/virt-resize.pod:19
22095 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
22096 "not> be used on live virtual machines - for consistent results, shut the "
22097 "virtual machine down before resizing it."
22101 #: ../resize/virt-resize.pod:23
22103 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
22104 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
22108 #: ../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
22113 #: ../resize/virt-resize.pod:33
22115 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
22116 "fill the extra 5GB of space."
22120 #: ../resize/virt-resize.pod:36
22123 " virt-filesystems --long -h --all -a olddisk\n"
22128 #: ../resize/virt-resize.pod:38
22131 " truncate -r olddisk newdisk\n"
22132 " truncate -s +5G newdisk\n"
22137 #: ../resize/virt-resize.pod:41
22140 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
22141 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
22146 #: ../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
22151 #: ../resize/virt-resize.pod:46
22153 "As above, but make the /boot partition 200MB bigger, while giving the "
22154 "remaining space to /dev/sda2:"
22158 #: ../resize/virt-resize.pod:49
22161 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22162 " olddisk newdisk\n"
22167 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:610 ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:501 ../src/guestfs.pod:1451
22172 #: ../resize/virt-resize.pod:54
22174 "As in the first example, but expand a logical volume as the final step. "
22175 "This is what you would typically use for Linux guests that use LVM:"
22179 #: ../resize/virt-resize.pod:58
22182 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
22183 " olddisk newdisk\n"
22188 #: ../resize/virt-resize.pod:61
22193 #: ../resize/virt-resize.pod:63
22195 "As in the first example, but the output format will be qcow2 instead of a "
22200 #: ../resize/virt-resize.pod:66
22203 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
22204 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
22209 #: ../resize/virt-resize.pod:71
22210 msgid "DETAILED USAGE"
22214 #: ../resize/virt-resize.pod:73
22215 msgid "EXPANDING A VIRTUAL MACHINE DISK"
22219 #: ../resize/virt-resize.pod:77
22220 msgid "1. Shut down the virtual machine"
22224 #: ../resize/virt-resize.pod:79
22225 msgid "2. Locate input disk image"
22229 #: ../resize/virt-resize.pod:81
22231 "Locate the input disk image (ie. the file or device on the host containing "
22232 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
22233 "dumpxml> like this to find the disk image name:"
22237 #: ../resize/virt-resize.pod:85
22240 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
22241 " Found 1 nodes:\n"
22243 " <source dev=\"/dev/vg/lv_guest\" />\n"
22248 #: ../resize/virt-resize.pod:90
22249 msgid "3. Look at current sizing"
22253 #: ../resize/virt-resize.pod:92
22254 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
22258 #: ../resize/virt-resize.pod:95
22261 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
22262 " Name Type Size Parent\n"
22263 " /dev/sda1 partition 101M /dev/sda\n"
22264 " /dev/sda2 partition 7.9G /dev/sda\n"
22265 " /dev/sda device 8.0G -\n"
22270 #: ../resize/virt-resize.pod:101
22272 "(This example is a virtual machine with an 8 GB disk which we would like to "
22273 "expand up to 10 GB)."
22277 #: ../resize/virt-resize.pod:104
22278 msgid "4. Create output disk"
22282 #: ../resize/virt-resize.pod:106
22284 "Virt-resize cannot do in-place disk modifications. You have to have space "
22285 "to store the resized output disk."
22289 #: ../resize/virt-resize.pod:109
22290 msgid "To store the resized disk image in a file, create a file of a suitable size:"
22294 #: ../resize/virt-resize.pod:112
22297 " # rm -f outdisk\n"
22298 " # truncate -s 10G outdisk\n"
22303 #: ../resize/virt-resize.pod:115
22304 msgid "Or use L<lvcreate(1)> to create a logical volume:"
22308 #: ../resize/virt-resize.pod:117
22311 " # lvcreate -L 10G -n lv_name vg_name\n"
22316 #: ../resize/virt-resize.pod:119
22317 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
22321 #: ../resize/virt-resize.pod:121
22324 " # virsh pool-list\n"
22325 " # virsh vol-create-as poolname newvol 10G\n"
22330 #: ../resize/virt-resize.pod:124
22335 #: ../resize/virt-resize.pod:126
22337 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
22338 "file) and the output disk. The output disk is the one created in the "
22343 #: ../resize/virt-resize.pod:130
22346 " # virt-resize indisk outdisk\n"
22351 #: ../resize/virt-resize.pod:132
22353 "This command just copies disk image C<indisk> to disk image C<outdisk> "
22354 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
22355 "larger, then an extra, empty partition is created at the end of the disk "
22356 "covering the extra space. If C<outdisk> is smaller, then it will give an "
22361 #: ../resize/virt-resize.pod:138
22363 "More realistically you'd want to expand existing partitions in the disk "
22364 "image by passing extra options (for the full list see the L</OPTIONS> "
22369 #: ../resize/virt-resize.pod:142
22371 "L</--expand> is the most useful option. It expands the named partition "
22372 "within the disk to fill any extra space:"
22376 #: ../resize/virt-resize.pod:145
22379 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
22384 #: ../resize/virt-resize.pod:147
22386 "(In this case, an extra partition is I<not> created at the end of the disk, "
22387 "because there will be no unused space)."
22391 #: ../resize/virt-resize.pod:150
22393 "L</--resize> is the other commonly used option. The following would "
22394 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
22395 "rest of the available space:"
22399 #: ../resize/virt-resize.pod:154
22402 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22403 " indisk outdisk\n"
22408 #: ../resize/virt-resize.pod:157
22410 "If the expanded partition in the image contains a filesystem or LVM PV, then "
22411 "if virt-resize knows how, it will resize the contents, the equivalent of "
22412 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
22413 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
22414 "filesystems, so you would have to online resize them after booting the "
22419 #: ../resize/virt-resize.pod:164
22420 msgid "Other options are covered below."
22424 #: ../resize/virt-resize.pod:166
22429 #: ../resize/virt-resize.pod:168
22430 msgid "Thoroughly test the new disk image I<before> discarding the old one."
22434 #: ../resize/virt-resize.pod:170
22435 msgid "If you are using libvirt, edit the XML to point at the new disk:"
22439 #: ../resize/virt-resize.pod:172
22442 " # virsh edit guestname\n"
22447 #: ../resize/virt-resize.pod:174
22449 "Change E<lt>source ...E<gt>, see "
22450 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
22454 #: ../resize/virt-resize.pod:177
22455 msgid "Then start up the domain with the new, resized disk:"
22459 #: ../resize/virt-resize.pod:179
22462 " # virsh start guestname\n"
22467 #: ../resize/virt-resize.pod:181
22469 "and check that it still works. See also the L</NOTES> section below for "
22470 "additional information."
22474 #: ../resize/virt-resize.pod:184
22475 msgid "7. Resize LVs etc inside the guest"
22479 #: ../resize/virt-resize.pod:186
22480 msgid "(This can also be done offline using L<guestfish(1)>)"
22484 #: ../resize/virt-resize.pod:188
22486 "Once the guest has booted you should see the new space available, at least "
22487 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
22488 "may need to resize LVs inside PVs, and also resize filesystem types that "
22489 "virt-resize does not know how to expand."
22493 #: ../resize/virt-resize.pod:195
22494 msgid "SHRINKING A VIRTUAL MACHINE DISK"
22498 #: ../resize/virt-resize.pod:197
22500 "Shrinking is somewhat more complex than expanding, and only an overview is "
22505 #: ../resize/virt-resize.pod:200
22507 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
22508 "filesystems). The user has to shrink content before passing the disk image "
22509 "to virt-resize, and virt-resize will check that the content has been shrunk "
22514 #: ../resize/virt-resize.pod:205
22515 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
22519 #: ../resize/virt-resize.pod:207
22521 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
22522 "steps 3 and 4 above to allocate a new disk image."
22526 #: ../resize/virt-resize.pod:210
22527 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
22531 #: ../resize/virt-resize.pod:213
22532 msgid "IGNORING OR DELETING PARTITIONS"
22536 #: ../resize/virt-resize.pod:215
22538 "virt-resize also gives a convenient way to ignore or delete partitions when "
22539 "copying from the input disk to the output disk. Ignoring a partition speeds "
22540 "up the copy where you don't care about the existing contents of a "
22541 "partition. Deleting a partition removes it completely, but note that it "
22542 "also renumbers any partitions after the one which is deleted, which can "
22543 "leave some guests unbootable."
22547 #: ../resize/virt-resize.pod:222
22548 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
22552 #: ../resize/virt-resize.pod:224
22554 "If the input disk is in qcow2 format, then you may prefer that the output is "
22555 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
22556 "the fly. The output format is simply determined by the format of the empty "
22557 "output container that you provide. Thus to create qcow2 output, use:"
22561 #: ../resize/virt-resize.pod:230
22564 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
22569 #: ../resize/virt-resize.pod:232
22570 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
22574 #: ../resize/virt-resize.pod:234
22575 msgid "Similarly, to get non-sparse raw output use:"
22579 #: ../resize/virt-resize.pod:236
22582 " fallocate -l size outdisk\n"
22587 #: ../resize/virt-resize.pod:238
22589 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
22590 "if=/dev/zero of=outdisk bs=1M count=..>)"
22594 #: ../resize/virt-resize.pod:241
22595 msgid "LOGICAL PARTITIONS"
22599 #: ../resize/virt-resize.pod:243
22601 "Logical partitions (a.k.a. C</dev/sda5+> on disks using DOS partition "
22602 "tables) cannot be resized."
22606 #: ../resize/virt-resize.pod:246
22608 "To understand what is going on, firstly one of the four partitions "
22609 "C</dev/sda1-4> will have MBR partition type C<05> or C<0f>. This is called "
22610 "the B<extended partition>. Use L<virt-filesystems(1)> to see the MBR "
22615 #: ../resize/virt-resize.pod:251
22616 msgid "Logical partitions live inside the extended partition."
22620 #: ../resize/virt-resize.pod:253
22622 "The extended partition can be expanded, but not shrunk (unless you force it, "
22623 "which is not advisable). When the extended partition is copied across, all "
22624 "the logical partitions contained inside are copied over implicitly. "
22625 "Virt-resize does not look inside the extended partition, so it copies the "
22626 "logical partitions blindly."
22630 #: ../resize/virt-resize.pod:259
22632 "You cannot specify a logical partition (C</dev/sda5+>) at all on the command "
22633 "line. Doing so will give an error."
22637 #: ../resize/virt-resize.pod:268 ../sparsify/virt-sparsify.pod:105
22638 msgid "Display help."
22642 #: ../resize/virt-resize.pod:270
22643 msgid "B<--align-first auto>"
22647 #: ../resize/virt-resize.pod:272
22648 msgid "B<--align-first never>"
22652 #: ../resize/virt-resize.pod:274
22653 msgid "B<--align-first always>"
22657 #: ../resize/virt-resize.pod:276
22659 "Align the first partition for improved performance (see also the "
22660 "I<--alignment> option)."
22664 #: ../resize/virt-resize.pod:279
22666 "The default is I<--align-first auto> which only aligns the first partition "
22667 "if it is safe to do so. That is, only when we know how to fix the "
22668 "bootloader automatically, and at the moment that can only be done for "
22673 #: ../resize/virt-resize.pod:284
22675 "I<--align-first never> means we never move the first partition. This is the "
22676 "safest option. Try this if the guest does not boot after resizing."
22680 #: ../resize/virt-resize.pod:288
22682 "I<--align-first always> means we always align the first partition (if it "
22683 "needs to be aligned). For some guests this will break the bootloader, "
22684 "making the guest unbootable."
22688 #: ../resize/virt-resize.pod:292
22689 msgid "B<--alignment N>"
22693 #: ../resize/virt-resize.pod:294
22695 "Set the alignment of partitions to C<N> sectors. The default in virt-resize "
22696 "E<lt> 1.13.19 was 64 sectors, and after that is 128 sectors."
22700 #: ../resize/virt-resize.pod:298
22702 "Assuming 512 byte sector size inside the guest, here are some suitable "
22707 #: ../resize/virt-resize.pod:303
22708 msgid "I<--alignment 1> (512 bytes)"
22712 #: ../resize/virt-resize.pod:305
22714 "The partitions would be packed together as closely as possible, but would be "
22715 "completely unaligned. In some cases this can cause very poor performance. "
22716 "See L<virt-alignment-scan(1)> for further details."
22720 #: ../resize/virt-resize.pod:309
22721 msgid "I<--alignment 8> (4K)"
22725 #: ../resize/virt-resize.pod:311
22727 "This would be the minimum acceptable alignment for reasonable performance on "
22732 #: ../resize/virt-resize.pod:314
22733 msgid "I<--alignment 128> (64K)"
22737 #: ../resize/virt-resize.pod:316
22739 "This alignment provides good performance when the host is using high end "
22744 #: ../resize/virt-resize.pod:319
22745 msgid "I<--alignment 2048> (1M)"
22749 #: ../resize/virt-resize.pod:321
22751 "This is the standard alignment used by all newly installed guests since "
22756 #: ../resize/virt-resize.pod:326
22761 #: ../resize/virt-resize.pod:328 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
22766 #: ../resize/virt-resize.pod:330 ../tools/virt-win-reg.pl:122
22767 msgid "Enable debugging messages."
22771 #: ../resize/virt-resize.pod:332
22772 msgid "B<--delete part>"
22776 #: ../resize/virt-resize.pod:334
22778 "Delete the named partition. It would be more accurate to describe this as "
22779 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
22780 "the original disk image is left intact."
22784 #: ../resize/virt-resize.pod:338
22786 "Note that when you delete a partition, then anything contained in the "
22787 "partition is also deleted. Furthermore, this causes any partitions that "
22788 "come after to be I<renumbered>, which can easily make your guest unbootable."
22792 #: ../resize/virt-resize.pod:343 ../resize/virt-resize.pod:404 ../resize/virt-resize.pod:531 ../sparsify/virt-sparsify.pod:145
22793 msgid "You can give this option multiple times."
22797 #: ../resize/virt-resize.pod:345
22798 msgid "B<--expand part>"
22802 #: ../resize/virt-resize.pod:347
22804 "Expand the named partition so it uses up all extra space (space left over "
22805 "after any other resize changes that you request have been done)."
22809 #: ../resize/virt-resize.pod:350
22811 "If virt-resize knows how, it will expand the direct content of the "
22812 "partition. For example, if the partition is an LVM PV, it will expand the "
22813 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
22814 "content it doesn't know about alone."
22818 #: ../resize/virt-resize.pod:355
22819 msgid "Currently virt-resize can resize:"
22823 #: ../resize/virt-resize.pod:361
22824 msgid "ext2, ext3 and ext4 filesystems."
22828 #: ../resize/virt-resize.pod:365
22829 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
22833 #: ../resize/virt-resize.pod:367
22835 "The filesystem must have been shut down consistently last time it was used. "
22836 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
22837 "consistency check, so at the first boot after resizing Windows will check "
22842 #: ../resize/virt-resize.pod:374
22844 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
22845 "inside the PV, but see the I<--LV-expand> option. The user could also "
22846 "resize LVs as desired after boot."
22850 #: ../resize/virt-resize.pod:380
22851 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
22855 #: ../resize/virt-resize.pod:384 ../resize/virt-resize.pod:559
22856 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
22860 #: ../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
22861 msgid "B<--format> raw"
22865 #: ../resize/virt-resize.pod:388 ../sparsify/virt-sparsify.pod:129
22867 "Specify the format of the input disk image. If this flag is not given then "
22868 "it is auto-detected from the image itself."
22872 #: ../resize/virt-resize.pod:394
22874 "Note that this option I<does not> affect the output format. See L</QCOW2 "
22875 "AND NON-SPARSE RAW FORMATS>."
22879 #: ../resize/virt-resize.pod:397
22880 msgid "B<--ignore part>"
22884 #: ../resize/virt-resize.pod:399
22886 "Ignore the named partition. Effectively this means the partition is "
22887 "allocated on the destination disk, but the content is not copied across from "
22888 "the source disk. The content of the partition will be blank (all zero "
22893 #: ../resize/virt-resize.pod:406
22894 msgid "B<--LV-expand logvol>"
22898 #: ../resize/virt-resize.pod:408
22900 "This takes the logical volume and, as a final step, expands it to fill all "
22901 "the space available in its volume group. A typical usage, assuming a Linux "
22902 "guest with a single PV C</dev/sda2> and a root device called "
22903 "C</dev/vg_guest/lv_root> would be:"
22907 #: ../resize/virt-resize.pod:413
22910 " virt-resize indisk outdisk \\\n"
22911 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
22916 #: ../resize/virt-resize.pod:416
22918 "This would first expand the partition (and PV), and then expand the root "
22919 "device to fill the extra space in the PV."
22923 #: ../resize/virt-resize.pod:419
22925 "The contents of the LV are also resized if virt-resize knows how to do "
22926 "that. You can stop virt-resize from trying to expand the content by using "
22927 "the option I<--no-expand-content>."
22931 #: ../resize/virt-resize.pod:423
22932 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
22936 #: ../resize/virt-resize.pod:425
22938 "You can give this option multiple times, I<but> it doesn't make sense to do "
22939 "this unless the logical volumes you specify are all in different volume "
22944 #: ../resize/virt-resize.pod:429 ../sparsify/virt-sparsify.pod:147
22945 msgid "B<--machine-readable>"
22949 #: ../resize/virt-resize.pod:431 ../sparsify/virt-sparsify.pod:149
22951 "This option is used to make the output more machine friendly when being "
22952 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
22956 #: ../resize/virt-resize.pod:437
22957 msgid "B<--dryrun>"
22961 #: ../resize/virt-resize.pod:439
22962 msgid "Print a summary of what would be done, but don't do anything."
22966 #: ../resize/virt-resize.pod:441
22967 msgid "B<--no-copy-boot-loader>"
22971 #: ../resize/virt-resize.pod:443
22973 "By default, virt-resize copies over some sectors at the start of the disk "
22974 "(up to the beginning of the first partition). Commonly these sectors "
22975 "contain the Master Boot Record (MBR) and the boot loader, and are required "
22976 "in order for the guest to boot correctly."
22980 #: ../resize/virt-resize.pod:448
22982 "If you specify this flag, then this initial copy is not done. You may need "
22983 "to reinstall the boot loader in this case."
22987 #: ../resize/virt-resize.pod:451
22988 msgid "B<--no-extra-partition>"
22992 #: ../resize/virt-resize.pod:453
22994 "By default, virt-resize creates an extra partition if there is any extra, "
22995 "unused space after all resizing has happened. Use this option to prevent "
22996 "the extra partition from being created. If you do this then the extra space "
22997 "will be inaccessible until you run fdisk, parted, or some other partitioning "
22998 "tool in the guest."
23002 #: ../resize/virt-resize.pod:459
23004 "Note that if the surplus space is smaller than 10 MB, no extra partition "
23009 #: ../resize/virt-resize.pod:462
23010 msgid "B<--no-expand-content>"
23014 #: ../resize/virt-resize.pod:464
23016 "By default, virt-resize will try to expand the direct contents of "
23017 "partitions, if it knows how (see I<--expand> option above)."
23021 #: ../resize/virt-resize.pod:467
23023 "If you give the I<--no-expand-content> option then virt-resize will not "
23028 #: ../resize/virt-resize.pod:470
23029 msgid "B<--ntfsresize-force>"
23033 #: ../resize/virt-resize.pod:472
23035 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
23036 "the NTFS disk is marked as needing a consistency check. You have to use "
23037 "this option if you want to resize a Windows guest multiple times without "
23038 "booting into Windows between each resize."
23042 #: ../resize/virt-resize.pod:478
23043 msgid "B<--output-format> raw"
23047 #: ../resize/virt-resize.pod:480
23049 "Specify the format of the output disk image. If this flag is not given then "
23050 "it is auto-detected from the image itself."
23054 #: ../resize/virt-resize.pod:486
23056 "Note that this option I<does not create> the output format. This option "
23057 "just tells libguestfs what it is so it doesn't try to guess it. You still "
23058 "need to create the output disk with the right format. See L</QCOW2 AND "
23059 "NON-SPARSE RAW FORMATS>."
23063 #: ../resize/virt-resize.pod:495
23064 msgid "Don't print the summary."
23068 #: ../resize/virt-resize.pod:497
23069 msgid "B<--resize part=size>"
23073 #: ../resize/virt-resize.pod:499
23075 "Resize the named partition (expanding or shrinking it) so that it has the "
23080 #: ../resize/virt-resize.pod:502
23082 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
23083 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
23084 "size; or as a relative number or percentage. For example:"
23088 #: ../resize/virt-resize.pod:508
23091 " --resize /dev/sda2=10G\n"
23096 #: ../resize/virt-resize.pod:510
23099 " --resize /dev/sda4=90%\n"
23104 #: ../resize/virt-resize.pod:512
23107 " --resize /dev/sda2=+1G\n"
23112 #: ../resize/virt-resize.pod:514
23115 " --resize /dev/sda2=-200M\n"
23120 #: ../resize/virt-resize.pod:516
23123 " --resize /dev/sda1=+128K\n"
23128 #: ../resize/virt-resize.pod:518
23131 " --resize /dev/sda1=+10%\n"
23136 #: ../resize/virt-resize.pod:520
23139 " --resize /dev/sda1=-10%\n"
23144 #: ../resize/virt-resize.pod:522
23146 "You can increase the size of any partition. Virt-resize will expand the "
23147 "direct content of the partition if it knows how (see I<--expand> below)."
23151 #: ../resize/virt-resize.pod:526
23153 "You can only I<decrease> the size of partitions that contain filesystems or "
23154 "PVs which have already been shrunk. Virt-resize will check this has been "
23155 "done before proceeding, or else will print an error (see also "
23156 "I<--resize-force>)."
23160 #: ../resize/virt-resize.pod:533
23161 msgid "B<--resize-force part=size>"
23165 #: ../resize/virt-resize.pod:535
23167 "This is the same as I<--resize> except that it will let you decrease the "
23168 "size of any partition. Generally this means you will lose any data which "
23169 "was at the end of the partition you shrink, but you may not care about that "
23170 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
23171 "as a swap partition)."
23175 #: ../resize/virt-resize.pod:541
23176 msgid "See also the I<--ignore> option."
23180 #: ../resize/virt-resize.pod:543
23181 msgid "B<--shrink part>"
23185 #: ../resize/virt-resize.pod:545
23187 "Shrink the named partition until the overall disk image fits in the "
23188 "destination. The named partition B<must> contain a filesystem or PV which "
23189 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
23190 "online tools). Virt-resize will check this and give an error if it has not "
23195 #: ../resize/virt-resize.pod:551
23197 "The amount by which the overall disk must be shrunk (after carrying out all "
23198 "other operations requested by the user) is called the \"deficit\". For "
23199 "example, a straight copy (assume no other operations) from a 5GB disk image "
23200 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
23201 "would give an error unless the user specified a partition to shrink and that "
23202 "partition had more than a gigabyte of free space."
23206 #: ../resize/virt-resize.pod:569 ../sparsify/virt-sparsify.pod:177
23207 msgid "MACHINE READABLE OUTPUT"
23211 #: ../resize/virt-resize.pod:571
23213 "The I<--machine-readable> option can be used to make the output more machine "
23214 "friendly, which is useful when calling virt-resize from other programs, GUIs "
23219 #: ../resize/virt-resize.pod:575 ../sparsify/virt-sparsify.pod:183
23220 msgid "There are two ways to use this option."
23224 #: ../resize/virt-resize.pod:577
23226 "Firstly use the option on its own to query the capabilities of the "
23227 "virt-resize binary. Typical output looks like this:"
23231 #: ../resize/virt-resize.pod:580
23234 " $ virt-resize --machine-readable\n"
23236 " ntfsresize-force\n"
23244 #: ../resize/virt-resize.pod:587 ../sparsify/virt-sparsify.pod:193
23246 "A list of features is printed, one per line, and the program exits with "
23251 #: ../resize/virt-resize.pod:590 ../sparsify/virt-sparsify.pod:196
23253 "Secondly use the option in conjunction with other options to make the "
23254 "regular program output more machine friendly."
23258 #: ../resize/virt-resize.pod:593 ../sparsify/virt-sparsify.pod:199
23259 msgid "At the moment this means:"
23263 #: ../resize/virt-resize.pod:599 ../sparsify/virt-sparsify.pod:205
23265 "Progress bar messages can be parsed from stdout by looking for this regular "
23270 #: ../resize/virt-resize.pod:602 ../sparsify/virt-sparsify.pod:208
23273 " ^[0-9]+/[0-9]+$\n"
23278 #: ../resize/virt-resize.pod:606 ../sparsify/virt-sparsify.pod:212
23280 "The calling program should treat messages sent to stdout (except for "
23281 "progress bar messages) as status messages. They can be logged and/or "
23282 "displayed to the user."
23286 #: ../resize/virt-resize.pod:612
23288 "The calling program should treat messages sent to stderr as error messages. "
23289 "In addition, virt-resize exits with a non-zero status code if there was a "
23294 #: ../resize/virt-resize.pod:618
23296 "Versions of the program prior to 1.13.9 did not support the "
23297 "I<--machine-readable> option and will return an error."
23301 #: ../resize/virt-resize.pod:623
23302 msgid "\"Partition 1 does not end on cylinder boundary.\""
23306 #: ../resize/virt-resize.pod:625
23308 "Virt-resize aligns partitions to multiples of 128 sectors (see the "
23309 "I<--alignment> parameter). Usually this means the partitions will not be "
23310 "aligned to the ancient CHS geometry. However CHS geometry is meaningless "
23311 "for disks manufactured since the early 1990s, and doubly so for virtual hard "
23312 "drives. Alignment of partitions to cylinders is not required by any modern "
23313 "operating system."
23317 #: ../resize/virt-resize.pod:632
23318 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
23322 #: ../resize/virt-resize.pod:634
23324 "In Windows Vista and later versions, Microsoft switched to using a separate "
23325 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
23326 "and C</dev/sda2> is the main (C:) drive. Resizing the first (boot) "
23327 "partition causes the bootloader to fail with C<0xC0000225> error. Resizing "
23328 "the second partition (ie. C: drive) should work."
23332 #: ../resize/virt-resize.pod:641
23334 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
23335 "NTFS partitions have been expanded. This is just a safety check and (unless "
23336 "it find errors) is nothing to worry about."
23340 #: ../resize/virt-resize.pod:645
23341 msgid "GUEST BOOT STUCK AT \"GRUB\""
23345 #: ../resize/virt-resize.pod:647
23347 "If a Linux guest does not boot after resizing, and the boot is stuck after "
23348 "printing C<GRUB> on the console, try reinstalling grub."
23352 #: ../resize/virt-resize.pod:650
23355 " guestfish -i -a newdisk\n"
23356 " ><fs> cat /boot/grub/device.map\n"
23357 " # check the contents of this file are sensible or\n"
23358 " # edit the file if necessary\n"
23359 " ><fs> grub-install / /dev/vda\n"
23365 #: ../resize/virt-resize.pod:657
23367 "For more flexible guest reconfiguration, including if you need to specify "
23368 "other parameters to grub-install, use L<virt-rescue(1)>."
23372 #: ../resize/virt-resize.pod:660
23373 msgid "ALTERNATIVE TOOLS"
23377 #: ../resize/virt-resize.pod:662
23379 "There are several proprietary tools for resizing partitions. We won't "
23380 "mention any here."
23384 #: ../resize/virt-resize.pod:665
23386 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
23387 "operations on disk images. They can resize and move partitions, but I don't "
23388 "think they can do anything with the contents, and they certainly don't "
23393 #: ../resize/virt-resize.pod:670
23395 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
23396 "but at a much lower level. You will probably end up hand-calculating sector "
23397 "offsets, which is something that virt-resize was designed to avoid. If you "
23398 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
23403 #: ../resize/virt-resize.pod:690
23405 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
23406 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
23407 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
23408 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
23409 "L<virt-sparsify(1)>, L<virt-alignment-scan(1)>, L<http://libguestfs.org/>."
23413 #: ../ruby/examples/guestfs-ruby.pod:5
23414 msgid "guestfs-ruby - How to use libguestfs from Ruby"
23418 #: ../ruby/examples/guestfs-ruby.pod:9
23421 " require 'guestfs'\n"
23422 " g = Guestfs::Guestfs.new()\n"
23423 " g.add_drive_opts(\"disk.img\",\n"
23424 " :readonly => 1, :format => \"raw\")\n"
23430 #: ../ruby/examples/guestfs-ruby.pod:17
23432 "This manual page documents how to call libguestfs from the Ruby programming "
23433 "language. This page just documents the differences from the C API and gives "
23434 "some examples. If you are not familiar with using libguestfs, you also need "
23435 "to read L<guestfs(3)>."
23439 #: ../ruby/examples/guestfs-ruby.pod:24
23441 "Errors from libguestfs functions are mapped into the C<Error> exception. "
23442 "This has a single parameter which is the error message (a string)."
23446 #: ../ruby/examples/guestfs-ruby.pod:38
23448 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
23449 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
23450 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
23454 #: ../sparsify/virt-sparsify.pod:5
23455 msgid "virt-sparsify - Make a virtual machine disk sparse"
23459 #: ../sparsify/virt-sparsify.pod:9
23462 " virt-sparsify [--options] indisk outdisk\n"
23467 #: ../sparsify/virt-sparsify.pod:13
23469 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
23470 "image) sparse a.k.a. thin-provisioned. This means that free space within "
23471 "the disk image can be converted back to free space on the host."
23475 #: ../sparsify/virt-sparsify.pod:18
23477 "Virt-sparsify can locate and sparsify free space in most filesystems "
23478 "(eg. ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
23482 #: ../sparsify/virt-sparsify.pod:21
23484 "Virt-sparsify can also convert between some disk formats, for example "
23485 "converting a raw disk image to a thin-provisioned qcow2 image."
23489 #: ../sparsify/virt-sparsify.pod:24
23491 "Virt-sparsify can operate on any disk image, not just ones from virtual "
23492 "machines. If a virtual machine has more than one attached disk, you must "
23493 "sparsify each one separately."
23497 #: ../sparsify/virt-sparsify.pod:28
23498 msgid "IMPORTANT LIMITATIONS"
23502 #: ../sparsify/virt-sparsify.pod:34
23504 "Virt-sparsify does not do in-place modifications. It copies from a source "
23505 "image to a destination image, leaving the source unchanged. I<Check that "
23506 "the sparsification was successful before deleting the source image>."
23510 #: ../sparsify/virt-sparsify.pod:41
23511 msgid "The virtual machine I<must be shut down> before using this tool."
23515 #: ../sparsify/virt-sparsify.pod:45
23517 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
23518 "(1 temporary copy + 1 destination image). This is in the worst case and "
23519 "usually much less space is required."
23523 #: ../sparsify/virt-sparsify.pod:51
23524 msgid "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
23528 #: ../sparsify/virt-sparsify.pod:56
23529 msgid "Virt-sparsify cannot handle encrypted disks."
23533 #: ../sparsify/virt-sparsify.pod:60
23535 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
23536 "this space is often used for critical items like bootloaders so it's not "
23541 #: ../sparsify/virt-sparsify.pod:66
23543 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
23544 "to do this unless we can be sure there is no hibernation data, so at the "
23545 "moment swap partitions are ignored."
23549 #: ../sparsify/virt-sparsify.pod:72
23551 "You may also want to read the manual pages for the associated tools "
23552 "L<virt-filesystems(1)> and L<virt-df(1)> before starting."
23556 #: ../sparsify/virt-sparsify.pod:77
23557 msgid "Typical usage is:"
23561 #: ../sparsify/virt-sparsify.pod:79
23564 " virt-sparsify indisk outdisk\n"
23569 #: ../sparsify/virt-sparsify.pod:81
23571 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
23572 "is created, or overwritten if it already exists. The format of the input "
23573 "disk is detected (eg. qcow2) and the same format is used for the output "
23578 #: ../sparsify/virt-sparsify.pod:86
23579 msgid "To convert between formats, use the I<--convert> option:"
23583 #: ../sparsify/virt-sparsify.pod:88
23586 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
23591 #: ../sparsify/virt-sparsify.pod:90
23593 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
23594 "can find within the source disk image. You can get it to ignore (don't zero "
23595 "free space on) certain filesystems by doing:"
23599 #: ../sparsify/virt-sparsify.pod:94
23602 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
23607 #: ../sparsify/virt-sparsify.pod:96
23608 msgid "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
23612 #: ../sparsify/virt-sparsify.pod:107
23613 msgid "B<--convert> raw"
23617 #: ../sparsify/virt-sparsify.pod:109
23618 msgid "B<--convert> qcow2"
23622 #: ../sparsify/virt-sparsify.pod:111
23623 msgid "B<--convert> [other formats]"
23627 #: ../sparsify/virt-sparsify.pod:113
23629 "Use C<output-format> as the format for the destination image. If this is "
23630 "not specified, then the input format is used."
23634 #: ../sparsify/virt-sparsify.pod:116
23635 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
23639 #: ../sparsify/virt-sparsify.pod:118
23641 "You can also use any format supported by the L<qemu-img(1)> program, "
23642 "eg. C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
23646 #: ../sparsify/virt-sparsify.pod:122
23648 "Specifying the I<--convert> option is usually a good idea, because then "
23649 "virt-sparsify doesn't need to try to guess the input format."
23653 #: ../sparsify/virt-sparsify.pod:127
23654 msgid "B<--format> qcow2"
23658 #: ../sparsify/virt-sparsify.pod:135
23659 msgid "B<--ignore> filesystem"
23663 #: ../sparsify/virt-sparsify.pod:137
23664 msgid "B<--ignore> volgroup"
23668 #: ../sparsify/virt-sparsify.pod:139
23670 "Ignore the named filesystem. Free space on the filesystem will not be "
23671 "zeroed, but existing blocks of zeroes will still be sparsified."
23675 #: ../sparsify/virt-sparsify.pod:142
23677 "In the second form, this ignores the named volume group. Use the volume "
23678 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
23682 #: ../sparsify/virt-sparsify.pod:157
23683 msgid "This disables progress bars and other unnecessary output."
23687 #: ../sparsify/virt-sparsify.pod:179
23689 "The I<--machine-readable> option can be used to make the output more machine "
23690 "friendly, which is useful when calling virt-sparsify from other programs, "
23695 #: ../sparsify/virt-sparsify.pod:185
23697 "Firstly use the option on its own to query the capabilities of the "
23698 "virt-sparsify binary. Typical output looks like this:"
23702 #: ../sparsify/virt-sparsify.pod:188
23705 " $ virt-sparsify --machine-readable\n"
23713 #: ../sparsify/virt-sparsify.pod:218
23715 "The calling program should treat messages sent to stderr as error messages. "
23716 "In addition, virt-sparsify exits with a non-zero status code if there was a "
23721 #: ../sparsify/virt-sparsify.pod:224
23723 "All versions of virt-sparsify have supported the I<--machine-readable> "
23728 #: ../sparsify/virt-sparsify.pod:238
23730 "Location of the temporary directory used for the potentially large temporary "
23735 #: ../sparsify/virt-sparsify.pod:241
23737 "You should ensure there is enough free space in the worst case for a full "
23738 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
23739 "to another directory that has enough space."
23743 #: ../sparsify/virt-sparsify.pod:245
23744 msgid "This defaults to C</tmp>."
23748 #: ../sparsify/virt-sparsify.pod:249
23749 msgid "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
23753 #: ../sparsify/virt-sparsify.pod:253
23755 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
23756 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, "
23757 "L<qemu-img(1)>, L<http://libguestfs.org/>."
23761 #: ../src/guestfs-actions.pod:1
23762 msgid "guestfs_add_cdrom"
23766 #: ../src/guestfs-actions.pod:3
23770 " guestfs_add_cdrom (guestfs_h *g,\n"
23771 " const char *filename);\n"
23776 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:255 ../src/guestfs-actions.pod:276
23778 "I<This function is deprecated.> In new code, use the "
23779 "L</guestfs_add_drive_opts> call instead."
23783 #: ../src/guestfs-actions.pod:24
23785 "This call checks for the existence of C<filename>. This stops you from "
23786 "specifying other types of drive which are supported by qemu such as C<nbd:> "
23787 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
23792 #: ../src/guestfs-actions.pod:31
23794 "If you just want to add an ISO file (often you use this as an efficient way "
23795 "to transfer large files into the guest), then you should probably use "
23796 "C<guestfs_add_drive_ro> instead."
23800 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140 ../src/guestfs-actions.pod:207 ../src/guestfs-actions.pod:244 ../src/guestfs-actions.pod:265 ../src/guestfs-actions.pod:286 ../src/guestfs-actions.pod:299 ../src/guestfs-actions.pod:313 ../src/guestfs-actions.pod:433 ../src/guestfs-actions.pod:453 ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:512 ../src/guestfs-actions.pod:540 ../src/guestfs-actions.pod:558 ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:658 ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:687 ../src/guestfs-actions.pod:786 ../src/guestfs-actions.pod:804 ../src/guestfs-actions.pod:818 ../src/guestfs-actions.pod:832 ../src/guestfs-actions.pod:869 ../src/guestfs-actions.pod:1052 ../src/guestfs-actions.pod:1072 ../src/guestfs-actions.pod:1090 ../src/guestfs-actions.pod:1180 ../src/guestfs-actions.pod:1239 ../src/guestfs-actions.pod:1285 ../src/guestfs-actions.pod:1325 ../src/guestfs-actions.pod:1376 ../src/guestfs-actions.pod:1427 ../src/guestfs-actions.pod:1483 ../src/guestfs-actions.pod:1535 ../src/guestfs-actions.pod:1554 ../src/guestfs-actions.pod:1568 ../src/guestfs-actions.pod:1596 ../src/guestfs-actions.pod:1666 ../src/guestfs-actions.pod:1697 ../src/guestfs-actions.pod:1722 ../src/guestfs-actions.pod:1764 ../src/guestfs-actions.pod:1877 ../src/guestfs-actions.pod:1904 ../src/guestfs-actions.pod:2119 ../src/guestfs-actions.pod:2141 ../src/guestfs-actions.pod:2228 ../src/guestfs-actions.pod:2736 ../src/guestfs-actions.pod:2880 ../src/guestfs-actions.pod:2941 ../src/guestfs-actions.pod:2976 ../src/guestfs-actions.pod:4033 ../src/guestfs-actions.pod:4048 ../src/guestfs-actions.pod:4073 ../src/guestfs-actions.pod:4262 ../src/guestfs-actions.pod:4276 ../src/guestfs-actions.pod:4289 ../src/guestfs-actions.pod:4303 ../src/guestfs-actions.pod:4318 ../src/guestfs-actions.pod:4354 ../src/guestfs-actions.pod:4426 ../src/guestfs-actions.pod:4446 ../src/guestfs-actions.pod:4463 ../src/guestfs-actions.pod:4486 ../src/guestfs-actions.pod:4509 ../src/guestfs-actions.pod:4544 ../src/guestfs-actions.pod:4563 ../src/guestfs-actions.pod:4582 ../src/guestfs-actions.pod:4617 ../src/guestfs-actions.pod:4629 ../src/guestfs-actions.pod:4665 ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:4694 ../src/guestfs-actions.pod:4709 ../src/guestfs-actions.pod:4726 ../src/guestfs-actions.pod:4819 ../src/guestfs-actions.pod:4839 ../src/guestfs-actions.pod:4852 ../src/guestfs-actions.pod:4903 ../src/guestfs-actions.pod:4921 ../src/guestfs-actions.pod:4939 ../src/guestfs-actions.pod:4955 ../src/guestfs-actions.pod:4969 ../src/guestfs-actions.pod:4983 ../src/guestfs-actions.pod:5000 ../src/guestfs-actions.pod:5015 ../src/guestfs-actions.pod:5042 ../src/guestfs-actions.pod:5105 ../src/guestfs-actions.pod:5178 ../src/guestfs-actions.pod:5209 ../src/guestfs-actions.pod:5228 ../src/guestfs-actions.pod:5247 ../src/guestfs-actions.pod:5259 ../src/guestfs-actions.pod:5276 ../src/guestfs-actions.pod:5289 ../src/guestfs-actions.pod:5304 ../src/guestfs-actions.pod:5319 ../src/guestfs-actions.pod:5351 ../src/guestfs-actions.pod:5377 ../src/guestfs-actions.pod:5416 ../src/guestfs-actions.pod:5436 ../src/guestfs-actions.pod:5450 ../src/guestfs-actions.pod:5467 ../src/guestfs-actions.pod:5516 ../src/guestfs-actions.pod:5569 ../src/guestfs-actions.pod:5616 ../src/guestfs-actions.pod:5659 ../src/guestfs-actions.pod:5687 ../src/guestfs-actions.pod:5704 ../src/guestfs-actions.pod:5722 ../src/guestfs-actions.pod:5862 ../src/guestfs-actions.pod:5919 ../src/guestfs-actions.pod:5941 ../src/guestfs-actions.pod:5959 ../src/guestfs-actions.pod:6009 ../src/guestfs-actions.pod:6075 ../src/guestfs-actions.pod:6092 ../src/guestfs-actions.pod:6105 ../src/guestfs-actions.pod:6119 ../src/guestfs-actions.pod:6408 ../src/guestfs-actions.pod:6427 ../src/guestfs-actions.pod:6446 ../src/guestfs-actions.pod:6460 ../src/guestfs-actions.pod:6472 ../src/guestfs-actions.pod:6486 ../src/guestfs-actions.pod:6498 ../src/guestfs-actions.pod:6512 ../src/guestfs-actions.pod:6528 ../src/guestfs-actions.pod:6549 ../src/guestfs-actions.pod:6568 ../src/guestfs-actions.pod:6587 ../src/guestfs-actions.pod:6617 ../src/guestfs-actions.pod:6635 ../src/guestfs-actions.pod:6658 ../src/guestfs-actions.pod:6676 ../src/guestfs-actions.pod:6695 ../src/guestfs-actions.pod:6716 ../src/guestfs-actions.pod:6735 ../src/guestfs-actions.pod:6752 ../src/guestfs-actions.pod:6771 ../src/guestfs-actions.pod:6799 ../src/guestfs-actions.pod:6823 ../src/guestfs-actions.pod:6842 ../src/guestfs-actions.pod:6858 ../src/guestfs-actions.pod:6882 ../src/guestfs-actions.pod:6901 ../src/guestfs-actions.pod:6916 ../src/guestfs-actions.pod:6935 ../src/guestfs-actions.pod:6979 ../src/guestfs-actions.pod:7009 ../src/guestfs-actions.pod:7042 ../src/guestfs-actions.pod:7157 ../src/guestfs-actions.pod:7278 ../src/guestfs-actions.pod:7290 ../src/guestfs-actions.pod:7303 ../src/guestfs-actions.pod:7316 ../src/guestfs-actions.pod:7338 ../src/guestfs-actions.pod:7351 ../src/guestfs-actions.pod:7364 ../src/guestfs-actions.pod:7377 ../src/guestfs-actions.pod:7392 ../src/guestfs-actions.pod:7451 ../src/guestfs-actions.pod:7468 ../src/guestfs-actions.pod:7484 ../src/guestfs-actions.pod:7500 ../src/guestfs-actions.pod:7517 ../src/guestfs-actions.pod:7530 ../src/guestfs-actions.pod:7550 ../src/guestfs-actions.pod:7586 ../src/guestfs-actions.pod:7600 ../src/guestfs-actions.pod:7641 ../src/guestfs-actions.pod:7654 ../src/guestfs-actions.pod:7672 ../src/guestfs-actions.pod:7706 ../src/guestfs-actions.pod:7742 ../src/guestfs-actions.pod:7858 ../src/guestfs-actions.pod:7873 ../src/guestfs-actions.pod:7887 ../src/guestfs-actions.pod:7942 ../src/guestfs-actions.pod:7955 ../src/guestfs-actions.pod:8000 ../src/guestfs-actions.pod:8040 ../src/guestfs-actions.pod:8096 ../src/guestfs-actions.pod:8116 ../src/guestfs-actions.pod:8149 ../src/guestfs-actions.pod:8213 ../src/guestfs-actions.pod:8236 ../src/guestfs-actions.pod:8265
23801 msgid "This function returns 0 on success or -1 on error."
23805 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142 ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:2342 ../src/guestfs-actions.pod:2440 ../src/guestfs-actions.pod:2565 ../src/guestfs-actions.pod:4035 ../src/guestfs-actions.pod:4055 ../src/guestfs-actions.pod:5353 ../src/guestfs-actions.pod:6637 ../src/guestfs-actions.pod:6754 ../src/guestfs-actions.pod:6903 ../src/guestfs-actions.pod:7394 ../src/guestfs-actions.pod:7519 ../src/guestfs-actions.pod:8042
23806 msgid "(Added in 0.3)"
23810 #: ../src/guestfs-actions.pod:41
23811 msgid "guestfs_add_domain"
23815 #: ../src/guestfs-actions.pod:43
23819 " guestfs_add_domain (guestfs_h *g,\n"
23820 " const char *dom,\n"
23826 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151 ../src/guestfs-actions.pod:843 ../src/guestfs-actions.pod:1167 ../src/guestfs-actions.pod:1219 ../src/guestfs-actions.pod:1297 ../src/guestfs-actions.pod:1364 ../src/guestfs-actions.pod:1415 ../src/guestfs-actions.pod:1466 ../src/guestfs-actions.pod:3233 ../src/guestfs-actions.pod:5054 ../src/guestfs-actions.pod:5363 ../src/guestfs-actions.pod:5580
23828 "You may supply a list of optional arguments to this call. Use zero or more "
23829 "of the following pairs of parameters, and terminate the list with C<-1> on "
23830 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
23834 #: ../src/guestfs-actions.pod:53
23837 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
23838 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
23839 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
23840 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
23841 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
23846 #: ../src/guestfs-actions.pod:59
23848 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
23849 "It works by connecting to libvirt, requesting the domain and domain XML from "
23850 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
23855 #: ../src/guestfs-actions.pod:94
23857 "The other optional parameters are passed directly through to "
23858 "C<guestfs_add_drive_opts>."
23862 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:356 ../src/guestfs-actions.pod:526 ../src/guestfs-actions.pod:704 ../src/guestfs-actions.pod:735 ../src/guestfs-actions.pod:753 ../src/guestfs-actions.pod:772 ../src/guestfs-actions.pod:1742 ../src/guestfs-actions.pod:2098 ../src/guestfs-actions.pod:2301 ../src/guestfs-actions.pod:2412 ../src/guestfs-actions.pod:2463 ../src/guestfs-actions.pod:2515 ../src/guestfs-actions.pod:2529 ../src/guestfs-actions.pod:2552 ../src/guestfs-actions.pod:2867 ../src/guestfs-actions.pod:3351 ../src/guestfs-actions.pod:3369 ../src/guestfs-actions.pod:5539 ../src/guestfs-actions.pod:5759 ../src/guestfs-actions.pod:5997 ../src/guestfs-actions.pod:6189 ../src/guestfs-actions.pod:6215 ../src/guestfs-actions.pod:7627 ../src/guestfs-actions.pod:8053 ../src/guestfs-actions.pod:8066 ../src/guestfs-actions.pod:8079
23863 msgid "On error this function returns -1."
23867 #: ../src/guestfs-actions.pod:99
23868 msgid "(Added in 1.7.4)"
23872 #: ../src/guestfs-actions.pod:101
23873 msgid "guestfs_add_domain_va"
23877 #: ../src/guestfs-actions.pod:103
23881 " guestfs_add_domain_va (guestfs_h *g,\n"
23882 " const char *dom,\n"
23883 " va_list args);\n"
23888 #: ../src/guestfs-actions.pod:108
23889 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
23893 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:220 ../src/guestfs-actions.pod:231 ../src/guestfs-actions.pod:882 ../src/guestfs-actions.pod:893 ../src/guestfs-actions.pod:1195 ../src/guestfs-actions.pod:1208 ../src/guestfs-actions.pod:1254 ../src/guestfs-actions.pod:1267 ../src/guestfs-actions.pod:1342 ../src/guestfs-actions.pod:1354 ../src/guestfs-actions.pod:1393 ../src/guestfs-actions.pod:1405 ../src/guestfs-actions.pod:1444 ../src/guestfs-actions.pod:1456 ../src/guestfs-actions.pod:1500 ../src/guestfs-actions.pod:1512 ../src/guestfs-actions.pod:3317 ../src/guestfs-actions.pod:3329 ../src/guestfs-actions.pod:5119 ../src/guestfs-actions.pod:5131 ../src/guestfs-actions.pod:5391 ../src/guestfs-actions.pod:5403 ../src/guestfs-actions.pod:5629 ../src/guestfs-actions.pod:5640
23894 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
23898 #: ../src/guestfs-actions.pod:112
23899 msgid "guestfs_add_domain_argv"
23903 #: ../src/guestfs-actions.pod:114
23907 " guestfs_add_domain_argv (guestfs_h *g,\n"
23908 " const char *dom,\n"
23909 " const struct guestfs_add_domain_argv *optargs);\n"
23914 #: ../src/guestfs-actions.pod:119
23915 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
23919 #: ../src/guestfs-actions.pod:123
23920 msgid "guestfs_add_drive"
23924 #: ../src/guestfs-actions.pod:125
23928 " guestfs_add_drive (guestfs_h *g,\n"
23929 " const char *filename);\n"
23934 #: ../src/guestfs-actions.pod:129
23936 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
23937 "optional parameters, so the disk is added writable, with the format being "
23938 "detected automatically."
23942 #: ../src/guestfs-actions.pod:133
23944 "Automatic detection of the format opens you up to a potential security hole "
23945 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
23946 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
23947 "you should think about replacing calls to this function with calls to "
23948 "C<guestfs_add_drive_opts>, and specifying the format."
23952 #: ../src/guestfs-actions.pod:144
23953 msgid "guestfs_add_drive_opts"
23957 #: ../src/guestfs-actions.pod:146
23961 " guestfs_add_drive_opts (guestfs_h *g,\n"
23962 " const char *filename,\n"
23968 #: ../src/guestfs-actions.pod:156
23971 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
23972 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
23973 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
23974 " GUESTFS_ADD_DRIVE_OPTS_NAME, const char *name,\n"
23979 #: ../src/guestfs-actions.pod:186
23981 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
23982 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
23983 "Possible formats include C<raw> and C<qcow2>."
23987 #: ../src/guestfs-actions.pod:197
23989 "This rarely-used option lets you emulate the behaviour of the deprecated "
23990 "C<guestfs_add_drive_with_if> call (q.v.)"
23994 #: ../src/guestfs-actions.pod:209
23995 msgid "(Added in 1.5.23)"
23999 #: ../src/guestfs-actions.pod:211
24000 msgid "guestfs_add_drive_opts_va"
24004 #: ../src/guestfs-actions.pod:213
24008 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
24009 " const char *filename,\n"
24010 " va_list args);\n"
24015 #: ../src/guestfs-actions.pod:218
24016 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
24020 #: ../src/guestfs-actions.pod:222
24021 msgid "guestfs_add_drive_opts_argv"
24025 #: ../src/guestfs-actions.pod:224
24029 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
24030 " const char *filename,\n"
24031 " const struct guestfs_add_drive_opts_argv "
24037 #: ../src/guestfs-actions.pod:229
24038 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
24042 #: ../src/guestfs-actions.pod:233
24043 msgid "guestfs_add_drive_ro"
24047 #: ../src/guestfs-actions.pod:235
24051 " guestfs_add_drive_ro (guestfs_h *g,\n"
24052 " const char *filename);\n"
24057 #: ../src/guestfs-actions.pod:239
24059 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
24060 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
24061 "disk is added read-only, with the format being detected automatically."
24065 #: ../src/guestfs-actions.pod:246
24066 msgid "(Added in 1.0.38)"
24070 #: ../src/guestfs-actions.pod:248
24071 msgid "guestfs_add_drive_ro_with_if"
24075 #: ../src/guestfs-actions.pod:250
24079 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
24080 " const char *filename,\n"
24081 " const char *iface);\n"
24086 #: ../src/guestfs-actions.pod:262
24088 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
24089 "QEMU interface emulation to use at run time."
24093 #: ../src/guestfs-actions.pod:267 ../src/guestfs-actions.pod:288 ../src/guestfs-actions.pod:2826
24094 msgid "(Added in 1.0.84)"
24098 #: ../src/guestfs-actions.pod:269
24099 msgid "guestfs_add_drive_with_if"
24103 #: ../src/guestfs-actions.pod:271
24107 " guestfs_add_drive_with_if (guestfs_h *g,\n"
24108 " const char *filename,\n"
24109 " const char *iface);\n"
24114 #: ../src/guestfs-actions.pod:283
24116 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
24117 "QEMU interface emulation to use at run time."
24121 #: ../src/guestfs-actions.pod:290
24122 msgid "guestfs_aug_clear"
24126 #: ../src/guestfs-actions.pod:292
24130 " guestfs_aug_clear (guestfs_h *g,\n"
24131 " const char *augpath);\n"
24136 #: ../src/guestfs-actions.pod:301 ../src/guestfs-actions.pod:2554
24137 msgid "(Added in 1.3.4)"
24141 #: ../src/guestfs-actions.pod:303
24142 msgid "guestfs_aug_close"
24146 #: ../src/guestfs-actions.pod:305
24150 " guestfs_aug_close (guestfs_h *g);\n"
24155 #: ../src/guestfs-actions.pod:308
24157 "Close the current Augeas handle and free up any resources used by it. After "
24158 "calling this, you have to call C<guestfs_aug_init> again before you can use "
24159 "any other Augeas functions."
24163 #: ../src/guestfs-actions.pod:315 ../src/guestfs-actions.pod:340 ../src/guestfs-actions.pod:358 ../src/guestfs-actions.pod:372 ../src/guestfs-actions.pod:435 ../src/guestfs-actions.pod:455 ../src/guestfs-actions.pod:469 ../src/guestfs-actions.pod:500 ../src/guestfs-actions.pod:514 ../src/guestfs-actions.pod:528 ../src/guestfs-actions.pod:542 ../src/guestfs-actions.pod:560 ../src/guestfs-actions.pod:6266
24164 msgid "(Added in 0.7)"
24168 #: ../src/guestfs-actions.pod:317
24169 msgid "guestfs_aug_defnode"
24173 #: ../src/guestfs-actions.pod:319
24176 " struct guestfs_int_bool *\n"
24177 " guestfs_aug_defnode (guestfs_h *g,\n"
24178 " const char *name,\n"
24179 " const char *expr,\n"
24180 " const char *val);\n"
24185 #: ../src/guestfs-actions.pod:328
24187 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
24188 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
24189 "containing that single node."
24193 #: ../src/guestfs-actions.pod:336
24195 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
24196 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
24200 #: ../src/guestfs-actions.pod:342
24201 msgid "guestfs_aug_defvar"
24205 #: ../src/guestfs-actions.pod:344
24209 " guestfs_aug_defvar (guestfs_h *g,\n"
24210 " const char *name,\n"
24211 " const char *expr);\n"
24216 #: ../src/guestfs-actions.pod:360
24217 msgid "guestfs_aug_get"
24221 #: ../src/guestfs-actions.pod:362
24225 " guestfs_aug_get (guestfs_h *g,\n"
24226 " const char *augpath);\n"
24231 #: ../src/guestfs-actions.pod:369 ../src/guestfs-actions.pod:933 ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:1011 ../src/guestfs-actions.pod:1027 ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1611 ../src/guestfs-actions.pod:1628 ../src/guestfs-actions.pod:1647 ../src/guestfs-actions.pod:1781 ../src/guestfs-actions.pod:1969 ../src/guestfs-actions.pod:2081 ../src/guestfs-actions.pod:2244 ../src/guestfs-actions.pod:2261 ../src/guestfs-actions.pod:2328 ../src/guestfs-actions.pod:2371 ../src/guestfs-actions.pod:2392 ../src/guestfs-actions.pod:2577 ../src/guestfs-actions.pod:2791 ../src/guestfs-actions.pod:2995 ../src/guestfs-actions.pod:3097 ../src/guestfs-actions.pod:3201 ../src/guestfs-actions.pod:3220 ../src/guestfs-actions.pod:3435 ../src/guestfs-actions.pod:3463 ../src/guestfs-actions.pod:3484 ../src/guestfs-actions.pod:3518 ../src/guestfs-actions.pod:3581 ../src/guestfs-actions.pod:3601 ../src/guestfs-actions.pod:3621 ../src/guestfs-actions.pod:4248 ../src/guestfs-actions.pod:4601 ../src/guestfs-actions.pod:4771 ../src/guestfs-actions.pod:4881 ../src/guestfs-actions.pod:5777 ../src/guestfs-actions.pod:5978 ../src/guestfs-actions.pod:6164 ../src/guestfs-actions.pod:6342 ../src/guestfs-actions.pod:6391 ../src/guestfs-actions.pod:7063 ../src/guestfs-actions.pod:7079 ../src/guestfs-actions.pod:7103 ../src/guestfs-actions.pod:7127 ../src/guestfs-actions.pod:7801 ../src/guestfs-actions.pod:7820 ../src/guestfs-actions.pod:7838 ../src/guestfs-actions.pod:8012 ../src/guestfs-actions.pod:8329
24233 "This function returns a string, or NULL on error. I<The caller must free "
24234 "the returned string after use>."
24238 #: ../src/guestfs-actions.pod:374
24239 msgid "guestfs_aug_init"
24243 #: ../src/guestfs-actions.pod:376
24247 " guestfs_aug_init (guestfs_h *g,\n"
24248 " const char *root,\n"
24254 #: ../src/guestfs-actions.pod:385
24255 msgid "You must call this before using any other C<guestfs_aug_*> commands."
24259 #: ../src/guestfs-actions.pod:410
24261 "This option is only useful when debugging Augeas lenses. Use of this option "
24262 "may require additional memory for the libguestfs appliance. You may need to "
24263 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
24264 "C<guestfs_set_memsize>."
24268 #: ../src/guestfs-actions.pod:425
24269 msgid "Do not load the tree in C<guestfs_aug_init>."
24273 #: ../src/guestfs-actions.pod:429
24274 msgid "To close the handle, you can call C<guestfs_aug_close>."
24278 #: ../src/guestfs-actions.pod:437
24279 msgid "guestfs_aug_insert"
24283 #: ../src/guestfs-actions.pod:439
24287 " guestfs_aug_insert (guestfs_h *g,\n"
24288 " const char *augpath,\n"
24289 " const char *label,\n"
24295 #: ../src/guestfs-actions.pod:457
24296 msgid "guestfs_aug_load"
24300 #: ../src/guestfs-actions.pod:459
24304 " guestfs_aug_load (guestfs_h *g);\n"
24309 #: ../src/guestfs-actions.pod:471
24310 msgid "guestfs_aug_ls"
24314 #: ../src/guestfs-actions.pod:473
24318 " guestfs_aug_ls (guestfs_h *g,\n"
24319 " const char *augpath);\n"
24324 #: ../src/guestfs-actions.pod:477
24326 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
24327 "sorting the resulting nodes into alphabetical order."
24331 #: ../src/guestfs-actions.pod:480 ../src/guestfs-actions.pod:496 ../src/guestfs-actions.pod:642 ../src/guestfs-actions.pod:1149 ../src/guestfs-actions.pod:1796 ../src/guestfs-actions.pod:1815 ../src/guestfs-actions.pod:1918 ../src/guestfs-actions.pod:1937 ../src/guestfs-actions.pod:2183 ../src/guestfs-actions.pod:2649 ../src/guestfs-actions.pod:2665 ../src/guestfs-actions.pod:2684 ../src/guestfs-actions.pod:2749 ../src/guestfs-actions.pod:2773 ../src/guestfs-actions.pod:2844 ../src/guestfs-actions.pod:2893 ../src/guestfs-actions.pod:3162 ../src/guestfs-actions.pod:3537 ../src/guestfs-actions.pod:3817 ../src/guestfs-actions.pod:4131 ../src/guestfs-actions.pod:4148 ../src/guestfs-actions.pod:4168 ../src/guestfs-actions.pod:4230 ../src/guestfs-actions.pod:4335 ../src/guestfs-actions.pod:4743 ../src/guestfs-actions.pod:5500 ../src/guestfs-actions.pod:6136 ../src/guestfs-actions.pod:6262 ../src/guestfs-actions.pod:6376 ../src/guestfs-actions.pod:7143 ../src/guestfs-actions.pod:7204 ../src/guestfs-actions.pod:7259 ../src/guestfs-actions.pod:7405 ../src/guestfs-actions.pod:7429 ../src/guestfs-actions.pod:7905 ../src/guestfs-actions.pod:7925 ../src/guestfs-actions.pod:7972 ../src/guestfs-actions.pod:8166 ../src/guestfs-actions.pod:8185 ../src/guestfs-actions.pod:8279 ../src/guestfs-actions.pod:8298 ../src/guestfs-actions.pod:8344 ../src/guestfs-actions.pod:8363
24333 "This function returns a NULL-terminated array of strings (like "
24334 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
24335 "strings and the array after use>."
24339 #: ../src/guestfs-actions.pod:484 ../src/guestfs-actions.pod:1074 ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1853 ../src/guestfs-actions.pod:3895 ../src/guestfs-actions.pod:3926 ../src/guestfs-actions.pod:4584 ../src/guestfs-actions.pod:4634 ../src/guestfs-actions.pod:4821 ../src/guestfs-actions.pod:4854 ../src/guestfs-actions.pod:5017 ../src/guestfs-actions.pod:5504 ../src/guestfs-actions.pod:6077 ../src/guestfs-actions.pod:6474 ../src/guestfs-actions.pod:6488 ../src/guestfs-actions.pod:6500 ../src/guestfs-actions.pod:6984 ../src/guestfs-actions.pod:7643 ../src/guestfs-actions.pod:7656 ../src/guestfs-actions.pod:7889 ../src/guestfs-actions.pod:8154
24340 msgid "(Added in 0.8)"
24344 #: ../src/guestfs-actions.pod:486
24345 msgid "guestfs_aug_match"
24349 #: ../src/guestfs-actions.pod:488
24353 " guestfs_aug_match (guestfs_h *g,\n"
24354 " const char *augpath);\n"
24359 #: ../src/guestfs-actions.pod:502
24360 msgid "guestfs_aug_mv"
24364 #: ../src/guestfs-actions.pod:504
24368 " guestfs_aug_mv (guestfs_h *g,\n"
24369 " const char *src,\n"
24370 " const char *dest);\n"
24375 #: ../src/guestfs-actions.pod:516
24376 msgid "guestfs_aug_rm"
24380 #: ../src/guestfs-actions.pod:518
24384 " guestfs_aug_rm (guestfs_h *g,\n"
24385 " const char *augpath);\n"
24390 #: ../src/guestfs-actions.pod:530
24391 msgid "guestfs_aug_save"
24395 #: ../src/guestfs-actions.pod:532
24399 " guestfs_aug_save (guestfs_h *g);\n"
24404 #: ../src/guestfs-actions.pod:537
24406 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
24411 #: ../src/guestfs-actions.pod:544
24412 msgid "guestfs_aug_set"
24416 #: ../src/guestfs-actions.pod:546
24420 " guestfs_aug_set (guestfs_h *g,\n"
24421 " const char *augpath,\n"
24422 " const char *val);\n"
24427 #: ../src/guestfs-actions.pod:553
24429 "In the Augeas API, it is possible to clear a node by setting the value to "
24430 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
24431 "this call. Instead you must use the C<guestfs_aug_clear> call."
24435 #: ../src/guestfs-actions.pod:562
24436 msgid "guestfs_available"
24440 #: ../src/guestfs-actions.pod:564
24444 " guestfs_available (guestfs_h *g,\n"
24445 " char *const *groups);\n"
24450 #: ../src/guestfs-actions.pod:572
24452 "The libguestfs groups, and the functions that those groups correspond to, "
24453 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
24454 "runtime by calling C<guestfs_available_all_groups>."
24458 #: ../src/guestfs-actions.pod:596
24459 msgid "You must call C<guestfs_launch> before calling this function."
24463 #: ../src/guestfs-actions.pod:618
24465 "This call was added in version C<1.0.80>. In previous versions of "
24466 "libguestfs all you could do would be to speculatively execute a command to "
24467 "find out if the daemon implemented it. See also C<guestfs_version>."
24471 #: ../src/guestfs-actions.pod:627 ../src/guestfs-actions.pod:1598
24472 msgid "(Added in 1.0.80)"
24476 #: ../src/guestfs-actions.pod:629
24477 msgid "guestfs_available_all_groups"
24481 #: ../src/guestfs-actions.pod:631
24485 " guestfs_available_all_groups (guestfs_h *g);\n"
24490 #: ../src/guestfs-actions.pod:634
24492 "This command returns a list of all optional groups that this daemon knows "
24493 "about. Note this returns both supported and unsupported groups. To find "
24494 "out which ones the daemon can actually support you have to call "
24495 "C<guestfs_available> on each member of the returned list."
24499 #: ../src/guestfs-actions.pod:640
24500 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
24504 #: ../src/guestfs-actions.pod:646
24505 msgid "(Added in 1.3.15)"
24509 #: ../src/guestfs-actions.pod:648
24510 msgid "guestfs_base64_in"
24514 #: ../src/guestfs-actions.pod:650
24518 " guestfs_base64_in (guestfs_h *g,\n"
24519 " const char *base64file,\n"
24520 " const char *filename);\n"
24525 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:674
24526 msgid "(Added in 1.3.5)"
24530 #: ../src/guestfs-actions.pod:662
24531 msgid "guestfs_base64_out"
24535 #: ../src/guestfs-actions.pod:664
24539 " guestfs_base64_out (guestfs_h *g,\n"
24540 " const char *filename,\n"
24541 " const char *base64file);\n"
24546 #: ../src/guestfs-actions.pod:676
24547 msgid "guestfs_blockdev_flushbufs"
24551 #: ../src/guestfs-actions.pod:678
24555 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
24556 " const char *device);\n"
24561 #: ../src/guestfs-actions.pod:689 ../src/guestfs-actions.pod:706 ../src/guestfs-actions.pod:721 ../src/guestfs-actions.pod:737 ../src/guestfs-actions.pod:755 ../src/guestfs-actions.pod:774 ../src/guestfs-actions.pod:788 ../src/guestfs-actions.pod:806 ../src/guestfs-actions.pod:820 ../src/guestfs-actions.pod:834
24562 msgid "(Added in 0.9.3)"
24566 #: ../src/guestfs-actions.pod:691
24567 msgid "guestfs_blockdev_getbsz"
24571 #: ../src/guestfs-actions.pod:693
24575 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
24576 " const char *device);\n"
24581 #: ../src/guestfs-actions.pod:708
24582 msgid "guestfs_blockdev_getro"
24586 #: ../src/guestfs-actions.pod:710
24590 " guestfs_blockdev_getro (guestfs_h *g,\n"
24591 " const char *device);\n"
24596 #: ../src/guestfs-actions.pod:719 ../src/guestfs-actions.pod:1836 ../src/guestfs-actions.pod:1851 ../src/guestfs-actions.pod:2340 ../src/guestfs-actions.pod:2351 ../src/guestfs-actions.pod:2423 ../src/guestfs-actions.pod:2449 ../src/guestfs-actions.pod:2489 ../src/guestfs-actions.pod:2504 ../src/guestfs-actions.pod:2540 ../src/guestfs-actions.pod:2563 ../src/guestfs-actions.pod:3638 ../src/guestfs-actions.pod:3654 ../src/guestfs-actions.pod:3672 ../src/guestfs-actions.pod:3834 ../src/guestfs-actions.pod:3848 ../src/guestfs-actions.pod:3863 ../src/guestfs-actions.pod:3877 ../src/guestfs-actions.pod:3893 ../src/guestfs-actions.pod:3908 ../src/guestfs-actions.pod:3924 ../src/guestfs-actions.pod:3938 ../src/guestfs-actions.pod:3951 ../src/guestfs-actions.pod:3965 ../src/guestfs-actions.pod:3980 ../src/guestfs-actions.pod:3995 ../src/guestfs-actions.pod:4008 ../src/guestfs-actions.pod:4022 ../src/guestfs-actions.pod:5741
24597 msgid "This function returns a C truth value on success or -1 on error."
24601 #: ../src/guestfs-actions.pod:723
24602 msgid "guestfs_blockdev_getsize64"
24606 #: ../src/guestfs-actions.pod:725
24610 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
24611 " const char *device);\n"
24616 #: ../src/guestfs-actions.pod:731
24617 msgid "See also C<guestfs_blockdev_getsz>."
24621 #: ../src/guestfs-actions.pod:739
24622 msgid "guestfs_blockdev_getss"
24626 #: ../src/guestfs-actions.pod:741
24630 " guestfs_blockdev_getss (guestfs_h *g,\n"
24631 " const char *device);\n"
24636 #: ../src/guestfs-actions.pod:748
24638 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
24643 #: ../src/guestfs-actions.pod:757
24644 msgid "guestfs_blockdev_getsz"
24648 #: ../src/guestfs-actions.pod:759
24652 " guestfs_blockdev_getsz (guestfs_h *g,\n"
24653 " const char *device);\n"
24658 #: ../src/guestfs-actions.pod:766
24660 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
24661 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
24665 #: ../src/guestfs-actions.pod:776
24666 msgid "guestfs_blockdev_rereadpt"
24670 #: ../src/guestfs-actions.pod:778
24674 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
24675 " const char *device);\n"
24680 #: ../src/guestfs-actions.pod:790
24681 msgid "guestfs_blockdev_setbsz"
24685 #: ../src/guestfs-actions.pod:792
24689 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
24690 " const char *device,\n"
24691 " int blocksize);\n"
24696 #: ../src/guestfs-actions.pod:808
24697 msgid "guestfs_blockdev_setro"
24701 #: ../src/guestfs-actions.pod:810
24705 " guestfs_blockdev_setro (guestfs_h *g,\n"
24706 " const char *device);\n"
24711 #: ../src/guestfs-actions.pod:822
24712 msgid "guestfs_blockdev_setrw"
24716 #: ../src/guestfs-actions.pod:824
24720 " guestfs_blockdev_setrw (guestfs_h *g,\n"
24721 " const char *device);\n"
24726 #: ../src/guestfs-actions.pod:836
24727 msgid "guestfs_btrfs_filesystem_resize"
24731 #: ../src/guestfs-actions.pod:838
24735 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
24736 " const char *mountpoint,\n"
24742 #: ../src/guestfs-actions.pod:848
24745 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
24750 #: ../src/guestfs-actions.pod:871
24751 msgid "(Added in 1.11.17)"
24755 #: ../src/guestfs-actions.pod:873
24756 msgid "guestfs_btrfs_filesystem_resize_va"
24760 #: ../src/guestfs-actions.pod:875
24764 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
24765 " const char *mountpoint,\n"
24766 " va_list args);\n"
24771 #: ../src/guestfs-actions.pod:880
24772 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
24776 #: ../src/guestfs-actions.pod:884
24777 msgid "guestfs_btrfs_filesystem_resize_argv"
24781 #: ../src/guestfs-actions.pod:886
24785 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
24786 " const char *mountpoint,\n"
24788 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
24793 #: ../src/guestfs-actions.pod:891
24794 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
24798 #: ../src/guestfs-actions.pod:895
24799 msgid "guestfs_case_sensitive_path"
24803 #: ../src/guestfs-actions.pod:897
24807 " guestfs_case_sensitive_path (guestfs_h *g,\n"
24808 " const char *path);\n"
24813 #: ../src/guestfs-actions.pod:923
24815 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
24816 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
24817 "how the directories were originally created under Windows)."
24821 #: ../src/guestfs-actions.pod:931
24822 msgid "See also C<guestfs_realpath>."
24826 #: ../src/guestfs-actions.pod:936 ../src/guestfs-actions.pod:7823
24827 msgid "(Added in 1.0.75)"
24831 #: ../src/guestfs-actions.pod:938
24832 msgid "guestfs_cat"
24836 #: ../src/guestfs-actions.pod:940
24840 " guestfs_cat (guestfs_h *g,\n"
24841 " const char *path);\n"
24846 #: ../src/guestfs-actions.pod:946
24848 "Note that this function cannot correctly handle binary files (specifically, "
24849 "files containing C<\\0> character which is treated as end of string). For "
24850 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
24851 "functions which have a more complex interface."
24855 #: ../src/guestfs-actions.pod:957 ../src/guestfs-actions.pod:4152 ../src/guestfs-actions.pod:4234 ../src/guestfs-actions.pod:4251 ../src/guestfs-actions.pod:4339 ../src/guestfs-actions.pod:4747 ../src/guestfs-actions.pod:4761 ../src/guestfs-actions.pod:6140 ../src/guestfs-actions.pod:6154 ../src/guestfs-actions.pod:7976 ../src/guestfs-actions.pod:7990
24856 msgid "(Added in 0.4)"
24860 #: ../src/guestfs-actions.pod:959
24861 msgid "guestfs_checksum"
24865 #: ../src/guestfs-actions.pod:961
24869 " guestfs_checksum (guestfs_h *g,\n"
24870 " const char *csumtype,\n"
24871 " const char *path);\n"
24876 #: ../src/guestfs-actions.pod:1007
24877 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
24881 #: ../src/guestfs-actions.pod:1009
24882 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
24886 #: ../src/guestfs-actions.pod:1014 ../src/guestfs-actions.pod:1673 ../src/guestfs-actions.pod:2531 ../src/guestfs-actions.pod:3850 ../src/guestfs-actions.pod:3879 ../src/guestfs-actions.pod:3940 ../src/guestfs-actions.pod:3967 ../src/guestfs-actions.pod:7679
24887 msgid "(Added in 1.0.2)"
24891 #: ../src/guestfs-actions.pod:1016
24892 msgid "guestfs_checksum_device"
24896 #: ../src/guestfs-actions.pod:1018
24900 " guestfs_checksum_device (guestfs_h *g,\n"
24901 " const char *csumtype,\n"
24902 " const char *device);\n"
24907 #: ../src/guestfs-actions.pod:1023
24909 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
24910 "device named C<device>. For the types of checksums supported see the "
24911 "C<guestfs_checksum> command."
24915 #: ../src/guestfs-actions.pod:1030 ../src/guestfs-actions.pod:5571 ../src/guestfs-actions.pod:5706 ../src/guestfs-actions.pod:5743 ../src/guestfs-actions.pod:5761 ../src/guestfs-actions.pod:5943 ../src/guestfs-actions.pod:7588 ../src/guestfs-actions.pod:7602 ../src/guestfs-actions.pod:8002
24916 msgid "(Added in 1.3.2)"
24920 #: ../src/guestfs-actions.pod:1032
24921 msgid "guestfs_checksums_out"
24925 #: ../src/guestfs-actions.pod:1034
24929 " guestfs_checksums_out (guestfs_h *g,\n"
24930 " const char *csumtype,\n"
24931 " const char *directory,\n"
24932 " const char *sumsfile);\n"
24937 #: ../src/guestfs-actions.pod:1054
24938 msgid "(Added in 1.3.7)"
24942 #: ../src/guestfs-actions.pod:1056
24943 msgid "guestfs_chmod"
24947 #: ../src/guestfs-actions.pod:1058
24951 " guestfs_chmod (guestfs_h *g,\n"
24953 " const char *path);\n"
24958 #: ../src/guestfs-actions.pod:1076
24959 msgid "guestfs_chown"
24963 #: ../src/guestfs-actions.pod:1078
24967 " guestfs_chown (guestfs_h *g,\n"
24970 " const char *path);\n"
24975 #: ../src/guestfs-actions.pod:1094
24976 msgid "guestfs_command"
24980 #: ../src/guestfs-actions.pod:1096
24984 " guestfs_command (guestfs_h *g,\n"
24985 " char *const *arguments);\n"
24990 #: ../src/guestfs-actions.pod:1105
24992 "The single parameter is an argv-style list of arguments. The first element "
24993 "is the name of the program to run. Subsequent elements are parameters. The "
24994 "list must be non-empty (ie. must contain a program name). Note that the "
24995 "command runs directly, and is I<not> invoked via the shell (see "
25000 #: ../src/guestfs-actions.pod:1136 ../src/guestfs-actions.pod:1156 ../src/guestfs-actions.pod:1972
25001 msgid "(Added in 0.9.1)"
25005 #: ../src/guestfs-actions.pod:1138
25006 msgid "guestfs_command_lines"
25010 #: ../src/guestfs-actions.pod:1140
25014 " guestfs_command_lines (guestfs_h *g,\n"
25015 " char *const *arguments);\n"
25020 #: ../src/guestfs-actions.pod:1144
25022 "This is the same as C<guestfs_command>, but splits the result into a list of "
25027 #: ../src/guestfs-actions.pod:1147
25028 msgid "See also: C<guestfs_sh_lines>"
25032 #: ../src/guestfs-actions.pod:1158
25033 msgid "guestfs_compress_device_out"
25037 #: ../src/guestfs-actions.pod:1160
25041 " guestfs_compress_device_out (guestfs_h *g,\n"
25042 " const char *ctype,\n"
25043 " const char *device,\n"
25044 " const char *zdevice,\n"
25050 #: ../src/guestfs-actions.pod:1172
25053 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
25058 #: ../src/guestfs-actions.pod:1177
25060 "The C<ctype> and optional C<level> parameters have the same meaning as in "
25061 "C<guestfs_compress_out>."
25065 #: ../src/guestfs-actions.pod:1182 ../src/guestfs-actions.pod:1241 ../src/guestfs-actions.pod:2517 ../src/guestfs-actions.pod:6860
25066 msgid "(Added in 1.13.15)"
25070 #: ../src/guestfs-actions.pod:1184
25071 msgid "guestfs_compress_device_out_va"
25075 #: ../src/guestfs-actions.pod:1186
25079 " guestfs_compress_device_out_va (guestfs_h *g,\n"
25080 " const char *ctype,\n"
25081 " const char *device,\n"
25082 " const char *zdevice,\n"
25083 " va_list args);\n"
25088 #: ../src/guestfs-actions.pod:1193
25089 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
25093 #: ../src/guestfs-actions.pod:1197
25094 msgid "guestfs_compress_device_out_argv"
25098 #: ../src/guestfs-actions.pod:1199
25102 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
25103 " const char *ctype,\n"
25104 " const char *device,\n"
25105 " const char *zdevice,\n"
25107 "guestfs_compress_device_out_argv *optargs);\n"
25112 #: ../src/guestfs-actions.pod:1206
25113 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
25117 #: ../src/guestfs-actions.pod:1210
25118 msgid "guestfs_compress_out"
25122 #: ../src/guestfs-actions.pod:1212
25126 " guestfs_compress_out (guestfs_h *g,\n"
25127 " const char *ctype,\n"
25128 " const char *file,\n"
25129 " const char *zfile,\n"
25135 #: ../src/guestfs-actions.pod:1224
25138 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
25143 #: ../src/guestfs-actions.pod:1243
25144 msgid "guestfs_compress_out_va"
25148 #: ../src/guestfs-actions.pod:1245
25152 " guestfs_compress_out_va (guestfs_h *g,\n"
25153 " const char *ctype,\n"
25154 " const char *file,\n"
25155 " const char *zfile,\n"
25156 " va_list args);\n"
25161 #: ../src/guestfs-actions.pod:1252
25162 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
25166 #: ../src/guestfs-actions.pod:1256
25167 msgid "guestfs_compress_out_argv"
25171 #: ../src/guestfs-actions.pod:1258
25175 " guestfs_compress_out_argv (guestfs_h *g,\n"
25176 " const char *ctype,\n"
25177 " const char *file,\n"
25178 " const char *zfile,\n"
25179 " const struct guestfs_compress_out_argv "
25185 #: ../src/guestfs-actions.pod:1265
25186 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
25190 #: ../src/guestfs-actions.pod:1269
25191 msgid "guestfs_config"
25195 #: ../src/guestfs-actions.pod:1271
25199 " guestfs_config (guestfs_h *g,\n"
25200 " const char *qemuparam,\n"
25201 " const char *qemuvalue);\n"
25206 #: ../src/guestfs-actions.pod:1289
25207 msgid "guestfs_copy_device_to_device"
25211 #: ../src/guestfs-actions.pod:1291
25215 " guestfs_copy_device_to_device (guestfs_h *g,\n"
25216 " const char *src,\n"
25217 " const char *dest,\n"
25223 #: ../src/guestfs-actions.pod:1302
25226 " GUESTFS_COPY_DEVICE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
25227 " GUESTFS_COPY_DEVICE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
25228 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, int64_t size,\n"
25233 #: ../src/guestfs-actions.pod:1306
25235 "The four calls C<guestfs_copy_device_to_device>, "
25236 "C<guestfs_copy_device_to_file>, C<guestfs_copy_file_to_device>, and "
25237 "C<guestfs_copy_file_to_file> let you copy from a source (device|file) to a "
25238 "destination (device|file)."
25242 #: ../src/guestfs-actions.pod:1327 ../src/guestfs-actions.pod:1378 ../src/guestfs-actions.pod:1429 ../src/guestfs-actions.pod:1485 ../src/guestfs-actions.pod:1537 ../src/guestfs-actions.pod:1668 ../src/guestfs-actions.pod:1699 ../src/guestfs-actions.pod:1744 ../src/guestfs-actions.pod:2121 ../src/guestfs-actions.pod:2143 ../src/guestfs-actions.pod:4050 ../src/guestfs-actions.pod:7674 ../src/guestfs-actions.pod:7708 ../src/guestfs-actions.pod:8215 ../src/guestfs-actions.pod:8238
25244 "This long-running command can generate progress notification messages so "
25245 "that the caller can display a progress bar or indicator. To receive these "
25246 "messages, the caller must register a progress event callback. See "
25247 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
25251 #: ../src/guestfs-actions.pod:1332
25252 msgid "guestfs_copy_device_to_device_va"
25256 #: ../src/guestfs-actions.pod:1334
25260 " guestfs_copy_device_to_device_va (guestfs_h *g,\n"
25261 " const char *src,\n"
25262 " const char *dest,\n"
25263 " va_list args);\n"
25268 #: ../src/guestfs-actions.pod:1340
25269 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_device>."
25273 #: ../src/guestfs-actions.pod:1344
25274 msgid "guestfs_copy_device_to_device_argv"
25278 #: ../src/guestfs-actions.pod:1346
25282 " guestfs_copy_device_to_device_argv (guestfs_h *g,\n"
25283 " const char *src,\n"
25284 " const char *dest,\n"
25286 "guestfs_copy_device_to_device_argv *optargs);\n"
25291 #: ../src/guestfs-actions.pod:1352
25292 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_device>."
25296 #: ../src/guestfs-actions.pod:1356
25297 msgid "guestfs_copy_device_to_file"
25301 #: ../src/guestfs-actions.pod:1358
25305 " guestfs_copy_device_to_file (guestfs_h *g,\n"
25306 " const char *src,\n"
25307 " const char *dest,\n"
25313 #: ../src/guestfs-actions.pod:1369
25316 " GUESTFS_COPY_DEVICE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
25317 " GUESTFS_COPY_DEVICE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
25318 " GUESTFS_COPY_DEVICE_TO_FILE_SIZE, int64_t size,\n"
25323 #: ../src/guestfs-actions.pod:1373 ../src/guestfs-actions.pod:1424 ../src/guestfs-actions.pod:1475
25324 msgid "See C<guestfs_copy_device_to_device> for a general overview of this call."
25328 #: ../src/guestfs-actions.pod:1383
25329 msgid "guestfs_copy_device_to_file_va"
25333 #: ../src/guestfs-actions.pod:1385
25337 " guestfs_copy_device_to_file_va (guestfs_h *g,\n"
25338 " const char *src,\n"
25339 " const char *dest,\n"
25340 " va_list args);\n"
25345 #: ../src/guestfs-actions.pod:1391
25346 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_file>."
25350 #: ../src/guestfs-actions.pod:1395
25351 msgid "guestfs_copy_device_to_file_argv"
25355 #: ../src/guestfs-actions.pod:1397
25359 " guestfs_copy_device_to_file_argv (guestfs_h *g,\n"
25360 " const char *src,\n"
25361 " const char *dest,\n"
25363 "guestfs_copy_device_to_file_argv *optargs);\n"
25368 #: ../src/guestfs-actions.pod:1403
25369 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_file>."
25373 #: ../src/guestfs-actions.pod:1407
25374 msgid "guestfs_copy_file_to_device"
25378 #: ../src/guestfs-actions.pod:1409
25382 " guestfs_copy_file_to_device (guestfs_h *g,\n"
25383 " const char *src,\n"
25384 " const char *dest,\n"
25390 #: ../src/guestfs-actions.pod:1420
25393 " GUESTFS_COPY_FILE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
25394 " GUESTFS_COPY_FILE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
25395 " GUESTFS_COPY_FILE_TO_DEVICE_SIZE, int64_t size,\n"
25400 #: ../src/guestfs-actions.pod:1434
25401 msgid "guestfs_copy_file_to_device_va"
25405 #: ../src/guestfs-actions.pod:1436
25409 " guestfs_copy_file_to_device_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:1442
25418 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_device>."
25422 #: ../src/guestfs-actions.pod:1446
25423 msgid "guestfs_copy_file_to_device_argv"
25427 #: ../src/guestfs-actions.pod:1448
25431 " guestfs_copy_file_to_device_argv (guestfs_h *g,\n"
25432 " const char *src,\n"
25433 " const char *dest,\n"
25435 "guestfs_copy_file_to_device_argv *optargs);\n"
25440 #: ../src/guestfs-actions.pod:1454
25441 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_device>."
25445 #: ../src/guestfs-actions.pod:1458
25446 msgid "guestfs_copy_file_to_file"
25450 #: ../src/guestfs-actions.pod:1460
25454 " guestfs_copy_file_to_file (guestfs_h *g,\n"
25455 " const char *src,\n"
25456 " const char *dest,\n"
25462 #: ../src/guestfs-actions.pod:1471
25465 " GUESTFS_COPY_FILE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
25466 " GUESTFS_COPY_FILE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
25467 " GUESTFS_COPY_FILE_TO_FILE_SIZE, int64_t size,\n"
25472 #: ../src/guestfs-actions.pod:1478
25474 "This is B<not> the function you want for copying files. This is for copying "
25475 "blocks within existing files. See C<guestfs_cp>, C<guestfs_cp_a> and "
25476 "C<guestfs_mv> for general file copying and moving functions."
25480 #: ../src/guestfs-actions.pod:1490
25481 msgid "guestfs_copy_file_to_file_va"
25485 #: ../src/guestfs-actions.pod:1492
25489 " guestfs_copy_file_to_file_va (guestfs_h *g,\n"
25490 " const char *src,\n"
25491 " const char *dest,\n"
25492 " va_list args);\n"
25497 #: ../src/guestfs-actions.pod:1498
25498 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_file>."
25502 #: ../src/guestfs-actions.pod:1502
25503 msgid "guestfs_copy_file_to_file_argv"
25507 #: ../src/guestfs-actions.pod:1504
25511 " guestfs_copy_file_to_file_argv (guestfs_h *g,\n"
25512 " const char *src,\n"
25513 " const char *dest,\n"
25514 " const struct guestfs_copy_file_to_file_argv "
25520 #: ../src/guestfs-actions.pod:1510
25521 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_file>."
25525 #: ../src/guestfs-actions.pod:1514
25526 msgid "guestfs_copy_size"
25530 #: ../src/guestfs-actions.pod:1516
25534 " guestfs_copy_size (guestfs_h *g,\n"
25535 " const char *src,\n"
25536 " const char *dest,\n"
25537 " int64_t size);\n"
25542 #: ../src/guestfs-actions.pod:1522 ../src/guestfs-actions.pod:1579
25544 "I<This function is deprecated.> In new code, use the "
25545 "L</guestfs_copy_device_to_device> call instead."
25549 #: ../src/guestfs-actions.pod:1542 ../src/guestfs-actions.pod:4774 ../src/guestfs-actions.pod:6167 ../src/guestfs-actions.pod:7909 ../src/guestfs-actions.pod:7929 ../src/guestfs-actions.pod:8015
25550 msgid "(Added in 1.0.87)"
25554 #: ../src/guestfs-actions.pod:1544
25559 #: ../src/guestfs-actions.pod:1546
25563 " guestfs_cp (guestfs_h *g,\n"
25564 " const char *src,\n"
25565 " const char *dest);\n"
25570 #: ../src/guestfs-actions.pod:1556 ../src/guestfs-actions.pod:1570 ../src/guestfs-actions.pod:1650 ../src/guestfs-actions.pod:1724 ../src/guestfs-actions.pod:1838 ../src/guestfs-actions.pod:5518 ../src/guestfs-actions.pod:6011
25571 msgid "(Added in 1.0.18)"
25575 #: ../src/guestfs-actions.pod:1558
25576 msgid "guestfs_cp_a"
25580 #: ../src/guestfs-actions.pod:1560
25584 " guestfs_cp_a (guestfs_h *g,\n"
25585 " const char *src,\n"
25586 " const char *dest);\n"
25591 #: ../src/guestfs-actions.pod:1572
25596 #: ../src/guestfs-actions.pod:1574
25600 " guestfs_dd (guestfs_h *g,\n"
25601 " const char *src,\n"
25602 " const char *dest);\n"
25607 #: ../src/guestfs-actions.pod:1591
25609 "If the destination is a device, it must be as large or larger than the "
25610 "source file or device, otherwise the copy will fail. This command cannot do "
25611 "partial copies (see C<guestfs_copy_device_to_device>)."
25615 #: ../src/guestfs-actions.pod:1600
25620 #: ../src/guestfs-actions.pod:1602
25624 " guestfs_df (guestfs_h *g);\n"
25629 #: ../src/guestfs-actions.pod:1607 ../src/guestfs-actions.pod:1624
25631 "This command is mostly useful for interactive sessions. It is I<not> "
25632 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
25637 #: ../src/guestfs-actions.pod:1614 ../src/guestfs-actions.pod:1631 ../src/guestfs-actions.pod:1749 ../src/guestfs-actions.pod:2756 ../src/guestfs-actions.pod:2780 ../src/guestfs-actions.pod:2848 ../src/guestfs-actions.pod:4884 ../src/guestfs-actions.pod:5418 ../src/guestfs-actions.pod:7412 ../src/guestfs-actions.pod:7436 ../src/guestfs-actions.pod:8055 ../src/guestfs-actions.pod:8068 ../src/guestfs-actions.pod:8081
25638 msgid "(Added in 1.0.54)"
25642 #: ../src/guestfs-actions.pod:1616
25643 msgid "guestfs_df_h"
25647 #: ../src/guestfs-actions.pod:1618
25651 " guestfs_df_h (guestfs_h *g);\n"
25656 #: ../src/guestfs-actions.pod:1633
25657 msgid "guestfs_dmesg"
25661 #: ../src/guestfs-actions.pod:1635
25665 " guestfs_dmesg (guestfs_h *g);\n"
25670 #: ../src/guestfs-actions.pod:1642
25672 "Another way to get the same information is to enable verbose messages with "
25673 "C<guestfs_set_verbose> or by setting the environment variable "
25674 "C<LIBGUESTFS_DEBUG=1> before running the program."
25678 #: ../src/guestfs-actions.pod:1652
25679 msgid "guestfs_download"
25683 #: ../src/guestfs-actions.pod:1654
25687 " guestfs_download (guestfs_h *g,\n"
25688 " const char *remotefilename,\n"
25689 " const char *filename);\n"
25694 #: ../src/guestfs-actions.pod:1664
25695 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
25699 #: ../src/guestfs-actions.pod:1675
25700 msgid "guestfs_download_offset"
25704 #: ../src/guestfs-actions.pod:1677
25708 " guestfs_download_offset (guestfs_h *g,\n"
25709 " const char *remotefilename,\n"
25710 " const char *filename,\n"
25711 " int64_t offset,\n"
25712 " int64_t size);\n"
25717 #: ../src/guestfs-actions.pod:1690
25719 "Note that there is no limit on the amount of data that can be downloaded "
25720 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
25721 "full amount unless an error occurs."
25725 #: ../src/guestfs-actions.pod:1695
25726 msgid "See also C<guestfs_download>, C<guestfs_pread>."
25730 #: ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:7713
25731 msgid "(Added in 1.5.17)"
25735 #: ../src/guestfs-actions.pod:1706
25736 msgid "guestfs_drop_caches"
25740 #: ../src/guestfs-actions.pod:1708
25744 " guestfs_drop_caches (guestfs_h *g,\n"
25745 " int whattodrop);\n"
25750 #: ../src/guestfs-actions.pod:1726
25755 #: ../src/guestfs-actions.pod:1728
25759 " guestfs_du (guestfs_h *g,\n"
25760 " const char *path);\n"
25765 #: ../src/guestfs-actions.pod:1751
25766 msgid "guestfs_e2fsck_f"
25770 #: ../src/guestfs-actions.pod:1753
25774 " guestfs_e2fsck_f (guestfs_h *g,\n"
25775 " const char *device);\n"
25780 #: ../src/guestfs-actions.pod:1761
25782 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
25783 "Normally you should use C<guestfs_fsck>."
25787 #: ../src/guestfs-actions.pod:1766
25788 msgid "(Added in 1.0.29)"
25792 #: ../src/guestfs-actions.pod:1768
25793 msgid "guestfs_echo_daemon"
25797 #: ../src/guestfs-actions.pod:1770
25801 " guestfs_echo_daemon (guestfs_h *g,\n"
25802 " char *const *words);\n"
25807 #: ../src/guestfs-actions.pod:1779
25808 msgid "See also C<guestfs_ping_daemon>."
25812 #: ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:2542 ../src/guestfs-actions.pod:6884
25813 msgid "(Added in 1.0.69)"
25817 #: ../src/guestfs-actions.pod:1786
25818 msgid "guestfs_egrep"
25822 #: ../src/guestfs-actions.pod:1788
25826 " guestfs_egrep (guestfs_h *g,\n"
25827 " const char *regex,\n"
25828 " const char *path);\n"
25833 #: ../src/guestfs-actions.pod:1803 ../src/guestfs-actions.pod:1822 ../src/guestfs-actions.pod:1879 ../src/guestfs-actions.pod:1925 ../src/guestfs-actions.pod:1944 ../src/guestfs-actions.pod:2672 ../src/guestfs-actions.pod:2691 ../src/guestfs-actions.pod:2869 ../src/guestfs-actions.pod:2882 ../src/guestfs-actions.pod:2897 ../src/guestfs-actions.pod:2943 ../src/guestfs-actions.pod:2965 ../src/guestfs-actions.pod:2978 ../src/guestfs-actions.pod:4264 ../src/guestfs-actions.pod:4278 ../src/guestfs-actions.pod:4291 ../src/guestfs-actions.pod:4305 ../src/guestfs-actions.pod:5306 ../src/guestfs-actions.pod:6345 ../src/guestfs-actions.pod:6394 ../src/guestfs-actions.pod:7280 ../src/guestfs-actions.pod:7292 ../src/guestfs-actions.pod:7305 ../src/guestfs-actions.pod:7318 ../src/guestfs-actions.pod:7340 ../src/guestfs-actions.pod:7353 ../src/guestfs-actions.pod:7366 ../src/guestfs-actions.pod:7379 ../src/guestfs-actions.pod:8173 ../src/guestfs-actions.pod:8192 ../src/guestfs-actions.pod:8286 ../src/guestfs-actions.pod:8305 ../src/guestfs-actions.pod:8351 ../src/guestfs-actions.pod:8370
25834 msgid "(Added in 1.0.66)"
25838 #: ../src/guestfs-actions.pod:1805
25839 msgid "guestfs_egrepi"
25843 #: ../src/guestfs-actions.pod:1807
25847 " guestfs_egrepi (guestfs_h *g,\n"
25848 " const char *regex,\n"
25849 " const char *path);\n"
25854 #: ../src/guestfs-actions.pod:1824
25855 msgid "guestfs_equal"
25859 #: ../src/guestfs-actions.pod:1826
25863 " guestfs_equal (guestfs_h *g,\n"
25864 " const char *file1,\n"
25865 " const char *file2);\n"
25870 #: ../src/guestfs-actions.pod:1840
25871 msgid "guestfs_exists"
25875 #: ../src/guestfs-actions.pod:1842
25879 " guestfs_exists (guestfs_h *g,\n"
25880 " const char *path);\n"
25885 #: ../src/guestfs-actions.pod:1849
25886 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
25890 #: ../src/guestfs-actions.pod:1855
25891 msgid "guestfs_fallocate"
25895 #: ../src/guestfs-actions.pod:1857
25899 " guestfs_fallocate (guestfs_h *g,\n"
25900 " const char *path,\n"
25906 #: ../src/guestfs-actions.pod:1862
25908 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
25913 #: ../src/guestfs-actions.pod:1881
25914 msgid "guestfs_fallocate64"
25918 #: ../src/guestfs-actions.pod:1883
25922 " guestfs_fallocate64 (guestfs_h *g,\n"
25923 " const char *path,\n"
25929 #: ../src/guestfs-actions.pod:1892
25931 "Note that this call allocates disk blocks for the file. To create a sparse "
25932 "file use C<guestfs_truncate_size> instead."
25936 #: ../src/guestfs-actions.pod:1895
25938 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
25939 "oversight it only allowed 30 bit lengths to be specified, effectively "
25940 "limiting the maximum size of files created through that call to 1GB."
25944 #: ../src/guestfs-actions.pod:1906
25945 msgid "(Added in 1.3.17)"
25949 #: ../src/guestfs-actions.pod:1908
25950 msgid "guestfs_fgrep"
25954 #: ../src/guestfs-actions.pod:1910
25958 " guestfs_fgrep (guestfs_h *g,\n"
25959 " const char *pattern,\n"
25960 " const char *path);\n"
25965 #: ../src/guestfs-actions.pod:1927
25966 msgid "guestfs_fgrepi"
25970 #: ../src/guestfs-actions.pod:1929
25974 " guestfs_fgrepi (guestfs_h *g,\n"
25975 " const char *pattern,\n"
25976 " const char *path);\n"
25981 #: ../src/guestfs-actions.pod:1946
25982 msgid "guestfs_file"
25986 #: ../src/guestfs-actions.pod:1948
25990 " guestfs_file (guestfs_h *g,\n"
25991 " const char *path);\n"
25996 #: ../src/guestfs-actions.pod:1966
25998 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
25999 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
26003 #: ../src/guestfs-actions.pod:1974
26004 msgid "guestfs_file_architecture"
26008 #: ../src/guestfs-actions.pod:1976
26012 " guestfs_file_architecture (guestfs_h *g,\n"
26013 " const char *filename);\n"
26018 #: ../src/guestfs-actions.pod:2084 ../src/guestfs-actions.pod:2247 ../src/guestfs-actions.pod:2264 ../src/guestfs-actions.pod:2998 ../src/guestfs-actions.pod:3100 ../src/guestfs-actions.pod:3166 ../src/guestfs-actions.pod:3353 ../src/guestfs-actions.pod:3371 ../src/guestfs-actions.pod:3411 ../src/guestfs-actions.pod:3487 ../src/guestfs-actions.pod:3584 ../src/guestfs-actions.pod:3821 ../src/guestfs-actions.pod:3953
26019 msgid "(Added in 1.5.3)"
26023 #: ../src/guestfs-actions.pod:2086
26024 msgid "guestfs_filesize"
26028 #: ../src/guestfs-actions.pod:2088
26032 " guestfs_filesize (guestfs_h *g,\n"
26033 " const char *file);\n"
26038 #: ../src/guestfs-actions.pod:2094
26040 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
26041 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
26042 "devices, use C<guestfs_blockdev_getsize64>."
26046 #: ../src/guestfs-actions.pod:2100
26047 msgid "(Added in 1.0.82)"
26051 #: ../src/guestfs-actions.pod:2102
26052 msgid "guestfs_fill"
26056 #: ../src/guestfs-actions.pod:2104
26060 " guestfs_fill (guestfs_h *g,\n"
26063 " const char *path);\n"
26068 #: ../src/guestfs-actions.pod:2114
26070 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
26071 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
26072 "bytes use C<guestfs_fill_pattern>."
26076 #: ../src/guestfs-actions.pod:2126
26077 msgid "(Added in 1.0.79)"
26081 #: ../src/guestfs-actions.pod:2128
26082 msgid "guestfs_fill_pattern"
26086 #: ../src/guestfs-actions.pod:2130
26090 " guestfs_fill_pattern (guestfs_h *g,\n"
26091 " const char *pattern,\n"
26093 " const char *path);\n"
26098 #: ../src/guestfs-actions.pod:2136
26100 "This function is like C<guestfs_fill> except that it creates a new file of "
26101 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
26102 "pattern is truncated if necessary to ensure the length of the file is "
26103 "exactly C<len> bytes."
26107 #: ../src/guestfs-actions.pod:2148
26108 msgid "(Added in 1.3.12)"
26112 #: ../src/guestfs-actions.pod:2150
26113 msgid "guestfs_find"
26117 #: ../src/guestfs-actions.pod:2152
26121 " guestfs_find (guestfs_h *g,\n"
26122 " const char *directory);\n"
26127 #: ../src/guestfs-actions.pod:2168
26128 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
26132 #: ../src/guestfs-actions.pod:2181
26133 msgid "See also C<guestfs_find0>."
26137 #: ../src/guestfs-actions.pod:2190 ../src/guestfs-actions.pod:4711 ../src/guestfs-actions.pod:6429
26138 msgid "(Added in 1.0.27)"
26142 #: ../src/guestfs-actions.pod:2192
26143 msgid "guestfs_find0"
26147 #: ../src/guestfs-actions.pod:2194
26151 " guestfs_find0 (guestfs_h *g,\n"
26152 " const char *directory,\n"
26153 " const char *files);\n"
26158 #: ../src/guestfs-actions.pod:2203
26160 "This command works the same way as C<guestfs_find> with the following "
26165 #: ../src/guestfs-actions.pod:2230
26166 msgid "(Added in 1.0.74)"
26170 #: ../src/guestfs-actions.pod:2232
26171 msgid "guestfs_findfs_label"
26175 #: ../src/guestfs-actions.pod:2234
26179 " guestfs_findfs_label (guestfs_h *g,\n"
26180 " const char *label);\n"
26185 #: ../src/guestfs-actions.pod:2242
26186 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
26190 #: ../src/guestfs-actions.pod:2249
26191 msgid "guestfs_findfs_uuid"
26195 #: ../src/guestfs-actions.pod:2251
26199 " guestfs_findfs_uuid (guestfs_h *g,\n"
26200 " const char *uuid);\n"
26205 #: ../src/guestfs-actions.pod:2259
26206 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
26210 #: ../src/guestfs-actions.pod:2266
26211 msgid "guestfs_fsck"
26215 #: ../src/guestfs-actions.pod:2268
26219 " guestfs_fsck (guestfs_h *g,\n"
26220 " const char *fstype,\n"
26221 " const char *device);\n"
26226 #: ../src/guestfs-actions.pod:2303 ../src/guestfs-actions.pod:8220
26227 msgid "(Added in 1.0.16)"
26231 #: ../src/guestfs-actions.pod:2305
26232 msgid "guestfs_get_append"
26236 #: ../src/guestfs-actions.pod:2307
26240 " guestfs_get_append (guestfs_h *g);\n"
26245 #: ../src/guestfs-actions.pod:2315
26247 "This function returns a string which may be NULL. There is no way to return "
26248 "an error from this function. The string is owned by the guest handle and "
26249 "must I<not> be freed."
26253 #: ../src/guestfs-actions.pod:2319 ../src/guestfs-actions.pod:6107 ../src/guestfs-actions.pod:6589 ../src/guestfs-actions.pod:7047 ../src/guestfs-actions.pod:7066 ../src/guestfs-actions.pod:7082 ../src/guestfs-actions.pod:7106 ../src/guestfs-actions.pod:7860 ../src/guestfs-actions.pod:7875 ../src/guestfs-actions.pod:8267
26254 msgid "(Added in 1.0.26)"
26258 #: ../src/guestfs-actions.pod:2321
26259 msgid "guestfs_get_attach_method"
26263 #: ../src/guestfs-actions.pod:2323
26267 " guestfs_get_attach_method (guestfs_h *g);\n"
26272 #: ../src/guestfs-actions.pod:2326
26273 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
26277 #: ../src/guestfs-actions.pod:2331 ../src/guestfs-actions.pod:6619
26278 msgid "(Added in 1.9.8)"
26282 #: ../src/guestfs-actions.pod:2333
26283 msgid "guestfs_get_autosync"
26287 #: ../src/guestfs-actions.pod:2335
26291 " guestfs_get_autosync (guestfs_h *g);\n"
26296 #: ../src/guestfs-actions.pod:2344
26297 msgid "guestfs_get_direct"
26301 #: ../src/guestfs-actions.pod:2346
26305 " guestfs_get_direct (guestfs_h *g);\n"
26310 #: ../src/guestfs-actions.pod:2353 ../src/guestfs-actions.pod:6660
26311 msgid "(Added in 1.0.72)"
26315 #: ../src/guestfs-actions.pod:2355
26316 msgid "guestfs_get_e2label"
26320 #: ../src/guestfs-actions.pod:2357
26324 " guestfs_get_e2label (guestfs_h *g,\n"
26325 " const char *device);\n"
26330 #: ../src/guestfs-actions.pod:2361
26332 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
26337 #: ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:2395 ../src/guestfs-actions.pod:6678 ../src/guestfs-actions.pod:6697
26338 msgid "(Added in 1.0.15)"
26342 #: ../src/guestfs-actions.pod:2376
26343 msgid "guestfs_get_e2uuid"
26347 #: ../src/guestfs-actions.pod:2378
26351 " guestfs_get_e2uuid (guestfs_h *g,\n"
26352 " const char *device);\n"
26357 #: ../src/guestfs-actions.pod:2382
26359 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
26364 #: ../src/guestfs-actions.pod:2397
26365 msgid "guestfs_get_memsize"
26369 #: ../src/guestfs-actions.pod:2399
26373 " guestfs_get_memsize (guestfs_h *g);\n"
26378 #: ../src/guestfs-actions.pod:2405
26380 "If C<guestfs_set_memsize> was not called on this handle, and if "
26381 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
26382 "value for memsize."
26386 #: ../src/guestfs-actions.pod:2414 ../src/guestfs-actions.pod:5002 ../src/guestfs-actions.pod:5211 ../src/guestfs-actions.pod:5230 ../src/guestfs-actions.pod:5249 ../src/guestfs-actions.pod:5261 ../src/guestfs-actions.pod:5278 ../src/guestfs-actions.pod:5291 ../src/guestfs-actions.pod:6332 ../src/guestfs-actions.pod:6718 ../src/guestfs-actions.pod:7014 ../src/guestfs-actions.pod:7629
26387 msgid "(Added in 1.0.55)"
26391 #: ../src/guestfs-actions.pod:2416
26392 msgid "guestfs_get_network"
26396 #: ../src/guestfs-actions.pod:2418
26400 " guestfs_get_network (guestfs_h *g);\n"
26405 #: ../src/guestfs-actions.pod:2425 ../src/guestfs-actions.pod:6737
26406 msgid "(Added in 1.5.4)"
26410 #: ../src/guestfs-actions.pod:2427
26411 msgid "guestfs_get_path"
26415 #: ../src/guestfs-actions.pod:2429
26419 " guestfs_get_path (guestfs_h *g);\n"
26424 #: ../src/guestfs-actions.pod:2437 ../src/guestfs-actions.pod:2477
26426 "This function returns a string, or NULL on error. The string is owned by "
26427 "the guest handle and must I<not> be freed."
26431 #: ../src/guestfs-actions.pod:2442
26432 msgid "guestfs_get_pgroup"
26436 #: ../src/guestfs-actions.pod:2444
26440 " guestfs_get_pgroup (guestfs_h *g);\n"
26445 #: ../src/guestfs-actions.pod:2451 ../src/guestfs-actions.pod:6773 ../src/guestfs-actions.pod:8121
26446 msgid "(Added in 1.11.18)"
26450 #: ../src/guestfs-actions.pod:2453
26451 msgid "guestfs_get_pid"
26455 #: ../src/guestfs-actions.pod:2455
26459 " guestfs_get_pid (guestfs_h *g);\n"
26464 #: ../src/guestfs-actions.pod:2465
26465 msgid "(Added in 1.0.56)"
26469 #: ../src/guestfs-actions.pod:2467
26470 msgid "guestfs_get_qemu"
26474 #: ../src/guestfs-actions.pod:2469
26478 " guestfs_get_qemu (guestfs_h *g);\n"
26483 #: ../src/guestfs-actions.pod:2480 ../src/guestfs-actions.pod:6801
26484 msgid "(Added in 1.0.6)"
26488 #: ../src/guestfs-actions.pod:2482
26489 msgid "guestfs_get_recovery_proc"
26493 #: ../src/guestfs-actions.pod:2484
26497 " guestfs_get_recovery_proc (guestfs_h *g);\n"
26502 #: ../src/guestfs-actions.pod:2491 ../src/guestfs-actions.pod:4075 ../src/guestfs-actions.pod:4406 ../src/guestfs-actions.pod:4809 ../src/guestfs-actions.pod:4841 ../src/guestfs-actions.pod:6037 ../src/guestfs-actions.pod:6380 ../src/guestfs-actions.pod:6825 ../src/guestfs-actions.pod:7532 ../src/guestfs-actions.pod:7552 ../src/guestfs-actions.pod:7744
26503 msgid "(Added in 1.0.77)"
26507 #: ../src/guestfs-actions.pod:2493
26508 msgid "guestfs_get_selinux"
26512 #: ../src/guestfs-actions.pod:2495
26516 " guestfs_get_selinux (guestfs_h *g);\n"
26521 #: ../src/guestfs-actions.pod:2498
26523 "This returns the current setting of the selinux flag which is passed to the "
26524 "appliance at boot time. See C<guestfs_set_selinux>."
26528 #: ../src/guestfs-actions.pod:2506 ../src/guestfs-actions.pod:2580 ../src/guestfs-actions.pod:6844 ../src/guestfs-actions.pod:6918
26529 msgid "(Added in 1.0.67)"
26533 #: ../src/guestfs-actions.pod:2508
26534 msgid "guestfs_get_smp"
26538 #: ../src/guestfs-actions.pod:2510
26542 " guestfs_get_smp (guestfs_h *g);\n"
26547 #: ../src/guestfs-actions.pod:2519
26548 msgid "guestfs_get_state"
26552 #: ../src/guestfs-actions.pod:2521
26556 " guestfs_get_state (guestfs_h *g);\n"
26561 #: ../src/guestfs-actions.pod:2533
26562 msgid "guestfs_get_trace"
26566 #: ../src/guestfs-actions.pod:2535
26570 " guestfs_get_trace (guestfs_h *g);\n"
26575 #: ../src/guestfs-actions.pod:2544
26576 msgid "guestfs_get_umask"
26580 #: ../src/guestfs-actions.pod:2546
26584 " guestfs_get_umask (guestfs_h *g);\n"
26589 #: ../src/guestfs-actions.pod:2549
26591 "Return the current umask. By default the umask is C<022> unless it has been "
26592 "set by calling C<guestfs_umask>."
26596 #: ../src/guestfs-actions.pod:2556
26597 msgid "guestfs_get_verbose"
26601 #: ../src/guestfs-actions.pod:2558
26605 " guestfs_get_verbose (guestfs_h *g);\n"
26610 #: ../src/guestfs-actions.pod:2567
26611 msgid "guestfs_getcon"
26615 #: ../src/guestfs-actions.pod:2569
26619 " guestfs_getcon (guestfs_h *g);\n"
26624 #: ../src/guestfs-actions.pod:2574
26625 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
26629 #: ../src/guestfs-actions.pod:2582
26630 msgid "guestfs_getxattr"
26634 #: ../src/guestfs-actions.pod:2584
26638 " guestfs_getxattr (guestfs_h *g,\n"
26639 " const char *path,\n"
26640 " const char *name,\n"
26641 " size_t *size_r);\n"
26646 #: ../src/guestfs-actions.pod:2590
26648 "Get a single extended attribute from file C<path> named C<name>. This call "
26649 "follows symlinks. If you want to lookup an extended attribute for the "
26650 "symlink itself, use C<guestfs_lgetxattr>."
26654 #: ../src/guestfs-actions.pod:2594 ../src/guestfs-actions.pod:4089
26656 "Normally it is better to get all extended attributes from a file in one go "
26657 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
26658 "implementations are buggy and do not provide a way to list out attributes. "
26659 "For these filesystems (notably ntfs-3g) you have to know the names of the "
26660 "extended attributes you want in advance and call this function."
26664 #: ../src/guestfs-actions.pod:2604
26665 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
26669 #: ../src/guestfs-actions.pod:2606 ../src/guestfs-actions.pod:2819 ../src/guestfs-actions.pod:3301 ../src/guestfs-actions.pod:4101 ../src/guestfs-actions.pod:6030 ../src/guestfs-actions.pod:6056 ../src/guestfs-actions.pod:6237
26671 "This function returns a buffer, or NULL on error. The size of the returned "
26672 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
26677 #: ../src/guestfs-actions.pod:2610 ../src/guestfs-actions.pod:4105
26678 msgid "(Added in 1.7.24)"
26682 #: ../src/guestfs-actions.pod:2612
26683 msgid "guestfs_getxattrs"
26687 #: ../src/guestfs-actions.pod:2614
26690 " struct guestfs_xattr_list *\n"
26691 " guestfs_getxattrs (guestfs_h *g,\n"
26692 " const char *path);\n"
26697 #: ../src/guestfs-actions.pod:2624
26698 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
26702 #: ../src/guestfs-actions.pod:2626 ../src/guestfs-actions.pod:4117 ../src/guestfs-actions.pod:4805
26704 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
26705 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
26709 #: ../src/guestfs-actions.pod:2630 ../src/guestfs-actions.pod:4121 ../src/guestfs-actions.pod:4320 ../src/guestfs-actions.pod:4356 ../src/guestfs-actions.pod:6410 ../src/guestfs-actions.pod:6937 ../src/guestfs-actions.pod:8332
26710 msgid "(Added in 1.0.59)"
26714 #: ../src/guestfs-actions.pod:2632
26715 msgid "guestfs_glob_expand"
26719 #: ../src/guestfs-actions.pod:2634
26723 " guestfs_glob_expand (guestfs_h *g,\n"
26724 " const char *pattern);\n"
26729 #: ../src/guestfs-actions.pod:2653 ../src/guestfs-actions.pod:7130 ../src/guestfs-actions.pod:7147
26730 msgid "(Added in 1.0.50)"
26734 #: ../src/guestfs-actions.pod:2655
26735 msgid "guestfs_grep"
26739 #: ../src/guestfs-actions.pod:2657
26743 " guestfs_grep (guestfs_h *g,\n"
26744 " const char *regex,\n"
26745 " const char *path);\n"
26750 #: ../src/guestfs-actions.pod:2674
26751 msgid "guestfs_grepi"
26755 #: ../src/guestfs-actions.pod:2676
26759 " guestfs_grepi (guestfs_h *g,\n"
26760 " const char *regex,\n"
26761 " const char *path);\n"
26766 #: ../src/guestfs-actions.pod:2693
26767 msgid "guestfs_grub_install"
26771 #: ../src/guestfs-actions.pod:2695
26775 " guestfs_grub_install (guestfs_h *g,\n"
26776 " const char *root,\n"
26777 " const char *device);\n"
26782 #: ../src/guestfs-actions.pod:2738
26783 msgid "(Added in 1.0.17)"
26787 #: ../src/guestfs-actions.pod:2740
26788 msgid "guestfs_head"
26792 #: ../src/guestfs-actions.pod:2742
26796 " guestfs_head (guestfs_h *g,\n"
26797 " const char *path);\n"
26802 #: ../src/guestfs-actions.pod:2758
26803 msgid "guestfs_head_n"
26807 #: ../src/guestfs-actions.pod:2760
26811 " guestfs_head_n (guestfs_h *g,\n"
26813 " const char *path);\n"
26818 #: ../src/guestfs-actions.pod:2782
26819 msgid "guestfs_hexdump"
26823 #: ../src/guestfs-actions.pod:2784
26827 " guestfs_hexdump (guestfs_h *g,\n"
26828 " const char *path);\n"
26833 #: ../src/guestfs-actions.pod:2797 ../src/guestfs-actions.pod:7211 ../src/guestfs-actions.pod:7266
26834 msgid "(Added in 1.0.22)"
26838 #: ../src/guestfs-actions.pod:2799
26839 msgid "guestfs_initrd_cat"
26843 #: ../src/guestfs-actions.pod:2801
26847 " guestfs_initrd_cat (guestfs_h *g,\n"
26848 " const char *initrdpath,\n"
26849 " const char *filename,\n"
26850 " size_t *size_r);\n"
26855 #: ../src/guestfs-actions.pod:2817
26856 msgid "See also C<guestfs_initrd_list>."
26860 #: ../src/guestfs-actions.pod:2828
26861 msgid "guestfs_initrd_list"
26865 #: ../src/guestfs-actions.pod:2830
26869 " guestfs_initrd_list (guestfs_h *g,\n"
26870 " const char *path);\n"
26875 #: ../src/guestfs-actions.pod:2850
26876 msgid "guestfs_inotify_add_watch"
26880 #: ../src/guestfs-actions.pod:2852
26884 " guestfs_inotify_add_watch (guestfs_h *g,\n"
26885 " const char *path,\n"
26891 #: ../src/guestfs-actions.pod:2871
26892 msgid "guestfs_inotify_close"
26896 #: ../src/guestfs-actions.pod:2873
26900 " guestfs_inotify_close (guestfs_h *g);\n"
26905 #: ../src/guestfs-actions.pod:2884
26906 msgid "guestfs_inotify_files"
26910 #: ../src/guestfs-actions.pod:2886
26914 " guestfs_inotify_files (guestfs_h *g);\n"
26919 #: ../src/guestfs-actions.pod:2889
26921 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
26922 "returns a list of pathnames of objects that were touched. The returned "
26923 "pathnames are sorted and deduplicated."
26927 #: ../src/guestfs-actions.pod:2899
26928 msgid "guestfs_inotify_init"
26932 #: ../src/guestfs-actions.pod:2901
26936 " guestfs_inotify_init (guestfs_h *g,\n"
26937 " int maxevents);\n"
26942 #: ../src/guestfs-actions.pod:2909
26944 "C<maxevents> is the maximum number of events which will be queued up between "
26945 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
26946 "passed as C<0>, then the kernel (or previously set) default is used. For "
26947 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
26948 "throws away events, but records the fact that it threw them away by setting "
26949 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
26950 "C<guestfs_inotify_read>)."
26954 #: ../src/guestfs-actions.pod:2919
26956 "Before any events are generated, you have to add some watches to the "
26957 "internal watch list. See: C<guestfs_inotify_add_watch>, "
26958 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
26962 #: ../src/guestfs-actions.pod:2925
26964 "Queued up events should be read periodically by calling "
26965 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
26966 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
26967 "often enough then you risk the internal queue overflowing."
26971 #: ../src/guestfs-actions.pod:2932
26973 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
26974 "This also removes any watches automatically."
26978 #: ../src/guestfs-actions.pod:2945
26979 msgid "guestfs_inotify_read"
26983 #: ../src/guestfs-actions.pod:2947
26986 " struct guestfs_inotify_event_list *\n"
26987 " guestfs_inotify_read (guestfs_h *g);\n"
26992 #: ../src/guestfs-actions.pod:2961
26994 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
26995 "there was an error. I<The caller must call "
26996 "C<guestfs_free_inotify_event_list> after use>."
27000 #: ../src/guestfs-actions.pod:2967
27001 msgid "guestfs_inotify_rm_watch"
27005 #: ../src/guestfs-actions.pod:2969
27009 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
27015 #: ../src/guestfs-actions.pod:2973
27017 "Remove a previously defined inotify watch. See "
27018 "C<guestfs_inotify_add_watch>."
27022 #: ../src/guestfs-actions.pod:2980
27023 msgid "guestfs_inspect_get_arch"
27027 #: ../src/guestfs-actions.pod:2982
27031 " guestfs_inspect_get_arch (guestfs_h *g,\n"
27032 " const char *root);\n"
27037 #: ../src/guestfs-actions.pod:2986
27039 "This returns the architecture of the inspected operating system. The "
27040 "possible return values are listed under C<guestfs_file_architecture>."
27044 #: ../src/guestfs-actions.pod:3000
27045 msgid "guestfs_inspect_get_distro"
27049 #: ../src/guestfs-actions.pod:3002
27053 " guestfs_inspect_get_distro (guestfs_h *g,\n"
27054 " const char *root);\n"
27059 #: ../src/guestfs-actions.pod:3102
27060 msgid "guestfs_inspect_get_drive_mappings"
27064 #: ../src/guestfs-actions.pod:3104
27068 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
27069 " const char *root);\n"
27074 #: ../src/guestfs-actions.pod:3133
27076 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27077 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
27081 #: ../src/guestfs-actions.pod:3137 ../src/guestfs-actions.pod:3405 ../src/guestfs-actions.pod:4208 ../src/guestfs-actions.pod:5480 ../src/guestfs-actions.pod:7568
27083 "This function returns a NULL-terminated array of strings, or NULL if there "
27084 "was an error. The array of strings will always have length C<2n+1>, where "
27085 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
27086 "caller must free the strings and the array after use>."
27090 #: ../src/guestfs-actions.pod:3143 ../src/guestfs-actions.pod:3604
27091 msgid "(Added in 1.9.17)"
27095 #: ../src/guestfs-actions.pod:3145
27096 msgid "guestfs_inspect_get_filesystems"
27100 #: ../src/guestfs-actions.pod:3147
27104 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
27105 " const char *root);\n"
27110 #: ../src/guestfs-actions.pod:3159
27112 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27113 "C<guestfs_inspect_get_mountpoints>."
27117 #: ../src/guestfs-actions.pod:3168
27118 msgid "guestfs_inspect_get_format"
27122 #: ../src/guestfs-actions.pod:3170
27126 " guestfs_inspect_get_format (guestfs_h *g,\n"
27127 " const char *root);\n"
27132 #: ../src/guestfs-actions.pod:3204 ../src/guestfs-actions.pod:3640 ../src/guestfs-actions.pod:3656 ../src/guestfs-actions.pod:3674 ../src/guestfs-actions.pod:6448
27133 msgid "(Added in 1.9.4)"
27137 #: ../src/guestfs-actions.pod:3206
27138 msgid "guestfs_inspect_get_hostname"
27142 #: ../src/guestfs-actions.pod:3208
27146 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
27147 " const char *root);\n"
27152 #: ../src/guestfs-actions.pod:3223
27153 msgid "(Added in 1.7.9)"
27157 #: ../src/guestfs-actions.pod:3225
27158 msgid "guestfs_inspect_get_icon"
27162 #: ../src/guestfs-actions.pod:3227
27166 " guestfs_inspect_get_icon (guestfs_h *g,\n"
27167 " const char *root,\n"
27168 " size_t *size_r,\n"
27174 #: ../src/guestfs-actions.pod:3238
27177 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
27178 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
27183 #: ../src/guestfs-actions.pod:3305 ../src/guestfs-actions.pod:4135 ../src/guestfs-actions.pod:5379
27184 msgid "(Added in 1.11.12)"
27188 #: ../src/guestfs-actions.pod:3307
27189 msgid "guestfs_inspect_get_icon_va"
27193 #: ../src/guestfs-actions.pod:3309
27197 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
27198 " const char *root,\n"
27199 " size_t *size_r,\n"
27200 " va_list args);\n"
27205 #: ../src/guestfs-actions.pod:3315
27206 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
27210 #: ../src/guestfs-actions.pod:3319
27211 msgid "guestfs_inspect_get_icon_argv"
27215 #: ../src/guestfs-actions.pod:3321
27219 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
27220 " const char *root,\n"
27221 " size_t *size_r,\n"
27222 " const struct guestfs_inspect_get_icon_argv "
27228 #: ../src/guestfs-actions.pod:3327
27229 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
27233 #: ../src/guestfs-actions.pod:3331
27234 msgid "guestfs_inspect_get_major_version"
27238 #: ../src/guestfs-actions.pod:3333
27242 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
27243 " const char *root);\n"
27248 #: ../src/guestfs-actions.pod:3355
27249 msgid "guestfs_inspect_get_minor_version"
27253 #: ../src/guestfs-actions.pod:3357
27257 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
27258 " const char *root);\n"
27263 #: ../src/guestfs-actions.pod:3366
27265 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27266 "C<guestfs_inspect_get_major_version>."
27270 #: ../src/guestfs-actions.pod:3373
27271 msgid "guestfs_inspect_get_mountpoints"
27275 #: ../src/guestfs-actions.pod:3375
27279 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
27280 " const char *root);\n"
27285 #: ../src/guestfs-actions.pod:3396
27287 "For operating systems like Windows which still use drive letters, this call "
27288 "will only return an entry for the first drive \"mounted on\" C</>. For "
27289 "information about the mapping of drive letters to partitions, see "
27290 "C<guestfs_inspect_get_drive_mappings>."
27294 #: ../src/guestfs-actions.pod:3402
27296 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27297 "C<guestfs_inspect_get_filesystems>."
27301 #: ../src/guestfs-actions.pod:3413
27302 msgid "guestfs_inspect_get_package_format"
27306 #: ../src/guestfs-actions.pod:3415
27310 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
27311 " const char *root);\n"
27316 #: ../src/guestfs-actions.pod:3419
27318 "This function and C<guestfs_inspect_get_package_management> return the "
27319 "package format and package management tool used by the inspected operating "
27320 "system. For example for Fedora these functions would return C<rpm> (package "
27321 "format) and C<yum> (package management)."
27325 #: ../src/guestfs-actions.pod:3438 ../src/guestfs-actions.pod:3466
27326 msgid "(Added in 1.7.5)"
27330 #: ../src/guestfs-actions.pod:3440
27331 msgid "guestfs_inspect_get_package_management"
27335 #: ../src/guestfs-actions.pod:3442
27339 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
27340 " const char *root);\n"
27345 #: ../src/guestfs-actions.pod:3446
27347 "C<guestfs_inspect_get_package_format> and this function return the package "
27348 "format and package management tool used by the inspected operating system. "
27349 "For example for Fedora these functions would return C<rpm> (package format) "
27350 "and C<yum> (package management)."
27354 #: ../src/guestfs-actions.pod:3468
27355 msgid "guestfs_inspect_get_product_name"
27359 #: ../src/guestfs-actions.pod:3470
27363 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
27364 " const char *root);\n"
27369 #: ../src/guestfs-actions.pod:3489
27370 msgid "guestfs_inspect_get_product_variant"
27374 #: ../src/guestfs-actions.pod:3491
27378 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
27379 " const char *root);\n"
27384 #: ../src/guestfs-actions.pod:3514
27386 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27387 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
27391 #: ../src/guestfs-actions.pod:3521
27392 msgid "(Added in 1.9.13)"
27396 #: ../src/guestfs-actions.pod:3523
27397 msgid "guestfs_inspect_get_roots"
27401 #: ../src/guestfs-actions.pod:3525
27405 " guestfs_inspect_get_roots (guestfs_h *g);\n"
27410 #: ../src/guestfs-actions.pod:3528
27412 "This function is a convenient way to get the list of root devices, as "
27413 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
27414 "the whole inspection process."
27418 #: ../src/guestfs-actions.pod:3532
27420 "This returns an empty list if either no root devices were found or the "
27421 "caller has not called C<guestfs_inspect_os>."
27425 #: ../src/guestfs-actions.pod:3541
27426 msgid "(Added in 1.7.3)"
27430 #: ../src/guestfs-actions.pod:3543
27431 msgid "guestfs_inspect_get_type"
27435 #: ../src/guestfs-actions.pod:3545
27439 " guestfs_inspect_get_type (guestfs_h *g,\n"
27440 " const char *root);\n"
27445 #: ../src/guestfs-actions.pod:3586
27446 msgid "guestfs_inspect_get_windows_current_control_set"
27450 #: ../src/guestfs-actions.pod:3588
27454 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
27455 " const char *root);\n"
27460 #: ../src/guestfs-actions.pod:3606
27461 msgid "guestfs_inspect_get_windows_systemroot"
27465 #: ../src/guestfs-actions.pod:3608
27469 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
27470 " const char *root);\n"
27475 #: ../src/guestfs-actions.pod:3624
27476 msgid "(Added in 1.5.25)"
27480 #: ../src/guestfs-actions.pod:3626
27481 msgid "guestfs_inspect_is_live"
27485 #: ../src/guestfs-actions.pod:3628
27489 " guestfs_inspect_is_live (guestfs_h *g,\n"
27490 " const char *root);\n"
27495 #: ../src/guestfs-actions.pod:3632
27497 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27498 "disk), then this returns true if a live image was detected on the disk."
27502 #: ../src/guestfs-actions.pod:3642
27503 msgid "guestfs_inspect_is_multipart"
27507 #: ../src/guestfs-actions.pod:3644
27511 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
27512 " const char *root);\n"
27517 #: ../src/guestfs-actions.pod:3648
27519 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27520 "disk), then this returns true if the disk is part of a set."
27524 #: ../src/guestfs-actions.pod:3658
27525 msgid "guestfs_inspect_is_netinst"
27529 #: ../src/guestfs-actions.pod:3660
27533 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
27534 " const char *root);\n"
27539 #: ../src/guestfs-actions.pod:3664
27541 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27542 "disk), then this returns true if the disk is a network installer, ie. not a "
27543 "self-contained install CD but one which is likely to require network access "
27544 "to complete the install."
27548 #: ../src/guestfs-actions.pod:3676
27549 msgid "guestfs_inspect_list_applications"
27553 #: ../src/guestfs-actions.pod:3678
27556 " struct guestfs_application_list *\n"
27557 " guestfs_inspect_list_applications (guestfs_h *g,\n"
27558 " const char *root);\n"
27563 #: ../src/guestfs-actions.pod:3684
27565 "I<Note:> This call works differently from other parts of the inspection "
27566 "API. You have to call C<guestfs_inspect_os>, then "
27567 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
27568 "this. Listing applications is a significantly more difficult operation "
27569 "which requires access to the full filesystem. Also note that unlike the "
27570 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
27571 "the libguestfs handle, this call actually reads parts of the mounted "
27572 "filesystems during the call."
27576 #: ../src/guestfs-actions.pod:3774
27578 "This function returns a C<struct guestfs_application_list *>, or NULL if "
27579 "there was an error. I<The caller must call C<guestfs_free_application_list> "
27584 #: ../src/guestfs-actions.pod:3778
27585 msgid "(Added in 1.7.8)"
27589 #: ../src/guestfs-actions.pod:3780
27590 msgid "guestfs_inspect_os"
27594 #: ../src/guestfs-actions.pod:3782
27598 " guestfs_inspect_os (guestfs_h *g);\n"
27603 #: ../src/guestfs-actions.pod:3798
27605 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
27606 "functions in order to query further information about each operating system, "
27607 "such as the name and version."
27611 #: ../src/guestfs-actions.pod:3803
27613 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
27614 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
27615 "the contents. This should be called with no disks currently mounted. The "
27616 "function may also use Augeas, so any existing Augeas handle will be closed."
27620 #: ../src/guestfs-actions.pod:3815 ../src/guestfs-actions.pod:4146 ../src/guestfs-actions.pod:4228
27621 msgid "See also C<guestfs_list_filesystems>."
27625 #: ../src/guestfs-actions.pod:3823
27626 msgid "guestfs_is_blockdev"
27630 #: ../src/guestfs-actions.pod:3825
27634 " guestfs_is_blockdev (guestfs_h *g,\n"
27635 " const char *path);\n"
27640 #: ../src/guestfs-actions.pod:3832 ../src/guestfs-actions.pod:3861 ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:3906 ../src/guestfs-actions.pod:3922 ../src/guestfs-actions.pod:3978 ../src/guestfs-actions.pod:3993
27641 msgid "See also C<guestfs_stat>."
27645 #: ../src/guestfs-actions.pod:3836 ../src/guestfs-actions.pod:3865 ../src/guestfs-actions.pod:3910 ../src/guestfs-actions.pod:3982 ../src/guestfs-actions.pod:3997
27646 msgid "(Added in 1.5.10)"
27650 #: ../src/guestfs-actions.pod:3838
27651 msgid "guestfs_is_busy"
27655 #: ../src/guestfs-actions.pod:3840
27659 " guestfs_is_busy (guestfs_h *g);\n"
27664 #: ../src/guestfs-actions.pod:3852
27665 msgid "guestfs_is_chardev"
27669 #: ../src/guestfs-actions.pod:3854
27673 " guestfs_is_chardev (guestfs_h *g,\n"
27674 " const char *path);\n"
27679 #: ../src/guestfs-actions.pod:3867
27680 msgid "guestfs_is_config"
27684 #: ../src/guestfs-actions.pod:3869
27688 " guestfs_is_config (guestfs_h *g);\n"
27693 #: ../src/guestfs-actions.pod:3881
27694 msgid "guestfs_is_dir"
27698 #: ../src/guestfs-actions.pod:3883
27702 " guestfs_is_dir (guestfs_h *g,\n"
27703 " const char *path);\n"
27708 #: ../src/guestfs-actions.pod:3897
27709 msgid "guestfs_is_fifo"
27713 #: ../src/guestfs-actions.pod:3899
27717 " guestfs_is_fifo (guestfs_h *g,\n"
27718 " const char *path);\n"
27723 #: ../src/guestfs-actions.pod:3912
27724 msgid "guestfs_is_file"
27728 #: ../src/guestfs-actions.pod:3914
27732 " guestfs_is_file (guestfs_h *g,\n"
27733 " const char *path);\n"
27738 #: ../src/guestfs-actions.pod:3928
27739 msgid "guestfs_is_launching"
27743 #: ../src/guestfs-actions.pod:3930
27747 " guestfs_is_launching (guestfs_h *g);\n"
27752 #: ../src/guestfs-actions.pod:3942
27753 msgid "guestfs_is_lv"
27757 #: ../src/guestfs-actions.pod:3944
27761 " guestfs_is_lv (guestfs_h *g,\n"
27762 " const char *device);\n"
27767 #: ../src/guestfs-actions.pod:3955
27768 msgid "guestfs_is_ready"
27772 #: ../src/guestfs-actions.pod:3957
27776 " guestfs_is_ready (guestfs_h *g);\n"
27781 #: ../src/guestfs-actions.pod:3969
27782 msgid "guestfs_is_socket"
27786 #: ../src/guestfs-actions.pod:3971
27790 " guestfs_is_socket (guestfs_h *g,\n"
27791 " const char *path);\n"
27796 #: ../src/guestfs-actions.pod:3984
27797 msgid "guestfs_is_symlink"
27801 #: ../src/guestfs-actions.pod:3986
27805 " guestfs_is_symlink (guestfs_h *g,\n"
27806 " const char *path);\n"
27811 #: ../src/guestfs-actions.pod:3999
27812 msgid "guestfs_is_zero"
27816 #: ../src/guestfs-actions.pod:4001
27820 " guestfs_is_zero (guestfs_h *g,\n"
27821 " const char *path);\n"
27826 #: ../src/guestfs-actions.pod:4010 ../src/guestfs-actions.pod:4024
27827 msgid "(Added in 1.11.8)"
27831 #: ../src/guestfs-actions.pod:4012
27832 msgid "guestfs_is_zero_device"
27836 #: ../src/guestfs-actions.pod:4014
27840 " guestfs_is_zero_device (guestfs_h *g,\n"
27841 " const char *device);\n"
27846 #: ../src/guestfs-actions.pod:4026
27847 msgid "guestfs_kill_subprocess"
27851 #: ../src/guestfs-actions.pod:4028
27855 " guestfs_kill_subprocess (guestfs_h *g);\n"
27860 #: ../src/guestfs-actions.pod:4037
27861 msgid "guestfs_launch"
27865 #: ../src/guestfs-actions.pod:4039
27869 " guestfs_launch (guestfs_h *g);\n"
27874 #: ../src/guestfs-actions.pod:4057
27875 msgid "guestfs_lchown"
27879 #: ../src/guestfs-actions.pod:4059
27883 " guestfs_lchown (guestfs_h *g,\n"
27886 " const char *path);\n"
27891 #: ../src/guestfs-actions.pod:4065
27893 "Change the file owner to C<owner> and group to C<group>. This is like "
27894 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
27895 "changed, not the target."
27899 #: ../src/guestfs-actions.pod:4077
27900 msgid "guestfs_lgetxattr"
27904 #: ../src/guestfs-actions.pod:4079
27908 " guestfs_lgetxattr (guestfs_h *g,\n"
27909 " const char *path,\n"
27910 " const char *name,\n"
27911 " size_t *size_r);\n"
27916 #: ../src/guestfs-actions.pod:4099
27917 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
27921 #: ../src/guestfs-actions.pod:4107
27922 msgid "guestfs_lgetxattrs"
27926 #: ../src/guestfs-actions.pod:4109
27929 " struct guestfs_xattr_list *\n"
27930 " guestfs_lgetxattrs (guestfs_h *g,\n"
27931 " const char *path);\n"
27936 #: ../src/guestfs-actions.pod:4113
27938 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
27939 "then it returns the extended attributes of the link itself."
27943 #: ../src/guestfs-actions.pod:4123
27944 msgid "guestfs_list_9p"
27948 #: ../src/guestfs-actions.pod:4125
27952 " guestfs_list_9p (guestfs_h *g);\n"
27957 #: ../src/guestfs-actions.pod:4137
27958 msgid "guestfs_list_devices"
27962 #: ../src/guestfs-actions.pod:4139
27966 " guestfs_list_devices (guestfs_h *g);\n"
27971 #: ../src/guestfs-actions.pod:4154
27972 msgid "guestfs_list_dm_devices"
27976 #: ../src/guestfs-actions.pod:4156
27980 " guestfs_list_dm_devices (guestfs_h *g);\n"
27985 #: ../src/guestfs-actions.pod:4161
27987 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
27988 "previous call to C<guestfs_luks_open>."
27992 #: ../src/guestfs-actions.pod:4164
27994 "Device mapper devices which correspond to logical volumes are I<not> "
27995 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
28000 #: ../src/guestfs-actions.pod:4172 ../src/guestfs-actions.pod:5618
28001 msgid "(Added in 1.11.15)"
28005 #: ../src/guestfs-actions.pod:4174
28006 msgid "guestfs_list_filesystems"
28010 #: ../src/guestfs-actions.pod:4176
28014 " guestfs_list_filesystems (guestfs_h *g);\n"
28019 #: ../src/guestfs-actions.pod:4196
28021 "This command runs other libguestfs commands, which might include "
28022 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
28023 "soon after launch and only when nothing is mounted."
28027 #: ../src/guestfs-actions.pod:4200
28029 "Not all of the filesystems returned will be mountable. In particular, swap "
28030 "partitions are returned in the list. Also this command does not check that "
28031 "each filesystem found is valid and mountable, and some filesystems might be "
28032 "mountable but require special options. Filesystems may not all belong to a "
28033 "single logical operating system (use C<guestfs_inspect_os> to look for "
28038 #: ../src/guestfs-actions.pod:4214 ../src/guestfs-actions.pod:5981
28039 msgid "(Added in 1.5.15)"
28043 #: ../src/guestfs-actions.pod:4216
28044 msgid "guestfs_list_partitions"
28048 #: ../src/guestfs-actions.pod:4218
28052 " guestfs_list_partitions (guestfs_h *g);\n"
28057 #: ../src/guestfs-actions.pod:4225
28059 "This does not return logical volumes. For that you will need to call "
28064 #: ../src/guestfs-actions.pod:4236
28069 #: ../src/guestfs-actions.pod:4238
28073 " guestfs_ll (guestfs_h *g,\n"
28074 " const char *directory);\n"
28079 #: ../src/guestfs-actions.pod:4253
28084 #: ../src/guestfs-actions.pod:4255
28088 " guestfs_ln (guestfs_h *g,\n"
28089 " const char *target,\n"
28090 " const char *linkname);\n"
28095 #: ../src/guestfs-actions.pod:4266
28096 msgid "guestfs_ln_f"
28100 #: ../src/guestfs-actions.pod:4268
28104 " guestfs_ln_f (guestfs_h *g,\n"
28105 " const char *target,\n"
28106 " const char *linkname);\n"
28111 #: ../src/guestfs-actions.pod:4280
28112 msgid "guestfs_ln_s"
28116 #: ../src/guestfs-actions.pod:4282
28120 " guestfs_ln_s (guestfs_h *g,\n"
28121 " const char *target,\n"
28122 " const char *linkname);\n"
28127 #: ../src/guestfs-actions.pod:4293
28128 msgid "guestfs_ln_sf"
28132 #: ../src/guestfs-actions.pod:4295
28136 " guestfs_ln_sf (guestfs_h *g,\n"
28137 " const char *target,\n"
28138 " const char *linkname);\n"
28143 #: ../src/guestfs-actions.pod:4307
28144 msgid "guestfs_lremovexattr"
28148 #: ../src/guestfs-actions.pod:4309
28152 " guestfs_lremovexattr (guestfs_h *g,\n"
28153 " const char *xattr,\n"
28154 " const char *path);\n"
28159 #: ../src/guestfs-actions.pod:4314
28161 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
28162 "link, then it removes an extended attribute of the link itself."
28166 #: ../src/guestfs-actions.pod:4322
28171 #: ../src/guestfs-actions.pod:4324
28175 " guestfs_ls (guestfs_h *g,\n"
28176 " const char *directory);\n"
28181 #: ../src/guestfs-actions.pod:4332
28183 "This command is mostly useful for interactive sessions. Programs should "
28184 "probably use C<guestfs_readdir> instead."
28188 #: ../src/guestfs-actions.pod:4341
28189 msgid "guestfs_lsetxattr"
28193 #: ../src/guestfs-actions.pod:4343
28197 " guestfs_lsetxattr (guestfs_h *g,\n"
28198 " const char *xattr,\n"
28199 " const char *val,\n"
28201 " const char *path);\n"
28206 #: ../src/guestfs-actions.pod:4350
28208 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
28209 "then it sets an extended attribute of the link itself."
28213 #: ../src/guestfs-actions.pod:4358
28214 msgid "guestfs_lstat"
28218 #: ../src/guestfs-actions.pod:4360
28221 " struct guestfs_stat *\n"
28222 " guestfs_lstat (guestfs_h *g,\n"
28223 " const char *path);\n"
28228 #: ../src/guestfs-actions.pod:4366
28230 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
28231 "link, then the link is stat-ed, not the file it refers to."
28235 #: ../src/guestfs-actions.pod:4372 ../src/guestfs-actions.pod:7171
28237 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
28238 "error. I<The caller must call C<guestfs_free_stat> after use>."
28242 #: ../src/guestfs-actions.pod:4376 ../src/guestfs-actions.pod:7175 ../src/guestfs-actions.pod:7193 ../src/guestfs-actions.pod:7574
28243 msgid "(Added in 0.9.2)"
28247 #: ../src/guestfs-actions.pod:4378
28248 msgid "guestfs_lstatlist"
28252 #: ../src/guestfs-actions.pod:4380
28255 " struct guestfs_stat_list *\n"
28256 " guestfs_lstatlist (guestfs_h *g,\n"
28257 " const char *path,\n"
28258 " char *const *names);\n"
28263 #: ../src/guestfs-actions.pod:4385
28265 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
28266 "files, where all files are in the directory C<path>. C<names> is the list "
28267 "of files from this directory."
28271 #: ../src/guestfs-actions.pod:4394
28273 "This call is intended for programs that want to efficiently list a directory "
28274 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
28275 "for a similarly efficient call for getting extended attributes. Very long "
28276 "directory listings might cause the protocol message size to be exceeded, "
28277 "causing this call to fail. The caller must split up such requests into "
28278 "smaller groups of names."
28282 #: ../src/guestfs-actions.pod:4402
28284 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
28285 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
28289 #: ../src/guestfs-actions.pod:4408
28290 msgid "guestfs_luks_add_key"
28294 #: ../src/guestfs-actions.pod:4410
28298 " guestfs_luks_add_key (guestfs_h *g,\n"
28299 " const char *device,\n"
28300 " const char *key,\n"
28301 " const char *newkey,\n"
28307 #: ../src/guestfs-actions.pod:4422
28309 "Note that if C<keyslot> already contains a key, then this command will "
28310 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
28314 #: ../src/guestfs-actions.pod:4428 ../src/guestfs-actions.pod:4468 ../src/guestfs-actions.pod:4491 ../src/guestfs-actions.pod:4511 ../src/guestfs-actions.pod:4546 ../src/guestfs-actions.pod:4565
28316 "This function takes a key or passphrase parameter which could contain "
28317 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
28322 #: ../src/guestfs-actions.pod:4432 ../src/guestfs-actions.pod:4472 ../src/guestfs-actions.pod:4495 ../src/guestfs-actions.pod:4515
28323 msgid "(Added in 1.5.2)"
28327 #: ../src/guestfs-actions.pod:4434
28328 msgid "guestfs_luks_close"
28332 #: ../src/guestfs-actions.pod:4436
28336 " guestfs_luks_close (guestfs_h *g,\n"
28337 " const char *device);\n"
28342 #: ../src/guestfs-actions.pod:4440
28344 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
28345 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
28346 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
28347 "underlying block device."
28351 #: ../src/guestfs-actions.pod:4448 ../src/guestfs-actions.pod:4550 ../src/guestfs-actions.pod:4569 ../src/guestfs-actions.pod:4619 ../src/guestfs-actions.pod:4667
28352 msgid "(Added in 1.5.1)"
28356 #: ../src/guestfs-actions.pod:4450
28357 msgid "guestfs_luks_format"
28361 #: ../src/guestfs-actions.pod:4452
28365 " guestfs_luks_format (guestfs_h *g,\n"
28366 " const char *device,\n"
28367 " const char *key,\n"
28373 #: ../src/guestfs-actions.pod:4474
28374 msgid "guestfs_luks_format_cipher"
28378 #: ../src/guestfs-actions.pod:4476
28382 " guestfs_luks_format_cipher (guestfs_h *g,\n"
28383 " const char *device,\n"
28384 " const char *key,\n"
28386 " const char *cipher);\n"
28391 #: ../src/guestfs-actions.pod:4483
28393 "This command is the same as C<guestfs_luks_format> but it also allows you to "
28394 "set the C<cipher> used."
28398 #: ../src/guestfs-actions.pod:4497
28399 msgid "guestfs_luks_kill_slot"
28403 #: ../src/guestfs-actions.pod:4499
28407 " guestfs_luks_kill_slot (guestfs_h *g,\n"
28408 " const char *device,\n"
28409 " const char *key,\n"
28415 #: ../src/guestfs-actions.pod:4517
28416 msgid "guestfs_luks_open"
28420 #: ../src/guestfs-actions.pod:4519
28424 " guestfs_luks_open (guestfs_h *g,\n"
28425 " const char *device,\n"
28426 " const char *key,\n"
28427 " const char *mapname);\n"
28432 #: ../src/guestfs-actions.pod:4537
28434 "If this block device contains LVM volume groups, then calling "
28435 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
28440 #: ../src/guestfs-actions.pod:4541
28441 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
28445 #: ../src/guestfs-actions.pod:4552
28446 msgid "guestfs_luks_open_ro"
28450 #: ../src/guestfs-actions.pod:4554
28454 " guestfs_luks_open_ro (guestfs_h *g,\n"
28455 " const char *device,\n"
28456 " const char *key,\n"
28457 " const char *mapname);\n"
28462 #: ../src/guestfs-actions.pod:4560
28464 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
28469 #: ../src/guestfs-actions.pod:4571
28470 msgid "guestfs_lvcreate"
28474 #: ../src/guestfs-actions.pod:4573
28478 " guestfs_lvcreate (guestfs_h *g,\n"
28479 " const char *logvol,\n"
28480 " const char *volgroup,\n"
28486 #: ../src/guestfs-actions.pod:4586
28487 msgid "guestfs_lvm_canonical_lv_name"
28491 #: ../src/guestfs-actions.pod:4588
28495 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
28496 " const char *lvname);\n"
28501 #: ../src/guestfs-actions.pod:4599
28502 msgid "See also C<guestfs_is_lv>."
28506 #: ../src/guestfs-actions.pod:4604
28507 msgid "(Added in 1.5.24)"
28511 #: ../src/guestfs-actions.pod:4606
28512 msgid "guestfs_lvm_clear_filter"
28516 #: ../src/guestfs-actions.pod:4608
28520 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
28525 #: ../src/guestfs-actions.pod:4611
28527 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
28528 "see every block device."
28532 #: ../src/guestfs-actions.pod:4621
28533 msgid "guestfs_lvm_remove_all"
28537 #: ../src/guestfs-actions.pod:4623
28541 " guestfs_lvm_remove_all (guestfs_h *g);\n"
28546 #: ../src/guestfs-actions.pod:4636
28547 msgid "guestfs_lvm_set_filter"
28551 #: ../src/guestfs-actions.pod:4638
28555 " guestfs_lvm_set_filter (guestfs_h *g,\n"
28556 " char *const *devices);\n"
28561 #: ../src/guestfs-actions.pod:4669
28562 msgid "guestfs_lvremove"
28566 #: ../src/guestfs-actions.pod:4671
28570 " guestfs_lvremove (guestfs_h *g,\n"
28571 " const char *device);\n"
28576 #: ../src/guestfs-actions.pod:4683 ../src/guestfs-actions.pod:6094 ../src/guestfs-actions.pod:7944
28577 msgid "(Added in 1.0.13)"
28581 #: ../src/guestfs-actions.pod:4685
28582 msgid "guestfs_lvrename"
28586 #: ../src/guestfs-actions.pod:4687
28590 " guestfs_lvrename (guestfs_h *g,\n"
28591 " const char *logvol,\n"
28592 " const char *newlogvol);\n"
28597 #: ../src/guestfs-actions.pod:4696 ../src/guestfs-actions.pod:7957
28598 msgid "(Added in 1.0.83)"
28602 #: ../src/guestfs-actions.pod:4698
28603 msgid "guestfs_lvresize"
28607 #: ../src/guestfs-actions.pod:4700
28611 " guestfs_lvresize (guestfs_h *g,\n"
28612 " const char *device,\n"
28618 #: ../src/guestfs-actions.pod:4713
28619 msgid "guestfs_lvresize_free"
28623 #: ../src/guestfs-actions.pod:4715
28627 " guestfs_lvresize_free (guestfs_h *g,\n"
28628 " const char *lv,\n"
28634 #: ../src/guestfs-actions.pod:4728
28635 msgid "(Added in 1.3.3)"
28639 #: ../src/guestfs-actions.pod:4730
28640 msgid "guestfs_lvs"
28644 #: ../src/guestfs-actions.pod:4732
28648 " guestfs_lvs (guestfs_h *g);\n"
28653 #: ../src/guestfs-actions.pod:4741
28654 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
28658 #: ../src/guestfs-actions.pod:4749
28659 msgid "guestfs_lvs_full"
28663 #: ../src/guestfs-actions.pod:4751
28666 " struct guestfs_lvm_lv_list *\n"
28667 " guestfs_lvs_full (guestfs_h *g);\n"
28672 #: ../src/guestfs-actions.pod:4757
28674 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
28675 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
28680 #: ../src/guestfs-actions.pod:4763
28681 msgid "guestfs_lvuuid"
28685 #: ../src/guestfs-actions.pod:4765
28689 " guestfs_lvuuid (guestfs_h *g,\n"
28690 " const char *device);\n"
28695 #: ../src/guestfs-actions.pod:4776
28696 msgid "guestfs_lxattrlist"
28700 #: ../src/guestfs-actions.pod:4778
28703 " struct guestfs_xattr_list *\n"
28704 " guestfs_lxattrlist (guestfs_h *g,\n"
28705 " const char *path,\n"
28706 " char *const *names);\n"
28711 #: ../src/guestfs-actions.pod:4797
28713 "This call is intended for programs that want to efficiently list a directory "
28714 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
28715 "a similarly efficient call for getting standard stats. Very long directory "
28716 "listings might cause the protocol message size to be exceeded, causing this "
28717 "call to fail. The caller must split up such requests into smaller groups of "
28722 #: ../src/guestfs-actions.pod:4811
28723 msgid "guestfs_mkdir"
28727 #: ../src/guestfs-actions.pod:4813
28731 " guestfs_mkdir (guestfs_h *g,\n"
28732 " const char *path);\n"
28737 #: ../src/guestfs-actions.pod:4823
28738 msgid "guestfs_mkdir_mode"
28742 #: ../src/guestfs-actions.pod:4825
28746 " guestfs_mkdir_mode (guestfs_h *g,\n"
28747 " const char *path,\n"
28753 #: ../src/guestfs-actions.pod:4837
28754 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
28758 #: ../src/guestfs-actions.pod:4843
28759 msgid "guestfs_mkdir_p"
28763 #: ../src/guestfs-actions.pod:4845
28767 " guestfs_mkdir_p (guestfs_h *g,\n"
28768 " const char *path);\n"
28773 #: ../src/guestfs-actions.pod:4856
28774 msgid "guestfs_mkdtemp"
28778 #: ../src/guestfs-actions.pod:4858
28782 " guestfs_mkdtemp (guestfs_h *g,\n"
28783 " const char *template);\n"
28788 #: ../src/guestfs-actions.pod:4886
28789 msgid "guestfs_mke2fs_J"
28793 #: ../src/guestfs-actions.pod:4888
28797 " guestfs_mke2fs_J (guestfs_h *g,\n"
28798 " const char *fstype,\n"
28799 " int blocksize,\n"
28800 " const char *device,\n"
28801 " const char *journal);\n"
28806 #: ../src/guestfs-actions.pod:4901
28807 msgid "See also C<guestfs_mke2journal>."
28811 #: ../src/guestfs-actions.pod:4905 ../src/guestfs-actions.pod:4923 ../src/guestfs-actions.pod:4941 ../src/guestfs-actions.pod:4957 ../src/guestfs-actions.pod:4971 ../src/guestfs-actions.pod:4985 ../src/guestfs-actions.pod:5044 ../src/guestfs-actions.pod:5321
28812 msgid "(Added in 1.0.68)"
28816 #: ../src/guestfs-actions.pod:4907
28817 msgid "guestfs_mke2fs_JL"
28821 #: ../src/guestfs-actions.pod:4909
28825 " guestfs_mke2fs_JL (guestfs_h *g,\n"
28826 " const char *fstype,\n"
28827 " int blocksize,\n"
28828 " const char *device,\n"
28829 " const char *label);\n"
28834 #: ../src/guestfs-actions.pod:4919
28835 msgid "See also C<guestfs_mke2journal_L>."
28839 #: ../src/guestfs-actions.pod:4925
28840 msgid "guestfs_mke2fs_JU"
28844 #: ../src/guestfs-actions.pod:4927
28848 " guestfs_mke2fs_JU (guestfs_h *g,\n"
28849 " const char *fstype,\n"
28850 " int blocksize,\n"
28851 " const char *device,\n"
28852 " const char *uuid);\n"
28857 #: ../src/guestfs-actions.pod:4937
28858 msgid "See also C<guestfs_mke2journal_U>."
28862 #: ../src/guestfs-actions.pod:4943
28863 msgid "guestfs_mke2journal"
28867 #: ../src/guestfs-actions.pod:4945
28871 " guestfs_mke2journal (guestfs_h *g,\n"
28872 " int blocksize,\n"
28873 " const char *device);\n"
28878 #: ../src/guestfs-actions.pod:4959
28879 msgid "guestfs_mke2journal_L"
28883 #: ../src/guestfs-actions.pod:4961
28887 " guestfs_mke2journal_L (guestfs_h *g,\n"
28888 " int blocksize,\n"
28889 " const char *label,\n"
28890 " const char *device);\n"
28895 #: ../src/guestfs-actions.pod:4973
28896 msgid "guestfs_mke2journal_U"
28900 #: ../src/guestfs-actions.pod:4975
28904 " guestfs_mke2journal_U (guestfs_h *g,\n"
28905 " int blocksize,\n"
28906 " const char *uuid,\n"
28907 " const char *device);\n"
28912 #: ../src/guestfs-actions.pod:4987
28913 msgid "guestfs_mkfifo"
28917 #: ../src/guestfs-actions.pod:4989
28921 " guestfs_mkfifo (guestfs_h *g,\n"
28923 " const char *path);\n"
28928 #: ../src/guestfs-actions.pod:4994
28930 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
28931 "is just a convenient wrapper around C<guestfs_mknod>."
28935 #: ../src/guestfs-actions.pod:5004
28936 msgid "guestfs_mkfs"
28940 #: ../src/guestfs-actions.pod:5006
28944 " guestfs_mkfs (guestfs_h *g,\n"
28945 " const char *fstype,\n"
28946 " const char *device);\n"
28951 #: ../src/guestfs-actions.pod:5019
28952 msgid "guestfs_mkfs_b"
28956 #: ../src/guestfs-actions.pod:5021
28960 " guestfs_mkfs_b (guestfs_h *g,\n"
28961 " const char *fstype,\n"
28962 " int blocksize,\n"
28963 " const char *device);\n"
28968 #: ../src/guestfs-actions.pod:5027
28970 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
28975 #: ../src/guestfs-actions.pod:5034
28977 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
28978 "block size of the resulting filesystem. Supported block sizes depend on the "
28979 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
28983 #: ../src/guestfs-actions.pod:5046
28984 msgid "guestfs_mkfs_opts"
28988 #: ../src/guestfs-actions.pod:5048
28992 " guestfs_mkfs_opts (guestfs_h *g,\n"
28993 " const char *fstype,\n"
28994 " const char *device,\n"
29000 #: ../src/guestfs-actions.pod:5059
29003 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
29004 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
29005 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
29006 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
29011 #: ../src/guestfs-actions.pod:5107
29012 msgid "(Added in 1.7.19)"
29016 #: ../src/guestfs-actions.pod:5109
29017 msgid "guestfs_mkfs_opts_va"
29021 #: ../src/guestfs-actions.pod:5111
29025 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
29026 " const char *fstype,\n"
29027 " const char *device,\n"
29028 " va_list args);\n"
29033 #: ../src/guestfs-actions.pod:5117
29034 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
29038 #: ../src/guestfs-actions.pod:5121
29039 msgid "guestfs_mkfs_opts_argv"
29043 #: ../src/guestfs-actions.pod:5123
29047 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
29048 " const char *fstype,\n"
29049 " const char *device,\n"
29050 " const struct guestfs_mkfs_opts_argv *optargs);\n"
29055 #: ../src/guestfs-actions.pod:5129
29056 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
29060 #: ../src/guestfs-actions.pod:5133
29061 msgid "guestfs_mkmountpoint"
29065 #: ../src/guestfs-actions.pod:5135
29069 " guestfs_mkmountpoint (guestfs_h *g,\n"
29070 " const char *exemptpath);\n"
29075 #: ../src/guestfs-actions.pod:5139
29077 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
29078 "that can be used to create extra mountpoints before mounting the first "
29083 #: ../src/guestfs-actions.pod:5163
29085 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
29086 "may get unexpected errors if you try to mix these calls. It is safest to "
29087 "manually unmount filesystems and remove mountpoints after use."
29091 #: ../src/guestfs-actions.pod:5167
29093 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
29094 "first, so for this to work for manual mountpoints, you must ensure that the "
29095 "innermost mountpoints have the longest pathnames, as in the example code "
29100 #: ../src/guestfs-actions.pod:5174
29102 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
29103 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
29104 "can also trigger these issues."
29108 #: ../src/guestfs-actions.pod:5180 ../src/guestfs-actions.pod:5486 ../src/guestfs-actions.pod:6514
29109 msgid "(Added in 1.0.62)"
29113 #: ../src/guestfs-actions.pod:5182
29114 msgid "guestfs_mknod"
29118 #: ../src/guestfs-actions.pod:5184
29122 " guestfs_mknod (guestfs_h *g,\n"
29126 " const char *path);\n"
29131 #: ../src/guestfs-actions.pod:5199
29133 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
29134 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
29135 "regular file). These constants are available in the standard Linux header "
29136 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
29137 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
29138 "the appropriate constant for you."
29142 #: ../src/guestfs-actions.pod:5213
29143 msgid "guestfs_mknod_b"
29147 #: ../src/guestfs-actions.pod:5215
29151 " guestfs_mknod_b (guestfs_h *g,\n"
29155 " const char *path);\n"
29160 #: ../src/guestfs-actions.pod:5222
29162 "This call creates a block device node called C<path> with mode C<mode> and "
29163 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29164 "wrapper around C<guestfs_mknod>."
29168 #: ../src/guestfs-actions.pod:5232
29169 msgid "guestfs_mknod_c"
29173 #: ../src/guestfs-actions.pod:5234
29177 " guestfs_mknod_c (guestfs_h *g,\n"
29181 " const char *path);\n"
29186 #: ../src/guestfs-actions.pod:5241
29188 "This call creates a char device node called C<path> with mode C<mode> and "
29189 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29190 "wrapper around C<guestfs_mknod>."
29194 #: ../src/guestfs-actions.pod:5251
29195 msgid "guestfs_mkswap"
29199 #: ../src/guestfs-actions.pod:5253
29203 " guestfs_mkswap (guestfs_h *g,\n"
29204 " const char *device);\n"
29209 #: ../src/guestfs-actions.pod:5263
29210 msgid "guestfs_mkswap_L"
29214 #: ../src/guestfs-actions.pod:5265
29218 " guestfs_mkswap_L (guestfs_h *g,\n"
29219 " const char *label,\n"
29220 " const char *device);\n"
29225 #: ../src/guestfs-actions.pod:5280
29226 msgid "guestfs_mkswap_U"
29230 #: ../src/guestfs-actions.pod:5282
29234 " guestfs_mkswap_U (guestfs_h *g,\n"
29235 " const char *uuid,\n"
29236 " const char *device);\n"
29241 #: ../src/guestfs-actions.pod:5293
29242 msgid "guestfs_mkswap_file"
29246 #: ../src/guestfs-actions.pod:5295
29250 " guestfs_mkswap_file (guestfs_h *g,\n"
29251 " const char *path);\n"
29256 #: ../src/guestfs-actions.pod:5301
29258 "This command just writes a swap file signature to an existing file. To "
29259 "create the file itself, use something like C<guestfs_fallocate>."
29263 #: ../src/guestfs-actions.pod:5308
29264 msgid "guestfs_modprobe"
29268 #: ../src/guestfs-actions.pod:5310
29272 " guestfs_modprobe (guestfs_h *g,\n"
29273 " const char *modulename);\n"
29278 #: ../src/guestfs-actions.pod:5323
29279 msgid "guestfs_mount"
29283 #: ../src/guestfs-actions.pod:5325
29287 " guestfs_mount (guestfs_h *g,\n"
29288 " const char *device,\n"
29289 " const char *mountpoint);\n"
29294 #: ../src/guestfs-actions.pod:5344
29296 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
29297 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
29298 "problems for users. If your program might need to work with older versions "
29299 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
29300 "for the first parameter if you don't want any options)."
29304 #: ../src/guestfs-actions.pod:5355
29305 msgid "guestfs_mount_9p"
29309 #: ../src/guestfs-actions.pod:5357
29313 " guestfs_mount_9p (guestfs_h *g,\n"
29314 " const char *mounttag,\n"
29315 " const char *mountpoint,\n"
29321 #: ../src/guestfs-actions.pod:5368
29324 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
29329 #: ../src/guestfs-actions.pod:5381
29330 msgid "guestfs_mount_9p_va"
29334 #: ../src/guestfs-actions.pod:5383
29338 " guestfs_mount_9p_va (guestfs_h *g,\n"
29339 " const char *mounttag,\n"
29340 " const char *mountpoint,\n"
29341 " va_list args);\n"
29346 #: ../src/guestfs-actions.pod:5389
29347 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
29351 #: ../src/guestfs-actions.pod:5393
29352 msgid "guestfs_mount_9p_argv"
29356 #: ../src/guestfs-actions.pod:5395
29360 " guestfs_mount_9p_argv (guestfs_h *g,\n"
29361 " const char *mounttag,\n"
29362 " const char *mountpoint,\n"
29363 " const struct guestfs_mount_9p_argv *optargs);\n"
29368 #: ../src/guestfs-actions.pod:5401
29369 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
29373 #: ../src/guestfs-actions.pod:5405
29374 msgid "guestfs_mount_loop"
29378 #: ../src/guestfs-actions.pod:5407
29382 " guestfs_mount_loop (guestfs_h *g,\n"
29383 " const char *file,\n"
29384 " const char *mountpoint);\n"
29389 #: ../src/guestfs-actions.pod:5420
29390 msgid "guestfs_mount_options"
29394 #: ../src/guestfs-actions.pod:5422
29398 " guestfs_mount_options (guestfs_h *g,\n"
29399 " const char *options,\n"
29400 " const char *device,\n"
29401 " const char *mountpoint);\n"
29406 #: ../src/guestfs-actions.pod:5428
29408 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29409 "the mount options as for the L<mount(8)> I<-o> flag."
29413 #: ../src/guestfs-actions.pod:5438 ../src/guestfs-actions.pod:5452 ../src/guestfs-actions.pod:5469
29414 msgid "(Added in 1.0.10)"
29418 #: ../src/guestfs-actions.pod:5440
29419 msgid "guestfs_mount_ro"
29423 #: ../src/guestfs-actions.pod:5442
29427 " guestfs_mount_ro (guestfs_h *g,\n"
29428 " const char *device,\n"
29429 " const char *mountpoint);\n"
29434 #: ../src/guestfs-actions.pod:5447
29436 "This is the same as the C<guestfs_mount> command, but it mounts the "
29437 "filesystem with the read-only (I<-o ro>) flag."
29441 #: ../src/guestfs-actions.pod:5454
29442 msgid "guestfs_mount_vfs"
29446 #: ../src/guestfs-actions.pod:5456
29450 " guestfs_mount_vfs (guestfs_h *g,\n"
29451 " const char *options,\n"
29452 " const char *vfstype,\n"
29453 " const char *device,\n"
29454 " const char *mountpoint);\n"
29459 #: ../src/guestfs-actions.pod:5463
29461 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29462 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
29467 #: ../src/guestfs-actions.pod:5471
29468 msgid "guestfs_mountpoints"
29472 #: ../src/guestfs-actions.pod:5473
29476 " guestfs_mountpoints (guestfs_h *g);\n"
29481 #: ../src/guestfs-actions.pod:5476
29483 "This call is similar to C<guestfs_mounts>. That call returns a list of "
29484 "devices. This one returns a hash table (map) of device name to directory "
29485 "where the device is mounted."
29489 #: ../src/guestfs-actions.pod:5488
29490 msgid "guestfs_mounts"
29494 #: ../src/guestfs-actions.pod:5490
29498 " guestfs_mounts (guestfs_h *g);\n"
29503 #: ../src/guestfs-actions.pod:5498
29504 msgid "See also: C<guestfs_mountpoints>"
29508 #: ../src/guestfs-actions.pod:5506
29513 #: ../src/guestfs-actions.pod:5508
29517 " guestfs_mv (guestfs_h *g,\n"
29518 " const char *src,\n"
29519 " const char *dest);\n"
29524 #: ../src/guestfs-actions.pod:5520
29525 msgid "guestfs_ntfs_3g_probe"
29529 #: ../src/guestfs-actions.pod:5522
29533 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
29535 " const char *device);\n"
29540 #: ../src/guestfs-actions.pod:5541
29541 msgid "(Added in 1.0.43)"
29545 #: ../src/guestfs-actions.pod:5543
29546 msgid "guestfs_ntfsresize"
29550 #: ../src/guestfs-actions.pod:5545
29554 " guestfs_ntfsresize (guestfs_h *g,\n"
29555 " const char *device);\n"
29560 #: ../src/guestfs-actions.pod:5549 ../src/guestfs-actions.pod:5649
29562 "I<This function is deprecated.> In new code, use the "
29563 "L</guestfs_ntfsresize_opts> call instead."
29567 #: ../src/guestfs-actions.pod:5573
29568 msgid "guestfs_ntfsresize_opts"
29572 #: ../src/guestfs-actions.pod:5575
29576 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
29577 " const char *device,\n"
29583 #: ../src/guestfs-actions.pod:5585
29586 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
29587 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
29592 #: ../src/guestfs-actions.pod:5605
29594 "After the resize operation, the filesystem is always marked as requiring a "
29595 "consistency check (for safety). You have to boot into Windows to perform "
29596 "this check and clear this condition. If you I<don't> set the C<force> "
29597 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
29598 "times on a single filesystem without booting into Windows between each "
29603 #: ../src/guestfs-actions.pod:5620
29604 msgid "guestfs_ntfsresize_opts_va"
29608 #: ../src/guestfs-actions.pod:5622
29612 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
29613 " const char *device,\n"
29614 " va_list args);\n"
29619 #: ../src/guestfs-actions.pod:5627
29620 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
29624 #: ../src/guestfs-actions.pod:5631
29625 msgid "guestfs_ntfsresize_opts_argv"
29629 #: ../src/guestfs-actions.pod:5633
29633 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
29634 " const char *device,\n"
29635 " const struct guestfs_ntfsresize_opts_argv "
29641 #: ../src/guestfs-actions.pod:5638
29642 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
29646 #: ../src/guestfs-actions.pod:5642
29647 msgid "guestfs_ntfsresize_size"
29651 #: ../src/guestfs-actions.pod:5644
29655 " guestfs_ntfsresize_size (guestfs_h *g,\n"
29656 " const char *device,\n"
29657 " int64_t size);\n"
29662 #: ../src/guestfs-actions.pod:5656
29664 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
29665 "to specify the new size (in bytes) explicitly."
29669 #: ../src/guestfs-actions.pod:5661 ../src/guestfs-actions.pod:6121 ../src/guestfs-actions.pod:6194 ../src/guestfs-actions.pod:6462 ../src/guestfs-actions.pod:8101
29670 msgid "(Added in 1.3.14)"
29674 #: ../src/guestfs-actions.pod:5663
29675 msgid "guestfs_part_add"
29679 #: ../src/guestfs-actions.pod:5665
29683 " guestfs_part_add (guestfs_h *g,\n"
29684 " const char *device,\n"
29685 " const char *prlogex,\n"
29686 " int64_t startsect,\n"
29687 " int64_t endsect);\n"
29692 #: ../src/guestfs-actions.pod:5672
29694 "This command adds a partition to C<device>. If there is no partition table "
29695 "on the device, call C<guestfs_part_init> first."
29699 #: ../src/guestfs-actions.pod:5684
29701 "Creating a partition which covers the whole disk is not so easy. Use "
29702 "C<guestfs_part_disk> to do that."
29706 #: ../src/guestfs-actions.pod:5689 ../src/guestfs-actions.pod:5727 ../src/guestfs-actions.pod:5780 ../src/guestfs-actions.pod:5864 ../src/guestfs-actions.pod:5902 ../src/guestfs-actions.pod:5921 ../src/guestfs-actions.pod:5961
29707 msgid "(Added in 1.0.78)"
29711 #: ../src/guestfs-actions.pod:5691
29712 msgid "guestfs_part_del"
29716 #: ../src/guestfs-actions.pod:5693
29720 " guestfs_part_del (guestfs_h *g,\n"
29721 " const char *device,\n"
29727 #: ../src/guestfs-actions.pod:5708
29728 msgid "guestfs_part_disk"
29732 #: ../src/guestfs-actions.pod:5710
29736 " guestfs_part_disk (guestfs_h *g,\n"
29737 " const char *device,\n"
29738 " const char *parttype);\n"
29743 #: ../src/guestfs-actions.pod:5715
29745 "This command is simply a combination of C<guestfs_part_init> followed by "
29746 "C<guestfs_part_add> to create a single primary partition covering the whole "
29751 #: ../src/guestfs-actions.pod:5719
29753 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
29754 "possible values are described in C<guestfs_part_init>."
29758 #: ../src/guestfs-actions.pod:5729
29759 msgid "guestfs_part_get_bootable"
29763 #: ../src/guestfs-actions.pod:5731
29767 " guestfs_part_get_bootable (guestfs_h *g,\n"
29768 " const char *device,\n"
29774 #: ../src/guestfs-actions.pod:5739
29775 msgid "See also C<guestfs_part_set_bootable>."
29779 #: ../src/guestfs-actions.pod:5745
29780 msgid "guestfs_part_get_mbr_id"
29784 #: ../src/guestfs-actions.pod:5747
29788 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
29789 " const char *device,\n"
29795 #: ../src/guestfs-actions.pod:5755 ../src/guestfs-actions.pod:5937
29797 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
29798 "undefined results for other partition table types (see "
29799 "C<guestfs_part_get_parttype>)."
29803 #: ../src/guestfs-actions.pod:5763
29804 msgid "guestfs_part_get_parttype"
29808 #: ../src/guestfs-actions.pod:5765
29812 " guestfs_part_get_parttype (guestfs_h *g,\n"
29813 " const char *device);\n"
29818 #: ../src/guestfs-actions.pod:5772
29820 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
29821 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
29822 "possible, although unusual. See C<guestfs_part_init> for a full list."
29826 #: ../src/guestfs-actions.pod:5782
29827 msgid "guestfs_part_init"
29831 #: ../src/guestfs-actions.pod:5784
29835 " guestfs_part_init (guestfs_h *g,\n"
29836 " const char *device,\n"
29837 " const char *parttype);\n"
29842 #: ../src/guestfs-actions.pod:5793
29844 "Initially there are no partitions. Following this, you should call "
29845 "C<guestfs_part_add> for each partition required."
29849 #: ../src/guestfs-actions.pod:5866
29850 msgid "guestfs_part_list"
29854 #: ../src/guestfs-actions.pod:5868
29857 " struct guestfs_partition_list *\n"
29858 " guestfs_part_list (guestfs_h *g,\n"
29859 " const char *device);\n"
29864 #: ../src/guestfs-actions.pod:5885
29866 "Start of the partition I<in bytes>. To get sectors you have to divide by "
29867 "the device's sector size, see C<guestfs_blockdev_getss>."
29871 #: ../src/guestfs-actions.pod:5898
29873 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
29874 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
29879 #: ../src/guestfs-actions.pod:5904
29880 msgid "guestfs_part_set_bootable"
29884 #: ../src/guestfs-actions.pod:5906
29888 " guestfs_part_set_bootable (guestfs_h *g,\n"
29889 " const char *device,\n"
29891 " int bootable);\n"
29896 #: ../src/guestfs-actions.pod:5923
29897 msgid "guestfs_part_set_mbr_id"
29901 #: ../src/guestfs-actions.pod:5925
29905 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
29906 " const char *device,\n"
29913 #: ../src/guestfs-actions.pod:5945
29914 msgid "guestfs_part_set_name"
29918 #: ../src/guestfs-actions.pod:5947
29922 " guestfs_part_set_name (guestfs_h *g,\n"
29923 " const char *device,\n"
29925 " const char *name);\n"
29930 #: ../src/guestfs-actions.pod:5963
29931 msgid "guestfs_part_to_dev"
29935 #: ../src/guestfs-actions.pod:5965
29939 " guestfs_part_to_dev (guestfs_h *g,\n"
29940 " const char *partition);\n"
29945 #: ../src/guestfs-actions.pod:5973 ../src/guestfs-actions.pod:5992
29947 "The named partition must exist, for example as a string returned from "
29948 "C<guestfs_list_partitions>."
29952 #: ../src/guestfs-actions.pod:5976
29953 msgid "See also C<guestfs_part_to_partnum>."
29957 #: ../src/guestfs-actions.pod:5983
29958 msgid "guestfs_part_to_partnum"
29962 #: ../src/guestfs-actions.pod:5985
29966 " guestfs_part_to_partnum (guestfs_h *g,\n"
29967 " const char *partition);\n"
29972 #: ../src/guestfs-actions.pod:5995
29973 msgid "See also C<guestfs_part_to_dev>."
29977 #: ../src/guestfs-actions.pod:5999
29978 msgid "guestfs_ping_daemon"
29982 #: ../src/guestfs-actions.pod:6001
29986 " guestfs_ping_daemon (guestfs_h *g);\n"
29991 #: ../src/guestfs-actions.pod:6013
29992 msgid "guestfs_pread"
29996 #: ../src/guestfs-actions.pod:6015
30000 " guestfs_pread (guestfs_h *g,\n"
30001 " const char *path,\n"
30003 " int64_t offset,\n"
30004 " size_t *size_r);\n"
30009 #: ../src/guestfs-actions.pod:6028
30010 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
30014 #: ../src/guestfs-actions.pod:6039
30015 msgid "guestfs_pread_device"
30019 #: ../src/guestfs-actions.pod:6041
30023 " guestfs_pread_device (guestfs_h *g,\n"
30024 " const char *device,\n"
30026 " int64_t offset,\n"
30027 " size_t *size_r);\n"
30032 #: ../src/guestfs-actions.pod:6054
30033 msgid "See also C<guestfs_pread>."
30037 #: ../src/guestfs-actions.pod:6063
30038 msgid "(Added in 1.5.21)"
30042 #: ../src/guestfs-actions.pod:6065
30043 msgid "guestfs_pvcreate"
30047 #: ../src/guestfs-actions.pod:6067
30051 " guestfs_pvcreate (guestfs_h *g,\n"
30052 " const char *device);\n"
30057 #: ../src/guestfs-actions.pod:6079
30058 msgid "guestfs_pvremove"
30062 #: ../src/guestfs-actions.pod:6081
30066 " guestfs_pvremove (guestfs_h *g,\n"
30067 " const char *device);\n"
30072 #: ../src/guestfs-actions.pod:6096
30073 msgid "guestfs_pvresize"
30077 #: ../src/guestfs-actions.pod:6098
30081 " guestfs_pvresize (guestfs_h *g,\n"
30082 " const char *device);\n"
30087 #: ../src/guestfs-actions.pod:6109
30088 msgid "guestfs_pvresize_size"
30092 #: ../src/guestfs-actions.pod:6111
30096 " guestfs_pvresize_size (guestfs_h *g,\n"
30097 " const char *device,\n"
30098 " int64_t size);\n"
30103 #: ../src/guestfs-actions.pod:6116
30105 "This command is the same as C<guestfs_pvresize> except that it allows you to "
30106 "specify the new size (in bytes) explicitly."
30110 #: ../src/guestfs-actions.pod:6123
30111 msgid "guestfs_pvs"
30115 #: ../src/guestfs-actions.pod:6125
30119 " guestfs_pvs (guestfs_h *g);\n"
30124 #: ../src/guestfs-actions.pod:6134
30125 msgid "See also C<guestfs_pvs_full>."
30129 #: ../src/guestfs-actions.pod:6142
30130 msgid "guestfs_pvs_full"
30134 #: ../src/guestfs-actions.pod:6144
30137 " struct guestfs_lvm_pv_list *\n"
30138 " guestfs_pvs_full (guestfs_h *g);\n"
30143 #: ../src/guestfs-actions.pod:6150
30145 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
30146 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
30151 #: ../src/guestfs-actions.pod:6156
30152 msgid "guestfs_pvuuid"
30156 #: ../src/guestfs-actions.pod:6158
30160 " guestfs_pvuuid (guestfs_h *g,\n"
30161 " const char *device);\n"
30166 #: ../src/guestfs-actions.pod:6169
30167 msgid "guestfs_pwrite"
30171 #: ../src/guestfs-actions.pod:6171
30175 " guestfs_pwrite (guestfs_h *g,\n"
30176 " const char *path,\n"
30177 " const char *content,\n"
30178 " size_t content_size,\n"
30179 " int64_t offset);\n"
30184 #: ../src/guestfs-actions.pod:6187
30185 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
30189 #: ../src/guestfs-actions.pod:6196
30190 msgid "guestfs_pwrite_device"
30194 #: ../src/guestfs-actions.pod:6198
30198 " guestfs_pwrite_device (guestfs_h *g,\n"
30199 " const char *device,\n"
30200 " const char *content,\n"
30201 " size_t content_size,\n"
30202 " int64_t offset);\n"
30207 #: ../src/guestfs-actions.pod:6213
30208 msgid "See also C<guestfs_pwrite>."
30212 #: ../src/guestfs-actions.pod:6220
30213 msgid "(Added in 1.5.20)"
30217 #: ../src/guestfs-actions.pod:6222
30218 msgid "guestfs_read_file"
30222 #: ../src/guestfs-actions.pod:6224
30226 " guestfs_read_file (guestfs_h *g,\n"
30227 " const char *path,\n"
30228 " size_t *size_r);\n"
30233 #: ../src/guestfs-actions.pod:6232
30235 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
30236 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
30237 "function is limited in the total size of file that can be handled."
30241 #: ../src/guestfs-actions.pod:6244
30242 msgid "(Added in 1.0.63)"
30246 #: ../src/guestfs-actions.pod:6246
30247 msgid "guestfs_read_lines"
30251 #: ../src/guestfs-actions.pod:6248
30255 " guestfs_read_lines (guestfs_h *g,\n"
30256 " const char *path);\n"
30261 #: ../src/guestfs-actions.pod:6257
30263 "Note that this function cannot correctly handle binary files (specifically, "
30264 "files containing C<\\0> character which is treated as end of line). For "
30265 "those you need to use the C<guestfs_read_file> function which has a more "
30266 "complex interface."
30270 #: ../src/guestfs-actions.pod:6268
30271 msgid "guestfs_readdir"
30275 #: ../src/guestfs-actions.pod:6270
30278 " struct guestfs_dirent_list *\n"
30279 " guestfs_readdir (guestfs_h *g,\n"
30280 " const char *dir);\n"
30285 #: ../src/guestfs-actions.pod:6324
30287 "This function is primarily intended for use by programs. To get a simple "
30288 "list of names, use C<guestfs_ls>. To get a printable directory for human "
30289 "consumption, use C<guestfs_ll>."
30293 #: ../src/guestfs-actions.pod:6328
30295 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
30296 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
30301 #: ../src/guestfs-actions.pod:6334
30302 msgid "guestfs_readlink"
30306 #: ../src/guestfs-actions.pod:6336
30310 " guestfs_readlink (guestfs_h *g,\n"
30311 " const char *path);\n"
30316 #: ../src/guestfs-actions.pod:6347
30317 msgid "guestfs_readlinklist"
30321 #: ../src/guestfs-actions.pod:6349
30325 " guestfs_readlinklist (guestfs_h *g,\n"
30326 " const char *path,\n"
30327 " char *const *names);\n"
30332 #: ../src/guestfs-actions.pod:6382
30333 msgid "guestfs_realpath"
30337 #: ../src/guestfs-actions.pod:6384
30341 " guestfs_realpath (guestfs_h *g,\n"
30342 " const char *path);\n"
30347 #: ../src/guestfs-actions.pod:6396
30348 msgid "guestfs_removexattr"
30352 #: ../src/guestfs-actions.pod:6398
30356 " guestfs_removexattr (guestfs_h *g,\n"
30357 " const char *xattr,\n"
30358 " const char *path);\n"
30363 #: ../src/guestfs-actions.pod:6406
30364 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
30368 #: ../src/guestfs-actions.pod:6412
30369 msgid "guestfs_resize2fs"
30373 #: ../src/guestfs-actions.pod:6414
30377 " guestfs_resize2fs (guestfs_h *g,\n"
30378 " const char *device);\n"
30383 #: ../src/guestfs-actions.pod:6421
30385 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
30386 "C<device> before calling this command. For unknown reasons C<resize2fs> "
30387 "sometimes gives an error about this and sometimes not. In any case, it is "
30388 "always safe to call C<guestfs_e2fsck_f> before calling this function."
30392 #: ../src/guestfs-actions.pod:6431
30393 msgid "guestfs_resize2fs_M"
30397 #: ../src/guestfs-actions.pod:6433
30401 " guestfs_resize2fs_M (guestfs_h *g,\n"
30402 " const char *device);\n"
30407 #: ../src/guestfs-actions.pod:6437
30409 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
30410 "resized to its minimum size. This works like the I<-M> option to the "
30411 "C<resize2fs> command."
30415 #: ../src/guestfs-actions.pod:6441
30417 "To get the resulting size of the filesystem you should call "
30418 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
30419 "These two numbers, multiplied together, give the resulting size of the "
30420 "minimal filesystem in bytes."
30424 #: ../src/guestfs-actions.pod:6450
30425 msgid "guestfs_resize2fs_size"
30429 #: ../src/guestfs-actions.pod:6452
30433 " guestfs_resize2fs_size (guestfs_h *g,\n"
30434 " const char *device,\n"
30435 " int64_t size);\n"
30440 #: ../src/guestfs-actions.pod:6457
30442 "This command is the same as C<guestfs_resize2fs> except that it allows you "
30443 "to specify the new size (in bytes) explicitly."
30447 #: ../src/guestfs-actions.pod:6464
30452 #: ../src/guestfs-actions.pod:6466
30456 " guestfs_rm (guestfs_h *g,\n"
30457 " const char *path);\n"
30462 #: ../src/guestfs-actions.pod:6476
30463 msgid "guestfs_rm_rf"
30467 #: ../src/guestfs-actions.pod:6478
30471 " guestfs_rm_rf (guestfs_h *g,\n"
30472 " const char *path);\n"
30477 #: ../src/guestfs-actions.pod:6490
30478 msgid "guestfs_rmdir"
30482 #: ../src/guestfs-actions.pod:6492
30486 " guestfs_rmdir (guestfs_h *g,\n"
30487 " const char *path);\n"
30492 #: ../src/guestfs-actions.pod:6502
30493 msgid "guestfs_rmmountpoint"
30497 #: ../src/guestfs-actions.pod:6504
30501 " guestfs_rmmountpoint (guestfs_h *g,\n"
30502 " const char *exemptpath);\n"
30507 #: ../src/guestfs-actions.pod:6508
30509 "This calls removes a mountpoint that was previously created with "
30510 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
30514 #: ../src/guestfs-actions.pod:6516
30515 msgid "guestfs_scrub_device"
30519 #: ../src/guestfs-actions.pod:6518
30523 " guestfs_scrub_device (guestfs_h *g,\n"
30524 " const char *device);\n"
30529 #: ../src/guestfs-actions.pod:6533 ../src/guestfs-actions.pod:6551 ../src/guestfs-actions.pod:6570
30530 msgid "(Added in 1.0.52)"
30534 #: ../src/guestfs-actions.pod:6535
30535 msgid "guestfs_scrub_file"
30539 #: ../src/guestfs-actions.pod:6537
30543 " guestfs_scrub_file (guestfs_h *g,\n"
30544 " const char *file);\n"
30549 #: ../src/guestfs-actions.pod:6553
30550 msgid "guestfs_scrub_freespace"
30554 #: ../src/guestfs-actions.pod:6555
30558 " guestfs_scrub_freespace (guestfs_h *g,\n"
30559 " const char *dir);\n"
30564 #: ../src/guestfs-actions.pod:6559
30566 "This command creates the directory C<dir> and then fills it with files until "
30567 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
30568 "and deletes them. The intention is to scrub any free space on the partition "
30569 "containing C<dir>."
30573 #: ../src/guestfs-actions.pod:6572
30574 msgid "guestfs_set_append"
30578 #: ../src/guestfs-actions.pod:6574
30582 " guestfs_set_append (guestfs_h *g,\n"
30583 " const char *append);\n"
30588 #: ../src/guestfs-actions.pod:6591
30589 msgid "guestfs_set_attach_method"
30593 #: ../src/guestfs-actions.pod:6593
30597 " guestfs_set_attach_method (guestfs_h *g,\n"
30598 " const char *attachmethod);\n"
30603 #: ../src/guestfs-actions.pod:6621
30604 msgid "guestfs_set_autosync"
30608 #: ../src/guestfs-actions.pod:6623
30612 " guestfs_set_autosync (guestfs_h *g,\n"
30613 " int autosync);\n"
30618 #: ../src/guestfs-actions.pod:6639
30619 msgid "guestfs_set_direct"
30623 #: ../src/guestfs-actions.pod:6641
30627 " guestfs_set_direct (guestfs_h *g,\n"
30633 #: ../src/guestfs-actions.pod:6649
30635 "One consequence of this is that log messages aren't caught by the library "
30636 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
30641 #: ../src/guestfs-actions.pod:6662
30642 msgid "guestfs_set_e2label"
30646 #: ../src/guestfs-actions.pod:6664
30650 " guestfs_set_e2label (guestfs_h *g,\n"
30651 " const char *device,\n"
30652 " const char *label);\n"
30657 #: ../src/guestfs-actions.pod:6673
30659 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
30660 "the existing label on a filesystem."
30664 #: ../src/guestfs-actions.pod:6680
30665 msgid "guestfs_set_e2uuid"
30669 #: ../src/guestfs-actions.pod:6682
30673 " guestfs_set_e2uuid (guestfs_h *g,\n"
30674 " const char *device,\n"
30675 " const char *uuid);\n"
30680 #: ../src/guestfs-actions.pod:6692
30682 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
30683 "the existing UUID of a filesystem."
30687 #: ../src/guestfs-actions.pod:6699
30688 msgid "guestfs_set_memsize"
30692 #: ../src/guestfs-actions.pod:6701
30696 " guestfs_set_memsize (guestfs_h *g,\n"
30702 #: ../src/guestfs-actions.pod:6705
30704 "This sets the memory size in megabytes allocated to the qemu subprocess. "
30705 "This only has any effect if called before C<guestfs_launch>."
30709 #: ../src/guestfs-actions.pod:6720
30710 msgid "guestfs_set_network"
30714 #: ../src/guestfs-actions.pod:6722
30718 " guestfs_set_network (guestfs_h *g,\n"
30724 #: ../src/guestfs-actions.pod:6732
30726 "You must call this before calling C<guestfs_launch>, otherwise it has no "
30731 #: ../src/guestfs-actions.pod:6739
30732 msgid "guestfs_set_path"
30736 #: ../src/guestfs-actions.pod:6741
30740 " guestfs_set_path (guestfs_h *g,\n"
30741 " const char *searchpath);\n"
30746 #: ../src/guestfs-actions.pod:6756
30747 msgid "guestfs_set_pgroup"
30751 #: ../src/guestfs-actions.pod:6758
30755 " guestfs_set_pgroup (guestfs_h *g,\n"
30761 #: ../src/guestfs-actions.pod:6775
30762 msgid "guestfs_set_qemu"
30766 #: ../src/guestfs-actions.pod:6777
30770 " guestfs_set_qemu (guestfs_h *g,\n"
30771 " const char *qemu);\n"
30776 #: ../src/guestfs-actions.pod:6803
30777 msgid "guestfs_set_recovery_proc"
30781 #: ../src/guestfs-actions.pod:6805
30785 " guestfs_set_recovery_proc (guestfs_h *g,\n"
30786 " int recoveryproc);\n"
30791 #: ../src/guestfs-actions.pod:6809
30793 "If this is called with the parameter C<false> then C<guestfs_launch> does "
30794 "not create a recovery process. The purpose of the recovery process is to "
30795 "stop runaway qemu processes in the case where the main program aborts "
30800 #: ../src/guestfs-actions.pod:6814
30802 "This only has any effect if called before C<guestfs_launch>, and the default "
30807 #: ../src/guestfs-actions.pod:6827
30808 msgid "guestfs_set_selinux"
30812 #: ../src/guestfs-actions.pod:6829
30816 " guestfs_set_selinux (guestfs_h *g,\n"
30822 #: ../src/guestfs-actions.pod:6846
30823 msgid "guestfs_set_smp"
30827 #: ../src/guestfs-actions.pod:6848
30831 " guestfs_set_smp (guestfs_h *g,\n"
30837 #: ../src/guestfs-actions.pod:6856
30838 msgid "This function must be called before C<guestfs_launch>."
30842 #: ../src/guestfs-actions.pod:6862
30843 msgid "guestfs_set_trace"
30847 #: ../src/guestfs-actions.pod:6864
30851 " guestfs_set_trace (guestfs_h *g,\n"
30857 #: ../src/guestfs-actions.pod:6878
30859 "Trace messages are normally sent to C<stderr>, unless you register a "
30860 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30864 #: ../src/guestfs-actions.pod:6886
30865 msgid "guestfs_set_verbose"
30869 #: ../src/guestfs-actions.pod:6888
30873 " guestfs_set_verbose (guestfs_h *g,\n"
30879 #: ../src/guestfs-actions.pod:6897
30881 "Verbose messages are normally sent to C<stderr>, unless you register a "
30882 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30886 #: ../src/guestfs-actions.pod:6905
30887 msgid "guestfs_setcon"
30891 #: ../src/guestfs-actions.pod:6907
30895 " guestfs_setcon (guestfs_h *g,\n"
30896 " const char *context);\n"
30901 #: ../src/guestfs-actions.pod:6920
30902 msgid "guestfs_setxattr"
30906 #: ../src/guestfs-actions.pod:6922
30910 " guestfs_setxattr (guestfs_h *g,\n"
30911 " const char *xattr,\n"
30912 " const char *val,\n"
30914 " const char *path);\n"
30919 #: ../src/guestfs-actions.pod:6933
30920 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
30924 #: ../src/guestfs-actions.pod:6939
30925 msgid "guestfs_sfdisk"
30929 #: ../src/guestfs-actions.pod:6941
30933 " guestfs_sfdisk (guestfs_h *g,\n"
30934 " const char *device,\n"
30938 " char *const *lines);\n"
30943 #: ../src/guestfs-actions.pod:6949 ../src/guestfs-actions.pod:6993 ../src/guestfs-actions.pod:7027
30945 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
30950 #: ../src/guestfs-actions.pod:6976
30951 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
30955 #: ../src/guestfs-actions.pod:6986
30956 msgid "guestfs_sfdiskM"
30960 #: ../src/guestfs-actions.pod:6988
30964 " guestfs_sfdiskM (guestfs_h *g,\n"
30965 " const char *device,\n"
30966 " char *const *lines);\n"
30971 #: ../src/guestfs-actions.pod:7000
30973 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
30974 "partition sizes are specified in megabytes only (rounded to the nearest "
30975 "cylinder) and you don't need to specify the cyls, heads and sectors "
30976 "parameters which were rarely if ever used anyway."
30980 #: ../src/guestfs-actions.pod:7006
30982 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
30983 "C<guestfs_part_disk>"
30987 #: ../src/guestfs-actions.pod:7016
30988 msgid "guestfs_sfdisk_N"
30992 #: ../src/guestfs-actions.pod:7018
30996 " guestfs_sfdisk_N (guestfs_h *g,\n"
30997 " const char *device,\n"
31002 " const char *line);\n"
31007 #: ../src/guestfs-actions.pod:7037
31009 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
31010 "for the cyls/heads/sectors parameters."
31014 #: ../src/guestfs-actions.pod:7040
31015 msgid "See also: C<guestfs_part_add>"
31019 #: ../src/guestfs-actions.pod:7049
31020 msgid "guestfs_sfdisk_disk_geometry"
31024 #: ../src/guestfs-actions.pod:7051
31028 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
31029 " const char *device);\n"
31034 #: ../src/guestfs-actions.pod:7055
31036 "This displays the disk geometry of C<device> read from the partition table. "
31037 "Especially in the case where the underlying block device has been resized, "
31038 "this can be different from the kernel's idea of the geometry (see "
31039 "C<guestfs_sfdisk_kernel_geometry>)."
31043 #: ../src/guestfs-actions.pod:7068
31044 msgid "guestfs_sfdisk_kernel_geometry"
31048 #: ../src/guestfs-actions.pod:7070
31052 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
31053 " const char *device);\n"
31058 #: ../src/guestfs-actions.pod:7084
31059 msgid "guestfs_sfdisk_l"
31063 #: ../src/guestfs-actions.pod:7086
31067 " guestfs_sfdisk_l (guestfs_h *g,\n"
31068 " const char *device);\n"
31073 #: ../src/guestfs-actions.pod:7090
31075 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
31080 #: ../src/guestfs-actions.pod:7101
31081 msgid "See also: C<guestfs_part_list>"
31085 #: ../src/guestfs-actions.pod:7108
31090 #: ../src/guestfs-actions.pod:7110
31094 " guestfs_sh (guestfs_h *g,\n"
31095 " const char *command);\n"
31100 #: ../src/guestfs-actions.pod:7117
31101 msgid "This is like C<guestfs_command>, but passes the command to:"
31105 #: ../src/guestfs-actions.pod:7125
31106 msgid "All the provisos about C<guestfs_command> apply to this call."
31110 #: ../src/guestfs-actions.pod:7132
31111 msgid "guestfs_sh_lines"
31115 #: ../src/guestfs-actions.pod:7134
31119 " guestfs_sh_lines (guestfs_h *g,\n"
31120 " const char *command);\n"
31125 #: ../src/guestfs-actions.pod:7138
31127 "This is the same as C<guestfs_sh>, but splits the result into a list of "
31132 #: ../src/guestfs-actions.pod:7141
31133 msgid "See also: C<guestfs_command_lines>"
31137 #: ../src/guestfs-actions.pod:7149
31138 msgid "guestfs_sleep"
31142 #: ../src/guestfs-actions.pod:7151
31146 " guestfs_sleep (guestfs_h *g,\n"
31152 #: ../src/guestfs-actions.pod:7159
31153 msgid "(Added in 1.0.41)"
31157 #: ../src/guestfs-actions.pod:7161 ../src/guestfs-structs.pod:109
31158 msgid "guestfs_stat"
31162 #: ../src/guestfs-actions.pod:7163
31165 " struct guestfs_stat *\n"
31166 " guestfs_stat (guestfs_h *g,\n"
31167 " const char *path);\n"
31172 #: ../src/guestfs-actions.pod:7177 ../src/guestfs-structs.pod:135
31173 msgid "guestfs_statvfs"
31177 #: ../src/guestfs-actions.pod:7179
31180 " struct guestfs_statvfs *\n"
31181 " guestfs_statvfs (guestfs_h *g,\n"
31182 " const char *path);\n"
31187 #: ../src/guestfs-actions.pod:7189
31189 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
31190 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
31194 #: ../src/guestfs-actions.pod:7195
31195 msgid "guestfs_strings"
31199 #: ../src/guestfs-actions.pod:7197
31203 " guestfs_strings (guestfs_h *g,\n"
31204 " const char *path);\n"
31209 #: ../src/guestfs-actions.pod:7213
31210 msgid "guestfs_strings_e"
31214 #: ../src/guestfs-actions.pod:7215
31218 " guestfs_strings_e (guestfs_h *g,\n"
31219 " const char *encoding,\n"
31220 " const char *path);\n"
31225 #: ../src/guestfs-actions.pod:7220
31227 "This is like the C<guestfs_strings> command, but allows you to specify the "
31228 "encoding of strings that are looked for in the source file C<path>."
31232 #: ../src/guestfs-actions.pod:7230
31234 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
31235 "ISO-8859-X (this is what C<guestfs_strings> uses)."
31239 #: ../src/guestfs-actions.pod:7268
31240 msgid "guestfs_swapoff_device"
31244 #: ../src/guestfs-actions.pod:7270
31248 " guestfs_swapoff_device (guestfs_h *g,\n"
31249 " const char *device);\n"
31254 #: ../src/guestfs-actions.pod:7274
31256 "This command disables the libguestfs appliance swap device or partition "
31257 "named C<device>. See C<guestfs_swapon_device>."
31261 #: ../src/guestfs-actions.pod:7282
31262 msgid "guestfs_swapoff_file"
31266 #: ../src/guestfs-actions.pod:7284
31270 " guestfs_swapoff_file (guestfs_h *g,\n"
31271 " const char *file);\n"
31276 #: ../src/guestfs-actions.pod:7294
31277 msgid "guestfs_swapoff_label"
31281 #: ../src/guestfs-actions.pod:7296
31285 " guestfs_swapoff_label (guestfs_h *g,\n"
31286 " const char *label);\n"
31291 #: ../src/guestfs-actions.pod:7307
31292 msgid "guestfs_swapoff_uuid"
31296 #: ../src/guestfs-actions.pod:7309
31300 " guestfs_swapoff_uuid (guestfs_h *g,\n"
31301 " const char *uuid);\n"
31306 #: ../src/guestfs-actions.pod:7320
31307 msgid "guestfs_swapon_device"
31311 #: ../src/guestfs-actions.pod:7322
31315 " guestfs_swapon_device (guestfs_h *g,\n"
31316 " const char *device);\n"
31321 #: ../src/guestfs-actions.pod:7326
31323 "This command enables the libguestfs appliance to use the swap device or "
31324 "partition named C<device>. The increased memory is made available for all "
31325 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
31329 #: ../src/guestfs-actions.pod:7342
31330 msgid "guestfs_swapon_file"
31334 #: ../src/guestfs-actions.pod:7344
31338 " guestfs_swapon_file (guestfs_h *g,\n"
31339 " const char *file);\n"
31344 #: ../src/guestfs-actions.pod:7348
31346 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
31351 #: ../src/guestfs-actions.pod:7355
31352 msgid "guestfs_swapon_label"
31356 #: ../src/guestfs-actions.pod:7357
31360 " guestfs_swapon_label (guestfs_h *g,\n"
31361 " const char *label);\n"
31366 #: ../src/guestfs-actions.pod:7361
31368 "This command enables swap to a labeled swap partition. See "
31369 "C<guestfs_swapon_device> for other notes."
31373 #: ../src/guestfs-actions.pod:7368
31374 msgid "guestfs_swapon_uuid"
31378 #: ../src/guestfs-actions.pod:7370
31382 " guestfs_swapon_uuid (guestfs_h *g,\n"
31383 " const char *uuid);\n"
31388 #: ../src/guestfs-actions.pod:7374
31390 "This command enables swap to a swap partition with the given UUID. See "
31391 "C<guestfs_swapon_device> for other notes."
31395 #: ../src/guestfs-actions.pod:7381
31396 msgid "guestfs_sync"
31400 #: ../src/guestfs-actions.pod:7383
31404 " guestfs_sync (guestfs_h *g);\n"
31409 #: ../src/guestfs-actions.pod:7396
31410 msgid "guestfs_tail"
31414 #: ../src/guestfs-actions.pod:7398
31418 " guestfs_tail (guestfs_h *g,\n"
31419 " const char *path);\n"
31424 #: ../src/guestfs-actions.pod:7414
31425 msgid "guestfs_tail_n"
31429 #: ../src/guestfs-actions.pod:7416
31433 " guestfs_tail_n (guestfs_h *g,\n"
31435 " const char *path);\n"
31440 #: ../src/guestfs-actions.pod:7438
31441 msgid "guestfs_tar_in"
31445 #: ../src/guestfs-actions.pod:7440
31449 " guestfs_tar_in (guestfs_h *g,\n"
31450 " const char *tarfile,\n"
31451 " const char *directory);\n"
31456 #: ../src/guestfs-actions.pod:7448
31457 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
31461 #: ../src/guestfs-actions.pod:7453 ../src/guestfs-actions.pod:7470 ../src/guestfs-actions.pod:7486 ../src/guestfs-actions.pod:7502
31462 msgid "(Added in 1.0.3)"
31466 #: ../src/guestfs-actions.pod:7455
31467 msgid "guestfs_tar_out"
31471 #: ../src/guestfs-actions.pod:7457
31475 " guestfs_tar_out (guestfs_h *g,\n"
31476 " const char *directory,\n"
31477 " const char *tarfile);\n"
31482 #: ../src/guestfs-actions.pod:7465
31484 "To download a compressed tarball, use C<guestfs_tgz_out> or "
31485 "C<guestfs_txz_out>."
31489 #: ../src/guestfs-actions.pod:7472
31490 msgid "guestfs_tgz_in"
31494 #: ../src/guestfs-actions.pod:7474
31498 " guestfs_tgz_in (guestfs_h *g,\n"
31499 " const char *tarball,\n"
31500 " const char *directory);\n"
31505 #: ../src/guestfs-actions.pod:7482
31506 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
31510 #: ../src/guestfs-actions.pod:7488
31511 msgid "guestfs_tgz_out"
31515 #: ../src/guestfs-actions.pod:7490
31519 " guestfs_tgz_out (guestfs_h *g,\n"
31520 " const char *directory,\n"
31521 " const char *tarball);\n"
31526 #: ../src/guestfs-actions.pod:7498
31527 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
31531 #: ../src/guestfs-actions.pod:7504
31532 msgid "guestfs_touch"
31536 #: ../src/guestfs-actions.pod:7506
31540 " guestfs_touch (guestfs_h *g,\n"
31541 " const char *path);\n"
31546 #: ../src/guestfs-actions.pod:7521
31547 msgid "guestfs_truncate"
31551 #: ../src/guestfs-actions.pod:7523
31555 " guestfs_truncate (guestfs_h *g,\n"
31556 " const char *path);\n"
31561 #: ../src/guestfs-actions.pod:7534
31562 msgid "guestfs_truncate_size"
31566 #: ../src/guestfs-actions.pod:7536
31570 " guestfs_truncate_size (guestfs_h *g,\n"
31571 " const char *path,\n"
31572 " int64_t size);\n"
31577 #: ../src/guestfs-actions.pod:7544
31579 "If the current file size is less than C<size> then the file is extended to "
31580 "the required size with zero bytes. This creates a sparse file (ie. disk "
31581 "blocks are not allocated for the file until you write to it). To create a "
31582 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
31586 #: ../src/guestfs-actions.pod:7554
31587 msgid "guestfs_tune2fs_l"
31591 #: ../src/guestfs-actions.pod:7556
31595 " guestfs_tune2fs_l (guestfs_h *g,\n"
31596 " const char *device);\n"
31601 #: ../src/guestfs-actions.pod:7576
31602 msgid "guestfs_txz_in"
31606 #: ../src/guestfs-actions.pod:7578
31610 " guestfs_txz_in (guestfs_h *g,\n"
31611 " const char *tarball,\n"
31612 " const char *directory);\n"
31617 #: ../src/guestfs-actions.pod:7590
31618 msgid "guestfs_txz_out"
31622 #: ../src/guestfs-actions.pod:7592
31626 " guestfs_txz_out (guestfs_h *g,\n"
31627 " const char *directory,\n"
31628 " const char *tarball);\n"
31633 #: ../src/guestfs-actions.pod:7604
31634 msgid "guestfs_umask"
31638 #: ../src/guestfs-actions.pod:7606
31642 " guestfs_umask (guestfs_h *g,\n"
31648 #: ../src/guestfs-actions.pod:7622
31650 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
31651 "C<guestfs_mkdir>."
31655 #: ../src/guestfs-actions.pod:7631
31656 msgid "guestfs_umount"
31660 #: ../src/guestfs-actions.pod:7633
31664 " guestfs_umount (guestfs_h *g,\n"
31665 " const char *pathordevice);\n"
31670 #: ../src/guestfs-actions.pod:7645
31671 msgid "guestfs_umount_all"
31675 #: ../src/guestfs-actions.pod:7647
31679 " guestfs_umount_all (guestfs_h *g);\n"
31684 #: ../src/guestfs-actions.pod:7658
31685 msgid "guestfs_upload"
31689 #: ../src/guestfs-actions.pod:7660
31693 " guestfs_upload (guestfs_h *g,\n"
31694 " const char *filename,\n"
31695 " const char *remotefilename);\n"
31700 #: ../src/guestfs-actions.pod:7670
31701 msgid "See also C<guestfs_download>."
31705 #: ../src/guestfs-actions.pod:7681
31706 msgid "guestfs_upload_offset"
31710 #: ../src/guestfs-actions.pod:7683
31714 " guestfs_upload_offset (guestfs_h *g,\n"
31715 " const char *filename,\n"
31716 " const char *remotefilename,\n"
31717 " int64_t offset);\n"
31722 #: ../src/guestfs-actions.pod:7699
31724 "Note that there is no limit on the amount of data that can be uploaded with "
31725 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
31726 "full amount unless an error occurs."
31730 #: ../src/guestfs-actions.pod:7704
31731 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
31735 #: ../src/guestfs-actions.pod:7715
31736 msgid "guestfs_utimens"
31740 #: ../src/guestfs-actions.pod:7717
31744 " guestfs_utimens (guestfs_h *g,\n"
31745 " const char *path,\n"
31746 " int64_t atsecs,\n"
31747 " int64_t atnsecs,\n"
31748 " int64_t mtsecs,\n"
31749 " int64_t mtnsecs);\n"
31754 #: ../src/guestfs-actions.pod:7746 ../src/guestfs-structs.pod:175
31755 msgid "guestfs_version"
31759 #: ../src/guestfs-actions.pod:7748
31762 " struct guestfs_version *\n"
31763 " guestfs_version (guestfs_h *g);\n"
31768 #: ../src/guestfs-actions.pod:7776
31770 "I<Note:> Don't use this call to test for availability of features. In "
31771 "enterprise distributions we backport features from later versions into "
31772 "earlier versions, making this an unreliable way to test for features. Use "
31773 "C<guestfs_available> instead."
31777 #: ../src/guestfs-actions.pod:7782
31779 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
31780 "error. I<The caller must call C<guestfs_free_version> after use>."
31784 #: ../src/guestfs-actions.pod:7786
31785 msgid "(Added in 1.0.58)"
31789 #: ../src/guestfs-actions.pod:7788
31790 msgid "guestfs_vfs_label"
31794 #: ../src/guestfs-actions.pod:7790
31798 " guestfs_vfs_label (guestfs_h *g,\n"
31799 " const char *device);\n"
31804 #: ../src/guestfs-actions.pod:7799
31805 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
31809 #: ../src/guestfs-actions.pod:7804 ../src/guestfs-actions.pod:7841
31810 msgid "(Added in 1.3.18)"
31814 #: ../src/guestfs-actions.pod:7806
31815 msgid "guestfs_vfs_type"
31819 #: ../src/guestfs-actions.pod:7808
31823 " guestfs_vfs_type (guestfs_h *g,\n"
31824 " const char *device);\n"
31829 #: ../src/guestfs-actions.pod:7825
31830 msgid "guestfs_vfs_uuid"
31834 #: ../src/guestfs-actions.pod:7827
31838 " guestfs_vfs_uuid (guestfs_h *g,\n"
31839 " const char *device);\n"
31844 #: ../src/guestfs-actions.pod:7836
31845 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
31849 #: ../src/guestfs-actions.pod:7843
31850 msgid "guestfs_vg_activate"
31854 #: ../src/guestfs-actions.pod:7845
31858 " guestfs_vg_activate (guestfs_h *g,\n"
31860 " char *const *volgroups);\n"
31865 #: ../src/guestfs-actions.pod:7862
31866 msgid "guestfs_vg_activate_all"
31870 #: ../src/guestfs-actions.pod:7864
31874 " guestfs_vg_activate_all (guestfs_h *g,\n"
31875 " int activate);\n"
31880 #: ../src/guestfs-actions.pod:7877
31881 msgid "guestfs_vgcreate"
31885 #: ../src/guestfs-actions.pod:7879
31889 " guestfs_vgcreate (guestfs_h *g,\n"
31890 " const char *volgroup,\n"
31891 " char *const *physvols);\n"
31896 #: ../src/guestfs-actions.pod:7891
31897 msgid "guestfs_vglvuuids"
31901 #: ../src/guestfs-actions.pod:7893
31905 " guestfs_vglvuuids (guestfs_h *g,\n"
31906 " const char *vgname);\n"
31911 #: ../src/guestfs-actions.pod:7900
31913 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
31914 "associate logical volumes and volume groups."
31918 #: ../src/guestfs-actions.pod:7903
31919 msgid "See also C<guestfs_vgpvuuids>."
31923 #: ../src/guestfs-actions.pod:7911
31924 msgid "guestfs_vgpvuuids"
31928 #: ../src/guestfs-actions.pod:7913
31932 " guestfs_vgpvuuids (guestfs_h *g,\n"
31933 " const char *vgname);\n"
31938 #: ../src/guestfs-actions.pod:7920
31940 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
31941 "associate physical volumes and volume groups."
31945 #: ../src/guestfs-actions.pod:7923
31946 msgid "See also C<guestfs_vglvuuids>."
31950 #: ../src/guestfs-actions.pod:7931
31951 msgid "guestfs_vgremove"
31955 #: ../src/guestfs-actions.pod:7933
31959 " guestfs_vgremove (guestfs_h *g,\n"
31960 " const char *vgname);\n"
31965 #: ../src/guestfs-actions.pod:7946
31966 msgid "guestfs_vgrename"
31970 #: ../src/guestfs-actions.pod:7948
31974 " guestfs_vgrename (guestfs_h *g,\n"
31975 " const char *volgroup,\n"
31976 " const char *newvolgroup);\n"
31981 #: ../src/guestfs-actions.pod:7959
31982 msgid "guestfs_vgs"
31986 #: ../src/guestfs-actions.pod:7961
31990 " guestfs_vgs (guestfs_h *g);\n"
31995 #: ../src/guestfs-actions.pod:7970
31996 msgid "See also C<guestfs_vgs_full>."
32000 #: ../src/guestfs-actions.pod:7978
32001 msgid "guestfs_vgs_full"
32005 #: ../src/guestfs-actions.pod:7980
32008 " struct guestfs_lvm_vg_list *\n"
32009 " guestfs_vgs_full (guestfs_h *g);\n"
32014 #: ../src/guestfs-actions.pod:7986
32016 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
32017 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
32022 #: ../src/guestfs-actions.pod:7992
32023 msgid "guestfs_vgscan"
32027 #: ../src/guestfs-actions.pod:7994
32031 " guestfs_vgscan (guestfs_h *g);\n"
32036 #: ../src/guestfs-actions.pod:8004
32037 msgid "guestfs_vguuid"
32041 #: ../src/guestfs-actions.pod:8006
32045 " guestfs_vguuid (guestfs_h *g,\n"
32046 " const char *vgname);\n"
32051 #: ../src/guestfs-actions.pod:8017
32052 msgid "guestfs_wait_ready"
32056 #: ../src/guestfs-actions.pod:8019
32060 " guestfs_wait_ready (guestfs_h *g);\n"
32065 #: ../src/guestfs-actions.pod:8022
32067 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
32072 #: ../src/guestfs-actions.pod:8029
32073 msgid "This function is a no op."
32077 #: ../src/guestfs-actions.pod:8031
32079 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
32080 "calling C<guestfs_launch> to wait for the launch to complete. However this "
32081 "is no longer necessary because C<guestfs_launch> now does the waiting."
32085 #: ../src/guestfs-actions.pod:8036
32087 "If you see any calls to this function in code then you can just remove them, "
32088 "unless you want to retain compatibility with older versions of the API."
32092 #: ../src/guestfs-actions.pod:8044
32093 msgid "guestfs_wc_c"
32097 #: ../src/guestfs-actions.pod:8046
32101 " guestfs_wc_c (guestfs_h *g,\n"
32102 " const char *path);\n"
32107 #: ../src/guestfs-actions.pod:8057
32108 msgid "guestfs_wc_l"
32112 #: ../src/guestfs-actions.pod:8059
32116 " guestfs_wc_l (guestfs_h *g,\n"
32117 " const char *path);\n"
32122 #: ../src/guestfs-actions.pod:8070
32123 msgid "guestfs_wc_w"
32127 #: ../src/guestfs-actions.pod:8072
32131 " guestfs_wc_w (guestfs_h *g,\n"
32132 " const char *path);\n"
32137 #: ../src/guestfs-actions.pod:8083
32138 msgid "guestfs_write"
32142 #: ../src/guestfs-actions.pod:8085
32146 " guestfs_write (guestfs_h *g,\n"
32147 " const char *path,\n"
32148 " const char *content,\n"
32149 " size_t content_size);\n"
32154 #: ../src/guestfs-actions.pod:8094
32155 msgid "See also C<guestfs_write_append>."
32159 #: ../src/guestfs-actions.pod:8103
32160 msgid "guestfs_write_append"
32164 #: ../src/guestfs-actions.pod:8105
32168 " guestfs_write_append (guestfs_h *g,\n"
32169 " const char *path,\n"
32170 " const char *content,\n"
32171 " size_t content_size);\n"
32176 #: ../src/guestfs-actions.pod:8114
32177 msgid "See also C<guestfs_write>."
32181 #: ../src/guestfs-actions.pod:8123
32182 msgid "guestfs_write_file"
32186 #: ../src/guestfs-actions.pod:8125
32190 " guestfs_write_file (guestfs_h *g,\n"
32191 " const char *path,\n"
32192 " const char *content,\n"
32198 #: ../src/guestfs-actions.pod:8131
32200 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
32205 #: ../src/guestfs-actions.pod:8156
32206 msgid "guestfs_zegrep"
32210 #: ../src/guestfs-actions.pod:8158
32214 " guestfs_zegrep (guestfs_h *g,\n"
32215 " const char *regex,\n"
32216 " const char *path);\n"
32221 #: ../src/guestfs-actions.pod:8175
32222 msgid "guestfs_zegrepi"
32226 #: ../src/guestfs-actions.pod:8177
32230 " guestfs_zegrepi (guestfs_h *g,\n"
32231 " const char *regex,\n"
32232 " const char *path);\n"
32237 #: ../src/guestfs-actions.pod:8194
32238 msgid "guestfs_zero"
32242 #: ../src/guestfs-actions.pod:8196
32246 " guestfs_zero (guestfs_h *g,\n"
32247 " const char *device);\n"
32252 #: ../src/guestfs-actions.pod:8210
32254 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
32255 "C<guestfs_is_zero_device>"
32259 #: ../src/guestfs-actions.pod:8222
32260 msgid "guestfs_zero_device"
32264 #: ../src/guestfs-actions.pod:8224
32268 " guestfs_zero_device (guestfs_h *g,\n"
32269 " const char *device);\n"
32274 #: ../src/guestfs-actions.pod:8228
32276 "This command writes zeroes over the entire C<device>. Compare with "
32277 "C<guestfs_zero> which just zeroes the first few blocks of a device."
32281 #: ../src/guestfs-actions.pod:8246
32282 msgid "(Added in 1.3.1)"
32286 #: ../src/guestfs-actions.pod:8248
32287 msgid "guestfs_zerofree"
32291 #: ../src/guestfs-actions.pod:8250
32295 " guestfs_zerofree (guestfs_h *g,\n"
32296 " const char *device);\n"
32301 #: ../src/guestfs-actions.pod:8269
32302 msgid "guestfs_zfgrep"
32306 #: ../src/guestfs-actions.pod:8271
32310 " guestfs_zfgrep (guestfs_h *g,\n"
32311 " const char *pattern,\n"
32312 " const char *path);\n"
32317 #: ../src/guestfs-actions.pod:8288
32318 msgid "guestfs_zfgrepi"
32322 #: ../src/guestfs-actions.pod:8290
32326 " guestfs_zfgrepi (guestfs_h *g,\n"
32327 " const char *pattern,\n"
32328 " const char *path);\n"
32333 #: ../src/guestfs-actions.pod:8307
32334 msgid "guestfs_zfile"
32338 #: ../src/guestfs-actions.pod:8309
32342 " guestfs_zfile (guestfs_h *g,\n"
32343 " const char *meth,\n"
32344 " const char *path);\n"
32349 #: ../src/guestfs-actions.pod:8314
32351 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
32356 #: ../src/guestfs-actions.pod:8326
32358 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
32363 #: ../src/guestfs-actions.pod:8334
32364 msgid "guestfs_zgrep"
32368 #: ../src/guestfs-actions.pod:8336
32372 " guestfs_zgrep (guestfs_h *g,\n"
32373 " const char *regex,\n"
32374 " const char *path);\n"
32379 #: ../src/guestfs-actions.pod:8353
32380 msgid "guestfs_zgrepi"
32384 #: ../src/guestfs-actions.pod:8355
32388 " guestfs_zgrepi (guestfs_h *g,\n"
32389 " const char *regex,\n"
32390 " const char *path);\n"
32395 #: ../src/guestfs-availability.pod:3
32400 #: ../src/guestfs-availability.pod:5
32402 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
32403 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
32404 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
32405 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
32406 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
32410 #: ../src/guestfs-availability.pod:21
32415 #: ../src/guestfs-availability.pod:23
32416 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
32420 #: ../src/guestfs-availability.pod:26
32425 #: ../src/guestfs-availability.pod:28
32426 msgid "The following functions: L</guestfs_grub_install>"
32430 #: ../src/guestfs-availability.pod:31
32435 #: ../src/guestfs-availability.pod:33
32437 "The following functions: L</guestfs_inotify_add_watch> "
32438 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
32439 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
32443 #: ../src/guestfs-availability.pod:41
32444 msgid "B<linuxfsuuid>"
32448 #: ../src/guestfs-availability.pod:43
32450 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
32451 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
32455 #: ../src/guestfs-availability.pod:50
32456 msgid "B<linuxmodules>"
32460 #: ../src/guestfs-availability.pod:52
32461 msgid "The following functions: L</guestfs_modprobe>"
32465 #: ../src/guestfs-availability.pod:55
32466 msgid "B<linuxxattrs>"
32470 #: ../src/guestfs-availability.pod:57
32472 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
32473 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
32474 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
32475 "L</guestfs_setxattr>"
32479 #: ../src/guestfs-availability.pod:68
32484 #: ../src/guestfs-availability.pod:70
32486 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
32487 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
32488 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
32492 #: ../src/guestfs-availability.pod:79
32497 #: ../src/guestfs-availability.pod:81
32499 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
32500 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
32501 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
32502 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
32503 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
32504 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
32505 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
32506 "L</guestfs_vgs_full>"
32510 #: ../src/guestfs-availability.pod:104
32515 #: ../src/guestfs-availability.pod:106
32517 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
32518 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
32522 #: ../src/guestfs-availability.pod:112
32527 #: ../src/guestfs-availability.pod:114
32528 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
32532 #: ../src/guestfs-availability.pod:117
32533 msgid "B<ntfsprogs>"
32537 #: ../src/guestfs-availability.pod:119
32539 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
32540 "L</guestfs_ntfsresize_size>"
32544 #: ../src/guestfs-availability.pod:124
32545 msgid "B<realpath>"
32549 #: ../src/guestfs-availability.pod:126
32550 msgid "The following functions: L</guestfs_realpath>"
32554 #: ../src/guestfs-availability.pod:129
32559 #: ../src/guestfs-availability.pod:131
32561 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
32562 "L</guestfs_scrub_freespace>"
32566 #: ../src/guestfs-availability.pod:136
32571 #: ../src/guestfs-availability.pod:138
32572 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
32576 #: ../src/guestfs-availability.pod:142
32581 #: ../src/guestfs-availability.pod:144
32582 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
32586 #: ../src/guestfs-availability.pod:148
32587 msgid "B<zerofree>"
32591 #: ../src/guestfs-availability.pod:150
32592 msgid "The following functions: L</guestfs_zerofree>"
32596 #: ../src/guestfs-structs.pod:1
32597 msgid "guestfs_int_bool"
32601 #: ../src/guestfs-structs.pod:3
32604 " struct guestfs_int_bool {\n"
32612 #: ../src/guestfs-structs.pod:8
32615 " struct guestfs_int_bool_list {\n"
32616 " uint32_t len; /* Number of elements in list. */\n"
32617 " struct guestfs_int_bool *val; /* Elements. */\n"
32623 #: ../src/guestfs-structs.pod:13
32626 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
32627 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
32632 #: ../src/guestfs-structs.pod:16
32633 msgid "guestfs_lvm_pv"
32637 #: ../src/guestfs-structs.pod:18
32640 " struct guestfs_lvm_pv {\n"
32641 " char *pv_name;\n"
32642 " /* The next field is NOT nul-terminated, be careful when printing it: "
32644 " char pv_uuid[32];\n"
32646 " uint64_t pv_size;\n"
32647 " uint64_t dev_size;\n"
32648 " uint64_t pv_free;\n"
32649 " uint64_t pv_used;\n"
32650 " char *pv_attr;\n"
32651 " int64_t pv_pe_count;\n"
32652 " int64_t pv_pe_alloc_count;\n"
32653 " char *pv_tags;\n"
32654 " uint64_t pe_start;\n"
32655 " int64_t pv_mda_count;\n"
32656 " uint64_t pv_mda_free;\n"
32662 #: ../src/guestfs-structs.pod:36
32665 " struct guestfs_lvm_pv_list {\n"
32666 " uint32_t len; /* Number of elements in list. */\n"
32667 " struct guestfs_lvm_pv *val; /* Elements. */\n"
32673 #: ../src/guestfs-structs.pod:41
32676 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
32677 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
32682 #: ../src/guestfs-structs.pod:44
32683 msgid "guestfs_lvm_vg"
32687 #: ../src/guestfs-structs.pod:46
32690 " struct guestfs_lvm_vg {\n"
32691 " char *vg_name;\n"
32692 " /* The next field is NOT nul-terminated, be careful when printing it: "
32694 " char vg_uuid[32];\n"
32696 " char *vg_attr;\n"
32697 " uint64_t vg_size;\n"
32698 " uint64_t vg_free;\n"
32699 " char *vg_sysid;\n"
32700 " uint64_t vg_extent_size;\n"
32701 " int64_t vg_extent_count;\n"
32702 " int64_t vg_free_count;\n"
32703 " int64_t max_lv;\n"
32704 " int64_t max_pv;\n"
32705 " int64_t pv_count;\n"
32706 " int64_t lv_count;\n"
32707 " int64_t snap_count;\n"
32708 " int64_t vg_seqno;\n"
32709 " char *vg_tags;\n"
32710 " int64_t vg_mda_count;\n"
32711 " uint64_t vg_mda_free;\n"
32717 #: ../src/guestfs-structs.pod:69
32720 " struct guestfs_lvm_vg_list {\n"
32721 " uint32_t len; /* Number of elements in list. */\n"
32722 " struct guestfs_lvm_vg *val; /* Elements. */\n"
32728 #: ../src/guestfs-structs.pod:74
32731 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
32732 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
32737 #: ../src/guestfs-structs.pod:77
32738 msgid "guestfs_lvm_lv"
32742 #: ../src/guestfs-structs.pod:79
32745 " struct guestfs_lvm_lv {\n"
32746 " char *lv_name;\n"
32747 " /* The next field is NOT nul-terminated, be careful when printing it: "
32749 " char lv_uuid[32];\n"
32750 " char *lv_attr;\n"
32751 " int64_t lv_major;\n"
32752 " int64_t lv_minor;\n"
32753 " int64_t lv_kernel_major;\n"
32754 " int64_t lv_kernel_minor;\n"
32755 " uint64_t lv_size;\n"
32756 " int64_t seg_count;\n"
32758 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32759 " float snap_percent;\n"
32760 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32761 " float copy_percent;\n"
32762 " char *move_pv;\n"
32763 " char *lv_tags;\n"
32764 " char *mirror_log;\n"
32765 " char *modules;\n"
32771 #: ../src/guestfs-structs.pod:101
32774 " struct guestfs_lvm_lv_list {\n"
32775 " uint32_t len; /* Number of elements in list. */\n"
32776 " struct guestfs_lvm_lv *val; /* Elements. */\n"
32782 #: ../src/guestfs-structs.pod:106
32785 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
32786 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
32791 #: ../src/guestfs-structs.pod:111
32794 " struct guestfs_stat {\n"
32798 " int64_t nlink;\n"
32803 " int64_t blksize;\n"
32804 " int64_t blocks;\n"
32805 " int64_t atime;\n"
32806 " int64_t mtime;\n"
32807 " int64_t ctime;\n"
32813 #: ../src/guestfs-structs.pod:127
32816 " struct guestfs_stat_list {\n"
32817 " uint32_t len; /* Number of elements in list. */\n"
32818 " struct guestfs_stat *val; /* Elements. */\n"
32824 #: ../src/guestfs-structs.pod:132
32827 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
32828 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
32833 #: ../src/guestfs-structs.pod:137
32836 " struct guestfs_statvfs {\n"
32837 " int64_t bsize;\n"
32838 " int64_t frsize;\n"
32839 " int64_t blocks;\n"
32840 " int64_t bfree;\n"
32841 " int64_t bavail;\n"
32842 " int64_t files;\n"
32843 " int64_t ffree;\n"
32844 " int64_t favail;\n"
32847 " int64_t namemax;\n"
32853 #: ../src/guestfs-structs.pod:151
32856 " struct guestfs_statvfs_list {\n"
32857 " uint32_t len; /* Number of elements in list. */\n"
32858 " struct guestfs_statvfs *val; /* Elements. */\n"
32864 #: ../src/guestfs-structs.pod:156
32867 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
32868 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
32873 #: ../src/guestfs-structs.pod:159
32874 msgid "guestfs_dirent"
32878 #: ../src/guestfs-structs.pod:161
32881 " struct guestfs_dirent {\n"
32890 #: ../src/guestfs-structs.pod:167
32893 " struct guestfs_dirent_list {\n"
32894 " uint32_t len; /* Number of elements in list. */\n"
32895 " struct guestfs_dirent *val; /* Elements. */\n"
32901 #: ../src/guestfs-structs.pod:172
32904 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
32905 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
32910 #: ../src/guestfs-structs.pod:177
32913 " struct guestfs_version {\n"
32914 " int64_t major;\n"
32915 " int64_t minor;\n"
32916 " int64_t release;\n"
32923 #: ../src/guestfs-structs.pod:184
32926 " struct guestfs_version_list {\n"
32927 " uint32_t len; /* Number of elements in list. */\n"
32928 " struct guestfs_version *val; /* Elements. */\n"
32934 #: ../src/guestfs-structs.pod:189
32937 " void guestfs_free_version (struct guestfs_free_version *);\n"
32938 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
32943 #: ../src/guestfs-structs.pod:192
32944 msgid "guestfs_xattr"
32948 #: ../src/guestfs-structs.pod:194
32951 " struct guestfs_xattr {\n"
32952 " char *attrname;\n"
32953 " /* The next two fields describe a byte array. */\n"
32954 " uint32_t attrval_len;\n"
32955 " char *attrval;\n"
32961 #: ../src/guestfs-structs.pod:201
32964 " struct guestfs_xattr_list {\n"
32965 " uint32_t len; /* Number of elements in list. */\n"
32966 " struct guestfs_xattr *val; /* Elements. */\n"
32972 #: ../src/guestfs-structs.pod:206
32975 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
32976 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
32981 #: ../src/guestfs-structs.pod:209
32982 msgid "guestfs_inotify_event"
32986 #: ../src/guestfs-structs.pod:211
32989 " struct guestfs_inotify_event {\n"
32990 " int64_t in_wd;\n"
32991 " uint32_t in_mask;\n"
32992 " uint32_t in_cookie;\n"
32993 " char *in_name;\n"
32999 #: ../src/guestfs-structs.pod:218
33002 " struct guestfs_inotify_event_list {\n"
33003 " uint32_t len; /* Number of elements in list. */\n"
33004 " struct guestfs_inotify_event *val; /* Elements. */\n"
33010 #: ../src/guestfs-structs.pod:223
33013 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
33014 " void guestfs_free_inotify_event_list (struct "
33015 "guestfs_free_inotify_event_list *);\n"
33020 #: ../src/guestfs-structs.pod:226
33021 msgid "guestfs_partition"
33025 #: ../src/guestfs-structs.pod:228
33028 " struct guestfs_partition {\n"
33029 " int32_t part_num;\n"
33030 " uint64_t part_start;\n"
33031 " uint64_t part_end;\n"
33032 " uint64_t part_size;\n"
33038 #: ../src/guestfs-structs.pod:235
33041 " struct guestfs_partition_list {\n"
33042 " uint32_t len; /* Number of elements in list. */\n"
33043 " struct guestfs_partition *val; /* Elements. */\n"
33049 #: ../src/guestfs-structs.pod:240
33052 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
33053 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
33058 #: ../src/guestfs-structs.pod:243
33059 msgid "guestfs_application"
33063 #: ../src/guestfs-structs.pod:245
33066 " struct guestfs_application {\n"
33067 " char *app_name;\n"
33068 " char *app_display_name;\n"
33069 " int32_t app_epoch;\n"
33070 " char *app_version;\n"
33071 " char *app_release;\n"
33072 " char *app_install_path;\n"
33073 " char *app_trans_path;\n"
33074 " char *app_publisher;\n"
33075 " char *app_url;\n"
33076 " char *app_source_package;\n"
33077 " char *app_summary;\n"
33078 " char *app_description;\n"
33084 #: ../src/guestfs-structs.pod:260
33087 " struct guestfs_application_list {\n"
33088 " uint32_t len; /* Number of elements in list. */\n"
33089 " struct guestfs_application *val; /* Elements. */\n"
33095 #: ../src/guestfs-structs.pod:265
33098 " void guestfs_free_application (struct guestfs_free_application *);\n"
33099 " void guestfs_free_application_list (struct guestfs_free_application_list "
33105 #: ../src/guestfs.pod:5
33106 msgid "guestfs - Library for accessing and modifying virtual machine images"
33110 #: ../src/guestfs.pod:11
33113 " guestfs_h *g = guestfs_create ();\n"
33114 " guestfs_add_drive (g, \"guest.img\");\n"
33115 " guestfs_launch (g);\n"
33116 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33117 " guestfs_touch (g, \"/hello\");\n"
33118 " guestfs_umount (g, \"/\");\n"
33119 " guestfs_close (g);\n"
33124 #: ../src/guestfs.pod:25
33126 "Libguestfs is a library for accessing and modifying guest disk images. "
33127 "Amongst the things this is good for: making batch configuration changes to "
33128 "guests, getting disk used/free statistics (see also: virt-df), migrating "
33129 "between virtualization systems (see also: virt-p2v), performing partial "
33130 "backups, performing partial guest clones, cloning guests and changing "
33131 "registry/UUID/hostname info, and much else besides."
33135 #: ../src/guestfs.pod:33
33137 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
33138 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
33139 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
33144 #: ../src/guestfs.pod:38
33146 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
33147 "what filesystem is in each LV, etc.). It can also run commands in the "
33148 "context of the guest. Also you can access filesystems over FUSE."
33152 #: ../src/guestfs.pod:43
33154 "Libguestfs is a library that can be linked with C and C++ management "
33155 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
33156 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
33161 #: ../src/guestfs.pod:48
33163 "You don't need to be root to use libguestfs, although obviously you do need "
33164 "enough permissions to access the disk images."
33168 #: ../src/guestfs.pod:51
33170 "Libguestfs is a large API because it can do many things. For a gentle "
33171 "introduction, please read the L</API OVERVIEW> section next."
33175 #: ../src/guestfs.pod:54
33177 "There are also some example programs in the L<guestfs-examples(3)> manual "
33182 #: ../src/guestfs.pod:57
33183 msgid "API OVERVIEW"
33187 #: ../src/guestfs.pod:59
33189 "This section provides a gentler overview of the libguestfs API. We also try "
33190 "to group API calls together, where that may not be obvious from reading "
33191 "about the individual calls in the main section of this manual."
33195 #: ../src/guestfs.pod:64
33200 #: ../src/guestfs.pod:66
33202 "Before you can use libguestfs calls, you have to create a handle. Then you "
33203 "must add at least one disk image to the handle, followed by launching the "
33204 "handle, then performing whatever operations you want, and finally closing "
33205 "the handle. By convention we use the single letter C<g> for the name of the "
33206 "handle variable, although of course you can use any name you want."
33210 #: ../src/guestfs.pod:73
33211 msgid "The general structure of all libguestfs-using programs looks like this:"
33215 #: ../src/guestfs.pod:76
33218 " guestfs_h *g = guestfs_create ();\n"
33223 #: ../src/guestfs.pod:78
33226 " /* Call guestfs_add_drive additional times if there are\n"
33227 " * multiple disk images.\n"
33229 " guestfs_add_drive (g, \"guest.img\");\n"
33234 #: ../src/guestfs.pod:83
33237 " /* Most manipulation calls won't work until you've launched\n"
33238 " * the handle 'g'. You have to do this _after_ adding drives\n"
33239 " * and _before_ other commands.\n"
33241 " guestfs_launch (g);\n"
33246 #: ../src/guestfs.pod:89
33249 " /* Now you can examine what partitions, LVs etc are available.\n"
33251 " char **partitions = guestfs_list_partitions (g);\n"
33252 " char **logvols = guestfs_lvs (g);\n"
33257 #: ../src/guestfs.pod:94
33260 " /* To access a filesystem in the image, you must mount it.\n"
33262 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33267 #: ../src/guestfs.pod:98
33270 " /* Now you can perform filesystem actions on the guest\n"
33273 " guestfs_touch (g, \"/hello\");\n"
33278 #: ../src/guestfs.pod:103
33281 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
33282 " * it is done automatically when you close the handle. See\n"
33283 " * discussion of autosync in this page.\n"
33285 " guestfs_sync (g);\n"
33290 #: ../src/guestfs.pod:109
33293 " /* Close the handle 'g'. */\n"
33294 " guestfs_close (g);\n"
33299 #: ../src/guestfs.pod:112
33301 "The code above doesn't include any error checking. In real code you should "
33302 "check return values carefully for errors. In general all functions that "
33303 "return integers return C<-1> on error, and all functions that return "
33304 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
33305 "how to handle errors, and consult the documentation for each function call "
33306 "below to see precisely how they return error indications. See "
33307 "L<guestfs-examples(3)> for fully worked examples."
33311 #: ../src/guestfs.pod:121
33312 msgid "DISK IMAGES"
33316 #: ../src/guestfs.pod:123
33318 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
33319 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
33320 "actual block device, or simply an empty file of zeroes that you have created "
33321 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
33326 #: ../src/guestfs.pod:129
33328 "The call you should use in modern code for adding drives is "
33329 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
33330 "specifying that the format is raw, do:"
33334 #: ../src/guestfs.pod:133
33337 " guestfs_add_drive_opts (g, filename,\n"
33338 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33344 #: ../src/guestfs.pod:137
33345 msgid "You can add a disk read-only using:"
33349 #: ../src/guestfs.pod:139
33352 " guestfs_add_drive_opts (g, filename,\n"
33353 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33354 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
33360 #: ../src/guestfs.pod:144
33362 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
33363 "libguestfs won't modify the file."
33367 #: ../src/guestfs.pod:147
33369 "Be extremely cautious if the disk image is in use, eg. if it is being used "
33370 "by a virtual machine. Adding it read-write will almost certainly cause disk "
33371 "corruption, but adding it read-only is safe."
33375 #: ../src/guestfs.pod:151
33377 "You must add at least one disk image, and you may add multiple disk images. "
33378 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
33379 "first one you added), C</dev/sdb> (for the second one you added), etc."
33383 #: ../src/guestfs.pod:156
33385 "Once L</guestfs_launch> has been called you cannot add any more images. You "
33386 "can call L</guestfs_list_devices> to get a list of the device names, in the "
33387 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
33391 #: ../src/guestfs.pod:161
33396 #: ../src/guestfs.pod:163
33398 "Before you can read or write files, create directories and so on in a disk "
33399 "image that contains filesystems, you have to mount those filesystems using "
33400 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
33401 "a disk image contains (for example) one partition with a filesystem on that "
33402 "partition, then you can mount it directly:"
33406 #: ../src/guestfs.pod:170
33409 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
33414 #: ../src/guestfs.pod:172
33416 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
33417 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
33418 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
33419 "that these are libguestfs virtual devices, and are nothing to do with host "
33424 #: ../src/guestfs.pod:178
33426 "If you are given a disk image and you don't know what it contains then you "
33427 "have to find out. Libguestfs can do that too: use "
33428 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
33429 "and LVs, and either try mounting each to see what is mountable, or else "
33430 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
33431 "filesystems, use L</guestfs_list_filesystems>."
33435 #: ../src/guestfs.pod:186
33437 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
33438 "L</INSPECTION> below). But you might find it easier to look at higher level "
33439 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
33443 #: ../src/guestfs.pod:191
33445 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
33446 "several other variations of the C<guestfs_mount_*> call."
33450 #: ../src/guestfs.pod:194
33451 msgid "FILESYSTEM ACCESS AND MODIFICATION"
33455 #: ../src/guestfs.pod:196
33457 "The majority of the libguestfs API consists of fairly low-level calls for "
33458 "accessing and modifying the files, directories, symlinks etc on mounted "
33459 "filesystems. There are over a hundred such calls which you can find listed "
33460 "in detail below in this man page, and we don't even pretend to cover them "
33461 "all in this overview."
33465 #: ../src/guestfs.pod:202
33467 "Specify filenames as full paths, starting with C<\"/\"> and including the "
33472 #: ../src/guestfs.pod:205
33474 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
33475 "the file called C<\"etc/passwd\"> then you could do:"
33479 #: ../src/guestfs.pod:208
33482 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
33487 #: ../src/guestfs.pod:210
33489 "This would return C<data> as a newly allocated buffer containing the full "
33490 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
33491 "or C<NULL> if there was an error."
33495 #: ../src/guestfs.pod:214
33497 "As another example, to create a top-level directory on that filesystem "
33498 "called C<\"var\"> you would do:"
33502 #: ../src/guestfs.pod:217
33505 " guestfs_mkdir (g, \"/var\");\n"
33510 #: ../src/guestfs.pod:219
33511 msgid "To create a symlink you could do:"
33515 #: ../src/guestfs.pod:221
33518 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
33519 " \"/etc/rc3.d/S30portmap\");\n"
33524 #: ../src/guestfs.pod:224
33526 "Libguestfs will reject attempts to use relative paths and there is no "
33527 "concept of a current working directory."
33531 #: ../src/guestfs.pod:227
33533 "Libguestfs can return errors in many situations: for example if the "
33534 "filesystem isn't writable, or if a file or directory that you requested "
33535 "doesn't exist. If you are using the C API (documented here) you have to "
33536 "check for those error conditions after each call. (Other language bindings "
33537 "turn these errors into exceptions)."
33541 #: ../src/guestfs.pod:233
33543 "File writes are affected by the per-handle umask, set by calling "
33544 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
33548 #: ../src/guestfs.pod:236
33549 msgid "PARTITIONING"
33553 #: ../src/guestfs.pod:238
33555 "Libguestfs contains API calls to read, create and modify partition tables on "
33560 #: ../src/guestfs.pod:241
33562 "In the common case where you want to create a single partition covering the "
33563 "whole disk, you should use the L</guestfs_part_disk> call:"
33567 #: ../src/guestfs.pod:245
33570 " const char *parttype = \"mbr\";\n"
33571 " if (disk_is_larger_than_2TB)\n"
33572 " parttype = \"gpt\";\n"
33573 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
33578 #: ../src/guestfs.pod:250
33580 "Obviously this effectively wipes anything that was on that disk image "
33585 #: ../src/guestfs.pod:253
33590 #: ../src/guestfs.pod:255
33592 "Libguestfs provides access to a large part of the LVM2 API, such as "
33593 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
33594 "unless you familiarize yourself with the concepts of physical volumes, "
33595 "volume groups and logical volumes."
33599 #: ../src/guestfs.pod:260
33601 "This author strongly recommends reading the LVM HOWTO, online at "
33602 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
33606 #: ../src/guestfs.pod:263
33607 msgid "DOWNLOADING"
33611 #: ../src/guestfs.pod:265
33613 "Use L</guestfs_cat> to download small, text only files. This call is "
33614 "limited to files which are less than 2 MB and which cannot contain any ASCII "
33615 "NUL (C<\\0>) characters. However the API is very simple to use."
33619 #: ../src/guestfs.pod:269
33621 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
33622 "bit data, since it returns a (pointer, size) pair. However it is still "
33623 "limited to \"small\" files, less than 2 MB."
33627 #: ../src/guestfs.pod:273
33629 "L</guestfs_download> can be used to download any file, with no limits on "
33630 "content or size (even files larger than 4 GB)."
33634 #: ../src/guestfs.pod:276
33635 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
33639 #: ../src/guestfs.pod:279
33644 #: ../src/guestfs.pod:281
33646 "It's often the case that you want to write a file or files to the disk "
33651 #: ../src/guestfs.pod:284
33653 "To write a small file with fixed content, use L</guestfs_write>. To create "
33654 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
33655 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
33656 "variety of other functions for creating test files, for example "
33657 "L</guestfs_fill> and L</guestfs_fill_pattern>."
33661 #: ../src/guestfs.pod:290
33663 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
33664 "file content or size (even files larger than 4 GB)."
33668 #: ../src/guestfs.pod:293
33669 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
33673 #: ../src/guestfs.pod:295
33675 "However the fastest way to upload I<large numbers of arbitrary files> is to "
33676 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
33677 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
33678 "the drive in a predictable way (eg. adding it last after all other drives) "
33679 "then you can get the device name from L</guestfs_list_devices> and mount it "
33680 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
33681 "sometimes non-portable between kernel versions, and they don't support "
33682 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
33683 "using a label or UUID, use an ISO image instead."
33687 #: ../src/guestfs.pod:306
33692 #: ../src/guestfs.pod:308
33694 "There are various different commands for copying between files and devices "
33695 "and in and out of the guest filesystem. These are summarised in the table "
33700 #: ../src/guestfs.pod:314
33701 msgid "B<file> to B<file>"
33705 #: ../src/guestfs.pod:316
33707 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
33708 "directories recursively."
33712 #: ../src/guestfs.pod:319
33713 msgid "To copy part of a file (offset and size) use L</guestfs_copy_file_to_file>."
33717 #: ../src/guestfs.pod:322
33718 msgid "B<file> to B<device>"
33722 #: ../src/guestfs.pod:324
33723 msgid "B<device> to B<file>"
33727 #: ../src/guestfs.pod:326
33728 msgid "B<device> to B<device>"
33732 #: ../src/guestfs.pod:328
33734 "Use L</guestfs_copy_file_to_device>, L</guestfs_copy_device_to_file>, or "
33735 "L</guestfs_copy_device_to_device>."
33739 #: ../src/guestfs.pod:331
33740 msgid "Example: duplicate the contents of an LV:"
33744 #: ../src/guestfs.pod:333
33747 " guestfs_copy_device_to_device (g,\n"
33748 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
33749 " /* -1 marks the end of the list of optional parameters */\n"
33755 #: ../src/guestfs.pod:338
33757 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
33758 "(C</dev/VG/Original>). To copy less than the whole source device, use the "
33759 "optional C<size> parameter:"
33763 #: ../src/guestfs.pod:342
33766 " guestfs_copy_device_to_device (g,\n"
33767 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
33768 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, 10000,\n"
33774 #: ../src/guestfs.pod:347
33775 msgid "B<file on the host> to B<file or device>"
33779 #: ../src/guestfs.pod:349
33780 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
33784 #: ../src/guestfs.pod:351
33785 msgid "B<file or device> to B<file on the host>"
33789 #: ../src/guestfs.pod:353
33790 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
33794 #: ../src/guestfs.pod:357
33795 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
33799 #: ../src/guestfs.pod:359
33801 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
33802 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
33803 "appears you can only upload and download to files. However many Un*x-like "
33804 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
33805 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
33806 "stderr, and arbitrary file descriptor N."
33810 #: ../src/guestfs.pod:367
33811 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
33815 #: ../src/guestfs.pod:370
33818 " guestfs_download (g, filename, \"/dev/stdout\");\n"
33823 #: ../src/guestfs.pod:372
33824 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
33828 #: ../src/guestfs.pod:374
33831 " char devfd[64];\n"
33832 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
33833 " guestfs_tar_out (g, \"/\", devfd);\n"
33838 #: ../src/guestfs.pod:378
33839 msgid "LISTING FILES"
33843 #: ../src/guestfs.pod:380
33845 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
33846 "L<guestfish(1)>-equivalent command C<ll>)."
33850 #: ../src/guestfs.pod:383
33852 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
33853 "programs, as a flat list of strings."
33857 #: ../src/guestfs.pod:386
33859 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
33860 "directory, plus additional information about each one. It is more "
33861 "equivalent to using the L<readdir(3)> call on a local filesystem."
33865 #: ../src/guestfs.pod:390
33867 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
33872 #: ../src/guestfs.pod:393
33873 msgid "RUNNING COMMANDS"
33877 #: ../src/guestfs.pod:395
33879 "Although libguestfs is primarily an API for manipulating files inside guest "
33880 "images, we also provide some limited facilities for running commands inside "
33885 #: ../src/guestfs.pod:399
33886 msgid "There are many limitations to this:"
33890 #: ../src/guestfs.pod:405
33892 "The kernel version that the command runs under will be different from what "
33897 #: ../src/guestfs.pod:410
33899 "If the command needs to communicate with daemons, then most likely they "
33900 "won't be running."
33904 #: ../src/guestfs.pod:415
33905 msgid "The command will be running in limited memory."
33909 #: ../src/guestfs.pod:419
33911 "The network may not be available unless you enable it (see "
33912 "L</guestfs_set_network>)."
33916 #: ../src/guestfs.pod:424
33917 msgid "Only supports Linux guests (not Windows, BSD, etc)."
33921 #: ../src/guestfs.pod:428
33922 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
33926 #: ../src/guestfs.pod:433
33928 "For SELinux guests, you may need to enable SELinux and load policy first. "
33929 "See L</SELINUX> in this manpage."
33933 #: ../src/guestfs.pod:438
33935 "I<Security:> It is not safe to run commands from untrusted, possibly "
33936 "malicious guests. These commands may attempt to exploit your program by "
33937 "sending unexpected output. They could also try to exploit the Linux kernel "
33938 "or qemu provided by the libguestfs appliance. They could use the network "
33939 "provided by the libguestfs appliance to bypass ordinary network partitions "
33940 "and firewalls. They could use the elevated privileges or different SELinux "
33941 "context of your program to their advantage."
33945 #: ../src/guestfs.pod:447
33947 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
33948 "(a script which runs when the guest next boots normally), and to have this "
33949 "script run the commands you want in the normal context of the running guest, "
33950 "network security and so on. For information about other security issues, "
33951 "see L</SECURITY>."
33955 #: ../src/guestfs.pod:455
33957 "The two main API calls to run commands are L</guestfs_command> and "
33958 "L</guestfs_sh> (there are also variations)."
33962 #: ../src/guestfs.pod:458
33964 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
33965 "shell globs, redirections, etc will work."
33969 #: ../src/guestfs.pod:461
33970 msgid "CONFIGURATION FILES"
33974 #: ../src/guestfs.pod:463
33976 "To read and write configuration files in Linux guest filesystems, we "
33977 "strongly recommend using Augeas. For example, Augeas understands how to "
33978 "read and write, say, a Linux shadow password file or X.org configuration "
33979 "file, and so avoids you having to write that code."
33983 #: ../src/guestfs.pod:468
33985 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
33986 "document Augeas itself here because there is excellent documentation on the "
33987 "L<http://augeas.net/> website."
33991 #: ../src/guestfs.pod:472
33993 "If you don't want to use Augeas (you fool!) then try calling "
33994 "L</guestfs_read_lines> to get the file as a list of lines which you can "
33999 #: ../src/guestfs.pod:476
34004 #: ../src/guestfs.pod:478
34006 "We support SELinux guests. To ensure that labeling happens correctly in "
34007 "SELinux guests, you need to enable SELinux and load the guest's policy:"
34011 #: ../src/guestfs.pod:486
34012 msgid "Before launching, do:"
34016 #: ../src/guestfs.pod:488
34019 " guestfs_set_selinux (g, 1);\n"
34024 #: ../src/guestfs.pod:492
34026 "After mounting the guest's filesystem(s), load the policy. This is best "
34027 "done by running the L<load_policy(8)> command in the guest itself:"
34031 #: ../src/guestfs.pod:496
34034 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
34039 #: ../src/guestfs.pod:498
34041 "(Older versions of C<load_policy> require you to specify the name of the "
34046 #: ../src/guestfs.pod:503
34048 "Optionally, set the security context for the API. The correct security "
34049 "context to use can only be known by inspecting the guest. As an example:"
34053 #: ../src/guestfs.pod:507
34056 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
34061 #: ../src/guestfs.pod:511
34062 msgid "This will work for running commands and editing existing files."
34066 #: ../src/guestfs.pod:513
34068 "When new files are created, you may need to label them explicitly, for "
34069 "example by running the external command C<restorecon pathname>."
34073 #: ../src/guestfs.pod:517
34078 #: ../src/guestfs.pod:519
34080 "Certain calls are affected by the current file mode creation mask (the "
34081 "\"umask\"). In particular ones which create files or directories, such as "
34082 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
34083 "either the default mode that the file is created with or modifies the mode "
34088 #: ../src/guestfs.pod:525
34090 "The default umask is C<022>, so files are created with modes such as C<0644> "
34091 "and directories with C<0755>."
34095 #: ../src/guestfs.pod:528
34097 "There are two ways to avoid being affected by umask. Either set umask to 0 "
34098 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
34099 "L</guestfs_chmod> after creating each file or directory."
34103 #: ../src/guestfs.pod:532
34104 msgid "For more information about umask, see L<umask(2)>."
34108 #: ../src/guestfs.pod:536
34110 "Libguestfs allows you to access Linux guests which have been encrypted using "
34111 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
34112 "standard. This includes nearly all whole disk encryption systems used by "
34113 "modern Linux guests."
34117 #: ../src/guestfs.pod:542
34119 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
34120 "returns the string C<crypto_LUKS>)."
34124 #: ../src/guestfs.pod:545
34126 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
34127 "will require the passphrase!"
34131 #: ../src/guestfs.pod:548
34133 "Opening a LUKS device creates a new device mapper device called "
34134 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
34135 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
34136 "decrypted from and encrypted to the underlying block device respectively."
34140 #: ../src/guestfs.pod:554
34142 "LVM volume groups on the device can be made visible by calling "
34143 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
34144 "volume(s) can now be mounted in the usual way."
34148 #: ../src/guestfs.pod:558
34150 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
34151 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
34152 "[\"/dev/VG\"])>. Then close the mapper device by calling "
34153 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
34154 "underlying encrypted block device)."
34158 #: ../src/guestfs.pod:565
34163 #: ../src/guestfs.pod:567
34165 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
34166 "contains operating systems, an install CD or a live CD. (These APIs used to "
34167 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
34168 "version 1.5.3 the most frequently used part of this library has been "
34169 "rewritten in C and moved into the core code)."
34173 #: ../src/guestfs.pod:574
34175 "Add all disks belonging to the unknown virtual machine and call "
34176 "L</guestfs_launch> in the usual way."
34180 #: ../src/guestfs.pod:577
34182 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
34183 "and certain heuristics, and returns a list of operating systems that were "
34184 "found. An empty list means none were found. A single element is the root "
34185 "filesystem of the operating system. For dual- or multi-boot guests, "
34186 "multiple roots can be returned, each one corresponding to a separate "
34187 "operating system. (Multi-boot virtual machines are extremely rare in the "
34188 "world of virtualization, but since this scenario can happen, we have built "
34189 "libguestfs to deal with it.)"
34193 #: ../src/guestfs.pod:586
34195 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
34196 "to get additional details about that operating system. For example, call "
34197 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
34198 "Windows and Linux-based operating systems respectively."
34202 #: ../src/guestfs.pod:592
34204 "Un*x-like and Linux-based operating systems usually consist of several "
34205 "filesystems which are mounted at boot time (for example, a separate boot "
34206 "partition mounted on C</boot>). The inspection rules are able to detect how "
34207 "filesystems correspond to mount points. Call "
34208 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
34209 "hash table like this example:"
34213 #: ../src/guestfs.pod:599
34216 " /boot => /dev/sda1\n"
34217 " / => /dev/vg_guest/lv_root\n"
34218 " /usr => /dev/vg_guest/lv_usr\n"
34223 #: ../src/guestfs.pod:603
34225 "The caller can then make calls to L</guestfs_mount_options> to mount the "
34226 "filesystems as suggested."
34230 #: ../src/guestfs.pod:606
34232 "Be careful to mount filesystems in the right order (eg. C</> before "
34233 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
34238 #: ../src/guestfs.pod:610
34240 "Inspection currently only works for some common operating systems. "
34241 "Contributors are welcome to send patches for other operating systems that we "
34242 "currently cannot detect."
34246 #: ../src/guestfs.pod:614
34248 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
34249 "for more details. The L</guestfs_inspect_os> function just ignores any "
34250 "encrypted devices."
34254 #: ../src/guestfs.pod:618
34256 "A note on the implementation: The call L</guestfs_inspect_os> performs "
34257 "inspection and caches the results in the guest handle. Subsequent calls to "
34258 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
34259 "re-read the disks. If you change the content of the guest disks, you can "
34260 "redo inspection by calling L</guestfs_inspect_os> again. "
34261 "(L</guestfs_inspect_list_applications> works a little differently from the "
34262 "other calls and does read the disks. See documentation for that function "
34267 #: ../src/guestfs.pod:627
34268 msgid "INSPECTING INSTALL DISKS"
34272 #: ../src/guestfs.pod:629
34274 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
34279 #: ../src/guestfs.pod:632
34281 "Call L</guestfs_inspect_get_format> to return the format of the operating "
34282 "system, which currently can be C<installed> (a regular operating system) or "
34283 "C<installer> (some sort of install disk)."
34287 #: ../src/guestfs.pod:636
34289 "Further information is available about the operating system that can be "
34290 "installed using the regular inspection APIs like "
34291 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
34296 #: ../src/guestfs.pod:641
34298 "Some additional information specific to installer disks is also available "
34299 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
34300 "L</guestfs_inspect_is_multipart> calls."
34304 #: ../src/guestfs.pod:646
34305 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
34309 #: ../src/guestfs.pod:648
34311 "Libguestfs can mount NTFS partitions. It does this using the "
34312 "L<http://www.ntfs-3g.org/> driver."
34316 #: ../src/guestfs.pod:651
34317 msgid "DRIVE LETTERS AND PATHS"
34321 #: ../src/guestfs.pod:653
34323 "DOS and Windows still use drive letters, and the filesystems are always "
34324 "treated as case insensitive by Windows itself, and therefore you might find "
34325 "a Windows configuration file referring to a path like "
34326 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
34327 "that directory might be referred to as C</WINDOWS/System32>."
34331 #: ../src/guestfs.pod:659
34333 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
34334 "L</guestfs_inspect_get_drive_mappings>)"
34338 #: ../src/guestfs.pod:662
34340 "Dealing with separator characters (backslash vs forward slash) is outside "
34341 "the scope of libguestfs, but usually a simple character replacement will "
34346 #: ../src/guestfs.pod:666
34348 "To resolve the case insensitivity of paths, call "
34349 "L</guestfs_case_sensitive_path>."
34353 #: ../src/guestfs.pod:669
34354 msgid "ACCESSING THE WINDOWS REGISTRY"
34358 #: ../src/guestfs.pod:671
34360 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
34361 "files, through the library C<hivex> which is part of the libguestfs project "
34362 "although ships as a separate tarball. You have to locate and download the "
34363 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
34364 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
34365 "L<virt-win-reg(1)> for more help on this issue."
34369 #: ../src/guestfs.pod:679
34370 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
34374 #: ../src/guestfs.pod:681
34376 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
34377 "provide something which looks like a Linux symlink. The way it tries to do "
34378 "the rewriting is described here:"
34382 #: ../src/guestfs.pod:685
34383 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
34387 #: ../src/guestfs.pod:687
34389 "The essential problem is that ntfs-3g simply does not have enough "
34390 "information to do a correct job. NTFS links can contain drive letters and "
34391 "references to external device GUIDs that ntfs-3g has no way of resolving. "
34392 "It is almost certainly the case that libguestfs callers should ignore what "
34393 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
34397 #: ../src/guestfs.pod:694
34399 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
34400 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
34401 "attribute, and read the raw reparse data from that (you can find the format "
34402 "documented in various places around the web)."
34406 #: ../src/guestfs.pod:699
34407 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
34411 #: ../src/guestfs.pod:701
34413 "There are other useful extended attributes that can be read from ntfs-3g "
34414 "filesystems (using L</guestfs_getxattr>). See:"
34418 #: ../src/guestfs.pod:704
34419 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
34423 #: ../src/guestfs.pod:706
34424 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
34428 #: ../src/guestfs.pod:708
34430 "Although we don't want to discourage you from using the C API, we will "
34431 "mention here that the same API is also available in other languages."
34435 #: ../src/guestfs.pod:711
34437 "The API is broadly identical in all supported languages. This means that "
34438 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
34439 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
34440 "OCaml. In other words, a straightforward, predictable isomorphism between "
34445 #: ../src/guestfs.pod:717
34447 "Error messages are automatically transformed into exceptions if the language "
34452 #: ../src/guestfs.pod:720
34454 "We don't try to \"object orientify\" parts of the API in OO languages, "
34455 "although contributors are welcome to write higher level APIs above what we "
34456 "provide in their favourite languages if they wish."
34460 #: ../src/guestfs.pod:726
34465 #: ../src/guestfs.pod:728
34467 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
34468 "identical to the C API. C++ classes and exceptions are not used."
34472 #: ../src/guestfs.pod:732
34477 #: ../src/guestfs.pod:734
34479 "The C# bindings are highly experimental. Please read the warnings at the "
34480 "top of C<csharp/Libguestfs.cs>."
34484 #: ../src/guestfs.pod:737
34489 #: ../src/guestfs.pod:739
34490 msgid "See L<guestfs-erlang(3)>."
34494 #: ../src/guestfs.pod:741
34499 #: ../src/guestfs.pod:743
34501 "This is the only language binding that is working but incomplete. Only "
34502 "calls which return simple integers have been bound in Haskell, and we are "
34503 "looking for help to complete this binding."
34507 #: ../src/guestfs.pod:747
34512 #: ../src/guestfs.pod:749
34514 "Full documentation is contained in the Javadoc which is distributed with "
34515 "libguestfs. For examples, see L<guestfs-java(3)>."
34519 #: ../src/guestfs.pod:752
34524 #: ../src/guestfs.pod:754
34525 msgid "See L<guestfs-ocaml(3)>."
34529 #: ../src/guestfs.pod:756
34534 #: ../src/guestfs.pod:758
34535 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
34539 #: ../src/guestfs.pod:760
34544 #: ../src/guestfs.pod:762
34546 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
34547 "the php-libguestfs package for your distribution."
34551 #: ../src/guestfs.pod:765
34552 msgid "The PHP binding only works correctly on 64 bit machines."
34556 #: ../src/guestfs.pod:767
34561 #: ../src/guestfs.pod:769
34562 msgid "See L<guestfs-python(3)>."
34566 #: ../src/guestfs.pod:771
34571 #: ../src/guestfs.pod:773
34572 msgid "See L<guestfs-ruby(3)>."
34576 #: ../src/guestfs.pod:775
34577 msgid "B<shell scripts>"
34581 #: ../src/guestfs.pod:777
34582 msgid "See L<guestfish(1)>."
34586 #: ../src/guestfs.pod:781
34587 msgid "LIBGUESTFS GOTCHAS"
34591 #: ../src/guestfs.pod:783
34593 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
34594 "system [...] that works in the way it is documented but is counterintuitive "
34595 "and almost invites mistakes.\""
34599 #: ../src/guestfs.pod:787
34601 "Since we developed libguestfs and the associated tools, there are several "
34602 "things we would have designed differently, but are now stuck with for "
34603 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
34604 "release, you can expect these to change. Beware of them."
34608 #: ../src/guestfs.pod:795
34609 msgid "Autosync / forgetting to sync."
34613 #: ../src/guestfs.pod:797
34615 "I<Update:> Autosync is enabled by default for all API users starting from "
34616 "libguestfs 1.5.24. This section only applies to older versions."
34620 #: ../src/guestfs.pod:800
34622 "When modifying a filesystem from C or another language, you B<must> unmount "
34623 "all filesystems and call L</guestfs_sync> explicitly before you close the "
34624 "libguestfs handle. You can also call:"
34628 #: ../src/guestfs.pod:804
34631 " guestfs_set_autosync (g, 1);\n"
34636 #: ../src/guestfs.pod:806
34638 "to have the unmount/sync done automatically for you when the handle 'g' is "
34639 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
34644 #: ../src/guestfs.pod:810
34646 "If you forget to do this, then it is entirely possible that your changes "
34647 "won't be written out, or will be partially written, or (very rarely) that "
34648 "you'll get disk corruption."
34652 #: ../src/guestfs.pod:814
34654 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
34655 "guestfish scripts that forget to sync will work just fine, which can make "
34656 "this very puzzling if you are trying to debug a problem."
34660 #: ../src/guestfs.pod:818
34661 msgid "Mount option C<-o sync> should not be the default."
34665 #: ../src/guestfs.pod:820
34667 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
34668 "libguestfs 1.13.16. This section only applies to older versions."
34672 #: ../src/guestfs.pod:823
34674 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
34675 "However C<-o sync> does not add any reliability benefit, but does have a "
34676 "very large performance impact."
34680 #: ../src/guestfs.pod:827
34682 "The work around is to use L</guestfs_mount_options> and set the mount "
34683 "options that you actually want to use."
34687 #: ../src/guestfs.pod:830
34688 msgid "Read-only should be the default."
34692 #: ../src/guestfs.pod:832
34694 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
34695 "specify I<--rw> if you want to make changes to the image."
34699 #: ../src/guestfs.pod:835
34700 msgid "This would reduce the potential to corrupt live VM images."
34704 #: ../src/guestfs.pod:837
34706 "Note that many filesystems change the disk when you just mount and unmount, "
34707 "even if you didn't perform any writes. You need to use "
34708 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
34712 #: ../src/guestfs.pod:841
34713 msgid "guestfish command line is hard to use."
34717 #: ../src/guestfs.pod:843
34719 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
34720 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
34721 "exist, so it fails. In earlier versions of guestfish the error message was "
34722 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
34723 "we should have used C<guestfish -c command> to run commands."
34727 #: ../src/guestfs.pod:850
34728 msgid "guestfish megabyte modifiers don't work right on all commands"
34732 #: ../src/guestfs.pod:852
34734 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
34735 "other modifiers). What guestfish actually does is to multiply the number "
34736 "part by the modifier part and pass the result to the C API. However this "
34737 "doesn't work for a few APIs which aren't expecting bytes, but are already "
34738 "expecting some other unit (eg. megabytes)."
34742 #: ../src/guestfs.pod:859
34743 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
34747 #: ../src/guestfs.pod:861
34750 " lvcreate LV VG 100M\n"
34755 #: ../src/guestfs.pod:863
34757 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
34758 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
34759 "megabytes * megabytes) logical volume. The error message you get from this "
34760 "is also a little obscure."
34764 #: ../src/guestfs.pod:868
34766 "This could be fixed in the generator by specially marking parameters and "
34767 "return values which take bytes or other units."
34771 #: ../src/guestfs.pod:871
34772 msgid "Ambiguity between devices and paths"
34776 #: ../src/guestfs.pod:873
34778 "There is a subtle ambiguity in the API between a device name "
34779 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
34780 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
34784 #: ../src/guestfs.pod:878
34786 "In the current API we usually resolve this ambiguity by having two separate "
34787 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
34788 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
34789 "detecting if the path supplied begins with C</dev/>."
34793 #: ../src/guestfs.pod:884
34795 "To avoid both the ambiguity and the need to duplicate some calls, we could "
34796 "make paths/devices into structured names. One way to do this would be to "
34797 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
34798 "aspect of grub. Another way would be to use a structured type, equivalent "
34799 "to this OCaml type:"
34803 #: ../src/guestfs.pod:890
34806 " type path = Path of string | Device of int | Partition of int * int\n"
34811 #: ../src/guestfs.pod:892
34812 msgid "which would allow you to pass arguments like:"
34816 #: ../src/guestfs.pod:894
34819 " Path \"/foo/bar\"\n"
34820 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
34821 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
34822 " Path \"/dev/sdb2\" (* not a device *)\n"
34827 #: ../src/guestfs.pod:899
34829 "As you can see there are still problems to resolve even with this "
34830 "representation. Also consider how it might work in guestfish."
34834 #: ../src/guestfs.pod:904
34835 msgid "KEYS AND PASSPHRASES"
34839 #: ../src/guestfs.pod:906
34841 "Certain libguestfs calls take a parameter that contains sensitive key "
34842 "material, passed in as a C string."
34846 #: ../src/guestfs.pod:909
34848 "In the future we would hope to change the libguestfs implementation so that "
34849 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
34850 "swap. However this is I<not> done at the moment, because of the complexity "
34851 "of such an implementation."
34855 #: ../src/guestfs.pod:914
34857 "Therefore you should be aware that any key parameter you pass to libguestfs "
34858 "might end up being written out to the swap partition. If this is a concern, "
34859 "scrub the swap partition or don't use libguestfs on encrypted devices."
34863 #: ../src/guestfs.pod:919
34864 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
34868 #: ../src/guestfs.pod:921
34870 "All high-level libguestfs actions are synchronous. If you want to use "
34871 "libguestfs asynchronously then you must create a thread."
34875 #: ../src/guestfs.pod:924
34877 "Only use the handle from a single thread. Either use the handle exclusively "
34878 "from one thread, or provide your own mutex so that two threads cannot issue "
34879 "calls on the same handle at the same time."
34883 #: ../src/guestfs.pod:928
34885 "See the graphical program guestfs-browser for one possible architecture for "
34886 "multithreaded programs using libvirt and libguestfs."
34890 #: ../src/guestfs.pod:931
34895 #: ../src/guestfs.pod:933
34897 "Libguestfs needs a supermin appliance, which it finds by looking along an "
34902 #: ../src/guestfs.pod:936
34904 "By default it looks for these in the directory C<$libdir/guestfs> "
34905 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
34909 #: ../src/guestfs.pod:939
34911 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
34912 "to change the directories that libguestfs will search in. The value is a "
34913 "colon-separated list of paths. The current directory is I<not> searched "
34914 "unless the path contains an empty element or C<.>. For example "
34915 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
34916 "then C</usr/lib/guestfs>."
34920 #: ../src/guestfs.pod:946
34921 msgid "QEMU WRAPPERS"
34925 #: ../src/guestfs.pod:948
34927 "If you want to compile your own qemu, run qemu from a non-standard location, "
34928 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
34933 #: ../src/guestfs.pod:952
34935 "There is one important rule to remember: you I<must C<exec qemu>> as the "
34936 "last command in the shell script (so that qemu replaces the shell and "
34937 "becomes the direct child of the libguestfs-using program). If you don't do "
34938 "this, then the qemu process won't be cleaned up correctly."
34942 #: ../src/guestfs.pod:957
34944 "Here is an example of a wrapper, where I have built my own copy of qemu from "
34949 #: ../src/guestfs.pod:960
34953 " qemudir=/home/rjones/d/qemu\n"
34954 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
34960 #: ../src/guestfs.pod:964
34962 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
34963 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
34968 #: ../src/guestfs.pod:968
34971 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
34976 #: ../src/guestfs.pod:970
34978 "Note that libguestfs also calls qemu with the -help and -version options in "
34979 "order to determine features."
34983 #: ../src/guestfs.pod:973
34985 "Wrappers can also be used to edit the options passed to qemu. In the "
34986 "following example, the C<-machine ...> option (C<-machine> and the following "
34987 "argument) are removed from the command line and replaced with C<-machine "
34988 "pc,accel=tcg>. The while loop iterates over the options until it finds the "
34989 "right one to remove, putting the remaining options into the C<args> array."
34993 #: ../src/guestfs.pod:982
34997 " while [ $# -gt 0 ]; do\n"
34998 " case \"$1\" in\n"
35002 " args[i]=\"$1\"\n"
35011 #: ../src/guestfs.pod:994
35014 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
35019 #: ../src/guestfs.pod:996
35020 msgid "ATTACHING TO RUNNING DAEMONS"
35024 #: ../src/guestfs.pod:998
35026 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
35027 "babies. Use with caution."
35031 #: ../src/guestfs.pod:1001
35033 "I<Note (2):> This section explains how to attach to a running daemon from a "
35034 "low level perspective. For most users, simply using virt tools such as "
35035 "L<guestfish(1)> with the I<--live> option will \"just work\"."
35039 #: ../src/guestfs.pod:1005
35040 msgid "Using guestfs_set_attach_method"
35044 #: ../src/guestfs.pod:1007
35046 "By calling L</guestfs_set_attach_method> you can change how the library "
35047 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
35048 "L</ARCHITECTURE> for some background)."
35052 #: ../src/guestfs.pod:1011
35054 "The normal attach method is C<appliance>, where a small appliance is created "
35055 "containing the daemon, and then the library connects to this."
35059 #: ../src/guestfs.pod:1014
35061 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
35062 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
35063 "daemon over the Unix domain socket."
35067 #: ../src/guestfs.pod:1018
35069 "The normal use for this is to connect to a running virtual machine that "
35070 "contains a C<guestfsd> daemon, and send commands so you can read and write "
35071 "files inside the live virtual machine."
35075 #: ../src/guestfs.pod:1022
35076 msgid "Using guestfs_add_domain with live flag"
35080 #: ../src/guestfs.pod:1024
35082 "L</guestfs_add_domain> provides some help for getting the correct attach "
35083 "method. If you pass the C<live> option to this function, then (if the "
35084 "virtual machine is running) it will examine the libvirt XML looking for a "
35085 "virtio-serial channel to connect to:"
35089 #: ../src/guestfs.pod:1030
35096 " <channel type='unix'>\n"
35097 " <source mode='bind' path='/path/to/socket'/>\n"
35098 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
35107 #: ../src/guestfs.pod:1042
35109 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
35110 "method to C<unix:/path/to/socket>."
35114 #: ../src/guestfs.pod:1045
35116 "Some of the libguestfs tools (including guestfish) support a I<--live> "
35117 "option which is passed through to L</guestfs_add_domain> thus allowing you "
35118 "to attach to and modify live virtual machines."
35122 #: ../src/guestfs.pod:1049
35124 "The virtual machine needs to have been set up beforehand so that it has the "
35125 "virtio-serial channel and so that guestfsd is running inside it."
35129 #: ../src/guestfs.pod:1053
35130 msgid "ABI GUARANTEE"
35134 #: ../src/guestfs.pod:1055
35136 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
35137 "actions as outlined in this section. Although we will deprecate some "
35138 "actions, for example if they get replaced by newer calls, we will keep the "
35139 "old actions forever. This allows you the developer to program in confidence "
35140 "against the libguestfs API."
35144 #: ../src/guestfs.pod:1061
35145 msgid "BLOCK DEVICE NAMING"
35149 #: ../src/guestfs.pod:1063
35151 "In the kernel there is now quite a profusion of schemata for naming block "
35152 "devices (in this context, by I<block device> I mean a physical or virtual "
35153 "hard drive). The original Linux IDE driver used names starting with "
35154 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
35155 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
35156 "replacement for the old IDE driver (particularly for SATA devices) those "
35157 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
35158 "machines with paravirtualized drivers. This has created several different "
35159 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
35164 #: ../src/guestfs.pod:1075
35166 "As discussed above, libguestfs uses a qemu appliance running an embedded "
35167 "Linux kernel to access block devices. We can run a variety of appliances "
35168 "based on a variety of Linux kernels."
35172 #: ../src/guestfs.pod:1079
35174 "This causes a problem for libguestfs because many API calls use device or "
35175 "partition names. Working scripts and the recipe (example) scripts that we "
35176 "make available over the internet could fail if the naming scheme changes."
35180 #: ../src/guestfs.pod:1084
35182 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
35183 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
35184 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
35185 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
35189 #: ../src/guestfs.pod:1090
35191 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
35192 "L</guestfs_list_partitions> and similar calls return the true names of the "
35193 "devices and partitions as known to the appliance."
35197 #: ../src/guestfs.pod:1095
35198 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
35202 #: ../src/guestfs.pod:1097
35204 "Usually this translation is transparent. However in some (very rare) cases "
35205 "you may need to know the exact algorithm. Such cases include where you use "
35206 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
35207 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
35212 #: ../src/guestfs.pod:1103
35214 "The algorithm is applied only to I<parameters> which are known to be either "
35215 "device or partition names. Return values from functions such as "
35216 "L</guestfs_list_devices> are never changed."
35220 #: ../src/guestfs.pod:1111
35221 msgid "Is the string a parameter which is a device or partition name?"
35225 #: ../src/guestfs.pod:1115
35226 msgid "Does the string begin with C</dev/sd>?"
35230 #: ../src/guestfs.pod:1119
35232 "Does the named device exist? If so, we use that device. However if I<not> "
35233 "then we continue with this algorithm."
35237 #: ../src/guestfs.pod:1124
35238 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
35242 #: ../src/guestfs.pod:1126
35243 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
35247 #: ../src/guestfs.pod:1128
35248 msgid "If that named device exists, use it. If not, continue."
35252 #: ../src/guestfs.pod:1132
35253 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
35257 #: ../src/guestfs.pod:1134
35258 msgid "If that named device exists, use it. If not, return an error."
35262 #: ../src/guestfs.pod:1138
35263 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
35267 #: ../src/guestfs.pod:1140
35269 "Although the standard naming scheme and automatic translation is useful for "
35270 "simple programs and guestfish scripts, for larger programs it is best not to "
35271 "rely on this mechanism."
35275 #: ../src/guestfs.pod:1144
35277 "Where possible for maximum future portability programs using libguestfs "
35278 "should use these future-proof techniques:"
35282 #: ../src/guestfs.pod:1151
35284 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
35285 "device names, and then use those names directly."
35289 #: ../src/guestfs.pod:1154
35290 msgid "Since those device names exist by definition, they will never be translated."
35294 #: ../src/guestfs.pod:1159
35296 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
35297 "filesystem labels."
35301 #: ../src/guestfs.pod:1166
35303 "This section discusses security implications of using libguestfs, "
35304 "particularly with untrusted or malicious guests or disk images."
35308 #: ../src/guestfs.pod:1169
35309 msgid "GENERAL SECURITY CONSIDERATIONS"
35313 #: ../src/guestfs.pod:1171
35315 "Be careful with any files or data that you download from a guest (by "
35316 "\"download\" we mean not just the L</guestfs_download> command but any "
35317 "command that reads files, filenames, directories or anything else from a "
35318 "disk image). An attacker could manipulate the data to fool your program "
35319 "into doing the wrong thing. Consider cases such as:"
35323 #: ../src/guestfs.pod:1181
35324 msgid "the data (file etc) not being present"
35328 #: ../src/guestfs.pod:1185
35329 msgid "being present but empty"
35333 #: ../src/guestfs.pod:1189
35334 msgid "being much larger than normal"
35338 #: ../src/guestfs.pod:1193
35339 msgid "containing arbitrary 8 bit data"
35343 #: ../src/guestfs.pod:1197
35344 msgid "being in an unexpected character encoding"
35348 #: ../src/guestfs.pod:1201
35349 msgid "containing homoglyphs."
35353 #: ../src/guestfs.pod:1205
35354 msgid "SECURITY OF MOUNTING FILESYSTEMS"
35358 #: ../src/guestfs.pod:1207
35360 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
35361 "(VFS) module can sometimes be escalated into exploits by deliberately "
35362 "creating a malicious, malformed filesystem. These exploits are very severe "
35363 "for two reasons. Firstly there are very many filesystem drivers in the "
35364 "kernel, and many of them are infrequently used and not much developer "
35365 "attention has been paid to the code. Linux userspace helps potential "
35366 "crackers by detecting the filesystem type and automatically choosing the "
35367 "right VFS driver, even if that filesystem type is obscure or unexpected for "
35368 "the administrator. Secondly, a kernel-level exploit is like a local root "
35369 "exploit (worse in some ways), giving immediate and total access to the "
35370 "system right down to the hardware level."
35374 #: ../src/guestfs.pod:1220
35376 "That explains why you should never mount a filesystem from an untrusted "
35377 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
35378 "inside a qemu virtual machine, usually running as a non-root user. The "
35379 "attacker would need to write a filesystem which first exploited the kernel, "
35380 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
35381 "the libguestfs protocol, and finally to be as serious as the host kernel "
35382 "exploit it would need to escalate its privileges to root. This multi-step "
35383 "escalation, performed by a static piece of data, is thought to be extremely "
35384 "hard to do, although we never say 'never' about security issues."
35388 #: ../src/guestfs.pod:1231
35390 "In any case callers can reduce the attack surface by forcing the filesystem "
35391 "type when mounting (use L</guestfs_mount_vfs>)."
35395 #: ../src/guestfs.pod:1234
35396 msgid "PROTOCOL SECURITY"
35400 #: ../src/guestfs.pod:1236
35402 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
35403 "defined upper message size. However a program that uses libguestfs must "
35404 "also take care - for example you can write a program that downloads a binary "
35405 "from a disk image and executes it locally, and no amount of protocol "
35406 "security will save you from the consequences."
35410 #: ../src/guestfs.pod:1242
35411 msgid "INSPECTION SECURITY"
35415 #: ../src/guestfs.pod:1244
35417 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
35418 "directly from the guest, and these could contain any 8 bit data. Callers "
35419 "should be careful to escape these before printing them to a structured file "
35420 "(for example, use HTML escaping if creating a web page)."
35424 #: ../src/guestfs.pod:1250
35426 "Guest configuration may be altered in unusual ways by the administrator of "
35427 "the virtual machine, and may not reflect reality (particularly for untrusted "
35428 "or actively malicious guests). For example we parse the hostname from "
35429 "configuration files like C</etc/sysconfig/network> that we find in the "
35430 "guest, but the guest administrator can easily manipulate these files to "
35431 "provide the wrong hostname."
35435 #: ../src/guestfs.pod:1258
35437 "The inspection API parses guest configuration using two external libraries: "
35438 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
35439 "designed to be robust in the face of malicious data, although denial of "
35440 "service attacks are still possible, for example with oversized configuration "
35445 #: ../src/guestfs.pod:1264
35446 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
35450 #: ../src/guestfs.pod:1266
35452 "Be very cautious about running commands from the guest. By running a "
35453 "command in the guest, you are giving CPU time to a binary that you do not "
35454 "control, under the same user account as the library, albeit wrapped in qemu "
35455 "virtualization. More information and alternatives can be found in the "
35456 "section L</RUNNING COMMANDS>."
35460 #: ../src/guestfs.pod:1272
35461 msgid "CVE-2010-3851"
35465 #: ../src/guestfs.pod:1274
35466 msgid "https://bugzilla.redhat.com/642934"
35470 #: ../src/guestfs.pod:1276
35472 "This security bug concerns the automatic disk format detection that qemu "
35473 "does on disk images."
35477 #: ../src/guestfs.pod:1279
35479 "A raw disk image is just the raw bytes, there is no header. Other disk "
35480 "images like qcow2 contain a special header. Qemu deals with this by looking "
35481 "for one of the known headers, and if none is found then assuming the disk "
35482 "image must be raw."
35486 #: ../src/guestfs.pod:1284
35488 "This allows a guest which has been given a raw disk image to write some "
35489 "other header. At next boot (or when the disk image is accessed by "
35490 "libguestfs) qemu would do autodetection and think the disk image format was, "
35491 "say, qcow2 based on the header written by the guest."
35495 #: ../src/guestfs.pod:1289
35497 "This in itself would not be a problem, but qcow2 offers many features, one "
35498 "of which is to allow a disk image to refer to another image (called the "
35499 "\"backing disk\"). It does this by placing the path to the backing disk "
35500 "into the qcow2 header. This path is not validated and could point to any "
35501 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
35502 "\"holes\" in the qcow2 disk image, which of course is completely under the "
35503 "control of the attacker."
35507 #: ../src/guestfs.pod:1297
35508 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
35512 #: ../src/guestfs.pod:1304
35513 msgid "You have enabled the network or have opened the disk in write mode."
35517 #: ../src/guestfs.pod:1308
35519 "You are also running untrusted code from the guest (see L</RUNNING "
35524 #: ../src/guestfs.pod:1313
35526 "The way to avoid this is to specify the expected disk format when adding "
35527 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
35528 "should always do this if the disk is raw format, and it's a good idea for "
35533 #: ../src/guestfs.pod:1318
35535 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
35536 "format is fetched from libvirt and passed through."
35540 #: ../src/guestfs.pod:1321
35542 "For libguestfs tools, use the I<--format> command line parameter as "
35547 #: ../src/guestfs.pod:1324
35548 msgid "CONNECTION MANAGEMENT"
35552 #: ../src/guestfs.pod:1326
35553 msgid "guestfs_h *"
35557 #: ../src/guestfs.pod:1328
35559 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
35560 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
35561 "handle and release all resources used."
35565 #: ../src/guestfs.pod:1332
35567 "For information on using multiple handles and threads, see the section "
35568 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
35572 #: ../src/guestfs.pod:1335
35573 msgid "guestfs_create"
35577 #: ../src/guestfs.pod:1337
35580 " guestfs_h *guestfs_create (void);\n"
35585 #: ../src/guestfs.pod:1339
35586 msgid "Create a connection handle."
35590 #: ../src/guestfs.pod:1341
35592 "On success this returns a non-NULL pointer to a handle. On error it returns "
35597 #: ../src/guestfs.pod:1344
35599 "You have to \"configure\" the handle after creating it. This includes "
35600 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
35601 "handle at least once."
35605 #: ../src/guestfs.pod:1348
35606 msgid "After configuring the handle, you have to call L</guestfs_launch>."
35610 #: ../src/guestfs.pod:1350
35612 "You may also want to configure error handling for the handle. See the "
35613 "L</ERROR HANDLING> section below."
35617 #: ../src/guestfs.pod:1353
35618 msgid "guestfs_close"
35622 #: ../src/guestfs.pod:1355
35625 " void guestfs_close (guestfs_h *g);\n"
35630 #: ../src/guestfs.pod:1357
35631 msgid "This closes the connection handle and frees up all resources used."
35635 #: ../src/guestfs.pod:1359
35637 "If autosync was set on the handle and the handle was launched, then this "
35638 "implicitly calls various functions to unmount filesystems and sync the "
35639 "disk. See L</guestfs_set_autosync> for more details."
35643 #: ../src/guestfs.pod:1363
35644 msgid "If a close callback was set on the handle, then it is called."
35648 #: ../src/guestfs.pod:1365
35649 msgid "ERROR HANDLING"
35653 #: ../src/guestfs.pod:1367
35655 "API functions can return errors. For example, almost all functions that "
35656 "return C<int> will return C<-1> to indicate an error."
35660 #: ../src/guestfs.pod:1370
35662 "Additional information is available for errors: an error message string and "
35663 "optionally an error number (errno) if the thing that failed was a system "
35668 #: ../src/guestfs.pod:1374
35670 "You can get at the additional information about the last error on the handle "
35671 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
35672 "up an error handler with L</guestfs_set_error_handler>."
35676 #: ../src/guestfs.pod:1379
35678 "When the handle is created, a default error handler is installed which "
35679 "prints the error message string to C<stderr>. For small short-running "
35680 "command line programs it is sufficient to do:"
35684 #: ../src/guestfs.pod:1383
35687 " if (guestfs_launch (g) == -1)\n"
35688 " exit (EXIT_FAILURE);\n"
35693 #: ../src/guestfs.pod:1386
35695 "since the default error handler will ensure that an error message has been "
35696 "printed to C<stderr> before the program exits."
35700 #: ../src/guestfs.pod:1389
35702 "For other programs the caller will almost certainly want to install an "
35703 "alternate error handler or do error handling in-line like this:"
35707 #: ../src/guestfs.pod:1392
35710 " /* This disables the default behaviour of printing errors\n"
35712 " guestfs_set_error_handler (g, NULL, NULL);\n"
35717 #: ../src/guestfs.pod:1396
35720 " if (guestfs_launch (g) == -1) {\n"
35721 " /* Examine the error message and print it etc. */\n"
35722 " char *msg = guestfs_last_error (g);\n"
35723 " int errnum = guestfs_last_errno (g);\n"
35724 " fprintf (stderr, \"%s\", msg);\n"
35725 " if (errnum != 0)\n"
35726 " fprintf (stderr, \": %s\", strerror (errnum));\n"
35727 " fprintf (stderr, \"\\n\");\n"
35734 #: ../src/guestfs.pod:1407
35736 "Out of memory errors are handled differently. The default action is to call "
35737 "L<abort(3)>. If this is undesirable, then you can set a handler using "
35738 "L</guestfs_set_out_of_memory_handler>."
35742 #: ../src/guestfs.pod:1411
35744 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
35745 "because there is no handle if this happens there is no way to get additional "
35746 "error information. However L</guestfs_create> is supposed to be a "
35747 "lightweight operation which can only fail because of insufficient memory (it "
35748 "returns NULL in this case)."
35752 #: ../src/guestfs.pod:1417
35753 msgid "guestfs_last_error"
35757 #: ../src/guestfs.pod:1419
35760 " const char *guestfs_last_error (guestfs_h *g);\n"
35765 #: ../src/guestfs.pod:1421
35767 "This returns the last error message that happened on C<g>. If there has not "
35768 "been an error since the handle was created, then this returns C<NULL>."
35772 #: ../src/guestfs.pod:1425
35774 "The lifetime of the returned string is until the next error occurs, or "
35775 "L</guestfs_close> is called."
35779 #: ../src/guestfs.pod:1428
35780 msgid "guestfs_last_errno"
35784 #: ../src/guestfs.pod:1430
35787 " int guestfs_last_errno (guestfs_h *g);\n"
35792 #: ../src/guestfs.pod:1432
35793 msgid "This returns the last error number (errno) that happened on C<g>."
35797 #: ../src/guestfs.pod:1434
35798 msgid "If successful, an errno integer not equal to zero is returned."
35802 #: ../src/guestfs.pod:1436
35803 msgid "If no error, this returns 0. This call can return 0 in three situations:"
35807 #: ../src/guestfs.pod:1443
35808 msgid "There has not been any error on the handle."
35812 #: ../src/guestfs.pod:1447
35814 "There has been an error but the errno was meaningless. This corresponds to "
35815 "the case where the error did not come from a failed system call, but for "
35816 "some other reason."
35820 #: ../src/guestfs.pod:1453
35822 "There was an error from a failed system call, but for some reason the errno "
35823 "was not captured and returned. This usually indicates a bug in libguestfs."
35827 #: ../src/guestfs.pod:1459
35829 "Libguestfs tries to convert the errno from inside the applicance into a "
35830 "corresponding errno for the caller (not entirely trivial: the appliance "
35831 "might be running a completely different operating system from the library "
35832 "and error numbers are not standardized across Un*xen). If this could not be "
35833 "done, then the error is translated to C<EINVAL>. In practice this should "
35834 "only happen in very rare circumstances."
35838 #: ../src/guestfs.pod:1467
35839 msgid "guestfs_set_error_handler"
35843 #: ../src/guestfs.pod:1469
35846 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
35848 " const char *msg);\n"
35849 " void guestfs_set_error_handler (guestfs_h *g,\n"
35850 " guestfs_error_handler_cb cb,\n"
35851 " void *opaque);\n"
35856 #: ../src/guestfs.pod:1476
35858 "The callback C<cb> will be called if there is an error. The parameters "
35859 "passed to the callback are an opaque data pointer and the error message "
35864 #: ../src/guestfs.pod:1480
35866 "C<errno> is not passed to the callback. To get that the callback must call "
35867 "L</guestfs_last_errno>."
35871 #: ../src/guestfs.pod:1483
35873 "Note that the message string C<msg> is freed as soon as the callback "
35874 "function returns, so if you want to stash it somewhere you must make your "
35879 #: ../src/guestfs.pod:1487
35880 msgid "The default handler prints messages on C<stderr>."
35884 #: ../src/guestfs.pod:1489
35885 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
35889 #: ../src/guestfs.pod:1491
35890 msgid "guestfs_get_error_handler"
35894 #: ../src/guestfs.pod:1493
35897 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
35898 " void **opaque_rtn);\n"
35903 #: ../src/guestfs.pod:1496
35904 msgid "Returns the current error handler callback."
35908 #: ../src/guestfs.pod:1498
35909 msgid "guestfs_set_out_of_memory_handler"
35913 #: ../src/guestfs.pod:1500
35916 " typedef void (*guestfs_abort_cb) (void);\n"
35917 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
35918 " guestfs_abort_cb);\n"
35923 #: ../src/guestfs.pod:1504
35925 "The callback C<cb> will be called if there is an out of memory situation. "
35926 "I<Note this callback must not return>."
35930 #: ../src/guestfs.pod:1507
35931 msgid "The default is to call L<abort(3)>."
35935 #: ../src/guestfs.pod:1509
35936 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
35940 #: ../src/guestfs.pod:1512
35941 msgid "guestfs_get_out_of_memory_handler"
35945 #: ../src/guestfs.pod:1514
35948 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
35953 #: ../src/guestfs.pod:1516
35954 msgid "This returns the current out of memory handler."
35958 #: ../src/guestfs.pod:1518
35963 #: ../src/guestfs.pod:1522
35968 #: ../src/guestfs.pod:1524
35973 #: ../src/guestfs.pod:1526
35974 msgid "AVAILABILITY"
35978 #: ../src/guestfs.pod:1528
35979 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
35983 #: ../src/guestfs.pod:1530
35985 "Using L</guestfs_available> you can test availability of the following "
35986 "groups of functions. This test queries the appliance to see if the "
35987 "appliance you are currently using supports the functionality."
35991 #: ../src/guestfs.pod:1535
35992 msgid "@AVAILABILITY@"
35996 #: ../src/guestfs.pod:1537
35997 msgid "GUESTFISH supported COMMAND"
36001 #: ../src/guestfs.pod:1539
36003 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
36004 "prints out the available groups and whether they are supported by this build "
36005 "of libguestfs. Note however that you have to do C<run> first."
36009 #: ../src/guestfs.pod:1544
36010 msgid "SINGLE CALLS AT COMPILE TIME"
36014 #: ../src/guestfs.pod:1546
36016 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
36017 "function, such as:"
36021 #: ../src/guestfs.pod:1549
36024 " #define LIBGUESTFS_HAVE_DD 1\n"
36029 #: ../src/guestfs.pod:1551
36030 msgid "if L</guestfs_dd> is available."
36034 #: ../src/guestfs.pod:1553
36036 "Before version 1.5.8, if you needed to test whether a single libguestfs "
36037 "function is available at compile time, we recommended using build tools such "
36038 "as autoconf or cmake. For example in autotools you could use:"
36042 #: ../src/guestfs.pod:1558
36045 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
36046 " AC_CHECK_FUNCS([guestfs_dd])\n"
36051 #: ../src/guestfs.pod:1561
36053 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
36058 #: ../src/guestfs.pod:1564
36059 msgid "SINGLE CALLS AT RUN TIME"
36063 #: ../src/guestfs.pod:1566
36065 "Testing at compile time doesn't guarantee that a function really exists in "
36066 "the library. The reason is that you might be dynamically linked against a "
36067 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
36068 "This situation unfortunately results in a segmentation fault, which is a "
36069 "shortcoming of the C dynamic linking system itself."
36073 #: ../src/guestfs.pod:1573
36075 "You can use L<dlopen(3)> to test if a function is available at run time, as "
36076 "in this example program (note that you still need the compile time check as "
36081 #: ../src/guestfs.pod:1577
36084 " #include <stdio.h>\n"
36085 " #include <stdlib.h>\n"
36086 " #include <unistd.h>\n"
36087 " #include <dlfcn.h>\n"
36088 " #include <guestfs.h>\n"
36093 #: ../src/guestfs.pod:1583
36098 " #ifdef LIBGUESTFS_HAVE_DD\n"
36100 " int has_function;\n"
36105 #: ../src/guestfs.pod:1589
36108 " /* Test if the function guestfs_dd is really available. */\n"
36109 " dl = dlopen (NULL, RTLD_LAZY);\n"
36111 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
36112 " exit (EXIT_FAILURE);\n"
36114 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
36120 #: ../src/guestfs.pod:1598
36123 " if (!has_function)\n"
36124 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
36126 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
36127 " /* Now it's safe to call\n"
36128 " guestfs_dd (g, \"foo\", \"bar\");\n"
36132 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
36139 #: ../src/guestfs.pod:1611
36141 "You may think the above is an awful lot of hassle, and it is. There are "
36142 "other ways outside of the C linking system to ensure that this kind of "
36143 "incompatibility never arises, such as using package versioning:"
36147 #: ../src/guestfs.pod:1616
36150 " Requires: libguestfs >= 1.0.80\n"
36155 #: ../src/guestfs.pod:1618
36156 msgid "CALLS WITH OPTIONAL ARGUMENTS"
36160 #: ../src/guestfs.pod:1620
36162 "A recent feature of the API is the introduction of calls which take optional "
36163 "arguments. In C these are declared 3 ways. The main way is as a call which "
36164 "takes variable arguments (ie. C<...>), as in this example:"
36168 #: ../src/guestfs.pod:1625
36171 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
36176 #: ../src/guestfs.pod:1627
36178 "Call this with a list of optional arguments, terminated by C<-1>. So to "
36179 "call with no optional arguments specified:"
36183 #: ../src/guestfs.pod:1630
36186 " guestfs_add_drive_opts (g, filename, -1);\n"
36191 #: ../src/guestfs.pod:1632
36192 msgid "With a single optional argument:"
36196 #: ../src/guestfs.pod:1634
36199 " guestfs_add_drive_opts (g, filename,\n"
36200 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36206 #: ../src/guestfs.pod:1638
36211 #: ../src/guestfs.pod:1640
36214 " guestfs_add_drive_opts (g, filename,\n"
36215 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36216 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
36222 #: ../src/guestfs.pod:1645
36224 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
36229 #: ../src/guestfs.pod:1648
36230 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
36234 #: ../src/guestfs.pod:1650
36236 "The second variant has the same name with the suffix C<_va>, which works the "
36237 "same way but takes a C<va_list>. See the C manual for details. For the "
36238 "example function, this is declared:"
36242 #: ../src/guestfs.pod:1654
36245 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
36246 " va_list args);\n"
36251 #: ../src/guestfs.pod:1657
36252 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
36256 #: ../src/guestfs.pod:1659
36258 "The third variant is useful where you need to construct these calls. You "
36259 "pass in a structure where you fill in the optional fields. The structure "
36260 "has a bitmask as the first element which you must set to indicate which "
36261 "fields you have filled in. For our example function the structure and call "
36266 #: ../src/guestfs.pod:1665
36269 " struct guestfs_add_drive_opts_argv {\n"
36270 " uint64_t bitmask;\n"
36272 " const char *format;\n"
36275 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
36276 " const struct guestfs_add_drive_opts_argv *optargs);\n"
36281 #: ../src/guestfs.pod:1674
36282 msgid "You could call it like this:"
36286 #: ../src/guestfs.pod:1676
36289 " struct guestfs_add_drive_opts_argv optargs = {\n"
36290 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
36291 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
36292 " .readonly = 1,\n"
36293 " .format = \"qcow2\"\n"
36299 #: ../src/guestfs.pod:1683
36302 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
36307 #: ../src/guestfs.pod:1691
36308 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
36312 #: ../src/guestfs.pod:1696
36313 msgid "You do not need to fill in all fields of the structure."
36317 #: ../src/guestfs.pod:1700
36319 "There must be a one-to-one correspondence between fields of the structure "
36320 "that are filled in, and bits set in the bitmask."
36324 #: ../src/guestfs.pod:1705
36325 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
36329 #: ../src/guestfs.pod:1707
36331 "In other languages, optional arguments are expressed in the way that is "
36332 "natural for that language. We refer you to the language-specific "
36333 "documentation for more details on that."
36337 #: ../src/guestfs.pod:1711
36338 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
36342 #: ../src/guestfs.pod:1713
36343 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
36347 #: ../src/guestfs.pod:1715
36349 "B<Note:> This section documents the generic event mechanism introduced in "
36350 "libguestfs 1.10, which you should use in new code if possible. The old "
36351 "functions C<guestfs_set_log_message_callback>, "
36352 "C<guestfs_set_subprocess_quit_callback>, "
36353 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
36354 "C<guestfs_set_progress_callback> are no longer documented in this manual "
36355 "page. Because of the ABI guarantee, the old functions continue to work."
36359 #: ../src/guestfs.pod:1724
36361 "Handles generate events when certain things happen, such as log messages "
36362 "being generated, progress messages during long-running operations, or the "
36363 "handle being closed. The API calls described below let you register a "
36364 "callback to be called when events happen. You can register multiple "
36365 "callbacks (for the same, different or overlapping sets of events), and "
36366 "individually remove callbacks. If callbacks are not removed, then they "
36367 "remain in force until the handle is closed."
36371 #: ../src/guestfs.pod:1732
36373 "In the current implementation, events are only generated synchronously: that "
36374 "means that events (and hence callbacks) can only happen while you are in the "
36375 "middle of making another libguestfs call. The callback is called in the "
36380 #: ../src/guestfs.pod:1737
36382 "Events may contain a payload, usually nothing (void), an array of 64 bit "
36383 "unsigned integers, or a message buffer. Payloads are discussed later on."
36387 #: ../src/guestfs.pod:1741
36388 msgid "CLASSES OF EVENTS"
36392 #: ../src/guestfs.pod:1745
36393 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
36397 #: ../src/guestfs.pod:1748
36399 "The callback function will be called while the handle is being closed "
36400 "(synchronously from L</guestfs_close>)."
36404 #: ../src/guestfs.pod:1751
36406 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
36407 "handles that are open when the program exits. This means that this callback "
36408 "might be called indirectly from L<exit(3)>, which can cause unexpected "
36409 "problems in higher-level languages (eg. if your HLL interpreter has already "
36410 "been cleaned up by the time this is called, and if your callback then jumps "
36411 "into some HLL function)."
36415 #: ../src/guestfs.pod:1758
36417 "If no callback is registered: the handle is closed without any callback "
36422 #: ../src/guestfs.pod:1761
36423 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
36427 #: ../src/guestfs.pod:1764
36429 "The callback function will be called when the child process quits, either "
36430 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
36431 "corresponds to a transition from any state to the CONFIG state)."
36435 #: ../src/guestfs.pod:1768 ../src/guestfs.pod:1777 ../src/guestfs.pod:1894
36436 msgid "If no callback is registered: the event is ignored."
36440 #: ../src/guestfs.pod:1770
36441 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
36445 #: ../src/guestfs.pod:1773
36447 "The callback function will be called when the child process becomes ready "
36448 "first time after it has been launched. (This corresponds to a transition "
36449 "from LAUNCHING to the READY state)."
36453 #: ../src/guestfs.pod:1779
36454 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
36458 #: ../src/guestfs.pod:1782
36460 "Some long-running operations can generate progress messages. If this "
36461 "callback is registered, then it will be called each time a progress message "
36462 "is generated (usually two seconds after the operation started, and three "
36463 "times per second thereafter until it completes, although the frequency may "
36464 "change in future versions)."
36468 #: ../src/guestfs.pod:1788
36470 "The callback receives in the payload four unsigned 64 bit numbers which are "
36471 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
36475 #: ../src/guestfs.pod:1791
36477 "The units of C<total> are not defined, although for some operations C<total> "
36478 "may relate in some way to the amount of data to be transferred (eg. in bytes "
36479 "or megabytes), and C<position> may be the portion which has been "
36484 #: ../src/guestfs.pod:1796
36485 msgid "The only defined and stable parts of the API are:"
36489 #: ../src/guestfs.pod:1802
36491 "The callback can display to the user some type of progress bar or indicator "
36492 "which shows the ratio of C<position>:C<total>."
36496 #: ../src/guestfs.pod:1807
36497 msgid "0 E<lt>= C<position> E<lt>= C<total>"
36501 #: ../src/guestfs.pod:1811
36503 "If any progress notification is sent during a call, then a final progress "
36504 "notification is always sent when C<position> = C<total> (I<unless> the call "
36505 "fails with an error)."
36509 #: ../src/guestfs.pod:1815
36511 "This is to simplify caller code, so callers can easily set the progress "
36512 "indicator to \"100%\" at the end of the operation, without requiring special "
36513 "code to detect this case."
36517 #: ../src/guestfs.pod:1821
36519 "For some calls we are unable to estimate the progress of the call, but we "
36520 "can still generate progress messages to indicate activity. This is known as "
36521 "\"pulse mode\", and is directly supported by certain progress bar "
36522 "implementations (eg. GtkProgressBar)."
36526 #: ../src/guestfs.pod:1826
36528 "For these calls, zero or more progress messages are generated with "
36529 "C<position = 0> and C<total = 1>, followed by a final message with "
36530 "C<position = total = 1>."
36534 #: ../src/guestfs.pod:1830
36536 "As noted above, if the call fails with an error then the final message may "
36537 "not be generated."
36541 #: ../src/guestfs.pod:1835
36543 "The callback also receives the procedure number (C<proc_nr>) and serial "
36544 "number (C<serial>) of the call. These are only useful for debugging "
36545 "protocol issues, and the callback can normally ignore them. The callback "
36546 "may want to print these numbers in error messages or debugging messages."
36550 #: ../src/guestfs.pod:1841
36551 msgid "If no callback is registered: progress messages are discarded."
36555 #: ../src/guestfs.pod:1843
36556 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
36560 #: ../src/guestfs.pod:1846
36562 "The callback function is called whenever a log message is generated by qemu, "
36563 "the appliance kernel, guestfsd (daemon), or utility programs."
36567 #: ../src/guestfs.pod:1849
36569 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
36570 "(L</guestfs_launch>) then additional debug messages are generated."
36574 #: ../src/guestfs.pod:1852 ../src/guestfs.pod:1866
36576 "If no callback is registered: the messages are discarded unless the verbose "
36577 "flag is set in which case they are sent to stderr. You can override the "
36578 "printing of verbose messages to stderr by setting up a callback."
36582 #: ../src/guestfs.pod:1857
36583 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
36587 #: ../src/guestfs.pod:1860
36589 "The callback function is called whenever a log message is generated by the "
36590 "library part of libguestfs."
36594 #: ../src/guestfs.pod:1863
36596 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
36597 "messages are generated."
36601 #: ../src/guestfs.pod:1871
36602 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
36606 #: ../src/guestfs.pod:1874
36608 "The callback function is called whenever a trace message is generated. This "
36609 "only applies if the trace flag (L</guestfs_set_trace>) is set."
36613 #: ../src/guestfs.pod:1877
36615 "If no callback is registered: the messages are sent to stderr. You can "
36616 "override the printing of trace messages to stderr by setting up a callback."
36620 #: ../src/guestfs.pod:1881
36621 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
36625 #: ../src/guestfs.pod:1884
36626 msgid "The callback function is called whenever a libguestfs function is entered."
36630 #: ../src/guestfs.pod:1887
36632 "The payload is a string which contains the name of the function that we are "
36633 "entering (not including C<guestfs_> prefix)."
36637 #: ../src/guestfs.pod:1890
36639 "Note that libguestfs functions can call themselves, so you may see many "
36640 "events from a single call. A few libguestfs functions do not generate this "
36645 #: ../src/guestfs.pod:1898
36646 msgid "guestfs_set_event_callback"
36650 #: ../src/guestfs.pod:1900
36653 " int guestfs_set_event_callback (guestfs_h *g,\n"
36654 " guestfs_event_callback cb,\n"
36655 " uint64_t event_bitmask,\n"
36657 " void *opaque);\n"
36662 #: ../src/guestfs.pod:1906
36664 "This function registers a callback (C<cb>) for all event classes in the "
36665 "C<event_bitmask>."
36669 #: ../src/guestfs.pod:1909
36671 "For example, to register for all log message events, you could call this "
36672 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
36673 "To register a single callback for all possible classes of events, use "
36674 "C<GUESTFS_EVENT_ALL>."
36678 #: ../src/guestfs.pod:1915
36679 msgid "C<flags> should always be passed as 0."
36683 #: ../src/guestfs.pod:1917
36685 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
36686 "it for any purpose."
36690 #: ../src/guestfs.pod:1920
36692 "The return value is the event handle (an integer) which you can use to "
36693 "delete the callback (see below)."
36697 #: ../src/guestfs.pod:1923
36699 "If there is an error, this function returns C<-1>, and sets the error in the "
36700 "handle in the usual way (see L</guestfs_last_error> etc.)"
36704 #: ../src/guestfs.pod:1926
36706 "Callbacks remain in effect until they are deleted, or until the handle is "
36711 #: ../src/guestfs.pod:1929
36713 "In the case where multiple callbacks are registered for a particular event "
36714 "class, all of the callbacks are called. The order in which multiple "
36715 "callbacks are called is not defined."
36719 #: ../src/guestfs.pod:1933
36720 msgid "guestfs_delete_event_callback"
36724 #: ../src/guestfs.pod:1935
36727 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
36732 #: ../src/guestfs.pod:1937
36734 "Delete a callback that was previously registered. C<event_handle> should be "
36735 "the integer that was returned by a previous call to "
36736 "C<guestfs_set_event_callback> on the same handle."
36740 #: ../src/guestfs.pod:1941
36741 msgid "guestfs_event_callback"
36745 #: ../src/guestfs.pod:1943
36748 " typedef void (*guestfs_event_callback) (\n"
36751 " uint64_t event,\n"
36752 " int event_handle,\n"
36754 " const char *buf, size_t buf_len,\n"
36755 " const uint64_t *array, size_t array_len);\n"
36760 #: ../src/guestfs.pod:1952
36761 msgid "This is the type of the event callback function that you have to provide."
36765 #: ../src/guestfs.pod:1955
36767 "The basic parameters are: the handle (C<g>), the opaque user pointer "
36768 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
36769 "handle, and C<flags> which in the current API you should ignore."
36773 #: ../src/guestfs.pod:1959
36775 "The remaining parameters contain the event payload (if any). Each event may "
36776 "contain a payload, which usually relates to the event class, but for future "
36777 "proofing your code should be written to handle any payload for any event "
36782 #: ../src/guestfs.pod:1964
36784 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
36785 "there is no message buffer). Note that this message buffer can contain "
36786 "arbitrary 8 bit data, including NUL bytes."
36790 #: ../src/guestfs.pod:1968
36792 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
36793 "moment this is only used for progress messages."
36797 #: ../src/guestfs.pod:1971
36798 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
36802 #: ../src/guestfs.pod:1973
36804 "One motivation for the generic event API was to allow GUI programs to "
36805 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
36806 "unconditionally to C<stderr>."
36810 #: ../src/guestfs.pod:1977
36812 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
36813 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
36814 "messages are not events; you must capture error messages separately)."
36818 #: ../src/guestfs.pod:1982
36820 "Programs have to set up a callback to capture the classes of events of "
36825 #: ../src/guestfs.pod:1985
36829 " guestfs_set_event_callback\n"
36830 " (g, message_callback,\n"
36831 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
36832 " GUESTFS_EVENT_TRACE,\n"
36833 " 0, NULL) == -1)\n"
36834 " if (eh == -1) {\n"
36835 " // handle error in the usual way\n"
36841 #: ../src/guestfs.pod:1995
36843 "The callback can then direct messages to the appropriate place. In this "
36844 "example, messages are directed to syslog:"
36848 #: ../src/guestfs.pod:1998
36852 " message_callback (\n"
36855 " uint64_t event,\n"
36856 " int event_handle,\n"
36858 " const char *buf, size_t buf_len,\n"
36859 " const uint64_t *array, size_t array_len)\n"
36861 " const int priority = LOG_USER|LOG_INFO;\n"
36862 " if (buf_len > 0)\n"
36863 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
36869 #: ../src/guestfs.pod:2013
36870 msgid "CANCELLING LONG TRANSFERS"
36874 #: ../src/guestfs.pod:2015
36876 "Some operations can be cancelled by the caller while they are in progress. "
36877 "Currently only operations that involve uploading or downloading data can be "
36878 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
36879 "parameters in the generator)."
36883 #: ../src/guestfs.pod:2020
36884 msgid "guestfs_user_cancel"
36888 #: ../src/guestfs.pod:2022
36891 " void guestfs_user_cancel (guestfs_h *g);\n"
36896 #: ../src/guestfs.pod:2024
36897 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
36901 #: ../src/guestfs.pod:2027
36903 "Unlike most other libguestfs calls, this function is signal safe and thread "
36904 "safe. You can call it from a signal handler or from another thread, without "
36905 "needing to do any locking."
36909 #: ../src/guestfs.pod:2031
36911 "The transfer that was in progress (if there is one) will stop shortly "
36912 "afterwards, and will return an error. The errno (see "
36913 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
36914 "out if the operation was cancelled or failed because of another error."
36918 #: ../src/guestfs.pod:2037
36920 "No cleanup is performed: for example, if a file was being uploaded then "
36921 "after cancellation there may be a partially uploaded file. It is the "
36922 "caller's responsibility to clean up if necessary."
36926 #: ../src/guestfs.pod:2041
36927 msgid "There are two common places that you might call C<guestfs_user_cancel>."
36931 #: ../src/guestfs.pod:2043
36933 "In an interactive text-based program, you might call it from a C<SIGINT> "
36934 "signal handler so that pressing C<^C> cancels the current operation. (You "
36935 "also need to call L</guestfs_set_pgroup> so that child processes don't "
36936 "receive the C<^C> signal)."
36940 #: ../src/guestfs.pod:2048
36942 "In a graphical program, when the main thread is displaying a progress bar "
36943 "with a cancel button, wire up the cancel button to call this function."
36947 #: ../src/guestfs.pod:2052
36948 msgid "PRIVATE DATA AREA"
36952 #: ../src/guestfs.pod:2054
36954 "You can attach named pieces of private data to the libguestfs handle, fetch "
36955 "them by name, and walk over them, for the lifetime of the handle. This is "
36956 "called the private data area and is only available from the C API."
36960 #: ../src/guestfs.pod:2059
36961 msgid "To attach a named piece of data, use the following call:"
36965 #: ../src/guestfs.pod:2061
36968 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
36973 #: ../src/guestfs.pod:2063
36975 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
36976 "pointer (which can be C<NULL>). Any previous item with the same key is "
36981 #: ../src/guestfs.pod:2067
36983 "You can use any C<key> you want, but your key should I<not> start with an "
36984 "underscore character. Keys beginning with an underscore character are "
36985 "reserved for internal libguestfs purposes (eg. for implementing language "
36986 "bindings). It is recommended that you prefix the key with some unique "
36987 "string to avoid collisions with other users."
36991 #: ../src/guestfs.pod:2073
36992 msgid "To retrieve the pointer, use:"
36996 #: ../src/guestfs.pod:2075
36999 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
37004 #: ../src/guestfs.pod:2077
37006 "This function returns C<NULL> if either no data is found associated with "
37007 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
37012 #: ../src/guestfs.pod:2081
37014 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
37015 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
37016 "all. In particular, libguestfs does I<not> try to free the data when the "
37017 "handle is closed. If the data must be freed, then the caller must either "
37018 "free it before calling L</guestfs_close> or must set up a close callback to "
37019 "do it (see L</GUESTFS_EVENT_CLOSE>)."
37023 #: ../src/guestfs.pod:2088
37024 msgid "To walk over all entries, use these two functions:"
37028 #: ../src/guestfs.pod:2090
37031 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
37036 #: ../src/guestfs.pod:2092
37039 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
37044 #: ../src/guestfs.pod:2094
37046 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
37047 "not have any particular meaning -- keys are not returned in any defined "
37048 "order). A pointer to the key is returned in C<*key_rtn> and the "
37049 "corresponding data pointer is returned from the function. C<NULL> is "
37050 "returned if there are no keys stored in the handle."
37054 #: ../src/guestfs.pod:2100
37056 "C<guestfs_next_private> returns the next key, pointer pair. The return "
37057 "value of this function is also C<NULL> is there are no further entries to "
37062 #: ../src/guestfs.pod:2104
37063 msgid "Notes about walking over entries:"
37067 #: ../src/guestfs.pod:2110
37068 msgid "You must not call C<guestfs_set_private> while walking over the entries."
37072 #: ../src/guestfs.pod:2115
37074 "The handle maintains an internal iterator which is reset when you call "
37075 "C<guestfs_first_private>. This internal iterator is invalidated when you "
37076 "call C<guestfs_set_private>."
37080 #: ../src/guestfs.pod:2121
37081 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
37085 #: ../src/guestfs.pod:2123
37088 " guestfs_set_private (g, key, NULL);\n"
37093 #: ../src/guestfs.pod:2125
37094 msgid "then that C<key> is not returned when walking."
37098 #: ../src/guestfs.pod:2129
37100 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
37101 "C<guestfs_next_private> or C<guestfs_set_private>."
37105 #: ../src/guestfs.pod:2135
37107 "The following example code shows how to print all keys and data pointers "
37108 "that are associated with the handle C<g>:"
37112 #: ../src/guestfs.pod:2138
37115 " const char *key;\n"
37116 " void *data = guestfs_first_private (g, &key);\n"
37117 " while (data != NULL)\n"
37119 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37120 " data = guestfs_next_private (g, &key);\n"
37126 #: ../src/guestfs.pod:2146
37128 "More commonly you are only interested in keys that begin with an "
37129 "application-specific prefix C<foo_>. Modify the loop like so:"
37133 #: ../src/guestfs.pod:2149
37136 " const char *key;\n"
37137 " void *data = guestfs_first_private (g, &key);\n"
37138 " while (data != NULL)\n"
37140 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37141 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37142 " data = guestfs_next_private (g, &key);\n"
37148 #: ../src/guestfs.pod:2158
37150 "If you need to modify keys while walking, then you have to jump back to the "
37151 "beginning of the loop. For example, to delete all keys prefixed with "
37156 #: ../src/guestfs.pod:2162
37159 " const char *key;\n"
37162 " data = guestfs_first_private (g, &key);\n"
37163 " while (data != NULL)\n"
37165 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37167 " guestfs_set_private (g, key, NULL);\n"
37168 " /* note that 'key' pointer is now invalid, and so is\n"
37169 " the internal iterator */\n"
37172 " data = guestfs_next_private (g, &key);\n"
37178 #: ../src/guestfs.pod:2178
37180 "Note that the above loop is guaranteed to terminate because the keys are "
37181 "being deleted, but other manipulations of keys within the loop might not "
37182 "terminate unless you also maintain an indication of which keys have been "
37187 #: ../src/guestfs.pod:2183
37192 #: ../src/guestfs.pod:2185
37194 "The libguestfs C library can be probed using systemtap or DTrace. This is "
37195 "true of any library, not just libguestfs. However libguestfs also contains "
37196 "static markers to help in probing internal operations."
37200 #: ../src/guestfs.pod:2189
37201 msgid "You can list all the static markers by doing:"
37205 #: ../src/guestfs.pod:2191
37208 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
37209 " .provider(\"guestfs\").mark(\"*\")'\n"
37214 #: ../src/guestfs.pod:2194
37216 "B<Note:> These static markers are I<not> part of the stable API and may "
37217 "change in future versions."
37221 #: ../src/guestfs.pod:2197
37222 msgid "SYSTEMTAP SCRIPT EXAMPLE"
37226 #: ../src/guestfs.pod:2199
37228 "This script contains examples of displaying both the static markers and some "
37229 "ordinary C entry points:"
37233 #: ../src/guestfs.pod:2202
37241 #: ../src/guestfs.pod:2204
37244 " function display_time () {\n"
37245 " now = gettimeofday_us ();\n"
37248 " delta = now - last;\n"
37254 #: ../src/guestfs.pod:2211
37257 " printf (\"%d (+%d):\", now, delta);\n"
37263 #: ../src/guestfs.pod:2214
37268 " printf (\"ready\\n\");\n"
37274 #: ../src/guestfs.pod:2219
37277 " /* Display all calls to static markers. */\n"
37278 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37279 " .provider(\"guestfs\").mark(\"*\") ? {\n"
37280 " display_time();\n"
37281 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
37287 #: ../src/guestfs.pod:2226
37290 " /* Display all calls to guestfs_mkfs* functions. */\n"
37291 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37292 " .function(\"guestfs_mkfs*\") ? {\n"
37293 " display_time();\n"
37294 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
37300 #: ../src/guestfs.pod:2233
37302 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
37303 "program. Note that you either have to be root, or you have to add yourself "
37304 "to several special stap groups. Consult the systemtap documentation for "
37305 "more information."
37309 #: ../src/guestfs.pod:2238
37312 " # stap /tmp/test.stap\n"
37318 #: ../src/guestfs.pod:2241
37319 msgid "In another terminal, run a guestfish command such as this:"
37323 #: ../src/guestfs.pod:2245
37324 msgid "In the first terminal, stap trace output similar to this is shown:"
37328 #: ../src/guestfs.pod:2247
37331 " 1318248056692655 (+0):\tlaunch_start\n"
37332 " 1318248056692850 (+195): launch_build_appliance_start\n"
37333 " 1318248056818285 (+125435): launch_build_appliance_end\n"
37334 " 1318248056838059 (+19774): launch_run_qemu\n"
37335 " 1318248061071167 (+4233108): launch_end\n"
37336 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f "
37337 "device=0x1024e60\n"
37342 #: ../src/guestfs.pod:2254 ../src/guestfs.pod:2259
37347 #: ../src/guestfs.pod:2256
37349 "<!-- old anchor for the next section --> <a "
37350 "name=\"state_machine_and_low_level_event_api\"/>"
37354 #: ../src/guestfs.pod:2261
37355 msgid "ARCHITECTURE"
37359 #: ../src/guestfs.pod:2263
37361 "Internally, libguestfs is implemented by running an appliance (a special "
37362 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
37363 "process of the main program."
37367 #: ../src/guestfs.pod:2267
37370 " ___________________\n"
37372 " | main program |\n"
37374 " | | child process / appliance\n"
37375 " | | __________________________\n"
37377 " +-------------------+ RPC | +-----------------+ |\n"
37378 " | libguestfs <--------------------> guestfsd | |\n"
37379 " | | | +-----------------+ |\n"
37380 " \\___________________/ | | Linux kernel | |\n"
37381 " | +--^--------------+ |\n"
37382 " \\_________|________________/\n"
37384 " _______v______\n"
37387 " | disk image |\n"
37388 " \\______________/\n"
37393 #: ../src/guestfs.pod:2287
37395 "The library, linked to the main program, creates the child process and hence "
37396 "the appliance in the L</guestfs_launch> function."
37400 #: ../src/guestfs.pod:2290
37402 "Inside the appliance is a Linux kernel and a complete stack of userspace "
37403 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
37404 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
37405 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
37406 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
37407 "attached to the qemu process which translates device access by the "
37408 "appliance's Linux kernel into accesses to the image."
37412 #: ../src/guestfs.pod:2299
37414 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
37415 "Although the disk image you are attached to might also be used by some "
37416 "virtual machine, libguestfs doesn't know or care about this. (But you will "
37417 "care if both libguestfs's qemu process and your virtual machine are trying "
37418 "to update the disk image at the same time, since these usually results in "
37419 "massive disk corruption)."
37423 #: ../src/guestfs.pod:2306
37424 msgid "STATE MACHINE"
37428 #: ../src/guestfs.pod:2308
37429 msgid "libguestfs uses a state machine to model the child process:"
37433 #: ../src/guestfs.pod:2310
37437 " guestfs_create\n"
37445 " / | \\ \\ guestfs_launch\n"
37446 " / | _\\__V______\n"
37448 " / | | LAUNCHING |\n"
37449 " / | \\___________/\n"
37451 " / | guestfs_launch\n"
37453 " ______ / __|____V\n"
37454 " / \\ ------> / \\\n"
37455 " | BUSY | | READY |\n"
37456 " \\______/ <------ \\________/\n"
37461 #: ../src/guestfs.pod:2332
37463 "The normal transitions are (1) CONFIG (when the handle is created, but there "
37464 "is no child process), (2) LAUNCHING (when the child process is booting up), "
37465 "(3) alternating between READY and BUSY as commands are issued to, and "
37466 "carried out by, the child process."
37470 #: ../src/guestfs.pod:2337
37472 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
37473 "asynchronously at any time (eg. due to some internal error), and that causes "
37474 "the state to transition back to CONFIG."
37478 #: ../src/guestfs.pod:2341
37480 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
37481 "issued when in the CONFIG state."
37485 #: ../src/guestfs.pod:2344
37487 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
37488 "L</guestfs_launch> blocks until the child process is READY to accept "
37489 "commands (or until some failure or timeout). L</guestfs_launch> internally "
37490 "moves the state from CONFIG to LAUNCHING while it is running."
37494 #: ../src/guestfs.pod:2350
37496 "API actions such as L</guestfs_mount> can only be issued when in the READY "
37497 "state. These API calls block waiting for the command to be carried out "
37498 "(ie. the state to transition to BUSY and then back to READY). There are no "
37499 "non-blocking versions, and no way to issue more than one command per handle "
37500 "at the same time."
37504 #: ../src/guestfs.pod:2356
37506 "Finally, the child process sends asynchronous messages back to the main "
37507 "program, such as kernel log messages. You can register a callback to "
37508 "receive these messages."
37512 #: ../src/guestfs.pod:2360
37517 #: ../src/guestfs.pod:2362
37518 msgid "APPLIANCE BOOT PROCESS"
37522 #: ../src/guestfs.pod:2364
37524 "This process has evolved and continues to evolve. The description here "
37525 "corresponds only to the current version of libguestfs and is provided for "
37526 "information only."
37530 #: ../src/guestfs.pod:2368
37532 "In order to follow the stages involved below, enable libguestfs debugging "
37533 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
37537 #: ../src/guestfs.pod:2373
37538 msgid "Create the appliance"
37542 #: ../src/guestfs.pod:2375
37544 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
37545 "initrd and the appliance."
37549 #: ../src/guestfs.pod:2378
37551 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
37552 "directory if C<TMPDIR> is set)."
37556 #: ../src/guestfs.pod:2381
37558 "For a complete description of how the appliance is created and cached, read "
37559 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
37563 #: ../src/guestfs.pod:2385
37564 msgid "Start qemu and boot the kernel"
37568 #: ../src/guestfs.pod:2387
37569 msgid "qemu is invoked to boot the kernel."
37573 #: ../src/guestfs.pod:2389
37574 msgid "Run the initrd"
37578 #: ../src/guestfs.pod:2391
37580 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
37581 "appliance. The purpose of the initrd is to load enough kernel modules in "
37582 "order that the appliance itself can be mounted and started."
37586 #: ../src/guestfs.pod:2395
37588 "The initrd is a cpio archive called "
37589 "C</var/tmp/.guestfs-E<lt>UIDE<gt>/initrd>."
37593 #: ../src/guestfs.pod:2398
37595 "When the initrd has started you will see messages showing that kernel "
37596 "modules are being loaded, similar to this:"
37600 #: ../src/guestfs.pod:2401
37603 " febootstrap: ext2 mini initrd starting up\n"
37604 " febootstrap: mounting /sys\n"
37605 " febootstrap: internal insmod libcrc32c.ko\n"
37606 " febootstrap: internal insmod crc32c-intel.ko\n"
37611 #: ../src/guestfs.pod:2406
37612 msgid "Find and mount the appliance device"
37616 #: ../src/guestfs.pod:2408
37618 "The appliance is a sparse file containing an ext2 filesystem which contains "
37619 "a familiar (although reduced in size) Linux operating system. It would "
37620 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
37624 #: ../src/guestfs.pod:2412
37626 "The regular disks being inspected by libguestfs are the first devices "
37627 "exposed by qemu (eg. as C</dev/vda>)."
37631 #: ../src/guestfs.pod:2415
37633 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
37634 "there was only one regular disk)."
37638 #: ../src/guestfs.pod:2418
37640 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
37641 "and switch root into the appliance, and run C</init> from the appliance."
37645 #: ../src/guestfs.pod:2422
37646 msgid "If this works successfully you will see messages such as:"
37650 #: ../src/guestfs.pod:2424
37653 " febootstrap: picked /sys/block/vdb/dev as root device\n"
37654 " febootstrap: creating /dev/root as block special 252:16\n"
37655 " febootstrap: mounting new root on /root\n"
37656 " febootstrap: chroot\n"
37657 " Starting /init script ...\n"
37662 #: ../src/guestfs.pod:2430
37664 "Note that C<Starting /init script ...> indicates that the appliance's init "
37665 "script is now running."
37669 #: ../src/guestfs.pod:2433
37670 msgid "Initialize the appliance"
37674 #: ../src/guestfs.pod:2435
37676 "The appliance itself now initializes itself. This involves starting certain "
37677 "processes like C<udev>, possibly printing some debug information, and "
37678 "finally running the daemon (C<guestfsd>)."
37682 #: ../src/guestfs.pod:2439
37687 #: ../src/guestfs.pod:2441
37689 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
37694 #: ../src/guestfs.pod:2444
37697 " verbose daemon enabled\n"
37702 #: ../src/guestfs.pod:2446
37704 "The daemon expects to see a named virtio-serial port exposed by qemu and "
37705 "connected on the other end to the library."
37709 #: ../src/guestfs.pod:2449
37711 "The daemon connects to this port (and hence to the library) and sends a four "
37712 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
37713 "protocol (see below)."
37717 #: ../src/guestfs.pod:2455
37718 msgid "COMMUNICATION PROTOCOL"
37722 #: ../src/guestfs.pod:2457
37724 "Don't rely on using this protocol directly. This section documents how it "
37725 "currently works, but it may change at any time."
37729 #: ../src/guestfs.pod:2460
37731 "The protocol used to talk between the library and the daemon running inside "
37732 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
37733 "1014, RFC 1832, RFC 4506)."
37737 #: ../src/guestfs.pod:2464
37739 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
37740 "this file is automatically generated)."
37744 #: ../src/guestfs.pod:2467
37746 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
37747 "and C<FileOut> parameters, which are handled with very simple request/reply "
37748 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
37749 "parameters, which use the same request and reply messages, but they may also "
37750 "be followed by files sent using a chunked encoding."
37754 #: ../src/guestfs.pod:2474
37755 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
37759 #: ../src/guestfs.pod:2476
37760 msgid "For ordinary functions, the request message is:"
37764 #: ../src/guestfs.pod:2478
37767 " total length (header + arguments,\n"
37768 " but not including the length word itself)\n"
37769 " struct guestfs_message_header (encoded as XDR)\n"
37770 " struct guestfs_<foo>_args (encoded as XDR)\n"
37775 #: ../src/guestfs.pod:2483
37777 "The total length field allows the daemon to allocate a fixed size buffer "
37778 "into which it slurps the rest of the message. As a result, the total length "
37779 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
37780 "effective size of any request is limited to somewhere under this size."
37784 #: ../src/guestfs.pod:2489
37786 "Note also that many functions don't take any arguments, in which case the "
37787 "C<guestfs_I<foo>_args> is completely omitted."
37791 #: ../src/guestfs.pod:2492
37793 "The header contains the procedure number (C<guestfs_proc>) which is how the "
37794 "receiver knows what type of args structure to expect, or none at all."
37798 #: ../src/guestfs.pod:2496
37800 "For functions that take optional arguments, the optional arguments are "
37801 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
37802 "arguments. A bitmask in the header indicates which optional arguments are "
37803 "meaningful. The bitmask is also checked to see if it contains bits set "
37804 "which the daemon does not know about (eg. if more optional arguments were "
37805 "added in a later version of the library), and this causes the call to be "
37810 #: ../src/guestfs.pod:2504
37811 msgid "The reply message for ordinary functions is:"
37815 #: ../src/guestfs.pod:2506
37818 " total length (header + ret,\n"
37819 " but not including the length word itself)\n"
37820 " struct guestfs_message_header (encoded as XDR)\n"
37821 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37826 #: ../src/guestfs.pod:2511
37828 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
37829 "functions that return no formal return values."
37833 #: ../src/guestfs.pod:2514
37834 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
37838 #: ../src/guestfs.pod:2517
37840 "In the case of an error, a flag is set in the header, and the reply message "
37841 "is slightly changed:"
37845 #: ../src/guestfs.pod:2520
37848 " total length (header + error,\n"
37849 " but not including the length word itself)\n"
37850 " struct guestfs_message_header (encoded as XDR)\n"
37851 " struct guestfs_message_error (encoded as XDR)\n"
37856 #: ../src/guestfs.pod:2525
37858 "The C<guestfs_message_error> structure contains the error message as a "
37863 #: ../src/guestfs.pod:2528
37864 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
37868 #: ../src/guestfs.pod:2530
37870 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
37871 "The normal request message is sent (see above). However this is followed by "
37872 "a sequence of file chunks."
37876 #: ../src/guestfs.pod:2534
37879 " total length (header + arguments,\n"
37880 " but not including the length word itself,\n"
37881 " and not including the chunks)\n"
37882 " struct guestfs_message_header (encoded as XDR)\n"
37883 " struct guestfs_<foo>_args (encoded as XDR)\n"
37884 " sequence of chunks for FileIn param #0\n"
37885 " sequence of chunks for FileIn param #1 etc.\n"
37890 #: ../src/guestfs.pod:2542
37891 msgid "The \"sequence of chunks\" is:"
37895 #: ../src/guestfs.pod:2544
37898 " length of chunk (not including length word itself)\n"
37899 " struct guestfs_chunk (encoded as XDR)\n"
37900 " length of chunk\n"
37901 " struct guestfs_chunk (encoded as XDR)\n"
37903 " length of chunk\n"
37904 " struct guestfs_chunk (with data.data_len == 0)\n"
37909 #: ../src/guestfs.pod:2552
37911 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
37912 "is set in the final chunk to indicate either successful completion or early "
37917 #: ../src/guestfs.pod:2556
37919 "At time of writing there are no functions that have more than one FileIn "
37920 "parameter. However this is (theoretically) supported, by sending the "
37921 "sequence of chunks for each FileIn parameter one after another (from left to "
37926 #: ../src/guestfs.pod:2561
37928 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
37929 "transfer. The library does this by sending a chunk with a special flag set "
37930 "to indicate cancellation. When the daemon sees this, it cancels the whole "
37931 "RPC, does I<not> send any reply, and goes back to reading the next request."
37935 #: ../src/guestfs.pod:2567
37937 "The daemon may also cancel. It does this by writing a special word "
37938 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
37939 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
37940 "cancel chunk). The special word is chosen so that even if cancellation "
37941 "happens right at the end of the transfer (after the library has finished "
37942 "writing and has started listening for the reply), the \"spurious\" cancel "
37943 "flag will not be confused with the reply message."
37947 #: ../src/guestfs.pod:2576
37949 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
37950 "limit), and also files where the size is not known in advance (eg. from "
37951 "pipes or sockets). However the chunks are rather small "
37952 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
37953 "to keep much in memory."
37957 #: ../src/guestfs.pod:2582
37958 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
37962 #: ../src/guestfs.pod:2584
37964 "The protocol for FileOut parameters is exactly the same as for FileIn "
37965 "parameters, but with the roles of daemon and library reversed."
37969 #: ../src/guestfs.pod:2587
37972 " total length (header + ret,\n"
37973 " but not including the length word itself,\n"
37974 " and not including the chunks)\n"
37975 " struct guestfs_message_header (encoded as XDR)\n"
37976 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37977 " sequence of chunks for FileOut param #0\n"
37978 " sequence of chunks for FileOut param #1 etc.\n"
37983 #: ../src/guestfs.pod:2595
37984 msgid "INITIAL MESSAGE"
37988 #: ../src/guestfs.pod:2597
37990 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
37991 "which indicates that the guest and daemon is alive. This is what "
37992 "L</guestfs_launch> waits for."
37996 #: ../src/guestfs.pod:2601
37997 msgid "PROGRESS NOTIFICATION MESSAGES"
38001 #: ../src/guestfs.pod:2603
38003 "The daemon may send progress notification messages at any time. These are "
38004 "distinguished by the normal length word being replaced by "
38005 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
38009 #: ../src/guestfs.pod:2607
38011 "The library turns them into progress callbacks (see "
38012 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
38017 #: ../src/guestfs.pod:2611
38019 "The daemon self-limits the frequency of progress messages it sends (see "
38020 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
38025 #: ../src/guestfs.pod:2615
38026 msgid "LIBGUESTFS VERSION NUMBERS"
38030 #: ../src/guestfs.pod:2617
38032 "Since April 2010, libguestfs has started to make separate development and "
38033 "stable releases, along with corresponding branches in our git repository. "
38034 "These separate releases can be identified by version number:"
38038 #: ../src/guestfs.pod:2622
38041 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
38042 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
38048 " | `-------- sub-version\n"
38050 " `------ always '1' because we don't change the ABI\n"
38055 #: ../src/guestfs.pod:2633
38056 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
38060 #: ../src/guestfs.pod:2635
38062 "As time passes we cherry pick fixes from the development branch and backport "
38063 "those into the stable branch, the effect being that the stable branch should "
38064 "get more stable and less buggy over time. So the stable releases are ideal "
38065 "for people who don't need new features but would just like the software to "
38070 #: ../src/guestfs.pod:2641
38071 msgid "Our criteria for backporting changes are:"
38075 #: ../src/guestfs.pod:2647
38077 "Documentation changes which don't affect any code are backported unless the "
38078 "documentation refers to a future feature which is not in stable."
38082 #: ../src/guestfs.pod:2653
38084 "Bug fixes which are not controversial, fix obvious problems, and have been "
38085 "well tested are backported."
38089 #: ../src/guestfs.pod:2658
38091 "Simple rearrangements of code which shouldn't affect how it works get "
38092 "backported. This is so that the code in the two branches doesn't get too "
38093 "far out of step, allowing us to backport future fixes more easily."
38097 #: ../src/guestfs.pod:2664
38099 "We I<don't> backport new features, new APIs, new tools etc, except in one "
38100 "exceptional case: the new feature is required in order to implement an "
38101 "important bug fix."
38105 #: ../src/guestfs.pod:2670
38107 "A new stable branch starts when we think the new features in development are "
38108 "substantial and compelling enough over the current stable branch to warrant "
38109 "it. When that happens we create new stable and development versions 1.N.0 "
38110 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
38111 "stable at this point, but by backporting fixes from development, that branch "
38112 "will stabilize over time."
38116 #: ../src/guestfs.pod:2678
38117 msgid "EXTENDING LIBGUESTFS"
38121 #: ../src/guestfs.pod:2680
38122 msgid "ADDING A NEW API ACTION"
38126 #: ../src/guestfs.pod:2682
38128 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
38129 "documentation) are generated, and this makes it easy to extend the "
38134 #: ../src/guestfs.pod:2686
38135 msgid "To add a new API action there are two changes:"
38139 #: ../src/guestfs.pod:2692
38141 "You need to add a description of the call (name, parameters, return type, "
38142 "tests, documentation) to C<generator/generator_actions.ml>."
38146 #: ../src/guestfs.pod:2695
38148 "There are two sorts of API action, depending on whether the call goes "
38149 "through to the daemon in the appliance, or is serviced entirely by the "
38150 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
38151 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
38152 "an example of the latter, since a trace flag is maintained in the handle and "
38153 "all tracing is done on the library side."
38157 #: ../src/guestfs.pod:2703
38159 "Most new actions are of the first type, and get added to the "
38160 "C<daemon_functions> list. Each function has a unique procedure number used "
38161 "in the RPC protocol which is assigned to that action when we publish "
38162 "libguestfs and cannot be reused. Take the latest procedure number and "
38167 #: ../src/guestfs.pod:2709
38169 "For library-only actions of the second type, add to the "
38170 "C<non_daemon_functions> list. Since these functions are serviced by the "
38171 "library and do not travel over the RPC mechanism to the daemon, these "
38172 "functions do not need a procedure number, and so the procedure number is set "
38177 #: ../src/guestfs.pod:2717
38178 msgid "Implement the action (in C):"
38182 #: ../src/guestfs.pod:2719
38184 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
38185 "C<daemon/> directory."
38189 #: ../src/guestfs.pod:2722
38191 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
38192 "(note: double underscore) in the C<src/> directory."
38196 #: ../src/guestfs.pod:2725
38197 msgid "In either case, use another function as an example of what to do."
38201 #: ../src/guestfs.pod:2729
38202 msgid "After making these changes, use C<make> to compile."
38206 #: ../src/guestfs.pod:2731
38208 "Note that you don't need to implement the RPC, language bindings, manual "
38209 "pages or anything else. It's all automatically generated from the OCaml "
38214 #: ../src/guestfs.pod:2735
38215 msgid "ADDING TESTS FOR AN API ACTION"
38219 #: ../src/guestfs.pod:2737
38221 "You can supply zero or as many tests as you want per API call. The tests "
38222 "can either be added as part of the API description "
38223 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
38224 "drop a script into C<regressions/>. Note that adding a script to "
38225 "C<regressions/> is slower, so if possible use the first method."
38229 #: ../src/guestfs.pod:2743
38231 "The following describes the test environment used when you add an API test "
38232 "in C<generator_actions.ml>."
38236 #: ../src/guestfs.pod:2746
38237 msgid "The test environment has 4 block devices:"
38241 #: ../src/guestfs.pod:2750
38242 msgid "C</dev/sda> 500MB"
38246 #: ../src/guestfs.pod:2752
38247 msgid "General block device for testing."
38251 #: ../src/guestfs.pod:2754
38252 msgid "C</dev/sdb> 50MB"
38256 #: ../src/guestfs.pod:2756
38258 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
38263 #: ../src/guestfs.pod:2759
38264 msgid "C</dev/sdc> 10MB"
38268 #: ../src/guestfs.pod:2761
38269 msgid "Used in a few tests where two block devices are needed."
38273 #: ../src/guestfs.pod:2763
38274 msgid "C</dev/sdd>"
38278 #: ../src/guestfs.pod:2765
38279 msgid "ISO with fixed content (see C<images/test.iso>)."
38283 #: ../src/guestfs.pod:2769
38285 "To be able to run the tests in a reasonable amount of time, the libguestfs "
38286 "appliance and block devices are reused between tests. So don't try testing "
38287 "L</guestfs_kill_subprocess> :-x"
38291 #: ../src/guestfs.pod:2773
38293 "Each test starts with an initial scenario, selected using one of the "
38294 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
38295 "initialize the disks mentioned above in a particular way as documented in "
38296 "C<generator_types.ml>. You should not assume anything about the previous "
38297 "contents of other disks that are not initialized."
38301 #: ../src/guestfs.pod:2779
38303 "You can add a prerequisite clause to any individual test. This is a "
38304 "run-time check, which, if it fails, causes the test to be skipped. Useful "
38305 "if testing a command which might not work on all variations of libguestfs "
38306 "builds. A test that has prerequisite of C<Always> means to run "
38311 #: ../src/guestfs.pod:2785
38313 "In addition, packagers can skip individual tests by setting environment "
38314 "variables before running C<make check>."
38318 #: ../src/guestfs.pod:2788
38321 " SKIP_TEST_<CMD>_<NUM>=1\n"
38326 #: ../src/guestfs.pod:2790
38327 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
38331 #: ../src/guestfs.pod:2792
38336 #: ../src/guestfs.pod:2794
38339 " SKIP_TEST_<CMD>=1\n"
38344 #: ../src/guestfs.pod:2796
38345 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
38349 #: ../src/guestfs.pod:2798
38350 msgid "Packagers can run only certain tests by setting for example:"
38354 #: ../src/guestfs.pod:2800
38357 " TEST_ONLY=\"vfs_type zerofree\"\n"
38362 #: ../src/guestfs.pod:2802
38364 "See C<capitests/tests.c> for more details of how these environment variables "
38369 #: ../src/guestfs.pod:2805
38370 msgid "DEBUGGING NEW API ACTIONS"
38374 #: ../src/guestfs.pod:2807
38375 msgid "Test new actions work before submitting them."
38379 #: ../src/guestfs.pod:2809
38380 msgid "You can use guestfish to try out new commands."
38384 #: ../src/guestfs.pod:2811
38386 "Debugging the daemon is a problem because it runs inside a minimal "
38387 "environment. However you can fprintf messages in the daemon to stderr, and "
38388 "they will show up if you use C<guestfish -v>."
38392 #: ../src/guestfs.pod:2815
38393 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
38397 #: ../src/guestfs.pod:2817
38399 "Our C source code generally adheres to some basic code-formatting "
38400 "conventions. The existing code base is not totally consistent on this "
38401 "front, but we do prefer that contributed code be formatted similarly. In "
38402 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
38403 "indentation level, and other than that, follow the K&R style."
38407 #: ../src/guestfs.pod:2823
38409 "If you use Emacs, add the following to one of one of your start-up files "
38410 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
38414 #: ../src/guestfs.pod:2826
38417 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
38418 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
38419 " (add-hook 'find-file-hook\n"
38420 " '(lambda () (if (and buffer-file-name\n"
38421 " (string-match \"/libguestfs\\\\>\"\n"
38422 " (buffer-file-name))\n"
38423 " (not (string-equal mode-name \"Change Log\"))\n"
38424 " (not (string-equal mode-name \"Makefile\")))\n"
38425 " (setq indent-tabs-mode nil))))\n"
38430 #: ../src/guestfs.pod:2836
38433 " ;;; When editing C sources in libguestfs, use this style.\n"
38434 " (defun libguestfs-c-mode ()\n"
38435 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
38437 " (c-set-style \"K&R\")\n"
38438 " (setq c-indent-level 2)\n"
38439 " (setq c-basic-offset 2))\n"
38440 " (add-hook 'c-mode-hook\n"
38441 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
38442 " (buffer-file-name))\n"
38443 " (libguestfs-c-mode))))\n"
38448 #: ../src/guestfs.pod:2848
38449 msgid "Enable warnings when compiling (and fix any problems this finds):"
38453 #: ../src/guestfs.pod:2851
38456 " ./configure --enable-gcc-warnings\n"
38461 #: ../src/guestfs.pod:2853
38462 msgid "Useful targets are:"
38466 #: ../src/guestfs.pod:2855
38469 " make syntax-check # checks the syntax of the C code\n"
38470 " make check # runs the test suite\n"
38475 #: ../src/guestfs.pod:2858
38476 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
38480 #: ../src/guestfs.pod:2860
38482 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
38483 "which are used to do shell quoting."
38487 #: ../src/guestfs.pod:2865
38492 #: ../src/guestfs.pod:2867
38494 "Simple shell quoted string. Any spaces or other shell characters are "
38499 #: ../src/guestfs.pod:2870
38504 #: ../src/guestfs.pod:2872
38506 "Same as C<%Q> except the string is treated as a path which is prefixed by "
38511 #: ../src/guestfs.pod:2879
38514 " asprintf (&cmd, \"cat %R\", path);\n"
38519 #: ../src/guestfs.pod:2881
38520 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
38524 #: ../src/guestfs.pod:2883
38526 "I<Note:> Do I<not> use these when you are passing parameters to the "
38527 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
38528 "because they are not passed via the shell (instead, straight to exec). You "
38529 "probably want to use the C<sysroot_path()> function however."
38533 #: ../src/guestfs.pod:2889
38534 msgid "SUBMITTING YOUR NEW API ACTIONS"
38538 #: ../src/guestfs.pod:2891
38540 "Submit patches to the mailing list: "
38541 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
38542 "L<rjones@redhat.com>."
38546 #: ../src/guestfs.pod:2895
38547 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
38551 #: ../src/guestfs.pod:2897
38552 msgid "We support i18n (gettext anyhow) in the library."
38556 #: ../src/guestfs.pod:2899
38558 "However many messages come from the daemon, and we don't translate those at "
38559 "the moment. One reason is that the appliance generally has all locale files "
38560 "removed from it, because they take up a lot of space. So we'd have to readd "
38561 "some of those, as well as copying our PO files into the appliance."
38565 #: ../src/guestfs.pod:2905
38567 "Debugging messages are never translated, since they are intended for the "
38572 #: ../src/guestfs.pod:2908
38573 msgid "SOURCE CODE SUBDIRECTORIES"
38577 #: ../src/guestfs.pod:2912
38582 #: ../src/guestfs.pod:2914
38583 msgid "L<virt-alignment-scan(1)> command and documentation."
38587 #: ../src/guestfs.pod:2918
38588 msgid "The libguestfs appliance, build scripts and so on."
38592 #: ../src/guestfs.pod:2920
38593 msgid "C<capitests>"
38597 #: ../src/guestfs.pod:2922
38598 msgid "Automated tests of the C API."
38602 #: ../src/guestfs.pod:2924
38607 #: ../src/guestfs.pod:2926
38609 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
38614 #: ../src/guestfs.pod:2929
38619 #: ../src/guestfs.pod:2931
38621 "Safety and liveness tests of components that libguestfs depends upon (not of "
38622 "libguestfs itself). Mainly this is for qemu and the kernel."
38626 #: ../src/guestfs.pod:2934
38631 #: ../src/guestfs.pod:2936
38633 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
38634 "command and documentation."
38638 #: ../src/guestfs.pod:2939
38643 #: ../src/guestfs.pod:2941
38644 msgid "Outside contributions, experimental parts."
38648 #: ../src/guestfs.pod:2943
38653 #: ../src/guestfs.pod:2945
38655 "The daemon that runs inside the libguestfs appliance and carries out "
38660 #: ../src/guestfs.pod:2948
38665 #: ../src/guestfs.pod:2950
38666 msgid "L<virt-df(1)> command and documentation."
38670 #: ../src/guestfs.pod:2952
38675 #: ../src/guestfs.pod:2954
38676 msgid "L<virt-edit(1)> command and documentation."
38680 #: ../src/guestfs.pod:2956
38681 msgid "C<examples>"
38685 #: ../src/guestfs.pod:2958
38686 msgid "C API example code."
38690 #: ../src/guestfs.pod:2960
38695 #: ../src/guestfs.pod:2962
38697 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
38698 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
38699 "L<virt-tar-out(1)>."
38703 #: ../src/guestfs.pod:2966
38708 #: ../src/guestfs.pod:2968
38709 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
38713 #: ../src/guestfs.pod:2970
38714 msgid "C<generator>"
38718 #: ../src/guestfs.pod:2972
38720 "The crucially important generator, used to automatically generate large "
38721 "amounts of boilerplate C code for things like RPC and bindings."
38725 #: ../src/guestfs.pod:2975
38730 #: ../src/guestfs.pod:2977
38731 msgid "Files used by the test suite."
38735 #: ../src/guestfs.pod:2979
38736 msgid "Some \"phony\" guest images which we test against."
38740 #: ../src/guestfs.pod:2981
38741 msgid "C<inspector>"
38745 #: ../src/guestfs.pod:2983
38746 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
38750 #: ../src/guestfs.pod:2985
38755 #: ../src/guestfs.pod:2987
38756 msgid "Logo used on the website. The fish is called Arthur by the way."
38760 #: ../src/guestfs.pod:2989
38765 #: ../src/guestfs.pod:2991
38766 msgid "M4 macros used by autoconf."
38770 #: ../src/guestfs.pod:2993
38775 #: ../src/guestfs.pod:2995
38776 msgid "Translations of simple gettext strings."
38780 #: ../src/guestfs.pod:2997
38785 #: ../src/guestfs.pod:2999
38787 "The build infrastructure and PO files for translations of manpages and POD "
38788 "files. Eventually this will be combined with the C<po> directory, but that "
38789 "is rather complicated."
38793 #: ../src/guestfs.pod:3003
38794 msgid "C<regressions>"
38798 #: ../src/guestfs.pod:3005
38799 msgid "Regression tests."
38803 #: ../src/guestfs.pod:3007
38808 #: ../src/guestfs.pod:3009
38809 msgid "L<virt-rescue(1)> command and documentation."
38813 #: ../src/guestfs.pod:3011
38818 #: ../src/guestfs.pod:3013
38819 msgid "L<virt-resize(1)> command and documentation."
38823 #: ../src/guestfs.pod:3015
38824 msgid "C<sparsify>"
38828 #: ../src/guestfs.pod:3017
38829 msgid "L<virt-sparsify(1)> command and documentation."
38833 #: ../src/guestfs.pod:3019
38838 #: ../src/guestfs.pod:3021
38839 msgid "Source code to the C library."
38843 #: ../src/guestfs.pod:3023
38848 #: ../src/guestfs.pod:3025
38849 msgid "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
38853 #: ../src/guestfs.pod:3027
38854 msgid "C<test-tool>"
38858 #: ../src/guestfs.pod:3029
38860 "Test tool for end users to test if their qemu/kernel combination will work "
38865 #: ../src/guestfs.pod:3032
38870 #: ../src/guestfs.pod:3034
38875 #: ../src/guestfs.pod:3036
38880 #: ../src/guestfs.pod:3038
38885 #: ../src/guestfs.pod:3040
38890 #: ../src/guestfs.pod:3042
38895 #: ../src/guestfs.pod:3044
38900 #: ../src/guestfs.pod:3046
38905 #: ../src/guestfs.pod:3048
38910 #: ../src/guestfs.pod:3050
38911 msgid "Language bindings."
38915 #: ../src/guestfs.pod:3054
38916 msgid "MAKING A STABLE RELEASE"
38920 #: ../src/guestfs.pod:3056
38922 "When we make a stable release, there are several steps documented here. See "
38923 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
38928 #: ../src/guestfs.pod:3064
38929 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
38933 #: ../src/guestfs.pod:3069
38934 msgid "Finalize RELEASE-NOTES."
38938 #: ../src/guestfs.pod:3073
38939 msgid "Update ROADMAP."
38943 #: ../src/guestfs.pod:3077
38944 msgid "Run C<src/api-support/update-from-tarballs.sh>."
38948 #: ../src/guestfs.pod:3081
38949 msgid "Push and pull from Transifex."
38953 #: ../src/guestfs.pod:3083
38958 #: ../src/guestfs.pod:3085
38966 #: ../src/guestfs.pod:3087
38967 msgid "to push the latest POT files to Transifex. Then run:"
38971 #: ../src/guestfs.pod:3089
38979 #: ../src/guestfs.pod:3091
38980 msgid "which is a wrapper to pull the latest translated C<*.po> files."
38984 #: ../src/guestfs.pod:3095
38986 "Create new stable and development directories under "
38987 "L<http://libguestfs.org/download>."
38991 #: ../src/guestfs.pod:3100
38992 msgid "Create the branch in git:"
38996 #: ../src/guestfs.pod:3102
38999 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
39000 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
39001 " git branch stable-1.XX\n"
39002 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
39007 #: ../src/guestfs.pod:3109
39012 #: ../src/guestfs.pod:3111
39013 msgid "PROTOCOL LIMITS"
39017 #: ../src/guestfs.pod:3113
39019 "Internally libguestfs uses a message-based protocol to pass API calls and "
39020 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
39021 "plenty more detail about this). The maximum message size used by the "
39022 "protocol is slightly less than 4 MB. For some API calls you may need to be "
39023 "aware of this limit. The API calls which may be affected are individually "
39024 "documented, with a link back to this section of the documentation."
39028 #: ../src/guestfs.pod:3121
39030 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
39031 "a simple string. Because this string is at some point internally encoded as "
39032 "a message, the maximum size that it can return is slightly under 4 MB. If "
39033 "the requested file is larger than this then you will get an error."
39037 #: ../src/guestfs.pod:3127
39039 "In order to transfer large files into and out of the guest filesystem, you "
39040 "need to use particular calls that support this. The sections L</UPLOADING> "
39041 "and L</DOWNLOADING> document how to do this."
39045 #: ../src/guestfs.pod:3131
39047 "You might also consider mounting the disk image using our FUSE filesystem "
39048 "support (L<guestmount(1)>)."
39052 #: ../src/guestfs.pod:3134
39053 msgid "MAXIMUM NUMBER OF DISKS"
39057 #: ../src/guestfs.pod:3136
39058 msgid "When using virtio disks (the default) the current limit is B<25> disks."
39062 #: ../src/guestfs.pod:3139
39064 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
39065 "slots. However febootstrap only understands disks with names C</dev/vda> "
39066 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
39071 #: ../src/guestfs.pod:3144
39073 "We are working to substantially raise this limit in future versions but it "
39074 "requires complex changes to qemu."
39078 #: ../src/guestfs.pod:3147
39080 "In future versions of libguestfs it should also be possible to \"hot plug\" "
39081 "disks (add and remove disks after calling L</guestfs_launch>). This also "
39082 "requires changes to qemu."
39086 #: ../src/guestfs.pod:3151
39087 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
39091 #: ../src/guestfs.pod:3153
39092 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
39096 #: ../src/guestfs.pod:3155
39098 "This is because it reserves 4 bits for the minor device number (thus "
39099 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
39103 #: ../src/guestfs.pod:3158
39105 "If you attach a disk with more than 15 partitions, the extra partitions are "
39106 "ignored by libguestfs."
39110 #: ../src/guestfs.pod:3161
39111 msgid "MAXIMUM SIZE OF A DISK"
39115 #: ../src/guestfs.pod:3163
39116 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
39120 #: ../src/guestfs.pod:3165
39122 "We have tested block devices up to 1 exabyte (2**60 or "
39123 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
39128 #: ../src/guestfs.pod:3169
39130 "Although libguestfs probably does not impose any limit, the underlying host "
39131 "storage will. If you store disk images on a host ext4 filesystem, then the "
39132 "maximum size will be limited by the maximum ext4 file size (currently 16 "
39133 "TB). If you store disk images as host logical volumes then you are limited "
39134 "by the maximum size of an LV."
39138 #: ../src/guestfs.pod:3175
39140 "For the hugest disk image files, we recommend using XFS on the host for "
39145 #: ../src/guestfs.pod:3178
39146 msgid "MAXIMUM SIZE OF A PARTITION"
39150 #: ../src/guestfs.pod:3180
39152 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
39153 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
39154 "address a partition located beyond 2 TB on the disk."
39158 #: ../src/guestfs.pod:3184
39160 "It is recommended that you use GPT partitions on disks which are larger than "
39161 "this size. GPT uses 64 bit sector numbers and so can address partitions "
39162 "which are theoretically larger than the largest disk we could support."
39166 #: ../src/guestfs.pod:3189
39167 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
39171 #: ../src/guestfs.pod:3191
39173 "This depends on the filesystem type. libguestfs itself does not impose any "
39174 "known limit. Consult Wikipedia or the filesystem documentation to find out "
39175 "what these limits are."
39179 #: ../src/guestfs.pod:3195
39180 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
39184 #: ../src/guestfs.pod:3197
39186 "The API functions L</guestfs_upload>, L</guestfs_download>, "
39187 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
39188 "uploads and downloads."
39192 #: ../src/guestfs.pod:3201
39193 msgid "INSPECTION LIMITS"
39197 #: ../src/guestfs.pod:3203
39199 "The inspection code has several arbitrary limits on things like the size of "
39200 "Windows Registry hive it will read, and the length of product name. These "
39201 "are intended to stop a malicious guest from consuming arbitrary amounts of "
39202 "memory and disk space on the host, and should not be reached in practice. "
39203 "See the source code for more information."
39207 #: ../src/guestfs.pod:3229
39209 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
39210 "effect as calling C<guestfs_set_verbose (g, 1)>."
39214 #: ../src/guestfs.pod:3241
39216 "Set the path that libguestfs uses to search for a supermin appliance. See "
39217 "the discussion of paths in section L</PATH> above."
39221 #: ../src/guestfs.pod:3250
39222 msgid "See also L</QEMU WRAPPERS> above."
39226 #: ../src/guestfs.pod:3254
39228 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
39229 "effect as calling C<guestfs_set_trace (g, 1)>."
39233 #: ../src/guestfs.pod:3272
39235 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
39236 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
39237 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, "
39238 "L<virt-alignment-scan(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
39239 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
39240 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
39241 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
39242 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, "
39243 "L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
39244 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
39245 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)>, "
39246 "L<http://libguestfs.org/>."
39250 #: ../src/guestfs.pod:3308
39252 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
39253 "L<lvm(8)>, L<disktype(1)>."
39257 #: ../src/guestfs.pod:3315 ../tools/virt-make-fs.pl:571 ../tools/virt-win-reg.pl:772
39262 #: ../src/guestfs.pod:3317
39263 msgid "To get a list of bugs against libguestfs use this link:"
39267 #: ../src/guestfs.pod:3319
39268 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
39272 #: ../src/guestfs.pod:3321
39273 msgid "To report a new bug against libguestfs use this link:"
39277 #: ../src/guestfs.pod:3323
39278 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
39282 #: ../src/guestfs.pod:3325
39283 msgid "When reporting a bug, please check:"
39287 #: ../src/guestfs.pod:3331
39288 msgid "That the bug hasn't been reported already."
39292 #: ../src/guestfs.pod:3335
39293 msgid "That you are testing a recent version."
39297 #: ../src/guestfs.pod:3339
39298 msgid "Describe the bug accurately, and give a way to reproduce it."
39302 #: ../src/guestfs.pod:3343
39304 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
39309 #: ../test-tool/libguestfs-test-tool.pod:5
39310 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
39314 #: ../test-tool/libguestfs-test-tool.pod:9
39317 " libguestfs-test-tool [--options]\n"
39322 #: ../test-tool/libguestfs-test-tool.pod:13
39324 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
39325 "to check basic libguestfs functionality is working. This is needed because "
39326 "libguestfs occasionally breaks for reasons beyond our control: usually "
39327 "because of changes in the underlying qemu or kernel packages, or the host "
39332 #: ../test-tool/libguestfs-test-tool.pod:19
39333 msgid "If you suspect a problem in libguestfs, then just run:"
39337 #: ../test-tool/libguestfs-test-tool.pod:21
39340 " libguestfs-test-tool\n"
39345 #: ../test-tool/libguestfs-test-tool.pod:23
39346 msgid "It will print lots of diagnostic messages."
39350 #: ../test-tool/libguestfs-test-tool.pod:25
39351 msgid "If it runs to completion successfully, you will see this near the end:"
39355 #: ../test-tool/libguestfs-test-tool.pod:27
39358 " ===== TEST FINISHED OK =====\n"
39363 #: ../test-tool/libguestfs-test-tool.pod:29
39364 msgid "and the test tool will exit with code 0."
39368 #: ../test-tool/libguestfs-test-tool.pod:31
39370 "If it fails (and/or exits with non-zero error code), please paste the "
39371 "I<complete, unedited> output of the test tool into a bug report. More "
39372 "information about reporting bugs can be found on the "
39373 "L<http://libguestfs.org/> website."
39377 #: ../test-tool/libguestfs-test-tool.pod:42
39378 msgid "Display short usage information and exit."
39382 #: ../test-tool/libguestfs-test-tool.pod:44
39383 msgid "B<--qemu qemu_binary>"
39387 #: ../test-tool/libguestfs-test-tool.pod:46
39389 "If you have downloaded another qemu binary, point this option at the full "
39390 "path of the binary to try it."
39394 #: ../test-tool/libguestfs-test-tool.pod:49
39395 msgid "B<--qemudir qemu_source_dir>"
39399 #: ../test-tool/libguestfs-test-tool.pod:51
39401 "If you have compiled qemu from source, point this option at the source "
39402 "directory to try it."
39406 #: ../test-tool/libguestfs-test-tool.pod:54
39411 #: ../test-tool/libguestfs-test-tool.pod:56
39412 msgid "B<--timeout N>"
39416 #: ../test-tool/libguestfs-test-tool.pod:58
39418 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
39419 "minutes) which does not usually need to be adjusted."
39423 #: ../test-tool/libguestfs-test-tool.pod:63
39424 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
39428 #: ../test-tool/libguestfs-test-tool.pod:65
39430 "If you have compiled another version of qemu from source and would like to "
39431 "try that, then you can use the I<--qemudir> option to point to the qemu "
39432 "source directory."
39436 #: ../test-tool/libguestfs-test-tool.pod:69
39438 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
39439 "option to point to the binary."
39443 #: ../test-tool/libguestfs-test-tool.pod:72
39445 "Note when using these options, you can ignore the business of qemu wrapper "
39446 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
39447 "wrapper script for you if one is needed."
39451 #: ../test-tool/libguestfs-test-tool.pod:76
39452 msgid "TRYING OUT A DIFFERENT KERNEL"
39456 #: ../test-tool/libguestfs-test-tool.pod:78
39458 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
39459 "libguestfs tries. You do this by setting the environment variables "
39460 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
39464 #: ../test-tool/libguestfs-test-tool.pod:82
39466 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
39471 #: ../test-tool/libguestfs-test-tool.pod:85
39472 msgid "SELF-DIAGNOSIS"
39476 #: ../test-tool/libguestfs-test-tool.pod:87
39478 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
39479 "produced by libguestfs-test-tool and/or possible errors."
39483 #: ../test-tool/libguestfs-test-tool.pod:92
39485 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
39486 "I<1> if there was an error."
39490 #: ../test-tool/libguestfs-test-tool.pod:97
39492 "For the full list of environment variables which may affect libguestfs, "
39493 "please see the L<guestfs(3)> manual page."
39497 #: ../test-tool/libguestfs-test-tool.pod:102
39498 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
39502 #: ../tools/virt-list-filesystems.pl:32
39503 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
39507 #: ../tools/virt-list-filesystems.pl:36
39510 " virt-list-filesystems [--options] domname\n"
39515 #: ../tools/virt-list-filesystems.pl:38
39518 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
39523 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
39525 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
39530 #: ../tools/virt-list-filesystems.pl:45
39532 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
39533 "are contained in a virtual machine or disk image."
39537 #: ../tools/virt-list-filesystems.pl:49
39539 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
39540 "functionality. For more complex cases you should look at the "
39541 "L<guestfish(1)> tool."
39545 #: ../tools/virt-list-filesystems.pl:112
39547 "With this option, C<virt-list-filesystems> displays the type of each "
39548 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
39552 #: ../tools/virt-list-filesystems.pl:119
39557 #: ../tools/virt-list-filesystems.pl:123
39559 "Normally we only show mountable filesystems. If this option is given then "
39560 "swap devices are shown too."
39564 #: ../tools/virt-list-filesystems.pl:197
39566 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
39567 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
39568 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39572 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
39573 msgid "Copyright (C) 2009 Red Hat Inc."
39577 #: ../tools/virt-list-partitions.pl:32
39578 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
39582 #: ../tools/virt-list-partitions.pl:36
39585 " virt-list-partitions [--options] domname\n"
39590 #: ../tools/virt-list-partitions.pl:38
39593 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
39598 #: ../tools/virt-list-partitions.pl:45
39600 "C<virt-list-partitions> is a command line tool to list the partitions that "
39601 "are contained in a virtual machine or disk image. It is mainly useful as a "
39602 "first step to using L<virt-resize(1)>."
39606 #: ../tools/virt-list-partitions.pl:50
39608 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
39609 "functionality. For more complex cases you should look at the "
39610 "L<guestfish(1)> tool."
39614 #: ../tools/virt-list-partitions.pl:113
39615 msgid "Show sizes in human-readable form (eg. \"1G\")."
39619 #: ../tools/virt-list-partitions.pl:123
39621 "With this option, C<virt-list-partitions> displays the type and size of each "
39622 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
39626 #: ../tools/virt-list-partitions.pl:130
39631 #: ../tools/virt-list-partitions.pl:132
39636 #: ../tools/virt-list-partitions.pl:134
39637 msgid "Display the total size of each block device (as a separate row or rows)."
39641 #: ../tools/virt-list-partitions.pl:267
39643 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
39644 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
39645 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39649 #: ../tools/virt-list-partitions.pl:283
39650 msgid "Copyright (C) 2009-2010 Red Hat Inc."
39654 #: ../tools/virt-make-fs.pl:37
39655 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
39659 #: ../tools/virt-make-fs.pl:41
39662 " virt-make-fs [--options] input.tar output.img\n"
39667 #: ../tools/virt-make-fs.pl:43
39670 " virt-make-fs [--options] input.tar.gz output.img\n"
39675 #: ../tools/virt-make-fs.pl:45
39678 " virt-make-fs [--options] directory output.img\n"
39683 #: ../tools/virt-make-fs.pl:49
39685 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
39686 "archive or some files in a directory. It is similar to tools like "
39687 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
39688 "it can create common filesystem types like ext2/3 or NTFS, which can be "
39689 "useful if you want to attach these filesystems to existing virtual machines "
39690 "(eg. to import large amounts of read-only data to a VM)."
39694 #: ../tools/virt-make-fs.pl:57
39695 msgid "Basic usage is:"
39699 #: ../tools/virt-make-fs.pl:59
39702 " virt-make-fs input output.img\n"
39707 #: ../tools/virt-make-fs.pl:61
39709 "where C<input> is either a directory containing files that you want to add, "
39710 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
39711 "C<output.img> is a disk image. The input type is detected automatically. "
39712 "The output disk image defaults to a raw ext2 sparse image unless you specify "
39713 "extra flags (see L</OPTIONS> below)."
39717 #: ../tools/virt-make-fs.pl:67
39718 msgid "FILESYSTEM TYPE"
39722 #: ../tools/virt-make-fs.pl:69
39724 "The default filesystem type is C<ext2>. Just about any filesystem type that "
39725 "libguestfs supports can be used (but I<not> read-only formats like "
39726 "ISO9660). Here are some of the more common choices:"
39730 #: ../tools/virt-make-fs.pl:75
39735 #: ../tools/virt-make-fs.pl:77
39737 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
39738 "you are not going to use the filesystem in a way that requires the journal, "
39739 "then this is just wasted overhead."
39743 #: ../tools/virt-make-fs.pl:81
39744 msgid "I<ntfs> or I<vfat>"
39748 #: ../tools/virt-make-fs.pl:83
39749 msgid "Useful if exporting data to a Windows guest."
39753 #: ../tools/virt-make-fs.pl:85
39755 "I<Note for vfat>: The tar archive or local directory must only contain files "
39756 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
39757 "program running within libguestfs is unable to change the ownership of "
39758 "non-root files, since vfat itself does not support this."
39762 #: ../tools/virt-make-fs.pl:90
39767 #: ../tools/virt-make-fs.pl:92
39769 "Lower overhead than C<ext2>, but certain limitations on filename length and "
39770 "total filesystem size."
39774 #: ../tools/virt-make-fs.pl:97 ../tools/virt-make-fs.pl:116 ../tools/virt-make-fs.pl:149
39779 #: ../tools/virt-make-fs.pl:99
39782 " virt-make-fs --type=minix input minixfs.img\n"
39787 #: ../tools/virt-make-fs.pl:101
39788 msgid "TO PARTITION OR NOT TO PARTITION"
39792 #: ../tools/virt-make-fs.pl:103
39793 msgid "Optionally virt-make-fs can add a partition table to the output disk."
39797 #: ../tools/virt-make-fs.pl:105
39799 "Adding a partition can make the disk image more compatible with certain "
39800 "virtualized operating systems which don't expect to see a filesystem "
39801 "directly located on a block device (Linux doesn't care and will happily "
39802 "handle both types)."
39806 #: ../tools/virt-make-fs.pl:110
39808 "On the other hand, if you have a partition table then the output image is no "
39809 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
39810 "directly on a partitioned disk image. (However libguestfs tools such as "
39811 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
39815 #: ../tools/virt-make-fs.pl:118
39816 msgid "Add an MBR partition:"
39820 #: ../tools/virt-make-fs.pl:120
39823 " virt-make-fs --partition -- input disk.img\n"
39828 #: ../tools/virt-make-fs.pl:122
39830 "If the output disk image could be terabyte-sized or larger, it's better to "
39831 "use an EFI/GPT-compatible partition table:"
39835 #: ../tools/virt-make-fs.pl:125
39838 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
39843 #: ../tools/virt-make-fs.pl:127
39844 msgid "EXTRA SPACE"
39848 #: ../tools/virt-make-fs.pl:129
39850 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
39851 "the files that it contains, but might have extra space. Depending on how "
39852 "you are going to use the output, you might think this extra space is wasted "
39853 "and want to minimize it, or you might want to leave space so that more files "
39854 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
39855 "but you can use the I<--size> flag to leave space in the filesystem if you "
39860 #: ../tools/virt-make-fs.pl:137
39862 "An alternative way to leave extra space but not make the output image any "
39863 "bigger is to use an alternative disk image format (instead of the default "
39864 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
39865 "image format (check your hypervisor supports this before using it). This "
39866 "allows you to choose a large I<--size> but the extra space won't actually be "
39867 "allocated in the image until you try to store something in it."
39871 #: ../tools/virt-make-fs.pl:145
39873 "Don't forget that you can also use local commands including L<resize2fs(8)> "
39874 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
39875 "to build another image from scratch."
39879 #: ../tools/virt-make-fs.pl:151
39882 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
39887 #: ../tools/virt-make-fs.pl:179
39888 msgid "Enable debugging information."
39892 #: ../tools/virt-make-fs.pl:185
39893 msgid "B<--size=E<lt>NE<gt>>"
39897 #: ../tools/virt-make-fs.pl:187
39898 msgid "B<--size=+E<lt>NE<gt>>"
39902 #: ../tools/virt-make-fs.pl:189
39903 msgid "B<-s E<lt>NE<gt>>"
39907 #: ../tools/virt-make-fs.pl:191
39908 msgid "B<-s +E<lt>NE<gt>>"
39912 #: ../tools/virt-make-fs.pl:193
39913 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
39917 #: ../tools/virt-make-fs.pl:196
39919 "If this option is I<not> given, then the output image will be just large "
39920 "enough to contain all the files, with not much wasted space."
39924 #: ../tools/virt-make-fs.pl:199
39926 "To choose a fixed size output disk, specify an absolute number followed by "
39927 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
39928 "Petabytes or Exabytes. This must be large enough to contain all the input "
39929 "files, else you will get an error."
39933 #: ../tools/virt-make-fs.pl:204
39935 "To leave extra space, specify C<+> (plus sign) and a number followed by "
39936 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
39937 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
39938 "the input files, and (approximately) an extra 200 MB free space."
39942 #: ../tools/virt-make-fs.pl:210
39944 "Note that virt-make-fs estimates free space, and therefore will not produce "
39945 "filesystems containing precisely the free space requested. (It is much more "
39946 "expensive and time-consuming to produce a filesystem which has precisely the "
39947 "desired free space)."
39951 #: ../tools/virt-make-fs.pl:219
39952 msgid "B<--format=E<lt>fmtE<gt>>"
39956 #: ../tools/virt-make-fs.pl:221
39957 msgid "B<-F E<lt>fmtE<gt>>"
39961 #: ../tools/virt-make-fs.pl:223
39962 msgid "Choose the output disk image format."
39966 #: ../tools/virt-make-fs.pl:225
39967 msgid "The default is C<raw> (raw sparse disk image)."
39971 #: ../tools/virt-make-fs.pl:227
39973 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
39974 "that would really make sense here is C<qcow2>."
39978 #: ../tools/virt-make-fs.pl:234
39979 msgid "B<--type=E<lt>fsE<gt>>"
39983 #: ../tools/virt-make-fs.pl:236
39984 msgid "B<-t E<lt>fsE<gt>>"
39988 #: ../tools/virt-make-fs.pl:238
39989 msgid "Choose the output filesystem type."
39993 #: ../tools/virt-make-fs.pl:240
39994 msgid "The default is C<ext2>."
39998 #: ../tools/virt-make-fs.pl:242
39999 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
40003 #: ../tools/virt-make-fs.pl:249
40004 msgid "B<--partition>"
40008 #: ../tools/virt-make-fs.pl:251
40009 msgid "B<--partition=E<lt>parttypeE<gt>>"
40013 #: ../tools/virt-make-fs.pl:253
40015 "If specified, this flag adds an MBR partition table to the output disk "
40020 #: ../tools/virt-make-fs.pl:256
40022 "You can change the partition table type, eg. I<--partition=gpt> for large "
40027 #: ../tools/virt-make-fs.pl:259
40029 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
40030 "might consider the next parameter to be the partition type. For example:"
40034 #: ../tools/virt-make-fs.pl:263
40037 " virt-make-fs --partition input.tar output.img\n"
40042 #: ../tools/virt-make-fs.pl:265
40044 "would cause virt-make-fs to think you wanted to use a partition type of "
40045 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
40046 "dash) between options and the input and output arguments:"
40050 #: ../tools/virt-make-fs.pl:269
40053 " virt-make-fs --partition -- input.tar output.img\n"
40058 #: ../tools/virt-make-fs.pl:271
40059 msgid "For MBR, virt-make-fs sets the partition type byte automatically."
40063 #: ../tools/virt-make-fs.pl:559
40065 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
40066 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
40067 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
40071 #: ../tools/virt-make-fs.pl:573 ../tools/virt-win-reg.pl:774
40073 "When reporting bugs, please enable debugging and capture the I<complete> "
40078 #: ../tools/virt-make-fs.pl:576
40081 " export LIBGUESTFS_DEBUG=1\n"
40082 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
40087 #: ../tools/virt-make-fs.pl:579
40089 "Attach /tmp/virt-make-fs.log to a new bug report at "
40090 "L<https://bugzilla.redhat.com/>"
40094 #: ../tools/virt-tar.pl:33
40095 msgid "virt-tar - Extract or upload files to a virtual machine"
40099 #: ../tools/virt-tar.pl:37
40102 " virt-tar [--options] -x domname directory tarball\n"
40107 #: ../tools/virt-tar.pl:39
40110 " virt-tar [--options] -u domname tarball directory\n"
40115 #: ../tools/virt-tar.pl:41
40118 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
40123 #: ../tools/virt-tar.pl:43
40126 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
40131 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
40136 #: ../tools/virt-tar.pl:47
40138 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
40139 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
40143 #: ../tools/virt-tar.pl:52
40144 msgid "Download C</home> from the VM into a local tarball:"
40148 #: ../tools/virt-tar.pl:54
40151 " virt-tar -x domname /home home.tar\n"
40156 #: ../tools/virt-tar.pl:56
40159 " virt-tar -zx domname /home home.tar.gz\n"
40164 #: ../tools/virt-tar.pl:58
40165 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
40169 #: ../tools/virt-tar.pl:60
40172 " virt-tar -u domname uploadstuff.tar /tmp\n"
40177 #: ../tools/virt-tar.pl:62
40180 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
40185 #: ../tools/virt-tar.pl:66
40187 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
40188 "virtual machines. If you do this, you risk disk corruption in the VM. "
40189 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
40193 #: ../tools/virt-tar.pl:71
40195 "You can use I<-x> (extract) on live virtual machines, but you might get "
40196 "inconsistent results or errors if there is filesystem activity inside the "
40197 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
40198 "work, but the only way to guarantee consistent results is if the virtual "
40199 "machine is shut down."
40203 #: ../tools/virt-tar.pl:79
40205 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
40206 "parts of a guest filesystem. There are many possibilities: making backups, "
40207 "uploading data files, snooping on guest activity, fixing or customizing "
40212 #: ../tools/virt-tar.pl:84
40214 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
40215 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
40216 "should look at the L<guestfish(1)> tool."
40220 #: ../tools/virt-tar.pl:88
40222 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
40223 "its contents (recursively) from the virtual machine into a local tarball. "
40224 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
40225 "virtual machine. You cannot use these two options together."
40229 #: ../tools/virt-tar.pl:94
40231 "In addition, you may need to use the I<-z> (gZip) option to enable "
40232 "compression. When uploading, you have to specify I<-z> if the upload file "
40233 "is compressed because virt-tar won't detect this on its own."
40237 #: ../tools/virt-tar.pl:98
40239 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
40240 "example it cannot do PKZip files or bzip2 compression. If you want that "
40241 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
40242 "the L<libguestfs(3)> API)."
40246 #: ../tools/virt-tar.pl:160
40247 msgid "B<--extract>"
40251 #: ../tools/virt-tar.pl:162
40252 msgid "B<--download>"
40256 #: ../tools/virt-tar.pl:164
40261 #: ../tools/virt-tar.pl:166
40262 msgid "B<--upload>"
40266 #: ../tools/virt-tar.pl:168
40268 "Use I<-x> to extract (download) a directory from a virtual machine to a "
40273 #: ../tools/virt-tar.pl:171
40275 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
40276 "Please read the L</WARNING> section above before using this option."
40280 #: ../tools/virt-tar.pl:175
40281 msgid "You must specify exactly one of these options."
40285 #: ../tools/virt-tar.pl:181
40290 #: ../tools/virt-tar.pl:183
40295 #: ../tools/virt-tar.pl:185
40296 msgid "Specify that the input or output tarball is gzip-compressed."
40300 #: ../tools/virt-tar.pl:298
40302 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
40303 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
40304 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
40305 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40309 #: ../tools/virt-win-reg.pl:37
40311 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
40316 #: ../tools/virt-win-reg.pl:41
40319 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
40324 #: ../tools/virt-win-reg.pl:43
40327 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
40332 #: ../tools/virt-win-reg.pl:45
40335 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
40340 #: ../tools/virt-win-reg.pl:47
40343 " virt-win-reg --merge domname [input.reg ...]\n"
40348 #: ../tools/virt-win-reg.pl:49
40351 " virt-win-reg [--options] disk.img ... # instead of domname\n"
40356 #: ../tools/virt-win-reg.pl:53
40358 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
40359 "virtual machines. If you do this, you I<will> get irreversible disk "
40360 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
40361 "but doesn't catch all cases."
40365 #: ../tools/virt-win-reg.pl:58
40367 "Modifying the Windows Registry is an inherently risky operation. The format "
40368 "is deliberately obscure and undocumented, and Registry changes can leave the "
40369 "system unbootable. Therefore when using the I<--merge> option, make sure "
40370 "you have a reliable backup first."
40374 #: ../tools/virt-win-reg.pl:65
40376 "This program can export and merge Windows Registry entries from a Windows "
40381 #: ../tools/virt-win-reg.pl:68
40383 "The first parameter is the libvirt guest name or the raw disk image of a "
40388 #: ../tools/virt-win-reg.pl:71
40390 "If I<--merge> is I<not> specified, then the chosen registry key is "
40391 "displayed/exported (recursively). For example:"
40395 #: ../tools/virt-win-reg.pl:74
40398 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
40403 #: ../tools/virt-win-reg.pl:76
40404 msgid "You can also display single values from within registry keys, for example:"
40408 #: ../tools/virt-win-reg.pl:79
40411 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
40412 " $ virt-win-reg Windows7 $cvkey ProductName\n"
40413 " Windows 7 Enterprise\n"
40418 #: ../tools/virt-win-reg.pl:83
40420 "With I<--merge>, you can merge a textual regedit file into the Windows "
40425 #: ../tools/virt-win-reg.pl:86
40428 " $ virt-win-reg --merge Windows7 changes.reg\n"
40433 #: ../tools/virt-win-reg.pl:90
40435 "This program is only meant for simple access to the registry. If you want "
40436 "to do complicated things with the registry, we suggest you download the "
40437 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
40438 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
40439 "L<hivexregedit(1)>."
40443 #: ../tools/virt-win-reg.pl:159
40448 #: ../tools/virt-win-reg.pl:161
40450 "In merge mode, this merges a textual regedit file into the Windows Registry "
40451 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
40452 "displays or exports Registry entries instead."
40456 #: ../tools/virt-win-reg.pl:165
40458 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
40459 "result in disk corruption. However exporting (without this flag) is always "
40464 #: ../tools/virt-win-reg.pl:173
40465 msgid "B<--encoding> UTF-16LE|ASCII"
40469 #: ../tools/virt-win-reg.pl:175
40471 "When merging (only), you may need to specify the encoding for strings to be "
40472 "used in the hive file. This is explained in detail in "
40473 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
40477 #: ../tools/virt-win-reg.pl:179
40479 "The default is to use UTF-16LE, which should work with recent versions of "
40484 #: ../tools/virt-win-reg.pl:186
40485 msgid "B<--unsafe-printable-strings>"
40489 #: ../tools/virt-win-reg.pl:188
40491 "When exporting (only), assume strings are UTF-16LE and print them as strings "
40492 "instead of hex sequences. Remove the final zero codepoint from strings if "
40497 #: ../tools/virt-win-reg.pl:192
40499 "This is unsafe and does not preserve the fidelity of strings in the original "
40500 "Registry for various reasons:"
40504 #: ../tools/virt-win-reg.pl:199
40506 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
40507 "other encodings will be corrupted by this transformation."
40511 #: ../tools/virt-win-reg.pl:204
40513 "Assumes that everything which has type 1 or 2 is really a string and that "
40514 "everything else is not a string, but the type field in real Registries is "
40519 #: ../tools/virt-win-reg.pl:210
40521 "Loses information about whether a zero codepoint followed the string in the "
40526 #: ../tools/virt-win-reg.pl:215
40528 "This all happens because the Registry itself contains no information about "
40529 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
40533 #: ../tools/virt-win-reg.pl:219
40535 "You should only use this option for quick hacking and debugging of the "
40536 "Registry contents, and I<never> use it if the output is going to be passed "
40537 "into another program or stored in another Registry."
40541 #: ../tools/virt-win-reg.pl:556
40542 msgid "SUPPORTED SYSTEMS"
40546 #: ../tools/virt-win-reg.pl:558
40548 "The program currently supports Windows NT-derived guests starting with "
40549 "Windows XP through to at least Windows 7."
40553 #: ../tools/virt-win-reg.pl:561
40554 msgid "The following Registry keys are supported:"
40558 #: ../tools/virt-win-reg.pl:565
40559 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
40563 #: ../tools/virt-win-reg.pl:567
40564 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
40568 #: ../tools/virt-win-reg.pl:569
40569 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
40573 #: ../tools/virt-win-reg.pl:571
40574 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
40578 #: ../tools/virt-win-reg.pl:573
40579 msgid "C<HKEY_USERS\\.DEFAULT>"
40583 #: ../tools/virt-win-reg.pl:575
40584 msgid "C<HKEY_USERS\\I<SID>>"
40588 #: ../tools/virt-win-reg.pl:577
40589 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
40593 #: ../tools/virt-win-reg.pl:579
40594 msgid "C<HKEY_USERS\\I<username>>"
40598 #: ../tools/virt-win-reg.pl:581
40599 msgid "where I<username> is a local user name (this is a libguestfs extension)."
40603 #: ../tools/virt-win-reg.pl:585
40605 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
40610 #: ../tools/virt-win-reg.pl:588
40612 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
40613 "supported (there is no \"current user\")."
40617 #: ../tools/virt-win-reg.pl:591
40622 #: ../tools/virt-win-reg.pl:593
40624 "C<virt-win-reg> expects that regedit files have already been reencoded in "
40625 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
40626 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
40627 "with Windows-style line endings, you may need to reencode the whole file "
40628 "before or after processing."
40632 #: ../tools/virt-win-reg.pl:599
40634 "To reencode a file from Windows format to Linux (before processing it with "
40635 "the I<--merge> option), you would do something like this:"
40639 #: ../tools/virt-win-reg.pl:602
40642 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
40647 #: ../tools/virt-win-reg.pl:604
40649 "To go in the opposite direction, after exporting and before sending the file "
40650 "to a Windows user, do something like this:"
40654 #: ../tools/virt-win-reg.pl:607
40657 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
40662 #: ../tools/virt-win-reg.pl:609
40663 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
40667 #: ../tools/virt-win-reg.pl:611
40669 "If you are unsure about the current encoding, use the L<file(1)> command. "
40670 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
40671 "Windows-style (CRLF) line endings, like this:"
40675 #: ../tools/virt-win-reg.pl:615
40678 " $ file software.reg\n"
40679 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
40680 " with CRLF line terminators\n"
40685 #: ../tools/virt-win-reg.pl:619
40686 msgid "This file would need conversion before you could I<--merge> it."
40690 #: ../tools/virt-win-reg.pl:621
40691 msgid "CurrentControlSet etc."
40695 #: ../tools/virt-win-reg.pl:623
40697 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
40698 "Registry at the level of the hive file, and therefore you cannot modify "
40703 #: ../tools/virt-win-reg.pl:627
40705 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
40706 "circumstances it might refer to another control set. The way to find out is "
40707 "to look at the C<HKLM\\SYSTEM\\Select> key:"
40711 #: ../tools/virt-win-reg.pl:631
40714 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
40715 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
40716 " \"Current\"=dword:00000001\n"
40717 " \"Default\"=dword:00000001\n"
40718 " \"Failed\"=dword:00000000\n"
40719 " \"LastKnownGood\"=dword:00000002\n"
40724 #: ../tools/virt-win-reg.pl:638
40725 msgid "\"Current\" is the one which Windows will choose when it boots."
40729 #: ../tools/virt-win-reg.pl:640
40730 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
40734 #: ../tools/virt-win-reg.pl:643
40735 msgid "DELETING REGISTRY KEYS AND VALUES"
40739 #: ../tools/virt-win-reg.pl:645
40740 msgid "To delete a whole registry key, use the syntax:"
40744 #: ../tools/virt-win-reg.pl:647
40747 " [-HKEY_LOCAL_MACHINE\\Foo]\n"
40752 #: ../tools/virt-win-reg.pl:649
40753 msgid "To delete a single value within a key, use the syntax:"
40757 #: ../tools/virt-win-reg.pl:651
40760 " [HKEY_LOCAL_MACHINE\\Foo]\n"
40766 #: ../tools/virt-win-reg.pl:654
40767 msgid "WINDOWS TIPS"
40771 #: ../tools/virt-win-reg.pl:656
40773 "Note that some of these tips modify the guest disk image. The guest I<must> "
40774 "be shut off, else you will get disk corruption."
40778 #: ../tools/virt-win-reg.pl:659
40779 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
40783 #: ../tools/virt-win-reg.pl:661
40785 "Prepare a DOS batch script, VBScript or executable. Upload this using "
40786 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
40787 "is uploaded into C<C:\\>:"
40791 #: ../tools/virt-win-reg.pl:665
40794 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
40799 #: ../tools/virt-win-reg.pl:667
40800 msgid "Prepare a regedit file containing the registry change:"
40804 #: ../tools/virt-win-reg.pl:669
40807 " cat > test.reg <<'EOF'\n"
40808 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
40809 " \"Test\"=\"c:\\\\test.bat\"\n"
40815 #: ../tools/virt-win-reg.pl:674
40817 "In this example we use the key C<RunOnce> which means that the script will "
40818 "run precisely once when the first user logs in. If you want it to run every "
40819 "time a user logs in, replace C<RunOnce> with C<Run>."
40823 #: ../tools/virt-win-reg.pl:678
40824 msgid "Now update the registry:"
40828 #: ../tools/virt-win-reg.pl:680
40831 " virt-win-reg --merge WindowsGuest test.reg\n"
40836 #: ../tools/virt-win-reg.pl:682
40837 msgid "INSTALLING A SERVICE"
40841 #: ../tools/virt-win-reg.pl:684
40843 "This section assumes you are familiar with Windows services, and you either "
40844 "have a program which handles the Windows Service Control Protocol directly "
40845 "or you want to run any program using a service wrapper like SrvAny or the "
40850 #: ../tools/virt-win-reg.pl:689
40852 "First upload the program and optionally the service wrapper. In this case "
40853 "the test program is called C<test.exe> and we are using the RHSrvAny "
40858 #: ../tools/virt-win-reg.pl:693
40861 " guestfish -i -d WindowsGuest <<EOF\n"
40862 " upload rhsrvany.exe /rhsrvany.exe\n"
40863 " upload test.exe /test.exe\n"
40869 #: ../tools/virt-win-reg.pl:698
40871 "Prepare a regedit file containing the registry changes. In this example, "
40872 "the first registry change is needed for the service itself or the service "
40873 "wrapper (if used). The second registry change is only needed because I am "
40874 "using the RHSrvAny service wrapper."
40878 #: ../tools/virt-win-reg.pl:703
40881 " cat > service.reg <<'EOF'\n"
40882 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
40883 " \"Type\"=dword:00000010\n"
40884 " \"Start\"=dword:00000002\n"
40885 " \"ErrorControl\"=dword:00000001\n"
40886 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
40887 " \"DisplayName\"=\"RHSrvAny\"\n"
40888 " \"ObjectName\"=\"NetworkService\"\n"
40893 #: ../tools/virt-win-reg.pl:712
40896 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
40897 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
40898 " \"PWD\"=\"c:\\\\Temp\"\n"
40904 #: ../tools/virt-win-reg.pl:723
40906 "For use of C<ControlSet001> see the section above in this manual page. You "
40907 "may need to adjust this according to the control set that is in use by the "
40912 #: ../tools/virt-win-reg.pl:729
40914 "C<\"ObjectName\"> controls the privileges that the service will have. An "
40915 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
40916 "privileged account."
40920 #: ../tools/virt-win-reg.pl:735
40922 "For the meaning of the magic numbers, see this Microsoft KB article: "
40923 "L<http://support.microsoft.com/kb/103000>."
40927 #: ../tools/virt-win-reg.pl:740
40928 msgid "Update the registry:"
40932 #: ../tools/virt-win-reg.pl:742
40935 " virt-win-reg --merge WindowsGuest service.reg\n"
40940 #: ../tools/virt-win-reg.pl:746
40942 "Be careful when passing parameters containing C<\\> (backslash) in the "
40943 "shell. Usually you will have to use 'single quotes' or double backslashes "
40944 "(but not both) to protect them from the shell."
40948 #: ../tools/virt-win-reg.pl:750
40949 msgid "Paths and value names are case-insensitive."
40953 #: ../tools/virt-win-reg.pl:759
40955 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
40956 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
40957 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
40958 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40962 #: ../tools/virt-win-reg.pl:777
40965 " export LIBGUESTFS_DEBUG=1\n"
40966 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
40971 #: ../tools/virt-win-reg.pl:780
40973 "Attach /tmp/virt-win-reg.log to a new bug report at "
40974 "L<https://bugzilla.redhat.com/>"