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.14.2\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-11-09 22:24+0000\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
21 #: ../align/virt-alignment-scan.pod:3 ../cat/virt-cat.pod:3 ../cat/virt-filesystems.pod:3 ../cat/virt-ls.pod:3 ../clone/virt-sysprep.pod:3 ../df/virt-df.pod:3 ../edit/virt-edit.pod:3 ../erlang/examples/guestfs-erlang.pod:3 ../examples/guestfs-examples.pod:3 ../examples/guestfs-recipes.pod:14 ../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:351 ../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 consumer hard drive with 512 byte sectors:"
530 #: ../align/virt-alignment-scan.pod:234
533 " $ cat /sys/block/sda/queue/hw_sector_size\n"
535 " $ cat /sys/block/sda/queue/physical_block_size\n"
537 " $ cat /sys/block/sda/queue/logical_block_size\n"
539 " $ cat /sys/block/sda/queue/minimum_io_size\n"
541 " $ cat /sys/block/sda/queue/optimal_io_size\n"
547 #: ../align/virt-alignment-scan.pod:245
548 msgid "For a new consumer hard drive with 4Kbyte sectors:"
552 #: ../align/virt-alignment-scan.pod:247
555 " $ cat /sys/block/sda/queue/hw_sector_size\n"
557 " $ cat /sys/block/sda/queue/physical_block_size\n"
559 " $ cat /sys/block/sda/queue/logical_block_size\n"
561 " $ cat /sys/block/sda/queue/minimum_io_size\n"
563 " $ cat /sys/block/sda/queue/optimal_io_size\n"
569 #: ../align/virt-alignment-scan.pod:258
570 msgid "For a NetApp LUN:"
574 #: ../align/virt-alignment-scan.pod:260
577 " $ cat /sys/block/sdc/queue/logical_block_size\n"
579 " $ cat /sys/block/sdc/queue/physical_block_size\n"
581 " $ cat /sys/block/sdc/queue/minimum_io_size\n"
583 " $ cat /sys/block/sdc/queue/optimal_io_size\n"
589 #: ../align/virt-alignment-scan.pod:269
591 "The NetApp allows 512 byte accesses (but they will be very inefficient), "
592 "prefers a minimum 4K I/O size, but the optimal I/O size is 64K."
596 #: ../align/virt-alignment-scan.pod:273
598 "For detailed information about what these numbers mean, see "
599 "L<http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/newstorage-iolimits.html>"
603 #: ../align/virt-alignment-scan.pod:276
605 "[Thanks to Matt Booth for providing 4K drive data. Thanks to Mike Snitzer "
606 "for providing NetApp data and additional information.]"
610 #: ../align/virt-alignment-scan.pod:279
611 msgid "1 MB PARTITION ALIGNMENT"
615 #: ../align/virt-alignment-scan.pod:281
617 "Microsoft picked 1 MB as the default alignment for all partitions starting "
618 "with Windows 2008 Server, and Linux has followed this."
622 #: ../align/virt-alignment-scan.pod:284
624 "Assuming 512 byte sectors in the guest, you will now see the first partition "
625 "starting at sector 2048, and subsequent partitions (if any) will start at a "
626 "multiple of 2048 sectors."
630 #: ../align/virt-alignment-scan.pod:288
632 "1 MB alignment is compatible with all current alignment requirements (4K, "
633 "64K) and provides room for future growth in physical block sizes."
637 #: ../align/virt-alignment-scan.pod:291
638 msgid "SETTING ALIGNMENT"
642 #: ../align/virt-alignment-scan.pod:293
644 "L<virt-resize(1)> can change the alignment of the partitions of some "
645 "guests. Currently it can fully align all the partitions of all Windows "
646 "guests, and it will fix the bootloader where necessary. For Linux guests, "
647 "it can align the second and subsequent partitions, so the majority of OS "
648 "accesses except at boot will be aligned."
652 #: ../align/virt-alignment-scan.pod:299
654 "Another way to correct partition alignment problems is to reinstall your "
655 "guest operating systems. If you install operating systems from templates, "
656 "ensure these have correct partition alignment too."
660 #: ../align/virt-alignment-scan.pod:303
662 "For older versions of Windows, the following NetApp document contains useful "
663 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
667 #: ../align/virt-alignment-scan.pod:306
669 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
670 "an explicit C<%pre> section that creates aligned partitions using "
671 "L<parted(8)>. Do not use the Kickstart C<part> command. The NetApp "
672 "document above contains an example."
676 #: ../align/virt-alignment-scan.pod:311 ../cat/virt-cat.pod:231 ../cat/virt-filesystems.pod:373 ../cat/virt-ls.pod:483 ../clone/virt-sysprep.pod:475 ../df/virt-df.pod:215 ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:367 ../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
677 msgid "SHELL QUOTING"
681 #: ../align/virt-alignment-scan.pod:313 ../cat/virt-cat.pod:233 ../cat/virt-filesystems.pod:375 ../cat/virt-ls.pod:485 ../clone/virt-sysprep.pod:477 ../df/virt-df.pod:217 ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:369 ../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
683 "Libvirt guest names can contain arbitrary characters, some of which have "
684 "meaning to the shell such as C<#> and space. You may need to quote or "
685 "escape these characters on the command line. See the shell manual page "
686 "L<sh(1)> for details."
690 #: ../align/virt-alignment-scan.pod:318 ../cat/virt-cat.pod:238 ../cat/virt-filesystems.pod:380 ../cat/virt-ls.pod:490 ../clone/virt-sysprep.pod:482 ../df/virt-df.pod:222 ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1114 ../fuse/guestmount.pod:312 ../inspector/virt-inspector.pod:390 ../resize/virt-resize.pod:683 ../sparsify/virt-sparsify.pod:227 ../test-tool/libguestfs-test-tool.pod:90
695 #: ../align/virt-alignment-scan.pod:320
696 msgid "This program returns:"
700 #: ../align/virt-alignment-scan.pod:324 ../align/virt-alignment-scan.pod:330 ../align/virt-alignment-scan.pod:336 ../align/virt-alignment-scan.pod:343 ../cat/virt-cat.pod:177 ../cat/virt-cat.pod:182 ../cat/virt-cat.pod:187 ../cat/virt-cat.pod:198 ../cat/virt-cat.pod:202 ../clone/virt-sysprep.pod:283 ../clone/virt-sysprep.pod:287 ../clone/virt-sysprep.pod:291 ../clone/virt-sysprep.pod:295 ../clone/virt-sysprep.pod:310 ../clone/virt-sysprep.pod:314 ../clone/virt-sysprep.pod:318 ../clone/virt-sysprep.pod:322 ../clone/virt-sysprep.pod:326 ../clone/virt-sysprep.pod:362 ../clone/virt-sysprep.pod:384 ../clone/virt-sysprep.pod:388 ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266 ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276 ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291 ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102 ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132 ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227 ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235 ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:441 ../fish/guestfish-actions.pod:449 ../fish/guestfish-actions.pod:456 ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:1262 ../fish/guestfish-actions.pod:1266 ../fish/guestfish-actions.pod:1270 ../fish/guestfish-actions.pod:1274 ../fish/guestfish-actions.pod:1282 ../fish/guestfish-actions.pod:1286 ../fish/guestfish-actions.pod:1290 ../fish/guestfish-actions.pod:1300 ../fish/guestfish-actions.pod:1304 ../fish/guestfish-actions.pod:1308 ../fish/guestfish-actions.pod:1398 ../fish/guestfish-actions.pod:1402 ../fish/guestfish-actions.pod:1407 ../fish/guestfish-actions.pod:1412 ../fish/guestfish-actions.pod:1454 ../fish/guestfish-actions.pod:1458 ../fish/guestfish-actions.pod:1463 ../fish/guestfish-actions.pod:1719 ../fish/guestfish-actions.pod:1726 ../fish/guestfish-actions.pod:1733 ../fish/guestfish-actions.pod:2136 ../fish/guestfish-actions.pod:2142 ../fish/guestfish-actions.pod:2150 ../fish/guestfish-actions.pod:2157 ../fish/guestfish-actions.pod:2164 ../fish/guestfish.pod:445 ../fish/guestfish.pod:449 ../fish/guestfish.pod:453 ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:408 ../inspector/virt-inspector.pod:412 ../resize/virt-resize.pod:359 ../resize/virt-resize.pod:363 ../resize/virt-resize.pod:372 ../resize/virt-resize.pod:378 ../sparsify/virt-sparsify.pod:32 ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43 ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54 ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:641 ../src/guestfs-actions.pod:649 ../src/guestfs-actions.pod:656 ../src/guestfs-actions.pod:663 ../src/guestfs-actions.pod:2079 ../src/guestfs-actions.pod:2083 ../src/guestfs-actions.pod:2087 ../src/guestfs-actions.pod:2091 ../src/guestfs-actions.pod:2099 ../src/guestfs-actions.pod:2103 ../src/guestfs-actions.pod:2107 ../src/guestfs-actions.pod:2117 ../src/guestfs-actions.pod:2121 ../src/guestfs-actions.pod:2125 ../src/guestfs-actions.pod:2263 ../src/guestfs-actions.pod:2267 ../src/guestfs-actions.pod:2272 ../src/guestfs-actions.pod:2277 ../src/guestfs-actions.pod:2338 ../src/guestfs-actions.pod:2342 ../src/guestfs-actions.pod:2347 ../src/guestfs-actions.pod:2762 ../src/guestfs-actions.pod:2769 ../src/guestfs-actions.pod:2776 ../src/guestfs-actions.pod:3321 ../src/guestfs-actions.pod:3327 ../src/guestfs-actions.pod:3335 ../src/guestfs-actions.pod:3342 ../src/guestfs-actions.pod:3349 ../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
705 #: ../align/virt-alignment-scan.pod:326
710 #: ../align/virt-alignment-scan.pod:328
711 msgid "successful exit, all partitions are aligned E<ge> 64K for best performance"
715 #: ../align/virt-alignment-scan.pod:332
720 #: ../align/virt-alignment-scan.pod:334
721 msgid "an error scanning the disk image or guest"
725 #: ../align/virt-alignment-scan.pod:338
730 #: ../align/virt-alignment-scan.pod:340
732 "successful exit, some partitions have alignment E<lt> 64K which can result "
733 "in poor performance on high end network storage"
737 #: ../align/virt-alignment-scan.pod:345
742 #: ../align/virt-alignment-scan.pod:347
744 "successful exit, some partitions have alignment E<lt> 4K which can result in "
745 "poor performance on most hypervisors"
749 #: ../align/virt-alignment-scan.pod:352 ../cat/virt-cat.pod:243 ../cat/virt-filesystems.pod:385 ../cat/virt-ls.pod:495 ../clone/virt-sysprep.pod:486 ../df/virt-df.pod: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:395 ../java/examples/guestfs-java.pod:45 ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39 ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod: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
754 #: ../align/virt-alignment-scan.pod:354
756 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
757 "L<virt-resize(1)>, L<http://libguestfs.org/>."
761 #: ../align/virt-alignment-scan.pod:361 ../cat/virt-cat.pod:252 ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:507 ../clone/virt-sysprep.pod:501 ../df/virt-df.pod: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
766 #: ../align/virt-alignment-scan.pod:363 ../cat/virt-cat.pod:254 ../cat/virt-filesystems.pod:398 ../cat/virt-ls.pod:509 ../clone/virt-sysprep.pod:503 ../df/virt-df.pod:237 ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:410 ../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
767 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
771 #: ../align/virt-alignment-scan.pod:365 ../cat/virt-cat.pod:256 ../cat/virt-filesystems.pod:400 ../cat/virt-ls.pod:511 ../clone/virt-sysprep.pod:505 ../df/virt-df.pod: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:418 ../java/examples/guestfs-java.pod:62 ../ocaml/examples/guestfs-ocaml.pod:95 ../perl/examples/guestfs-perl.pod:56 ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod: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
776 #: ../align/virt-alignment-scan.pod:367 ../clone/virt-sysprep.pod:507 ../sparsify/virt-sparsify.pod:270
777 msgid "Copyright (C) 2011 Red Hat Inc."
781 #: ../align/virt-alignment-scan.pod:369 ../cat/virt-cat.pod:260 ../cat/virt-filesystems.pod:404 ../cat/virt-ls.pod:515 ../clone/virt-sysprep.pod:509 ../df/virt-df.pod: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:422 ../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
783 "This program is free software; you can redistribute it and/or modify it "
784 "under the terms of the GNU General Public License as published by the Free "
785 "Software Foundation; either version 2 of the License, or (at your option) "
790 #: ../align/virt-alignment-scan.pod:374 ../cat/virt-cat.pod:265 ../cat/virt-filesystems.pod:409 ../cat/virt-ls.pod:520 ../clone/virt-sysprep.pod:514 ../df/virt-df.pod: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:427 ../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
792 "This program is distributed in the hope that it will be useful, but WITHOUT "
793 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
794 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
799 #: ../align/virt-alignment-scan.pod:379 ../cat/virt-cat.pod:270 ../cat/virt-filesystems.pod:414 ../cat/virt-ls.pod:525 ../clone/virt-sysprep.pod:519 ../df/virt-df.pod: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:432 ../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
801 "You should have received a copy of the GNU General Public License along with "
802 "this program; if not, write to the Free Software Foundation, Inc., 51 "
803 "Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA."
807 #: ../cat/virt-cat.pod:5
808 msgid "virt-cat - Display files in a virtual machine"
812 #: ../cat/virt-cat.pod:9
815 " virt-cat [--options] -d domname file [file ...]\n"
820 #: ../cat/virt-cat.pod:11
823 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
828 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15 ../inspector/virt-inspector.pod:13
833 #: ../cat/virt-cat.pod:15
836 " virt-cat domname file\n"
841 #: ../cat/virt-cat.pod:17
844 " virt-cat disk.img file\n"
849 #: ../cat/virt-cat.pod:21
851 "C<virt-cat> is a command line tool to display the contents of C<file> where "
852 "C<file> exists in the named virtual machine (or disk image)."
856 #: ../cat/virt-cat.pod:24
858 "Multiple filenames can be given, in which case they are concatenated "
859 "together. Each filename must be a full path, starting at the root directory "
860 "(starting with '/')."
864 #: ../cat/virt-cat.pod:28
866 "C<virt-cat> can be used to quickly view a file. To edit a file, use "
867 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
868 "tool (see L</USING GUESTFISH> below)."
872 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43 ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41 ../fish/guestfish.pod:1051 ../fish/virt-copy-in.pod:29 ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30 ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39 ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75 ../tools/virt-tar.pl:50
877 #: ../cat/virt-cat.pod:34
878 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
882 #: ../cat/virt-cat.pod:37
885 " virt-cat -d mydomain /etc/fstab\n"
890 #: ../cat/virt-cat.pod:39
891 msgid "List syslog messages from a VM disk image file:"
895 #: ../cat/virt-cat.pod:41
898 " virt-cat -a disk.img /var/log/messages | tail\n"
903 #: ../cat/virt-cat.pod:43
904 msgid "Find out what DHCP IP address a VM acquired:"
908 #: ../cat/virt-cat.pod:45
911 " virt-cat -d mydomain /var/log/messages | \\\n"
912 " grep 'dhclient: bound to' | tail\n"
917 #: ../cat/virt-cat.pod:48
918 msgid "Find out what packages were recently installed:"
922 #: ../cat/virt-cat.pod:50
925 " virt-cat -d mydomain /var/log/yum.log | tail\n"
930 #: ../cat/virt-cat.pod:52
931 msgid "Find out who is logged on inside a virtual machine:"
935 #: ../cat/virt-cat.pod:54
938 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
944 #: ../cat/virt-cat.pod:57
945 msgid "or who was logged on:"
949 #: ../cat/virt-cat.pod:59
952 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
953 " last -f /tmp/wtmp\n"
958 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103 ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74 ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
960 "Add I<file> which should be a disk image from a virtual machine. If the "
961 "virtual machine has multiple block devices, you must supply all of them with "
962 "separate I<-a> options."
966 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148 ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217 ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:92
967 msgid "B<--echo-keys>"
971 #: ../cat/virt-cat.pod:100
973 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
974 "so you cannot see what you are typing. If you are not worried about Tempest "
975 "attacks and there is no one else in the room you can specify this flag to "
976 "see what you are typing."
980 #: ../cat/virt-cat.pod:116
983 " virt-cat --format=raw -a disk.img file\n"
988 #: ../cat/virt-cat.pod:120
991 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
996 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200 ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289 ../fuse/guestmount.pod:172 ../inspector/virt-inspector.pod:114
997 msgid "B<--keys-from-stdin>"
1001 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202 ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291 ../fuse/guestmount.pod:174 ../inspector/virt-inspector.pod:116
1003 "Read key or passphrase parameters from stdin. The default is to try to read "
1004 "passphrases from the user by opening C</dev/tty>."
1008 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179 ../inspector/virt-inspector.pod:144 ../rescue/virt-rescue.pod:209
1009 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
1013 #: ../cat/virt-cat.pod:154
1014 msgid "Previous versions of virt-cat allowed you to write either:"
1018 #: ../cat/virt-cat.pod:156
1021 " virt-cat disk.img [disk.img ...] file\n"
1026 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185 ../inspector/virt-inspector.pod:150 ../rescue/virt-rescue.pod:215
1031 #: ../cat/virt-cat.pod:160
1034 " virt-cat guestname file\n"
1039 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189 ../inspector/virt-inspector.pod:154 ../rescue/virt-rescue.pod:219
1041 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1042 "the confusing case where a disk image might have the same name as a guest."
1046 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193 ../inspector/virt-inspector.pod:158 ../rescue/virt-rescue.pod:223
1047 msgid "For compatibility the old style is still supported."
1051 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
1052 msgid "WINDOWS PATHS"
1056 #: ../cat/virt-cat.pod:170
1058 "C<virt-cat> has a limited ability to understand Windows drive letters and "
1059 "paths (eg. C<E:\\foo\\bar.txt>)."
1063 #: ../cat/virt-cat.pod:173 ../edit/virt-edit.pod:262
1064 msgid "If and only if the guest is running Windows then:"
1068 #: ../cat/virt-cat.pod:179 ../edit/virt-edit.pod:268
1070 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
1071 "to the correct filesystem."
1075 #: ../cat/virt-cat.pod:184 ../edit/virt-edit.pod:273
1077 "Any backslash (C<\\>) characters in the path are replaced with forward "
1078 "slashes so that libguestfs can process it."
1082 #: ../cat/virt-cat.pod:189
1084 "The path is resolved case insensitively to locate the file that should be "
1089 #: ../cat/virt-cat.pod:194 ../edit/virt-edit.pod:283
1090 msgid "There are some known shortcomings:"
1094 #: ../cat/virt-cat.pod:200 ../edit/virt-edit.pod:289
1095 msgid "Some NTFS symbolic links may not be followed correctly."
1099 #: ../cat/virt-cat.pod:204 ../edit/virt-edit.pod:293
1100 msgid "NTFS junction points that cross filesystems are not followed."
1104 #: ../cat/virt-cat.pod:208 ../edit/virt-edit.pod:297
1105 msgid "USING GUESTFISH"
1109 #: ../cat/virt-cat.pod:210
1111 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1112 "C<virt-cat> doesn't work."
1116 #: ../cat/virt-cat.pod:213
1117 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1121 #: ../cat/virt-cat.pod:215
1124 " guestfish --ro -i -d domname download file -\n"
1129 #: ../cat/virt-cat.pod:217
1131 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1132 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1136 #: ../cat/virt-cat.pod:221
1138 "The command above uses libguestfs's guest inspection feature and so does not "
1139 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1140 "disk images that don't contain guests. To display a file from a disk image "
1145 #: ../cat/virt-cat.pod:226
1148 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1153 #: ../cat/virt-cat.pod:228
1155 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1156 "the disk image, and C<file> is the full path to the file."
1160 #: ../cat/virt-cat.pod:240 ../cat/virt-filesystems.pod:382 ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351 ../fuse/guestmount.pod:314 ../inspector/virt-inspector.pod:392 ../resize/virt-resize.pod:685 ../sparsify/virt-sparsify.pod:229
1161 msgid "This program returns 0 if successful, or non-zero if there was an error."
1165 #: ../cat/virt-cat.pod:245
1167 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
1168 "L<virt-tar-out(1)>, L<http://libguestfs.org/>."
1172 #: ../cat/virt-cat.pod:258 ../inspector/virt-inspector.pod:420 ../resize/virt-resize.pod:717 ../tools/virt-make-fs.pl:588
1173 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1177 #: ../cat/virt-filesystems.pod:5
1179 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1180 "virtual machine or disk image"
1184 #: ../cat/virt-filesystems.pod:9
1187 " virt-filesystems [--options] -d domname\n"
1192 #: ../cat/virt-filesystems.pod:11
1195 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1200 #: ../cat/virt-filesystems.pod:15
1202 "This tool allows you to discover filesystems, partitions, logical volumes, "
1203 "and their sizes in a disk image or virtual machine. It is a replacement for "
1204 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1208 #: ../cat/virt-filesystems.pod:20
1210 "One use for this tool is from shell scripts to iterate over all filesystems "
1211 "from a disk image:"
1215 #: ../cat/virt-filesystems.pod:23
1218 " for fs in $(virt-filesystems -a disk.img); do\n"
1225 #: ../cat/virt-filesystems.pod:27
1227 "Another use is to list partitions before using another tool to modify those "
1228 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1229 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1233 #: ../cat/virt-filesystems.pod:32
1235 "Various command line options control what this program displays. You need "
1236 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1237 "guest respectively. If you just specify that then the program shows "
1238 "filesystems found, one per line, like this:"
1242 #: ../cat/virt-filesystems.pod:37
1245 " $ virt-filesystems -a disk.img\n"
1247 " /dev/vg_guest/lv_root\n"
1252 #: ../cat/virt-filesystems.pod:41
1253 msgid "If you add I<-l> or I<--long> then the output includes extra information:"
1257 #: ../cat/virt-filesystems.pod:44
1260 " $ virt-filesystems -a disk.img -l\n"
1261 " Name Type VFS Label Size\n"
1262 " /dev/sda1 filesystem ext4 boot 524288000\n"
1263 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1268 #: ../cat/virt-filesystems.pod:49
1270 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1275 #: ../cat/virt-filesystems.pod:52
1278 " $ virt-filesystems -a disk.img --extra\n"
1280 " /dev/vg_guest/lv_root\n"
1281 " /dev/vg_guest/lv_swap\n"
1282 " /dev/vg_guest/lv_data\n"
1287 #: ../cat/virt-filesystems.pod:58
1288 msgid "If you add I<--partitions> then partitions are shown instead of filesystems:"
1292 #: ../cat/virt-filesystems.pod:60
1295 " $ virt-filesystems -a disk.img --partitions\n"
1302 #: ../cat/virt-filesystems.pod:64
1304 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, "
1305 "I<--physical-volumes>, I<--block-devices> to list those items."
1309 #: ../cat/virt-filesystems.pod:67
1311 "You can use these options in combination as well (if you want a combination "
1312 "including filesystems, you have to add I<--filesystems>). Notice that some "
1313 "items fall into several categories (eg. C</dev/sda1> might be both a "
1314 "partition and a filesystem). These items are listed several times. To get "
1315 "a list which includes absolutely everything that virt-filesystems knows "
1316 "about, use the I<--all> option."
1320 #: ../cat/virt-filesystems.pod:74
1322 "UUIDs (because they are quite long) are not shown by default. Add the "
1323 "I<--uuid> option to display device and filesystem UUIDs in the long output."
1327 #: ../cat/virt-filesystems.pod:78
1329 "I<--all --long --uuid> is a useful combination to display all possible "
1330 "information about everything."
1334 #: ../cat/virt-filesystems.pod:81
1337 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1338 " Name Type VFS Label Size Parent UUID\n"
1339 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1340 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1341 " /dev/sda1 partition - - 100M /dev/sda -\n"
1342 " /dev/sda2 partition - - 20G /dev/sda -\n"
1343 " /dev/sda device - - 20G - -\n"
1348 #: ../cat/virt-filesystems.pod:89
1349 msgid "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1353 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1358 #: ../cat/virt-filesystems.pod:112
1360 "Display everything. This is currently the same as specifying these options: "
1361 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, "
1362 "I<--logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may "
1363 "be added to this list in future)."
1367 #: ../cat/virt-filesystems.pod:117
1368 msgid "See also I<--long>."
1372 #: ../cat/virt-filesystems.pod:119
1373 msgid "B<--blkdevs>"
1377 #: ../cat/virt-filesystems.pod:121
1378 msgid "B<--block-devices>"
1382 #: ../cat/virt-filesystems.pod:123
1383 msgid "Display block devices."
1387 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1392 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1394 "Write out the results in CSV format (comma-separated values). This format "
1395 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1396 "ABOUT CSV FORMAT> below."
1400 #: ../cat/virt-filesystems.pod:150
1402 "When prompting for keys and passphrases, virt-filesystems normally turns "
1403 "echoing off so you cannot see what you are typing. If you are not worried "
1404 "about Tempest attacks and there is no one else in the room you can specify "
1405 "this flag to see what you are typing."
1409 #: ../cat/virt-filesystems.pod:155
1414 #: ../cat/virt-filesystems.pod:157
1416 "This causes filesystems that are not ordinary, mountable filesystems to be "
1417 "displayed. This category includes swapspace, and filesystems that are empty "
1418 "or contain unknown data."
1422 #: ../cat/virt-filesystems.pod:161
1423 msgid "This option implies I<--filesystems>."
1427 #: ../cat/virt-filesystems.pod:163
1428 msgid "B<--filesystems>"
1432 #: ../cat/virt-filesystems.pod:165
1434 "Display mountable filesystems. If no display option was selected then this "
1435 "option is implied."
1439 #: ../cat/virt-filesystems.pod:168
1440 msgid "With I<--extra>, non-mountable filesystems are shown too."
1444 #: ../cat/virt-filesystems.pod:181
1447 " virt-filesystems --format=raw -a disk.img\n"
1452 #: ../cat/virt-filesystems.pod:185
1455 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1460 #: ../cat/virt-filesystems.pod:194 ../cat/virt-ls.pod:352 ../df/virt-df.pod:125 ../fish/guestfish.pod:156 ../tools/virt-list-partitions.pl:109
1465 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354 ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1466 msgid "B<--human-readable>"
1470 #: ../cat/virt-filesystems.pod:198
1471 msgid "In I<--long> mode, display sizes in human-readable format."
1475 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366 ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1480 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368 ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1485 #: ../cat/virt-filesystems.pod:209
1486 msgid "Display extra columns of data (\"long format\")."
1490 #: ../cat/virt-filesystems.pod:211
1491 msgid "A title row is added unless you also specify I<--no-title>."
1495 #: ../cat/virt-filesystems.pod:213
1497 "The extra columns displayed depend on what output you select, and the "
1498 "ordering of columns may change in future versions. Use the title row, "
1499 "I<--csv> output and/or L<csvtool(1)> to match columns to data in external "
1504 #: ../cat/virt-filesystems.pod:218
1506 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1507 "default is to show raw numbers of I<bytes>."
1511 #: ../cat/virt-filesystems.pod:221
1512 msgid "Use I<--uuid> to display UUIDs too."
1516 #: ../cat/virt-filesystems.pod:223
1521 #: ../cat/virt-filesystems.pod:225
1522 msgid "B<--logvols>"
1526 #: ../cat/virt-filesystems.pod:227
1527 msgid "B<--logical-volumes>"
1531 #: ../cat/virt-filesystems.pod:229
1533 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1534 "of whether the LVs contain filesystems."
1538 #: ../cat/virt-filesystems.pod:232
1539 msgid "B<--no-title>"
1543 #: ../cat/virt-filesystems.pod:234
1544 msgid "In I<--long> mode, don't add a title row."
1548 #: ../cat/virt-filesystems.pod:236
1550 "Note that the order of the columns is not fixed, and may change in future "
1551 "versions of virt-filesystems, so using this option may give you unexpected "
1556 #: ../cat/virt-filesystems.pod:240
1561 #: ../cat/virt-filesystems.pod:242
1562 msgid "B<--partitions>"
1566 #: ../cat/virt-filesystems.pod:244
1568 "Display partitions. In this mode, these are displayed irrespective of "
1569 "whether the partitions contain filesystems."
1573 #: ../cat/virt-filesystems.pod:247
1578 #: ../cat/virt-filesystems.pod:249
1579 msgid "B<--physvols>"
1583 #: ../cat/virt-filesystems.pod:251
1584 msgid "B<--physical-volumes>"
1588 #: ../cat/virt-filesystems.pod:253
1589 msgid "Display LVM physical volumes."
1593 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1598 #: ../cat/virt-filesystems.pod:257
1603 #: ../cat/virt-filesystems.pod:259
1604 msgid "In I<--long> mode, display UUIDs as well."
1608 #: ../cat/virt-filesystems.pod:273
1613 #: ../cat/virt-filesystems.pod:275
1614 msgid "B<--volgroups>"
1618 #: ../cat/virt-filesystems.pod:277
1619 msgid "B<--volume-groups>"
1623 #: ../cat/virt-filesystems.pod:279
1624 msgid "Display LVM volume groups."
1628 #: ../cat/virt-filesystems.pod:287
1633 #: ../cat/virt-filesystems.pod:289
1635 "Note that columns in the output are subject to reordering and change in "
1636 "future versions of this tool."
1640 #: ../cat/virt-filesystems.pod:294
1645 #: ../cat/virt-filesystems.pod:296
1646 msgid "The filesystem, partition, block device or LVM name."
1650 #: ../cat/virt-filesystems.pod:298
1652 "For device and partition names these are displayed as canonical libguestfs "
1653 "names, so that for example C</dev/sda2> is the second partition on the first "
1658 #: ../cat/virt-filesystems.pod:302
1660 "If the I<--long> option is B<not> specified, then only the name column is "
1661 "shown in the output."
1665 #: ../cat/virt-filesystems.pod:305
1670 #: ../cat/virt-filesystems.pod:307
1671 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1675 #: ../cat/virt-filesystems.pod:309
1680 #: ../cat/virt-filesystems.pod:311
1682 "If there is a filesystem, then this column displays the filesystem type if "
1683 "one could be detected, eg. C<ext4>."
1687 #: ../cat/virt-filesystems.pod:314
1692 #: ../cat/virt-filesystems.pod:316
1694 "If the object has a label (used for identifying and mounting filesystems) "
1695 "then this column contains the label."
1699 #: ../cat/virt-filesystems.pod:319
1704 #: ../cat/virt-filesystems.pod:321
1706 "The partition type byte, displayed as a two digit hexadecimal number. A "
1707 "comprehensive list of partition types can be found here: "
1708 "L<http://www.win.tue.nl/~aeb/partitions/partition_types-1.html>"
1712 #: ../cat/virt-filesystems.pod:325
1713 msgid "This is only applicable for DOS (MBR) partitions."
1717 #: ../cat/virt-filesystems.pod:327
1722 #: ../cat/virt-filesystems.pod:329
1724 "The size of the object in bytes. If the I<--human> option is used then the "
1725 "size is displayed in a human-readable form."
1729 #: ../cat/virt-filesystems.pod:332
1734 #: ../cat/virt-filesystems.pod:334
1736 "The parent column records the parent relationship between objects. For "
1737 "example, if the object is a partition, then this column contains the name of "
1738 "the containing device. If the object is a logical volume, then this column "
1739 "is the name of the volume group."
1743 #: ../cat/virt-filesystems.pod:339
1748 #: ../cat/virt-filesystems.pod:341
1750 "If the object has a UUID (used for identifying and mounting filesystems and "
1751 "block devices) then this column contains the UUID as a string."
1755 #: ../cat/virt-filesystems.pod:345
1756 msgid "The UUID is only displayed if the I<--uuid> option is given."
1760 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:459 ../df/virt-df.pod:191
1761 msgid "NOTE ABOUT CSV FORMAT"
1765 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:461 ../df/virt-df.pod:193
1767 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1768 "should be easy to parse, but it is definitely not easy to parse."
1772 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:464 ../df/virt-df.pod:196
1774 "Myth: Just split fields at commas. Reality: This does I<not> work "
1775 "reliably. This example has two columns:"
1779 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:467 ../df/virt-df.pod:199
1782 " \"foo,bar\",baz\n"
1787 #: ../cat/virt-filesystems.pod:359 ../cat/virt-ls.pod:469 ../df/virt-df.pod:201
1789 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1790 "reliably. This example has one row:"
1794 #: ../cat/virt-filesystems.pod:362 ../cat/virt-ls.pod:472 ../df/virt-df.pod:204
1803 #: ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:475 ../df/virt-df.pod:207
1805 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1806 "packaged in major Linux distributions)."
1810 #: ../cat/virt-filesystems.pod:368 ../cat/virt-ls.pod:478 ../df/virt-df.pod:210
1812 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1813 "or Python's built-in csv library)."
1817 #: ../cat/virt-filesystems.pod:371 ../cat/virt-ls.pod:481 ../df/virt-df.pod:213
1818 msgid "Most spreadsheets and databases can import CSV directly."
1822 #: ../cat/virt-filesystems.pod:387
1824 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
1825 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, "
1826 "L<http://libguestfs.org/>."
1830 #: ../cat/virt-filesystems.pod:402 ../tools/virt-win-reg.pl:789
1831 msgid "Copyright (C) 2010 Red Hat Inc."
1835 #: ../cat/virt-ls.pod:5
1836 msgid "virt-ls - List files in a virtual machine"
1840 #: ../cat/virt-ls.pod:9
1843 " virt-ls [--options] -d domname directory [directory ...]\n"
1848 #: ../cat/virt-ls.pod:11
1851 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory "
1857 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
1862 #: ../cat/virt-ls.pod:15
1865 " virt-ls [--options] domname directory\n"
1870 #: ../cat/virt-ls.pod:17
1873 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1878 #: ../cat/virt-ls.pod:21
1880 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1881 "more from a virtual machine or disk image."
1885 #: ../cat/virt-ls.pod:24
1887 "Multiple directory names can be given, in which case the output from each is "
1892 #: ../cat/virt-ls.pod:27
1894 "To list directories from a libvirt guest use the I<-d> option to specify the "
1895 "name of the guest. For a disk image, use the I<-a> option."
1899 #: ../cat/virt-ls.pod:31
1901 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1902 "may need to use L<guestfish(1)>, or write a program directly to the "
1903 "L<guestfs(3)> API."
1907 #: ../cat/virt-ls.pod:37
1908 msgid "Get a list of all files and directories in a virtual machine:"
1912 #: ../cat/virt-ls.pod:39
1915 " virt-ls -R -d guest /\n"
1920 #: ../cat/virt-ls.pod:41
1921 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1925 #: ../cat/virt-ls.pod:43
1928 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1933 #: ../cat/virt-ls.pod:45
1934 msgid "List all public-writable directories in a Linux virtual machine:"
1938 #: ../cat/virt-ls.pod:47
1941 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1946 #: ../cat/virt-ls.pod:49
1947 msgid "List all Unix domain sockets in a Linux virtual machine:"
1951 #: ../cat/virt-ls.pod:51
1954 " virt-ls -lR -d guest / | grep '^s'\n"
1959 #: ../cat/virt-ls.pod:53
1960 msgid "List all regular files with filenames ending in '.png':"
1964 #: ../cat/virt-ls.pod:55
1967 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1972 #: ../cat/virt-ls.pod:57
1973 msgid "To display files larger than 10MB in home directories:"
1977 #: ../cat/virt-ls.pod:59
1980 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1985 #: ../cat/virt-ls.pod:61
1986 msgid "Find everything modified in the last 7 days:"
1990 #: ../cat/virt-ls.pod:63
1993 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1998 #: ../cat/virt-ls.pod:65
1999 msgid "Find regular files modified in the last 24 hours:"
2003 #: ../cat/virt-ls.pod:67
2006 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
2011 #: ../cat/virt-ls.pod:69
2012 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
2016 #: ../cat/virt-ls.pod:71
2018 "Find the differences between files in a guest and an earlier snapshot of the "
2023 #: ../cat/virt-ls.pod:74
2026 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
2027 " virt-ls -lR -a current.img / --uids --time-t > new\n"
2028 " diff -u old new | less\n"
2033 #: ../cat/virt-ls.pod:78
2035 "The commands above won't find files where the content has changed but the "
2036 "metadata (eg. file size and modification date) is the same. To do that, you "
2037 "need to add the I<--checksum> parameter to both C<virt-ls> commands. "
2038 "I<--checksum> can be quite slow since it has to read and compute a checksum "
2039 "of every regular file in the virtual machine."
2043 #: ../cat/virt-ls.pod:84
2044 msgid "OUTPUT MODES"
2048 #: ../cat/virt-ls.pod:86
2050 "C<virt-ls> has four output modes, controlled by different combinations of "
2051 "the I<-l> and I<-R> options."
2055 #: ../cat/virt-ls.pod:89
2056 msgid "SIMPLE LISTING"
2060 #: ../cat/virt-ls.pod:91
2061 msgid "A simple listing is like the ordinary L<ls(1)> command:"
2065 #: ../cat/virt-ls.pod:93
2068 " $ virt-ls -d guest /\n"
2076 #: ../cat/virt-ls.pod:98
2077 msgid "LONG LISTING"
2081 #: ../cat/virt-ls.pod:100
2083 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
2084 "(more specifically, like the C<guestfs_ll> function)."
2088 #: ../cat/virt-ls.pod:103
2091 " $ virt-ls -l -d guest /\n"
2093 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2094 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2100 #: ../cat/virt-ls.pod:109
2102 "Note that while this is useful for displaying a directory, do not try "
2103 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2108 #: ../cat/virt-ls.pod:113
2109 msgid "RECURSIVE LISTING"
2113 #: ../cat/virt-ls.pod:115
2115 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2116 "and directories recursively:"
2120 #: ../cat/virt-ls.pod:118
2123 " $ virt-ls -R -d guest /tmp\n"
2131 #: ../cat/virt-ls.pod:123
2133 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2134 "converts C<\\0> characters to C<\\n>."
2138 #: ../cat/virt-ls.pod:126
2139 msgid "RECURSIVE LONG LISTING"
2143 #: ../cat/virt-ls.pod:128
2145 "Using I<-lR> options together changes the output to display directories "
2146 "recursively, with file stats, and optionally other features such as "
2147 "checksums and extended attributes."
2151 #: ../cat/virt-ls.pod:132
2153 "Most of the interesting features of C<virt-ls> are only available when using "
2158 #: ../cat/virt-ls.pod:135
2160 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2161 "you cannot use the output in another program (because filenames can contain "
2162 "spaces and other unsafe characters). If the guest was untrusted and someone "
2163 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2164 "on you by creating filenames with embedded newline characters. To B<safely> "
2165 "parse the output in another program, use the I<--csv> (Comma-Separated "
2170 #: ../cat/virt-ls.pod:143
2172 "Note that this output format is completely unrelated to the C<ls -lR> "
2177 #: ../cat/virt-ls.pod:146
2180 " $ virt-ls -lR -d guest /bin\n"
2181 " d 0555 4096 /bin\n"
2182 " - 0755 123 /bin/alsaunmute\n"
2183 " - 0755 28328 /bin/arch\n"
2184 " l 0777 4 /bin/awk -> gawk\n"
2185 " - 0755 27216 /bin/basename\n"
2186 " - 0755 943360 /bin/bash\n"
2192 #: ../cat/virt-ls.pod:155
2193 msgid "These basic fields are always shown:"
2197 #: ../cat/virt-ls.pod:159
2202 #: ../cat/virt-ls.pod:161
2204 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2205 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2206 "link), C<s> (socket) or C<u> (unknown)."
2210 #: ../cat/virt-ls.pod:171
2215 #: ../cat/virt-ls.pod:173
2216 msgid "The Unix permissions, displayed as a 4 digit octal number."
2220 #: ../cat/virt-ls.pod:175
2225 #: ../cat/virt-ls.pod:177
2227 "The size of the file. This is shown in bytes unless I<-h> or "
2228 "I<--human-readable> option is given, in which case this is shown as a "
2229 "human-readable number."
2233 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4380
2238 #: ../cat/virt-ls.pod:183
2239 msgid "The full path of the file or directory."
2243 #: ../cat/virt-ls.pod:185
2248 #: ../cat/virt-ls.pod:187
2249 msgid "For symbolic links only, the link target."
2253 #: ../cat/virt-ls.pod:191
2255 "In I<-lR> mode, additional command line options enable the display of more "
2260 #: ../cat/virt-ls.pod:194
2262 "With the I<--uids> flag, these additional fields are displayed before the "
2267 #: ../cat/virt-ls.pod:199
2272 #: ../cat/virt-ls.pod:201
2277 #: ../cat/virt-ls.pod:203
2279 "The UID and GID of the owner of the file (displayed numerically). Note "
2280 "these only make sense in the context of a Unix-like guest."
2284 #: ../cat/virt-ls.pod:208
2285 msgid "With the I<--times> flag, these additional fields are displayed:"
2289 #: ../cat/virt-ls.pod:212
2294 #: ../cat/virt-ls.pod:214
2295 msgid "The time of last access."
2299 #: ../cat/virt-ls.pod:216
2304 #: ../cat/virt-ls.pod:218
2305 msgid "The time of last modification."
2309 #: ../cat/virt-ls.pod:220
2314 #: ../cat/virt-ls.pod:222
2315 msgid "The time of last status change."
2319 #: ../cat/virt-ls.pod:226
2321 "The time fields are displayed as string dates and times, unless one of the "
2322 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2326 #: ../cat/virt-ls.pod:229
2327 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2331 #: ../cat/virt-ls.pod:233
2336 #: ../cat/virt-ls.pod:235
2338 "The device containing the file (displayed as major:minor). This may not "
2339 "match devices as known to the guest."
2343 #: ../cat/virt-ls.pod:238
2348 #: ../cat/virt-ls.pod:240
2349 msgid "The inode number."
2353 #: ../cat/virt-ls.pod:242
2358 #: ../cat/virt-ls.pod:244
2359 msgid "The number of hard links."
2363 #: ../cat/virt-ls.pod:246
2368 #: ../cat/virt-ls.pod:248
2369 msgid "For block and char special files, the device (displayed as major:minor)."
2373 #: ../cat/virt-ls.pod:251
2378 #: ../cat/virt-ls.pod:253
2379 msgid "The number of 512 byte blocks allocated to the file."
2383 #: ../cat/virt-ls.pod:257
2385 "With the I<--checksum> flag, the checksum of the file contents is shown "
2386 "(only for regular files). Computing file checksums can take a considerable "
2391 #: ../cat/virt-ls.pod:280
2392 msgid "B<--checksum>"
2396 #: ../cat/virt-ls.pod:282
2397 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2401 #: ../cat/virt-ls.pod:284
2403 "Display checksum over file contents for regular files. With no argument, "
2404 "this defaults to using I<md5>. Using an argument, you can select the "
2405 "checksum type to use."
2409 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358 ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408 ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2411 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2416 #: ../cat/virt-ls.pod:316
2418 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2419 "so you cannot see what you are typing. If you are not worried about Tempest "
2420 "attacks and there is no one else in the room you can specify this flag to "
2421 "see what you are typing."
2425 #: ../cat/virt-ls.pod:321
2426 msgid "B<--extra-stats>"
2430 #: ../cat/virt-ls.pod:323
2431 msgid "Display extra stats."
2435 #: ../cat/virt-ls.pod:339
2438 " virt-ls --format=raw -a disk.img /dir\n"
2443 #: ../cat/virt-ls.pod:343
2446 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2451 #: ../cat/virt-ls.pod:356
2452 msgid "Display file sizes in human-readable format."
2456 #: ../cat/virt-ls.pod:370
2461 #: ../cat/virt-ls.pod:372
2462 msgid "B<--recursive>"
2466 #: ../cat/virt-ls.pod:374
2468 "Select the mode. With neither of these options, C<virt-ls> produces a "
2469 "simple, flat list of the files in the named directory. See L</SIMPLE "
2474 #: ../cat/virt-ls.pod:378
2476 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See "
2481 #: ../cat/virt-ls.pod:381
2483 "C<virt-ls -R> produces a recursive list of files starting at the named "
2484 "directory. See L</RECURSIVE LISTING>."
2488 #: ../cat/virt-ls.pod:384
2490 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2491 "parsed. See L</RECURSIVE LONG LISTING>."
2495 #: ../cat/virt-ls.pod:387
2500 #: ../cat/virt-ls.pod:389
2501 msgid "Display time fields."
2505 #: ../cat/virt-ls.pod:394
2506 msgid "B<--time-days>"
2510 #: ../cat/virt-ls.pod:396
2511 msgid "Display time fields as days before now (negative if in the future)."
2515 #: ../cat/virt-ls.pod:398
2517 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2518 "of the file is between 0 and 86399 seconds."
2522 #: ../cat/virt-ls.pod:404
2523 msgid "B<--time-relative>"
2527 #: ../cat/virt-ls.pod:406
2528 msgid "Display time fields as seconds before now (negative if in the future)."
2532 #: ../cat/virt-ls.pod:411
2537 #: ../cat/virt-ls.pod:413
2538 msgid "Display time fields as seconds since the Unix epoch."
2542 #: ../cat/virt-ls.pod:418
2547 #: ../cat/virt-ls.pod:420
2548 msgid "Display UID and GID fields."
2552 #: ../cat/virt-ls.pod:445
2553 msgid "Previous versions of virt-ls allowed you to write either:"
2557 #: ../cat/virt-ls.pod:447
2560 " virt-ls disk.img [disk.img ...] /dir\n"
2565 #: ../cat/virt-ls.pod:451
2568 " virt-ls guestname /dir\n"
2573 #: ../cat/virt-ls.pod:497
2575 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, "
2576 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
2577 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
2581 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374 ../rescue/virt-rescue.pod:302
2582 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2586 #: ../clone/virt-sysprep.pod:5
2587 msgid "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
2591 #: ../clone/virt-sysprep.pod:9
2594 " virt-sysprep [--options] -d domname\n"
2599 #: ../clone/virt-sysprep.pod:11
2602 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
2607 #: ../clone/virt-sysprep.pod:15
2609 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
2610 "can be made from it. Steps in this process include removing SSH host keys, "
2611 "removing persistent network MAC configuration, and removing user accounts. "
2612 "Each step can be enabled or disabled as required."
2616 #: ../clone/virt-sysprep.pod:21
2618 "Virt-sysprep is a simple shell script, allowing easy inspection or "
2619 "customization by the system administrator."
2623 #: ../clone/virt-sysprep.pod:24
2625 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
2626 "be shut down. If you want to preserve the existing contents of the guest, "
2627 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> "
2632 #: ../clone/virt-sysprep.pod:29
2634 "You do I<not> need to run virt-sysprep as root. In fact we'd generally "
2635 "recommend that you don't. The time you might want to run it as root is when "
2636 "you need root in order to access the disk image, but even in this case it "
2637 "would be better to change the permissions on the disk image to be writable "
2638 "as the non-root user running virt-sysprep."
2642 #: ../clone/virt-sysprep.pod:35
2644 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
2645 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
2646 "machines in preparation for cloning them. Having said that, virt-sysprep "
2647 "does I<not> currently work on Microsoft Windows guests. We plan to support "
2648 "Windows sysprepping in a future version, and we already have code to do it."
2652 #: ../clone/virt-sysprep.pod:76
2653 msgid "B<--enable=...>"
2657 #: ../clone/virt-sysprep.pod:78
2659 "Choose which sysprep operations to perform. Give a comma-separated list of "
2660 "operations, for example:"
2664 #: ../clone/virt-sysprep.pod:81
2667 " --enable=ssh-hostkeys,udev-persistent-net\n"
2672 #: ../clone/virt-sysprep.pod:83
2673 msgid "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
2677 #: ../clone/virt-sysprep.pod:85
2679 "If the I<--enable> option is not given, then we default to trying all "
2680 "possible sysprep operations. But some sysprep operations are skipped for "
2685 #: ../clone/virt-sysprep.pod:89
2687 "Use I<--list-operations> to list operations supported by a particular "
2688 "version of virt-sysprep."
2692 #: ../clone/virt-sysprep.pod:92
2693 msgid "See L</OPERATIONS> below for a list and an explanation of each operation."
2697 #: ../clone/virt-sysprep.pod:106
2700 " virt-sysprep --format=raw -a disk.img\n"
2705 #: ../clone/virt-sysprep.pod:110
2708 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
2713 #: ../clone/virt-sysprep.pod:119
2714 msgid "B<--hostname> newhostname"
2718 #: ../clone/virt-sysprep.pod:121
2720 "Change the hostname. See the L</hostname> operation below. If not given, "
2721 "defaults to C<localhost.localdomain>."
2725 #: ../clone/virt-sysprep.pod:124
2726 msgid "B<--list-operations>"
2730 #: ../clone/virt-sysprep.pod:126
2731 msgid "List the operations supported by the virt-sysprep program."
2735 #: ../clone/virt-sysprep.pod:128
2736 msgid "B<--selinux-relabel>"
2740 #: ../clone/virt-sysprep.pod:130
2741 msgid "B<--no-selinux-relabel>"
2745 #: ../clone/virt-sysprep.pod:132
2747 "I<--selinux-relabel> forces SELinux relabelling next time the guest boots. "
2748 "I<--no-selinux-relabel> disables relabelling."
2752 #: ../clone/virt-sysprep.pod:135
2754 "The default is to try to detect if SELinux relabelling is required. See "
2755 "L</SELINUX RELABELLING> below for more details."
2759 #: ../clone/virt-sysprep.pod:156
2764 #: ../clone/virt-sysprep.pod:158
2766 "If the I<--enable> option is I<not> given, then I<all sysprep operations are "
2767 "enabled>, although some are skipped depending on the type of guest."
2771 #: ../clone/virt-sysprep.pod:162
2773 "Operations can be individually enabled using the I<--enable> option. Use a "
2774 "comma-separated list, for example:"
2778 #: ../clone/virt-sysprep.pod:165
2781 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
2786 #: ../clone/virt-sysprep.pod:167
2788 "To list the operations supported by the current version of virt-sysprep, use "
2789 "I<--list-operations>."
2793 #: ../clone/virt-sysprep.pod:170
2795 "Future versions of virt-sysprep may add more operations. If you are using "
2796 "virt-sysprep and want predictable behaviour, specify only the operations "
2797 "that you want to have enabled."
2801 #: ../clone/virt-sysprep.pod:174
2806 #: ../clone/virt-sysprep.pod:176
2807 msgid "Remove user at-jobs and cron-jobs."
2811 #: ../clone/virt-sysprep.pod:178
2812 msgid "dhcp-client-state"
2816 #: ../clone/virt-sysprep.pod:180
2817 msgid "Remove DHCP client leases."
2821 #: ../clone/virt-sysprep.pod:182
2822 msgid "dhcp-server-state"
2826 #: ../clone/virt-sysprep.pod:184
2827 msgid "Remove DHCP server leases."
2831 #: ../clone/virt-sysprep.pod:186
2836 #: ../clone/virt-sysprep.pod:188
2838 "Changes the hostname of the guest to the value given in the I<--hostname> "
2843 #: ../clone/virt-sysprep.pod:191
2845 "If the I<--hostname> parameter is not given, then the hostname is changed to "
2846 "C<localhost.localdomain>."
2850 #: ../clone/virt-sysprep.pod:194
2855 #: ../clone/virt-sysprep.pod:196
2856 msgid "Remove many log files."
2860 #: ../clone/virt-sysprep.pod:198
2865 #: ../clone/virt-sysprep.pod:200
2866 msgid "Remove email from the local mail spool directory."
2870 #: ../clone/virt-sysprep.pod:202
2875 #: ../clone/virt-sysprep.pod:204
2877 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
2878 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
2882 #: ../clone/virt-sysprep.pod:207
2887 #: ../clone/virt-sysprep.pod:209
2889 "Write some random bytes from the host into the random seed file of the "
2894 #: ../clone/virt-sysprep.pod:212
2895 msgid "See L</RANDOM SEED> below."
2899 #: ../clone/virt-sysprep.pod:214
2900 msgid "rhn-systemid"
2904 #: ../clone/virt-sysprep.pod:216
2905 msgid "Remove the RHN system ID."
2909 #: ../clone/virt-sysprep.pod:218
2914 #: ../clone/virt-sysprep.pod:220
2915 msgid "Remove the Smolt hardware UUID."
2919 #: ../clone/virt-sysprep.pod:222
2920 msgid "ssh-hostkeys"
2924 #: ../clone/virt-sysprep.pod:224
2925 msgid "Remove the SSH host keys in the guest."
2929 #: ../clone/virt-sysprep.pod:226
2931 "The SSH host keys are regenerated (differently) next time the guest is "
2936 #: ../clone/virt-sysprep.pod:229
2938 "If, after cloning, the guest gets the same IP address, ssh will give you a "
2939 "stark warning about the host key changing:"
2943 #: ../clone/virt-sysprep.pod:232
2946 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2947 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
2948 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2949 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
2954 #: ../clone/virt-sysprep.pod:237
2955 msgid "udev-persistent-net"
2959 #: ../clone/virt-sysprep.pod:239
2961 "Remove udev persistent net rules which map the guest's existing MAC address "
2962 "to a fixed ethernet device (eg. eth0)."
2966 #: ../clone/virt-sysprep.pod:242
2968 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
2969 "address occupies the old name (eg. eth0), this means the fresh MAC address "
2970 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
2971 "Erasing the udev persistent net rules avoids this."
2975 #: ../clone/virt-sysprep.pod:247
2980 #: ../clone/virt-sysprep.pod:249
2981 msgid "Remove the utmp file."
2985 #: ../clone/virt-sysprep.pod:251
2987 "This records who is currently logged in on a machine. In modern Linux "
2988 "distros it is stored in a ramdisk and hence not part of the virtual "
2989 "machine's disk, but it was stored on disk in older distros."
2993 #: ../clone/virt-sysprep.pod:255
2998 #: ../clone/virt-sysprep.pod:257
2999 msgid "Remove the yum UUID."
3003 #: ../clone/virt-sysprep.pod:259
3005 "Yum creates a fresh UUID the next time it runs when it notices that the "
3006 "original UUID has been erased."
3010 #: ../clone/virt-sysprep.pod:262
3011 msgid "COPYING AND CLONING"
3015 #: ../clone/virt-sysprep.pod:264
3017 "Virt-sysprep can be used as part of a process of cloning guests, or to "
3018 "prepare a template from which guests can be cloned. There are many "
3019 "different ways to achieve this using the virt tools, and this section is "
3020 "just an introduction."
3024 #: ../clone/virt-sysprep.pod:269
3025 msgid "A virtual machine (when switched off) consists of two parts:"
3029 #: ../clone/virt-sysprep.pod:273
3030 msgid "I<configuration>"
3034 #: ../clone/virt-sysprep.pod:275
3036 "The configuration or description of the guest. eg. The libvirt XML (see "
3037 "C<virsh dumpxml>), the running configuration of the guest, or another "
3038 "external format like OVF."
3042 #: ../clone/virt-sysprep.pod:279
3043 msgid "Some configuration items that might need to be changed:"
3047 #: ../clone/virt-sysprep.pod:285
3052 #: ../clone/virt-sysprep.pod:289 ../clone/virt-sysprep.pod:316
3057 #: ../clone/virt-sysprep.pod:293
3058 msgid "path to block device(s)"
3062 #: ../clone/virt-sysprep.pod:297
3063 msgid "network card MAC address"
3067 #: ../clone/virt-sysprep.pod:301
3068 msgid "I<block device(s)>"
3072 #: ../clone/virt-sysprep.pod:303
3074 "One or more hard disk images, themselves containing files, directories, "
3075 "applications, kernels, configuration, etc."
3079 #: ../clone/virt-sysprep.pod:306
3080 msgid "Some things inside the block devices that might need to be changed:"
3084 #: ../clone/virt-sysprep.pod:312
3085 msgid "hostname and other net configuration"
3089 #: ../clone/virt-sysprep.pod:320
3090 msgid "SSH host keys"
3094 #: ../clone/virt-sysprep.pod:324
3095 msgid "Windows unique security ID (SID)"
3099 #: ../clone/virt-sysprep.pod:328
3100 msgid "Puppet registration"
3104 #: ../clone/virt-sysprep.pod:334
3105 msgid "COPYING THE BLOCK DEVICE"
3109 #: ../clone/virt-sysprep.pod:336
3111 "Starting with an original guest, you probably wish to copy the guest block "
3112 "device and its configuration to make a template. Then once you are happy "
3113 "with the template, you will want to make many clones from it."
3117 #: ../clone/virt-sysprep.pod:341
3123 " original guest --------> template ---------->\n"
3124 " \\------> cloned\n"
3125 " \\-----> guests\n"
3131 #: ../clone/virt-sysprep.pod:349
3133 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3138 #: ../clone/virt-sysprep.pod:352
3142 " original guest --------> template ---------->\n"
3143 " \\------> cloned\n"
3144 " \\-----> guests\n"
3150 #: ../clone/virt-sysprep.pod:358
3151 msgid "There are some smarter (and faster) ways too:"
3155 #: ../clone/virt-sysprep.pod:364
3159 " template ---------->\n"
3160 " \\------> cloned\n"
3161 " \\-----> guests\n"
3167 #: ../clone/virt-sysprep.pod:370
3169 "Use the block device as a backing file and create a snapshot on top for each "
3170 "guest. The advantage is that you don't need to copy the block device (very "
3171 "fast) and only changes are stored (less storage required)."
3175 #: ../clone/virt-sysprep.pod:375
3177 "Note that writing to the backing file once you have created guests on top of "
3178 "it is not possible: you will corrupt the guests."
3182 #: ../clone/virt-sysprep.pod:378
3184 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 "
3185 "-o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3186 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3187 "also create cheap snapshots from files or LUNs."
3191 #: ../clone/virt-sysprep.pod:386
3192 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3196 #: ../clone/virt-sysprep.pod:390
3197 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3201 #: ../clone/virt-sysprep.pod:394
3206 #: ../clone/virt-sysprep.pod:396
3208 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3209 "and/or modify the external libvirt configuration of a guest. It will reset "
3210 "the name, UUID and MAC address of the guest in the libvirt XML."
3214 #: ../clone/virt-sysprep.pod:401
3216 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3217 "image. This was the original motivation to write virt-sysprep."
3221 #: ../clone/virt-sysprep.pod:404
3226 #: ../clone/virt-sysprep.pod:406
3230 " original guest --------> template\n"
3235 #: ../clone/virt-sysprep.pod:409
3237 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3238 "it easier to compress and/or faster to copy."
3242 #: ../clone/virt-sysprep.pod:412
3244 "Notice that since virt-sparsify also copies the image, you can use it to "
3245 "make the initial copy (instead of C<dd>)."
3249 #: ../clone/virt-sysprep.pod:415
3254 #: ../clone/virt-sysprep.pod:417
3258 " template ---------->\n"
3259 " \\------> cloned\n"
3260 " \\-----> guests\n"
3266 #: ../clone/virt-sysprep.pod:423
3268 "If you want to give people cloned guests, but let them pick the size of the "
3269 "guest themselves (eg. depending on how much they are prepared to pay for "
3270 "disk space), then instead of copying the template, you can run "
3271 "L<virt-resize(1)>. Virt-resize performs a copy and resize, and thus is "
3272 "ideal for cloning guests from a template."
3276 #: ../clone/virt-sysprep.pod:429 ../src/guestfs.pod:1164
3281 #: ../clone/virt-sysprep.pod:431
3283 "Although virt-sysprep removes some sensitive information from the guest, it "
3284 "does not pretend to remove all of it. You should examine the L</OPERATIONS> "
3285 "above, and the implementation of the operations in the shell script. You "
3286 "should also examine the guest afterwards."
3290 #: ../clone/virt-sysprep.pod:436
3292 "Sensitive files are simply removed. The data they contained may still exist "
3293 "on the disk, easily recovered with a hex editor or undelete tool. Use "
3294 "L<virt-sparsify(1)> as one way to remove this content. See also the "
3295 "L<scrub(1)> command to get rid of deleted content in directory entries and "
3300 #: ../clone/virt-sysprep.pod:442
3305 #: ../clone/virt-sysprep.pod:444
3306 msgid "I<(This section applies to Linux guests only)>"
3310 #: ../clone/virt-sysprep.pod:446
3312 "The virt-sysprep C<random-seed> operation writes a few bytes of randomness "
3313 "from the host into the guest's random seed file."
3317 #: ../clone/virt-sysprep.pod:449
3319 "If this is just done once and the guest is cloned from the same template, "
3320 "then each guest will start with the same entropy, and things like SSH host "
3321 "keys and TCP sequence numbers may be predictable."
3325 #: ../clone/virt-sysprep.pod:453
3327 "Therefore you should arrange to add more randomness I<after> cloning from a "
3328 "template too, which can be done by just enabling the C<random-seed> "
3333 #: ../clone/virt-sysprep.pod:457
3336 " cp template.img newguest.img\n"
3337 " virt-sysprep --enable=random-seed -a newguest.img\n"
3342 #: ../clone/virt-sysprep.pod:460
3343 msgid "SELINUX RELABELLING"
3347 #: ../clone/virt-sysprep.pod:462
3348 msgid "I<(This section applies to Linux guests using SELinux only)>"
3352 #: ../clone/virt-sysprep.pod:464
3354 "If any new files are created by virt-sysprep, then virt-sysprep touches "
3355 "C</.autorelabel> so that these will be correctly labelled by SELinux the "
3356 "next time the guest is booted. This process interrupts boot and can take "
3361 #: ../clone/virt-sysprep.pod:469
3363 "You can force relabelling for all guests by supplying the "
3364 "I<--selinux-relabel> option."
3368 #: ../clone/virt-sysprep.pod:472
3370 "You can disable relabelling entirely by supplying the "
3371 "I<--no-selinux-relabel> option."
3375 #: ../clone/virt-sysprep.pod:484
3376 msgid "This program returns 0 on success, or 1 if there was an error."
3380 #: ../clone/virt-sysprep.pod:488
3382 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, "
3383 "L<virt-resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<lvcreate(8)>, "
3384 "L<qemu-img(1)>, L<scrub(1)>, L<http://libguestfs.org/>, "
3385 "L<http://libvirt.org/>."
3389 #: ../df/virt-df.pod:5
3390 msgid "virt-df - Display free space on virtual filesystems"
3394 #: ../df/virt-df.pod:9
3397 " virt-df [--options]\n"
3402 #: ../df/virt-df.pod:11
3405 " virt-df [--options] -d domname\n"
3410 #: ../df/virt-df.pod:13
3413 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3418 #: ../df/virt-df.pod:17
3421 " virt-df [--options] domname\n"
3426 #: ../df/virt-df.pod:19
3429 " virt-df [--options] disk.img [disk.img ...]\n"
3434 #: ../df/virt-df.pod:23
3436 "C<virt-df> is a command line tool to display free space on virtual machine "
3437 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3438 "allocated to a virtual machine, but can look inside disk images to see how "
3439 "much space is really being used."
3443 #: ../df/virt-df.pod:28
3445 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3446 "to get a list of all active and inactive guests, and performs a C<df>-type "
3447 "operation on each one in turn, printing out the results."
3451 #: ../df/virt-df.pod:32
3453 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a "
3454 "C<df>-type operation on either the single named libvirt domain, or on the "
3455 "disk image(s) listed on the command line (which must all belong to a single "
3456 "VM). In this mode (with arguments), C<virt-df> will I<only work for a "
3457 "single guest>. If you want to run on multiple guests, then you have to "
3458 "invoke C<virt-df> multiple times."
3462 #: ../df/virt-df.pod:39
3464 "Use the I<--csv> option to get a format which can be easily parsed by other "
3465 "programs. Other options are similar to the standard L<df(1)> command."
3469 #: ../df/virt-df.pod:45
3471 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3472 "output human-readable:"
3476 #: ../df/virt-df.pod:48
3479 " # virt-df -d F14x64 -h\n"
3480 " Filesystem Size Used Available Use%\n"
3481 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3482 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3487 #: ../df/virt-df.pod:53
3488 msgid "Show disk usage for a disk image file called C<test.img>:"
3492 #: ../df/virt-df.pod:55
3495 " $ virt-df -a test1.img\n"
3496 " Filesystem 1K-blocks Used Available Use%\n"
3497 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3502 #: ../df/virt-df.pod:112
3505 " virt-df --format=raw -a disk.img\n"
3510 #: ../df/virt-df.pod:116
3513 " virt-df --format=raw -a disk.img --format -a another.img\n"
3518 #: ../df/virt-df.pod:129
3519 msgid "Print sizes in human-readable format."
3523 #: ../df/virt-df.pod:131
3524 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3528 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:164
3533 #: ../df/virt-df.pod:135
3538 #: ../df/virt-df.pod:137
3539 msgid "Print inodes instead of blocks."
3543 #: ../df/virt-df.pod:139
3544 msgid "B<--one-per-guest>"
3548 #: ../df/virt-df.pod:141
3550 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3551 "disks from several guests to a single libguestfs appliance."
3555 #: ../df/virt-df.pod:144
3556 msgid "You might use this option in the following circumstances:"
3560 #: ../df/virt-df.pod:150
3562 "If you think an untrusted guest might actively try to exploit the libguestfs "
3563 "appliance kernel, then this prevents one guest from interfering with the "
3564 "stats printed for another guest."
3568 #: ../df/virt-df.pod:156
3570 "If the kernel has a bug which stops it from accessing a filesystem in one "
3571 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3572 "and report stats for further guests."
3576 #: ../df/virt-df.pod:165
3578 "Print UUIDs instead of names. This is useful for following a guest even "
3579 "when the guest is migrated or renamed, or when two guests happen to have the "
3584 #: ../df/virt-df.pod:169
3586 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3587 "images, we still print the disk image name even when this option is "
3592 #: ../df/virt-df.pod:229
3594 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
3595 "L<http://libguestfs.org/>."
3599 #: ../edit/virt-edit.pod:5
3600 msgid "virt-edit - Edit a file in a virtual machine"
3604 #: ../edit/virt-edit.pod:9
3607 " virt-edit [--options] -d domname file [file ...]\n"
3612 #: ../edit/virt-edit.pod:11
3615 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
3620 #: ../edit/virt-edit.pod:13
3623 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
3628 #: ../edit/virt-edit.pod:17
3631 " virt-edit domname file\n"
3636 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
3639 " virt-edit disk.img [disk.img ...] file\n"
3644 #: ../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
3649 #: ../edit/virt-edit.pod:23
3651 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
3652 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
3653 "doing this, but doesn't catch all cases."
3657 #: ../edit/virt-edit.pod:29
3659 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
3660 "exists in the named virtual machine (or disk image)."
3664 #: ../edit/virt-edit.pod:32
3666 "Multiple filenames can be given, in which case they are each edited in "
3667 "turn. Each filename must be a full path, starting at the root directory "
3668 "(starting with '/')."
3672 #: ../edit/virt-edit.pod:36
3673 msgid "If you want to just view a file, use L<virt-cat(1)>."
3677 #: ../edit/virt-edit.pod:38
3679 "For more complex cases you should look at the L<guestfish(1)> tool (see "
3680 "L</USING GUESTFISH> below)."
3684 #: ../edit/virt-edit.pod:41
3686 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
3687 "that and much more."
3691 #: ../edit/virt-edit.pod:46
3692 msgid "Edit the named files interactively:"
3696 #: ../edit/virt-edit.pod:48
3699 " virt-edit -d mydomain /boot/grub/grub.conf\n"
3704 #: ../edit/virt-edit.pod:50
3707 " virt-edit -d mydomain /etc/passwd\n"
3712 #: ../edit/virt-edit.pod:52
3713 msgid "For Windows guests, some Windows paths are understood:"
3717 #: ../edit/virt-edit.pod:54
3720 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
3725 #: ../edit/virt-edit.pod:56
3727 "If Perl is installed, you can also edit files non-interactively (see "
3728 "L</NON-INTERACTIVE EDITING> below). To change the init default level to 5:"
3732 #: ../edit/virt-edit.pod:60
3735 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
3740 #: ../edit/virt-edit.pod:81
3741 msgid "B<-b> extension"
3745 #: ../edit/virt-edit.pod:83
3746 msgid "B<--backup> extension"
3750 #: ../edit/virt-edit.pod:85
3752 "Create a backup of the original file I<in the guest disk image>. The backup "
3753 "has the original filename with C<extension> added."
3757 #: ../edit/virt-edit.pod:88
3759 "Usually the first character of C<extension> would be a dot C<.> so you would "
3764 #: ../edit/virt-edit.pod:91
3767 " virt-edit -b .orig [etc]\n"
3772 #: ../edit/virt-edit.pod:93
3773 msgid "By default, no backup file is made."
3777 #: ../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
3782 #: ../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
3783 msgid "B<--connect URI>"
3787 #: ../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
3789 "If you specify guest block devices directly, then libvirt is not used at "
3794 #: ../edit/virt-edit.pod:114
3796 "When prompting for keys and passphrases, virt-edit normally turns echoing "
3797 "off so you cannot see what you are typing. If you are not worried about "
3798 "Tempest attacks and there is no one else in the room you can specify this "
3799 "flag to see what you are typing."
3803 #: ../edit/virt-edit.pod:119
3808 #: ../edit/virt-edit.pod:121
3809 msgid "B<--expr> EXPR"
3813 #: ../edit/virt-edit.pod:123
3815 "Instead of launching the external editor, non-interactively apply the Perl "
3816 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
3821 #: ../edit/virt-edit.pod:127
3823 "Be careful to properly quote the expression to prevent it from being altered "
3828 #: ../edit/virt-edit.pod:130
3829 msgid "Note that this option is only available when Perl 5 is installed."
3833 #: ../edit/virt-edit.pod:132
3834 msgid "B<--format> raw|qcow2|..."
3838 #: ../edit/virt-edit.pod:143
3841 " virt-edit --format=raw -a disk.img file\n"
3846 #: ../edit/virt-edit.pod:147
3849 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
3854 #: ../edit/virt-edit.pod:181
3855 msgid "Previous versions of virt-edit allowed you to write either:"
3859 #: ../edit/virt-edit.pod:187
3862 " virt-edit guestname file\n"
3867 #: ../edit/virt-edit.pod:195
3868 msgid "NON-INTERACTIVE EDITING"
3872 #: ../edit/virt-edit.pod:197
3874 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
3875 "administrator can interactively edit the file."
3879 #: ../edit/virt-edit.pod:200
3881 "There are two ways also to use C<virt-edit> from scripts in order to make "
3882 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
3883 "like this, it's less error-prone to write scripts directly using the "
3884 "libguestfs API and Augeas for configuration file editing.)"
3888 #: ../edit/virt-edit.pod:206
3890 "The first method is to temporarily set C<$EDITOR> to any script or program "
3891 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
3892 "update C<tmpfile> in place however it likes."
3896 #: ../edit/virt-edit.pod:210
3898 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
3899 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
3900 "instances of C<foo> with C<bar> in a file:"
3904 #: ../edit/virt-edit.pod:214
3907 " virt-edit -d domname filename -e 's/foo/bar/'\n"
3912 #: ../edit/virt-edit.pod:216
3914 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
3915 "For example to delete root's password you could do:"
3919 #: ../edit/virt-edit.pod:219
3922 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3927 #: ../edit/virt-edit.pod:221
3929 "What really happens is that the snippet is evaluated as a Perl expression "
3930 "for each line of the file. The line, including the final C<\\n>, is passed "
3931 "in C<$_> and the expression should update C<$_> or leave it unchanged."
3935 #: ../edit/virt-edit.pod:226
3937 "To delete a line, set C<$_> to the empty string. For example, to delete the "
3938 "C<apache> user account from the password file you can do:"
3942 #: ../edit/virt-edit.pod:229
3945 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
3950 #: ../edit/virt-edit.pod:231
3952 "To insert a line, prepend or append it to C<$_>. However appending lines to "
3953 "the end of the file is rather difficult this way since there is no concept "
3954 "of \"last line of the file\" - your expression just doesn't get called "
3955 "again. You might want to use the first method (setting C<$EDITOR>) if you "
3960 #: ../edit/virt-edit.pod:237
3962 "The variable C<$lineno> contains the current line number. As is "
3963 "traditional, the first line in the file is number C<1>."
3967 #: ../edit/virt-edit.pod:240
3969 "The return value from the expression is ignored, but the expression may call "
3970 "C<die> in order to abort the whole program, leaving the original file "
3975 #: ../edit/virt-edit.pod:244
3977 "Remember when matching the end of a line that C<$_> may contain the final "
3978 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
3979 "newline then neither of these. Thus to match or substitute some text at the "
3980 "end of a line, use this regular expression:"
3984 #: ../edit/virt-edit.pod:249
3987 " /some text(\\r?\\n)?$/\n"
3992 #: ../edit/virt-edit.pod:251
3994 "Alternately, use the perl C<chomp> function, being careful not to chomp "
3995 "C<$_> itself (since that would remove all newlines from the file):"
3999 #: ../edit/virt-edit.pod:255
4002 " my $m = $_; chomp $m; $m =~ /some text$/\n"
4007 #: ../edit/virt-edit.pod:259
4009 "C<virt-edit> has a limited ability to understand Windows drive letters and "
4010 "paths (eg. C<E:\\foo\\bar.txt>)."
4014 #: ../edit/virt-edit.pod:278
4016 "The path is resolved case insensitively to locate the file that should be "
4021 #: ../edit/virt-edit.pod:299
4023 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
4024 "C<virt-edit> doesn't work."
4028 #: ../edit/virt-edit.pod:302
4029 msgid "Using C<virt-edit> is approximately equivalent to doing:"
4033 #: ../edit/virt-edit.pod:304
4036 " guestfish --rw -i -d domname edit /file\n"
4041 #: ../edit/virt-edit.pod:306
4043 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
4048 #: ../edit/virt-edit.pod:309
4050 "The command above uses libguestfs's guest inspection feature and so does not "
4051 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
4052 "disk images that don't contain guests. To edit a file on a disk image "
4057 #: ../edit/virt-edit.pod:314
4060 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4065 #: ../edit/virt-edit.pod:316
4067 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4068 "the disk image to edit, and C</file> is the full path to the file."
4072 #: ../edit/virt-edit.pod:320
4074 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4075 "C<write> or C<upload> instead:"
4079 #: ../edit/virt-edit.pod:323
4082 " guestfish --rw -i -d domname touch /newfile\n"
4087 #: ../edit/virt-edit.pod:325
4090 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4095 #: ../edit/virt-edit.pod:327
4098 " guestfish --rw -i -d domname upload localfile /newfile\n"
4103 #: ../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
4104 msgid "ENVIRONMENT VARIABLES"
4108 #: ../edit/virt-edit.pod:333
4113 #: ../edit/virt-edit.pod:335
4115 "If set, this string is used as the editor. It may contain arguments, "
4116 "eg. C<\"emacs -nw\">"
4120 #: ../edit/virt-edit.pod:338
4121 msgid "If not set, C<vi> is used."
4125 #: ../edit/virt-edit.pod:356
4127 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
4128 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
4129 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4133 #: ../erlang/examples/guestfs-erlang.pod:5
4134 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4138 #: ../erlang/examples/guestfs-erlang.pod:9
4141 " {ok, G} = guestfs:create(),\n"
4142 " ok = guestfs:add_drive_opts(G, Disk,\n"
4143 " [{format, \"raw\"}, {readonly, true}]),\n"
4144 " ok = guestfs:launch(G),\n"
4145 " [Device] = guestfs:list_devices(G),\n"
4146 " ok = guestfs:close(G).\n"
4151 #: ../erlang/examples/guestfs-erlang.pod:18
4153 "This manual page documents how to call libguestfs from the Erlang "
4154 "programming language. This page just documents the differences from the C "
4155 "API and gives some examples. If you are not familiar with using libguestfs, "
4156 "you also need to read L<guestfs(3)>."
4160 #: ../erlang/examples/guestfs-erlang.pod:23
4161 msgid "OPENING AND CLOSING THE HANDLE"
4165 #: ../erlang/examples/guestfs-erlang.pod:25
4167 "The Erlang bindings are implemented using an external program called "
4168 "C<erl-guestfs>. This program must be on the current PATH, or else you "
4169 "should specify the full path to the program:"
4173 #: ../erlang/examples/guestfs-erlang.pod:29
4176 " {ok, G} = guestfs:create().\n"
4181 #: ../erlang/examples/guestfs-erlang.pod:31
4184 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4189 #: ../erlang/examples/guestfs-erlang.pod:33
4190 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4194 #: ../erlang/examples/guestfs-erlang.pod:36
4195 msgid "To close the handle:"
4199 #: ../erlang/examples/guestfs-erlang.pod:38
4202 " ok = guestfs:close(G).\n"
4207 #: ../erlang/examples/guestfs-erlang.pod:40
4208 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4212 #: ../erlang/examples/guestfs-erlang.pod:42
4214 "For functions that take optional arguments, the first arguments are the "
4215 "non-optional ones. The last argument is a list of tuples supplying the "
4216 "remaining optional arguments."
4220 #: ../erlang/examples/guestfs-erlang.pod:46
4223 " ok = guestfs:add_drive_opts(G, Disk,\n"
4224 " [{format, \"raw\"}, {readonly, true}]).\n"
4229 #: ../erlang/examples/guestfs-erlang.pod:49
4230 msgid "If the last argument would be an empty list, you can also omit it:"
4234 #: ../erlang/examples/guestfs-erlang.pod:51
4237 " ok = guestfs:add_drive_opts(G, Disk).\n"
4242 #: ../erlang/examples/guestfs-erlang.pod:53
4243 msgid "RETURN VALUES AND ERRORS"
4247 #: ../erlang/examples/guestfs-erlang.pod:55
4249 "On success, most functions return a C<Result> term (which could be a list, "
4250 "string, tuple etc.). If there is nothing for the function to return, then "
4251 "the atom C<ok> is returned."
4255 #: ../erlang/examples/guestfs-erlang.pod:59
4256 msgid "On error, you would see one of the following tuples:"
4260 #: ../erlang/examples/guestfs-erlang.pod:63
4261 msgid "C<{error, Msg, Errno}>"
4265 #: ../erlang/examples/guestfs-erlang.pod:65
4266 msgid "This indicates an ordinary error from the function."
4270 #: ../erlang/examples/guestfs-erlang.pod:67
4272 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4277 #: ../erlang/examples/guestfs-erlang.pod:70
4278 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4282 #: ../erlang/examples/guestfs-erlang.pod:72
4283 msgid "C<{unknown, Function}>"
4287 #: ../erlang/examples/guestfs-erlang.pod:74
4289 "This indicates that the function you called is not known. Generally this "
4290 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4291 "which you should not do."
4295 #: ../erlang/examples/guestfs-erlang.pod:78
4296 msgid "C<Function> is the name of the unknown function."
4300 #: ../erlang/examples/guestfs-erlang.pod:80
4301 msgid "C<{unknownarg, Arg}>"
4305 #: ../erlang/examples/guestfs-erlang.pod:82
4307 "This indicates that you called a function with optional arguments, with an "
4308 "unknown argument name."
4312 #: ../erlang/examples/guestfs-erlang.pod:85
4313 msgid "C<Arg> is the name of the unknown argument."
4317 #: ../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
4318 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4322 #: ../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
4327 #: ../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
4328 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4332 #: ../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
4337 #: ../erlang/examples/guestfs-erlang.pod:99
4339 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
4340 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4341 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://www.erlang.org/>. "
4342 "L<http://libguestfs.org/>."
4346 #: ../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:404 ../java/examples/guestfs-java.pod:58 ../ocaml/examples/guestfs-ocaml.pod:91 ../perl/examples/guestfs-perl.pod:52 ../python/examples/guestfs-python.pod:54 ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3348 ../test-tool/libguestfs-test-tool.pod:106
4351 #: ../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
4352 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4356 #: ../erlang/examples/guestfs-erlang.pod:116 ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4357 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4361 #: ../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
4363 "The examples in this manual page may be freely copied, modified and "
4364 "distributed without any restrictions."
4368 #: ../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
4370 "This library is free software; you can redistribute it and/or modify it "
4371 "under the terms of the GNU Lesser General Public License as published by the "
4372 "Free Software Foundation; either version 2 of the License, or (at your "
4373 "option) any later version."
4377 #: ../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
4379 "This library is distributed in the hope that it will be useful, but WITHOUT "
4380 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4381 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4386 #: ../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
4388 "You should have received a copy of the GNU Lesser General Public License "
4389 "along with this library; if not, write to the Free Software Foundation, "
4390 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4394 #: ../examples/guestfs-examples.pod:5
4395 msgid "guestfs-examples - Examples of using libguestfs from C"
4399 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4402 " #include <guestfs.h>\n"
4407 #: ../examples/guestfs-examples.pod:11
4410 " guestfs_h *g = guestfs_create ();\n"
4411 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4412 " guestfs_launch (g);\n"
4417 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4420 " cc prog.c -o prog -lguestfs\n"
4422 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4427 #: ../examples/guestfs-examples.pod:21
4429 "This manual page contains examples of calling libguestfs from the C "
4430 "programming language. If you are not familiar with using libguestfs, you "
4431 "also need to read L<guestfs(3)>."
4435 #: ../examples/guestfs-examples.pod:35
4437 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
4438 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4439 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4443 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97 ../python/examples/guestfs-python.pod:60 ../ruby/examples/guestfs-ruby.pod:54
4444 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4448 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4453 #: ../examples/guestfs-recipes.pod:5
4455 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4456 "here. The only way which works for both sorts of output is to just write "
4457 "the URL directly. Do NOT use L<...> for URLs."
4461 #: ../examples/guestfs-recipes.pod:9
4463 "We break with tradition here and don't use ALL CAPS for the section "
4464 "headings, as this makes them much easier to read."
4468 #: ../examples/guestfs-recipes.pod:16
4469 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4473 #: ../examples/guestfs-recipes.pod:20
4475 "This page contains recipes for and links to things you can do using "
4476 "libguestfs, L<guestfish(1)> and the virt tools."
4480 #: ../examples/guestfs-recipes.pod:23
4481 msgid "Audit a virtual machine for setuid files"
4485 #: ../examples/guestfs-recipes.pod:25
4487 "The link below contains a small program which can be used to audit a Linux "
4488 "virtual machine to see what setuid and setgid files it contains."
4492 #: ../examples/guestfs-recipes.pod:28
4493 msgid "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-files/#content"
4497 #: ../examples/guestfs-recipes.pod:30
4498 msgid "Change the background image in a Windows XP VM"
4502 #: ../examples/guestfs-recipes.pod:32
4504 "The links below explain how to use L<guestfish(1)> to change the background "
4505 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4506 "be substantially different for each version of Windows."
4510 #: ../examples/guestfs-recipes.pod:37
4512 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html "
4513 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4517 #: ../examples/guestfs-recipes.pod:40
4518 msgid "Cloning a virtual machine (Linux)"
4522 #: ../examples/guestfs-recipes.pod:42
4524 "The guestfish technique described in the link below works well for most "
4525 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4530 #: ../examples/guestfs-recipes.pod:46
4531 msgid "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/#content"
4535 #: ../examples/guestfs-recipes.pod:48
4537 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
4542 #: ../examples/guestfs-recipes.pod:51
4543 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4547 #: ../examples/guestfs-recipes.pod:53
4548 msgid "Cloning a virtual machine (Windows)"
4552 #: ../examples/guestfs-recipes.pod:55
4554 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
4555 "straightforward. Currently there is code in the Aeolus Oz project which "
4556 "does this (using libguestfs). As part of our review of the virt-clone tool, "
4557 "we may add sysprepping ability."
4561 #: ../examples/guestfs-recipes.pod:60
4563 "https://github.com/clalancette/oz "
4564 "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4568 #: ../examples/guestfs-recipes.pod:63
4569 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
4573 #: ../examples/guestfs-recipes.pod:65
4574 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
4578 #: ../examples/guestfs-recipes.pod:67
4581 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
4586 #: ../examples/guestfs-recipes.pod:69
4587 msgid "To export just a subdirectory, eg. C</files>, do:"
4591 #: ../examples/guestfs-recipes.pod:71
4594 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
4599 #: ../examples/guestfs-recipes.pod:73
4600 msgid "Create empty disk images"
4604 #: ../examples/guestfs-recipes.pod:75
4606 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
4607 "The useful guide below explains the options available."
4611 #: ../examples/guestfs-recipes.pod:78
4612 msgid "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/#content"
4616 #: ../examples/guestfs-recipes.pod:80
4617 msgid "Dump raw filesystem content from inside a disk image or VM"
4621 #: ../examples/guestfs-recipes.pod:82
4623 "You can use the L<guestfish(1)> C<download> command to extract the raw "
4624 "filesystem content from any filesystem in a disk image or a VM (even one "
4625 "which is encrypted or buried inside an LV):"
4629 #: ../examples/guestfs-recipes.pod:86
4632 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
4637 #: ../examples/guestfs-recipes.pod:88
4640 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
4645 #: ../examples/guestfs-recipes.pod:90
4646 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
4650 #: ../examples/guestfs-recipes.pod:92
4651 msgid "Edit grub configuration in a VM"
4655 #: ../examples/guestfs-recipes.pod:94
4656 msgid "You can use this to:"
4660 #: ../examples/guestfs-recipes.pod:100
4661 msgid "Fix a virtual machine that does not boot."
4665 #: ../examples/guestfs-recipes.pod:104
4666 msgid "Change which kernel is used to boot the VM."
4670 #: ../examples/guestfs-recipes.pod:108
4671 msgid "Change kernel command line options."
4675 #: ../examples/guestfs-recipes.pod:112
4676 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
4680 #: ../examples/guestfs-recipes.pod:114
4683 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
4688 #: ../examples/guestfs-recipes.pod:116
4690 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
4695 #: ../examples/guestfs-recipes.pod:119
4698 " virt-rescue -d BrokenGuest\n"
4703 #: ../examples/guestfs-recipes.pod:121
4704 msgid "Export any directory from a VM"
4708 #: ../examples/guestfs-recipes.pod:123
4709 msgid "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
4713 #: ../examples/guestfs-recipes.pod:126
4716 " virt-copy-out -d Guest /home .\n"
4721 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1450 ../fish/guestfish-actions.pod:1715 ../fish/guestfish-actions.pod:2132 ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:2334 ../src/guestfs-actions.pod:2758 ../src/guestfs-actions.pod:3317 ../src/guestfs.pod:1685 ../tools/virt-win-reg.pl:717
4726 #: ../examples/guestfs-recipes.pod:134
4728 "The final dot of the command is not a printing error. It means we want to "
4729 "copy out to the current directory."
4733 #: ../examples/guestfs-recipes.pod:139
4734 msgid "This creates a directory called C<home> under the current directory."
4738 #: ../examples/guestfs-recipes.pod:143
4740 "If the guest is a Windows guest then you can use drive letters and "
4741 "backslashes, but you must prefix the path with C<win:> and quote it to "
4742 "protect it from the shell, like this:"
4746 #: ../examples/guestfs-recipes.pod:147
4749 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
4754 #: ../examples/guestfs-recipes.pod:149
4755 msgid "To get the output as a compressed tarball, do:"
4759 #: ../examples/guestfs-recipes.pod:151
4762 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
4767 #: ../examples/guestfs-recipes.pod:153
4769 "Although it sounds tempting, this is usually not a reliable way to get a "
4770 "backup from a running guest. See the entry in the FAQ: "
4771 "http://libguestfs.org/FAQ.html#backup"
4775 #: ../examples/guestfs-recipes.pod:157
4776 msgid "Find out which user is using the most space"
4780 #: ../examples/guestfs-recipes.pod:159
4782 "This simple script examines a Linux guest to find out which user is using "
4783 "the most space in their home directory:"
4787 #: ../examples/guestfs-recipes.pod:162
4795 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
4803 #: ../examples/guestfs-recipes.pod:166
4812 #: ../examples/guestfs-recipes.pod:169
4815 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
4820 #: ../examples/guestfs-recipes.pod:171
4823 " for d in $(guestfish --remote ls \"$dir\"); do\n"
4824 " echo -n \"$dir/$d\"\n"
4826 " guestfish --remote du \"$dir/$d\";\n"
4827 " done | sort -nr -k 2\n"
4832 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
4835 " guestfish --remote exit\n"
4840 #: ../examples/guestfs-recipes.pod:179
4841 msgid "Get DHCP address from a VM"
4845 #: ../examples/guestfs-recipes.pod:181
4847 "The link below explains the many different possible techniques for getting "
4848 "the last assigned DHCP address of a virtual machine."
4852 #: ../examples/guestfs-recipes.pod:184
4853 msgid "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-a-virtual-machine-disk-image/#content"
4857 #: ../examples/guestfs-recipes.pod:186
4859 "In the libguestfs source examples directory you will find the latest version "
4860 "of the C<virt-dhcp-address.c> program."
4864 #: ../examples/guestfs-recipes.pod:189
4865 msgid "Get the operating system product name string"
4869 #: ../examples/guestfs-recipes.pod:191
4870 msgid "Save the following script into a file called C<product-name.sh>:"
4874 #: ../examples/guestfs-recipes.pod:193
4879 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4880 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4881 " guestfish --remote inspect-get-product-name \"$root\"\n"
4882 " guestfish --remote exit\n"
4887 #: ../examples/guestfs-recipes.pod:200
4888 msgid "Make the script executable and run it on a named guest:"
4892 #: ../examples/guestfs-recipes.pod:202
4895 " # product-name.sh RHEL60x64\n"
4896 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
4901 #: ../examples/guestfs-recipes.pod:205
4903 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
4904 "C<xpath> command line tool or from your favourite programming language:"
4908 #: ../examples/guestfs-recipes.pod:209
4911 " # virt-inspector RHEL60x64 > xml\n"
4912 " # xpath '//product_name' < xml\n"
4915 " <product_name>Red Hat Enterprise Linux Server release 6.0 "
4916 "(Santiago)</product_name>\n"
4921 #: ../examples/guestfs-recipes.pod:215
4922 msgid "Get the default boot kernel for a Linux VM"
4926 #: ../examples/guestfs-recipes.pod:217
4928 "The link below contains a program to print the default boot kernel for a "
4933 #: ../examples/guestfs-recipes.pod:220
4934 msgid "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-kernel-for-a-vm/#content"
4938 #: ../examples/guestfs-recipes.pod:222
4940 "It uses Augeas, and the technique is generally applicable for many different "
4945 #: ../examples/guestfs-recipes.pod:229
4946 msgid "listing the user accounts in the guest"
4950 #: ../examples/guestfs-recipes.pod:233
4951 msgid "what repositories is it configured to use"
4955 #: ../examples/guestfs-recipes.pod:237
4956 msgid "what NTP servers does it connect to"
4960 #: ../examples/guestfs-recipes.pod:241
4961 msgid "what were the boot messages last time it booted"
4965 #: ../examples/guestfs-recipes.pod:245
4966 msgid "listing who was logged in recently"
4970 #: ../examples/guestfs-recipes.pod:249
4971 msgid "http://augeas.net/"
4975 #: ../examples/guestfs-recipes.pod:251
4976 msgid "Install RPMs in a guest"
4980 #: ../examples/guestfs-recipes.pod:253
4982 "The link below contains a method to install RPMs in a guest. In fact the "
4983 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
4984 "installs them next time the guest is booted. You could use this technique "
4985 "to install vital security updates in an offline guest."
4989 #: ../examples/guestfs-recipes.pod:259
4990 msgid "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
4994 #: ../examples/guestfs-recipes.pod:261
4995 msgid "List applications installed in a VM"
4999 #: ../examples/guestfs-recipes.pod:263
5000 msgid "Save the following to a file C<list-apps.sh>:"
5004 #: ../examples/guestfs-recipes.pod:265
5009 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5010 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5011 " guestfish --remote inspect-list-applications \"$root\"\n"
5012 " guestfish --remote exit\n"
5017 #: ../examples/guestfs-recipes.pod:272
5019 "Make the file executable and then you can run it on any named virtual "
5024 #: ../examples/guestfs-recipes.pod:275
5027 " # list-apps.sh WinGuest\n"
5029 " app_name: Mozilla Firefox (3.6.12)\n"
5030 " app_display_name: Mozilla Firefox (3.6.12)\n"
5032 " app_version: 3.6.12 (en-GB)\n"
5034 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
5035 " app_trans_path:\n"
5036 " app_publisher: Mozilla\n"
5037 " app_url: http://www.mozilla.com/en-GB/\n"
5038 " app_source_package:\n"
5040 " app_description: Mozilla Firefox\n"
5043 " app_name: VLC media player\n"
5044 " app_display_name: VLC media player 1.1.5\n"
5046 " app_version: 1.1.5\n"
5048 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
5049 " app_trans_path:\n"
5050 " app_publisher: VideoLAN\n"
5051 " app_url: http://www.videolan.org/\n"
5052 " app_source_package:\n"
5054 " app_description:\n"
5060 #: ../examples/guestfs-recipes.pod:305
5062 "If you want to run the script on disk images (instead of libvirt virtual "
5063 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also "
5064 "L<virt-inspector(1)>."
5068 #: ../examples/guestfs-recipes.pod:309
5069 msgid "List files and directories in a VM"
5073 #: ../examples/guestfs-recipes.pod:311
5074 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5078 #: ../examples/guestfs-recipes.pod:313
5081 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5086 #: ../examples/guestfs-recipes.pod:315
5087 msgid "List services in a Windows VM"
5091 #: ../examples/guestfs-recipes.pod:317
5093 "The link below contains a script that can be used to list out the services "
5094 "from a Windows VM, and whether those services run at boot time or are loaded "
5099 #: ../examples/guestfs-recipes.pod:321
5100 msgid "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/#content"
5104 #: ../examples/guestfs-recipes.pod:323
5105 msgid "Make a disk image sparse"
5109 #: ../examples/guestfs-recipes.pod:325
5111 "The link below contains some guides for making a disk image sparse (or "
5112 "reintroducing sparseness)."
5116 #: ../examples/guestfs-recipes.pod:328
5117 msgid "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5121 #: ../examples/guestfs-recipes.pod:330
5122 msgid "Monitor disk usage over time"
5126 #: ../examples/guestfs-recipes.pod:332
5128 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5129 "The link below contains a guide."
5133 #: ../examples/guestfs-recipes.pod:335
5134 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5138 #: ../examples/guestfs-recipes.pod:337
5139 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5143 #: ../examples/guestfs-recipes.pod:339
5145 "L<guestfish(1)> plus the tools described in the link below can be used to "
5146 "read out the Windows Event Log from any virtual machine running Windows "
5147 "Vista or a later version."
5151 #: ../examples/guestfs-recipes.pod:343
5152 msgid "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-guestfish/#content"
5156 #: ../examples/guestfs-recipes.pod:345
5157 msgid "Remove root password (Linux)"
5161 #: ../examples/guestfs-recipes.pod:347
5163 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5164 "files. One use is to remove the root password from a Linux guest:"
5168 #: ../examples/guestfs-recipes.pod:350
5171 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5176 #: ../examples/guestfs-recipes.pod:352
5177 msgid "Remove Administrator password (Windows)"
5181 #: ../examples/guestfs-recipes.pod:354
5183 "The link below contains one technique for removing the Administrator "
5184 "password from a Windows VM, or to be more precise, it gives you a command "
5185 "prompt the next time you log in which you can use to bypass any security:"
5189 #: ../examples/guestfs-recipes.pod:359
5190 msgid "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-administrator-password-with-guestfish/"
5194 #: ../examples/guestfs-recipes.pod:361
5195 msgid "Unpack a live CD"
5199 #: ../examples/guestfs-recipes.pod:363
5201 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5202 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5203 "layers, as outlined in the guide below."
5207 #: ../examples/guestfs-recipes.pod:367
5208 msgid "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/#content"
5212 #: ../examples/guestfs-recipes.pod:369
5213 msgid "Uploading and downloading files"
5217 #: ../examples/guestfs-recipes.pod:371
5219 "The link below contains general tips on uploading (copying in) and "
5220 "downloading (copying out) files from VMs."
5224 #: ../examples/guestfs-recipes.pod:374
5225 msgid "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5229 #: ../examples/guestfs-recipes.pod:376
5230 msgid "Use libguestfs tools on VMware ESX guests"
5234 #: ../examples/guestfs-recipes.pod:378
5236 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5237 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5241 #: ../examples/guestfs-recipes.pod:382
5242 msgid "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/#content"
5246 #: ../examples/guestfs-recipes.pod:386
5248 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, "
5249 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
5250 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
5251 "L<http://libguestfs.org/>."
5255 #: ../examples/guestfs-recipes.pod:403
5256 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5260 #: ../fish/guestfish-actions.pod:1
5265 #: ../fish/guestfish-actions.pod:3
5268 " add-cdrom filename\n"
5273 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
5274 msgid "This function adds a virtual CD-ROM disk image to the guest."
5278 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
5279 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
5283 #: ../fish/guestfish-actions.pod:15
5285 "This call checks for the existence of C<filename>. This stops you from "
5286 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5287 "and C<http:> URLs. To specify those, use the general L</config> call "
5292 #: ../fish/guestfish-actions.pod:22
5294 "If you just want to add an ISO file (often you use this as an efficient way "
5295 "to transfer large files into the guest), then you should probably use "
5296 "L</add-drive-ro> instead."
5300 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:214 ../fish/guestfish-actions.pod:228
5302 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
5307 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:217 ../fish/guestfish-actions.pod:231 ../fish/guestfish-actions.pod:941 ../fish/guestfish-actions.pod:976 ../fish/guestfish-actions.pod:1149 ../fish/guestfish-actions.pod:1509 ../fish/guestfish-actions.pod:1523 ../fish/guestfish-actions.pod:3284 ../fish/guestfish-actions.pod:3595 ../fish/guestfish-actions.pod:3643 ../fish/guestfish-actions.pod:4561 ../fish/guestfish-actions.pod:4581 ../fish/guestfish-actions.pod:4600 ../fish/guestfish-actions.pod:4638 ../fish/guestfish-actions.pod:5287 ../fish/guestfish-actions.pod:5390 ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:305 ../src/guestfs-actions.pod:326 ../src/guestfs-actions.pod:1580 ../src/guestfs-actions.pod:1637 ../src/guestfs-actions.pod:1920 ../src/guestfs-actions.pod:2419 ../src/guestfs-actions.pod:2440 ../src/guestfs-actions.pod:5076 ../src/guestfs-actions.pod:5598 ../src/guestfs-actions.pod:5698 ../src/guestfs-actions.pod:6994 ../src/guestfs-actions.pod:7035 ../src/guestfs-actions.pod:7066 ../src/guestfs-actions.pod:7126 ../src/guestfs-actions.pod:8058 ../src/guestfs-actions.pod:8167 ../src/guestfs-actions.pod:8347
5309 "Deprecated functions will not be removed from the API, but the fact that "
5310 "they are deprecated indicates that there are problems with correct use of "
5315 #: ../fish/guestfish-actions.pod:35
5320 #: ../fish/guestfish-actions.pod:37
5325 #: ../fish/guestfish-actions.pod:39
5328 " add-domain dom [libvirturi:..] [readonly:true|false] [iface:..] "
5329 "[live:true|false] [allowuuid:true|false] [readonlydisk:..]\n"
5334 #: ../fish/guestfish-actions.pod:41
5336 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5337 "It works by connecting to libvirt, requesting the domain and domain XML from "
5338 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
5342 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:65
5344 "The number of disks added is returned. This operation is atomic: if an "
5345 "error is returned, then no disks are added."
5349 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:68
5351 "This function does some minimal checks to make sure the libvirt domain is "
5352 "not running (unless C<readonly> is true). In a future version we will try "
5353 "to acquire the libvirt lock on each disk."
5357 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:72
5359 "Disks must be accessible locally. This often means that adding disks from a "
5360 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5361 "unless those disks are accessible via the same device path locally too."
5365 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:77
5367 "The optional C<libvirturi> parameter sets the libvirt URI (see "
5368 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
5369 "default libvirt URI (or one set through an environment variable, see the "
5370 "libvirt documentation for full details)."
5374 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:83
5376 "The optional C<live> flag controls whether this call will try to connect to "
5377 "a running virtual machine C<guestfsd> process if it sees a suitable "
5378 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5379 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5380 "DAEMONS> for more information."
5384 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:90
5386 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
5387 "passed instead of the domain name. The C<dom> string is treated as a UUID "
5388 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
5393 #: ../fish/guestfish-actions.pod:76 ../src/guestfs-actions.pod:95
5395 "The optional C<readonlydisk> parameter controls what we do for disks which "
5396 "are marked E<lt>readonly/E<gt> in the libvirt XML. Possible values are:"
5400 #: ../fish/guestfish-actions.pod:82 ../src/guestfs-actions.pod:101
5401 msgid "readonlydisk = \"error\""
5405 #: ../fish/guestfish-actions.pod:84 ../fish/guestfish-actions.pod:95 ../fish/guestfish-actions.pod:106 ../src/guestfs-actions.pod:103 ../src/guestfs-actions.pod:114 ../src/guestfs-actions.pod:125
5406 msgid "If C<readonly> is false:"
5410 #: ../fish/guestfish-actions.pod:86 ../src/guestfs-actions.pod:105
5412 "The whole call is aborted with an error if any disk with the "
5413 "E<lt>readonly/E<gt> flag is found."
5417 #: ../fish/guestfish-actions.pod:89 ../fish/guestfish-actions.pod:100 ../fish/guestfish-actions.pod:110 ../src/guestfs-actions.pod:108 ../src/guestfs-actions.pod:119 ../src/guestfs-actions.pod:129
5418 msgid "If C<readonly> is true:"
5422 #: ../fish/guestfish-actions.pod:91 ../fish/guestfish-actions.pod:102 ../fish/guestfish-actions.pod:112 ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:131
5423 msgid "Disks with the E<lt>readonly/E<gt> flag are added read-only."
5427 #: ../fish/guestfish-actions.pod:93 ../src/guestfs-actions.pod:112
5428 msgid "readonlydisk = \"read\""
5432 #: ../fish/guestfish-actions.pod:97 ../src/guestfs-actions.pod:116
5434 "Disks with the E<lt>readonly/E<gt> flag are added read-only. Other disks "
5435 "are added read/write."
5439 #: ../fish/guestfish-actions.pod:104 ../src/guestfs-actions.pod:123
5440 msgid "readonlydisk = \"write\" (default)"
5444 #: ../fish/guestfish-actions.pod:108 ../src/guestfs-actions.pod:127
5445 msgid "Disks with the E<lt>readonly/E<gt> flag are added read/write."
5449 #: ../fish/guestfish-actions.pod:114 ../src/guestfs-actions.pod:133
5450 msgid "readonlydisk = \"ignore\""
5454 #: ../fish/guestfish-actions.pod:116 ../src/guestfs-actions.pod:135
5455 msgid "If C<readonly> is true or false:"
5459 #: ../fish/guestfish-actions.pod:118 ../src/guestfs-actions.pod:137
5460 msgid "Disks with the E<lt>readonly/E<gt> flag are skipped."
5464 #: ../fish/guestfish-actions.pod:122
5466 "The other optional parameters are passed directly through to "
5467 "L</add-drive-opts>."
5471 #: ../fish/guestfish-actions.pod:125 ../fish/guestfish-actions.pod:194 ../fish/guestfish-actions.pod:624 ../fish/guestfish-actions.pod:835 ../fish/guestfish-actions.pod:856 ../fish/guestfish-actions.pod:894 ../fish/guestfish-actions.pod:903 ../fish/guestfish-actions.pod:912 ../fish/guestfish-actions.pod:926 ../fish/guestfish-actions.pod:2171 ../fish/guestfish-actions.pod:3333 ../fish/guestfish-actions.pod:3496 ../fish/guestfish-actions.pod:3631
5473 "This command has one or more optional arguments. See L</OPTIONAL "
5478 #: ../fish/guestfish-actions.pod:127
5483 #: ../fish/guestfish-actions.pod:129
5486 " add-drive filename\n"
5491 #: ../fish/guestfish-actions.pod:131
5493 "This function is the equivalent of calling L</add-drive-opts> with no "
5494 "optional parameters, so the disk is added writable, with the format being "
5495 "detected automatically."
5499 #: ../fish/guestfish-actions.pod:135
5501 "Automatic detection of the format opens you up to a potential security hole "
5502 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5503 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5504 "you should think about replacing calls to this function with calls to "
5505 "L</add-drive-opts>, and specifying the format."
5509 #: ../fish/guestfish-actions.pod:142
5510 msgid "add-drive-opts"
5514 #: ../fish/guestfish-actions.pod:144
5519 #: ../fish/guestfish-actions.pod:146
5522 " add-drive-opts filename [readonly:true|false] [format:..] [iface:..] "
5528 #: ../fish/guestfish-actions.pod:148 ../src/guestfs-actions.pod:208
5530 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5531 "The first time you call this function, the disk appears as C</dev/sda>, the "
5532 "second time as C</dev/sdb>, and so on."
5536 #: ../fish/guestfish-actions.pod:153 ../src/guestfs-actions.pod:213
5538 "You don't necessarily need to be root when using libguestfs. However you "
5539 "obviously do need sufficient permissions to access the filename for whatever "
5540 "operations you want to perform (ie. read access if you just want to read the "
5541 "image or write access if you want to modify the image)."
5545 #: ../fish/guestfish-actions.pod:159 ../src/guestfs-actions.pod:219
5546 msgid "This call checks that C<filename> exists."
5550 #: ../fish/guestfish-actions.pod:161 ../fish/guestfish-actions.pod:3295 ../src/guestfs-actions.pod:221 ../src/guestfs-actions.pod:5113
5551 msgid "The optional arguments are:"
5555 #: ../fish/guestfish-actions.pod:165 ../src/guestfs-actions.pod:225
5560 #: ../fish/guestfish-actions.pod:167 ../src/guestfs-actions.pod:227
5562 "If true then the image is treated as read-only. Writes are still allowed, "
5563 "but they are stored in a temporary snapshot overlay which is discarded at "
5564 "the end. The disk that you add is not modified."
5568 #: ../fish/guestfish-actions.pod:171 ../src/guestfs-actions.pod:231
5573 #: ../fish/guestfish-actions.pod:173
5575 "This forces the image format. If you omit this (or use L</add-drive> or "
5576 "L</add-drive-ro>) then the format is automatically detected. Possible "
5577 "formats include C<raw> and C<qcow2>."
5581 #: ../fish/guestfish-actions.pod:177 ../src/guestfs-actions.pod:237
5583 "Automatic detection of the format opens you up to a potential security hole "
5584 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5585 "RHBZ#642934. Specifying the format closes this security hole."
5589 #: ../fish/guestfish-actions.pod:182 ../src/guestfs-actions.pod:242
5594 #: ../fish/guestfish-actions.pod:184
5596 "This rarely-used option lets you emulate the behaviour of the deprecated "
5597 "L</add-drive-with-if> call (q.v.)"
5601 #: ../fish/guestfish-actions.pod:187 ../src/guestfs-actions.pod:247
5606 #: ../fish/guestfish-actions.pod:189 ../src/guestfs-actions.pod:249
5608 "The name the drive had in the original guest, e.g. /dev/sdb. This is used as "
5609 "a hint to the guest inspection process if it is available."
5613 #: ../fish/guestfish-actions.pod:196
5614 msgid "add-drive-ro"
5618 #: ../fish/guestfish-actions.pod:198
5623 #: ../fish/guestfish-actions.pod:200
5626 " add-drive-ro filename\n"
5631 #: ../fish/guestfish-actions.pod:202
5633 "This function is the equivalent of calling L</add-drive-opts> with the "
5634 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
5635 "is added read-only, with the format being detected automatically."
5639 #: ../fish/guestfish-actions.pod:207
5640 msgid "add-drive-ro-with-if"
5644 #: ../fish/guestfish-actions.pod:209
5647 " add-drive-ro-with-if filename iface\n"
5652 #: ../fish/guestfish-actions.pod:211
5654 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
5655 "interface emulation to use at run time."
5659 #: ../fish/guestfish-actions.pod:221
5660 msgid "add-drive-with-if"
5664 #: ../fish/guestfish-actions.pod:223
5667 " add-drive-with-if filename iface\n"
5672 #: ../fish/guestfish-actions.pod:225
5674 "This is the same as L</add-drive> but it allows you to specify the QEMU "
5675 "interface emulation to use at run time."
5679 #: ../fish/guestfish-actions.pod:235
5684 #: ../fish/guestfish-actions.pod:237
5687 " aug-clear augpath\n"
5692 #: ../fish/guestfish-actions.pod:239 ../src/guestfs-actions.pod:343
5694 "Set the value associated with C<path> to C<NULL>. This is the same as the "
5695 "L<augtool(1)> C<clear> command."
5699 #: ../fish/guestfish-actions.pod:242
5704 #: ../fish/guestfish-actions.pod:244
5712 #: ../fish/guestfish-actions.pod:246
5714 "Close the current Augeas handle and free up any resources used by it. After "
5715 "calling this, you have to call L</aug-init> again before you can use any "
5716 "other Augeas functions."
5720 #: ../fish/guestfish-actions.pod:251
5725 #: ../fish/guestfish-actions.pod:253
5728 " aug-defnode name expr val\n"
5733 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:372
5734 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
5738 #: ../fish/guestfish-actions.pod:258
5740 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
5741 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
5742 "containing that single node."
5746 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:379
5748 "On success this returns a pair containing the number of nodes in the "
5749 "nodeset, and a boolean flag if a node was created."
5753 #: ../fish/guestfish-actions.pod:266
5758 #: ../fish/guestfish-actions.pod:268
5761 " aug-defvar name expr\n"
5766 #: ../fish/guestfish-actions.pod:270 ../src/guestfs-actions.pod:396
5768 "Defines an Augeas variable C<name> whose value is the result of evaluating "
5769 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
5773 #: ../fish/guestfish-actions.pod:274 ../src/guestfs-actions.pod:400
5775 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
5776 "evaluates to something which is not a nodeset."
5780 #: ../fish/guestfish-actions.pod:277
5785 #: ../fish/guestfish-actions.pod:279
5788 " aug-get augpath\n"
5793 #: ../fish/guestfish-actions.pod:281 ../src/guestfs-actions.pod:413
5795 "Look up the value associated with C<path>. If C<path> matches exactly one "
5796 "node, the C<value> is returned."
5800 #: ../fish/guestfish-actions.pod:284
5805 #: ../fish/guestfish-actions.pod:286
5808 " aug-init root flags\n"
5813 #: ../fish/guestfish-actions.pod:288 ../src/guestfs-actions.pod:428
5815 "Create a new Augeas handle for editing configuration files. If there was "
5816 "any previous Augeas handle associated with this guestfs session, then it is "
5821 #: ../fish/guestfish-actions.pod:292
5822 msgid "You must call this before using any other L</aug-*> commands."
5826 #: ../fish/guestfish-actions.pod:295 ../src/guestfs-actions.pod:435
5827 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5831 #: ../fish/guestfish-actions.pod:298 ../src/guestfs-actions.pod:438
5833 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5834 "logical I<or> of the following integers:"
5838 #: ../fish/guestfish-actions.pod:304 ../src/guestfs-actions.pod:444
5839 msgid "C<AUG_SAVE_BACKUP> = 1"
5843 #: ../fish/guestfish-actions.pod:306 ../src/guestfs-actions.pod:446
5844 msgid "Keep the original file with a C<.augsave> extension."
5848 #: ../fish/guestfish-actions.pod:308 ../src/guestfs-actions.pod:448
5849 msgid "C<AUG_SAVE_NEWFILE> = 2"
5853 #: ../fish/guestfish-actions.pod:310 ../src/guestfs-actions.pod:450
5855 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5856 "original. Overrides C<AUG_SAVE_BACKUP>."
5860 #: ../fish/guestfish-actions.pod:313 ../src/guestfs-actions.pod:453
5861 msgid "C<AUG_TYPE_CHECK> = 4"
5865 #: ../fish/guestfish-actions.pod:315 ../src/guestfs-actions.pod:455
5866 msgid "Typecheck lenses."
5870 #: ../fish/guestfish-actions.pod:317
5872 "This option is only useful when debugging Augeas lenses. Use of this option "
5873 "may require additional memory for the libguestfs appliance. You may need to "
5874 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
5878 #: ../fish/guestfish-actions.pod:322 ../src/guestfs-actions.pod:462
5879 msgid "C<AUG_NO_STDINC> = 8"
5883 #: ../fish/guestfish-actions.pod:324 ../src/guestfs-actions.pod:464
5884 msgid "Do not use standard load path for modules."
5888 #: ../fish/guestfish-actions.pod:326 ../src/guestfs-actions.pod:466
5889 msgid "C<AUG_SAVE_NOOP> = 16"
5893 #: ../fish/guestfish-actions.pod:328 ../src/guestfs-actions.pod:468
5894 msgid "Make save a no-op, just record what would have been changed."
5898 #: ../fish/guestfish-actions.pod:330 ../src/guestfs-actions.pod:470
5899 msgid "C<AUG_NO_LOAD> = 32"
5903 #: ../fish/guestfish-actions.pod:332
5904 msgid "Do not load the tree in L</aug-init>."
5908 #: ../fish/guestfish-actions.pod:336
5909 msgid "To close the handle, you can call L</aug-close>."
5913 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:478
5914 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5918 #: ../fish/guestfish-actions.pod:340
5923 #: ../fish/guestfish-actions.pod:342
5926 " aug-insert augpath label true|false\n"
5931 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:492
5933 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5934 "or after C<path> (depending on the boolean flag C<before>)."
5938 #: ../fish/guestfish-actions.pod:348 ../src/guestfs-actions.pod:496
5940 "C<path> must match exactly one existing node in the tree, and C<label> must "
5941 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5945 #: ../fish/guestfish-actions.pod:352
5950 #: ../fish/guestfish-actions.pod:354
5958 #: ../fish/guestfish-actions.pod:356 ../src/guestfs-actions.pod:509
5959 msgid "Load files into the tree."
5963 #: ../fish/guestfish-actions.pod:358 ../src/guestfs-actions.pod:511
5964 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5968 #: ../fish/guestfish-actions.pod:361
5973 #: ../fish/guestfish-actions.pod:363
5981 #: ../fish/guestfish-actions.pod:365
5983 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
5984 "resulting nodes into alphabetical order."
5988 #: ../fish/guestfish-actions.pod:368
5993 #: ../fish/guestfish-actions.pod:370
5996 " aug-match augpath\n"
6001 #: ../fish/guestfish-actions.pod:372 ../src/guestfs-actions.pod:539
6003 "Returns a list of paths which match the path expression C<path>. The "
6004 "returned paths are sufficiently qualified so that they match exactly one "
6005 "node in the current tree."
6009 #: ../fish/guestfish-actions.pod:376
6014 #: ../fish/guestfish-actions.pod:378
6017 " aug-mv src dest\n"
6022 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:556
6024 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6025 "C<dest> is overwritten if it exists."
6029 #: ../fish/guestfish-actions.pod:383
6034 #: ../fish/guestfish-actions.pod:385
6042 #: ../fish/guestfish-actions.pod:387 ../src/guestfs-actions.pod:569
6043 msgid "Remove C<path> and all of its children."
6047 #: ../fish/guestfish-actions.pod:389 ../src/guestfs-actions.pod:571
6048 msgid "On success this returns the number of entries which were removed."
6052 #: ../fish/guestfish-actions.pod:391
6057 #: ../fish/guestfish-actions.pod:393
6065 #: ../fish/guestfish-actions.pod:395 ../src/guestfs-actions.pod:582
6066 msgid "This writes all pending changes to disk."
6070 #: ../fish/guestfish-actions.pod:397
6072 "The flags which were passed to L</aug-init> affect exactly how files are "
6077 #: ../fish/guestfish-actions.pod:400
6082 #: ../fish/guestfish-actions.pod:402
6085 " aug-set augpath val\n"
6090 #: ../fish/guestfish-actions.pod:404 ../src/guestfs-actions.pod:598
6091 msgid "Set the value associated with C<path> to C<val>."
6095 #: ../fish/guestfish-actions.pod:406
6097 "In the Augeas API, it is possible to clear a node by setting the value to "
6098 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6099 "this call. Instead you must use the L</aug-clear> call."
6103 #: ../fish/guestfish-actions.pod:411
6108 #: ../fish/guestfish-actions.pod:413
6111 " available 'groups ...'\n"
6116 #: ../fish/guestfish-actions.pod:415 ../src/guestfs-actions.pod:615
6118 "This command is used to check the availability of some groups of "
6119 "functionality in the appliance, which not all builds of the libguestfs "
6120 "appliance will be able to provide."
6124 #: ../fish/guestfish-actions.pod:419
6126 "The libguestfs groups, and the functions that those groups correspond to, "
6127 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6128 "runtime by calling L</available-all-groups>."
6132 #: ../fish/guestfish-actions.pod:424 ../src/guestfs-actions.pod:624
6134 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
6135 "\"augeas\"]> would check for the availability of the Linux inotify functions "
6136 "and Augeas (configuration file editing) functions."
6140 #: ../fish/guestfish-actions.pod:429 ../src/guestfs-actions.pod:629
6141 msgid "The command returns no error if I<all> requested groups are available."
6145 #: ../fish/guestfish-actions.pod:431 ../src/guestfs-actions.pod:631
6147 "It fails with an error if one or more of the requested groups is unavailable "
6152 #: ../fish/guestfish-actions.pod:434 ../src/guestfs-actions.pod:634
6154 "If an unknown group name is included in the list of groups then an error is "
6159 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:637
6164 #: ../fish/guestfish-actions.pod:443
6165 msgid "You must call L</launch> before calling this function."
6169 #: ../fish/guestfish-actions.pod:445 ../src/guestfs-actions.pod:645
6171 "The reason is because we don't know what groups are supported by the "
6172 "appliance/daemon until it is running and can be queried."
6176 #: ../fish/guestfish-actions.pod:451 ../src/guestfs-actions.pod:651
6178 "If a group of functions is available, this does not necessarily mean that "
6179 "they will work. You still have to check for errors when calling individual "
6180 "API functions even if they are available."
6184 #: ../fish/guestfish-actions.pod:458 ../src/guestfs-actions.pod:658
6186 "It is usually the job of distro packagers to build complete functionality "
6187 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6188 "with all requirements satisfied, will support everything."
6192 #: ../fish/guestfish-actions.pod:465
6194 "This call was added in version C<1.0.80>. In previous versions of "
6195 "libguestfs all you could do would be to speculatively execute a command to "
6196 "find out if the daemon implemented it. See also L</version>."
6200 #: ../fish/guestfish-actions.pod:472
6201 msgid "available-all-groups"
6205 #: ../fish/guestfish-actions.pod:474
6208 " available-all-groups\n"
6213 #: ../fish/guestfish-actions.pod:476
6215 "This command returns a list of all optional groups that this daemon knows "
6216 "about. Note this returns both supported and unsupported groups. To find "
6217 "out which ones the daemon can actually support you have to call "
6218 "L</available> on each member of the returned list."
6222 #: ../fish/guestfish-actions.pod:482
6223 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6227 #: ../fish/guestfish-actions.pod:484
6232 #: ../fish/guestfish-actions.pod:486
6235 " base64-in (base64file|-) filename\n"
6240 #: ../fish/guestfish-actions.pod:488 ../src/guestfs-actions.pod:702
6241 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
6245 #: ../fish/guestfish-actions.pod:491 ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod:749 ../fish/guestfish-actions.pod:833 ../fish/guestfish-actions.pod:854 ../fish/guestfish-actions.pod:1025 ../fish/guestfish-actions.pod:1044 ../fish/guestfish-actions.pod:1418 ../fish/guestfish-actions.pod:4858 ../fish/guestfish-actions.pod:4870 ../fish/guestfish-actions.pod:4881 ../fish/guestfish-actions.pod:4892 ../fish/guestfish-actions.pod:4944 ../fish/guestfish-actions.pod:4953 ../fish/guestfish-actions.pod:5007 ../fish/guestfish-actions.pod:5030
6246 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6250 #: ../fish/guestfish-actions.pod:493
6255 #: ../fish/guestfish-actions.pod:495
6258 " base64-out filename (base64file|-)\n"
6263 #: ../fish/guestfish-actions.pod:497 ../src/guestfs-actions.pod:716
6265 "This command downloads the contents of C<filename>, writing it out to local "
6266 "file C<base64file> encoded as base64."
6270 #: ../fish/guestfish-actions.pod:502
6271 msgid "blockdev-flushbufs"
6275 #: ../fish/guestfish-actions.pod:504
6278 " blockdev-flushbufs device\n"
6283 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:729
6284 msgid "This tells the kernel to flush internal buffers associated with C<device>."
6288 #: ../fish/guestfish-actions.pod:509 ../fish/guestfish-actions.pod:520 ../fish/guestfish-actions.pod:529 ../fish/guestfish-actions.pod:539 ../fish/guestfish-actions.pod:551 ../fish/guestfish-actions.pod:564 ../fish/guestfish-actions.pod:572 ../fish/guestfish-actions.pod:583 ../fish/guestfish-actions.pod:591 ../fish/guestfish-actions.pod:599 ../src/guestfs-actions.pod:732 ../src/guestfs-actions.pod:749 ../src/guestfs-actions.pod:764 ../src/guestfs-actions.pod:780 ../src/guestfs-actions.pod:798 ../src/guestfs-actions.pod:817 ../src/guestfs-actions.pod:831 ../src/guestfs-actions.pod:849 ../src/guestfs-actions.pod:863 ../src/guestfs-actions.pod:877
6289 msgid "This uses the L<blockdev(8)> command."
6293 #: ../fish/guestfish-actions.pod:511
6294 msgid "blockdev-getbsz"
6298 #: ../fish/guestfish-actions.pod:513
6301 " blockdev-getbsz device\n"
6306 #: ../fish/guestfish-actions.pod:515 ../src/guestfs-actions.pod:744
6307 msgid "This returns the block size of a device."
6311 #: ../fish/guestfish-actions.pod:517 ../fish/guestfish-actions.pod:580 ../src/guestfs-actions.pod:746 ../src/guestfs-actions.pod:846
6313 "(Note this is different from both I<size in blocks> and I<filesystem block "
6318 #: ../fish/guestfish-actions.pod:522
6319 msgid "blockdev-getro"
6323 #: ../fish/guestfish-actions.pod:524
6326 " blockdev-getro device\n"
6331 #: ../fish/guestfish-actions.pod:526 ../src/guestfs-actions.pod:761
6333 "Returns a boolean indicating if the block device is read-only (true if "
6334 "read-only, false if not)."
6338 #: ../fish/guestfish-actions.pod:531
6339 msgid "blockdev-getsize64"
6343 #: ../fish/guestfish-actions.pod:533
6346 " blockdev-getsize64 device\n"
6351 #: ../fish/guestfish-actions.pod:535 ../src/guestfs-actions.pod:776
6352 msgid "This returns the size of the device in bytes."
6356 #: ../fish/guestfish-actions.pod:537
6357 msgid "See also L</blockdev-getsz>."
6361 #: ../fish/guestfish-actions.pod:541
6362 msgid "blockdev-getss"
6366 #: ../fish/guestfish-actions.pod:543
6369 " blockdev-getss device\n"
6374 #: ../fish/guestfish-actions.pod:545 ../src/guestfs-actions.pod:792
6376 "This returns the size of sectors on a block device. Usually 512, but can be "
6377 "larger for modern devices."
6381 #: ../fish/guestfish-actions.pod:548
6382 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
6386 #: ../fish/guestfish-actions.pod:553
6387 msgid "blockdev-getsz"
6391 #: ../fish/guestfish-actions.pod:555
6394 " blockdev-getsz device\n"
6399 #: ../fish/guestfish-actions.pod:557 ../src/guestfs-actions.pod:810
6401 "This returns the size of the device in units of 512-byte sectors (even if "
6402 "the sectorsize isn't 512 bytes ... weird)."
6406 #: ../fish/guestfish-actions.pod:560
6408 "See also L</blockdev-getss> for the real sector size of the device, and "
6409 "L</blockdev-getsize64> for the more useful I<size in bytes>."
6413 #: ../fish/guestfish-actions.pod:566
6414 msgid "blockdev-rereadpt"
6418 #: ../fish/guestfish-actions.pod:568
6421 " blockdev-rereadpt device\n"
6426 #: ../fish/guestfish-actions.pod:570 ../src/guestfs-actions.pod:829
6427 msgid "Reread the partition table on C<device>."
6431 #: ../fish/guestfish-actions.pod:574
6432 msgid "blockdev-setbsz"
6436 #: ../fish/guestfish-actions.pod:576
6439 " blockdev-setbsz device blocksize\n"
6444 #: ../fish/guestfish-actions.pod:578 ../src/guestfs-actions.pod:844
6445 msgid "This sets the block size of a device."
6449 #: ../fish/guestfish-actions.pod:585
6450 msgid "blockdev-setro"
6454 #: ../fish/guestfish-actions.pod:587
6457 " blockdev-setro device\n"
6462 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:861
6463 msgid "Sets the block device named C<device> to read-only."
6467 #: ../fish/guestfish-actions.pod:593
6468 msgid "blockdev-setrw"
6472 #: ../fish/guestfish-actions.pod:595
6475 " blockdev-setrw device\n"
6480 #: ../fish/guestfish-actions.pod:597 ../src/guestfs-actions.pod:875
6481 msgid "Sets the block device named C<device> to read-write."
6485 #: ../fish/guestfish-actions.pod:601
6486 msgid "btrfs-filesystem-resize"
6490 #: ../fish/guestfish-actions.pod:603
6493 " btrfs-filesystem-resize mountpoint [size:N]\n"
6498 #: ../fish/guestfish-actions.pod:605 ../src/guestfs-actions.pod:897
6499 msgid "This command resizes a btrfs filesystem."
6503 #: ../fish/guestfish-actions.pod:607 ../src/guestfs-actions.pod:899
6505 "Note that unlike other resize calls, the filesystem has to be mounted and "
6506 "the parameter is the mountpoint not the device (this is a requirement of "
6511 #: ../fish/guestfish-actions.pod:611 ../fish/guestfish-actions.pod:3606 ../src/guestfs-actions.pod:903 ../src/guestfs-actions.pod:5637
6512 msgid "The optional parameters are:"
6516 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3610 ../src/guestfs-actions.pod:907 ../src/guestfs-actions.pod:5641
6521 #: ../fish/guestfish-actions.pod:617 ../src/guestfs-actions.pod:909
6523 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
6524 "resized to the maximum size."
6528 #: ../fish/guestfish-actions.pod:622 ../src/guestfs-actions.pod:914
6529 msgid "See also L<btrfs(8)>."
6533 #: ../fish/guestfish-actions.pod:626
6534 msgid "case-sensitive-path"
6538 #: ../fish/guestfish-actions.pod:628
6541 " case-sensitive-path path\n"
6546 #: ../fish/guestfish-actions.pod:630 ../src/guestfs-actions.pod:948
6548 "This can be used to resolve case insensitive paths on a filesystem which is "
6549 "case sensitive. The use case is to resolve paths which you have read from "
6550 "Windows configuration files or the Windows Registry, to the true path."
6554 #: ../fish/guestfish-actions.pod:635 ../src/guestfs-actions.pod:953
6556 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6557 "(and probably others), which is that although the underlying filesystem is "
6558 "case-insensitive, the driver exports the filesystem to Linux as "
6563 #: ../fish/guestfish-actions.pod:640 ../src/guestfs-actions.pod:958
6565 "One consequence of this is that special directories such as C<c:\\windows> "
6566 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6567 "precise details of how they were created. In Windows itself this would not "
6572 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:964
6574 "Bug or feature? You decide: "
6575 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
6579 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:967
6581 "This function resolves the true case of each element in the path and returns "
6582 "the case-sensitive path."
6586 #: ../fish/guestfish-actions.pod:652
6588 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
6589 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
6590 "how the directories were originally created under Windows)."
6594 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:975
6595 msgid "I<Note>: This function does not handle drive names, backslashes etc."
6599 #: ../fish/guestfish-actions.pod:660
6600 msgid "See also L</realpath>."
6604 #: ../fish/guestfish-actions.pod:662
6609 #: ../fish/guestfish-actions.pod:664
6617 #: ../fish/guestfish-actions.pod:666 ../fish/guestfish-actions.pod:4037 ../src/guestfs-actions.pod:991 ../src/guestfs-actions.pod:6297
6618 msgid "Return the contents of the file named C<path>."
6622 #: ../fish/guestfish-actions.pod:668
6624 "Note that this function cannot correctly handle binary files (specifically, "
6625 "files containing C<\\0> character which is treated as end of string). For "
6626 "those you need to use the L</read-file> or L</download> functions which have "
6627 "a more complex interface."
6631 #: ../fish/guestfish-actions.pod:673 ../fish/guestfish-actions.pod:808 ../fish/guestfish-actions.pod:820 ../fish/guestfish-actions.pod:1103 ../fish/guestfish-actions.pod:1113 ../fish/guestfish-actions.pod:1180 ../fish/guestfish-actions.pod:1190 ../fish/guestfish-actions.pod:1382 ../fish/guestfish-actions.pod:1695 ../fish/guestfish-actions.pod:1705 ../fish/guestfish-actions.pod:1755 ../fish/guestfish-actions.pod:1770 ../fish/guestfish-actions.pod:1780 ../fish/guestfish-actions.pod:1799 ../fish/guestfish-actions.pod:3907 ../fish/guestfish-actions.pod:3922 ../fish/guestfish-actions.pod:3998 ../fish/guestfish-actions.pod:4015 ../fish/guestfish-actions.pod:4030 ../fish/guestfish-actions.pod:4699 ../fish/guestfish-actions.pod:4745 ../fish/guestfish-actions.pod:4830 ../fish/guestfish-actions.pod:4845 ../fish/guestfish-actions.pod:5251 ../fish/guestfish-actions.pod:5263 ../fish/guestfish-actions.pod:5281 ../fish/guestfish-actions.pod:5298 ../fish/guestfish-actions.pod:5308 ../fish/guestfish-actions.pod:5362 ../fish/guestfish-actions.pod:5372 ../fish/guestfish-actions.pod:5401 ../fish/guestfish-actions.pod:5411 ../src/guestfs-actions.pod:1001 ../src/guestfs-actions.pod:1180 ../src/guestfs-actions.pod:1200 ../src/guestfs-actions.pod:1855 ../src/guestfs-actions.pod:1874 ../src/guestfs-actions.pod:1977 ../src/guestfs-actions.pod:1996 ../src/guestfs-actions.pod:2242 ../src/guestfs-actions.pod:2724 ../src/guestfs-actions.pod:2743 ../src/guestfs-actions.pod:2808 ../src/guestfs-actions.pod:2832 ../src/guestfs-actions.pod:2849 ../src/guestfs-actions.pod:2878 ../src/guestfs-actions.pod:6079 ../src/guestfs-actions.pod:6105 ../src/guestfs-actions.pod:6236 ../src/guestfs-actions.pod:6262 ../src/guestfs-actions.pod:6286 ../src/guestfs-actions.pod:7241 ../src/guestfs-actions.pod:7296 ../src/guestfs-actions.pod:7442 ../src/guestfs-actions.pod:7466 ../src/guestfs-actions.pod:8131 ../src/guestfs-actions.pod:8151 ../src/guestfs-actions.pod:8184 ../src/guestfs-actions.pod:8203 ../src/guestfs-actions.pod:8222 ../src/guestfs-actions.pod:8313 ../src/guestfs-actions.pod:8332 ../src/guestfs-actions.pod:8378 ../src/guestfs-actions.pod:8397
6633 "Because of the message protocol, there is a transfer limit of somewhere "
6634 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6638 #: ../fish/guestfish-actions.pod:676
6643 #: ../fish/guestfish-actions.pod:678
6646 " checksum csumtype path\n"
6651 #: ../fish/guestfish-actions.pod:680 ../src/guestfs-actions.pod:1013
6652 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6656 #: ../fish/guestfish-actions.pod:683 ../src/guestfs-actions.pod:1016
6658 "The type of checksum to compute is given by the C<csumtype> parameter which "
6659 "must have one of the following values:"
6663 #: ../fish/guestfish-actions.pod:688 ../src/guestfs-actions.pod:1021
6668 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1023
6670 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6675 #: ../fish/guestfish-actions.pod:693 ../src/guestfs-actions.pod:1026
6680 #: ../fish/guestfish-actions.pod:695 ../src/guestfs-actions.pod:1028
6681 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6685 #: ../fish/guestfish-actions.pod:697 ../src/guestfs-actions.pod:1030
6690 #: ../fish/guestfish-actions.pod:699 ../src/guestfs-actions.pod:1032
6691 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6695 #: ../fish/guestfish-actions.pod:701 ../src/guestfs-actions.pod:1034
6700 #: ../fish/guestfish-actions.pod:703 ../src/guestfs-actions.pod:1036
6701 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6705 #: ../fish/guestfish-actions.pod:705 ../src/guestfs-actions.pod:1038
6710 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1040
6711 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6715 #: ../fish/guestfish-actions.pod:709 ../src/guestfs-actions.pod:1042
6720 #: ../fish/guestfish-actions.pod:711 ../src/guestfs-actions.pod:1044
6721 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6725 #: ../fish/guestfish-actions.pod:713 ../src/guestfs-actions.pod:1046
6730 #: ../fish/guestfish-actions.pod:715 ../src/guestfs-actions.pod:1048
6731 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6735 #: ../fish/guestfish-actions.pod:719 ../src/guestfs-actions.pod:1052
6736 msgid "The checksum is returned as a printable string."
6740 #: ../fish/guestfish-actions.pod:721
6741 msgid "To get the checksum for a device, use L</checksum-device>."
6745 #: ../fish/guestfish-actions.pod:723
6746 msgid "To get the checksums for many files, use L</checksums-out>."
6750 #: ../fish/guestfish-actions.pod:725
6751 msgid "checksum-device"
6755 #: ../fish/guestfish-actions.pod:727
6758 " checksum-device csumtype device\n"
6763 #: ../fish/guestfish-actions.pod:729
6765 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6766 "device named C<device>. For the types of checksums supported see the "
6767 "L</checksum> command."
6771 #: ../fish/guestfish-actions.pod:733
6772 msgid "checksums-out"
6776 #: ../fish/guestfish-actions.pod:735
6779 " checksums-out csumtype directory (sumsfile|-)\n"
6784 #: ../fish/guestfish-actions.pod:737 ../src/guestfs-actions.pod:1087
6786 "This command computes the checksums of all regular files in C<directory> and "
6787 "then emits a list of those checksums to the local output file C<sumsfile>."
6791 #: ../fish/guestfish-actions.pod:741 ../src/guestfs-actions.pod:1091
6793 "This can be used for verifying the integrity of a virtual machine. However "
6794 "to be properly secure you should pay attention to the output of the checksum "
6795 "command (it uses the ones from GNU coreutils). In particular when the "
6796 "filename is not printable, coreutils uses a special backslash syntax. For "
6797 "more information, see the GNU coreutils info file."
6801 #: ../fish/guestfish-actions.pod:751
6806 #: ../fish/guestfish-actions.pod:753
6809 " chmod mode path\n"
6814 #: ../fish/guestfish-actions.pod:755 ../src/guestfs-actions.pod:1110
6816 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6821 #: ../fish/guestfish-actions.pod:758 ../src/guestfs-actions.pod:1113
6823 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6824 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6829 #: ../fish/guestfish-actions.pod:762 ../fish/guestfish-actions.pod:3259 ../fish/guestfish-actions.pod:3398 ../fish/guestfish-actions.pod:3408 ../fish/guestfish-actions.pod:3418 ../src/guestfs-actions.pod:1117 ../src/guestfs-actions.pod:5044 ../src/guestfs-actions.pod:5253 ../src/guestfs-actions.pod:5272 ../src/guestfs-actions.pod:5291
6830 msgid "The mode actually set is affected by the umask."
6834 #: ../fish/guestfish-actions.pod:764
6839 #: ../fish/guestfish-actions.pod:766
6842 " chown owner group path\n"
6847 #: ../fish/guestfish-actions.pod:768 ../src/guestfs-actions.pod:1131
6848 msgid "Change the file owner to C<owner> and group to C<group>."
6852 #: ../fish/guestfish-actions.pod:770 ../fish/guestfish-actions.pod:2703 ../src/guestfs-actions.pod:1133 ../src/guestfs-actions.pod:4124
6854 "Only numeric uid and gid are supported. If you want to use names, you will "
6855 "need to locate and parse the password file yourself (Augeas support makes "
6856 "this relatively easy)."
6860 #: ../fish/guestfish-actions.pod:774
6865 #: ../fish/guestfish-actions.pod:776
6868 " command 'arguments ...'\n"
6873 #: ../fish/guestfish-actions.pod:778 ../src/guestfs-actions.pod:1147
6875 "This call runs a command from the guest filesystem. The filesystem must be "
6876 "mounted, and must contain a compatible operating system (ie. something "
6877 "Linux, with the same or compatible processor architecture)."
6881 #: ../fish/guestfish-actions.pod:783
6883 "The single parameter is an argv-style list of arguments. The first element "
6884 "is the name of the program to run. Subsequent elements are parameters. The "
6885 "list must be non-empty (ie. must contain a program name). Note that the "
6886 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
6890 #: ../fish/guestfish-actions.pod:790 ../src/guestfs-actions.pod:1159
6891 msgid "The return value is anything printed to I<stdout> by the command."
6895 #: ../fish/guestfish-actions.pod:793 ../src/guestfs-actions.pod:1162
6897 "If the command returns a non-zero exit status, then this function returns an "
6898 "error message. The error message string is the content of I<stderr> from "
6903 #: ../fish/guestfish-actions.pod:797 ../src/guestfs-actions.pod:1166
6905 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
6906 "C</bin>. If you require a program from another location, you should provide "
6907 "the full path in the first parameter."
6911 #: ../fish/guestfish-actions.pod:802 ../src/guestfs-actions.pod:1171
6913 "Shared libraries and data files required by the program must be available on "
6914 "filesystems which are mounted in the correct places. It is the caller's "
6915 "responsibility to ensure all filesystems that are needed are mounted at the "
6920 #: ../fish/guestfish-actions.pod:811
6921 msgid "command-lines"
6925 #: ../fish/guestfish-actions.pod:813
6928 " command-lines 'arguments ...'\n"
6933 #: ../fish/guestfish-actions.pod:815
6934 msgid "This is the same as L</command>, but splits the result into a list of lines."
6938 #: ../fish/guestfish-actions.pod:818
6939 msgid "See also: L</sh-lines>"
6943 #: ../fish/guestfish-actions.pod:823
6944 msgid "compress-device-out"
6948 #: ../fish/guestfish-actions.pod:825
6951 " compress-device-out ctype device (zdevice|-) [level:N]\n"
6956 #: ../fish/guestfish-actions.pod:827 ../src/guestfs-actions.pod:1221
6958 "This command compresses C<device> and writes it out to the local file "
6963 #: ../fish/guestfish-actions.pod:830
6965 "The C<ctype> and optional C<level> parameters have the same meaning as in "
6970 #: ../fish/guestfish-actions.pod:837
6971 msgid "compress-out"
6975 #: ../fish/guestfish-actions.pod:839
6978 " compress-out ctype file (zfile|-) [level:N]\n"
6983 #: ../fish/guestfish-actions.pod:841 ../src/guestfs-actions.pod:1273
6985 "This command compresses C<file> and writes it out to the local file "
6990 #: ../fish/guestfish-actions.pod:844 ../src/guestfs-actions.pod:1276
6992 "The compression program used is controlled by the C<ctype> parameter. "
6993 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
6994 "Some compression types may not be supported by particular builds of "
6995 "libguestfs, in which case you will get an error containing the substring "
6996 "\"not supported\"."
7000 #: ../fish/guestfish-actions.pod:850 ../src/guestfs-actions.pod:1282
7002 "The optional C<level> parameter controls compression level. The meaning and "
7003 "default for this parameter depends on the compression program being used."
7007 #: ../fish/guestfish-actions.pod:858
7012 #: ../fish/guestfish-actions.pod:860
7015 " config qemuparam qemuvalue\n"
7020 #: ../fish/guestfish-actions.pod:862 ../src/guestfs-actions.pod:1323
7022 "This can be used to add arbitrary qemu command line parameters of the form "
7023 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
7024 "setting some parameters which would interfere with parameters that we use."
7028 #: ../fish/guestfish-actions.pod:867 ../src/guestfs-actions.pod:1328
7029 msgid "The first character of C<param> string must be a C<-> (dash)."
7033 #: ../fish/guestfish-actions.pod:869 ../src/guestfs-actions.pod:1330
7034 msgid "C<value> can be NULL."
7038 #: ../fish/guestfish-actions.pod:871
7039 msgid "copy-device-to-device"
7043 #: ../fish/guestfish-actions.pod:873
7046 " copy-device-to-device src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7051 #: ../fish/guestfish-actions.pod:875
7053 "The four calls L</copy-device-to-device>, L</copy-device-to-file>, "
7054 "L</copy-file-to-device>, and L</copy-file-to-file> let you copy from a "
7055 "source (device|file) to a destination (device|file)."
7059 #: ../fish/guestfish-actions.pod:882 ../src/guestfs-actions.pod:1360
7061 "Partial copies can be made since you can specify optionally the source "
7062 "offset, destination offset and size to copy. These values are all specified "
7063 "in bytes. If not given, the offsets both default to zero, and the size "
7064 "defaults to copying as much as possible until we hit the end of the source."
7068 #: ../fish/guestfish-actions.pod:888 ../src/guestfs-actions.pod:1366
7070 "The source and destination may be the same object. However overlapping "
7071 "regions may not be copied correctly."
7075 #: ../fish/guestfish-actions.pod:891 ../src/guestfs-actions.pod:1369
7077 "If the destination is a file, it is created if required. If the destination "
7078 "file is not large enough, it is extended."
7082 #: ../fish/guestfish-actions.pod:896
7083 msgid "copy-device-to-file"
7087 #: ../fish/guestfish-actions.pod:898
7090 " copy-device-to-file src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7095 #: ../fish/guestfish-actions.pod:900 ../fish/guestfish-actions.pod:909 ../fish/guestfish-actions.pod:918
7096 msgid "See L</copy-device-to-device> for a general overview of this call."
7100 #: ../fish/guestfish-actions.pod:905
7101 msgid "copy-file-to-device"
7105 #: ../fish/guestfish-actions.pod:907
7108 " copy-file-to-device src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7113 #: ../fish/guestfish-actions.pod:914
7114 msgid "copy-file-to-file"
7118 #: ../fish/guestfish-actions.pod:916
7121 " copy-file-to-file src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7126 #: ../fish/guestfish-actions.pod:921
7128 "This is B<not> the function you want for copying files. This is for copying "
7129 "blocks within existing files. See L</cp>, L</cp-a> and L</mv> for general "
7130 "file copying and moving functions."
7134 #: ../fish/guestfish-actions.pod:928
7139 #: ../fish/guestfish-actions.pod:930
7142 " copy-size src dest size\n"
7147 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1584
7149 "This command copies exactly C<size> bytes from one source device or file "
7150 "C<src> to another destination device or file C<dest>."
7154 #: ../fish/guestfish-actions.pod:935 ../src/guestfs-actions.pod:1587
7156 "Note this will fail if the source is too short or if the destination is not "
7161 #: ../fish/guestfish-actions.pod:938 ../fish/guestfish-actions.pod:973
7163 "I<This function is deprecated.> In new code, use the "
7164 "L</copy_device_to_device> call instead."
7168 #: ../fish/guestfish-actions.pod:945
7173 #: ../fish/guestfish-actions.pod:947
7181 #: ../fish/guestfish-actions.pod:949 ../src/guestfs-actions.pod:1606
7183 "This copies a file from C<src> to C<dest> where C<dest> is either a "
7184 "destination filename or destination directory."
7188 #: ../fish/guestfish-actions.pod:952
7193 #: ../fish/guestfish-actions.pod:954
7201 #: ../fish/guestfish-actions.pod:956 ../src/guestfs-actions.pod:1620
7203 "This copies a file or directory from C<src> to C<dest> recursively using the "
7208 #: ../fish/guestfish-actions.pod:959
7213 #: ../fish/guestfish-actions.pod:961
7221 #: ../fish/guestfish-actions.pod:963 ../src/guestfs-actions.pod:1641
7223 "This command copies from one source device or file C<src> to another "
7224 "destination device or file C<dest>. Normally you would use this to copy to "
7225 "or from a device or partition, for example to duplicate a filesystem."
7229 #: ../fish/guestfish-actions.pod:968
7231 "If the destination is a device, it must be as large or larger than the "
7232 "source file or device, otherwise the copy will fail. This command cannot do "
7233 "partial copies (see L</copy-device-to-device>)."
7237 #: ../fish/guestfish-actions.pod:980
7242 #: ../fish/guestfish-actions.pod:982
7250 #: ../fish/guestfish-actions.pod:984 ../src/guestfs-actions.pod:1660
7251 msgid "This command runs the C<df> command to report disk space used."
7255 #: ../fish/guestfish-actions.pod:986 ../fish/guestfish-actions.pod:997
7257 "This command is mostly useful for interactive sessions. It is I<not> "
7258 "intended that you try to parse the output string. Use L</statvfs> from "
7263 #: ../fish/guestfish-actions.pod:990
7268 #: ../fish/guestfish-actions.pod:992
7276 #: ../fish/guestfish-actions.pod:994 ../src/guestfs-actions.pod:1676
7278 "This command runs the C<df -h> command to report disk space used in "
7279 "human-readable format."
7283 #: ../fish/guestfish-actions.pod:1001
7288 #: ../fish/guestfish-actions.pod:1003
7296 #: ../fish/guestfish-actions.pod:1005 ../src/guestfs-actions.pod:1693
7298 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7299 "This is sometimes useful for extended debugging of problems."
7303 #: ../fish/guestfish-actions.pod:1009
7305 "Another way to get the same information is to enable verbose messages with "
7306 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
7307 "before running the program."
7311 #: ../fish/guestfish-actions.pod:1014
7316 #: ../fish/guestfish-actions.pod:1016
7319 " download remotefilename (filename|-)\n"
7324 #: ../fish/guestfish-actions.pod:1018 ../fish/guestfish-actions.pod:1031 ../src/guestfs-actions.pod:1714 ../src/guestfs-actions.pod:1739
7326 "Download file C<remotefilename> and save it as C<filename> on the local "
7331 #: ../fish/guestfish-actions.pod:1021 ../fish/guestfish-actions.pod:5003 ../src/guestfs-actions.pod:1717 ../src/guestfs-actions.pod:7701
7332 msgid "C<filename> can also be a named pipe."
7336 #: ../fish/guestfish-actions.pod:1023
7337 msgid "See also L</upload>, L</cat>."
7341 #: ../fish/guestfish-actions.pod:1027
7342 msgid "download-offset"
7346 #: ../fish/guestfish-actions.pod:1029
7349 " download-offset remotefilename (filename|-) offset size\n"
7354 #: ../fish/guestfish-actions.pod:1034 ../src/guestfs-actions.pod:1742
7356 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7357 "region must be within the file or device)."
7361 #: ../fish/guestfish-actions.pod:1037
7363 "Note that there is no limit on the amount of data that can be downloaded "
7364 "with this call, unlike with L</pread>, and this call always reads the full "
7365 "amount unless an error occurs."
7369 #: ../fish/guestfish-actions.pod:1042
7370 msgid "See also L</download>, L</pread>."
7374 #: ../fish/guestfish-actions.pod:1046
7379 #: ../fish/guestfish-actions.pod:1048
7382 " drop-caches whattodrop\n"
7387 #: ../fish/guestfish-actions.pod:1050 ../src/guestfs-actions.pod:1767
7389 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7390 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7391 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7395 #: ../fish/guestfish-actions.pod:1055 ../src/guestfs-actions.pod:1772
7396 msgid "Setting C<whattodrop> to 3 should drop everything."
7400 #: ../fish/guestfish-actions.pod:1057 ../src/guestfs-actions.pod:1774
7402 "This automatically calls L<sync(2)> before the operation, so that the "
7403 "maximum guest memory is freed."
7407 #: ../fish/guestfish-actions.pod:1060
7412 #: ../fish/guestfish-actions.pod:1062
7420 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1787
7422 "This command runs the C<du -s> command to estimate file space usage for "
7427 #: ../fish/guestfish-actions.pod:1067 ../src/guestfs-actions.pod:1790
7429 "C<path> can be a file or a directory. If C<path> is a directory then the "
7430 "estimate includes the contents of the directory and all subdirectories "
7435 #: ../fish/guestfish-actions.pod:1071 ../src/guestfs-actions.pod:1794
7436 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7440 #: ../fish/guestfish-actions.pod:1074
7445 #: ../fish/guestfish-actions.pod:1076
7448 " e2fsck-f device\n"
7453 #: ../fish/guestfish-actions.pod:1078 ../src/guestfs-actions.pod:1812
7455 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7456 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
7461 #: ../fish/guestfish-actions.pod:1082
7463 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
7464 "should use L</fsck>."
7468 #: ../fish/guestfish-actions.pod:1085
7473 #: ../fish/guestfish-actions.pod:1087
7476 " echo-daemon 'words ...'\n"
7481 #: ../fish/guestfish-actions.pod:1089 ../src/guestfs-actions.pod:1829
7483 "This command concatenates the list of C<words> passed with single spaces "
7484 "between them and returns the resulting string."
7488 #: ../fish/guestfish-actions.pod:1092 ../src/guestfs-actions.pod:1832
7489 msgid "You can use this command to test the connection through to the daemon."
7493 #: ../fish/guestfish-actions.pod:1094
7494 msgid "See also L</ping-daemon>."
7498 #: ../fish/guestfish-actions.pod:1096
7503 #: ../fish/guestfish-actions.pod:1098
7506 " egrep regex path\n"
7511 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1848
7512 msgid "This calls the external C<egrep> program and returns the matching lines."
7516 #: ../fish/guestfish-actions.pod:1106
7521 #: ../fish/guestfish-actions.pod:1108
7524 " egrepi regex path\n"
7529 #: ../fish/guestfish-actions.pod:1110 ../src/guestfs-actions.pod:1867
7530 msgid "This calls the external C<egrep -i> program and returns the matching lines."
7534 #: ../fish/guestfish-actions.pod:1116
7539 #: ../fish/guestfish-actions.pod:1118
7542 " equal file1 file2\n"
7547 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1886
7549 "This compares the two files C<file1> and C<file2> and returns true if their "
7550 "content is exactly equal, or false otherwise."
7554 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1889
7555 msgid "The external L<cmp(1)> program is used for the comparison."
7559 #: ../fish/guestfish-actions.pod:1125
7564 #: ../fish/guestfish-actions.pod:1127
7572 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1901
7574 "This returns C<true> if and only if there is a file, directory (or anything) "
7575 "with the given C<path> name."
7579 #: ../fish/guestfish-actions.pod:1132
7580 msgid "See also L</is-file>, L</is-dir>, L</stat>."
7584 #: ../fish/guestfish-actions.pod:1134
7589 #: ../fish/guestfish-actions.pod:1136
7592 " fallocate path len\n"
7597 #: ../fish/guestfish-actions.pod:1138 ../fish/guestfish-actions.pod:1157 ../src/guestfs-actions.pod:1924 ../src/guestfs-actions.pod:1943
7599 "This command preallocates a file (containing zero bytes) named C<path> of "
7600 "size C<len> bytes. If the file exists already, it is overwritten."
7604 #: ../fish/guestfish-actions.pod:1142 ../src/guestfs-actions.pod:1928
7606 "Do not confuse this with the guestfish-specific C<alloc> command which "
7607 "allocates a file in the host and attaches it as a device."
7611 #: ../fish/guestfish-actions.pod:1146
7613 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
7618 #: ../fish/guestfish-actions.pod:1153
7623 #: ../fish/guestfish-actions.pod:1155
7626 " fallocate64 path len\n"
7631 #: ../fish/guestfish-actions.pod:1161
7633 "Note that this call allocates disk blocks for the file. To create a sparse "
7634 "file use L</truncate-size> instead."
7638 #: ../fish/guestfish-actions.pod:1164
7640 "The deprecated call L</fallocate> does the same, but owing to an oversight "
7641 "it only allowed 30 bit lengths to be specified, effectively limiting the "
7642 "maximum size of files created through that call to 1GB."
7646 #: ../fish/guestfish-actions.pod:1169 ../src/guestfs-actions.pod:1955
7648 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
7649 "commands which create a file in the host and attach it as a device."
7653 #: ../fish/guestfish-actions.pod:1173
7658 #: ../fish/guestfish-actions.pod:1175
7661 " fgrep pattern path\n"
7666 #: ../fish/guestfish-actions.pod:1177 ../src/guestfs-actions.pod:1970
7667 msgid "This calls the external C<fgrep> program and returns the matching lines."
7671 #: ../fish/guestfish-actions.pod:1183
7676 #: ../fish/guestfish-actions.pod:1185
7679 " fgrepi pattern path\n"
7684 #: ../fish/guestfish-actions.pod:1187 ../src/guestfs-actions.pod:1989
7685 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
7689 #: ../fish/guestfish-actions.pod:1193
7694 #: ../fish/guestfish-actions.pod:1195
7702 #: ../fish/guestfish-actions.pod:1197 ../src/guestfs-actions.pod:2007
7704 "This call uses the standard L<file(1)> command to determine the type or "
7705 "contents of the file."
7709 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:2010
7711 "This call will also transparently look inside various types of compressed "
7716 #: ../fish/guestfish-actions.pod:1203 ../src/guestfs-actions.pod:2013
7718 "The exact command which runs is C<file -zb path>. Note in particular that "
7719 "the filename is not prepended to the output (the I<-b> option)."
7723 #: ../fish/guestfish-actions.pod:1207 ../src/guestfs-actions.pod:2017
7725 "The output depends on the output of the underlying L<file(1)> command and it "
7726 "can change in future in ways beyond our control. In other words, the output "
7727 "is not guaranteed by the ABI."
7731 #: ../fish/guestfish-actions.pod:1211
7733 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
7734 "(etc), L</is-zero>."
7738 #: ../fish/guestfish-actions.pod:1214
7739 msgid "file-architecture"
7743 #: ../fish/guestfish-actions.pod:1216
7746 " file-architecture filename\n"
7751 #: ../fish/guestfish-actions.pod:1218 ../src/guestfs-actions.pod:2035
7753 "This detects the architecture of the binary C<filename>, and returns it if "
7758 #: ../fish/guestfish-actions.pod:1221 ../src/guestfs-actions.pod:2038
7759 msgid "Currently defined architectures are:"
7763 #: ../fish/guestfish-actions.pod:1225 ../src/guestfs-actions.pod:2042
7768 #: ../fish/guestfish-actions.pod:1227 ../src/guestfs-actions.pod:2044
7770 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7771 "irrespective of the precise processor requirements of the binary."
7775 #: ../fish/guestfish-actions.pod:1230 ../src/guestfs-actions.pod:2047
7780 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:2049
7781 msgid "64 bit x86-64."
7785 #: ../fish/guestfish-actions.pod:1234 ../src/guestfs-actions.pod:2051
7790 #: ../fish/guestfish-actions.pod:1236 ../src/guestfs-actions.pod:2053
7791 msgid "32 bit SPARC."
7795 #: ../fish/guestfish-actions.pod:1238 ../src/guestfs-actions.pod:2055
7800 #: ../fish/guestfish-actions.pod:1240 ../src/guestfs-actions.pod:2057
7801 msgid "64 bit SPARC V9 and above."
7805 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:2059
7810 #: ../fish/guestfish-actions.pod:1244 ../src/guestfs-actions.pod:2061
7811 msgid "Intel Itanium."
7815 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:2063
7820 #: ../fish/guestfish-actions.pod:1248 ../src/guestfs-actions.pod:2065
7821 msgid "32 bit Power PC."
7825 #: ../fish/guestfish-actions.pod:1250 ../src/guestfs-actions.pod:2067
7830 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:2069
7831 msgid "64 bit Power PC."
7835 #: ../fish/guestfish-actions.pod:1256 ../src/guestfs-actions.pod:2073
7836 msgid "Libguestfs may return other architecture strings in future."
7840 #: ../fish/guestfish-actions.pod:1258 ../src/guestfs-actions.pod:2075
7841 msgid "The function works on at least the following types of files:"
7845 #: ../fish/guestfish-actions.pod:1264 ../src/guestfs-actions.pod:2081
7846 msgid "many types of Un*x and Linux binary"
7850 #: ../fish/guestfish-actions.pod:1268 ../src/guestfs-actions.pod:2085
7851 msgid "many types of Un*x and Linux shared library"
7855 #: ../fish/guestfish-actions.pod:1272 ../src/guestfs-actions.pod:2089
7856 msgid "Windows Win32 and Win64 binaries"
7860 #: ../fish/guestfish-actions.pod:1276 ../src/guestfs-actions.pod:2093
7861 msgid "Windows Win32 and Win64 DLLs"
7865 #: ../fish/guestfish-actions.pod:1278 ../src/guestfs-actions.pod:2095
7866 msgid "Win32 binaries and DLLs return C<i386>."
7870 #: ../fish/guestfish-actions.pod:1280 ../src/guestfs-actions.pod:2097
7871 msgid "Win64 binaries and DLLs return C<x86_64>."
7875 #: ../fish/guestfish-actions.pod:1284 ../src/guestfs-actions.pod:2101
7876 msgid "Linux kernel modules"
7880 #: ../fish/guestfish-actions.pod:1288 ../src/guestfs-actions.pod:2105
7881 msgid "Linux new-style initrd images"
7885 #: ../fish/guestfish-actions.pod:1292 ../src/guestfs-actions.pod:2109
7886 msgid "some non-x86 Linux vmlinuz kernels"
7890 #: ../fish/guestfish-actions.pod:1296 ../src/guestfs-actions.pod:2113
7891 msgid "What it can't do currently:"
7895 #: ../fish/guestfish-actions.pod:1302 ../src/guestfs-actions.pod:2119
7896 msgid "static libraries (libfoo.a)"
7900 #: ../fish/guestfish-actions.pod:1306 ../src/guestfs-actions.pod:2123
7901 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7905 #: ../fish/guestfish-actions.pod:1310 ../src/guestfs-actions.pod:2127
7906 msgid "x86 Linux vmlinuz kernels"
7910 #: ../fish/guestfish-actions.pod:1312 ../src/guestfs-actions.pod:2129
7912 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7913 "compressed code, and are horribly hard to unpack. If you want to find the "
7914 "architecture of a kernel, use the architecture of the associated initrd or "
7915 "kernel module(s) instead."
7919 #: ../fish/guestfish-actions.pod:1319
7924 #: ../fish/guestfish-actions.pod:1321
7932 #: ../fish/guestfish-actions.pod:1323 ../src/guestfs-actions.pod:2147
7933 msgid "This command returns the size of C<file> in bytes."
7937 #: ../fish/guestfish-actions.pod:1325
7939 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
7940 "L</is-file> etc. To get the size of block devices, use "
7941 "L</blockdev-getsize64>."
7945 #: ../fish/guestfish-actions.pod:1329
7950 #: ../fish/guestfish-actions.pod:1331
7953 " fill c len path\n"
7958 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:2165
7960 "This command creates a new file called C<path>. The initial content of the "
7961 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
7966 #: ../fish/guestfish-actions.pod:1337
7968 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7969 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
7974 #: ../fish/guestfish-actions.pod:1342
7975 msgid "fill-pattern"
7979 #: ../fish/guestfish-actions.pod:1344
7982 " fill-pattern pattern len path\n"
7987 #: ../fish/guestfish-actions.pod:1346
7989 "This function is like L</fill> except that it creates a new file of length "
7990 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
7991 "is truncated if necessary to ensure the length of the file is exactly C<len> "
7996 #: ../fish/guestfish-actions.pod:1351
8001 #: ../fish/guestfish-actions.pod:1353
8009 #: ../fish/guestfish-actions.pod:1355 ../src/guestfs-actions.pod:2211
8011 "This command lists out all files and directories, recursively, starting at "
8012 "C<directory>. It is essentially equivalent to running the shell command "
8013 "C<find directory -print> but some post-processing happens on the output, "
8018 #: ../fish/guestfish-actions.pod:1360 ../src/guestfs-actions.pod:2216
8020 "This returns a list of strings I<without any prefix>. Thus if the directory "
8025 #: ../fish/guestfish-actions.pod:1363 ../src/guestfs-actions.pod:2219
8035 #: ../fish/guestfish-actions.pod:1367
8036 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
8040 #: ../fish/guestfish-actions.pod:1370 ../src/guestfs-actions.pod:2226
8051 #: ../fish/guestfish-actions.pod:1375 ../src/guestfs-actions.pod:2231
8052 msgid "If C<directory> is not a directory, then this command returns an error."
8056 #: ../fish/guestfish-actions.pod:1378 ../src/guestfs-actions.pod:2234
8057 msgid "The returned list is sorted."
8061 #: ../fish/guestfish-actions.pod:1380
8062 msgid "See also L</find0>."
8066 #: ../fish/guestfish-actions.pod:1385
8071 #: ../fish/guestfish-actions.pod:1387
8074 " find0 directory (files|-)\n"
8079 #: ../fish/guestfish-actions.pod:1389 ../src/guestfs-actions.pod:2254
8081 "This command lists out all files and directories, recursively, starting at "
8082 "C<directory>, placing the resulting list in the external file called "
8087 #: ../fish/guestfish-actions.pod:1393
8088 msgid "This command works the same way as L</find> with the following exceptions:"
8092 #: ../fish/guestfish-actions.pod:1400 ../src/guestfs-actions.pod:2265
8093 msgid "The resulting list is written to an external file."
8097 #: ../fish/guestfish-actions.pod:1404 ../src/guestfs-actions.pod:2269
8099 "Items (filenames) in the result are separated by C<\\0> characters. See "
8100 "L<find(1)> option I<-print0>."
8104 #: ../fish/guestfish-actions.pod:1409 ../src/guestfs-actions.pod:2274
8105 msgid "This command is not limited in the number of names that it can return."
8109 #: ../fish/guestfish-actions.pod:1414 ../src/guestfs-actions.pod:2279
8110 msgid "The result list is not sorted."
8114 #: ../fish/guestfish-actions.pod:1420
8115 msgid "findfs-label"
8119 #: ../fish/guestfish-actions.pod:1422
8122 " findfs-label label\n"
8127 #: ../fish/guestfish-actions.pod:1424 ../src/guestfs-actions.pod:2293
8129 "This command searches the filesystems and returns the one which has the "
8130 "given label. An error is returned if no such filesystem can be found."
8134 #: ../fish/guestfish-actions.pod:1428
8135 msgid "To find the label of a filesystem, use L</vfs-label>."
8139 #: ../fish/guestfish-actions.pod:1430
8144 #: ../fish/guestfish-actions.pod:1432
8147 " findfs-uuid uuid\n"
8152 #: ../fish/guestfish-actions.pod:1434 ../src/guestfs-actions.pod:2310
8154 "This command searches the filesystems and returns the one which has the "
8155 "given UUID. An error is returned if no such filesystem can be found."
8159 #: ../fish/guestfish-actions.pod:1438
8160 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
8164 #: ../fish/guestfish-actions.pod:1440
8169 #: ../fish/guestfish-actions.pod:1442
8172 " fsck fstype device\n"
8177 #: ../fish/guestfish-actions.pod:1444 ../src/guestfs-actions.pod:2328
8179 "This runs the filesystem checker (fsck) on C<device> which should have "
8180 "filesystem type C<fstype>."
8184 #: ../fish/guestfish-actions.pod:1447 ../src/guestfs-actions.pod:2331
8186 "The returned integer is the status. See L<fsck(8)> for the list of status "
8187 "codes from C<fsck>."
8191 #: ../fish/guestfish-actions.pod:1456 ../src/guestfs-actions.pod:2340
8192 msgid "Multiple status codes can be summed together."
8196 #: ../fish/guestfish-actions.pod:1460 ../src/guestfs-actions.pod:2344
8198 "A non-zero return code can mean \"success\", for example if errors have been "
8199 "corrected on the filesystem."
8203 #: ../fish/guestfish-actions.pod:1465 ../src/guestfs-actions.pod:2349
8204 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
8208 #: ../fish/guestfish-actions.pod:1470 ../src/guestfs-actions.pod:2354
8209 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
8213 #: ../fish/guestfish-actions.pod:1472
8218 #: ../fish/guestfish-actions.pod:1474
8226 #: ../fish/guestfish-actions.pod:1476 ../src/guestfs-actions.pod:2365
8228 "Return the additional kernel options which are added to the guest kernel "
8233 #: ../fish/guestfish-actions.pod:1479 ../src/guestfs-actions.pod:2368
8234 msgid "If C<NULL> then no options are added."
8238 #: ../fish/guestfish-actions.pod:1481
8239 msgid "get-attach-method"
8243 #: ../fish/guestfish-actions.pod:1483
8246 " get-attach-method\n"
8251 #: ../fish/guestfish-actions.pod:1485
8252 msgid "Return the current attach method. See L</set-attach-method>."
8256 #: ../fish/guestfish-actions.pod:1487
8257 msgid "get-autosync"
8261 #: ../fish/guestfish-actions.pod:1489
8269 #: ../fish/guestfish-actions.pod:1491 ../src/guestfs-actions.pod:2393
8270 msgid "Get the autosync flag."
8274 #: ../fish/guestfish-actions.pod:1493
8279 #: ../fish/guestfish-actions.pod:1495
8287 #: ../fish/guestfish-actions.pod:1497 ../src/guestfs-actions.pod:2404
8288 msgid "Return the direct appliance mode flag."
8292 #: ../fish/guestfish-actions.pod:1499
8297 #: ../fish/guestfish-actions.pod:1501
8300 " get-e2label device\n"
8305 #: ../fish/guestfish-actions.pod:1503 ../src/guestfs-actions.pod:2423
8306 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8310 #: ../fish/guestfish-actions.pod:1506
8312 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
8317 #: ../fish/guestfish-actions.pod:1513
8322 #: ../fish/guestfish-actions.pod:1515
8325 " get-e2uuid device\n"
8330 #: ../fish/guestfish-actions.pod:1517 ../src/guestfs-actions.pod:2444
8331 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8335 #: ../fish/guestfish-actions.pod:1520
8337 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
8342 #: ../fish/guestfish-actions.pod:1527
8347 #: ../fish/guestfish-actions.pod:1529
8355 #: ../fish/guestfish-actions.pod:1531 ../src/guestfs-actions.pod:2457
8356 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
8360 #: ../fish/guestfish-actions.pod:1534
8362 "If L</set-memsize> was not called on this handle, and if "
8363 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8364 "value for memsize."
8368 #: ../fish/guestfish-actions.pod:1538 ../fish/guestfish-actions.pod:1595 ../fish/guestfish-actions.pod:4360 ../fish/guestfish-actions.pod:4462 ../src/guestfs-actions.pod:2464 ../src/guestfs-actions.pod:2556 ../src/guestfs-actions.pod:6755 ../src/guestfs-actions.pod:6881
8369 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8373 #: ../fish/guestfish-actions.pod:1541
8378 #: ../fish/guestfish-actions.pod:1543
8386 #: ../fish/guestfish-actions.pod:1545 ../src/guestfs-actions.pod:2476
8387 msgid "This returns the enable network flag."
8391 #: ../fish/guestfish-actions.pod:1547
8396 #: ../fish/guestfish-actions.pod:1549
8404 #: ../fish/guestfish-actions.pod:1551 ../src/guestfs-actions.pod:2487
8405 msgid "Return the current search path."
8409 #: ../fish/guestfish-actions.pod:1553 ../src/guestfs-actions.pod:2489
8411 "This is always non-NULL. If it wasn't set already, then this will return "
8416 #: ../fish/guestfish-actions.pod:1556
8421 #: ../fish/guestfish-actions.pod:1558
8429 #: ../fish/guestfish-actions.pod:1560 ../src/guestfs-actions.pod:2502
8430 msgid "This returns the process group flag."
8434 #: ../fish/guestfish-actions.pod:1562
8439 #: ../fish/guestfish-actions.pod:1564
8444 #: ../fish/guestfish-actions.pod:1566
8452 #: ../fish/guestfish-actions.pod:1568 ../src/guestfs-actions.pod:2513
8454 "Return the process ID of the qemu subprocess. If there is no qemu "
8455 "subprocess, then this will return an error."
8459 #: ../fish/guestfish-actions.pod:1571 ../src/guestfs-actions.pod:2516
8460 msgid "This is an internal call used for debugging and testing."
8464 #: ../fish/guestfish-actions.pod:1573
8469 #: ../fish/guestfish-actions.pod:1575
8477 #: ../fish/guestfish-actions.pod:1577 ../src/guestfs-actions.pod:2527
8478 msgid "Return the current qemu binary."
8482 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2529
8484 "This is always non-NULL. If it wasn't set already, then this will return "
8485 "the default qemu binary name."
8489 #: ../fish/guestfish-actions.pod:1582
8490 msgid "get-recovery-proc"
8494 #: ../fish/guestfish-actions.pod:1584
8497 " get-recovery-proc\n"
8502 #: ../fish/guestfish-actions.pod:1586 ../src/guestfs-actions.pod:2542
8503 msgid "Return the recovery process enabled flag."
8507 #: ../fish/guestfish-actions.pod:1588
8512 #: ../fish/guestfish-actions.pod:1590
8520 #: ../fish/guestfish-actions.pod:1592
8522 "This returns the current setting of the selinux flag which is passed to the "
8523 "appliance at boot time. See L</set-selinux>."
8527 #: ../fish/guestfish-actions.pod:1598
8532 #: ../fish/guestfish-actions.pod:1600
8540 #: ../fish/guestfish-actions.pod:1602 ../src/guestfs-actions.pod:2568
8541 msgid "This returns the number of virtual CPUs assigned to the appliance."
8545 #: ../fish/guestfish-actions.pod:1604
8550 #: ../fish/guestfish-actions.pod:1606
8558 #: ../fish/guestfish-actions.pod:1608 ../src/guestfs-actions.pod:2579
8560 "This returns the current state as an opaque integer. This is only useful "
8561 "for printing debug and internal error messages."
8565 #: ../fish/guestfish-actions.pod:1611 ../fish/guestfish-actions.pod:2570 ../fish/guestfish-actions.pod:2588 ../fish/guestfish-actions.pod:2626 ../fish/guestfish-actions.pod:2642 ../src/guestfs-actions.pod:2582 ../src/guestfs-actions.pod:3901 ../src/guestfs-actions.pod:3930 ../src/guestfs-actions.pod:3991 ../src/guestfs-actions.pod:4018
8566 msgid "For more information on states, see L<guestfs(3)>."
8570 #: ../fish/guestfish-actions.pod:1613
8575 #: ../fish/guestfish-actions.pod:1615
8583 #: ../fish/guestfish-actions.pod:1617 ../src/guestfs-actions.pod:2593
8584 msgid "Return the command trace flag."
8588 #: ../fish/guestfish-actions.pod:1619
8593 #: ../fish/guestfish-actions.pod:1621
8601 #: ../fish/guestfish-actions.pod:1623
8603 "Return the current umask. By default the umask is C<022> unless it has been "
8604 "set by calling L</umask>."
8608 #: ../fish/guestfish-actions.pod:1626
8613 #: ../fish/guestfish-actions.pod:1628
8621 #: ../fish/guestfish-actions.pod:1630 ../src/guestfs-actions.pod:2616
8622 msgid "This returns the verbose messages flag."
8626 #: ../fish/guestfish-actions.pod:1632
8631 #: ../fish/guestfish-actions.pod:1634
8639 #: ../fish/guestfish-actions.pod:1636 ../src/guestfs-actions.pod:2627
8640 msgid "This gets the SELinux security context of the daemon."
8644 #: ../fish/guestfish-actions.pod:1638
8645 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
8649 #: ../fish/guestfish-actions.pod:1641
8654 #: ../fish/guestfish-actions.pod:1643
8657 " getxattr path name\n"
8662 #: ../fish/guestfish-actions.pod:1645
8664 "Get a single extended attribute from file C<path> named C<name>. This call "
8665 "follows symlinks. If you want to lookup an extended attribute for the "
8666 "symlink itself, use L</lgetxattr>."
8670 #: ../fish/guestfish-actions.pod:1649 ../fish/guestfish-actions.pod:2715
8672 "Normally it is better to get all extended attributes from a file in one go "
8673 "by calling L</getxattrs>. However some Linux filesystem implementations are "
8674 "buggy and do not provide a way to list out attributes. For these "
8675 "filesystems (notably ntfs-3g) you have to know the names of the extended "
8676 "attributes you want in advance and call this function."
8680 #: ../fish/guestfish-actions.pod:1656 ../fish/guestfish-actions.pod:2722 ../src/guestfs-actions.pod:2656 ../src/guestfs-actions.pod:4151
8682 "Extended attribute values are blobs of binary data. If there is no extended "
8683 "attribute named C<name>, this returns an error."
8687 #: ../fish/guestfish-actions.pod:1659
8688 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
8692 #: ../fish/guestfish-actions.pod:1661
8697 #: ../fish/guestfish-actions.pod:1663
8705 #: ../fish/guestfish-actions.pod:1665 ../src/guestfs-actions.pod:2673
8706 msgid "This call lists the extended attributes of the file or directory C<path>."
8710 #: ../fish/guestfish-actions.pod:1668 ../src/guestfs-actions.pod:2676
8712 "At the system call level, this is a combination of the L<listxattr(2)> and "
8713 "L<getxattr(2)> calls."
8717 #: ../fish/guestfish-actions.pod:1671
8718 msgid "See also: L</lgetxattrs>, L<attr(5)>."
8722 #: ../fish/guestfish-actions.pod:1673
8727 #: ../fish/guestfish-actions.pod:1675
8730 " glob-expand pattern\n"
8735 #: ../fish/guestfish-actions.pod:1677 ../src/guestfs-actions.pod:2693
8737 "This command searches for all the pathnames matching C<pattern> according to "
8738 "the wildcard expansion rules used by the shell."
8742 #: ../fish/guestfish-actions.pod:1681 ../src/guestfs-actions.pod:2697
8743 msgid "If no paths match, then this returns an empty list (note: not an error)."
8747 #: ../fish/guestfish-actions.pod:1684 ../src/guestfs-actions.pod:2700
8749 "It is just a wrapper around the C L<glob(3)> function with flags "
8750 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
8754 #: ../fish/guestfish-actions.pod:1688
8759 #: ../fish/guestfish-actions.pod:1690
8762 " grep regex path\n"
8767 #: ../fish/guestfish-actions.pod:1692 ../src/guestfs-actions.pod:2717
8768 msgid "This calls the external C<grep> program and returns the matching lines."
8772 #: ../fish/guestfish-actions.pod:1698
8777 #: ../fish/guestfish-actions.pod:1700
8780 " grepi regex path\n"
8785 #: ../fish/guestfish-actions.pod:1702 ../src/guestfs-actions.pod:2736
8786 msgid "This calls the external C<grep -i> program and returns the matching lines."
8790 #: ../fish/guestfish-actions.pod:1708
8791 msgid "grub-install"
8795 #: ../fish/guestfish-actions.pod:1710
8798 " grub-install root device\n"
8803 #: ../fish/guestfish-actions.pod:1712 ../src/guestfs-actions.pod:2755
8805 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
8806 "with the root directory being C<root>."
8810 #: ../fish/guestfish-actions.pod:1721 ../src/guestfs-actions.pod:2764
8812 "There is currently no way in the API to install grub2, which is used by most "
8813 "modern Linux guests. It is possible to run the grub2 command from the "
8814 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
8818 #: ../fish/guestfish-actions.pod:1728 ../src/guestfs-actions.pod:2771
8820 "This uses C<grub-install> from the host. Unfortunately grub is not always "
8821 "compatible with itself, so this only works in rather narrow circumstances. "
8822 "Careful testing with each guest version is advisable."
8826 #: ../fish/guestfish-actions.pod:1735 ../src/guestfs-actions.pod:2778
8828 "If grub-install reports the error \"No suitable drive was found in the "
8829 "generated device map.\" it may be that you need to create a "
8830 "C</boot/grub/device.map> file first that contains the mapping between grub "
8831 "device names and Linux device names. It is usually sufficient to create a "
8836 #: ../fish/guestfish-actions.pod:1742 ../src/guestfs-actions.pod:2785
8844 #: ../fish/guestfish-actions.pod:1744 ../src/guestfs-actions.pod:2787
8845 msgid "replacing C</dev/vda> with the name of the installation device."
8849 #: ../fish/guestfish-actions.pod:1748
8854 #: ../fish/guestfish-actions.pod:1750
8862 #: ../fish/guestfish-actions.pod:1752 ../src/guestfs-actions.pod:2801
8864 "This command returns up to the first 10 lines of a file as a list of "
8869 #: ../fish/guestfish-actions.pod:1758
8874 #: ../fish/guestfish-actions.pod:1760
8877 " head-n nrlines path\n"
8882 #: ../fish/guestfish-actions.pod:1762 ../src/guestfs-actions.pod:2820
8884 "If the parameter C<nrlines> is a positive number, this returns the first "
8885 "C<nrlines> lines of the file C<path>."
8889 #: ../fish/guestfish-actions.pod:1765 ../src/guestfs-actions.pod:2823
8891 "If the parameter C<nrlines> is a negative number, this returns lines from "
8892 "the file C<path>, excluding the last C<nrlines> lines."
8896 #: ../fish/guestfish-actions.pod:1768 ../fish/guestfish-actions.pod:4843 ../src/guestfs-actions.pod:2826 ../src/guestfs-actions.pod:7460
8897 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8901 #: ../fish/guestfish-actions.pod:1773
8906 #: ../fish/guestfish-actions.pod:1775
8914 #: ../fish/guestfish-actions.pod:1777 ../src/guestfs-actions.pod:2843
8916 "This runs C<hexdump -C> on the given C<path>. The result is the "
8917 "human-readable, canonical hex dump of the file."
8921 #: ../fish/guestfish-actions.pod:1783
8926 #: ../fish/guestfish-actions.pod:1785
8929 " initrd-cat initrdpath filename\n"
8934 #: ../fish/guestfish-actions.pod:1787 ../src/guestfs-actions.pod:2862
8936 "This command unpacks the file C<filename> from the initrd file called "
8937 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8942 #: ../fish/guestfish-actions.pod:1791 ../src/guestfs-actions.pod:2866
8944 "For example, in guestfish you could use the following command to examine the "
8945 "boot script (usually called C</init>) contained in a Linux initrd or "
8950 #: ../fish/guestfish-actions.pod:1795 ../src/guestfs-actions.pod:2870
8953 " initrd-cat /boot/initrd-<version>.img init\n"
8958 #: ../fish/guestfish-actions.pod:1797
8959 msgid "See also L</initrd-list>."
8963 #: ../fish/guestfish-actions.pod:1802
8968 #: ../fish/guestfish-actions.pod:1804
8971 " initrd-list path\n"
8976 #: ../fish/guestfish-actions.pod:1806 ../src/guestfs-actions.pod:2889
8977 msgid "This command lists out files contained in an initrd."
8981 #: ../fish/guestfish-actions.pod:1808 ../src/guestfs-actions.pod:2891
8983 "The files are listed without any initial C</> character. The files are "
8984 "listed in the order they appear (not necessarily alphabetical). Directory "
8985 "names are listed as separate items."
8989 #: ../fish/guestfish-actions.pod:1812 ../src/guestfs-actions.pod:2895
8991 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8992 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8997 #: ../fish/guestfish-actions.pod:1816
8998 msgid "inotify-add-watch"
9002 #: ../fish/guestfish-actions.pod:1818
9005 " inotify-add-watch path mask\n"
9010 #: ../fish/guestfish-actions.pod:1820 ../src/guestfs-actions.pod:2912
9011 msgid "Watch C<path> for the events listed in C<mask>."
9015 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2914
9017 "Note that if C<path> is a directory then events within that directory are "
9018 "watched, but this does I<not> happen recursively (in subdirectories)."
9022 #: ../fish/guestfish-actions.pod:1826 ../src/guestfs-actions.pod:2918
9024 "Note for non-C or non-Linux callers: the inotify events are defined by the "
9025 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
9029 #: ../fish/guestfish-actions.pod:1830
9030 msgid "inotify-close"
9034 #: ../fish/guestfish-actions.pod:1832
9042 #: ../fish/guestfish-actions.pod:1834 ../src/guestfs-actions.pod:2931
9044 "This closes the inotify handle which was previously opened by inotify_init. "
9045 "It removes all watches, throws away any pending events, and deallocates all "
9050 #: ../fish/guestfish-actions.pod:1838
9051 msgid "inotify-files"
9055 #: ../fish/guestfish-actions.pod:1840
9063 #: ../fish/guestfish-actions.pod:1842
9065 "This function is a helpful wrapper around L</inotify-read> which just "
9066 "returns a list of pathnames of objects that were touched. The returned "
9067 "pathnames are sorted and deduplicated."
9071 #: ../fish/guestfish-actions.pod:1846
9072 msgid "inotify-init"
9076 #: ../fish/guestfish-actions.pod:1848
9079 " inotify-init maxevents\n"
9084 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2960
9086 "This command creates a new inotify handle. The inotify subsystem can be "
9087 "used to notify events which happen to objects in the guest filesystem."
9091 #: ../fish/guestfish-actions.pod:1854
9093 "C<maxevents> is the maximum number of events which will be queued up between "
9094 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
9095 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
9096 "default was 16384 events. Beyond this limit, the kernel throws away events, "
9097 "but records the fact that it threw them away by setting a flag "
9098 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
9102 #: ../fish/guestfish-actions.pod:1864
9104 "Before any events are generated, you have to add some watches to the "
9105 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
9106 "L</inotify-watch-all>."
9110 #: ../fish/guestfish-actions.pod:1870
9112 "Queued up events should be read periodically by calling L</inotify-read> (or "
9113 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
9114 "If you don't read the events out often enough then you risk the internal "
9115 "queue overflowing."
9119 #: ../fish/guestfish-actions.pod:1877
9121 "The handle should be closed after use by calling L</inotify-close>. This "
9122 "also removes any watches automatically."
9126 #: ../fish/guestfish-actions.pod:1881 ../src/guestfs-actions.pod:2991
9128 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9129 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9130 "that there is one global inotify handle per libguestfs instance."
9134 #: ../fish/guestfish-actions.pod:1886
9135 msgid "inotify-read"
9139 #: ../fish/guestfish-actions.pod:1888
9147 #: ../fish/guestfish-actions.pod:1890 ../src/guestfs-actions.pod:3005
9149 "Return the complete queue of events that have happened since the previous "
9154 #: ../fish/guestfish-actions.pod:1893 ../src/guestfs-actions.pod:3008
9155 msgid "If no events have happened, this returns an empty list."
9159 #: ../fish/guestfish-actions.pod:1895 ../src/guestfs-actions.pod:3010
9161 "I<Note>: In order to make sure that all events have been read, you must call "
9162 "this function repeatedly until it returns an empty list. The reason is that "
9163 "the call will read events up to the maximum appliance-to-host message size "
9164 "and leave remaining events in the queue."
9168 #: ../fish/guestfish-actions.pod:1901
9169 msgid "inotify-rm-watch"
9173 #: ../fish/guestfish-actions.pod:1903
9176 " inotify-rm-watch wd\n"
9181 #: ../fish/guestfish-actions.pod:1905
9182 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
9186 #: ../fish/guestfish-actions.pod:1908
9187 msgid "inspect-get-arch"
9191 #: ../fish/guestfish-actions.pod:1910
9194 " inspect-get-arch root\n"
9199 #: ../fish/guestfish-actions.pod:1912
9201 "This returns the architecture of the inspected operating system. The "
9202 "possible return values are listed under L</file-architecture>."
9206 #: ../fish/guestfish-actions.pod:1916 ../src/guestfs-actions.pod:3045
9208 "If the architecture could not be determined, then the string C<unknown> is "
9213 #: ../fish/guestfish-actions.pod:1919 ../fish/guestfish-actions.pod:2014 ../fish/guestfish-actions.pod:2093 ../fish/guestfish-actions.pod:2105 ../fish/guestfish-actions.pod:2189 ../fish/guestfish-actions.pod:2251 ../fish/guestfish-actions.pod:2272 ../fish/guestfish-actions.pod:2286 ../fish/guestfish-actions.pod:2326 ../fish/guestfish-actions.pod:2362 ../fish/guestfish-actions.pod:2375 ../fish/guestfish-actions.pod:2388 ../fish/guestfish-actions.pod:2398 ../fish/guestfish-actions.pod:2408 ../fish/guestfish-actions.pod:2420 ../fish/guestfish-actions.pod:2516 ../fish/guestfish-actions.pod:2550 ../src/guestfs-actions.pod:3048 ../src/guestfs-actions.pod:3150 ../src/guestfs-actions.pod:3254 ../src/guestfs-actions.pod:3273 ../src/guestfs-actions.pod:3404 ../src/guestfs-actions.pod:3488 ../src/guestfs-actions.pod:3516 ../src/guestfs-actions.pod:3537 ../src/guestfs-actions.pod:3590 ../src/guestfs-actions.pod:3634 ../src/guestfs-actions.pod:3654 ../src/guestfs-actions.pod:3674 ../src/guestfs-actions.pod:3691 ../src/guestfs-actions.pod:3707 ../src/guestfs-actions.pod:3725 ../src/guestfs-actions.pod:3827 ../src/guestfs-actions.pod:3868
9214 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
9218 #: ../fish/guestfish-actions.pod:1921
9219 msgid "inspect-get-distro"
9223 #: ../fish/guestfish-actions.pod:1923
9226 " inspect-get-distro root\n"
9231 #: ../fish/guestfish-actions.pod:1925 ../src/guestfs-actions.pod:3061
9232 msgid "This returns the distro (distribution) of the inspected operating system."
9236 #: ../fish/guestfish-actions.pod:1928 ../src/guestfs-actions.pod:3064
9237 msgid "Currently defined distros are:"
9241 #: ../fish/guestfish-actions.pod:1932 ../src/guestfs-actions.pod:3068
9242 msgid "\"archlinux\""
9246 #: ../fish/guestfish-actions.pod:1934 ../src/guestfs-actions.pod:3070
9251 #: ../fish/guestfish-actions.pod:1936 ../src/guestfs-actions.pod:3072
9256 #: ../fish/guestfish-actions.pod:1938 ../src/guestfs-actions.pod:3074
9261 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:3076
9266 #: ../fish/guestfish-actions.pod:1942 ../src/guestfs-actions.pod:3078
9271 #: ../fish/guestfish-actions.pod:1944 ../src/guestfs-actions.pod:3080
9276 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:3082
9281 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:3084
9286 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:3086
9291 #: ../fish/guestfish-actions.pod:1952 ../src/guestfs-actions.pod:3088
9292 msgid "\"linuxmint\""
9296 #: ../fish/guestfish-actions.pod:1954 ../src/guestfs-actions.pod:3090
9301 #: ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:3092
9306 #: ../fish/guestfish-actions.pod:1958 ../src/guestfs-actions.pod:3094
9311 #: ../fish/guestfish-actions.pod:1960 ../src/guestfs-actions.pod:3096
9312 msgid "\"mandriva\""
9316 #: ../fish/guestfish-actions.pod:1962 ../src/guestfs-actions.pod:3098
9321 #: ../fish/guestfish-actions.pod:1964 ../src/guestfs-actions.pod:3100
9326 #: ../fish/guestfish-actions.pod:1966 ../src/guestfs-actions.pod:3102
9331 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:3104
9332 msgid "\"opensuse\""
9336 #: ../fish/guestfish-actions.pod:1970 ../src/guestfs-actions.pod:3106
9341 #: ../fish/guestfish-actions.pod:1972 ../src/guestfs-actions.pod:3108
9346 #: ../fish/guestfish-actions.pod:1974 ../src/guestfs-actions.pod:3110
9351 #: ../fish/guestfish-actions.pod:1976 ../src/guestfs-actions.pod:3112
9352 msgid "\"redhat-based\""
9356 #: ../fish/guestfish-actions.pod:1978 ../src/guestfs-actions.pod:3114
9357 msgid "Some Red Hat-derived distro."
9361 #: ../fish/guestfish-actions.pod:1980 ../src/guestfs-actions.pod:3116
9366 #: ../fish/guestfish-actions.pod:1982 ../src/guestfs-actions.pod:3118
9367 msgid "Red Hat Enterprise Linux."
9371 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:3120
9372 msgid "\"scientificlinux\""
9376 #: ../fish/guestfish-actions.pod:1986 ../src/guestfs-actions.pod:3122
9377 msgid "Scientific Linux."
9381 #: ../fish/guestfish-actions.pod:1988 ../src/guestfs-actions.pod:3124
9382 msgid "\"slackware\""
9386 #: ../fish/guestfish-actions.pod:1990 ../src/guestfs-actions.pod:3126
9391 #: ../fish/guestfish-actions.pod:1992 ../src/guestfs-actions.pod:3128
9392 msgid "\"ttylinux\""
9396 #: ../fish/guestfish-actions.pod:1994 ../src/guestfs-actions.pod:3130
9401 #: ../fish/guestfish-actions.pod:1996 ../src/guestfs-actions.pod:3132
9406 #: ../fish/guestfish-actions.pod:1998 ../src/guestfs-actions.pod:3134
9411 #: ../fish/guestfish-actions.pod:2000 ../fish/guestfish-actions.pod:2084 ../fish/guestfish-actions.pod:2353 ../src/guestfs-actions.pod:3136 ../src/guestfs-actions.pod:3245 ../src/guestfs-actions.pod:3625
9416 #: ../fish/guestfish-actions.pod:2002 ../src/guestfs-actions.pod:3138
9417 msgid "The distro could not be determined."
9421 #: ../fish/guestfish-actions.pod:2004 ../fish/guestfish-actions.pod:2341 ../src/guestfs-actions.pod:3140 ../src/guestfs-actions.pod:3613
9426 #: ../fish/guestfish-actions.pod:2006 ../src/guestfs-actions.pod:3142
9428 "Windows does not have distributions. This string is returned if the OS type "
9433 #: ../fish/guestfish-actions.pod:2011 ../fish/guestfish-actions.pod:2090 ../fish/guestfish-actions.pod:2359 ../src/guestfs-actions.pod:3147 ../src/guestfs-actions.pod:3251 ../src/guestfs-actions.pod:3631
9435 "Future versions of libguestfs may return other strings here. The caller "
9436 "should be prepared to handle any string."
9440 #: ../fish/guestfish-actions.pod:2016
9441 msgid "inspect-get-drive-mappings"
9445 #: ../fish/guestfish-actions.pod:2018
9448 " inspect-get-drive-mappings root\n"
9453 #: ../fish/guestfish-actions.pod:2020 ../src/guestfs-actions.pod:3163
9455 "This call is useful for Windows which uses a primitive system of assigning "
9456 "drive letters (like \"C:\") to partitions. This inspection API examines the "
9457 "Windows Registry to find out how disks/partitions are mapped to drive "
9458 "letters, and returns a hash table as in the example below:"
9462 #: ../fish/guestfish-actions.pod:2026 ../src/guestfs-actions.pod:3169
9472 #: ../fish/guestfish-actions.pod:2030 ../src/guestfs-actions.pod:3173
9474 "Note that keys are drive letters. For Windows, the key is case insensitive "
9475 "and just contains the drive letter, without the customary colon separator "
9480 #: ../fish/guestfish-actions.pod:2034 ../src/guestfs-actions.pod:3177
9482 "In future we may support other operating systems that also used drive "
9483 "letters, but the keys for those might not be case insensitive and might be "
9484 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
9489 #: ../fish/guestfish-actions.pod:2039 ../src/guestfs-actions.pod:3182
9491 "For Windows guests, currently only hard drive mappings are returned. "
9492 "Removable disks (eg. DVD-ROMs) are ignored."
9496 #: ../fish/guestfish-actions.pod:2042 ../src/guestfs-actions.pod:3185
9498 "For guests that do not use drive mappings, or if the drive mappings could "
9499 "not be determined, this returns an empty hash table."
9503 #: ../fish/guestfish-actions.pod:2045
9505 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9506 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
9510 #: ../fish/guestfish-actions.pod:2049
9511 msgid "inspect-get-filesystems"
9515 #: ../fish/guestfish-actions.pod:2051
9518 " inspect-get-filesystems root\n"
9523 #: ../fish/guestfish-actions.pod:2053 ../src/guestfs-actions.pod:3206
9525 "This returns a list of all the filesystems that we think are associated with "
9526 "this operating system. This includes the root filesystem, other ordinary "
9527 "filesystems, and non-mounted devices like swap partitions."
9531 #: ../fish/guestfish-actions.pod:2058 ../src/guestfs-actions.pod:3211
9533 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9534 "to be shared between operating systems."
9538 #: ../fish/guestfish-actions.pod:2061
9540 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9541 "L</inspect-get-mountpoints>."
9545 #: ../fish/guestfish-actions.pod:2064
9546 msgid "inspect-get-format"
9550 #: ../fish/guestfish-actions.pod:2066
9553 " inspect-get-format root\n"
9558 #: ../fish/guestfish-actions.pod:2068 ../src/guestfs-actions.pod:3229
9560 "This returns the format of the inspected operating system. You can use it "
9561 "to detect install images, live CDs and similar."
9565 #: ../fish/guestfish-actions.pod:2071 ../src/guestfs-actions.pod:3232
9566 msgid "Currently defined formats are:"
9570 #: ../fish/guestfish-actions.pod:2075 ../src/guestfs-actions.pod:3236
9571 msgid "\"installed\""
9575 #: ../fish/guestfish-actions.pod:2077 ../src/guestfs-actions.pod:3238
9576 msgid "This is an installed operating system."
9580 #: ../fish/guestfish-actions.pod:2079 ../src/guestfs-actions.pod:3240
9581 msgid "\"installer\""
9585 #: ../fish/guestfish-actions.pod:2081 ../src/guestfs-actions.pod:3242
9587 "The disk image being inspected is not an installed operating system, but a "
9588 "I<bootable> install disk, live CD, or similar."
9592 #: ../fish/guestfish-actions.pod:2086 ../src/guestfs-actions.pod:3247
9593 msgid "The format of this disk image is not known."
9597 #: ../fish/guestfish-actions.pod:2095
9598 msgid "inspect-get-hostname"
9602 #: ../fish/guestfish-actions.pod:2097
9605 " inspect-get-hostname root\n"
9610 #: ../fish/guestfish-actions.pod:2099 ../src/guestfs-actions.pod:3267
9612 "This function returns the hostname of the operating system as found by "
9613 "inspection of the guest's configuration files."
9617 #: ../fish/guestfish-actions.pod:2102 ../src/guestfs-actions.pod:3270
9619 "If the hostname could not be determined, then the string C<unknown> is "
9624 #: ../fish/guestfish-actions.pod:2107
9625 msgid "inspect-get-icon"
9629 #: ../fish/guestfish-actions.pod:2109
9632 " inspect-get-icon root [favicon:true|false] [highquality:true|false]\n"
9637 #: ../fish/guestfish-actions.pod:2111 ../src/guestfs-actions.pod:3296
9639 "This function returns an icon corresponding to the inspected operating "
9640 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
9641 "to PNG if necessary)."
9645 #: ../fish/guestfish-actions.pod:2115 ../src/guestfs-actions.pod:3300
9647 "If it was not possible to get an icon this function returns a zero-length "
9648 "(non-NULL) buffer. I<Callers must check for this case>."
9652 #: ../fish/guestfish-actions.pod:2118 ../src/guestfs-actions.pod:3303
9654 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
9655 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
9656 "this file will be returned. You can disable favicons by passing the "
9657 "optional C<favicon> boolean as false (default is true)."
9661 #: ../fish/guestfish-actions.pod:2124 ../src/guestfs-actions.pod:3309
9663 "If finding the favicon fails, then we look in other places in the guest for "
9668 #: ../fish/guestfish-actions.pod:2127 ../src/guestfs-actions.pod:3312
9670 "If the optional C<highquality> boolean is true then only high quality icons "
9671 "are returned, which means only icons of high resolution with an alpha "
9672 "channel. The default (false) is to return any icon we can, even if it is of "
9673 "substandard quality."
9677 #: ../fish/guestfish-actions.pod:2138 ../src/guestfs-actions.pod:3323
9679 "Unlike most other inspection API calls, the guest's disks must be mounted up "
9680 "before you call this, since it needs to read information from the guest "
9681 "filesystem during the call."
9685 #: ../fish/guestfish-actions.pod:2144 ../src/guestfs-actions.pod:3329
9687 "B<Security:> The icon data comes from the untrusted guest, and should be "
9688 "treated with caution. PNG files have been known to contain exploits. "
9689 "Ensure that libpng (or other relevant libraries) are fully up to date before "
9690 "trying to process or display the icon."
9694 #: ../fish/guestfish-actions.pod:2152 ../src/guestfs-actions.pod:3337
9696 "The PNG image returned can be any size. It might not be square. Libguestfs "
9697 "tries to return the largest, highest quality icon available. The "
9698 "application must scale the icon to the required size."
9702 #: ../fish/guestfish-actions.pod:2159 ../src/guestfs-actions.pod:3344
9704 "Extracting icons from Windows guests requires the external C<wrestool> "
9705 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
9706 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
9707 "installed separately."
9711 #: ../fish/guestfish-actions.pod:2166 ../src/guestfs-actions.pod:3351
9713 "Operating system icons are usually trademarks. Seek legal advice before "
9714 "using trademarks in applications."
9718 #: ../fish/guestfish-actions.pod:2173
9719 msgid "inspect-get-major-version"
9723 #: ../fish/guestfish-actions.pod:2175
9726 " inspect-get-major-version root\n"
9731 #: ../fish/guestfish-actions.pod:2177 ../src/guestfs-actions.pod:3392
9732 msgid "This returns the major version number of the inspected operating system."
9736 #: ../fish/guestfish-actions.pod:2180 ../src/guestfs-actions.pod:3395
9738 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9739 "popular public names used by the operating system. Notably the operating "
9740 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9741 "1). You can find out the real versions corresponding to releases of Windows "
9742 "by consulting Wikipedia or MSDN."
9746 #: ../fish/guestfish-actions.pod:2187 ../fish/guestfish-actions.pod:2198 ../src/guestfs-actions.pod:3402 ../src/guestfs-actions.pod:3419
9747 msgid "If the version could not be determined, then C<0> is returned."
9751 #: ../fish/guestfish-actions.pod:2191
9752 msgid "inspect-get-minor-version"
9756 #: ../fish/guestfish-actions.pod:2193
9759 " inspect-get-minor-version root\n"
9764 #: ../fish/guestfish-actions.pod:2195 ../src/guestfs-actions.pod:3416
9765 msgid "This returns the minor version number of the inspected operating system."
9769 #: ../fish/guestfish-actions.pod:2200
9771 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9772 "L</inspect-get-major-version>."
9776 #: ../fish/guestfish-actions.pod:2203
9777 msgid "inspect-get-mountpoints"
9781 #: ../fish/guestfish-actions.pod:2205
9784 " inspect-get-mountpoints root\n"
9789 #: ../fish/guestfish-actions.pod:2207 ../src/guestfs-actions.pod:3434
9791 "This returns a hash of where we think the filesystems associated with this "
9792 "operating system should be mounted. Callers should note that this is at "
9793 "best an educated guess made by reading configuration files such as "
9794 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
9795 "are non-existent or not mountable and callers should be prepared to handle "
9796 "or ignore failures if they try to mount them."
9800 #: ../fish/guestfish-actions.pod:2216 ../src/guestfs-actions.pod:3443
9802 "Each element in the returned hashtable has a key which is the path of the "
9803 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9804 "mounted there (eg. C</dev/sda1>)."
9808 #: ../fish/guestfish-actions.pod:2221 ../src/guestfs-actions.pod:3448
9809 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
9813 #: ../fish/guestfish-actions.pod:2224
9815 "For operating systems like Windows which still use drive letters, this call "
9816 "will only return an entry for the first drive \"mounted on\" C</>. For "
9817 "information about the mapping of drive letters to partitions, see "
9818 "L</inspect-get-drive-mappings>."
9822 #: ../fish/guestfish-actions.pod:2230
9824 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9825 "L</inspect-get-filesystems>."
9829 #: ../fish/guestfish-actions.pod:2233
9830 msgid "inspect-get-package-format"
9834 #: ../fish/guestfish-actions.pod:2235
9837 " inspect-get-package-format root\n"
9842 #: ../fish/guestfish-actions.pod:2237
9844 "This function and L</inspect-get-package-management> return the package "
9845 "format and package management tool used by the inspected operating system. "
9846 "For example for Fedora these functions would return C<rpm> (package format) "
9847 "and C<yum> (package management)."
9851 #: ../fish/guestfish-actions.pod:2243 ../src/guestfs-actions.pod:3480
9853 "This returns the string C<unknown> if we could not determine the package "
9854 "format I<or> if the operating system does not have a real packaging system "
9859 #: ../fish/guestfish-actions.pod:2247 ../src/guestfs-actions.pod:3484
9861 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
9862 "C<pkgsrc>. Future versions of libguestfs may return other strings."
9866 #: ../fish/guestfish-actions.pod:2253
9867 msgid "inspect-get-package-management"
9871 #: ../fish/guestfish-actions.pod:2255
9874 " inspect-get-package-management root\n"
9879 #: ../fish/guestfish-actions.pod:2257
9881 "L</inspect-get-package-format> and this function return the package format "
9882 "and package management tool used by the inspected operating system. For "
9883 "example for Fedora these functions would return C<rpm> (package format) and "
9884 "C<yum> (package management)."
9888 #: ../fish/guestfish-actions.pod:2263 ../src/guestfs-actions.pod:3507
9890 "This returns the string C<unknown> if we could not determine the package "
9891 "management tool I<or> if the operating system does not have a real packaging "
9892 "system (eg. Windows)."
9896 #: ../fish/guestfish-actions.pod:2267 ../src/guestfs-actions.pod:3511
9898 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9899 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
9900 "versions of libguestfs may return other strings."
9904 #: ../fish/guestfish-actions.pod:2274
9905 msgid "inspect-get-product-name"
9909 #: ../fish/guestfish-actions.pod:2276
9912 " inspect-get-product-name root\n"
9917 #: ../fish/guestfish-actions.pod:2278 ../src/guestfs-actions.pod:3529
9919 "This returns the product name of the inspected operating system. The "
9920 "product name is generally some freeform string which can be displayed to the "
9921 "user, but should not be parsed by programs."
9925 #: ../fish/guestfish-actions.pod:2283 ../src/guestfs-actions.pod:3534
9927 "If the product name could not be determined, then the string C<unknown> is "
9932 #: ../fish/guestfish-actions.pod:2288
9933 msgid "inspect-get-product-variant"
9937 #: ../fish/guestfish-actions.pod:2290
9940 " inspect-get-product-variant root\n"
9945 #: ../fish/guestfish-actions.pod:2292 ../src/guestfs-actions.pod:3550
9946 msgid "This returns the product variant of the inspected operating system."
9950 #: ../fish/guestfish-actions.pod:2295 ../src/guestfs-actions.pod:3553
9952 "For Windows guests, this returns the contents of the Registry key "
9953 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
9954 "which is usually a string such as C<Client> or C<Server> (other values are "
9955 "possible). This can be used to distinguish consumer and enterprise versions "
9956 "of Windows that have the same version number (for example, Windows 7 and "
9957 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
9958 "the latter is C<Server>)."
9962 #: ../fish/guestfish-actions.pod:2304 ../src/guestfs-actions.pod:3562
9964 "For enterprise Linux guests, in future we intend this to return the product "
9965 "variant such as C<Desktop>, C<Server> and so on. But this is not "
9966 "implemented at present."
9970 #: ../fish/guestfish-actions.pod:2308 ../src/guestfs-actions.pod:3566
9972 "If the product variant could not be determined, then the string C<unknown> "
9977 #: ../fish/guestfish-actions.pod:2311
9979 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9980 "L</inspect-get-product-name>, L</inspect-get-major-version>."
9984 #: ../fish/guestfish-actions.pod:2315
9985 msgid "inspect-get-roots"
9989 #: ../fish/guestfish-actions.pod:2317
9992 " inspect-get-roots\n"
9997 #: ../fish/guestfish-actions.pod:2319
9999 "This function is a convenient way to get the list of root devices, as "
10000 "returned from a previous call to L</inspect-os>, but without redoing the "
10001 "whole inspection process."
10005 #: ../fish/guestfish-actions.pod:2323
10007 "This returns an empty list if either no root devices were found or the "
10008 "caller has not called L</inspect-os>."
10012 #: ../fish/guestfish-actions.pod:2328
10013 msgid "inspect-get-type"
10017 #: ../fish/guestfish-actions.pod:2330
10020 " inspect-get-type root\n"
10025 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3604
10027 "This returns the type of the inspected operating system. Currently defined "
10032 #: ../fish/guestfish-actions.pod:2337 ../src/guestfs-actions.pod:3609
10037 #: ../fish/guestfish-actions.pod:2339 ../src/guestfs-actions.pod:3611
10038 msgid "Any Linux-based operating system."
10042 #: ../fish/guestfish-actions.pod:2343 ../src/guestfs-actions.pod:3615
10043 msgid "Any Microsoft Windows operating system."
10047 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3617
10048 msgid "\"freebsd\""
10052 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3619
10057 #: ../fish/guestfish-actions.pod:2349 ../src/guestfs-actions.pod:3621
10062 #: ../fish/guestfish-actions.pod:2351 ../src/guestfs-actions.pod:3623
10067 #: ../fish/guestfish-actions.pod:2355 ../src/guestfs-actions.pod:3627
10068 msgid "The operating system type could not be determined."
10072 #: ../fish/guestfish-actions.pod:2364
10073 msgid "inspect-get-windows-current-control-set"
10077 #: ../fish/guestfish-actions.pod:2366
10080 " inspect-get-windows-current-control-set root\n"
10085 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3647
10087 "This returns the Windows CurrentControlSet of the inspected guest. The "
10088 "CurrentControlSet is a registry key name such as C<ControlSet001>."
10092 #: ../fish/guestfish-actions.pod:2371 ../src/guestfs-actions.pod:3650
10094 "This call assumes that the guest is Windows and that the Registry could be "
10095 "examined by inspection. If this is not the case then an error is returned."
10099 #: ../fish/guestfish-actions.pod:2377
10100 msgid "inspect-get-windows-systemroot"
10104 #: ../fish/guestfish-actions.pod:2379
10107 " inspect-get-windows-systemroot root\n"
10112 #: ../fish/guestfish-actions.pod:2381 ../src/guestfs-actions.pod:3667
10114 "This returns the Windows systemroot of the inspected guest. The systemroot "
10115 "is a directory path such as C</WINDOWS>."
10119 #: ../fish/guestfish-actions.pod:2384 ../src/guestfs-actions.pod:3670
10121 "This call assumes that the guest is Windows and that the systemroot could be "
10122 "determined by inspection. If this is not the case then an error is "
10127 #: ../fish/guestfish-actions.pod:2390
10128 msgid "inspect-is-live"
10132 #: ../fish/guestfish-actions.pod:2392
10135 " inspect-is-live root\n"
10140 #: ../fish/guestfish-actions.pod:2394
10142 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10143 "then this returns true if a live image was detected on the disk."
10147 #: ../fish/guestfish-actions.pod:2400
10148 msgid "inspect-is-multipart"
10152 #: ../fish/guestfish-actions.pod:2402
10155 " inspect-is-multipart root\n"
10160 #: ../fish/guestfish-actions.pod:2404
10162 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10163 "then this returns true if the disk is part of a set."
10167 #: ../fish/guestfish-actions.pod:2410
10168 msgid "inspect-is-netinst"
10172 #: ../fish/guestfish-actions.pod:2412
10175 " inspect-is-netinst root\n"
10180 #: ../fish/guestfish-actions.pod:2414
10182 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10183 "then this returns true if the disk is a network installer, ie. not a "
10184 "self-contained install CD but one which is likely to require network access "
10185 "to complete the install."
10189 #: ../fish/guestfish-actions.pod:2422
10190 msgid "inspect-list-applications"
10194 #: ../fish/guestfish-actions.pod:2424
10197 " inspect-list-applications root\n"
10202 #: ../fish/guestfish-actions.pod:2426 ../src/guestfs-actions.pod:3737
10203 msgid "Return the list of applications installed in the operating system."
10207 #: ../fish/guestfish-actions.pod:2428
10209 "I<Note:> This call works differently from other parts of the inspection "
10210 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
10211 "then mount up the disks, before calling this. Listing applications is a "
10212 "significantly more difficult operation which requires access to the full "
10213 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
10214 "are just returning data cached in the libguestfs handle, this call actually "
10215 "reads parts of the mounted filesystems during the call."
10219 #: ../fish/guestfish-actions.pod:2438 ../src/guestfs-actions.pod:3749
10221 "This returns an empty list if the inspection code was not able to determine "
10222 "the list of applications."
10226 #: ../fish/guestfish-actions.pod:2441 ../src/guestfs-actions.pod:3752
10227 msgid "The application structure contains the following fields:"
10231 #: ../fish/guestfish-actions.pod:2445 ../src/guestfs-actions.pod:3756
10232 msgid "C<app_name>"
10236 #: ../fish/guestfish-actions.pod:2447 ../src/guestfs-actions.pod:3758
10238 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10239 "guests, this is the package name."
10243 #: ../fish/guestfish-actions.pod:2450 ../src/guestfs-actions.pod:3761
10244 msgid "C<app_display_name>"
10248 #: ../fish/guestfish-actions.pod:2452 ../src/guestfs-actions.pod:3763
10250 "The display name of the application, sometimes localized to the install "
10251 "language of the guest operating system."
10255 #: ../fish/guestfish-actions.pod:2455 ../src/guestfs-actions.pod:3766
10257 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10258 "to display something can use C<app_name> instead."
10262 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3769
10263 msgid "C<app_epoch>"
10267 #: ../fish/guestfish-actions.pod:2460 ../src/guestfs-actions.pod:3771
10269 "For package managers which use epochs, this contains the epoch of the "
10270 "package (an integer). If unavailable, this is returned as C<0>."
10274 #: ../fish/guestfish-actions.pod:2463 ../src/guestfs-actions.pod:3774
10275 msgid "C<app_version>"
10279 #: ../fish/guestfish-actions.pod:2465 ../src/guestfs-actions.pod:3776
10281 "The version string of the application or package. If unavailable this is "
10282 "returned as an empty string C<\"\">."
10286 #: ../fish/guestfish-actions.pod:2468 ../src/guestfs-actions.pod:3779
10287 msgid "C<app_release>"
10291 #: ../fish/guestfish-actions.pod:2470 ../src/guestfs-actions.pod:3781
10293 "The release string of the application or package, for package managers that "
10294 "use this. If unavailable this is returned as an empty string C<\"\">."
10298 #: ../fish/guestfish-actions.pod:2474 ../src/guestfs-actions.pod:3785
10299 msgid "C<app_install_path>"
10303 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3787
10305 "The installation path of the application (on operating systems such as "
10306 "Windows which use installation paths). This path is in the format used by "
10307 "the guest operating system, it is not a libguestfs path."
10311 #: ../fish/guestfish-actions.pod:2481 ../src/guestfs-actions.pod:3792
10312 msgid "If unavailable this is returned as an empty string C<\"\">."
10316 #: ../fish/guestfish-actions.pod:2483 ../src/guestfs-actions.pod:3794
10317 msgid "C<app_trans_path>"
10321 #: ../fish/guestfish-actions.pod:2485 ../src/guestfs-actions.pod:3796
10323 "The install path translated into a libguestfs path. If unavailable this is "
10324 "returned as an empty string C<\"\">."
10328 #: ../fish/guestfish-actions.pod:2488 ../src/guestfs-actions.pod:3799
10329 msgid "C<app_publisher>"
10333 #: ../fish/guestfish-actions.pod:2490 ../src/guestfs-actions.pod:3801
10335 "The name of the publisher of the application, for package managers that use "
10336 "this. If unavailable this is returned as an empty string C<\"\">."
10340 #: ../fish/guestfish-actions.pod:2494 ../src/guestfs-actions.pod:3805
10345 #: ../fish/guestfish-actions.pod:2496 ../src/guestfs-actions.pod:3807
10347 "The URL (eg. upstream URL) of the application. If unavailable this is "
10348 "returned as an empty string C<\"\">."
10352 #: ../fish/guestfish-actions.pod:2499 ../src/guestfs-actions.pod:3810
10353 msgid "C<app_source_package>"
10357 #: ../fish/guestfish-actions.pod:2501 ../src/guestfs-actions.pod:3812
10359 "For packaging systems which support this, the name of the source package. "
10360 "If unavailable this is returned as an empty string C<\"\">."
10364 #: ../fish/guestfish-actions.pod:2504 ../src/guestfs-actions.pod:3815
10365 msgid "C<app_summary>"
10369 #: ../fish/guestfish-actions.pod:2506 ../src/guestfs-actions.pod:3817
10371 "A short (usually one line) description of the application or package. If "
10372 "unavailable this is returned as an empty string C<\"\">."
10376 #: ../fish/guestfish-actions.pod:2509 ../src/guestfs-actions.pod:3820
10377 msgid "C<app_description>"
10381 #: ../fish/guestfish-actions.pod:2511 ../src/guestfs-actions.pod:3822
10383 "A longer description of the application or package. If unavailable this is "
10384 "returned as an empty string C<\"\">."
10388 #: ../fish/guestfish-actions.pod:2518
10393 #: ../fish/guestfish-actions.pod:2520
10401 #: ../fish/guestfish-actions.pod:2522 ../src/guestfs-actions.pod:3840
10403 "This function uses other libguestfs functions and certain heuristics to "
10404 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10405 "for operating systems."
10409 #: ../fish/guestfish-actions.pod:2526 ../src/guestfs-actions.pod:3844
10410 msgid "The list returned is empty if no operating systems were found."
10414 #: ../fish/guestfish-actions.pod:2528 ../src/guestfs-actions.pod:3846
10416 "If one operating system was found, then this returns a list with a single "
10417 "element, which is the name of the root filesystem of this operating system. "
10418 "It is also possible for this function to return a list containing more than "
10419 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10420 "element being the root filesystem of one of the operating systems."
10424 #: ../fish/guestfish-actions.pod:2535
10426 "You can pass the root string(s) returned to other L</inspect-get-*> "
10427 "functions in order to query further information about each operating system, "
10428 "such as the name and version."
10432 #: ../fish/guestfish-actions.pod:2540
10434 "This function uses other libguestfs features such as L</mount-ro> and "
10435 "L</umount-all> in order to mount and unmount filesystems and look at the "
10436 "contents. This should be called with no disks currently mounted. The "
10437 "function may also use Augeas, so any existing Augeas handle will be closed."
10441 #: ../fish/guestfish-actions.pod:2546 ../src/guestfs-actions.pod:3864
10443 "This function cannot decrypt encrypted disks. The caller must do that first "
10444 "(supplying the necessary keys) if the disk is encrypted."
10448 #: ../fish/guestfish-actions.pod:2552 ../fish/guestfish-actions.pod:2750 ../fish/guestfish-actions.pod:2809
10449 msgid "See also L</list-filesystems>."
10453 #: ../fish/guestfish-actions.pod:2554
10454 msgid "is-blockdev"
10458 #: ../fish/guestfish-actions.pod:2556
10461 " is-blockdev path\n"
10466 #: ../fish/guestfish-actions.pod:2558 ../src/guestfs-actions.pod:3884
10468 "This returns C<true> if and only if there is a block device with the given "
10473 #: ../fish/guestfish-actions.pod:2561 ../fish/guestfish-actions.pod:2579 ../fish/guestfish-actions.pod:2598 ../fish/guestfish-actions.pod:2607 ../fish/guestfish-actions.pod:2617 ../fish/guestfish-actions.pod:2651 ../fish/guestfish-actions.pod:2660
10474 msgid "See also L</stat>."
10478 #: ../fish/guestfish-actions.pod:2563
10483 #: ../fish/guestfish-actions.pod:2565
10491 #: ../fish/guestfish-actions.pod:2567 ../src/guestfs-actions.pod:3898
10493 "This returns true iff this handle is busy processing a command (in the "
10498 #: ../fish/guestfish-actions.pod:2572
10503 #: ../fish/guestfish-actions.pod:2574
10506 " is-chardev path\n"
10511 #: ../fish/guestfish-actions.pod:2576 ../src/guestfs-actions.pod:3913
10513 "This returns C<true> if and only if there is a character device with the "
10514 "given C<path> name."
10518 #: ../fish/guestfish-actions.pod:2581
10523 #: ../fish/guestfish-actions.pod:2583
10531 #: ../fish/guestfish-actions.pod:2585 ../src/guestfs-actions.pod:3927
10533 "This returns true iff this handle is being configured (in the C<CONFIG> "
10538 #: ../fish/guestfish-actions.pod:2590
10543 #: ../fish/guestfish-actions.pod:2592
10551 #: ../fish/guestfish-actions.pod:2594 ../src/guestfs-actions.pod:3942
10553 "This returns C<true> if and only if there is a directory with the given "
10554 "C<path> name. Note that it returns false for other objects like files."
10558 #: ../fish/guestfish-actions.pod:2600
10563 #: ../fish/guestfish-actions.pod:2602
10571 #: ../fish/guestfish-actions.pod:2604 ../src/guestfs-actions.pod:3958
10573 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
10574 "given C<path> name."
10578 #: ../fish/guestfish-actions.pod:2609
10583 #: ../fish/guestfish-actions.pod:2611
10591 #: ../fish/guestfish-actions.pod:2613 ../src/guestfs-actions.pod:3973
10593 "This returns C<true> if and only if there is a regular file with the given "
10594 "C<path> name. Note that it returns false for other objects like "
10599 #: ../fish/guestfish-actions.pod:2619
10600 msgid "is-launching"
10604 #: ../fish/guestfish-actions.pod:2621
10612 #: ../fish/guestfish-actions.pod:2623 ../src/guestfs-actions.pod:3988
10614 "This returns true iff this handle is launching the subprocess (in the "
10615 "C<LAUNCHING> state)."
10619 #: ../fish/guestfish-actions.pod:2628
10624 #: ../fish/guestfish-actions.pod:2630
10632 #: ../fish/guestfish-actions.pod:2632 ../src/guestfs-actions.pod:4003
10634 "This command tests whether C<device> is a logical volume, and returns true "
10635 "iff this is the case."
10639 #: ../fish/guestfish-actions.pod:2635
10644 #: ../fish/guestfish-actions.pod:2637
10652 #: ../fish/guestfish-actions.pod:2639 ../src/guestfs-actions.pod:4015
10654 "This returns true iff this handle is ready to accept commands (in the "
10659 #: ../fish/guestfish-actions.pod:2644
10664 #: ../fish/guestfish-actions.pod:2646
10667 " is-socket path\n"
10672 #: ../fish/guestfish-actions.pod:2648 ../src/guestfs-actions.pod:4030
10674 "This returns C<true> if and only if there is a Unix domain socket with the "
10675 "given C<path> name."
10679 #: ../fish/guestfish-actions.pod:2653
10684 #: ../fish/guestfish-actions.pod:2655
10687 " is-symlink path\n"
10692 #: ../fish/guestfish-actions.pod:2657 ../src/guestfs-actions.pod:4045
10694 "This returns C<true> if and only if there is a symbolic link with the given "
10699 #: ../fish/guestfish-actions.pod:2662
10704 #: ../fish/guestfish-actions.pod:2664
10712 #: ../fish/guestfish-actions.pod:2666 ../src/guestfs-actions.pod:4060
10714 "This returns true iff the file exists and the file is empty or it contains "
10719 #: ../fish/guestfish-actions.pod:2669
10720 msgid "is-zero-device"
10724 #: ../fish/guestfish-actions.pod:2671
10727 " is-zero-device device\n"
10732 #: ../fish/guestfish-actions.pod:2673 ../src/guestfs-actions.pod:4073
10733 msgid "This returns true iff the device exists and contains all zero bytes."
10737 #: ../fish/guestfish-actions.pod:2675 ../src/guestfs-actions.pod:4075
10738 msgid "Note that for large devices this can take a long time to run."
10742 #: ../fish/guestfish-actions.pod:2677
10743 msgid "kill-subprocess"
10747 #: ../fish/guestfish-actions.pod:2679
10750 " kill-subprocess\n"
10755 #: ../fish/guestfish-actions.pod:2681 ../src/guestfs-actions.pod:4086
10756 msgid "This kills the qemu subprocess. You should never need to call this."
10760 #: ../fish/guestfish-actions.pod:2683
10765 #: ../fish/guestfish-actions.pod:2685
10770 #: ../fish/guestfish-actions.pod:2687
10778 #: ../fish/guestfish-actions.pod:2689 ../src/guestfs-actions.pod:4097
10780 "Internally libguestfs is implemented by running a virtual machine using "
10785 #: ../fish/guestfish-actions.pod:2692 ../src/guestfs-actions.pod:4100
10787 "You should call this after configuring the handle (eg. adding drives) but "
10788 "before performing any actions."
10792 #: ../fish/guestfish-actions.pod:2695
10797 #: ../fish/guestfish-actions.pod:2697
10800 " lchown owner group path\n"
10805 #: ../fish/guestfish-actions.pod:2699
10807 "Change the file owner to C<owner> and group to C<group>. This is like "
10808 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
10813 #: ../fish/guestfish-actions.pod:2707
10818 #: ../fish/guestfish-actions.pod:2709
10821 " lgetxattr path name\n"
10826 #: ../fish/guestfish-actions.pod:2711 ../src/guestfs-actions.pod:4140
10828 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10829 "is a symlink, then this call returns an extended attribute from the symlink."
10833 #: ../fish/guestfish-actions.pod:2725
10834 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
10838 #: ../fish/guestfish-actions.pod:2727
10843 #: ../fish/guestfish-actions.pod:2729
10846 " lgetxattrs path\n"
10851 #: ../fish/guestfish-actions.pod:2731
10853 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
10854 "it returns the extended attributes of the link itself."
10858 #: ../fish/guestfish-actions.pod:2735
10863 #: ../fish/guestfish-actions.pod:2737
10871 #: ../fish/guestfish-actions.pod:2739 ../src/guestfs-actions.pod:4183
10873 "List all 9p filesystems attached to the guest. A list of mount tags is "
10878 #: ../fish/guestfish-actions.pod:2742
10879 msgid "list-devices"
10883 #: ../fish/guestfish-actions.pod:2744
10891 #: ../fish/guestfish-actions.pod:2746 ../src/guestfs-actions.pod:4197
10892 msgid "List all the block devices."
10896 #: ../fish/guestfish-actions.pod:2748 ../src/guestfs-actions.pod:4199
10897 msgid "The full block device names are returned, eg. C</dev/sda>."
10901 #: ../fish/guestfish-actions.pod:2752
10902 msgid "list-dm-devices"
10906 #: ../fish/guestfish-actions.pod:2754
10909 " list-dm-devices\n"
10914 #: ../fish/guestfish-actions.pod:2756 ../src/guestfs-actions.pod:4214
10915 msgid "List all device mapper devices."
10919 #: ../fish/guestfish-actions.pod:2758
10921 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
10922 "previous call to L</luks-open>."
10926 #: ../fish/guestfish-actions.pod:2761
10928 "Device mapper devices which correspond to logical volumes are I<not> "
10929 "returned in this list. Call L</lvs> if you want to list logical volumes."
10933 #: ../fish/guestfish-actions.pod:2765
10934 msgid "list-filesystems"
10938 #: ../fish/guestfish-actions.pod:2767
10941 " list-filesystems\n"
10946 #: ../fish/guestfish-actions.pod:2769 ../src/guestfs-actions.pod:4234
10948 "This inspection command looks for filesystems on partitions, block devices "
10949 "and logical volumes, returning a list of devices containing filesystems and "
10954 #: ../fish/guestfish-actions.pod:2773 ../src/guestfs-actions.pod:4238
10956 "The return value is a hash, where the keys are the devices containing "
10957 "filesystems, and the values are the filesystem types. For example:"
10961 #: ../fish/guestfish-actions.pod:2777 ../src/guestfs-actions.pod:4242
10964 " \"/dev/sda1\" => \"ntfs\"\n"
10965 " \"/dev/sda2\" => \"ext2\"\n"
10966 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10967 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10972 #: ../fish/guestfish-actions.pod:2782 ../src/guestfs-actions.pod:4247
10974 "The value can have the special value \"unknown\", meaning the content of the "
10975 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10979 #: ../fish/guestfish-actions.pod:2786
10981 "This command runs other libguestfs commands, which might include L</mount> "
10982 "and L</umount>, and therefore you should use this soon after launch and only "
10983 "when nothing is mounted."
10987 #: ../fish/guestfish-actions.pod:2790
10989 "Not all of the filesystems returned will be mountable. In particular, swap "
10990 "partitions are returned in the list. Also this command does not check that "
10991 "each filesystem found is valid and mountable, and some filesystems might be "
10992 "mountable but require special options. Filesystems may not all belong to a "
10993 "single logical operating system (use L</inspect-os> to look for OSes)."
10997 #: ../fish/guestfish-actions.pod:2798
10998 msgid "list-partitions"
11002 #: ../fish/guestfish-actions.pod:2800
11005 " list-partitions\n"
11010 #: ../fish/guestfish-actions.pod:2802 ../src/guestfs-actions.pod:4276
11011 msgid "List all the partitions detected on all block devices."
11015 #: ../fish/guestfish-actions.pod:2804 ../src/guestfs-actions.pod:4278
11016 msgid "The full partition device names are returned, eg. C</dev/sda1>"
11020 #: ../fish/guestfish-actions.pod:2806
11022 "This does not return logical volumes. For that you will need to call "
11027 #: ../fish/guestfish-actions.pod:2811
11032 #: ../fish/guestfish-actions.pod:2813
11040 #: ../fish/guestfish-actions.pod:2815 ../src/guestfs-actions.pod:4297
11042 "List the files in C<directory> (relative to the root directory, there is no "
11043 "cwd) in the format of 'ls -la'."
11047 #: ../fish/guestfish-actions.pod:2818 ../src/guestfs-actions.pod:4300
11049 "This command is mostly useful for interactive sessions. It is I<not> "
11050 "intended that you try to parse the output string."
11054 #: ../fish/guestfish-actions.pod:2821
11059 #: ../fish/guestfish-actions.pod:2823
11062 " ln target linkname\n"
11067 #: ../fish/guestfish-actions.pod:2825 ../src/guestfs-actions.pod:4315
11068 msgid "This command creates a hard link using the C<ln> command."
11072 #: ../fish/guestfish-actions.pod:2827
11077 #: ../fish/guestfish-actions.pod:2829
11080 " ln-f target linkname\n"
11085 #: ../fish/guestfish-actions.pod:2831 ../src/guestfs-actions.pod:4328
11087 "This command creates a hard link using the C<ln -f> command. The I<-f> "
11088 "option removes the link (C<linkname>) if it exists already."
11092 #: ../fish/guestfish-actions.pod:2834
11097 #: ../fish/guestfish-actions.pod:2836
11100 " ln-s target linkname\n"
11105 #: ../fish/guestfish-actions.pod:2838 ../src/guestfs-actions.pod:4342
11106 msgid "This command creates a symbolic link using the C<ln -s> command."
11110 #: ../fish/guestfish-actions.pod:2840
11115 #: ../fish/guestfish-actions.pod:2842
11118 " ln-sf target linkname\n"
11123 #: ../fish/guestfish-actions.pod:2844 ../src/guestfs-actions.pod:4355
11125 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
11126 "option removes the link (C<linkname>) if it exists already."
11130 #: ../fish/guestfish-actions.pod:2847
11131 msgid "lremovexattr"
11135 #: ../fish/guestfish-actions.pod:2849
11138 " lremovexattr xattr path\n"
11143 #: ../fish/guestfish-actions.pod:2851
11145 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
11146 "it removes an extended attribute of the link itself."
11150 #: ../fish/guestfish-actions.pod:2855
11155 #: ../fish/guestfish-actions.pod:2857
11163 #: ../fish/guestfish-actions.pod:2859 ../src/guestfs-actions.pod:4383
11165 "List the files in C<directory> (relative to the root directory, there is no "
11166 "cwd). The '.' and '..' entries are not returned, but hidden files are "
11171 #: ../fish/guestfish-actions.pod:2863
11173 "This command is mostly useful for interactive sessions. Programs should "
11174 "probably use L</readdir> instead."
11178 #: ../fish/guestfish-actions.pod:2866
11183 #: ../fish/guestfish-actions.pod:2868
11186 " lsetxattr xattr val vallen path\n"
11191 #: ../fish/guestfish-actions.pod:2870
11193 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
11194 "sets an extended attribute of the link itself."
11198 #: ../fish/guestfish-actions.pod:2874
11203 #: ../fish/guestfish-actions.pod:2876
11211 #: ../fish/guestfish-actions.pod:2878 ../fish/guestfish-actions.pod:4678 ../src/guestfs-actions.pod:4419 ../src/guestfs-actions.pod:7200
11212 msgid "Returns file information for the given C<path>."
11216 #: ../fish/guestfish-actions.pod:2880
11218 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
11219 "the link is stat-ed, not the file it refers to."
11223 #: ../fish/guestfish-actions.pod:2884 ../src/guestfs-actions.pod:4425
11224 msgid "This is the same as the C<lstat(2)> system call."
11228 #: ../fish/guestfish-actions.pod:2886
11233 #: ../fish/guestfish-actions.pod:2888
11236 " lstatlist path 'names ...'\n"
11241 #: ../fish/guestfish-actions.pod:2890
11243 "This call allows you to perform the L</lstat> operation on multiple files, "
11244 "where all files are in the directory C<path>. C<names> is the list of files "
11245 "from this directory."
11249 #: ../fish/guestfish-actions.pod:2894 ../src/guestfs-actions.pod:4444
11251 "On return you get a list of stat structs, with a one-to-one correspondence "
11252 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11253 "then the C<ino> field of that structure is set to C<-1>."
11257 #: ../fish/guestfish-actions.pod:2899
11259 "This call is intended for programs that want to efficiently list a directory "
11260 "contents without making many round-trips. See also L</lxattrlist> for a "
11261 "similarly efficient call for getting extended attributes. Very long "
11262 "directory listings might cause the protocol message size to be exceeded, "
11263 "causing this call to fail. The caller must split up such requests into "
11264 "smaller groups of names."
11268 #: ../fish/guestfish-actions.pod:2907
11269 msgid "luks-add-key"
11273 #: ../fish/guestfish-actions.pod:2909
11276 " luks-add-key device keyslot\n"
11281 #: ../fish/guestfish-actions.pod:2911 ../src/guestfs-actions.pod:4472
11283 "This command adds a new key on LUKS device C<device>. C<key> is any "
11284 "existing key, and is used to access the device. C<newkey> is the new key to "
11285 "add. C<keyslot> is the key slot that will be replaced."
11289 #: ../fish/guestfish-actions.pod:2916
11291 "Note that if C<keyslot> already contains a key, then this command will "
11292 "fail. You have to use L</luks-kill-slot> first to remove that key."
11296 #: ../fish/guestfish-actions.pod:2920 ../fish/guestfish-actions.pod:2942 ../fish/guestfish-actions.pod:2952 ../fish/guestfish-actions.pod:2963 ../fish/guestfish-actions.pod:2989 ../fish/guestfish-actions.pod:2999
11298 "This command has one or more key or passphrase parameters. Guestfish will "
11299 "prompt for these separately."
11303 #: ../fish/guestfish-actions.pod:2923
11308 #: ../fish/guestfish-actions.pod:2925
11311 " luks-close device\n"
11316 #: ../fish/guestfish-actions.pod:2927
11318 "This closes a LUKS device that was created earlier by L</luks-open> or "
11319 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
11320 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
11321 "underlying block device."
11325 #: ../fish/guestfish-actions.pod:2933
11326 msgid "luks-format"
11330 #: ../fish/guestfish-actions.pod:2935
11333 " luks-format device keyslot\n"
11338 #: ../fish/guestfish-actions.pod:2937 ../src/guestfs-actions.pod:4513
11340 "This command erases existing data on C<device> and formats the device as a "
11341 "LUKS encrypted device. C<key> is the initial key, which is added to key "
11342 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
11346 #: ../fish/guestfish-actions.pod:2945
11347 msgid "luks-format-cipher"
11351 #: ../fish/guestfish-actions.pod:2947
11354 " luks-format-cipher device keyslot cipher\n"
11359 #: ../fish/guestfish-actions.pod:2949
11361 "This command is the same as L</luks-format> but it also allows you to set "
11362 "the C<cipher> used."
11366 #: ../fish/guestfish-actions.pod:2955
11367 msgid "luks-kill-slot"
11371 #: ../fish/guestfish-actions.pod:2957
11374 " luks-kill-slot device keyslot\n"
11379 #: ../fish/guestfish-actions.pod:2959 ../src/guestfs-actions.pod:4554
11381 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11382 "device C<device>. C<key> must be one of the I<other> keys."
11386 #: ../fish/guestfish-actions.pod:2966
11391 #: ../fish/guestfish-actions.pod:2968
11394 " luks-open device mapname\n"
11399 #: ../fish/guestfish-actions.pod:2970 ../src/guestfs-actions.pod:4574
11401 "This command opens a block device which has been encrypted according to the "
11402 "Linux Unified Key Setup (LUKS) standard."
11406 #: ../fish/guestfish-actions.pod:2973 ../src/guestfs-actions.pod:4577
11407 msgid "C<device> is the encrypted block device or partition."
11411 #: ../fish/guestfish-actions.pod:2975 ../src/guestfs-actions.pod:4579
11413 "The caller must supply one of the keys associated with the LUKS block "
11414 "device, in the C<key> parameter."
11418 #: ../fish/guestfish-actions.pod:2978 ../src/guestfs-actions.pod:4582
11420 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
11421 "writes to this block device are decrypted from and encrypted to the "
11422 "underlying C<device> respectively."
11426 #: ../fish/guestfish-actions.pod:2982
11428 "If this block device contains LVM volume groups, then calling L</vgscan> "
11429 "followed by L</vg-activate-all> will make them visible."
11433 #: ../fish/guestfish-actions.pod:2986
11434 msgid "Use L</list-dm-devices> to list all device mapper devices."
11438 #: ../fish/guestfish-actions.pod:2992
11439 msgid "luks-open-ro"
11443 #: ../fish/guestfish-actions.pod:2994
11446 " luks-open-ro device mapname\n"
11451 #: ../fish/guestfish-actions.pod:2996
11453 "This is the same as L</luks-open> except that a read-only mapping is "
11458 #: ../fish/guestfish-actions.pod:3002
11463 #: ../fish/guestfish-actions.pod:3004
11466 " lvcreate logvol volgroup mbytes\n"
11471 #: ../fish/guestfish-actions.pod:3006 ../src/guestfs-actions.pod:4628
11473 "This creates an LVM logical volume called C<logvol> on the volume group "
11474 "C<volgroup>, with C<size> megabytes."
11478 #: ../fish/guestfish-actions.pod:3009
11479 msgid "lvm-canonical-lv-name"
11483 #: ../fish/guestfish-actions.pod:3011
11486 " lvm-canonical-lv-name lvname\n"
11491 #: ../fish/guestfish-actions.pod:3013 ../src/guestfs-actions.pod:4641
11493 "This converts alternative naming schemes for LVs that you might find to the "
11494 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
11499 #: ../fish/guestfish-actions.pod:3017 ../src/guestfs-actions.pod:4645
11501 "This command returns an error if the C<lvname> parameter does not refer to a "
11506 #: ../fish/guestfish-actions.pod:3020
11507 msgid "See also L</is-lv>."
11511 #: ../fish/guestfish-actions.pod:3022
11512 msgid "lvm-clear-filter"
11516 #: ../fish/guestfish-actions.pod:3024
11519 " lvm-clear-filter\n"
11524 #: ../fish/guestfish-actions.pod:3026
11526 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
11531 #: ../fish/guestfish-actions.pod:3029 ../fish/guestfish-actions.pod:3057 ../src/guestfs-actions.pod:4663 ../src/guestfs-actions.pod:4702
11532 msgid "This command also clears the LVM cache and performs a volume group scan."
11536 #: ../fish/guestfish-actions.pod:3032
11537 msgid "lvm-remove-all"
11541 #: ../fish/guestfish-actions.pod:3034
11544 " lvm-remove-all\n"
11549 #: ../fish/guestfish-actions.pod:3036 ../src/guestfs-actions.pod:4675
11551 "This command removes all LVM logical volumes, volume groups and physical "
11556 #: ../fish/guestfish-actions.pod:3039
11557 msgid "lvm-set-filter"
11561 #: ../fish/guestfish-actions.pod:3041
11564 " lvm-set-filter 'devices ...'\n"
11569 #: ../fish/guestfish-actions.pod:3043 ../src/guestfs-actions.pod:4688
11571 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
11572 "block devices in the list C<devices>, and will ignore all other attached "
11577 #: ../fish/guestfish-actions.pod:3047 ../src/guestfs-actions.pod:4692
11579 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
11580 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
11581 "there are two types of duplication possible: either cloned PVs/VGs which "
11582 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
11583 "same name. In normal operation you cannot create this situation, but you "
11584 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
11585 "inside the LVM metadata."
11589 #: ../fish/guestfish-actions.pod:3060 ../src/guestfs-actions.pod:4705
11590 msgid "You can filter whole block devices or individual partitions."
11594 #: ../fish/guestfish-actions.pod:3062 ../src/guestfs-actions.pod:4707
11596 "You cannot use this if any VG is currently in use (eg. contains a mounted "
11597 "filesystem), even if you are not filtering out that VG."
11601 #: ../fish/guestfish-actions.pod:3066
11606 #: ../fish/guestfish-actions.pod:3068
11609 " lvremove device\n"
11614 #: ../fish/guestfish-actions.pod:3070 ../src/guestfs-actions.pod:4721
11616 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
11617 "LV, such as C</dev/VG/LV>."
11621 #: ../fish/guestfish-actions.pod:3073 ../src/guestfs-actions.pod:4724
11623 "You can also remove all LVs in a volume group by specifying the VG name, "
11628 #: ../fish/guestfish-actions.pod:3076
11633 #: ../fish/guestfish-actions.pod:3078
11636 " lvrename logvol newlogvol\n"
11641 #: ../fish/guestfish-actions.pod:3080 ../src/guestfs-actions.pod:4738
11642 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
11646 #: ../fish/guestfish-actions.pod:3082
11651 #: ../fish/guestfish-actions.pod:3084
11654 " lvresize device mbytes\n"
11659 #: ../fish/guestfish-actions.pod:3086 ../src/guestfs-actions.pod:4751
11661 "This resizes (expands or shrinks) an existing LVM logical volume to "
11662 "C<mbytes>. When reducing, data in the reduced part is lost."
11666 #: ../fish/guestfish-actions.pod:3090
11667 msgid "lvresize-free"
11671 #: ../fish/guestfish-actions.pod:3092
11674 " lvresize-free lv percent\n"
11679 #: ../fish/guestfish-actions.pod:3094 ../src/guestfs-actions.pod:4766
11681 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
11682 "remaining free space in the volume group. Commonly you would call this with "
11683 "pc = 100 which expands the logical volume as much as possible, using all "
11684 "remaining free space in the volume group."
11688 #: ../fish/guestfish-actions.pod:3100
11693 #: ../fish/guestfish-actions.pod:3102
11701 #: ../fish/guestfish-actions.pod:3104 ../src/guestfs-actions.pod:4781
11703 "List all the logical volumes detected. This is the equivalent of the "
11704 "L<lvs(8)> command."
11708 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4784
11710 "This returns a list of the logical volume device names "
11711 "(eg. C</dev/VolGroup00/LogVol00>)."
11715 #: ../fish/guestfish-actions.pod:3110
11716 msgid "See also L</lvs-full>, L</list-filesystems>."
11720 #: ../fish/guestfish-actions.pod:3112
11725 #: ../fish/guestfish-actions.pod:3114
11733 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4800
11735 "List all the logical volumes detected. This is the equivalent of the "
11736 "L<lvs(8)> command. The \"full\" version includes all fields."
11740 #: ../fish/guestfish-actions.pod:3119
11745 #: ../fish/guestfish-actions.pod:3121
11753 #: ../fish/guestfish-actions.pod:3123 ../src/guestfs-actions.pod:4815
11754 msgid "This command returns the UUID of the LVM LV C<device>."
11758 #: ../fish/guestfish-actions.pod:3125
11763 #: ../fish/guestfish-actions.pod:3127
11766 " lxattrlist path 'names ...'\n"
11771 #: ../fish/guestfish-actions.pod:3129 ../src/guestfs-actions.pod:4829
11773 "This call allows you to get the extended attributes of multiple files, where "
11774 "all files are in the directory C<path>. C<names> is the list of files from "
11779 #: ../fish/guestfish-actions.pod:3133 ../src/guestfs-actions.pod:4833
11781 "On return you get a flat list of xattr structs which must be interpreted "
11782 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11783 "C<attrval> in this struct is zero-length to indicate there was an error "
11784 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11785 "number (the number of following attributes for this file, which could be "
11786 "C<\"0\">). Then after the first xattr struct are the zero or more "
11787 "attributes for the first named file. This repeats for the second and "
11788 "subsequent files."
11792 #: ../fish/guestfish-actions.pod:3143
11794 "This call is intended for programs that want to efficiently list a directory "
11795 "contents without making many round-trips. See also L</lstatlist> for a "
11796 "similarly efficient call for getting standard stats. Very long directory "
11797 "listings might cause the protocol message size to be exceeded, causing this "
11798 "call to fail. The caller must split up such requests into smaller groups of "
11803 #: ../fish/guestfish-actions.pod:3151
11808 #: ../fish/guestfish-actions.pod:3153
11816 #: ../fish/guestfish-actions.pod:3155 ../src/guestfs-actions.pod:4863
11817 msgid "Create a directory named C<path>."
11821 #: ../fish/guestfish-actions.pod:3157
11826 #: ../fish/guestfish-actions.pod:3159
11829 " mkdir-mode path mode\n"
11834 #: ../fish/guestfish-actions.pod:3161 ../src/guestfs-actions.pod:4876
11836 "This command creates a directory, setting the initial permissions of the "
11837 "directory to C<mode>."
11841 #: ../fish/guestfish-actions.pod:3164 ../src/guestfs-actions.pod:4879
11843 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11844 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11849 #: ../fish/guestfish-actions.pod:3168
11850 msgid "See also L</mkdir>, L</umask>"
11854 #: ../fish/guestfish-actions.pod:3170
11859 #: ../fish/guestfish-actions.pod:3172
11867 #: ../fish/guestfish-actions.pod:3174 ../src/guestfs-actions.pod:4895
11869 "Create a directory named C<path>, creating any parent directories as "
11870 "necessary. This is like the C<mkdir -p> shell command."
11874 #: ../fish/guestfish-actions.pod:3177
11879 #: ../fish/guestfish-actions.pod:3179
11882 " mkdtemp template\n"
11887 #: ../fish/guestfish-actions.pod:3181 ../src/guestfs-actions.pod:4908
11889 "This command creates a temporary directory. The C<template> parameter "
11890 "should be a full pathname for the temporary directory name with the final "
11891 "six characters being \"XXXXXX\"."
11895 #: ../fish/guestfish-actions.pod:3186 ../src/guestfs-actions.pod:4913
11897 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11898 "being suitable for Windows filesystems."
11902 #: ../fish/guestfish-actions.pod:3189 ../src/guestfs-actions.pod:4916
11903 msgid "The name of the temporary directory that was created is returned."
11907 #: ../fish/guestfish-actions.pod:3192 ../src/guestfs-actions.pod:4919
11908 msgid "The temporary directory is created with mode 0700 and is owned by root."
11912 #: ../fish/guestfish-actions.pod:3195 ../src/guestfs-actions.pod:4922
11914 "The caller is responsible for deleting the temporary directory and its "
11915 "contents after use."
11919 #: ../fish/guestfish-actions.pod:3198 ../src/guestfs-actions.pod:4925
11920 msgid "See also: L<mkdtemp(3)>"
11924 #: ../fish/guestfish-actions.pod:3200
11929 #: ../fish/guestfish-actions.pod:3202
11932 " mke2fs-J fstype blocksize device journal\n"
11937 #: ../fish/guestfish-actions.pod:3204 ../src/guestfs-actions.pod:4941
11939 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11940 "C<journal>. It is equivalent to the command:"
11944 #: ../fish/guestfish-actions.pod:3208 ../src/guestfs-actions.pod:4945
11947 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11952 #: ../fish/guestfish-actions.pod:3210
11953 msgid "See also L</mke2journal>."
11957 #: ../fish/guestfish-actions.pod:3212
11962 #: ../fish/guestfish-actions.pod:3214
11965 " mke2fs-JL fstype blocksize device label\n"
11970 #: ../fish/guestfish-actions.pod:3216 ../src/guestfs-actions.pod:4962
11972 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11973 "the journal labeled C<label>."
11977 #: ../fish/guestfish-actions.pod:3219
11978 msgid "See also L</mke2journal-L>."
11982 #: ../fish/guestfish-actions.pod:3221
11987 #: ../fish/guestfish-actions.pod:3223
11990 " mke2fs-JU fstype blocksize device uuid\n"
11995 #: ../fish/guestfish-actions.pod:3225 ../src/guestfs-actions.pod:4980
11997 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11998 "the journal with UUID C<uuid>."
12002 #: ../fish/guestfish-actions.pod:3228
12003 msgid "See also L</mke2journal-U>."
12007 #: ../fish/guestfish-actions.pod:3230
12008 msgid "mke2journal"
12012 #: ../fish/guestfish-actions.pod:3232
12015 " mke2journal blocksize device\n"
12020 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4996
12022 "This creates an ext2 external journal on C<device>. It is equivalent to the "
12027 #: ../fish/guestfish-actions.pod:3237 ../src/guestfs-actions.pod:4999
12030 " mke2fs -O journal_dev -b blocksize device\n"
12035 #: ../fish/guestfish-actions.pod:3239
12036 msgid "mke2journal-L"
12040 #: ../fish/guestfish-actions.pod:3241
12043 " mke2journal-L blocksize label device\n"
12048 #: ../fish/guestfish-actions.pod:3243 ../src/guestfs-actions.pod:5013
12049 msgid "This creates an ext2 external journal on C<device> with label C<label>."
12053 #: ../fish/guestfish-actions.pod:3245
12054 msgid "mke2journal-U"
12058 #: ../fish/guestfish-actions.pod:3247
12061 " mke2journal-U blocksize uuid device\n"
12066 #: ../fish/guestfish-actions.pod:3249 ../src/guestfs-actions.pod:5027
12067 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
12071 #: ../fish/guestfish-actions.pod:3251
12076 #: ../fish/guestfish-actions.pod:3253
12079 " mkfifo mode path\n"
12084 #: ../fish/guestfish-actions.pod:3255
12086 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
12087 "is just a convenient wrapper around L</mknod>."
12091 #: ../fish/guestfish-actions.pod:3261
12096 #: ../fish/guestfish-actions.pod:3263
12099 " mkfs fstype device\n"
12104 #: ../fish/guestfish-actions.pod:3265 ../src/guestfs-actions.pod:5057
12106 "This creates a filesystem on C<device> (usually a partition or LVM logical "
12107 "volume). The filesystem type is C<fstype>, for example C<ext3>."
12111 #: ../fish/guestfish-actions.pod:3269
12116 #: ../fish/guestfish-actions.pod:3271
12119 " mkfs-b fstype blocksize device\n"
12124 #: ../fish/guestfish-actions.pod:3273
12126 "This call is similar to L</mkfs>, but it allows you to control the block "
12127 "size of the resulting filesystem. Supported block sizes depend on the "
12128 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
12132 #: ../fish/guestfish-actions.pod:3278 ../fish/guestfish-actions.pod:3305 ../src/guestfs-actions.pod:5085 ../src/guestfs-actions.pod:5123
12134 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
12139 #: ../fish/guestfish-actions.pod:3281
12141 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
12146 #: ../fish/guestfish-actions.pod:3288
12151 #: ../fish/guestfish-actions.pod:3290
12154 " mkfs-opts fstype device [blocksize:N] [features:..] [inode:N] "
12160 #: ../fish/guestfish-actions.pod:3292 ../src/guestfs-actions.pod:5110
12162 "This function creates a filesystem on C<device>. The filesystem type is "
12163 "C<fstype>, for example C<ext3>."
12167 #: ../fish/guestfish-actions.pod:3299 ../src/guestfs-actions.pod:5117
12168 msgid "C<blocksize>"
12172 #: ../fish/guestfish-actions.pod:3301 ../src/guestfs-actions.pod:5119
12174 "The filesystem block size. Supported block sizes depend on the filesystem "
12175 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
12180 #: ../fish/guestfish-actions.pod:3308 ../src/guestfs-actions.pod:5126
12181 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
12185 #: ../fish/guestfish-actions.pod:3310 ../src/guestfs-actions.pod:5128
12186 msgid "C<features>"
12190 #: ../fish/guestfish-actions.pod:3312 ../src/guestfs-actions.pod:5130
12191 msgid "This passes the I<-O> parameter to the external mkfs program."
12195 #: ../fish/guestfish-actions.pod:3314 ../src/guestfs-actions.pod:5132
12197 "For certain filesystem types, this allows extra filesystem features to be "
12198 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
12202 #: ../fish/guestfish-actions.pod:3318 ../src/guestfs-actions.pod:5136
12204 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
12209 #: ../fish/guestfish-actions.pod:3321 ../src/guestfs-actions.pod:5139
12214 #: ../fish/guestfish-actions.pod:3323 ../src/guestfs-actions.pod:5141
12216 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
12217 "sets the inode size (only for ext2/3/4 filesystems at present)."
12221 #: ../fish/guestfish-actions.pod:3326 ../src/guestfs-actions.pod:5144
12222 msgid "C<sectorsize>"
12226 #: ../fish/guestfish-actions.pod:3328 ../src/guestfs-actions.pod:5146
12228 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
12229 "sets sector size for ufs filesystem."
12233 #: ../fish/guestfish-actions.pod:3335
12234 msgid "mkmountpoint"
12238 #: ../fish/guestfish-actions.pod:3337
12241 " mkmountpoint exemptpath\n"
12246 #: ../fish/guestfish-actions.pod:3339
12248 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
12249 "to create extra mountpoints before mounting the first filesystem."
12253 #: ../fish/guestfish-actions.pod:3343 ../src/guestfs-actions.pod:5189
12255 "These calls are I<only> necessary in some very limited circumstances, mainly "
12256 "the case where you want to mount a mix of unrelated and/or read-only "
12257 "filesystems together."
12261 #: ../fish/guestfish-actions.pod:3347 ../src/guestfs-actions.pod:5193
12263 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
12264 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
12265 "inside that. You can unpack this as follows in guestfish:"
12269 #: ../fish/guestfish-actions.pod:3352 ../src/guestfs-actions.pod:5198
12272 " add-ro Fedora-11-i686-Live.iso\n"
12274 " mkmountpoint /cd\n"
12275 " mkmountpoint /sqsh\n"
12276 " mkmountpoint /ext3fs\n"
12277 " mount /dev/sda /cd\n"
12278 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
12279 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
12284 #: ../fish/guestfish-actions.pod:3361 ../src/guestfs-actions.pod:5207
12285 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
12289 #: ../fish/guestfish-actions.pod:3363
12291 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
12292 "unexpected errors if you try to mix these calls. It is safest to manually "
12293 "unmount filesystems and remove mountpoints after use."
12297 #: ../fish/guestfish-actions.pod:3367
12299 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
12300 "for this to work for manual mountpoints, you must ensure that the innermost "
12301 "mountpoints have the longest pathnames, as in the example code above."
12305 #: ../fish/guestfish-actions.pod:3372 ../src/guestfs-actions.pod:5218
12306 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
12310 #: ../fish/guestfish-actions.pod:3374
12312 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
12313 "L</umount-all> to be called when the handle is closed which can also trigger "
12318 #: ../fish/guestfish-actions.pod:3378
12323 #: ../fish/guestfish-actions.pod:3380
12326 " mknod mode devmajor devminor path\n"
12331 #: ../fish/guestfish-actions.pod:3382 ../src/guestfs-actions.pod:5237
12333 "This call creates block or character special devices, or named pipes "
12338 #: ../fish/guestfish-actions.pod:3385 ../src/guestfs-actions.pod:5240
12340 "The C<mode> parameter should be the mode, using the standard constants. "
12341 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
12342 "used when creating block and character special devices."
12346 #: ../fish/guestfish-actions.pod:3390
12348 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
12349 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
12350 "regular file). These constants are available in the standard Linux header "
12351 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
12352 "wrappers around this command which bitwise OR in the appropriate constant "
12357 #: ../fish/guestfish-actions.pod:3400
12362 #: ../fish/guestfish-actions.pod:3402
12365 " mknod-b mode devmajor devminor path\n"
12370 #: ../fish/guestfish-actions.pod:3404
12372 "This call creates a block device node called C<path> with mode C<mode> and "
12373 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12374 "wrapper around L</mknod>."
12378 #: ../fish/guestfish-actions.pod:3410
12383 #: ../fish/guestfish-actions.pod:3412
12386 " mknod-c mode devmajor devminor path\n"
12391 #: ../fish/guestfish-actions.pod:3414
12393 "This call creates a char device node called C<path> with mode C<mode> and "
12394 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12395 "wrapper around L</mknod>."
12399 #: ../fish/guestfish-actions.pod:3420
12404 #: ../fish/guestfish-actions.pod:3422
12412 #: ../fish/guestfish-actions.pod:3424 ../src/guestfs-actions.pod:5303
12413 msgid "Create a swap partition on C<device>."
12417 #: ../fish/guestfish-actions.pod:3426
12422 #: ../fish/guestfish-actions.pod:3428
12425 " mkswap-L label device\n"
12430 #: ../fish/guestfish-actions.pod:3430 ../src/guestfs-actions.pod:5316
12431 msgid "Create a swap partition on C<device> with label C<label>."
12435 #: ../fish/guestfish-actions.pod:3432 ../src/guestfs-actions.pod:5318
12437 "Note that you cannot attach a swap label to a block device "
12438 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
12439 "the kernel or swap tools."
12443 #: ../fish/guestfish-actions.pod:3436
12448 #: ../fish/guestfish-actions.pod:3438
12451 " mkswap-U uuid device\n"
12456 #: ../fish/guestfish-actions.pod:3440 ../src/guestfs-actions.pod:5333
12457 msgid "Create a swap partition on C<device> with UUID C<uuid>."
12461 #: ../fish/guestfish-actions.pod:3442
12462 msgid "mkswap-file"
12466 #: ../fish/guestfish-actions.pod:3444
12469 " mkswap-file path\n"
12474 #: ../fish/guestfish-actions.pod:3446 ../src/guestfs-actions.pod:5345
12475 msgid "Create a swap file."
12479 #: ../fish/guestfish-actions.pod:3448
12481 "This command just writes a swap file signature to an existing file. To "
12482 "create the file itself, use something like L</fallocate>."
12486 #: ../fish/guestfish-actions.pod:3451
12491 #: ../fish/guestfish-actions.pod:3453
12494 " modprobe modulename\n"
12499 #: ../fish/guestfish-actions.pod:3455 ../src/guestfs-actions.pod:5360
12500 msgid "This loads a kernel module in the appliance."
12504 #: ../fish/guestfish-actions.pod:3457 ../src/guestfs-actions.pod:5362
12506 "The kernel module must have been whitelisted when libguestfs was built (see "
12507 "C<appliance/kmod.whitelist.in> in the source)."
12511 #: ../fish/guestfish-actions.pod:3460
12516 #: ../fish/guestfish-actions.pod:3462
12519 " mount device mountpoint\n"
12524 #: ../fish/guestfish-actions.pod:3464 ../src/guestfs-actions.pod:5376
12526 "Mount a guest disk at a position in the filesystem. Block devices are named "
12527 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12528 "those block devices contain partitions, they will have the usual names "
12529 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12533 #: ../fish/guestfish-actions.pod:3470 ../src/guestfs-actions.pod:5382
12535 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12536 "mounted on C</> before others can be mounted. Other filesystems can only be "
12537 "mounted on directories which already exist."
12541 #: ../fish/guestfish-actions.pod:3475 ../src/guestfs-actions.pod:5387
12543 "The mounted filesystem is writable, if we have sufficient permissions on the "
12544 "underlying device."
12548 #: ../fish/guestfish-actions.pod:3478
12550 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
12551 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
12552 "problems for users. If your program might need to work with older versions "
12553 "of libguestfs, use L</mount-options> instead (using an empty string for the "
12554 "first parameter if you don't want any options)."
12558 #: ../fish/guestfish-actions.pod:3485
12563 #: ../fish/guestfish-actions.pod:3487
12566 " mount-9p mounttag mountpoint [options:..]\n"
12571 #: ../fish/guestfish-actions.pod:3489 ../src/guestfs-actions.pod:5416
12573 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
12578 #: ../fish/guestfish-actions.pod:3492 ../src/guestfs-actions.pod:5419
12580 "If required, C<trans=virtio> will be automatically added to the options. "
12581 "Any other options required can be passed in the optional C<options> "
12586 #: ../fish/guestfish-actions.pod:3498
12591 #: ../fish/guestfish-actions.pod:3500
12594 " mount-loop file mountpoint\n"
12599 #: ../fish/guestfish-actions.pod:3502 ../src/guestfs-actions.pod:5458
12601 "This command lets you mount C<file> (a filesystem image in a file) on a "
12602 "mount point. It is entirely equivalent to the command C<mount -o loop file "
12607 #: ../fish/guestfish-actions.pod:3506
12608 msgid "mount-options"
12612 #: ../fish/guestfish-actions.pod:3508
12615 " mount-options options device mountpoint\n"
12620 #: ../fish/guestfish-actions.pod:3510
12622 "This is the same as the L</mount> command, but it allows you to set the "
12623 "mount options as for the L<mount(8)> I<-o> flag."
12627 #: ../fish/guestfish-actions.pod:3514 ../src/guestfs-actions.pod:5478
12629 "If the C<options> parameter is an empty string, then no options are passed "
12630 "(all options default to whatever the filesystem uses)."
12634 #: ../fish/guestfish-actions.pod:3518
12639 #: ../fish/guestfish-actions.pod:3520
12642 " mount-ro device mountpoint\n"
12647 #: ../fish/guestfish-actions.pod:3522
12649 "This is the same as the L</mount> command, but it mounts the filesystem with "
12650 "the read-only (I<-o ro>) flag."
12654 #: ../fish/guestfish-actions.pod:3525
12659 #: ../fish/guestfish-actions.pod:3527
12662 " mount-vfs options vfstype device mountpoint\n"
12667 #: ../fish/guestfish-actions.pod:3529
12669 "This is the same as the L</mount> command, but it allows you to set both the "
12670 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
12674 #: ../fish/guestfish-actions.pod:3533
12675 msgid "mountpoints"
12679 #: ../fish/guestfish-actions.pod:3535
12687 #: ../fish/guestfish-actions.pod:3537
12689 "This call is similar to L</mounts>. That call returns a list of devices. "
12690 "This one returns a hash table (map) of device name to directory where the "
12691 "device is mounted."
12695 #: ../fish/guestfish-actions.pod:3541
12700 #: ../fish/guestfish-actions.pod:3543
12708 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5539
12710 "This returns the list of currently mounted filesystems. It returns the list "
12711 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12715 #: ../fish/guestfish-actions.pod:3548 ../src/guestfs-actions.pod:5542
12716 msgid "Some internal mounts are not shown."
12720 #: ../fish/guestfish-actions.pod:3550
12721 msgid "See also: L</mountpoints>"
12725 #: ../fish/guestfish-actions.pod:3552
12730 #: ../fish/guestfish-actions.pod:3554
12738 #: ../fish/guestfish-actions.pod:3556 ../src/guestfs-actions.pod:5559
12740 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12741 "destination filename or destination directory."
12745 #: ../fish/guestfish-actions.pod:3559
12746 msgid "ntfs-3g-probe"
12750 #: ../fish/guestfish-actions.pod:3561
12753 " ntfs-3g-probe true|false device\n"
12758 #: ../fish/guestfish-actions.pod:3563 ../src/guestfs-actions.pod:5573
12760 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12761 "C<device> for mountability. (Not all NTFS volumes can be mounted "
12762 "read-write, and some cannot be mounted at all)."
12766 #: ../fish/guestfish-actions.pod:3567 ../src/guestfs-actions.pod:5577
12768 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12769 "can be mounted read-write. Set it to false if you want to test if the "
12770 "volume can be mounted read-only."
12774 #: ../fish/guestfish-actions.pod:3571 ../src/guestfs-actions.pod:5581
12776 "The return value is an integer which C<0> if the operation would succeed, or "
12777 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12781 #: ../fish/guestfish-actions.pod:3575
12786 #: ../fish/guestfish-actions.pod:3577
12789 " ntfsresize device\n"
12794 #: ../fish/guestfish-actions.pod:3579 ../fish/guestfish-actions.pod:3603 ../src/guestfs-actions.pod:5602 ../src/guestfs-actions.pod:5634
12796 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12797 "size of the underlying device."
12801 #: ../fish/guestfish-actions.pod:3582 ../src/guestfs-actions.pod:5605
12803 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
12804 "consistency check (for safety). You have to boot into Windows to perform "
12805 "this check and clear this condition. Furthermore, ntfsresize refuses to "
12806 "resize filesystems which have been marked in this way. So in effect it is "
12807 "not possible to call ntfsresize multiple times on a single filesystem "
12808 "without booting into Windows between each resize."
12812 #: ../fish/guestfish-actions.pod:3590 ../fish/guestfish-actions.pod:3629 ../src/guestfs-actions.pod:5613 ../src/guestfs-actions.pod:5660
12813 msgid "See also L<ntfsresize(8)>."
12817 #: ../fish/guestfish-actions.pod:3592 ../fish/guestfish-actions.pod:3640
12819 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
12824 #: ../fish/guestfish-actions.pod:3599
12825 msgid "ntfsresize-opts"
12829 #: ../fish/guestfish-actions.pod:3601
12832 " ntfsresize-opts device [size:N] [force:true|false]\n"
12837 #: ../fish/guestfish-actions.pod:3612 ../src/guestfs-actions.pod:5643
12839 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
12840 "resized to fit the container (eg. partition)."
12844 #: ../fish/guestfish-actions.pod:3615 ../src/guestfs-actions.pod:5646
12849 #: ../fish/guestfish-actions.pod:3617 ../src/guestfs-actions.pod:5648
12851 "If this option is true, then force the resize of the filesystem even if the "
12852 "filesystem is marked as requiring a consistency check."
12856 #: ../fish/guestfish-actions.pod:3620
12858 "After the resize operation, the filesystem is always marked as requiring a "
12859 "consistency check (for safety). You have to boot into Windows to perform "
12860 "this check and clear this condition. If you I<don't> set the C<force> "
12861 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
12862 "a single filesystem without booting into Windows between each resize."
12866 #: ../fish/guestfish-actions.pod:3633
12867 msgid "ntfsresize-size"
12871 #: ../fish/guestfish-actions.pod:3635
12874 " ntfsresize-size device size\n"
12879 #: ../fish/guestfish-actions.pod:3637
12881 "This command is the same as L</ntfsresize> except that it allows you to "
12882 "specify the new size (in bytes) explicitly."
12886 #: ../fish/guestfish-actions.pod:3647
12891 #: ../fish/guestfish-actions.pod:3649
12894 " part-add device prlogex startsect endsect\n"
12899 #: ../fish/guestfish-actions.pod:3651
12901 "This command adds a partition to C<device>. If there is no partition table "
12902 "on the device, call L</part-init> first."
12906 #: ../fish/guestfish-actions.pod:3654 ../src/guestfs-actions.pod:5721
12908 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12909 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12910 "C<logical>) and C<e> (or C<extended>) partition types."
12914 #: ../fish/guestfish-actions.pod:3659 ../src/guestfs-actions.pod:5726
12916 "C<startsect> and C<endsect> are the start and end of the partition in "
12917 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12918 "from the end of the disk (C<-1> is the last sector)."
12922 #: ../fish/guestfish-actions.pod:3663
12924 "Creating a partition which covers the whole disk is not so easy. Use "
12925 "L</part-disk> to do that."
12929 #: ../fish/guestfish-actions.pod:3666
12934 #: ../fish/guestfish-actions.pod:3668
12937 " part-del device partnum\n"
12942 #: ../fish/guestfish-actions.pod:3670 ../src/guestfs-actions.pod:5744
12943 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12947 #: ../fish/guestfish-actions.pod:3672 ../src/guestfs-actions.pod:5746
12949 "Note that in the case of MBR partitioning, deleting an extended partition "
12950 "also deletes any logical partitions it contains."
12954 #: ../fish/guestfish-actions.pod:3676
12959 #: ../fish/guestfish-actions.pod:3678
12962 " part-disk device parttype\n"
12967 #: ../fish/guestfish-actions.pod:3680
12969 "This command is simply a combination of L</part-init> followed by "
12970 "L</part-add> to create a single primary partition covering the whole disk."
12974 #: ../fish/guestfish-actions.pod:3684
12976 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12977 "possible values are described in L</part-init>."
12981 #: ../fish/guestfish-actions.pod:3687
12982 msgid "part-get-bootable"
12986 #: ../fish/guestfish-actions.pod:3689
12989 " part-get-bootable device partnum\n"
12994 #: ../fish/guestfish-actions.pod:3691 ../src/guestfs-actions.pod:5779
12996 "This command returns true if the partition C<partnum> on C<device> has the "
12997 "bootable flag set."
13001 #: ../fish/guestfish-actions.pod:3694
13002 msgid "See also L</part-set-bootable>."
13006 #: ../fish/guestfish-actions.pod:3696
13007 msgid "part-get-mbr-id"
13011 #: ../fish/guestfish-actions.pod:3698
13014 " part-get-mbr-id device partnum\n"
13019 #: ../fish/guestfish-actions.pod:3700 ../src/guestfs-actions.pod:5795
13021 "Returns the MBR type byte (also known as the ID byte) from the numbered "
13022 "partition C<partnum>."
13026 #: ../fish/guestfish-actions.pod:3703 ../fish/guestfish-actions.pod:3847
13028 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
13029 "undefined results for other partition table types (see "
13030 "L</part-get-parttype>)."
13034 #: ../fish/guestfish-actions.pod:3707
13035 msgid "part-get-parttype"
13039 #: ../fish/guestfish-actions.pod:3709
13042 " part-get-parttype device\n"
13047 #: ../fish/guestfish-actions.pod:3711 ../src/guestfs-actions.pod:5812
13049 "This command examines the partition table on C<device> and returns the "
13050 "partition table type (format) being used."
13054 #: ../fish/guestfish-actions.pod:3714
13056 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
13057 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
13058 "possible, although unusual. See L</part-init> for a full list."
13062 #: ../fish/guestfish-actions.pod:3719
13067 #: ../fish/guestfish-actions.pod:3721
13070 " part-init device parttype\n"
13075 #: ../fish/guestfish-actions.pod:3723 ../src/guestfs-actions.pod:5832
13077 "This creates an empty partition table on C<device> of one of the partition "
13078 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
13079 "(for large disks)."
13083 #: ../fish/guestfish-actions.pod:3727
13085 "Initially there are no partitions. Following this, you should call "
13086 "L</part-add> for each partition required."
13090 #: ../fish/guestfish-actions.pod:3730 ../src/guestfs-actions.pod:5839
13091 msgid "Possible values for C<parttype> are:"
13095 #: ../fish/guestfish-actions.pod:3734 ../src/guestfs-actions.pod:5843
13100 #: ../fish/guestfish-actions.pod:3736 ../src/guestfs-actions.pod:5845
13105 #: ../fish/guestfish-actions.pod:3738 ../src/guestfs-actions.pod:5847
13106 msgid "Intel EFI / GPT partition table."
13110 #: ../fish/guestfish-actions.pod:3740 ../src/guestfs-actions.pod:5849
13112 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
13113 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
13114 "the C<mbr> format."
13118 #: ../fish/guestfish-actions.pod:3744 ../src/guestfs-actions.pod:5853
13123 #: ../fish/guestfish-actions.pod:3746 ../src/guestfs-actions.pod:5855
13128 #: ../fish/guestfish-actions.pod:3748 ../src/guestfs-actions.pod:5857
13130 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
13131 "Windows. This partition type will B<only> work for device sizes up to 2 "
13132 "TB. For large disks we recommend using C<gpt>."
13136 #: ../fish/guestfish-actions.pod:3755 ../src/guestfs-actions.pod:5864
13137 msgid "Other partition table types that may work but are not supported include:"
13141 #: ../fish/guestfish-actions.pod:3760 ../src/guestfs-actions.pod:5869
13146 #: ../fish/guestfish-actions.pod:3762 ../src/guestfs-actions.pod:5871
13147 msgid "AIX disk labels."
13151 #: ../fish/guestfish-actions.pod:3764 ../src/guestfs-actions.pod:5873
13156 #: ../fish/guestfish-actions.pod:3766 ../src/guestfs-actions.pod:5875
13161 #: ../fish/guestfish-actions.pod:3768 ../src/guestfs-actions.pod:5877
13162 msgid "Amiga \"Rigid Disk Block\" format."
13166 #: ../fish/guestfish-actions.pod:3770 ../src/guestfs-actions.pod:5879
13171 #: ../fish/guestfish-actions.pod:3772 ../src/guestfs-actions.pod:5881
13172 msgid "BSD disk labels."
13176 #: ../fish/guestfish-actions.pod:3774 ../src/guestfs-actions.pod:5883
13181 #: ../fish/guestfish-actions.pod:3776 ../src/guestfs-actions.pod:5885
13182 msgid "DASD, used on IBM mainframes."
13186 #: ../fish/guestfish-actions.pod:3778 ../src/guestfs-actions.pod:5887
13191 #: ../fish/guestfish-actions.pod:3780 ../src/guestfs-actions.pod:5889
13192 msgid "MIPS/SGI volumes."
13196 #: ../fish/guestfish-actions.pod:3782 ../src/guestfs-actions.pod:5891
13201 #: ../fish/guestfish-actions.pod:3784 ../src/guestfs-actions.pod:5893
13202 msgid "Old Mac partition format. Modern Macs use C<gpt>."
13206 #: ../fish/guestfish-actions.pod:3786 ../src/guestfs-actions.pod:5895
13211 #: ../fish/guestfish-actions.pod:3788 ../src/guestfs-actions.pod:5897
13212 msgid "NEC PC-98 format, common in Japan apparently."
13216 #: ../fish/guestfish-actions.pod:3790 ../src/guestfs-actions.pod:5899
13221 #: ../fish/guestfish-actions.pod:3792 ../src/guestfs-actions.pod:5901
13222 msgid "Sun disk labels."
13226 #: ../fish/guestfish-actions.pod:3796
13231 #: ../fish/guestfish-actions.pod:3798
13234 " part-list device\n"
13239 #: ../fish/guestfish-actions.pod:3800 ../src/guestfs-actions.pod:5915
13241 "This command parses the partition table on C<device> and returns the list of "
13242 "partitions found."
13246 #: ../fish/guestfish-actions.pod:3803 ../src/guestfs-actions.pod:5918
13247 msgid "The fields in the returned structure are:"
13251 #: ../fish/guestfish-actions.pod:3807 ../src/guestfs-actions.pod:5922
13252 msgid "B<part_num>"
13256 #: ../fish/guestfish-actions.pod:3809 ../src/guestfs-actions.pod:5924
13257 msgid "Partition number, counting from 1."
13261 #: ../fish/guestfish-actions.pod:3811 ../src/guestfs-actions.pod:5926
13262 msgid "B<part_start>"
13266 #: ../fish/guestfish-actions.pod:3813
13268 "Start of the partition I<in bytes>. To get sectors you have to divide by "
13269 "the device's sector size, see L</blockdev-getss>."
13273 #: ../fish/guestfish-actions.pod:3816 ../src/guestfs-actions.pod:5931
13274 msgid "B<part_end>"
13278 #: ../fish/guestfish-actions.pod:3818 ../src/guestfs-actions.pod:5933
13279 msgid "End of the partition in bytes."
13283 #: ../fish/guestfish-actions.pod:3820 ../src/guestfs-actions.pod:5935
13284 msgid "B<part_size>"
13288 #: ../fish/guestfish-actions.pod:3822 ../src/guestfs-actions.pod:5937
13289 msgid "Size of the partition in bytes."
13293 #: ../fish/guestfish-actions.pod:3826
13294 msgid "part-set-bootable"
13298 #: ../fish/guestfish-actions.pod:3828
13301 " part-set-bootable device partnum true|false\n"
13306 #: ../fish/guestfish-actions.pod:3830 ../src/guestfs-actions.pod:5955
13308 "This sets the bootable flag on partition numbered C<partnum> on device "
13309 "C<device>. Note that partitions are numbered from 1."
13313 #: ../fish/guestfish-actions.pod:3833 ../src/guestfs-actions.pod:5958
13315 "The bootable flag is used by some operating systems (notably Windows) to "
13316 "determine which partition to boot from. It is by no means universally "
13321 #: ../fish/guestfish-actions.pod:3837
13322 msgid "part-set-mbr-id"
13326 #: ../fish/guestfish-actions.pod:3839
13329 " part-set-mbr-id device partnum idbyte\n"
13334 #: ../fish/guestfish-actions.pod:3841 ../src/guestfs-actions.pod:5974
13336 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
13337 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
13338 "documentation are in fact hexadecimal numbers, but usually documented "
13339 "without any leading \"0x\" which might be confusing."
13343 #: ../fish/guestfish-actions.pod:3851
13344 msgid "part-set-name"
13348 #: ../fish/guestfish-actions.pod:3853
13351 " part-set-name device partnum name\n"
13356 #: ../fish/guestfish-actions.pod:3855 ../src/guestfs-actions.pod:5996
13358 "This sets the partition name on partition numbered C<partnum> on device "
13359 "C<device>. Note that partitions are numbered from 1."
13363 #: ../fish/guestfish-actions.pod:3858 ../src/guestfs-actions.pod:5999
13365 "The partition name can only be set on certain types of partition table. "
13366 "This works on C<gpt> but not on C<mbr> partitions."
13370 #: ../fish/guestfish-actions.pod:3861
13371 msgid "part-to-dev"
13375 #: ../fish/guestfish-actions.pod:3863
13378 " part-to-dev partition\n"
13383 #: ../fish/guestfish-actions.pod:3865 ../src/guestfs-actions.pod:6012
13385 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
13386 "partition number, returning the device name (eg. \"/dev/sdb\")."
13390 #: ../fish/guestfish-actions.pod:3869 ../fish/guestfish-actions.pod:3881
13392 "The named partition must exist, for example as a string returned from "
13393 "L</list-partitions>."
13397 #: ../fish/guestfish-actions.pod:3872
13398 msgid "See also L</part-to-partnum>."
13402 #: ../fish/guestfish-actions.pod:3874
13403 msgid "part-to-partnum"
13407 #: ../fish/guestfish-actions.pod:3876
13410 " part-to-partnum partition\n"
13415 #: ../fish/guestfish-actions.pod:3878 ../src/guestfs-actions.pod:6032
13417 "This function takes a partition name (eg. \"/dev/sdb1\") and returns the "
13418 "partition number (eg. C<1>)."
13422 #: ../fish/guestfish-actions.pod:3884
13423 msgid "See also L</part-to-dev>."
13427 #: ../fish/guestfish-actions.pod:3886
13428 msgid "ping-daemon"
13432 #: ../fish/guestfish-actions.pod:3888
13440 #: ../fish/guestfish-actions.pod:3890 ../src/guestfs-actions.pod:6049
13442 "This is a test probe into the guestfs daemon running inside the qemu "
13443 "subprocess. Calling this function checks that the daemon responds to the "
13444 "ping message, without affecting the daemon or attached block device(s) in "
13449 #: ../fish/guestfish-actions.pod:3895
13454 #: ../fish/guestfish-actions.pod:3897
13457 " pread path count offset\n"
13462 #: ../fish/guestfish-actions.pod:3899 ../src/guestfs-actions.pod:6067
13464 "This command lets you read part of a file. It reads C<count> bytes of the "
13465 "file, starting at C<offset>, from file C<path>."
13469 #: ../fish/guestfish-actions.pod:3902 ../fish/guestfish-actions.pod:3917 ../src/guestfs-actions.pod:6070 ../src/guestfs-actions.pod:6096
13471 "This may read fewer bytes than requested. For further details see the "
13472 "L<pread(2)> system call."
13476 #: ../fish/guestfish-actions.pod:3905
13477 msgid "See also L</pwrite>, L</pread-device>."
13481 #: ../fish/guestfish-actions.pod:3910
13482 msgid "pread-device"
13486 #: ../fish/guestfish-actions.pod:3912
13489 " pread-device device count offset\n"
13494 #: ../fish/guestfish-actions.pod:3914 ../src/guestfs-actions.pod:6093
13496 "This command lets you read part of a file. It reads C<count> bytes of "
13497 "C<device>, starting at C<offset>."
13501 #: ../fish/guestfish-actions.pod:3920
13502 msgid "See also L</pread>."
13506 #: ../fish/guestfish-actions.pod:3925
13511 #: ../fish/guestfish-actions.pod:3927
13514 " pvcreate device\n"
13519 #: ../fish/guestfish-actions.pod:3929 ../src/guestfs-actions.pod:6116
13521 "This creates an LVM physical volume on the named C<device>, where C<device> "
13522 "should usually be a partition name such as C</dev/sda1>."
13526 #: ../fish/guestfish-actions.pod:3933
13531 #: ../fish/guestfish-actions.pod:3935
13534 " pvremove device\n"
13539 #: ../fish/guestfish-actions.pod:3937 ../src/guestfs-actions.pod:6130
13541 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13546 #: ../fish/guestfish-actions.pod:3940 ../src/guestfs-actions.pod:6133
13548 "The implementation uses the C<pvremove> command which refuses to wipe "
13549 "physical volumes that contain any volume groups, so you have to remove those "
13554 #: ../fish/guestfish-actions.pod:3944
13559 #: ../fish/guestfish-actions.pod:3946
13562 " pvresize device\n"
13567 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:6147
13569 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13570 "the new size of the underlying device."
13574 #: ../fish/guestfish-actions.pod:3951
13575 msgid "pvresize-size"
13579 #: ../fish/guestfish-actions.pod:3953
13582 " pvresize-size device size\n"
13587 #: ../fish/guestfish-actions.pod:3955
13589 "This command is the same as L</pvresize> except that it allows you to "
13590 "specify the new size (in bytes) explicitly."
13594 #: ../fish/guestfish-actions.pod:3958
13599 #: ../fish/guestfish-actions.pod:3960
13607 #: ../fish/guestfish-actions.pod:3962 ../src/guestfs-actions.pod:6173
13609 "List all the physical volumes detected. This is the equivalent of the "
13610 "L<pvs(8)> command."
13614 #: ../fish/guestfish-actions.pod:3965 ../src/guestfs-actions.pod:6176
13616 "This returns a list of just the device names that contain PVs "
13617 "(eg. C</dev/sda2>)."
13621 #: ../fish/guestfish-actions.pod:3968
13622 msgid "See also L</pvs-full>."
13626 #: ../fish/guestfish-actions.pod:3970
13631 #: ../fish/guestfish-actions.pod:3972
13639 #: ../fish/guestfish-actions.pod:3974 ../src/guestfs-actions.pod:6192
13641 "List all the physical volumes detected. This is the equivalent of the "
13642 "L<pvs(8)> command. The \"full\" version includes all fields."
13646 #: ../fish/guestfish-actions.pod:3977
13651 #: ../fish/guestfish-actions.pod:3979
13659 #: ../fish/guestfish-actions.pod:3981 ../src/guestfs-actions.pod:6207
13660 msgid "This command returns the UUID of the LVM PV C<device>."
13664 #: ../fish/guestfish-actions.pod:3983
13669 #: ../fish/guestfish-actions.pod:3985
13672 " pwrite path content offset\n"
13677 #: ../fish/guestfish-actions.pod:3987 ../src/guestfs-actions.pod:6223
13679 "This command writes to part of a file. It writes the data buffer C<content> "
13680 "to the file C<path> starting at offset C<offset>."
13684 #: ../fish/guestfish-actions.pod:3990 ../src/guestfs-actions.pod:6226
13686 "This command implements the L<pwrite(2)> system call, and like that system "
13687 "call it may not write the full data requested. The return value is the "
13688 "number of bytes that were actually written to the file. This could even be "
13689 "0, although short writes are unlikely for regular files in ordinary "
13694 #: ../fish/guestfish-actions.pod:3996
13695 msgid "See also L</pread>, L</pwrite-device>."
13699 #: ../fish/guestfish-actions.pod:4001
13700 msgid "pwrite-device"
13704 #: ../fish/guestfish-actions.pod:4003
13707 " pwrite-device device content offset\n"
13712 #: ../fish/guestfish-actions.pod:4005 ../src/guestfs-actions.pod:6250
13714 "This command writes to part of a device. It writes the data buffer "
13715 "C<content> to C<device> starting at offset C<offset>."
13719 #: ../fish/guestfish-actions.pod:4008 ../src/guestfs-actions.pod:6253
13721 "This command implements the L<pwrite(2)> system call, and like that system "
13722 "call it may not write the full data requested (although short writes to disk "
13723 "devices and partitions are probably impossible with standard Linux kernels)."
13727 #: ../fish/guestfish-actions.pod:4013
13728 msgid "See also L</pwrite>."
13732 #: ../fish/guestfish-actions.pod:4018
13737 #: ../fish/guestfish-actions.pod:4020
13740 " read-file path\n"
13745 #: ../fish/guestfish-actions.pod:4022 ../src/guestfs-actions.pod:6274
13746 msgid "This calls returns the contents of the file C<path> as a buffer."
13750 #: ../fish/guestfish-actions.pod:4025
13752 "Unlike L</cat>, this function can correctly handle files that contain "
13753 "embedded ASCII NUL characters. However unlike L</download>, this function "
13754 "is limited in the total size of file that can be handled."
13758 #: ../fish/guestfish-actions.pod:4033
13763 #: ../fish/guestfish-actions.pod:4035
13766 " read-lines path\n"
13771 #: ../fish/guestfish-actions.pod:4039 ../src/guestfs-actions.pod:6299
13773 "The file contents are returned as a list of lines. Trailing C<LF> and "
13774 "C<CRLF> character sequences are I<not> returned."
13778 #: ../fish/guestfish-actions.pod:4042
13780 "Note that this function cannot correctly handle binary files (specifically, "
13781 "files containing C<\\0> character which is treated as end of line). For "
13782 "those you need to use the L</read-file> function which has a more complex "
13787 #: ../fish/guestfish-actions.pod:4047
13792 #: ../fish/guestfish-actions.pod:4049
13800 #: ../fish/guestfish-actions.pod:4051 ../src/guestfs-actions.pod:6319
13801 msgid "This returns the list of directory entries in directory C<dir>."
13805 #: ../fish/guestfish-actions.pod:4053 ../src/guestfs-actions.pod:6321
13807 "All entries in the directory are returned, including C<.> and C<..>. The "
13808 "entries are I<not> sorted, but returned in the same order as the underlying "
13813 #: ../fish/guestfish-actions.pod:4057 ../src/guestfs-actions.pod:6325
13815 "Also this call returns basic file type information about each file. The "
13816 "C<ftyp> field will contain one of the following characters:"
13820 #: ../fish/guestfish-actions.pod:4062 ../src/guestfs-actions.pod:6330
13825 #: ../fish/guestfish-actions.pod:4064 ../src/guestfs-actions.pod:6332
13826 msgid "Block special"
13830 #: ../fish/guestfish-actions.pod:4066 ../src/guestfs-actions.pod:6334
13835 #: ../fish/guestfish-actions.pod:4068 ../src/guestfs-actions.pod:6336
13836 msgid "Char special"
13840 #: ../fish/guestfish-actions.pod:4070 ../src/guestfs-actions.pod:6338
13845 #: ../fish/guestfish-actions.pod:4072 ../src/guestfs-actions.pod:6340
13850 #: ../fish/guestfish-actions.pod:4074 ../src/guestfs-actions.pod:6342
13855 #: ../fish/guestfish-actions.pod:4076 ../src/guestfs-actions.pod:6344
13856 msgid "FIFO (named pipe)"
13860 #: ../fish/guestfish-actions.pod:4078 ../src/guestfs-actions.pod:6346
13865 #: ../fish/guestfish-actions.pod:4080 ../src/guestfs-actions.pod:6348
13866 msgid "Symbolic link"
13870 #: ../fish/guestfish-actions.pod:4082 ../src/guestfs-actions.pod:6350
13875 #: ../fish/guestfish-actions.pod:4084 ../src/guestfs-actions.pod:6352
13876 msgid "Regular file"
13880 #: ../fish/guestfish-actions.pod:4086 ../src/guestfs-actions.pod:6354
13885 #: ../fish/guestfish-actions.pod:4088 ../src/guestfs-actions.pod:6356
13890 #: ../fish/guestfish-actions.pod:4090 ../src/guestfs-actions.pod:6358
13895 #: ../fish/guestfish-actions.pod:4092 ../src/guestfs-actions.pod:6360
13896 msgid "Unknown file type"
13900 #: ../fish/guestfish-actions.pod:4094 ../src/guestfs-actions.pod:6362
13905 #: ../fish/guestfish-actions.pod:4096 ../src/guestfs-actions.pod:6364
13906 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13910 #: ../fish/guestfish-actions.pod:4101
13912 "This function is primarily intended for use by programs. To get a simple "
13913 "list of names, use L</ls>. To get a printable directory for human "
13914 "consumption, use L</ll>."
13918 #: ../fish/guestfish-actions.pod:4105
13923 #: ../fish/guestfish-actions.pod:4107
13931 #: ../fish/guestfish-actions.pod:4109 ../src/guestfs-actions.pod:6385
13932 msgid "This command reads the target of a symbolic link."
13936 #: ../fish/guestfish-actions.pod:4111
13937 msgid "readlinklist"
13941 #: ../fish/guestfish-actions.pod:4113
13944 " readlinklist path 'names ...'\n"
13949 #: ../fish/guestfish-actions.pod:4115 ../src/guestfs-actions.pod:6399
13951 "This call allows you to do a C<readlink> operation on multiple files, where "
13952 "all files are in the directory C<path>. C<names> is the list of files from "
13957 #: ../fish/guestfish-actions.pod:4119 ../src/guestfs-actions.pod:6403
13959 "On return you get a list of strings, with a one-to-one correspondence to the "
13960 "C<names> list. Each string is the value of the symbolic link."
13964 #: ../fish/guestfish-actions.pod:4123 ../src/guestfs-actions.pod:6407
13966 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13967 "result string is the empty string C<\"\">. However the whole operation is "
13968 "completed even if there were C<readlink(2)> errors, and so you can call this "
13969 "function with names where you don't know if they are symbolic links already "
13970 "(albeit slightly less efficient)."
13974 #: ../fish/guestfish-actions.pod:4130 ../src/guestfs-actions.pod:6414
13976 "This call is intended for programs that want to efficiently list a directory "
13977 "contents without making many round-trips. Very long directory listings "
13978 "might cause the protocol message size to be exceeded, causing this call to "
13979 "fail. The caller must split up such requests into smaller groups of names."
13983 #: ../fish/guestfish-actions.pod:4137
13988 #: ../fish/guestfish-actions.pod:4139
13996 #: ../fish/guestfish-actions.pod:4141 ../src/guestfs-actions.pod:6433
13998 "Return the canonicalized absolute pathname of C<path>. The returned path "
13999 "has no C<.>, C<..> or symbolic link path elements."
14003 #: ../fish/guestfish-actions.pod:4144
14004 msgid "removexattr"
14008 #: ../fish/guestfish-actions.pod:4146
14011 " removexattr xattr path\n"
14016 #: ../fish/guestfish-actions.pod:4148 ../src/guestfs-actions.pod:6448
14017 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
14021 #: ../fish/guestfish-actions.pod:4151
14022 msgid "See also: L</lremovexattr>, L<attr(5)>."
14026 #: ../fish/guestfish-actions.pod:4153
14031 #: ../fish/guestfish-actions.pod:4155
14034 " resize2fs device\n"
14039 #: ../fish/guestfish-actions.pod:4157 ../src/guestfs-actions.pod:6463
14041 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
14042 "underlying device."
14046 #: ../fish/guestfish-actions.pod:4160
14048 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
14049 "before calling this command. For unknown reasons C<resize2fs> sometimes "
14050 "gives an error about this and sometimes not. In any case, it is always safe "
14051 "to call L</e2fsck-f> before calling this function."
14055 #: ../fish/guestfish-actions.pod:4166
14056 msgid "resize2fs-M"
14060 #: ../fish/guestfish-actions.pod:4168
14063 " resize2fs-M device\n"
14068 #: ../fish/guestfish-actions.pod:4170
14070 "This command is the same as L</resize2fs>, but the filesystem is resized to "
14071 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
14076 #: ../fish/guestfish-actions.pod:4174
14078 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
14079 "and read the C<Block size> and C<Block count> values. These two numbers, "
14080 "multiplied together, give the resulting size of the minimal filesystem in "
14085 #: ../fish/guestfish-actions.pod:4179
14086 msgid "resize2fs-size"
14090 #: ../fish/guestfish-actions.pod:4181
14093 " resize2fs-size device size\n"
14098 #: ../fish/guestfish-actions.pod:4183
14100 "This command is the same as L</resize2fs> except that it allows you to "
14101 "specify the new size (in bytes) explicitly."
14105 #: ../fish/guestfish-actions.pod:4186
14110 #: ../fish/guestfish-actions.pod:4188
14118 #: ../fish/guestfish-actions.pod:4190 ../src/guestfs-actions.pod:6515
14119 msgid "Remove the single file C<path>."
14123 #: ../fish/guestfish-actions.pod:4192
14128 #: ../fish/guestfish-actions.pod:4194
14136 #: ../fish/guestfish-actions.pod:4196 ../src/guestfs-actions.pod:6527
14138 "Remove the file or directory C<path>, recursively removing the contents if "
14139 "its a directory. This is like the C<rm -rf> shell command."
14143 #: ../fish/guestfish-actions.pod:4200
14148 #: ../fish/guestfish-actions.pod:4202
14156 #: ../fish/guestfish-actions.pod:4204 ../src/guestfs-actions.pod:6541
14157 msgid "Remove the single directory C<path>."
14161 #: ../fish/guestfish-actions.pod:4206
14162 msgid "rmmountpoint"
14166 #: ../fish/guestfish-actions.pod:4208
14169 " rmmountpoint exemptpath\n"
14174 #: ../fish/guestfish-actions.pod:4210
14176 "This calls removes a mountpoint that was previously created with "
14177 "L</mkmountpoint>. See L</mkmountpoint> for full details."
14181 #: ../fish/guestfish-actions.pod:4214
14182 msgid "scrub-device"
14186 #: ../fish/guestfish-actions.pod:4216
14189 " scrub-device device\n"
14194 #: ../fish/guestfish-actions.pod:4218 ../src/guestfs-actions.pod:6567
14196 "This command writes patterns over C<device> to make data retrieval more "
14201 #: ../fish/guestfish-actions.pod:4221 ../fish/guestfish-actions.pod:4233 ../fish/guestfish-actions.pod:4246 ../src/guestfs-actions.pod:6570 ../src/guestfs-actions.pod:6588 ../src/guestfs-actions.pod:6607
14203 "It is an interface to the L<scrub(1)> program. See that manual page for "
14208 #: ../fish/guestfish-actions.pod:4224
14213 #: ../fish/guestfish-actions.pod:4226
14216 " scrub-file file\n"
14221 #: ../fish/guestfish-actions.pod:4228 ../src/guestfs-actions.pod:6583
14223 "This command writes patterns over a file to make data retrieval more "
14228 #: ../fish/guestfish-actions.pod:4231 ../src/guestfs-actions.pod:6586
14229 msgid "The file is I<removed> after scrubbing."
14233 #: ../fish/guestfish-actions.pod:4236
14234 msgid "scrub-freespace"
14238 #: ../fish/guestfish-actions.pod:4238
14241 " scrub-freespace dir\n"
14246 #: ../fish/guestfish-actions.pod:4240
14248 "This command creates the directory C<dir> and then fills it with files until "
14249 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
14250 "deletes them. The intention is to scrub any free space on the partition "
14251 "containing C<dir>."
14255 #: ../fish/guestfish-actions.pod:4249
14260 #: ../fish/guestfish-actions.pod:4251
14265 #: ../fish/guestfish-actions.pod:4253
14268 " set-append append\n"
14273 #: ../fish/guestfish-actions.pod:4255 ../src/guestfs-actions.pod:6620
14275 "This function is used to add additional options to the guest kernel command "
14280 #: ../fish/guestfish-actions.pod:4258 ../src/guestfs-actions.pod:6623
14282 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
14283 "environment variable."
14287 #: ../fish/guestfish-actions.pod:4261 ../src/guestfs-actions.pod:6626
14289 "Setting C<append> to C<NULL> means I<no> additional options are passed "
14290 "(libguestfs always adds a few of its own)."
14294 #: ../fish/guestfish-actions.pod:4264
14295 msgid "set-attach-method"
14299 #: ../fish/guestfish-actions.pod:4266
14300 msgid "attach-method"
14304 #: ../fish/guestfish-actions.pod:4268
14307 " set-attach-method attachmethod\n"
14312 #: ../fish/guestfish-actions.pod:4270 ../src/guestfs-actions.pod:6639
14314 "Set the method that libguestfs uses to connect to the back end guestfsd "
14315 "daemon. Possible methods are:"
14319 #: ../fish/guestfish-actions.pod:4275 ../src/guestfs-actions.pod:6644 ../src/guestfs.pod:2916
14320 msgid "C<appliance>"
14324 #: ../fish/guestfish-actions.pod:4277 ../src/guestfs-actions.pod:6646
14326 "Launch an appliance and connect to it. This is the ordinary method and the "
14331 #: ../fish/guestfish-actions.pod:4280 ../src/guestfs-actions.pod:6649
14332 msgid "C<unix:I<path>>"
14336 #: ../fish/guestfish-actions.pod:4282 ../src/guestfs-actions.pod:6651
14337 msgid "Connect to the Unix domain socket I<path>."
14341 #: ../fish/guestfish-actions.pod:4284 ../src/guestfs-actions.pod:6653
14343 "This method lets you connect to an existing daemon or (using virtio-serial) "
14344 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
14345 "RUNNING DAEMONS>."
14349 #: ../fish/guestfish-actions.pod:4290
14350 msgid "set-autosync"
14354 #: ../fish/guestfish-actions.pod:4292
14359 #: ../fish/guestfish-actions.pod:4294
14362 " set-autosync true|false\n"
14367 #: ../fish/guestfish-actions.pod:4296 ../src/guestfs-actions.pod:6669
14369 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
14370 "effort attempt to make filesystems consistent and synchronized when the "
14371 "handle is closed (also if the program exits without closing handles)."
14375 #: ../fish/guestfish-actions.pod:4301 ../src/guestfs-actions.pod:6674
14377 "This is enabled by default (since libguestfs 1.5.24, previously it was "
14378 "disabled by default)."
14382 #: ../fish/guestfish-actions.pod:4304
14387 #: ../fish/guestfish-actions.pod:4306
14392 #: ../fish/guestfish-actions.pod:4308
14395 " set-direct true|false\n"
14400 #: ../fish/guestfish-actions.pod:4310 ../src/guestfs-actions.pod:6687
14402 "If the direct appliance mode flag is enabled, then stdin and stdout are "
14403 "passed directly through to the appliance once it is launched."
14407 #: ../fish/guestfish-actions.pod:4314
14409 "One consequence of this is that log messages aren't caught by the library "
14410 "and handled by L</set-log-message-callback>, but go straight to stdout."
14414 #: ../fish/guestfish-actions.pod:4318 ../src/guestfs-actions.pod:6695
14415 msgid "You probably don't want to use this unless you know what you are doing."
14419 #: ../fish/guestfish-actions.pod:4321 ../src/guestfs-actions.pod:6698
14420 msgid "The default is disabled."
14424 #: ../fish/guestfish-actions.pod:4323
14425 msgid "set-e2label"
14429 #: ../fish/guestfish-actions.pod:4325
14432 " set-e2label device label\n"
14437 #: ../fish/guestfish-actions.pod:4327 ../src/guestfs-actions.pod:6711
14439 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
14440 "C<label>. Filesystem labels are limited to 16 characters."
14444 #: ../fish/guestfish-actions.pod:4331
14446 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
14447 "label on a filesystem."
14451 #: ../fish/guestfish-actions.pod:4334
14456 #: ../fish/guestfish-actions.pod:4336
14459 " set-e2uuid device uuid\n"
14464 #: ../fish/guestfish-actions.pod:4338 ../src/guestfs-actions.pod:6729
14466 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
14467 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
14468 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
14472 #: ../fish/guestfish-actions.pod:4343
14474 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
14475 "UUID of a filesystem."
14479 #: ../fish/guestfish-actions.pod:4346
14480 msgid "set-memsize"
14484 #: ../fish/guestfish-actions.pod:4348
14489 #: ../fish/guestfish-actions.pod:4350
14492 " set-memsize memsize\n"
14497 #: ../fish/guestfish-actions.pod:4352
14499 "This sets the memory size in megabytes allocated to the qemu subprocess. "
14500 "This only has any effect if called before L</launch>."
14504 #: ../fish/guestfish-actions.pod:4356 ../src/guestfs-actions.pod:6751
14506 "You can also change this by setting the environment variable "
14507 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
14511 #: ../fish/guestfish-actions.pod:4363
14512 msgid "set-network"
14516 #: ../fish/guestfish-actions.pod:4365
14521 #: ../fish/guestfish-actions.pod:4367
14524 " set-network true|false\n"
14529 #: ../fish/guestfish-actions.pod:4369 ../src/guestfs-actions.pod:6768
14531 "If C<network> is true, then the network is enabled in the libguestfs "
14532 "appliance. The default is false."
14536 #: ../fish/guestfish-actions.pod:4372 ../src/guestfs-actions.pod:6771
14538 "This affects whether commands are able to access the network (see "
14539 "L<guestfs(3)/RUNNING COMMANDS>)."
14543 #: ../fish/guestfish-actions.pod:4375
14544 msgid "You must call this before calling L</launch>, otherwise it has no effect."
14548 #: ../fish/guestfish-actions.pod:4378
14553 #: ../fish/guestfish-actions.pod:4382
14556 " set-path searchpath\n"
14561 #: ../fish/guestfish-actions.pod:4384 ../src/guestfs-actions.pod:6787
14562 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14566 #: ../fish/guestfish-actions.pod:4386 ../src/guestfs-actions.pod:6789
14568 "The default is C<$libdir/guestfs> unless overridden by setting "
14569 "C<LIBGUESTFS_PATH> environment variable."
14573 #: ../fish/guestfish-actions.pod:4389 ../src/guestfs-actions.pod:6792
14574 msgid "Setting C<path> to C<NULL> restores the default path."
14578 #: ../fish/guestfish-actions.pod:4391
14583 #: ../fish/guestfish-actions.pod:4393
14588 #: ../fish/guestfish-actions.pod:4395
14591 " set-pgroup true|false\n"
14596 #: ../fish/guestfish-actions.pod:4397 ../src/guestfs-actions.pod:6804
14598 "If C<pgroup> is true, child processes are placed into their own process "
14603 #: ../fish/guestfish-actions.pod:4400 ../src/guestfs-actions.pod:6807
14605 "The practical upshot of this is that signals like C<SIGINT> (from users "
14606 "pressing C<^C>) won't be received by the child process."
14610 #: ../fish/guestfish-actions.pod:4403 ../src/guestfs-actions.pod:6810
14612 "The default for this flag is false, because usually you want C<^C> to kill "
14617 #: ../fish/guestfish-actions.pod:4406
14622 #: ../fish/guestfish-actions.pod:4408
14627 #: ../fish/guestfish-actions.pod:4410
14635 #: ../fish/guestfish-actions.pod:4412 ../src/guestfs-actions.pod:6823
14636 msgid "Set the qemu binary that we will use."
14640 #: ../fish/guestfish-actions.pod:4414 ../src/guestfs-actions.pod:6825
14641 msgid "The default is chosen when the library was compiled by the configure script."
14645 #: ../fish/guestfish-actions.pod:4417 ../src/guestfs-actions.pod:6828
14647 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
14652 #: ../fish/guestfish-actions.pod:4420 ../src/guestfs-actions.pod:6831
14653 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
14657 #: ../fish/guestfish-actions.pod:4422 ../src/guestfs-actions.pod:6833
14659 "Note that you should call this function as early as possible after creating "
14660 "the handle. This is because some pre-launch operations depend on testing "
14661 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
14662 "don't retest features, and so you might see inconsistent results. Using the "
14663 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
14664 "the qemu binary at the same time as the handle is created."
14668 #: ../fish/guestfish-actions.pod:4430
14669 msgid "set-recovery-proc"
14673 #: ../fish/guestfish-actions.pod:4432
14674 msgid "recovery-proc"
14678 #: ../fish/guestfish-actions.pod:4434
14681 " set-recovery-proc true|false\n"
14686 #: ../fish/guestfish-actions.pod:4436
14688 "If this is called with the parameter C<false> then L</launch> does not "
14689 "create a recovery process. The purpose of the recovery process is to stop "
14690 "runaway qemu processes in the case where the main program aborts abruptly."
14694 #: ../fish/guestfish-actions.pod:4441
14696 "This only has any effect if called before L</launch>, and the default is "
14701 #: ../fish/guestfish-actions.pod:4444 ../src/guestfs-actions.pod:6859
14703 "About the only time when you would want to disable this is if the main "
14704 "process will fork itself into the background (\"daemonize\" itself). In "
14705 "this case the recovery process thinks that the main program has disappeared "
14706 "and so kills qemu, which is not very helpful."
14710 #: ../fish/guestfish-actions.pod:4450
14711 msgid "set-selinux"
14715 #: ../fish/guestfish-actions.pod:4452
14720 #: ../fish/guestfish-actions.pod:4454
14723 " set-selinux true|false\n"
14728 #: ../fish/guestfish-actions.pod:4456 ../src/guestfs-actions.pod:6875
14730 "This sets the selinux flag that is passed to the appliance at boot time. "
14731 "The default is C<selinux=0> (disabled)."
14735 #: ../fish/guestfish-actions.pod:4459 ../src/guestfs-actions.pod:6878
14737 "Note that if SELinux is enabled, it is always in Permissive mode "
14738 "(C<enforcing=0>)."
14742 #: ../fish/guestfish-actions.pod:4465
14747 #: ../fish/guestfish-actions.pod:4467
14752 #: ../fish/guestfish-actions.pod:4469
14760 #: ../fish/guestfish-actions.pod:4471 ../src/guestfs-actions.pod:6894
14762 "Change the number of virtual CPUs assigned to the appliance. The default is "
14763 "C<1>. Increasing this may improve performance, though often it has no "
14768 #: ../fish/guestfish-actions.pod:4475
14769 msgid "This function must be called before L</launch>."
14773 #: ../fish/guestfish-actions.pod:4477
14778 #: ../fish/guestfish-actions.pod:4479
14783 #: ../fish/guestfish-actions.pod:4481
14786 " set-trace true|false\n"
14791 #: ../fish/guestfish-actions.pod:4483 ../src/guestfs-actions.pod:6910
14793 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
14794 "return values are traced."
14798 #: ../fish/guestfish-actions.pod:4486 ../src/guestfs-actions.pod:6913
14800 "If you want to trace C API calls into libguestfs (and other libraries) then "
14801 "possibly a better way is to use the external ltrace(1) command."
14805 #: ../fish/guestfish-actions.pod:4490 ../src/guestfs-actions.pod:6917
14807 "Command traces are disabled unless the environment variable "
14808 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14812 #: ../fish/guestfish-actions.pod:4493
14814 "Trace messages are normally sent to C<stderr>, unless you register a "
14815 "callback to send them somewhere else (see L</set-event-callback>)."
14819 #: ../fish/guestfish-actions.pod:4497
14820 msgid "set-verbose"
14824 #: ../fish/guestfish-actions.pod:4499
14829 #: ../fish/guestfish-actions.pod:4501
14832 " set-verbose true|false\n"
14837 #: ../fish/guestfish-actions.pod:4503 ../src/guestfs-actions.pod:6934
14838 msgid "If C<verbose> is true, this turns on verbose messages."
14842 #: ../fish/guestfish-actions.pod:4505 ../src/guestfs-actions.pod:6936
14844 "Verbose messages are disabled unless the environment variable "
14845 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14849 #: ../fish/guestfish-actions.pod:4508
14851 "Verbose messages are normally sent to C<stderr>, unless you register a "
14852 "callback to send them somewhere else (see L</set-event-callback>)."
14856 #: ../fish/guestfish-actions.pod:4512
14861 #: ../fish/guestfish-actions.pod:4514
14864 " setcon context\n"
14869 #: ../fish/guestfish-actions.pod:4516 ../src/guestfs-actions.pod:6953
14871 "This sets the SELinux security context of the daemon to the string "
14876 #: ../fish/guestfish-actions.pod:4519 ../src/guestfs-actions.pod:6956
14877 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14881 #: ../fish/guestfish-actions.pod:4521
14886 #: ../fish/guestfish-actions.pod:4523
14889 " setxattr xattr val vallen path\n"
14894 #: ../fish/guestfish-actions.pod:4525 ../src/guestfs-actions.pod:6971
14896 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14897 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14901 #: ../fish/guestfish-actions.pod:4529
14902 msgid "See also: L</lsetxattr>, L<attr(5)>."
14906 #: ../fish/guestfish-actions.pod:4531
14911 #: ../fish/guestfish-actions.pod:4533
14914 " sfdisk device cyls heads sectors 'lines ...'\n"
14919 #: ../fish/guestfish-actions.pod:4535 ../src/guestfs-actions.pod:6998
14921 "This is a direct interface to the L<sfdisk(8)> program for creating "
14922 "partitions on block devices."
14926 #: ../fish/guestfish-actions.pod:4538 ../src/guestfs-actions.pod:7001
14927 msgid "C<device> should be a block device, for example C</dev/sda>."
14931 #: ../fish/guestfish-actions.pod:4540 ../src/guestfs-actions.pod:7003
14933 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14934 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
14935 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14936 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14937 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14938 "the kernel) cannot work out the right geometry and you will need to tell it."
14942 #: ../fish/guestfish-actions.pod:4548 ../src/guestfs-actions.pod:7011
14944 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14945 "refer to the L<sfdisk(8)> manpage."
14949 #: ../fish/guestfish-actions.pod:4551 ../src/guestfs-actions.pod:7014
14951 "To create a single partition occupying the whole disk, you would pass "
14952 "C<lines> as a single element list, when the single element being the string "
14957 #: ../fish/guestfish-actions.pod:4555
14958 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
14962 #: ../fish/guestfish-actions.pod:4558 ../fish/guestfish-actions.pod:4578 ../fish/guestfish-actions.pod:4597
14964 "I<This function is deprecated.> In new code, use the L</part_add> call "
14969 #: ../fish/guestfish-actions.pod:4565
14974 #: ../fish/guestfish-actions.pod:4567
14977 " sfdiskM device 'lines ...'\n"
14982 #: ../fish/guestfish-actions.pod:4569
14984 "This is a simplified interface to the L</sfdisk> command, where partition "
14985 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
14986 "you don't need to specify the cyls, heads and sectors parameters which were "
14987 "rarely if ever used anyway."
14991 #: ../fish/guestfish-actions.pod:4575
14992 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
14996 #: ../fish/guestfish-actions.pod:4585
15001 #: ../fish/guestfish-actions.pod:4587
15004 " sfdisk-N device partnum cyls heads sectors line\n"
15009 #: ../fish/guestfish-actions.pod:4589 ../src/guestfs-actions.pod:7070
15011 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
15012 "(note: C<n> counts from 1)."
15016 #: ../fish/guestfish-actions.pod:4592
15018 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
15019 "cyls/heads/sectors parameters."
15023 #: ../fish/guestfish-actions.pod:4595
15024 msgid "See also: L</part-add>"
15028 #: ../fish/guestfish-actions.pod:4604
15029 msgid "sfdisk-disk-geometry"
15033 #: ../fish/guestfish-actions.pod:4606
15036 " sfdisk-disk-geometry device\n"
15041 #: ../fish/guestfish-actions.pod:4608
15043 "This displays the disk geometry of C<device> read from the partition table. "
15044 "Especially in the case where the underlying block device has been resized, "
15045 "this can be different from the kernel's idea of the geometry (see "
15046 "L</sfdisk-kernel-geometry>)."
15050 #: ../fish/guestfish-actions.pod:4613 ../fish/guestfish-actions.pod:4622 ../src/guestfs-actions.pod:7093 ../src/guestfs-actions.pod:7109
15051 msgid "The result is in human-readable format, and not designed to be parsed."
15055 #: ../fish/guestfish-actions.pod:4616
15056 msgid "sfdisk-kernel-geometry"
15060 #: ../fish/guestfish-actions.pod:4618
15063 " sfdisk-kernel-geometry device\n"
15068 #: ../fish/guestfish-actions.pod:4620 ../src/guestfs-actions.pod:7107
15069 msgid "This displays the kernel's idea of the geometry of C<device>."
15073 #: ../fish/guestfish-actions.pod:4625
15078 #: ../fish/guestfish-actions.pod:4627
15081 " sfdisk-l device\n"
15086 #: ../fish/guestfish-actions.pod:4629 ../src/guestfs-actions.pod:7130
15088 "This displays the partition table on C<device>, in the human-readable output "
15089 "of the L<sfdisk(8)> command. It is not intended to be parsed."
15093 #: ../fish/guestfish-actions.pod:4633
15094 msgid "See also: L</part-list>"
15098 #: ../fish/guestfish-actions.pod:4635
15100 "I<This function is deprecated.> In new code, use the L</part_list> call "
15105 #: ../fish/guestfish-actions.pod:4642
15110 #: ../fish/guestfish-actions.pod:4644
15118 #: ../fish/guestfish-actions.pod:4646 ../src/guestfs-actions.pod:7147
15120 "This call runs a command from the guest filesystem via the guest's "
15125 #: ../fish/guestfish-actions.pod:4649
15126 msgid "This is like L</command>, but passes the command to:"
15130 #: ../fish/guestfish-actions.pod:4651 ../src/guestfs-actions.pod:7152
15133 " /bin/sh -c \"command\"\n"
15138 #: ../fish/guestfish-actions.pod:4653 ../src/guestfs-actions.pod:7154
15140 "Depending on the guest's shell, this usually results in wildcards being "
15141 "expanded, shell expressions being interpolated and so on."
15145 #: ../fish/guestfish-actions.pod:4657
15146 msgid "All the provisos about L</command> apply to this call."
15150 #: ../fish/guestfish-actions.pod:4659
15155 #: ../fish/guestfish-actions.pod:4661
15158 " sh-lines command\n"
15163 #: ../fish/guestfish-actions.pod:4663
15164 msgid "This is the same as L</sh>, but splits the result into a list of lines."
15168 #: ../fish/guestfish-actions.pod:4666
15169 msgid "See also: L</command-lines>"
15173 #: ../fish/guestfish-actions.pod:4668
15178 #: ../fish/guestfish-actions.pod:4670
15186 #: ../fish/guestfish-actions.pod:4672 ../src/guestfs-actions.pod:7188
15187 msgid "Sleep for C<secs> seconds."
15191 #: ../fish/guestfish-actions.pod:4674
15196 #: ../fish/guestfish-actions.pod:4676
15204 #: ../fish/guestfish-actions.pod:4680 ../src/guestfs-actions.pod:7202
15205 msgid "This is the same as the C<stat(2)> system call."
15209 #: ../fish/guestfish-actions.pod:4682
15214 #: ../fish/guestfish-actions.pod:4684
15222 #: ../fish/guestfish-actions.pod:4686 ../src/guestfs-actions.pod:7216
15224 "Returns file system statistics for any mounted file system. C<path> should "
15225 "be a file or directory in the mounted file system (typically it is the mount "
15226 "point itself, but it doesn't need to be)."
15230 #: ../fish/guestfish-actions.pod:4690 ../src/guestfs-actions.pod:7220
15231 msgid "This is the same as the C<statvfs(2)> system call."
15235 #: ../fish/guestfish-actions.pod:4692
15240 #: ../fish/guestfish-actions.pod:4694
15248 #: ../fish/guestfish-actions.pod:4696 ../src/guestfs-actions.pod:7234
15250 "This runs the L<strings(1)> command on a file and returns the list of "
15251 "printable strings found."
15255 #: ../fish/guestfish-actions.pod:4702
15260 #: ../fish/guestfish-actions.pod:4704
15263 " strings-e encoding path\n"
15268 #: ../fish/guestfish-actions.pod:4706
15270 "This is like the L</strings> command, but allows you to specify the encoding "
15271 "of strings that are looked for in the source file C<path>."
15275 #: ../fish/guestfish-actions.pod:4710 ../src/guestfs-actions.pod:7257
15276 msgid "Allowed encodings are:"
15280 #: ../fish/guestfish-actions.pod:4714 ../src/guestfs-actions.pod:7261
15285 #: ../fish/guestfish-actions.pod:4716
15287 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
15288 "ISO-8859-X (this is what L</strings> uses)."
15292 #: ../fish/guestfish-actions.pod:4719 ../src/guestfs-actions.pod:7266
15297 #: ../fish/guestfish-actions.pod:4721 ../src/guestfs-actions.pod:7268
15298 msgid "Single 8-bit-byte characters."
15302 #: ../fish/guestfish-actions.pod:4723 ../src/guestfs-actions.pod:7270
15307 #: ../fish/guestfish-actions.pod:4725 ../src/guestfs-actions.pod:7272
15308 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
15312 #: ../fish/guestfish-actions.pod:4728 ../src/guestfs-actions.pod:7275
15313 msgid "l (lower case letter L)"
15317 #: ../fish/guestfish-actions.pod:4730 ../src/guestfs-actions.pod:7277
15319 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
15320 "examining binaries in Windows guests."
15324 #: ../fish/guestfish-actions.pod:4733 ../src/guestfs-actions.pod:7280
15329 #: ../fish/guestfish-actions.pod:4735 ../src/guestfs-actions.pod:7282
15330 msgid "32-bit big endian such as UCS-4BE."
15334 #: ../fish/guestfish-actions.pod:4737 ../src/guestfs-actions.pod:7284
15339 #: ../fish/guestfish-actions.pod:4739 ../src/guestfs-actions.pod:7286
15340 msgid "32-bit little endian such as UCS-4LE."
15344 #: ../fish/guestfish-actions.pod:4743 ../src/guestfs-actions.pod:7290
15345 msgid "The returned strings are transcoded to UTF-8."
15349 #: ../fish/guestfish-actions.pod:4748
15350 msgid "swapoff-device"
15354 #: ../fish/guestfish-actions.pod:4750
15357 " swapoff-device device\n"
15362 #: ../fish/guestfish-actions.pod:4752
15364 "This command disables the libguestfs appliance swap device or partition "
15365 "named C<device>. See L</swapon-device>."
15369 #: ../fish/guestfish-actions.pod:4756
15370 msgid "swapoff-file"
15374 #: ../fish/guestfish-actions.pod:4758
15377 " swapoff-file file\n"
15382 #: ../fish/guestfish-actions.pod:4760 ../src/guestfs-actions.pod:7321
15383 msgid "This command disables the libguestfs appliance swap on file."
15387 #: ../fish/guestfish-actions.pod:4762
15388 msgid "swapoff-label"
15392 #: ../fish/guestfish-actions.pod:4764
15395 " swapoff-label label\n"
15400 #: ../fish/guestfish-actions.pod:4766 ../src/guestfs-actions.pod:7333
15402 "This command disables the libguestfs appliance swap on labeled swap "
15407 #: ../fish/guestfish-actions.pod:4769
15408 msgid "swapoff-uuid"
15412 #: ../fish/guestfish-actions.pod:4771
15415 " swapoff-uuid uuid\n"
15420 #: ../fish/guestfish-actions.pod:4773 ../src/guestfs-actions.pod:7346
15422 "This command disables the libguestfs appliance swap partition with the given "
15427 #: ../fish/guestfish-actions.pod:4776
15428 msgid "swapon-device"
15432 #: ../fish/guestfish-actions.pod:4778
15435 " swapon-device device\n"
15440 #: ../fish/guestfish-actions.pod:4780
15442 "This command enables the libguestfs appliance to use the swap device or "
15443 "partition named C<device>. The increased memory is made available for all "
15444 "commands, for example those run using L</command> or L</sh>."
15448 #: ../fish/guestfish-actions.pod:4785 ../src/guestfs-actions.pod:7364
15450 "Note that you should not swap to existing guest swap partitions unless you "
15451 "know what you are doing. They may contain hibernation information, or other "
15452 "information that the guest doesn't want you to trash. You also risk leaking "
15453 "information about the host to the guest this way. Instead, attach a new "
15454 "host device to the guest and swap on that."
15458 #: ../fish/guestfish-actions.pod:4792
15459 msgid "swapon-file"
15463 #: ../fish/guestfish-actions.pod:4794
15466 " swapon-file file\n"
15471 #: ../fish/guestfish-actions.pod:4796
15472 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
15476 #: ../fish/guestfish-actions.pod:4799
15477 msgid "swapon-label"
15481 #: ../fish/guestfish-actions.pod:4801
15484 " swapon-label label\n"
15489 #: ../fish/guestfish-actions.pod:4803
15491 "This command enables swap to a labeled swap partition. See "
15492 "L</swapon-device> for other notes."
15496 #: ../fish/guestfish-actions.pod:4806
15497 msgid "swapon-uuid"
15501 #: ../fish/guestfish-actions.pod:4808
15504 " swapon-uuid uuid\n"
15509 #: ../fish/guestfish-actions.pod:4810
15511 "This command enables swap to a swap partition with the given UUID. See "
15512 "L</swapon-device> for other notes."
15516 #: ../fish/guestfish-actions.pod:4813
15521 #: ../fish/guestfish-actions.pod:4815
15529 #: ../fish/guestfish-actions.pod:4817 ../src/guestfs-actions.pod:7419
15531 "This syncs the disk, so that any writes are flushed through to the "
15532 "underlying disk image."
15536 #: ../fish/guestfish-actions.pod:4820 ../src/guestfs-actions.pod:7422
15538 "You should always call this if you have modified a disk image, before "
15539 "closing the handle."
15543 #: ../fish/guestfish-actions.pod:4823
15548 #: ../fish/guestfish-actions.pod:4825
15556 #: ../fish/guestfish-actions.pod:4827 ../src/guestfs-actions.pod:7435
15557 msgid "This command returns up to the last 10 lines of a file as a list of strings."
15561 #: ../fish/guestfish-actions.pod:4833
15566 #: ../fish/guestfish-actions.pod:4835
15569 " tail-n nrlines path\n"
15574 #: ../fish/guestfish-actions.pod:4837 ../src/guestfs-actions.pod:7454
15576 "If the parameter C<nrlines> is a positive number, this returns the last "
15577 "C<nrlines> lines of the file C<path>."
15581 #: ../fish/guestfish-actions.pod:4840 ../src/guestfs-actions.pod:7457
15583 "If the parameter C<nrlines> is a negative number, this returns lines from "
15584 "the file C<path>, starting with the C<-nrlines>th line."
15588 #: ../fish/guestfish-actions.pod:4848
15593 #: ../fish/guestfish-actions.pod:4850
15596 " tar-in (tarfile|-) directory\n"
15601 #: ../fish/guestfish-actions.pod:4852 ../src/guestfs-actions.pod:7478
15603 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
15604 "tar file) into C<directory>."
15608 #: ../fish/guestfish-actions.pod:4855
15609 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
15613 #: ../fish/guestfish-actions.pod:4860
15618 #: ../fish/guestfish-actions.pod:4862
15621 " tar-out directory (tarfile|-)\n"
15626 #: ../fish/guestfish-actions.pod:4864 ../src/guestfs-actions.pod:7495
15628 "This command packs the contents of C<directory> and downloads it to local "
15633 #: ../fish/guestfish-actions.pod:4867
15634 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
15638 #: ../fish/guestfish-actions.pod:4872
15643 #: ../fish/guestfish-actions.pod:4874
15646 " tgz-in (tarball|-) directory\n"
15651 #: ../fish/guestfish-actions.pod:4876 ../src/guestfs-actions.pod:7512
15653 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
15654 "tar file) into C<directory>."
15658 #: ../fish/guestfish-actions.pod:4879
15659 msgid "To upload an uncompressed tarball, use L</tar-in>."
15663 #: ../fish/guestfish-actions.pod:4883
15668 #: ../fish/guestfish-actions.pod:4885
15671 " tgz-out directory (tarball|-)\n"
15676 #: ../fish/guestfish-actions.pod:4887 ../src/guestfs-actions.pod:7528
15678 "This command packs the contents of C<directory> and downloads it to local "
15683 #: ../fish/guestfish-actions.pod:4890
15684 msgid "To download an uncompressed tarball, use L</tar-out>."
15688 #: ../fish/guestfish-actions.pod:4894
15693 #: ../fish/guestfish-actions.pod:4896
15701 #: ../fish/guestfish-actions.pod:4898 ../src/guestfs-actions.pod:7543
15703 "Touch acts like the L<touch(1)> command. It can be used to update the "
15704 "timestamps on a file, or, if the file does not exist, to create a new "
15705 "zero-length file."
15709 #: ../fish/guestfish-actions.pod:4902 ../src/guestfs-actions.pod:7547
15711 "This command only works on regular files, and will fail on other file types "
15712 "such as directories, symbolic links, block special etc."
15716 #: ../fish/guestfish-actions.pod:4905
15721 #: ../fish/guestfish-actions.pod:4907
15729 #: ../fish/guestfish-actions.pod:4909 ../src/guestfs-actions.pod:7560
15731 "This command truncates C<path> to a zero-length file. The file must exist "
15736 #: ../fish/guestfish-actions.pod:4912
15737 msgid "truncate-size"
15741 #: ../fish/guestfish-actions.pod:4914
15744 " truncate-size path size\n"
15749 #: ../fish/guestfish-actions.pod:4916 ../src/guestfs-actions.pod:7574
15751 "This command truncates C<path> to size C<size> bytes. The file must exist "
15756 #: ../fish/guestfish-actions.pod:4919
15758 "If the current file size is less than C<size> then the file is extended to "
15759 "the required size with zero bytes. This creates a sparse file (ie. disk "
15760 "blocks are not allocated for the file until you write to it). To create a "
15761 "non-sparse file of zeroes, use L</fallocate64> instead."
15765 #: ../fish/guestfish-actions.pod:4925
15770 #: ../fish/guestfish-actions.pod:4927
15773 " tune2fs-l device\n"
15778 #: ../fish/guestfish-actions.pod:4929 ../src/guestfs-actions.pod:7593
15780 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15785 #: ../fish/guestfish-actions.pod:4932 ../src/guestfs-actions.pod:7596
15787 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15788 "for more details. The list of fields returned isn't clearly defined, and "
15789 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15790 "and the filesystem itself."
15794 #: ../fish/guestfish-actions.pod:4937
15799 #: ../fish/guestfish-actions.pod:4939
15802 " txz-in (tarball|-) directory\n"
15807 #: ../fish/guestfish-actions.pod:4941 ../src/guestfs-actions.pod:7616
15809 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15810 "tar file) into C<directory>."
15814 #: ../fish/guestfish-actions.pod:4946
15819 #: ../fish/guestfish-actions.pod:4948
15822 " txz-out directory (tarball|-)\n"
15827 #: ../fish/guestfish-actions.pod:4950 ../src/guestfs-actions.pod:7630
15829 "This command packs the contents of C<directory> and downloads it to local "
15830 "file C<tarball> (as an xz compressed tar archive)."
15834 #: ../fish/guestfish-actions.pod:4955
15839 #: ../fish/guestfish-actions.pod:4957
15847 #: ../fish/guestfish-actions.pod:4959 ../src/guestfs-actions.pod:7643
15849 "This function sets the mask used for creating new files and device nodes to "
15854 #: ../fish/guestfish-actions.pod:4962 ../src/guestfs-actions.pod:7646
15856 "Typical umask values would be C<022> which creates new files with "
15857 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15858 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15862 #: ../fish/guestfish-actions.pod:4967 ../src/guestfs-actions.pod:7651
15864 "The default umask is C<022>. This is important because it means that "
15865 "directories and device nodes will be created with C<0644> or C<0755> mode "
15866 "even if you specify C<0777>."
15870 #: ../fish/guestfish-actions.pod:4971
15871 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
15875 #: ../fish/guestfish-actions.pod:4974 ../src/guestfs-actions.pod:7658
15876 msgid "This call returns the previous umask."
15880 #: ../fish/guestfish-actions.pod:4976
15885 #: ../fish/guestfish-actions.pod:4978
15890 #: ../fish/guestfish-actions.pod:4980
15893 " umount pathordevice\n"
15898 #: ../fish/guestfish-actions.pod:4982 ../src/guestfs-actions.pod:7670
15900 "This unmounts the given filesystem. The filesystem may be specified either "
15901 "by its mountpoint (path) or the device which contains the filesystem."
15905 #: ../fish/guestfish-actions.pod:4986
15910 #: ../fish/guestfish-actions.pod:4988
15911 msgid "unmount-all"
15915 #: ../fish/guestfish-actions.pod:4990
15923 #: ../fish/guestfish-actions.pod:4992 ../src/guestfs-actions.pod:7683
15924 msgid "This unmounts all mounted filesystems."
15928 #: ../fish/guestfish-actions.pod:4994 ../src/guestfs-actions.pod:7685
15929 msgid "Some internal mounts are not unmounted by this call."
15933 #: ../fish/guestfish-actions.pod:4996
15938 #: ../fish/guestfish-actions.pod:4998
15941 " upload (filename|-) remotefilename\n"
15946 #: ../fish/guestfish-actions.pod:5000 ../fish/guestfish-actions.pod:5013 ../src/guestfs-actions.pod:7698 ../src/guestfs-actions.pod:7722
15947 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15951 #: ../fish/guestfish-actions.pod:5005
15952 msgid "See also L</download>."
15956 #: ../fish/guestfish-actions.pod:5009
15957 msgid "upload-offset"
15961 #: ../fish/guestfish-actions.pod:5011
15964 " upload-offset (filename|-) remotefilename offset\n"
15969 #: ../fish/guestfish-actions.pod:5016 ../src/guestfs-actions.pod:7725
15971 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15972 "The intention is to overwrite parts of existing files or devices, although "
15973 "if a non-existant file is specified then it is created with a \"hole\" "
15974 "before C<offset>. The size of the data written is implicit in the size of "
15975 "the source C<filename>."
15979 #: ../fish/guestfish-actions.pod:5023
15981 "Note that there is no limit on the amount of data that can be uploaded with "
15982 "this call, unlike with L</pwrite>, and this call always writes the full "
15983 "amount unless an error occurs."
15987 #: ../fish/guestfish-actions.pod:5028
15988 msgid "See also L</upload>, L</pwrite>."
15992 #: ../fish/guestfish-actions.pod:5032
15997 #: ../fish/guestfish-actions.pod:5034
16000 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
16005 #: ../fish/guestfish-actions.pod:5036 ../src/guestfs-actions.pod:7758
16006 msgid "This command sets the timestamps of a file with nanosecond precision."
16010 #: ../fish/guestfish-actions.pod:5039 ../src/guestfs-actions.pod:7761
16012 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
16017 #: ../fish/guestfish-actions.pod:5042 ../src/guestfs-actions.pod:7764
16019 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
16020 "nanoseconds from the epoch."
16024 #: ../fish/guestfish-actions.pod:5045 ../src/guestfs-actions.pod:7767
16026 "If the C<*nsecs> field contains the special value C<-1> then the "
16027 "corresponding timestamp is set to the current time. (The C<*secs> field is "
16028 "ignored in this case)."
16032 #: ../fish/guestfish-actions.pod:5049 ../src/guestfs-actions.pod:7771
16034 "If the C<*nsecs> field contains the special value C<-2> then the "
16035 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
16040 #: ../fish/guestfish-actions.pod:5053
16045 #: ../fish/guestfish-actions.pod:5055
16053 #: ../fish/guestfish-actions.pod:5057 ../src/guestfs-actions.pod:7784
16054 msgid "Return the libguestfs version number that the program is linked against."
16058 #: ../fish/guestfish-actions.pod:5060 ../src/guestfs-actions.pod:7787
16060 "Note that because of dynamic linking this is not necessarily the version of "
16061 "libguestfs that you compiled against. You can compile the program, and then "
16062 "at runtime dynamically link against a completely different C<libguestfs.so> "
16067 #: ../fish/guestfish-actions.pod:5065 ../src/guestfs-actions.pod:7792
16069 "This call was added in version C<1.0.58>. In previous versions of "
16070 "libguestfs there was no way to get the version number. From C code you can "
16071 "use dynamic linker functions to find out if this symbol exists (if it "
16072 "doesn't, then it's an earlier version)."
16076 #: ../fish/guestfish-actions.pod:5071 ../src/guestfs-actions.pod:7798
16078 "The call returns a structure with four elements. The first three (C<major>, "
16079 "C<minor> and C<release>) are numbers and correspond to the usual version "
16080 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
16081 "but may be used for distro-specific information."
16085 #: ../fish/guestfish-actions.pod:5077 ../src/guestfs-actions.pod:7804
16086 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
16090 #: ../fish/guestfish-actions.pod:5080 ../src/guestfs-actions.pod:7807
16091 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
16095 #: ../fish/guestfish-actions.pod:5082
16097 "I<Note:> Don't use this call to test for availability of features. In "
16098 "enterprise distributions we backport features from later versions into "
16099 "earlier versions, making this an unreliable way to test for features. Use "
16100 "L</available> instead."
16104 #: ../fish/guestfish-actions.pod:5088
16109 #: ../fish/guestfish-actions.pod:5090
16112 " vfs-label device\n"
16117 #: ../fish/guestfish-actions.pod:5092 ../src/guestfs-actions.pod:7827
16118 msgid "This returns the filesystem label of the filesystem on C<device>."
16122 #: ../fish/guestfish-actions.pod:5095 ../src/guestfs-actions.pod:7830
16123 msgid "If the filesystem is unlabeled, this returns the empty string."
16127 #: ../fish/guestfish-actions.pod:5097
16128 msgid "To find a filesystem from the label, use L</findfs-label>."
16132 #: ../fish/guestfish-actions.pod:5099
16137 #: ../fish/guestfish-actions.pod:5101
16140 " vfs-type device\n"
16145 #: ../fish/guestfish-actions.pod:5103 ../src/guestfs-actions.pod:7845
16147 "This command gets the filesystem type corresponding to the filesystem on "
16152 #: ../fish/guestfish-actions.pod:5106 ../src/guestfs-actions.pod:7848
16154 "For most filesystems, the result is the name of the Linux VFS module which "
16155 "would be used to mount this filesystem if you mounted it without specifying "
16156 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
16160 #: ../fish/guestfish-actions.pod:5111
16165 #: ../fish/guestfish-actions.pod:5113
16168 " vfs-uuid device\n"
16173 #: ../fish/guestfish-actions.pod:5115 ../src/guestfs-actions.pod:7864
16174 msgid "This returns the filesystem UUID of the filesystem on C<device>."
16178 #: ../fish/guestfish-actions.pod:5118 ../src/guestfs-actions.pod:7867
16179 msgid "If the filesystem does not have a UUID, this returns the empty string."
16183 #: ../fish/guestfish-actions.pod:5120
16184 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
16188 #: ../fish/guestfish-actions.pod:5122
16189 msgid "vg-activate"
16193 #: ../fish/guestfish-actions.pod:5124
16196 " vg-activate true|false 'volgroups ...'\n"
16201 #: ../fish/guestfish-actions.pod:5126 ../src/guestfs-actions.pod:7883
16203 "This command activates or (if C<activate> is false) deactivates all logical "
16204 "volumes in the listed volume groups C<volgroups>."
16208 #: ../fish/guestfish-actions.pod:5129 ../src/guestfs-actions.pod:7886
16209 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
16213 #: ../fish/guestfish-actions.pod:5131 ../src/guestfs-actions.pod:7888
16215 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
16216 "activated or deactivated."
16220 #: ../fish/guestfish-actions.pod:5134
16221 msgid "vg-activate-all"
16225 #: ../fish/guestfish-actions.pod:5136
16228 " vg-activate-all true|false\n"
16233 #: ../fish/guestfish-actions.pod:5138 ../src/guestfs-actions.pod:7901
16235 "This command activates or (if C<activate> is false) deactivates all logical "
16236 "volumes in all volume groups."
16240 #: ../fish/guestfish-actions.pod:5141 ../src/guestfs-actions.pod:7904
16241 msgid "This command is the same as running C<vgchange -a y|n>"
16245 #: ../fish/guestfish-actions.pod:5143
16250 #: ../fish/guestfish-actions.pod:5145
16253 " vgcreate volgroup 'physvols ...'\n"
16258 #: ../fish/guestfish-actions.pod:5147 ../src/guestfs-actions.pod:7917
16260 "This creates an LVM volume group called C<volgroup> from the non-empty list "
16261 "of physical volumes C<physvols>."
16265 #: ../fish/guestfish-actions.pod:5150
16270 #: ../fish/guestfish-actions.pod:5152
16273 " vglvuuids vgname\n"
16278 #: ../fish/guestfish-actions.pod:5154 ../src/guestfs-actions.pod:7930
16280 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
16281 "volumes created in this volume group."
16285 #: ../fish/guestfish-actions.pod:5157
16287 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
16288 "logical volumes and volume groups."
16292 #: ../fish/guestfish-actions.pod:5160
16293 msgid "See also L</vgpvuuids>."
16297 #: ../fish/guestfish-actions.pod:5162
16302 #: ../fish/guestfish-actions.pod:5164
16305 " vgpvuuids vgname\n"
16310 #: ../fish/guestfish-actions.pod:5166 ../src/guestfs-actions.pod:7950
16312 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
16313 "volumes that this volume group resides on."
16317 #: ../fish/guestfish-actions.pod:5169
16319 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
16320 "physical volumes and volume groups."
16324 #: ../fish/guestfish-actions.pod:5172
16325 msgid "See also L</vglvuuids>."
16329 #: ../fish/guestfish-actions.pod:5174
16334 #: ../fish/guestfish-actions.pod:5176
16337 " vgremove vgname\n"
16342 #: ../fish/guestfish-actions.pod:5178 ../src/guestfs-actions.pod:7970
16343 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
16347 #: ../fish/guestfish-actions.pod:5180 ../src/guestfs-actions.pod:7972
16348 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
16352 #: ../fish/guestfish-actions.pod:5183
16357 #: ../fish/guestfish-actions.pod:5185
16360 " vgrename volgroup newvolgroup\n"
16365 #: ../fish/guestfish-actions.pod:5187 ../src/guestfs-actions.pod:7986
16366 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
16370 #: ../fish/guestfish-actions.pod:5189
16375 #: ../fish/guestfish-actions.pod:5191
16383 #: ../fish/guestfish-actions.pod:5193 ../src/guestfs-actions.pod:7997
16385 "List all the volumes groups detected. This is the equivalent of the "
16386 "L<vgs(8)> command."
16390 #: ../fish/guestfish-actions.pod:5196 ../src/guestfs-actions.pod:8000
16392 "This returns a list of just the volume group names that were detected "
16393 "(eg. C<VolGroup00>)."
16397 #: ../fish/guestfish-actions.pod:5199
16398 msgid "See also L</vgs-full>."
16402 #: ../fish/guestfish-actions.pod:5201
16407 #: ../fish/guestfish-actions.pod:5203
16415 #: ../fish/guestfish-actions.pod:5205 ../src/guestfs-actions.pod:8016
16417 "List all the volumes groups detected. This is the equivalent of the "
16418 "L<vgs(8)> command. The \"full\" version includes all fields."
16422 #: ../fish/guestfish-actions.pod:5208
16427 #: ../fish/guestfish-actions.pod:5210
16435 #: ../fish/guestfish-actions.pod:5212 ../src/guestfs-actions.pod:8030
16437 "This rescans all block devices and rebuilds the list of LVM physical "
16438 "volumes, volume groups and logical volumes."
16442 #: ../fish/guestfish-actions.pod:5215
16447 #: ../fish/guestfish-actions.pod:5217
16455 #: ../fish/guestfish-actions.pod:5219 ../src/guestfs-actions.pod:8043
16456 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16460 #: ../fish/guestfish-actions.pod:5221
16465 #: ../fish/guestfish-actions.pod:5223
16473 #: ../fish/guestfish-actions.pod:5225 ../src/guestfs-actions.pod:8083
16475 "This command counts the characters in a file, using the C<wc -c> external "
16480 #: ../fish/guestfish-actions.pod:5228
16485 #: ../fish/guestfish-actions.pod:5230
16493 #: ../fish/guestfish-actions.pod:5232 ../src/guestfs-actions.pod:8096
16495 "This command counts the lines in a file, using the C<wc -l> external "
16500 #: ../fish/guestfish-actions.pod:5235
16505 #: ../fish/guestfish-actions.pod:5237
16513 #: ../fish/guestfish-actions.pod:5239 ../src/guestfs-actions.pod:8109
16515 "This command counts the words in a file, using the C<wc -w> external "
16520 #: ../fish/guestfish-actions.pod:5242
16525 #: ../fish/guestfish-actions.pod:5244
16528 " write path content\n"
16533 #: ../fish/guestfish-actions.pod:5246 ../src/guestfs-actions.pod:8124
16535 "This call creates a file called C<path>. The content of the file is the "
16536 "string C<content> (which can contain any 8 bit data)."
16540 #: ../fish/guestfish-actions.pod:5249
16541 msgid "See also L</write-append>."
16545 #: ../fish/guestfish-actions.pod:5254
16546 msgid "write-append"
16550 #: ../fish/guestfish-actions.pod:5256
16553 " write-append path content\n"
16558 #: ../fish/guestfish-actions.pod:5258 ../src/guestfs-actions.pod:8144
16560 "This call appends C<content> to the end of file C<path>. If C<path> does "
16561 "not exist, then a new file is created."
16565 #: ../fish/guestfish-actions.pod:5261
16566 msgid "See also L</write>."
16570 #: ../fish/guestfish-actions.pod:5266
16575 #: ../fish/guestfish-actions.pod:5268
16578 " write-file path content size\n"
16583 #: ../fish/guestfish-actions.pod:5270 ../src/guestfs-actions.pod:8171
16585 "This call creates a file called C<path>. The contents of the file is the "
16586 "string C<content> (which can contain any 8 bit data), with length C<size>."
16590 #: ../fish/guestfish-actions.pod:5274 ../src/guestfs-actions.pod:8175
16592 "As a special case, if C<size> is C<0> then the length is calculated using "
16593 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16597 #: ../fish/guestfish-actions.pod:5278 ../src/guestfs-actions.pod:8179
16599 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16600 "I<not> work, even if the length is specified."
16604 #: ../fish/guestfish-actions.pod:5284
16605 msgid "I<This function is deprecated.> In new code, use the L</write> call instead."
16609 #: ../fish/guestfish-actions.pod:5291
16614 #: ../fish/guestfish-actions.pod:5293
16617 " zegrep regex path\n"
16622 #: ../fish/guestfish-actions.pod:5295 ../src/guestfs-actions.pod:8196
16623 msgid "This calls the external C<zegrep> program and returns the matching lines."
16627 #: ../fish/guestfish-actions.pod:5301
16632 #: ../fish/guestfish-actions.pod:5303
16635 " zegrepi regex path\n"
16640 #: ../fish/guestfish-actions.pod:5305 ../src/guestfs-actions.pod:8215
16641 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
16645 #: ../fish/guestfish-actions.pod:5311
16650 #: ../fish/guestfish-actions.pod:5313
16658 #: ../fish/guestfish-actions.pod:5315 ../src/guestfs-actions.pod:8233
16659 msgid "This command writes zeroes over the first few blocks of C<device>."
16663 #: ../fish/guestfish-actions.pod:5317 ../src/guestfs-actions.pod:8235
16665 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16666 "securely wipe the device). It should be sufficient to remove any partition "
16667 "tables, filesystem superblocks and so on."
16671 #: ../fish/guestfish-actions.pod:5321 ../fish/guestfish-actions.pod:5336 ../src/guestfs-actions.pod:8239 ../src/guestfs-actions.pod:8265
16673 "If blocks are already zero, then this command avoids writing zeroes. This "
16674 "prevents the underlying device from becoming non-sparse or growing "
16679 #: ../fish/guestfish-actions.pod:5325
16680 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
16684 #: ../fish/guestfish-actions.pod:5328
16685 msgid "zero-device"
16689 #: ../fish/guestfish-actions.pod:5330
16692 " zero-device device\n"
16697 #: ../fish/guestfish-actions.pod:5332
16699 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
16700 "which just zeroes the first few blocks of a device."
16704 #: ../fish/guestfish-actions.pod:5340
16709 #: ../fish/guestfish-actions.pod:5342
16712 " zerofree device\n"
16717 #: ../fish/guestfish-actions.pod:5344 ../src/guestfs-actions.pod:8284
16719 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16720 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16721 "possible to compress the filesystem more effectively."
16725 #: ../fish/guestfish-actions.pod:5349 ../src/guestfs-actions.pod:8289
16726 msgid "You should B<not> run this program if the filesystem is mounted."
16730 #: ../fish/guestfish-actions.pod:5352 ../src/guestfs-actions.pod:8292
16732 "It is possible that using this program can damage the filesystem or data on "
16737 #: ../fish/guestfish-actions.pod:5355
16742 #: ../fish/guestfish-actions.pod:5357
16745 " zfgrep pattern path\n"
16750 #: ../fish/guestfish-actions.pod:5359 ../src/guestfs-actions.pod:8306
16751 msgid "This calls the external C<zfgrep> program and returns the matching lines."
16755 #: ../fish/guestfish-actions.pod:5365
16760 #: ../fish/guestfish-actions.pod:5367
16763 " zfgrepi pattern path\n"
16768 #: ../fish/guestfish-actions.pod:5369 ../src/guestfs-actions.pod:8325
16769 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
16773 #: ../fish/guestfish-actions.pod:5375
16778 #: ../fish/guestfish-actions.pod:5377
16781 " zfile meth path\n"
16786 #: ../fish/guestfish-actions.pod:5379 ../src/guestfs-actions.pod:8351
16787 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
16791 #: ../fish/guestfish-actions.pod:5382 ../src/guestfs-actions.pod:8354
16792 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16796 #: ../fish/guestfish-actions.pod:5384
16797 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
16801 #: ../fish/guestfish-actions.pod:5387
16802 msgid "I<This function is deprecated.> In new code, use the L</file> call instead."
16806 #: ../fish/guestfish-actions.pod:5394
16811 #: ../fish/guestfish-actions.pod:5396
16814 " zgrep regex path\n"
16819 #: ../fish/guestfish-actions.pod:5398 ../src/guestfs-actions.pod:8371
16820 msgid "This calls the external C<zgrep> program and returns the matching lines."
16824 #: ../fish/guestfish-actions.pod:5404
16829 #: ../fish/guestfish-actions.pod:5406
16832 " zgrepi regex path\n"
16837 #: ../fish/guestfish-actions.pod:5408 ../src/guestfs-actions.pod:8390
16838 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
16842 #: ../fish/guestfish-commands.pod:1
16847 #: ../fish/guestfish-commands.pod:3
16852 #: ../fish/guestfish-commands.pod:5
16855 " alloc filename size\n"
16860 #: ../fish/guestfish-commands.pod:7
16862 "This creates an empty (zeroed) file of the given size, and then adds so it "
16863 "can be further examined."
16867 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
16868 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
16872 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
16873 msgid "Size can be specified using standard suffixes, eg. C<1M>."
16877 #: ../fish/guestfish-commands.pod:14
16879 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
16880 "image, see L</PREPARED DISK IMAGES>."
16884 #: ../fish/guestfish-commands.pod:17
16889 #: ../fish/guestfish-commands.pod:19
16892 " copy-in local [local ...] /remotedir\n"
16897 #: ../fish/guestfish-commands.pod:21
16899 "C<copy-in> copies local files or directories recursively into the disk "
16900 "image, placing them in the directory called C</remotedir> (which must "
16901 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
16902 "other commands as necessary."
16906 #: ../fish/guestfish-commands.pod:26
16908 "Multiple local files and directories can be specified, but the last "
16909 "parameter must always be a remote directory. Wildcards cannot be used."
16913 #: ../fish/guestfish-commands.pod:30
16918 #: ../fish/guestfish-commands.pod:32
16921 " copy-out remote [remote ...] localdir\n"
16926 #: ../fish/guestfish-commands.pod:34
16928 "C<copy-out> copies remote files or directories recursively out of the disk "
16929 "image, placing them on the host disk in a local directory called C<localdir> "
16930 "(which must exist). This guestfish meta-command turns into a sequence of "
16931 "L</download>, L</tar-out> and other commands as necessary."
16935 #: ../fish/guestfish-commands.pod:40
16937 "Multiple remote files and directories can be specified, but the last "
16938 "parameter must always be a local directory. To download to the current "
16939 "directory, use C<.> as in:"
16943 #: ../fish/guestfish-commands.pod:44
16946 " copy-out /home .\n"
16951 #: ../fish/guestfish-commands.pod:46
16953 "Wildcards cannot be used in the ordinary command, but you can use them with "
16954 "the help of L</glob> like this:"
16958 #: ../fish/guestfish-commands.pod:49
16961 " glob copy-out /home/* .\n"
16966 #: ../fish/guestfish-commands.pod:51
16971 #: ../fish/guestfish-commands.pod:53
16974 " display filename\n"
16979 #: ../fish/guestfish-commands.pod:55
16981 "Use C<display> (a graphical display program) to display an image file. It "
16982 "downloads the file, and runs C<display> on it."
16986 #: ../fish/guestfish-commands.pod:58
16988 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
16989 "environment variable. For example to use the GNOME display program:"
16993 #: ../fish/guestfish-commands.pod:61
16996 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
17001 #: ../fish/guestfish-commands.pod:63
17002 msgid "See also L<display(1)>."
17006 #: ../fish/guestfish-commands.pod:65
17011 #: ../fish/guestfish-commands.pod:67
17014 " echo [params ...]\n"
17019 #: ../fish/guestfish-commands.pod:69
17020 msgid "This echos the parameters to the terminal."
17024 #: ../fish/guestfish-commands.pod:71
17029 #: ../fish/guestfish-commands.pod:73
17034 #: ../fish/guestfish-commands.pod:75
17039 #: ../fish/guestfish-commands.pod:77
17047 #: ../fish/guestfish-commands.pod:79
17049 "This is used to edit a file. It downloads the file, edits it locally using "
17050 "your editor, then uploads the result."
17054 #: ../fish/guestfish-commands.pod:82
17056 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
17057 "or C<emacs> you will get those corresponding editors."
17061 #: ../fish/guestfish-commands.pod:86
17066 #: ../fish/guestfish-commands.pod:88
17069 " glob command args...\n"
17074 #: ../fish/guestfish-commands.pod:90
17076 "Expand wildcards in any paths in the args list, and run C<command> "
17077 "repeatedly on each matching path."
17081 #: ../fish/guestfish-commands.pod:93
17082 msgid "See L</WILDCARDS AND GLOBBING>."
17086 #: ../fish/guestfish-commands.pod:95
17091 #: ../fish/guestfish-commands.pod:97
17094 " hexedit <filename|device>\n"
17095 " hexedit <filename|device> <max>\n"
17096 " hexedit <filename|device> <start> <max>\n"
17101 #: ../fish/guestfish-commands.pod:101
17103 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
17108 #: ../fish/guestfish-commands.pod:104
17110 "This command works by downloading potentially the whole file or device, "
17111 "editing it locally, then uploading it. If the file or device is large, you "
17112 "have to specify which part you wish to edit by using C<max> and/or C<start> "
17113 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
17114 "usual modifiers allowed such as C<1M> (1 megabyte)."
17118 #: ../fish/guestfish-commands.pod:111
17119 msgid "For example to edit the first few sectors of a disk you might do:"
17123 #: ../fish/guestfish-commands.pod:114
17126 " hexedit /dev/sda 1M\n"
17131 #: ../fish/guestfish-commands.pod:116
17133 "which would allow you to edit anywhere within the first megabyte of the "
17138 #: ../fish/guestfish-commands.pod:119
17139 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
17143 #: ../fish/guestfish-commands.pod:121
17146 " hexedit /dev/sda1 0x400 0x400\n"
17151 #: ../fish/guestfish-commands.pod:123
17152 msgid "(assuming the superblock is in the standard location)."
17156 #: ../fish/guestfish-commands.pod:125
17158 "This command requires the external L<hexedit(1)> program. You can specify "
17159 "another program to use by setting the C<HEXEDITOR> environment variable."
17163 #: ../fish/guestfish-commands.pod:129
17164 msgid "See also L</hexdump>."
17168 #: ../fish/guestfish-commands.pod:131
17173 #: ../fish/guestfish-commands.pod:133
17181 #: ../fish/guestfish-commands.pod:135
17182 msgid "Change the local directory, ie. the current directory of guestfish itself."
17186 #: ../fish/guestfish-commands.pod:138
17187 msgid "Note that C<!cd> won't do what you might expect."
17191 #: ../fish/guestfish-commands.pod:140
17196 #: ../fish/guestfish-commands.pod:142
17201 #: ../fish/guestfish-commands.pod:144
17209 #: ../fish/guestfish-commands.pod:146
17210 msgid "Opens the manual page for guestfish."
17214 #: ../fish/guestfish-commands.pod:148
17219 #: ../fish/guestfish-commands.pod:150
17224 #: ../fish/guestfish-commands.pod:152
17232 #: ../fish/guestfish-commands.pod:154
17240 #: ../fish/guestfish-commands.pod:156
17241 msgid "This is used to view a file."
17245 #: ../fish/guestfish-commands.pod:158
17247 "The default viewer is C<$PAGER>. However if you use the alternate command "
17248 "C<less> you will get the C<less> command specifically."
17252 #: ../fish/guestfish-commands.pod:161
17257 #: ../fish/guestfish-commands.pod:163
17265 #: ../fish/guestfish-commands.pod:165
17267 "Close and reopen the libguestfs handle. It is not necessary to use this "
17268 "normally, because the handle is closed properly when guestfish exits. "
17269 "However this is occasionally useful for testing."
17273 #: ../fish/guestfish-commands.pod:169
17278 #: ../fish/guestfish-commands.pod:171
17281 " setenv VAR value\n"
17286 #: ../fish/guestfish-commands.pod:173
17287 msgid "Set the environment variable C<VAR> to the string C<value>."
17291 #: ../fish/guestfish-commands.pod:175
17292 msgid "To print the value of an environment variable use a shell command such as:"
17296 #: ../fish/guestfish-commands.pod:178
17304 #: ../fish/guestfish-commands.pod:180
17309 #: ../fish/guestfish-commands.pod:182
17312 " sparse filename size\n"
17317 #: ../fish/guestfish-commands.pod:184
17319 "This creates an empty sparse file of the given size, and then adds so it can "
17320 "be further examined."
17324 #: ../fish/guestfish-commands.pod:187
17326 "In all respects it works the same as the L</alloc> command, except that the "
17327 "image file is allocated sparsely, which means that disk blocks are not "
17328 "assigned to the file until they are needed. Sparse disk files only use "
17329 "space when written to, but they are slower and there is a danger you could "
17330 "run out of real disk space during a write operation."
17334 #: ../fish/guestfish-commands.pod:197
17339 #: ../fish/guestfish-commands.pod:199
17347 #: ../fish/guestfish-commands.pod:201
17349 "This command returns a list of the optional groups known to the daemon, and "
17350 "indicates which ones are supported by this build of the libguestfs "
17355 #: ../fish/guestfish-commands.pod:205
17356 msgid "See also L<guestfs(3)/AVAILABILITY>."
17360 #: ../fish/guestfish-commands.pod:207
17365 #: ../fish/guestfish-commands.pod:209
17368 " time command args...\n"
17373 #: ../fish/guestfish-commands.pod:211
17375 "Run the command as usual, but print the elapsed time afterwards. This can "
17376 "be useful for benchmarking operations."
17380 #: ../fish/guestfish-commands.pod:214
17385 #: ../fish/guestfish-commands.pod:216
17393 #: ../fish/guestfish-commands.pod:218
17394 msgid "Remove C<VAR> from the environment."
17398 #: ../fish/guestfish.pod:5
17399 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17403 #: ../fish/guestfish.pod:9
17406 " guestfish [--options] [commands]\n"
17411 #: ../fish/guestfish.pod:11
17419 #: ../fish/guestfish.pod:13
17422 " guestfish [--ro|--rw] -a disk.img\n"
17427 #: ../fish/guestfish.pod:15
17430 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17435 #: ../fish/guestfish.pod:17
17438 " guestfish -d libvirt-domain\n"
17443 #: ../fish/guestfish.pod:19
17446 " guestfish [--ro|--rw] -a disk.img -i\n"
17451 #: ../fish/guestfish.pod:21
17454 " guestfish -d libvirt-domain -i\n"
17459 #: ../fish/guestfish.pod:25
17461 "Using guestfish in read/write mode on live virtual machines can be "
17462 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17463 "option to use guestfish safely if the disk image or virtual machine might be "
17468 #: ../fish/guestfish.pod:32
17470 "Guestfish is a shell and command-line tool for examining and modifying "
17471 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17472 "functionality of the guestfs API, see L<guestfs(3)>."
17476 #: ../fish/guestfish.pod:36
17478 "Guestfish gives you structured access to the libguestfs API, from shell "
17479 "scripts or the command line or interactively. If you want to rescue a "
17480 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17485 #: ../fish/guestfish.pod:43
17486 msgid "As an interactive shell"
17490 #: ../fish/guestfish.pod:45
17498 #: ../fish/guestfish.pod:47
17501 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17502 " editing virtual machine filesystems.\n"
17507 #: ../fish/guestfish.pod:50
17510 " Type: 'help' for a list of commands\n"
17511 " 'man' to read the manual\n"
17512 " 'quit' to quit the shell\n"
17517 #: ../fish/guestfish.pod:54
17520 " ><fs> add-ro disk.img\n"
17522 " ><fs> list-filesystems\n"
17523 " /dev/sda1: ext4\n"
17524 " /dev/vg_guest/lv_root: ext4\n"
17525 " /dev/vg_guest/lv_swap: swap\n"
17526 " ><fs> mount /dev/vg_guest/lv_root /\n"
17527 " ><fs> cat /etc/fstab\n"
17529 " # Created by anaconda\n"
17536 #: ../fish/guestfish.pod:67
17537 msgid "From shell scripts"
17541 #: ../fish/guestfish.pod:69
17542 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17546 #: ../fish/guestfish.pod:71
17549 " guestfish <<_EOF_\n"
17552 " mount /dev/vg_guest/lv_root /\n"
17553 " write /etc/motd \"Welcome, new users\"\n"
17559 #: ../fish/guestfish.pod:78
17560 msgid "List the LVM logical volumes in a disk image:"
17564 #: ../fish/guestfish.pod:80
17567 " guestfish -a disk.img --ro <<_EOF_\n"
17575 #: ../fish/guestfish.pod:85
17576 msgid "List all the filesystems in a disk image:"
17580 #: ../fish/guestfish.pod:87
17583 " guestfish -a disk.img --ro <<_EOF_\n"
17585 " list-filesystems\n"
17591 #: ../fish/guestfish.pod:92
17592 msgid "On one command line"
17596 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
17597 msgid "Update C</etc/resolv.conf> in a guest:"
17601 #: ../fish/guestfish.pod:96
17605 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17606 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17611 #: ../fish/guestfish.pod:100
17612 msgid "Edit C</boot/grub/grub.conf> interactively:"
17616 #: ../fish/guestfish.pod:102
17619 " guestfish --rw --add disk.img \\\n"
17620 " --mount /dev/vg_guest/lv_root \\\n"
17621 " --mount /dev/sda1:/boot \\\n"
17622 " edit /boot/grub/grub.conf\n"
17627 #: ../fish/guestfish.pod:107
17628 msgid "Mount disks automatically"
17632 #: ../fish/guestfish.pod:109
17634 "Use the I<-i> option to automatically mount the disks from a virtual "
17639 #: ../fish/guestfish.pod:112
17642 " guestfish --ro -a disk.img -i cat /etc/group\n"
17647 #: ../fish/guestfish.pod:114
17650 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17655 #: ../fish/guestfish.pod:116
17656 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17660 #: ../fish/guestfish.pod:118
17663 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17668 #: ../fish/guestfish.pod:120
17669 msgid "As a script interpreter"
17673 #: ../fish/guestfish.pod:122
17674 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17678 #: ../fish/guestfish.pod:124
17681 " #!/usr/bin/guestfish -f\n"
17682 " sparse test1.img 100M\n"
17684 " part-disk /dev/sda mbr\n"
17685 " mkfs ext2 /dev/sda1\n"
17690 #: ../fish/guestfish.pod:130
17691 msgid "Start with a prepared disk"
17695 #: ../fish/guestfish.pod:132
17697 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17698 "single ext2-formatted partition:"
17702 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2243
17705 " guestfish -N fs\n"
17710 #: ../fish/guestfish.pod:137
17711 msgid "To list what is available do:"
17715 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
17718 " guestfish -N help | less\n"
17723 #: ../fish/guestfish.pod:141
17724 msgid "Remote control"
17728 #: ../fish/guestfish.pod:143
17731 " eval \"`guestfish --listen`\"\n"
17732 " guestfish --remote add-ro disk.img\n"
17733 " guestfish --remote run\n"
17734 " guestfish --remote lvs\n"
17739 #: ../fish/guestfish.pod:154
17740 msgid "Displays general help on options."
17744 #: ../fish/guestfish.pod:158
17745 msgid "B<--cmd-help>"
17749 #: ../fish/guestfish.pod:160
17750 msgid "Lists all available guestfish commands."
17754 #: ../fish/guestfish.pod:162
17759 #: ../fish/guestfish.pod:164
17760 msgid "B<--cmd-help cmd>"
17764 #: ../fish/guestfish.pod:166
17765 msgid "Displays detailed help on a single command C<cmd>."
17769 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
17770 msgid "B<-a image>"
17774 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
17775 msgid "B<--add image>"
17779 #: ../fish/guestfish.pod:172
17780 msgid "Add a block device or virtual machine image to the shell."
17784 #: ../fish/guestfish.pod:177
17786 "Using this flag is mostly equivalent to using the C<add> command, with "
17787 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17788 "the I<--format=...> flag was given."
17792 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
17794 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17795 "URI to use. The default is to use the default libvirt connection."
17799 #: ../fish/guestfish.pod:189
17804 #: ../fish/guestfish.pod:191
17806 "If using the I<--listen> option and a csh-like shell, use this option. See "
17807 "section L</REMOTE CONTROL AND CSH> below."
17811 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
17812 msgid "B<-d libvirt-domain>"
17816 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
17817 msgid "B<--domain libvirt-domain>"
17821 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
17823 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17824 "used, then any libvirt domain can be used. However in write mode, only "
17825 "libvirt domains which are shut down can be named here."
17829 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
17830 msgid "Domain UUIDs can be used instead of names."
17834 #: ../fish/guestfish.pod:204
17836 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17837 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17838 "if the I<--format:...> flag was given."
17842 #: ../fish/guestfish.pod:208
17847 #: ../fish/guestfish.pod:210
17848 msgid "B<--no-dest-paths>"
17852 #: ../fish/guestfish.pod:212
17854 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17855 "to hit the tab key to complete paths on the guest filesystem, but this "
17856 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17857 "allow this feature to be disabled."
17861 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
17863 "When prompting for keys and passphrases, guestfish normally turns echoing "
17864 "off so you cannot see what you are typing. If you are not worried about "
17865 "Tempest attacks and there is no one else in the room you can specify this "
17866 "flag to see what you are typing."
17870 #: ../fish/guestfish.pod:224
17875 #: ../fish/guestfish.pod:226
17876 msgid "B<--file file>"
17880 #: ../fish/guestfish.pod:228
17881 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17885 #: ../fish/guestfish.pod:231
17888 " #!/usr/bin/guestfish -f\n"
17893 #: ../fish/guestfish.pod:244
17896 " guestfish --format=raw -a disk.img\n"
17901 #: ../fish/guestfish.pod:248
17904 " guestfish --format=raw -a disk.img --format -a another.img\n"
17909 #: ../fish/guestfish.pod:253
17911 "If you have untrusted raw-format guest disk images, you should use this "
17912 "option to specify the disk format. This avoids a possible security problem "
17913 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17917 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
17918 msgid "B<--inspector>"
17922 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
17924 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17925 "system and mount filesystems as they would be mounted on the real virtual "
17930 #: ../fish/guestfish.pod:266
17931 msgid "Typical usage is either:"
17935 #: ../fish/guestfish.pod:268
17938 " guestfish -d myguest -i\n"
17943 #: ../fish/guestfish.pod:270
17944 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17948 #: ../fish/guestfish.pod:272
17951 " guestfish --ro -d myguest -i\n"
17956 #: ../fish/guestfish.pod:274
17957 msgid "(for active domains, readonly), or specify the block device directly:"
17961 #: ../fish/guestfish.pod:276
17964 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17969 #: ../fish/guestfish.pod:278
17971 "Note that the command line syntax changed slightly over older versions of "
17972 "guestfish. You can still use the old syntax:"
17976 #: ../fish/guestfish.pod:281
17979 " guestfish [--ro] -i disk.img\n"
17984 #: ../fish/guestfish.pod:283
17987 " guestfish [--ro] -i libvirt-domain\n"
17992 #: ../fish/guestfish.pod:285
17994 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
17995 "then using other commands to mount the filesystems that were found."
17999 #: ../fish/guestfish.pod:294
18000 msgid "B<--listen>"
18004 #: ../fish/guestfish.pod:296
18006 "Fork into the background and listen for remote commands. See section "
18007 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
18011 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
18016 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
18018 "Connect to a live virtual machine. (Experimental, see "
18019 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
18023 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
18024 msgid "B<-m dev[:mountpoint[:options]]>"
18028 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
18029 msgid "B<--mount dev[:mountpoint[:options]]>"
18033 #: ../fish/guestfish.pod:308
18034 msgid "Mount the named partition or logical volume on the given mountpoint."
18038 #: ../fish/guestfish.pod:310
18039 msgid "If the mountpoint is omitted, it defaults to C</>."
18043 #: ../fish/guestfish.pod:312
18044 msgid "You have to mount something on C</> before most commands will work."
18048 #: ../fish/guestfish.pod:314
18050 "If any I<-m> or I<--mount> options are given, the guest is automatically "
18055 #: ../fish/guestfish.pod:317
18057 "If you don't know what filesystems a disk image contains, you can either run "
18058 "guestfish without this option, then list the partitions, filesystems and LVs "
18059 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
18060 "commands), or you can use the L<virt-filesystems(1)> program."
18064 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
18066 "The third (and rarely used) part of the mount parameter is the list of mount "
18067 "options used to mount the underlying filesystem. If this is not given, then "
18068 "the mount options are either the empty string or C<ro> (the latter if the "
18069 "I<--ro> flag is used). By specifying the mount options, you override this "
18070 "default choice. Probably the only time you would use this is to enable ACLs "
18071 "and/or extended attributes if the filesystem can support them:"
18075 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
18078 " -m /dev/sda1:/:acl,user_xattr\n"
18083 #: ../fish/guestfish.pod:333
18084 msgid "Using this flag is equivalent to using the C<mount-options> command."
18088 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202 ../resize/virt-resize.pod:435
18093 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
18094 msgid "B<--no-sync>"
18098 #: ../fish/guestfish.pod:339
18100 "Disable autosync. This is enabled by default. See the discussion of "
18101 "autosync in the L<guestfs(3)> manpage."
18105 #: ../fish/guestfish.pod:342
18110 #: ../fish/guestfish.pod:344
18111 msgid "B<--new type>"
18115 #: ../fish/guestfish.pod:346
18120 #: ../fish/guestfish.pod:348
18122 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
18123 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
18124 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
18129 #: ../fish/guestfish.pod:353
18130 msgid "B<--progress-bars>"
18134 #: ../fish/guestfish.pod:355
18135 msgid "Enable progress bars, even when guestfish is used non-interactively."
18139 #: ../fish/guestfish.pod:357
18141 "Progress bars are enabled by default when guestfish is used as an "
18142 "interactive shell."
18146 #: ../fish/guestfish.pod:360
18147 msgid "B<--no-progress-bars>"
18151 #: ../fish/guestfish.pod:362
18152 msgid "Disable progress bars."
18156 #: ../fish/guestfish.pod:364
18157 msgid "B<--remote[=pid]>"
18161 #: ../fish/guestfish.pod:366
18163 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
18164 "CONTROL GUESTFISH OVER A SOCKET> below."
18168 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248 ../rescue/virt-rescue.pod:161
18173 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250 ../rescue/virt-rescue.pod:163
18178 #: ../fish/guestfish.pod:373
18180 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18181 "mounts are done read-only."
18185 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
18187 "The option must always be used if the disk image or virtual machine might be "
18188 "running, and is generally recommended in cases where you don't need write "
18189 "access to the disk."
18193 #: ../fish/guestfish.pod:380
18195 "Note that prepared disk images created with I<-N> are not affected by this "
18196 "option. Also commands like C<add> are not affected - you have to specify "
18197 "the C<readonly:true> option explicitly if you need it."
18201 #: ../fish/guestfish.pod:384
18202 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
18206 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262 ../rescue/virt-rescue.pod:173
18207 msgid "B<--selinux>"
18211 #: ../fish/guestfish.pod:388
18212 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
18216 #: ../fish/guestfish.pod:394
18218 "Enable very verbose messages. This is particularly useful if you find a "
18223 #: ../fish/guestfish.pod:401
18224 msgid "Display the guestfish / libguestfs version number and exit."
18228 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278 ../rescue/virt-rescue.pod:194
18233 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280 ../rescue/virt-rescue.pod:196
18238 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
18240 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
18241 "mounts are done read-write."
18245 #: ../fish/guestfish.pod:410
18246 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
18250 #: ../fish/guestfish.pod:414
18251 msgid "Echo each command before executing it."
18255 #: ../fish/guestfish.pod:418
18256 msgid "COMMANDS ON COMMAND LINE"
18260 #: ../fish/guestfish.pod:420
18261 msgid "Any additional (non-option) arguments are treated as commands to execute."
18265 #: ../fish/guestfish.pod:423
18267 "Commands to execute should be separated by a colon (C<:>), where the colon "
18268 "is a separate parameter. Thus:"
18272 #: ../fish/guestfish.pod:426
18275 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18280 #: ../fish/guestfish.pod:428
18282 "If there are no additional arguments, then we enter a shell, either an "
18283 "interactive shell with a prompt (if the input is a terminal) or a "
18284 "non-interactive shell."
18288 #: ../fish/guestfish.pod:432
18290 "In either command line mode or non-interactive shell, the first command that "
18291 "gives an error causes the whole shell to exit. In interactive mode (with a "
18292 "prompt) if a command fails, you can continue to enter commands."
18296 #: ../fish/guestfish.pod:437
18297 msgid "USING launch (OR run)"
18301 #: ../fish/guestfish.pod:439
18303 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18304 "then launch it, then mount any disks you need, and finally issue "
18305 "actions/commands. So the general order of the day is:"
18309 #: ../fish/guestfish.pod:447
18310 msgid "add or -a/--add"
18314 #: ../fish/guestfish.pod:451
18315 msgid "launch (aka run)"
18319 #: ../fish/guestfish.pod:455
18320 msgid "mount or -m/--mount"
18324 #: ../fish/guestfish.pod:459
18325 msgid "any other commands"
18329 #: ../fish/guestfish.pod:463
18331 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18332 "guest before mounting or performing any other commands."
18336 #: ../fish/guestfish.pod:466
18338 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18339 "I<--new> options were given then C<run> is done automatically, simply "
18340 "because guestfish can't perform the action you asked for without doing this."
18344 #: ../fish/guestfish.pod:471
18345 msgid "OPENING DISKS FOR READ AND WRITE"
18349 #: ../fish/guestfish.pod:473
18351 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
18352 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
18353 "I<-i> and I<-m> open disk images read-only or for writing."
18357 #: ../fish/guestfish.pod:478
18359 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
18360 "opening disk images supplied on the command line for write. To open a disk "
18361 "image read-only you have to do I<-a image --ro>."
18365 #: ../fish/guestfish.pod:482
18367 "This matters: If you accidentally open a live VM disk image writable then "
18368 "you will cause irreversible disk corruption."
18372 #: ../fish/guestfish.pod:485
18374 "In a future libguestfs we intend to change the default the other way. Disk "
18375 "images will be opened read-only. You will have to either specify "
18376 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
18377 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
18378 "access for disk images specified by those other command line options."
18382 #: ../fish/guestfish.pod:492
18384 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
18385 "which does nothing (it is already the default). However it is highly "
18386 "recommended that you use this option to indicate that you need write access, "
18387 "and prepare your scripts for the day when this option will be required for "
18392 #: ../fish/guestfish.pod:498
18394 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18395 "other libguestfs program apart from guestfish and guestmount."
18399 #: ../fish/guestfish.pod:501
18404 #: ../fish/guestfish.pod:503
18406 "You can quote ordinary parameters using either single or double quotes. For "
18411 #: ../fish/guestfish.pod:506
18414 " add \"file with a space.img\"\n"
18419 #: ../fish/guestfish.pod:508
18422 " rm '/file name'\n"
18427 #: ../fish/guestfish.pod:510
18435 #: ../fish/guestfish.pod:512
18437 "A few commands require a list of strings to be passed. For these, use a "
18438 "whitespace-separated list, enclosed in quotes. Strings containing "
18439 "whitespace to be passed through must be enclosed in single quotes. A "
18440 "literal single quote must be escaped with a backslash."
18444 #: ../fish/guestfish.pod:517
18447 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18448 " command \"/bin/echo 'foo bar'\"\n"
18449 " command \"/bin/echo \\'foo\\'\"\n"
18454 #: ../fish/guestfish.pod:521
18455 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
18459 #: ../fish/guestfish.pod:523
18461 "In double-quoted arguments (only) use backslash to insert special "
18466 #: ../fish/guestfish.pod:528
18471 #: ../fish/guestfish.pod:530
18472 msgid "Alert (bell) character."
18476 #: ../fish/guestfish.pod:532
18481 #: ../fish/guestfish.pod:534
18482 msgid "Backspace character."
18486 #: ../fish/guestfish.pod:536
18491 #: ../fish/guestfish.pod:538
18492 msgid "Form feed character."
18496 #: ../fish/guestfish.pod:540
18501 #: ../fish/guestfish.pod:542
18502 msgid "Newline character."
18506 #: ../fish/guestfish.pod:544
18511 #: ../fish/guestfish.pod:546
18512 msgid "Carriage return character."
18516 #: ../fish/guestfish.pod:548
18521 #: ../fish/guestfish.pod:550
18522 msgid "Horizontal tab character."
18526 #: ../fish/guestfish.pod:552
18531 #: ../fish/guestfish.pod:554
18532 msgid "Vertical tab character."
18536 #: ../fish/guestfish.pod:556
18541 #: ../fish/guestfish.pod:558
18542 msgid "A literal double quote character."
18546 #: ../fish/guestfish.pod:560
18551 #: ../fish/guestfish.pod:562
18553 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
18558 #: ../fish/guestfish.pod:565
18563 #: ../fish/guestfish.pod:567
18564 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
18568 #: ../fish/guestfish.pod:570
18570 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
18575 #: ../fish/guestfish.pod:573
18580 #: ../fish/guestfish.pod:575
18581 msgid "A literal backslash character."
18585 #: ../fish/guestfish.pod:579
18586 msgid "OPTIONAL ARGUMENTS"
18590 #: ../fish/guestfish.pod:581
18592 "Some commands take optional arguments. These arguments appear in this "
18593 "documentation as C<[argname:..]>. You can use them as in these examples:"
18597 #: ../fish/guestfish.pod:585
18600 " add-drive-opts filename\n"
18605 #: ../fish/guestfish.pod:587
18608 " add-drive-opts filename readonly:true\n"
18613 #: ../fish/guestfish.pod:589
18616 " add-drive-opts filename format:qcow2 readonly:false\n"
18621 #: ../fish/guestfish.pod:591
18623 "Each optional argument can appear at most once. All optional arguments must "
18624 "appear after the required ones."
18628 #: ../fish/guestfish.pod:594
18633 #: ../fish/guestfish.pod:596
18634 msgid "This section applies to all commands which can take integers as parameters."
18638 #: ../fish/guestfish.pod:599
18639 msgid "SIZE SUFFIX"
18643 #: ../fish/guestfish.pod:601
18645 "When the command takes a parameter measured in bytes, you can use one of the "
18646 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18650 #: ../fish/guestfish.pod:607
18651 msgid "B<k> or B<K> or B<KiB>"
18655 #: ../fish/guestfish.pod:609
18656 msgid "The size in kilobytes (multiplied by 1024)."
18660 #: ../fish/guestfish.pod:611
18665 #: ../fish/guestfish.pod:613
18666 msgid "The size in SI 1000 byte units."
18670 #: ../fish/guestfish.pod:615
18671 msgid "B<M> or B<MiB>"
18675 #: ../fish/guestfish.pod:617
18676 msgid "The size in megabytes (multiplied by 1048576)."
18680 #: ../fish/guestfish.pod:619
18685 #: ../fish/guestfish.pod:621
18686 msgid "The size in SI 1000000 byte units."
18690 #: ../fish/guestfish.pod:623
18691 msgid "B<G> or B<GiB>"
18695 #: ../fish/guestfish.pod:625
18696 msgid "The size in gigabytes (multiplied by 2**30)."
18700 #: ../fish/guestfish.pod:627
18705 #: ../fish/guestfish.pod:629
18706 msgid "The size in SI 10**9 byte units."
18710 #: ../fish/guestfish.pod:631
18711 msgid "B<T> or B<TiB>"
18715 #: ../fish/guestfish.pod:633
18716 msgid "The size in terabytes (multiplied by 2**40)."
18720 #: ../fish/guestfish.pod:635
18725 #: ../fish/guestfish.pod:637
18726 msgid "The size in SI 10**12 byte units."
18730 #: ../fish/guestfish.pod:639
18731 msgid "B<P> or B<PiB>"
18735 #: ../fish/guestfish.pod:641
18736 msgid "The size in petabytes (multiplied by 2**50)."
18740 #: ../fish/guestfish.pod:643
18745 #: ../fish/guestfish.pod:645
18746 msgid "The size in SI 10**15 byte units."
18750 #: ../fish/guestfish.pod:647
18751 msgid "B<E> or B<EiB>"
18755 #: ../fish/guestfish.pod:649
18756 msgid "The size in exabytes (multiplied by 2**60)."
18760 #: ../fish/guestfish.pod:651
18765 #: ../fish/guestfish.pod:653
18766 msgid "The size in SI 10**18 byte units."
18770 #: ../fish/guestfish.pod:655
18771 msgid "B<Z> or B<ZiB>"
18775 #: ../fish/guestfish.pod:657
18776 msgid "The size in zettabytes (multiplied by 2**70)."
18780 #: ../fish/guestfish.pod:659
18785 #: ../fish/guestfish.pod:661
18786 msgid "The size in SI 10**21 byte units."
18790 #: ../fish/guestfish.pod:663
18791 msgid "B<Y> or B<YiB>"
18795 #: ../fish/guestfish.pod:665
18796 msgid "The size in yottabytes (multiplied by 2**80)."
18800 #: ../fish/guestfish.pod:667
18805 #: ../fish/guestfish.pod:669
18806 msgid "The size in SI 10**24 byte units."
18810 #: ../fish/guestfish.pod:675
18813 " truncate-size /file 1G\n"
18818 #: ../fish/guestfish.pod:677
18819 msgid "would truncate the file to 1 gigabyte."
18823 #: ../fish/guestfish.pod:679
18825 "Be careful because a few commands take sizes in kilobytes or megabytes "
18826 "(eg. the parameter to L</memsize> is specified in megabytes already). "
18827 "Adding a suffix will probably not do what you expect."
18831 #: ../fish/guestfish.pod:683
18832 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18836 #: ../fish/guestfish.pod:685
18838 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18839 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18843 #: ../fish/guestfish.pod:688
18846 " 1234 decimal number 1234\n"
18847 " 02322 octal number, equivalent to decimal 1234\n"
18848 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18853 #: ../fish/guestfish.pod:692
18855 "When using the C<chmod> command, you almost always want to specify an octal "
18856 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18857 "L<chmod(1)> program):"
18861 #: ../fish/guestfish.pod:696
18864 " chmod 0777 /public # OK\n"
18865 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18870 #: ../fish/guestfish.pod:699
18872 "Commands that return numbers usually print them in decimal, but some "
18873 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18874 "octal, preceeded by C<0>)."
18878 #: ../fish/guestfish.pod:703
18879 msgid "WILDCARDS AND GLOBBING"
18883 #: ../fish/guestfish.pod:705
18885 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18886 "(globbing) by default. So for example the following will not do what you "
18891 #: ../fish/guestfish.pod:709
18899 #: ../fish/guestfish.pod:711
18901 "Assuming you don't have a directory called literally C</home/*> then the "
18902 "above command will return an error."
18906 #: ../fish/guestfish.pod:714
18907 msgid "To perform wildcard expansion, use the C<glob> command."
18911 #: ../fish/guestfish.pod:716
18914 " glob rm-rf /home/*\n"
18919 #: ../fish/guestfish.pod:718
18921 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18922 "many times), equivalent to:"
18926 #: ../fish/guestfish.pod:721
18929 " rm-rf /home/jim\n"
18930 " rm-rf /home/joe\n"
18931 " rm-rf /home/mary\n"
18936 #: ../fish/guestfish.pod:725
18937 msgid "C<glob> only works on simple guest paths and not on device names."
18941 #: ../fish/guestfish.pod:727
18943 "If you have several parameters, each containing a wildcard, then glob will "
18944 "perform a Cartesian product."
18948 #: ../fish/guestfish.pod:730
18953 #: ../fish/guestfish.pod:732
18955 "Any line which starts with a I<#> character is treated as a comment and "
18956 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18957 "a command. For example:"
18961 #: ../fish/guestfish.pod:736
18964 " # this is a comment\n"
18965 " # this is a comment\n"
18966 " foo # NOT a comment\n"
18971 #: ../fish/guestfish.pod:740
18972 msgid "Blank lines are also ignored."
18976 #: ../fish/guestfish.pod:742
18977 msgid "RUNNING COMMANDS LOCALLY"
18981 #: ../fish/guestfish.pod:744
18983 "Any line which starts with a I<!> character is treated as a command sent to "
18984 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18988 #: ../fish/guestfish.pod:748
18992 " tgz-out /remote local/remote-data.tar.gz\n"
18997 #: ../fish/guestfish.pod:751
18999 "will create a directory C<local> on the host, and then export the contents "
19000 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
19001 "(See C<tgz-out>)."
19005 #: ../fish/guestfish.pod:755
19007 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
19008 "effect, due to the way that subprocesses work in Unix."
19012 #: ../fish/guestfish.pod:758
19013 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
19017 #: ../fish/guestfish.pod:760
19019 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
19020 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
19021 "and executed as guestfish commands."
19025 #: ../fish/guestfish.pod:764
19027 "Thus you can use shell script to construct arbitrary guestfish commands "
19028 "which are then parsed by guestfish."
19032 #: ../fish/guestfish.pod:767
19034 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
19035 "through C</foo.100>) using guestfish commands alone. However this is simple "
19036 "if we use a shell script to create the guestfish commands for us:"
19040 #: ../fish/guestfish.pod:772
19043 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
19048 #: ../fish/guestfish.pod:774
19049 msgid "or with names like C</foo.001>:"
19053 #: ../fish/guestfish.pod:776
19056 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
19061 #: ../fish/guestfish.pod:778
19063 "When using guestfish interactively it can be helpful to just run the shell "
19064 "script first (ie. remove the initial C<E<lt>> character so it is just an "
19065 "ordinary I<!> local command), see what guestfish commands it would run, and "
19066 "when you are happy with those prepend the C<E<lt>> character to run the "
19067 "guestfish commands for real."
19071 #: ../fish/guestfish.pod:784
19076 #: ../fish/guestfish.pod:786
19078 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
19079 "command (a guestfish command) to the second command (any host command). For "
19084 #: ../fish/guestfish.pod:790
19087 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
19092 #: ../fish/guestfish.pod:792
19094 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
19095 "program). The above command would list all accounts in the guest filesystem "
19096 "which have UID 0, ie. root accounts including backdoors. Other examples:"
19100 #: ../fish/guestfish.pod:797
19103 " hexdump /bin/ls | head\n"
19104 " list-devices | tail -1\n"
19105 " tgz-out / - | tar ztf -\n"
19110 #: ../fish/guestfish.pod:801
19112 "The space before the pipe symbol is required, any space after the pipe "
19113 "symbol is optional. Everything after the pipe symbol is just passed "
19114 "straight to the host shell, so it can contain redirections, globs and "
19115 "anything else that makes sense on the host side."
19119 #: ../fish/guestfish.pod:806
19121 "To use a literal argument which begins with a pipe symbol, you have to quote "
19126 #: ../fish/guestfish.pod:809
19134 #: ../fish/guestfish.pod:811
19135 msgid "HOME DIRECTORIES"
19139 #: ../fish/guestfish.pod:813
19141 "If a parameter starts with the character C<~> then the tilde may be expanded "
19142 "as a home directory path (either C<~> for the current user's home directory, "
19143 "or C<~user> for another user)."
19147 #: ../fish/guestfish.pod:817
19149 "Note that home directory expansion happens for users known I<on the host>, "
19150 "not in the guest filesystem."
19154 #: ../fish/guestfish.pod:820
19156 "To use a literal argument which begins with a tilde, you have to quote it, "
19161 #: ../fish/guestfish.pod:823
19169 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:534
19170 msgid "ENCRYPTED DISKS"
19174 #: ../fish/guestfish.pod:827
19176 "Libguestfs has some support for Linux guests encrypted according to the "
19177 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
19178 "disk encryption systems used by modern Linux guests. Currently only "
19179 "LVM-on-LUKS is supported."
19183 #: ../fish/guestfish.pod:832
19184 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
19188 #: ../fish/guestfish.pod:834
19191 " ><fs> vfs-type /dev/sda2\n"
19197 #: ../fish/guestfish.pod:837
19199 "Then open those devices using L</luks-open>. This creates a device-mapper "
19200 "device called C</dev/mapper/luksdev>."
19204 #: ../fish/guestfish.pod:840
19207 " ><fs> luks-open /dev/sda2 luksdev\n"
19208 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
19213 #: ../fish/guestfish.pod:843
19215 "Finally you have to tell LVM to scan for volume groups on the newly created "
19220 #: ../fish/guestfish.pod:846
19224 " vg-activate-all true\n"
19229 #: ../fish/guestfish.pod:849
19230 msgid "The logical volume(s) can now be mounted in the usual way."
19234 #: ../fish/guestfish.pod:851
19236 "Before closing a LUKS device you must unmount any logical volumes on it and "
19237 "deactivate the volume groups by calling C<vg-activate false VG> on each "
19238 "one. Then you can close the mapper device:"
19242 #: ../fish/guestfish.pod:855
19245 " vg-activate false /dev/VG\n"
19246 " luks-close /dev/mapper/luksdev\n"
19251 #: ../fish/guestfish.pod:860
19253 "If a path is prefixed with C<win:> then you can use Windows-style drive "
19254 "letters and paths (with some limitations). The following commands are "
19259 #: ../fish/guestfish.pod:864
19262 " file /WINDOWS/system32/config/system.LOG\n"
19267 #: ../fish/guestfish.pod:866
19270 " file win:\\windows\\system32\\config\\system.log\n"
19275 #: ../fish/guestfish.pod:868
19278 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
19283 #: ../fish/guestfish.pod:870
19285 "The parameter is rewritten \"behind the scenes\" by looking up the position "
19286 "where the drive is mounted, prepending that to the path, changing all "
19287 "backslash characters to forward slash, then resolving the result using "
19288 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
19289 "then the parameter might be rewritten like this:"
19293 #: ../fish/guestfish.pod:876
19296 " win:e:\\foo\\bar => /e/FOO/bar\n"
19301 #: ../fish/guestfish.pod:878
19302 msgid "This only works in argument positions that expect a path."
19306 #: ../fish/guestfish.pod:880
19307 msgid "UPLOADING AND DOWNLOADING FILES"
19311 #: ../fish/guestfish.pod:882
19313 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19314 "others which upload from or download to a local file, you can use the "
19315 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19319 #: ../fish/guestfish.pod:886
19327 #: ../fish/guestfish.pod:888
19328 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
19332 #: ../fish/guestfish.pod:891
19335 " tar-out /etc - | tar tf -\n"
19340 #: ../fish/guestfish.pod:893
19342 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19343 "command (see L</PIPES>)."
19347 #: ../fish/guestfish.pod:896
19349 "When using C<-> to read from stdin, the input is read up to the end of "
19350 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19351 "some arbitrary end marker:"
19355 #: ../fish/guestfish.pod:900
19358 " upload -<<END /foo\n"
19367 #: ../fish/guestfish.pod:906
19369 "Any string of characters can be used instead of C<END>. The end marker must "
19370 "appear on a line of its own, without any preceeding or following characters "
19371 "(not even spaces)."
19375 #: ../fish/guestfish.pod:910
19377 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19378 "upload local files (so-called \"FileIn\" parameters in the generator)."
19382 #: ../fish/guestfish.pod:913
19383 msgid "EXIT ON ERROR BEHAVIOUR"
19387 #: ../fish/guestfish.pod:915
19389 "By default, guestfish will ignore any errors when in interactive mode "
19390 "(ie. taking commands from a human over a tty), and will exit on the first "
19391 "error in non-interactive mode (scripts, commands given on the command line)."
19395 #: ../fish/guestfish.pod:920
19397 "If you prefix a command with a I<-> character, then that command will not "
19398 "cause guestfish to exit, even if that (one) command returns an error."
19402 #: ../fish/guestfish.pod:924
19403 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19407 #: ../fish/guestfish.pod:926
19409 "Guestfish can be remote-controlled over a socket. This is useful "
19410 "particularly in shell scripts where you want to make several different "
19411 "changes to a filesystem, but you don't want the overhead of starting up a "
19412 "guestfish process each time."
19416 #: ../fish/guestfish.pod:931
19417 msgid "Start a guestfish server process using:"
19421 #: ../fish/guestfish.pod:933
19424 " eval \"`guestfish --listen`\"\n"
19429 #: ../fish/guestfish.pod:935
19430 msgid "and then send it commands by doing:"
19434 #: ../fish/guestfish.pod:937
19437 " guestfish --remote cmd [...]\n"
19442 #: ../fish/guestfish.pod:939
19443 msgid "To cause the server to exit, send it the exit command:"
19447 #: ../fish/guestfish.pod:943
19449 "Note that the server will normally exit if there is an error in a command. "
19450 "You can change this in the usual way. See section L</EXIT ON ERROR "
19455 #: ../fish/guestfish.pod:947
19456 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19460 #: ../fish/guestfish.pod:949
19462 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19463 "is how the I<--remote> option knows where to send the commands. You can "
19464 "have several guestfish listener processes running using:"
19468 #: ../fish/guestfish.pod:953
19471 " eval \"`guestfish --listen`\"\n"
19472 " pid1=$GUESTFISH_PID\n"
19473 " eval \"`guestfish --listen`\"\n"
19474 " pid2=$GUESTFISH_PID\n"
19476 " guestfish --remote=$pid1 cmd\n"
19477 " guestfish --remote=$pid2 cmd\n"
19482 #: ../fish/guestfish.pod:961
19483 msgid "REMOTE CONTROL AND CSH"
19487 #: ../fish/guestfish.pod:963
19489 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19494 #: ../fish/guestfish.pod:966
19497 " eval \"`guestfish --listen --csh`\"\n"
19502 #: ../fish/guestfish.pod:968
19503 msgid "REMOTE CONTROL DETAILS"
19507 #: ../fish/guestfish.pod:970
19509 "Remote control happens over a Unix domain socket called "
19510 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
19511 "of the process, and C<$PID> is the process ID of the server."
19515 #: ../fish/guestfish.pod:974
19516 msgid "Guestfish client and server versions must match exactly."
19520 #: ../fish/guestfish.pod:976
19521 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
19525 #: ../fish/guestfish.pod:978
19527 "From Bash, you can use the following code which creates a guestfish "
19528 "instance, correctly quotes the command line, handles failure to start, and "
19529 "cleans up guestfish when the script exits:"
19533 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:980
19541 #: ../fish/guestfish.pod:986
19544 " guestfish[0]=\"guestfish\"\n"
19545 " guestfish[1]=\"--listen\"\n"
19546 " guestfish[2]=\"--ro\"\n"
19547 " guestfish[3]=\"-a\"\n"
19548 " guestfish[4]=\"disk.img\"\n"
19553 #: ../fish/guestfish.pod:992
19556 " GUESTFISH_PID=\n"
19557 " eval $(\"${guestfish[@]}\")\n"
19558 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
19559 " echo \"error: guestfish didn't start up, see error messages above\"\n"
19566 #: ../fish/guestfish.pod:999
19569 " cleanup_guestfish ()\n"
19571 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
19573 " trap cleanup_guestfish EXIT ERR\n"
19578 #: ../fish/guestfish.pod:1005
19581 " guestfish --remote -- run\n"
19586 #: ../fish/guestfish.pod:1007
19594 #: ../fish/guestfish.pod:1009
19595 msgid "REMOTE CONTROL RUN COMMAND HANGING"
19599 #: ../fish/guestfish.pod:1011
19601 "Using the C<run> (or C<launch>) command remotely in a command substitution "
19602 "context hangs, ie. don't do (note the backquotes):"
19606 #: ../fish/guestfish.pod:1014
19609 " a=`guestfish --remote run`\n"
19614 #: ../fish/guestfish.pod:1016
19616 "Since the C<run> command produces no output on stdout, this is not useful "
19617 "anyway. For further information see "
19618 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
19622 #: ../fish/guestfish.pod:1020
19623 msgid "PREPARED DISK IMAGES"
19627 #: ../fish/guestfish.pod:1022
19629 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
19630 "preformatted disk images that guestfish can make for you to save typing. "
19631 "This is particularly useful for testing purposes. This option is used "
19632 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
19633 "can be mixed with I<-a>)."
19637 #: ../fish/guestfish.pod:1028
19639 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
19640 "the second and so on. Existing files in the current directory are "
19645 #: ../fish/guestfish.pod:1032
19647 "The type briefly describes how the disk should be sized, partitioned, how "
19648 "filesystem(s) should be created, and how content should be added. "
19649 "Optionally the type can be followed by extra parameters, separated by C<:> "
19650 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
19651 "sparsely-allocated disk, containing a single partition, with the partition "
19652 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
19653 "on a 1GB disk instead."
19657 #: ../fish/guestfish.pod:1040
19658 msgid "To list the available types and any extra parameters they take, run:"
19662 #: ../fish/guestfish.pod:1044
19664 "Note that the prepared filesystem is not mounted. You would usually have to "
19665 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
19669 #: ../fish/guestfish.pod:1048
19671 "If any I<-N> or I<--new> options are given, the guest is automatically "
19676 #: ../fish/guestfish.pod:1053
19677 msgid "Create a 100MB disk with an ext4-formatted partition:"
19681 #: ../fish/guestfish.pod:1055
19684 " guestfish -N fs:ext4\n"
19689 #: ../fish/guestfish.pod:1057
19690 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
19694 #: ../fish/guestfish.pod:1059
19697 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
19702 #: ../fish/guestfish.pod:1061
19703 msgid "Create a blank 200MB disk:"
19707 #: ../fish/guestfish.pod:1063
19710 " guestfish -N disk:200M\n"
19715 #: ../fish/guestfish.pod:1065
19716 msgid "PROGRESS BARS"
19720 #: ../fish/guestfish.pod:1067
19722 "Some (not all) long-running commands send progress notification messages as "
19723 "they are running. Guestfish turns these messages into progress bars."
19727 #: ../fish/guestfish.pod:1071
19729 "When a command that supports progress bars takes longer than two seconds to "
19730 "run, and if progress bars are enabled, then you will see one appearing below "
19735 #: ../fish/guestfish.pod:1075
19738 " ><fs> copy-size /large-file /another-file 2048M\n"
19739 " / 10% [#####-----------------------------------------] 00:30\n"
19744 #: ../fish/guestfish.pod:1078
19746 "The spinner on the left hand side moves round once for every progress "
19747 "notification received from the backend. This is a (reasonably) golden "
19748 "assurance that the command is \"doing something\" even if the progress bar "
19749 "is not moving, because the command is able to send the progress "
19750 "notifications. When the bar reaches 100% and the command finishes, the "
19751 "spinner disappears."
19755 #: ../fish/guestfish.pod:1085
19757 "Progress bars are enabled by default when guestfish is used interactively. "
19758 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19759 "and you can disable them completely using I<--no-progress-bars>."
19763 #: ../fish/guestfish.pod:1090
19764 msgid "GUESTFISH COMMANDS"
19768 #: ../fish/guestfish.pod:1092
19770 "The commands in this section are guestfish convenience commands, in other "
19771 "words, they are not part of the L<guestfs(3)> API."
19775 #: ../fish/guestfish.pod:1095
19780 #: ../fish/guestfish.pod:1097
19789 #: ../fish/guestfish.pod:1100
19790 msgid "Without any parameter, this provides general help."
19794 #: ../fish/guestfish.pod:1102
19795 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19799 #: ../fish/guestfish.pod:1104
19800 msgid "quit | exit"
19804 #: ../fish/guestfish.pod:1106
19805 msgid "This exits guestfish. You can also use C<^D> key."
19809 #: ../fish/guestfish.pod:1108
19810 msgid "@FISH_COMMANDS@"
19814 #: ../fish/guestfish.pod:1110
19819 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1520
19824 #: ../fish/guestfish.pod:1116
19826 "guestfish returns 0 if the commands completed without error, or 1 if there "
19831 #: ../fish/guestfish.pod:1123
19836 #: ../fish/guestfish.pod:1125
19838 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19843 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3213
19844 msgid "FEBOOTSTRAP_KERNEL"
19848 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3215
19849 msgid "FEBOOTSTRAP_MODULES"
19853 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3217
19855 "These two environment variables allow the kernel that libguestfs uses in the "
19856 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
19857 "most recent host kernel is chosen. For more information about kernel "
19858 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
19859 "available in febootstrap E<ge> 3.8."
19863 #: ../fish/guestfish.pod:1138
19864 msgid "GUESTFISH_DISPLAY_IMAGE"
19868 #: ../fish/guestfish.pod:1140
19870 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
19871 "If not set, it uses L<display(1)>."
19875 #: ../fish/guestfish.pod:1143
19876 msgid "GUESTFISH_PID"
19880 #: ../fish/guestfish.pod:1145
19882 "Used with the I<--remote> option to specify the remote guestfish process to "
19883 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19887 #: ../fish/guestfish.pod:1149
19892 #: ../fish/guestfish.pod:1151
19894 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19895 "not specified, the external L<hexedit(1)> program is used."
19899 #: ../fish/guestfish.pod:1155
19904 #: ../fish/guestfish.pod:1157
19906 "If compiled with GNU readline support, various files in the home directory "
19907 "can be used. See L</FILES>."
19911 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3223
19912 msgid "LIBGUESTFS_APPEND"
19916 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3225
19917 msgid "Pass additional options to the guest kernel."
19921 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3227
19922 msgid "LIBGUESTFS_DEBUG"
19926 #: ../fish/guestfish.pod:1166
19928 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19929 "effect as using the B<-v> option."
19933 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3232
19934 msgid "LIBGUESTFS_MEMSIZE"
19938 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3234
19939 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
19943 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3237
19946 " LIBGUESTFS_MEMSIZE=700\n"
19951 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3239
19952 msgid "LIBGUESTFS_PATH"
19956 #: ../fish/guestfish.pod:1178
19958 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19959 "the discussion of paths in L<guestfs(3)>."
19963 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3244
19964 msgid "LIBGUESTFS_QEMU"
19968 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3246
19970 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
19971 "which was found at compile time by the configure script is used."
19975 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3252
19976 msgid "LIBGUESTFS_TRACE"
19980 #: ../fish/guestfish.pod:1189
19981 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19985 #: ../fish/guestfish.pod:1191
19990 #: ../fish/guestfish.pod:1193
19992 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19997 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:236 ../src/guestfs.pod:3257
20002 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3259
20004 "Location of temporary directory, defaults to C</tmp> except for the cached "
20005 "supermin appliance which defaults to C</var/tmp>."
20009 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3262
20011 "If libguestfs was compiled to use the supermin appliance then the real "
20012 "appliance is cached in this directory, shared between all handles belonging "
20013 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
20014 "use in case C</var/tmp> is not large enough."
20018 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297 ../rescue/virt-rescue.pod:273
20023 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301 ../rescue/virt-rescue.pod:277
20024 msgid "$HOME/.libguestfs-tools.rc"
20028 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303 ../rescue/virt-rescue.pod:279
20029 msgid "/etc/libguestfs-tools.conf"
20033 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305 ../rescue/virt-rescue.pod:281
20035 "This configuration file controls the default read-only or read-write mode "
20036 "(I<--ro> or I<--rw>)."
20040 #: ../fish/guestfish.pod:1220
20041 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
20045 #: ../fish/guestfish.pod:1222
20046 msgid "$HOME/.guestfish"
20050 #: ../fish/guestfish.pod:1224
20052 "If compiled with GNU readline support, then the command history is saved in "
20057 #: ../fish/guestfish.pod:1227
20058 msgid "$HOME/.inputrc"
20062 #: ../fish/guestfish.pod:1229
20063 msgid "/etc/inputrc"
20067 #: ../fish/guestfish.pod:1231
20069 "If compiled with GNU readline support, then these files can be used to "
20070 "configure readline. For further information, please see "
20071 "L<readline(3)/INITIALIZATION FILE>."
20075 #: ../fish/guestfish.pod:1235
20076 msgid "To write rules which only apply to guestfish, use:"
20080 #: ../fish/guestfish.pod:1237
20090 #: ../fish/guestfish.pod:1241
20092 "Variables that you can set in inputrc that change the behaviour of guestfish "
20093 "in useful ways include:"
20097 #: ../fish/guestfish.pod:1246
20098 msgid "completion-ignore-case (default: on)"
20102 #: ../fish/guestfish.pod:1248
20104 "By default, guestfish will ignore case when tab-completing paths on the "
20109 #: ../fish/guestfish.pod:1251
20112 " set completion-ignore-case off\n"
20117 #: ../fish/guestfish.pod:1253
20118 msgid "to make guestfish case sensitive."
20122 #: ../fish/guestfish.pod:1257
20127 #: ../fish/guestfish.pod:1259
20128 msgid "test2.img (etc)"
20132 #: ../fish/guestfish.pod:1261
20134 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
20135 "will be created in the file C<test1.img> in the current directory. The "
20136 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
20137 "the same name will be overwritten."
20141 #: ../fish/guestfish.pod:1270
20143 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, "
20144 "L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, "
20145 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, "
20146 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
20147 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
20148 "L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
20149 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
20150 "L<febootstrap-supermin-helper(8)>."
20154 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3354 ../test-tool/libguestfs-test-tool.pod:112
20155 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
20159 #: ../fish/virt-copy-in.pod:5
20160 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
20164 #: ../fish/virt-copy-in.pod:9
20167 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
20172 #: ../fish/virt-copy-in.pod:11
20175 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
20180 #: ../fish/virt-copy-in.pod:15
20182 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
20183 "causing disk corruption. The virtual machine must be shut down before you "
20184 "use this command."
20188 #: ../fish/virt-copy-in.pod:21
20190 "C<virt-copy-in> copies files and directories from the local disk into a "
20191 "virtual machine disk image or named libvirt domain."
20195 #: ../fish/virt-copy-in.pod:24
20197 "You can give one of more filenames and directories on the command line. "
20198 "Directories are copied in recursively. The final parameter must be the "
20199 "destination directory in the disk image which must be an absolute path "
20200 "starting with a C</> character."
20204 #: ../fish/virt-copy-in.pod:33
20207 " virt-copy-in -d MyGuest resolv.conf /etc\n"
20212 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
20213 msgid "Upload a home directory to a guest:"
20217 #: ../fish/virt-copy-in.pod:37
20220 " virt-copy-in -d MyGuest skel /home\n"
20225 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
20226 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
20230 #: ../fish/virt-copy-in.pod:41
20232 "This command is just a simple shell script wrapper around the "
20233 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
20234 "trivial copy, you are probably better off using guestfish directly."
20238 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
20240 "Since the shell script just passes options straight to guestfish, read "
20241 "L<guestfish(1)> to see the full list of options."
20245 #: ../fish/virt-copy-in.pod:52
20247 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
20248 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20252 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
20253 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20257 #: ../fish/virt-copy-out.pod:5
20259 "virt-copy-out - Copy files and directories out of a virtual machine disk "
20264 #: ../fish/virt-copy-out.pod:9
20267 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
20272 #: ../fish/virt-copy-out.pod:11
20275 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
20280 #: ../fish/virt-copy-out.pod:15
20282 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
20283 "image or named libvirt domain."
20287 #: ../fish/virt-copy-out.pod:18
20289 "You can give one of more filenames and directories on the command line. "
20290 "Directories are copied out recursively."
20294 #: ../fish/virt-copy-out.pod:23
20295 msgid "Download the home directories from a virtual machine:"
20299 #: ../fish/virt-copy-out.pod:25
20303 " virt-copy-out -d MyGuest /home homes\n"
20308 #: ../fish/virt-copy-out.pod:30
20310 "This command is just a simple shell script wrapper around the "
20311 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
20312 "trivial copy, you are probably better off using guestfish directly."
20316 #: ../fish/virt-copy-out.pod:41
20318 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
20319 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20323 #: ../fish/virt-tar-in.pod:5
20324 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
20328 #: ../fish/virt-tar-in.pod:9
20331 " virt-tar-in -a disk.img data.tar /destination\n"
20336 #: ../fish/virt-tar-in.pod:11
20339 " virt-tar-in -d domain data.tar /destination\n"
20344 #: ../fish/virt-tar-in.pod:13
20347 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
20352 #: ../fish/virt-tar-in.pod:17
20354 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
20355 "causing disk corruption. The virtual machine must be shut down before you "
20356 "use this command."
20360 #: ../fish/virt-tar-in.pod:23
20362 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
20363 "image or named libvirt domain."
20367 #: ../fish/virt-tar-in.pod:26
20369 "The first parameter is the tar file. Use C<-> to read the tar file from "
20370 "standard input. The second parameter is the absolute target directory to "
20375 #: ../fish/virt-tar-in.pod:34
20378 " virt-tar-in -d MyGuest homes.tar /home\n"
20383 #: ../fish/virt-tar-in.pod:38
20385 "This command is just a simple shell script wrapper around the "
20386 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
20387 "copy, you are probably better off using guestfish directly."
20391 #: ../fish/virt-tar-in.pod:49
20393 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20394 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
20395 "L<http://libguestfs.org/>."
20399 #: ../fish/virt-tar-out.pod:5
20400 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
20404 #: ../fish/virt-tar-out.pod:9
20407 " virt-tar-out -a disk.img /dir files.tar\n"
20412 #: ../fish/virt-tar-out.pod:11
20415 " virt-tar-out -d domain /dir files.tar\n"
20420 #: ../fish/virt-tar-out.pod:13
20423 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
20428 #: ../fish/virt-tar-out.pod:17
20429 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
20433 #: ../fish/virt-tar-out.pod:20
20435 "The first parameter is the absolute path of the virtual machine directory. "
20436 "The second parameter is the tar file to write. Use C<-> to write to "
20441 #: ../fish/virt-tar-out.pod:26
20442 msgid "Download the home directories from a guest:"
20446 #: ../fish/virt-tar-out.pod:28
20449 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
20454 #: ../fish/virt-tar-out.pod:32
20456 "This command is just a simple shell script wrapper around the "
20457 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
20458 "trivial copy, you are probably better off using guestfish directly."
20462 #: ../fish/virt-tar-out.pod:43
20464 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20465 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
20469 #: ../fuse/guestmount.pod:5
20470 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
20474 #: ../fuse/guestmount.pod:9
20477 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
20482 #: ../fuse/guestmount.pod:11
20485 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
20490 #: ../fuse/guestmount.pod:13
20493 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
20498 #: ../fuse/guestmount.pod:17
20500 "You must I<not> use C<guestmount> in read-write mode on live virtual "
20501 "machines. If you do this, you risk disk corruption in the VM."
20505 #: ../fuse/guestmount.pod:22
20507 "The guestmount program can be used to mount virtual machine filesystems and "
20508 "other disk images on the host. It uses libguestfs for access to the guest "
20509 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
20510 "a mountable device."
20514 #: ../fuse/guestmount.pod:27
20516 "Along with other options, you have to give at least one device (I<-a> "
20517 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
20518 "option) or use the I<-i> inspection option or the I<--live> option. How "
20519 "this works is better explained in the L<guestfish(1)> manual page, or by "
20520 "looking at the examples below."
20524 #: ../fuse/guestmount.pod:33
20526 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
20527 "by you, and the filesystem will not be visible to any other users unless you "
20528 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
20529 "the filesystem, use the C<fusermount -u> command."
20533 #: ../fuse/guestmount.pod:41
20535 "For a typical Windows guest which has its main filesystem on the first "
20540 #: ../fuse/guestmount.pod:44
20543 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
20548 #: ../fuse/guestmount.pod:46
20550 "For a typical Linux guest which has a /boot filesystem on the first "
20551 "partition, and the root filesystem on a logical volume:"
20555 #: ../fuse/guestmount.pod:49
20558 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
20563 #: ../fuse/guestmount.pod:51
20564 msgid "To get libguestfs to detect guest mountpoints for you:"
20568 #: ../fuse/guestmount.pod:53
20571 " guestmount -a guest.img -i --ro /mnt\n"
20576 #: ../fuse/guestmount.pod:55
20577 msgid "For a libvirt guest called \"Guest\" you could do:"
20581 #: ../fuse/guestmount.pod:57
20584 " guestmount -d Guest -i --ro /mnt\n"
20589 #: ../fuse/guestmount.pod:59
20591 "If you don't know what filesystems are contained in a guest or disk image, "
20592 "use L<virt-filesystems(1)> first:"
20596 #: ../fuse/guestmount.pod:62
20599 " virt-filesystems MyGuest\n"
20604 #: ../fuse/guestmount.pod:64
20606 "If you want to trace the libguestfs calls but without excessive debugging "
20607 "information, we recommend:"
20611 #: ../fuse/guestmount.pod:67
20614 " guestmount [...] --trace /mnt\n"
20619 #: ../fuse/guestmount.pod:69
20620 msgid "If you want to debug the program, we recommend:"
20624 #: ../fuse/guestmount.pod:71
20627 " guestmount [...] --trace --verbose /mnt\n"
20632 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68 ../resize/virt-resize.pod:621
20637 #: ../fuse/guestmount.pod:75
20638 msgid "Other users cannot see the filesystem by default"
20642 #: ../fuse/guestmount.pod:77
20644 "If you mount a filesystem as one user (eg. root), then other users will not "
20645 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
20646 "option when mounting:"
20650 #: ../fuse/guestmount.pod:81
20653 " sudo guestmount [...] -o allow_other /mnt\n"
20658 #: ../fuse/guestmount.pod:83
20659 msgid "Enabling FUSE"
20663 #: ../fuse/guestmount.pod:85
20665 "On some distros, you may need to add yourself to a special group "
20666 "(eg. C<fuse>) before you can use any FUSE filesystem. This is necessary on "
20667 "Debian and derivatives."
20671 #: ../fuse/guestmount.pod:89
20673 "On other distros, no special group is required. It is not necessary on "
20674 "Fedora or Red Hat Enterprise Linux."
20678 #: ../fuse/guestmount.pod:100
20679 msgid "Add a block device or virtual machine image."
20683 #: ../fuse/guestmount.pod:123
20684 msgid "B<--dir-cache-timeout N>"
20688 #: ../fuse/guestmount.pod:125
20690 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
20691 "seconds. The readdir cache [actually, there are several semi-independent "
20692 "caches] is populated after a readdir(2) call with the stat and extended "
20693 "attributes of the files in the directory, in anticipation that they will be "
20694 "requested soon after."
20698 #: ../fuse/guestmount.pod:131
20700 "There is also a different attribute cache implemented by FUSE (see the FUSE "
20701 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
20702 "requests, only cache existing ones."
20706 #: ../fuse/guestmount.pod:151
20708 "If you have untrusted raw-format guest disk images, you should use this "
20709 "option to specify the disk format. This avoids a possible security problem "
20710 "with malicious guests (CVE-2010-3851). See also "
20711 "L<guestfs(3)/guestfs_add_drive_opts>."
20715 #: ../fuse/guestmount.pod:156
20716 msgid "B<--fuse-help>"
20720 #: ../fuse/guestmount.pod:158
20721 msgid "Display help on special FUSE options (see I<-o> below)."
20725 #: ../fuse/guestmount.pod:162
20726 msgid "Display brief help and exit."
20730 #: ../fuse/guestmount.pod:186
20732 "Mount the named partition or logical volume on the given mountpoint B<in the "
20733 "guest> (this has nothing to do with mountpoints in the host)."
20737 #: ../fuse/guestmount.pod:189
20739 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
20740 "something on C</>."
20744 #: ../fuse/guestmount.pod:206
20746 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
20747 "unmounted. If you specify this option, then we don't attempt to sync the "
20748 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
20752 #: ../fuse/guestmount.pod:211
20753 msgid "B<-o option>"
20757 #: ../fuse/guestmount.pod:213
20758 msgid "B<--option option>"
20762 #: ../fuse/guestmount.pod:215
20763 msgid "Pass extra options to FUSE."
20767 #: ../fuse/guestmount.pod:217
20769 "To get a list of all the extra options supported by FUSE, use the command "
20770 "below. Note that only the FUSE I<-o> options can be passed, and only some "
20771 "of them are a good idea."
20775 #: ../fuse/guestmount.pod:221
20778 " guestmount --fuse-help\n"
20783 #: ../fuse/guestmount.pod:223
20784 msgid "Some potentially useful FUSE options:"
20788 #: ../fuse/guestmount.pod:227
20789 msgid "B<-o allow_other>"
20793 #: ../fuse/guestmount.pod:229
20794 msgid "Allow other users to see the filesystem."
20798 #: ../fuse/guestmount.pod:231
20799 msgid "B<-o attr_timeout=N>"
20803 #: ../fuse/guestmount.pod:233
20804 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
20808 #: ../fuse/guestmount.pod:235
20809 msgid "B<-o kernel_cache>"
20813 #: ../fuse/guestmount.pod:237
20815 "Allow the kernel to cache files (reduces the number of reads that have to go "
20816 "through the L<guestfs(3)> API). This is generally a good idea if you can "
20817 "afford the extra memory usage."
20821 #: ../fuse/guestmount.pod:241
20822 msgid "B<-o uid=N> B<-o gid=N>"
20826 #: ../fuse/guestmount.pod:243
20828 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
20829 "the chosen values."
20833 #: ../fuse/guestmount.pod:252
20835 "Add devices and mount everything read-only. Also disallow writes and make "
20836 "the disk appear read-only to FUSE."
20840 #: ../fuse/guestmount.pod:255
20842 "This is highly recommended if you are not going to edit the guest disk. If "
20843 "the guest is running and this option is I<not> supplied, then there is a "
20844 "strong risk of disk corruption in the guest. We try to prevent this from "
20845 "happening, but it is not always possible."
20849 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:171
20850 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20854 #: ../fuse/guestmount.pod:264
20855 msgid "Enable SELinux support for the guest."
20859 #: ../fuse/guestmount.pod:270
20860 msgid "Enable verbose messages from underlying libguestfs."
20864 #: ../fuse/guestmount.pod:276
20865 msgid "Display the program version and exit."
20869 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308 ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
20870 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20874 #: ../fuse/guestmount.pod:289
20879 #: ../fuse/guestmount.pod:291
20880 msgid "Trace libguestfs calls and entry into each FUSE function."
20884 #: ../fuse/guestmount.pod:293
20885 msgid "This also stops the daemon from forking into the background."
20889 #: ../fuse/guestmount.pod:319
20891 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
20892 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
20893 "L<http://fuse.sf.net/>."
20897 #: ../fuse/guestmount.pod:334
20898 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
20902 #: ../inspector/virt-inspector.pod:5
20904 "virt-inspector - Display operating system version and other information "
20905 "about a virtual machine"
20909 #: ../inspector/virt-inspector.pod:9
20912 " virt-inspector [--options] -d domname\n"
20917 #: ../inspector/virt-inspector.pod:11
20920 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
20925 #: ../inspector/virt-inspector.pod:15
20928 " virt-inspector domname\n"
20933 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:148
20936 " virt-inspector disk.img [disk.img ...]\n"
20941 #: ../inspector/virt-inspector.pod:21
20943 "B<virt-inspector> examines a virtual machine or disk image and tries to "
20944 "determine the version of the operating system and other information about "
20945 "the virtual machine."
20949 #: ../inspector/virt-inspector.pod:25
20950 msgid "Virt-inspector produces XML output for feeding into other programs."
20954 #: ../inspector/virt-inspector.pod:27
20956 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
20957 "the libvirt domain (see: C<virsh list --all>)."
20961 #: ../inspector/virt-inspector.pod:30
20963 "You can also run virt-inspector directly on disk images from a single "
20964 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
20965 "has several block devices, in which case you should list several I<-a> "
20966 "options one after another, with the first corresponding to the guest's "
20967 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
20971 #: ../inspector/virt-inspector.pod:37
20973 "You can also run virt-inspector on install disks, live CDs, bootable USB "
20974 "keys and similar."
20978 #: ../inspector/virt-inspector.pod:40
20980 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
20981 "inspect several virtual machines, you have to run virt-inspector several "
20982 "times (for example, from a shell script for-loop)."
20986 #: ../inspector/virt-inspector.pod:45
20988 "Because virt-inspector needs direct access to guest images, it won't "
20989 "normally work over remote libvirt connections."
20993 #: ../inspector/virt-inspector.pod:48
20995 "All of the information available from virt-inspector is also available "
20996 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
20997 "The same information can also be fetched using guestfish or via libguestfs "
20998 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
20999 "WITH OTHER PROGRAMMING LANGUAGES>)."
21003 #: ../inspector/virt-inspector.pod:81
21005 "Libvirt is only used if you specify a C<domname> on the command line. If "
21006 "you specify guest block devices directly (I<-a>), then libvirt is not used "
21011 #: ../inspector/virt-inspector.pod:94
21013 "When prompting for keys and passphrases, virt-inspector normally turns "
21014 "echoing off so you cannot see what you are typing. If you are not worried "
21015 "about Tempest attacks and there is no one else in the room you can specify "
21016 "this flag to see what you are typing."
21020 #: ../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
21022 "Specify the format of disk images given on the command line. If this is "
21023 "omitted then the format is autodetected from the content of the disk image."
21027 #: ../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
21029 "If disk images are requested from libvirt, then this program asks libvirt "
21030 "for this information. In this case, the value of the format parameter is "
21035 #: ../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
21037 "If working with untrusted raw-format guest disk images, you should ensure "
21038 "the format is always specified."
21042 #: ../inspector/virt-inspector.pod:135
21043 msgid "B<--xpath> query"
21047 #: ../inspector/virt-inspector.pod:137
21049 "Perform an XPath query on the XML on stdin, and print the result on stdout. "
21050 "In this mode virt-inspector simply runs an XPath query; all other inspection "
21051 "functions are disabled. See L</XPATH QUERIES> below for some examples."
21055 #: ../inspector/virt-inspector.pod:146
21056 msgid "Previous versions of virt-inspector allowed you to write either:"
21060 #: ../inspector/virt-inspector.pod:152
21063 " virt-inspector guestname\n"
21068 #: ../inspector/virt-inspector.pod:160
21073 #: ../inspector/virt-inspector.pod:162
21075 "The virt-inspector XML is described precisely in a RELAX NG schema file "
21076 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
21077 "just an overview."
21081 #: ../inspector/virt-inspector.pod:166
21083 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
21084 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
21085 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
21086 "which is vanishingly rare in real world VMs."
21090 #: ../inspector/virt-inspector.pod:171
21091 msgid "E<lt>operatingsystemE<gt>"
21095 #: ../inspector/virt-inspector.pod:173
21097 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
21098 "describe the operating system, its architecture, the descriptive \"product "
21099 "name\" string, the type of OS and so on, as in this example:"
21103 #: ../inspector/virt-inspector.pod:177
21106 " <operatingsystems>\n"
21107 " <operatingsystem>\n"
21108 " <root>/dev/sda2</root>\n"
21109 " <name>windows</name>\n"
21110 " <arch>i386</arch>\n"
21111 " <distro>windows</distro>\n"
21112 " <product_name>Windows 7 Enterprise</product_name>\n"
21113 " <product_variant>Client</product_variant>\n"
21114 " <major_version>6</major_version>\n"
21115 " <minor_version>1</minor_version>\n"
21116 " <windows_systemroot>/Windows</windows_systemroot>\n"
21117 " <format>installed</format>\n"
21122 #: ../inspector/virt-inspector.pod:190
21124 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
21125 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
21126 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
21127 "architecture. The other fields are fairly self-explanatory, but because "
21128 "these fields are taken directly from the libguestfs inspection API you can "
21129 "find precise information from L<guestfs(3)/INSPECTION>."
21133 #: ../inspector/virt-inspector.pod:198
21135 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
21136 "of view of libguestfs (block devices may have completely different names "
21137 "inside the VM itself)."
21141 #: ../inspector/virt-inspector.pod:202
21142 msgid "E<lt>mountpointsE<gt>"
21146 #: ../inspector/virt-inspector.pod:204
21148 "Un*x-like guests typically have multiple filesystems which are mounted at "
21149 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
21150 "element which looks like this:"
21154 #: ../inspector/virt-inspector.pod:208
21157 " <operatingsystems>\n"
21158 " <operatingsystem>\n"
21161 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
21162 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
21163 " </mountpoints>\n"
21168 #: ../inspector/virt-inspector.pod:216
21170 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
21171 "and may have completely different names inside the guest. Only mountable "
21172 "filesystems appear in this list, not things like swap devices."
21176 #: ../inspector/virt-inspector.pod:221
21177 msgid "E<lt>filesystemsE<gt>"
21181 #: ../inspector/virt-inspector.pod:223
21183 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
21184 "filesystems belonging to the guest, including swap and empty partitions. "
21185 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
21186 "this OS or shared with this OS and other OSes)."
21190 #: ../inspector/virt-inspector.pod:229
21191 msgid "You might see something like this:"
21195 #: ../inspector/virt-inspector.pod:231
21198 " <operatingsystems>\n"
21199 " <operatingsystem>\n"
21202 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21203 " <type>ext4</type>\n"
21204 " <label>Fedora-13-x86_64</label>\n"
21205 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
21211 #: ../inspector/virt-inspector.pod:241
21213 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
21214 "the label, and the UUID."
21218 #: ../inspector/virt-inspector.pod:244
21219 msgid "E<lt>applicationsE<gt>"
21223 #: ../inspector/virt-inspector.pod:246
21225 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
21226 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
21231 #: ../inspector/virt-inspector.pod:250
21233 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
21234 "Typical values would be C<rpm> and C<deb>."
21238 #: ../inspector/virt-inspector.pod:253
21240 "E<lt>package_managementE<gt>, if present, describes the package manager. "
21241 "Typical values include C<yum>, C<up2date> and C<apt>"
21245 #: ../inspector/virt-inspector.pod:256
21246 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
21250 #: ../inspector/virt-inspector.pod:259
21253 " <operatingsystems>\n"
21254 " <operatingsystem>\n"
21256 " <applications>\n"
21258 " <name>coreutils</name>\n"
21259 " <version>8.5</version>\n"
21260 " <release>1</release>\n"
21261 " </application>\n"
21266 #: ../inspector/virt-inspector.pod:269
21268 "The version and release fields may not be available for some types guests. "
21269 "Other fields are possible, see "
21270 "L<guestfs(3)/guestfs_inspect_list_applications>."
21274 #: ../inspector/virt-inspector.pod:273
21275 msgid "E<lt>drive_mappingsE<gt>"
21279 #: ../inspector/virt-inspector.pod:275
21281 "For operating systems like Windows which use drive letters, virt-inspector "
21282 "is able to find out how drive letters map to filesystems."
21286 #: ../inspector/virt-inspector.pod:279
21289 " <operatingsystems>\n"
21290 " <operatingsystem>\n"
21292 " <drive_mappings>\n"
21293 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
21294 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
21295 " </drive_mappings>\n"
21300 #: ../inspector/virt-inspector.pod:287
21302 "In the example above, drive C maps to the filesystem on the second partition "
21303 "on the first disk, and drive E maps to the filesystem on the first partition "
21304 "on the second disk."
21308 #: ../inspector/virt-inspector.pod:291
21310 "Note that this only covers permanent local filesystem mappings, not things "
21311 "like network shares. Furthermore NTFS volume mount points may not be listed "
21316 #: ../inspector/virt-inspector.pod:295
21317 msgid "E<lt>iconE<gt>"
21321 #: ../inspector/virt-inspector.pod:297
21323 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
21324 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
21325 "very large and high quality."
21329 #: ../inspector/virt-inspector.pod:301
21332 " <operatingsystems>\n"
21333 " <operatingsystem>\n"
21336 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
21337 " [... many lines of base64 data ...]\n"
21343 #: ../inspector/virt-inspector.pod:309
21345 "To display the icon, you have to extract it and convert the base64 data back "
21346 "to a binary file. Use an XPath query or simply an editor to extract the "
21347 "data, then use the coreutils L<base64(1)> program to do the conversion back "
21352 #: ../inspector/virt-inspector.pod:314
21355 " base64 -i -d < icon.data > icon.png\n"
21360 #: ../inspector/virt-inspector.pod:316
21361 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
21365 #: ../inspector/virt-inspector.pod:318
21367 "Virt-inspector can detect some operating system installers on install disks, "
21368 "live CDs, bootable USB keys and more."
21372 #: ../inspector/virt-inspector.pod:321
21374 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
21375 "fields may be present to indicate a live CD, network installer, or one part "
21376 "of a multipart CD. For example:"
21380 #: ../inspector/virt-inspector.pod:325
21383 " <operatingsystems>\n"
21384 " <operatingsystem>\n"
21385 " <root>/dev/sda</root>\n"
21386 " <name>linux</name>\n"
21387 " <arch>i386</arch>\n"
21388 " <distro>ubuntu</distro>\n"
21389 " <product_name>Ubuntu 10.10 "Maverick "
21390 "Meerkat"</product_name>\n"
21391 " <major_version>10</major_version>\n"
21392 " <minor_version>10</minor_version>\n"
21393 " <format>installer</format>\n"
21399 #: ../inspector/virt-inspector.pod:337
21400 msgid "XPATH QUERIES"
21404 #: ../inspector/virt-inspector.pod:339
21406 "Virt-inspector includes built in support for running XPath queries. The "
21407 "reason for including XPath support directly in virt-inspector is simply that "
21408 "there are no good and widely available command line programs that can do "
21409 "XPath queries. The only good one is L<xmlstarlet(1)> and that is not "
21410 "available on Red Hat Enterprise Linux."
21414 #: ../inspector/virt-inspector.pod:346
21416 "To perform an XPath query, use the I<--xpath> option. Note that in this "
21417 "mode, virt-inspector simply reads XML from stdin and outputs the query "
21418 "result on stdout. All other inspection features are disabled in this mode."
21422 #: ../inspector/virt-inspector.pod:353
21425 " $ virt-inspector -d Guest | virt-inspector --xpath '//filesystems'\n"
21427 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21428 " <type>ext4</type>\n"
21434 #: ../inspector/virt-inspector.pod:359
21437 " $ virt-inspector -d Guest | \\\n"
21438 " virt-inspector --xpath "
21439 "\"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
21445 #: ../inspector/virt-inspector.pod:363
21448 " $ virt-inspector -d Guest | \\\n"
21449 " virt-inspector --xpath 'string(//icon)' | base64 -i -d | display -\n"
21450 " [displays the guest icon, if there is one]\n"
21455 #: ../inspector/virt-inspector.pod:374
21456 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
21460 #: ../inspector/virt-inspector.pod:376
21462 "Early versions of libguestfs shipped with a different virt-inspector program "
21463 "written in Perl (the current version is written in C). The XML output of "
21464 "the Perl virt-inspector was different and it could also output in other "
21465 "formats like text."
21469 #: ../inspector/virt-inspector.pod:381
21470 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
21474 #: ../inspector/virt-inspector.pod:384
21476 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
21477 "versions of virt-inspector with different names:"
21481 #: ../inspector/virt-inspector.pod:387
21484 " virt-inspector Old Perl version.\n"
21485 " virt-inspector2 New C version.\n"
21490 #: ../inspector/virt-inspector.pod:397
21492 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
21493 "L<base64(1)>, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
21497 #: ../inspector/virt-inspector.pod:414
21498 msgid "Matthew Booth L<mbooth@redhat.com>"
21502 #: ../java/examples/guestfs-java.pod:5
21503 msgid "guestfs-java - How to use libguestfs from Java"
21507 #: ../java/examples/guestfs-java.pod:9
21510 " import com.redhat.et.libguestfs.*;\n"
21515 #: ../java/examples/guestfs-java.pod:11
21518 " GuestFS g = new GuestFS ();\n"
21519 " g.add_drive_opts (\"disk.img\", null);\n"
21525 #: ../java/examples/guestfs-java.pod:17
21527 "This manual page documents how to call libguestfs from the Java programming "
21528 "language. This page just documents the differences from the C API and gives "
21529 "some examples. If you are not familiar with using libguestfs, you also need "
21530 "to read L<guestfs(3)>."
21534 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
21535 msgid "CLOSING THE HANDLE"
21539 #: ../java/examples/guestfs-java.pod:24
21541 "The handle is closed when it is reaped by the garbage collector. Because "
21542 "libguestfs handles include a lot of state, it is also possible to close (and "
21543 "hence free) them explicitly by calling the C<close> method."
21547 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
21552 #: ../java/examples/guestfs-java.pod:31
21554 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
21555 "exception. This has a single parameter which is the error message (a "
21560 #: ../java/examples/guestfs-java.pod:35
21561 msgid "Calling any method on a closed handle raises the same exception."
21565 #: ../java/examples/guestfs-java.pod:47
21567 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21568 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21569 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21570 "L<http://caml.inria.fr/>."
21574 #: ../ocaml/examples/guestfs-ocaml.pod:5
21575 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
21579 #: ../ocaml/examples/guestfs-ocaml.pod:9
21580 msgid "Module style:"
21584 #: ../ocaml/examples/guestfs-ocaml.pod:11
21587 " let g = Guestfs.create () in\n"
21588 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21589 " Guestfs.launch g;\n"
21594 #: ../ocaml/examples/guestfs-ocaml.pod:15
21595 msgid "Object-oriented style:"
21599 #: ../ocaml/examples/guestfs-ocaml.pod:17
21602 " let g = new Guestfs.guestfs () in\n"
21603 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21609 #: ../ocaml/examples/guestfs-ocaml.pod:21
21612 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
21614 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
21619 #: ../ocaml/examples/guestfs-ocaml.pod:27
21621 "This manual page documents how to call libguestfs from the OCaml programming "
21622 "language. This page just documents the differences from the C API and gives "
21623 "some examples. If you are not familiar with using libguestfs, you also need "
21624 "to read L<guestfs(3)>."
21628 #: ../ocaml/examples/guestfs-ocaml.pod:32
21629 msgid "PROGRAMMING STYLES"
21633 #: ../ocaml/examples/guestfs-ocaml.pod:34
21635 "There are two different programming styles supported by the OCaml bindings. "
21636 "You can use a module style, with each C function mapped to an OCaml "
21641 #: ../ocaml/examples/guestfs-ocaml.pod:38
21644 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
21649 #: ../ocaml/examples/guestfs-ocaml.pod:40
21654 #: ../ocaml/examples/guestfs-ocaml.pod:42
21657 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
21662 #: ../ocaml/examples/guestfs-ocaml.pod:44
21664 "Alternately you can use an object-oriented style, calling methods on the "
21665 "class C<Guestfs.guestfs>:"
21669 #: ../ocaml/examples/guestfs-ocaml.pod:47
21672 " method set_verbose : bool -> unit\n"
21677 #: ../ocaml/examples/guestfs-ocaml.pod:49
21679 "The object-oriented style is usually briefer, and the minor performance "
21680 "penalty isn't noticable in the general overhead of performing libguestfs "
21685 #: ../ocaml/examples/guestfs-ocaml.pod:55
21687 "The handle is closed when it is reaped by the garbage collector. Because "
21688 "libguestfs handles include a lot of state, it is also possible to close (and "
21689 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
21694 #: ../ocaml/examples/guestfs-ocaml.pod:62
21696 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
21697 "exception. This has a single parameter which is the error message (a "
21702 #: ../ocaml/examples/guestfs-ocaml.pod:66
21704 "Calling any function/method on a closed handle raises "
21705 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
21710 #: ../ocaml/examples/guestfs-ocaml.pod:80
21712 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21713 "L<guestfs-java(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21714 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21715 "L<http://caml.inria.fr/>."
21719 #: ../perl/examples/guestfs-perl.pod:5
21720 msgid "guestfs-perl - How to use libguestfs from Perl"
21724 #: ../perl/examples/guestfs-perl.pod:9
21727 " use Sys::Guestfs;\n"
21732 #: ../perl/examples/guestfs-perl.pod:11
21735 " my $h = Sys::Guestfs->new ();\n"
21736 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
21737 " $h->launch ();\n"
21738 " $h->mount_options ('', '/dev/sda1', '/');\n"
21739 " $h->touch ('/hello');\n"
21745 #: ../perl/examples/guestfs-perl.pod:20
21747 "This manual page documents how to call libguestfs from the Perl programming "
21748 "language. This page just documents the differences from the C API and gives "
21749 "some examples. If you are not familiar with using libguestfs, you also need "
21750 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
21754 #: ../perl/examples/guestfs-perl.pod:26
21759 #: ../perl/examples/guestfs-perl.pod:28
21761 "Errors from libguestfs functions turn into calls to C<croak> (see "
21766 #: ../perl/examples/guestfs-perl.pod:41
21768 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
21769 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
21770 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
21771 "L<http://libguestfs.org/>."
21775 #: ../python/examples/guestfs-python.pod:5
21776 msgid "guestfs-python - How to use libguestfs from Python"
21780 #: ../python/examples/guestfs-python.pod:9
21783 " import guestfs\n"
21784 " g = guestfs.GuestFS ()\n"
21785 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
21791 #: ../python/examples/guestfs-python.pod:16
21793 "This manual page documents how to call libguestfs from the Python "
21794 "programming language. This page just documents the differences from the C "
21795 "API and gives some examples. If you are not familiar with using libguestfs, "
21796 "you also need to read L<guestfs(3)>."
21800 #: ../python/examples/guestfs-python.pod:23
21802 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
21803 "single string argument which is the error message."
21807 #: ../python/examples/guestfs-python.pod:26
21808 msgid "MORE DOCUMENTATION"
21812 #: ../python/examples/guestfs-python.pod:28
21817 #: ../python/examples/guestfs-python.pod:30
21821 " >>> import guestfs\n"
21822 " >>> help (guestfs)\n"
21827 #: ../python/examples/guestfs-python.pod:44
21829 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21830 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
21831 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
21835 #: ../rescue/virt-rescue.pod:5
21836 msgid "virt-rescue - Run a rescue shell on a virtual machine"
21840 #: ../rescue/virt-rescue.pod:9
21843 " virt-rescue [--options] -d domname\n"
21848 #: ../rescue/virt-rescue.pod:11
21851 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
21856 #: ../rescue/virt-rescue.pod:15
21859 " virt-rescue [--options] domname\n"
21864 #: ../rescue/virt-rescue.pod:17
21867 " virt-rescue [--options] disk.img [disk.img ...]\n"
21872 #: ../rescue/virt-rescue.pod:21
21874 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
21875 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
21876 "you from doing this, but doesn't catch all cases."
21880 #: ../rescue/virt-rescue.pod:25
21882 "However if you use the I<--ro> (read only) option, then you can attach a "
21883 "shell to a live virtual machine. The results might be strange or "
21884 "inconsistent at times but you won't get disk corruption."
21888 #: ../rescue/virt-rescue.pod:31
21890 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
21891 "need for a CD. virt-rescue gives you a rescue shell and some simple "
21892 "recovery tools which you can use to examine or rescue a virtual machine or "
21897 #: ../rescue/virt-rescue.pod:36
21899 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
21900 "on disk image(s):"
21904 #: ../rescue/virt-rescue.pod:39
21907 " virt-rescue -d GuestName\n"
21912 #: ../rescue/virt-rescue.pod:41
21915 " virt-rescue --ro -a /path/to/disk.img\n"
21920 #: ../rescue/virt-rescue.pod:43
21923 " virt-rescue -a /dev/sdc\n"
21928 #: ../rescue/virt-rescue.pod:45
21929 msgid "For live VMs you I<must> use the --ro option."
21933 #: ../rescue/virt-rescue.pod:47
21935 "When you run virt-rescue on a virtual machine or disk image, you are placed "
21936 "in an interactive bash shell where you can use many ordinary Linux "
21937 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
21938 "appliance. You must mount the virtual machine's filesystems by hand. There "
21939 "is an empty directory called C</sysroot> where you can mount filesystems."
21943 #: ../rescue/virt-rescue.pod:54
21945 "In the example below, we list logical volumes, then choose one to mount "
21946 "under C</sysroot>:"
21950 #: ../rescue/virt-rescue.pod:57
21954 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
21955 " lv_root vg_f11x64 -wi-a- 8.83G\n"
21956 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
21957 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
21958 " ><rescue> ls /sysroot\n"
21963 #: ../rescue/virt-rescue.pod:64
21965 "If you don't know what filesystems are available on the virtual machine then "
21966 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
21970 #: ../rescue/virt-rescue.pod:70
21972 "Virt-rescue can be used on I<any> disk image file or device, not just a "
21973 "virtual machine. For example you can use it on a blank file if you want to "
21974 "partition that file (although we would recommend using L<guestfish(1)> "
21975 "instead as it is more suitable for this purpose). You can even use "
21976 "virt-rescue on things like SD cards."
21980 #: ../rescue/virt-rescue.pod:76
21982 "Virt-rescue does not require root. You only need to run it as root if you "
21983 "need root to open the disk image."
21987 #: ../rescue/virt-rescue.pod:79
21989 "This tool is just designed for quick interactive hacking on a virtual "
21990 "machine. For more structured access to a virtual machine disk image, you "
21991 "should use L<guestfs(3)>. To get a structured shell that you can use to "
21992 "make scripted changes to guests, use L<guestfish(1)>."
21996 #: ../rescue/virt-rescue.pod:103
21997 msgid "B<--append kernelopts>"
22001 #: ../rescue/virt-rescue.pod:105
22002 msgid "Pass additional options to the rescue kernel."
22006 #: ../rescue/virt-rescue.pod:135
22009 " virt-rescue --format=raw -a disk.img\n"
22014 #: ../rescue/virt-rescue.pod:139
22017 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
22022 #: ../rescue/virt-rescue.pod:148
22027 #: ../rescue/virt-rescue.pod:150
22028 msgid "B<--memsize MB>"
22032 #: ../rescue/virt-rescue.pod:152
22034 "Change the amount of memory allocated to the rescue system. The default is "
22035 "set by libguestfs and is small but adequate for running system tools. The "
22036 "occasional program might need more memory. The parameter is specified in "
22041 #: ../rescue/virt-rescue.pod:157
22042 msgid "B<--network>"
22046 #: ../rescue/virt-rescue.pod:159
22047 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
22051 #: ../rescue/virt-rescue.pod:165
22052 msgid "Open the image read-only."
22056 #: ../rescue/virt-rescue.pod:175
22058 "Enable SELinux in the rescue appliance. You should read "
22059 "L<guestfs(3)/SELINUX> before using this option."
22063 #: ../rescue/virt-rescue.pod:178
22068 #: ../rescue/virt-rescue.pod:180
22069 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
22073 #: ../rescue/virt-rescue.pod:198
22075 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
22076 "are done read-write."
22080 #: ../rescue/virt-rescue.pod:211
22081 msgid "Previous versions of virt-rescue allowed you to write either:"
22085 #: ../rescue/virt-rescue.pod:213
22088 " virt-rescue disk.img [disk.img ...]\n"
22093 #: ../rescue/virt-rescue.pod:217
22096 " virt-rescue guestname\n"
22101 #: ../rescue/virt-rescue.pod:225
22106 #: ../rescue/virt-rescue.pod:227
22108 "Adding the I<--network> option enables QEMU user networking in the rescue "
22109 "appliance. There are some differences between user networking and ordinary "
22114 #: ../rescue/virt-rescue.pod:233
22115 msgid "ping does not work"
22119 #: ../rescue/virt-rescue.pod:235
22121 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
22122 "send the ping packets, and because virt-rescue must be able to run as "
22123 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
22124 "command. The ping command will appear to resolve addresses but will not be "
22125 "able to send or receive any packets. This does not mean that the network is "
22130 #: ../rescue/virt-rescue.pod:242
22131 msgid "cannot receive connections"
22135 #: ../rescue/virt-rescue.pod:244
22136 msgid "QEMU user networking cannot receive incoming connections."
22140 #: ../rescue/virt-rescue.pod:246
22141 msgid "making TCP connections"
22145 #: ../rescue/virt-rescue.pod:248
22147 "The virt-rescue appliance needs to be small and so does not include many "
22148 "network tools. In particular there is no L<telnet(1)> command. You can "
22149 "make TCP connections from the shell using the magical "
22150 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
22154 #: ../rescue/virt-rescue.pod:253
22157 " exec 3<>/dev/tcp/redhat.com/80\n"
22158 " echo \"GET /\" >&3\n"
22164 #: ../rescue/virt-rescue.pod:257
22165 msgid "See L<bash(1)> for more details."
22169 #: ../rescue/virt-rescue.pod:263
22171 "Several environment variables affect virt-rescue. See "
22172 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
22176 #: ../rescue/virt-rescue.pod:290
22178 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
22179 "L<http://libguestfs.org/>."
22183 #: ../resize/virt-resize.pod:5
22184 msgid "virt-resize - Resize a virtual machine disk"
22188 #: ../resize/virt-resize.pod:9
22191 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
22192 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
22193 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
22198 #: ../resize/virt-resize.pod:15
22200 "Virt-resize is a tool which can resize a virtual machine disk, making it "
22201 "larger or smaller overall, and resizing or deleting any partitions contained "
22206 #: ../resize/virt-resize.pod:19
22208 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
22209 "not> be used on live virtual machines - for consistent results, shut the "
22210 "virtual machine down before resizing it."
22214 #: ../resize/virt-resize.pod:23
22216 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
22217 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
22221 #: ../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
22226 #: ../resize/virt-resize.pod:33
22228 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
22229 "fill the extra 5GB of space."
22233 #: ../resize/virt-resize.pod:36
22236 " virt-filesystems --long -h --all -a olddisk\n"
22241 #: ../resize/virt-resize.pod:38
22244 " truncate -r olddisk newdisk\n"
22245 " truncate -s +5G newdisk\n"
22250 #: ../resize/virt-resize.pod:41
22253 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
22254 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
22259 #: ../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
22264 #: ../resize/virt-resize.pod:46
22266 "As above, but make the /boot partition 200MB bigger, while giving the "
22267 "remaining space to /dev/sda2:"
22271 #: ../resize/virt-resize.pod:49
22274 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22275 " olddisk newdisk\n"
22280 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:610 ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:501 ../src/guestfs.pod:1451
22285 #: ../resize/virt-resize.pod:54
22287 "As in the first example, but expand a logical volume as the final step. "
22288 "This is what you would typically use for Linux guests that use LVM:"
22292 #: ../resize/virt-resize.pod:58
22295 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
22296 " olddisk newdisk\n"
22301 #: ../resize/virt-resize.pod:61
22306 #: ../resize/virt-resize.pod:63
22308 "As in the first example, but the output format will be qcow2 instead of a "
22313 #: ../resize/virt-resize.pod:66
22316 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
22317 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
22322 #: ../resize/virt-resize.pod:71
22323 msgid "DETAILED USAGE"
22327 #: ../resize/virt-resize.pod:73
22328 msgid "EXPANDING A VIRTUAL MACHINE DISK"
22332 #: ../resize/virt-resize.pod:77
22333 msgid "1. Shut down the virtual machine"
22337 #: ../resize/virt-resize.pod:79
22338 msgid "2. Locate input disk image"
22342 #: ../resize/virt-resize.pod:81
22344 "Locate the input disk image (ie. the file or device on the host containing "
22345 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
22346 "dumpxml> like this to find the disk image name:"
22350 #: ../resize/virt-resize.pod:85
22353 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
22354 " Found 1 nodes:\n"
22356 " <source dev=\"/dev/vg/lv_guest\" />\n"
22361 #: ../resize/virt-resize.pod:90
22362 msgid "3. Look at current sizing"
22366 #: ../resize/virt-resize.pod:92
22367 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
22371 #: ../resize/virt-resize.pod:95
22374 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
22375 " Name Type Size Parent\n"
22376 " /dev/sda1 partition 101M /dev/sda\n"
22377 " /dev/sda2 partition 7.9G /dev/sda\n"
22378 " /dev/sda device 8.0G -\n"
22383 #: ../resize/virt-resize.pod:101
22385 "(This example is a virtual machine with an 8 GB disk which we would like to "
22386 "expand up to 10 GB)."
22390 #: ../resize/virt-resize.pod:104
22391 msgid "4. Create output disk"
22395 #: ../resize/virt-resize.pod:106
22397 "Virt-resize cannot do in-place disk modifications. You have to have space "
22398 "to store the resized output disk."
22402 #: ../resize/virt-resize.pod:109
22403 msgid "To store the resized disk image in a file, create a file of a suitable size:"
22407 #: ../resize/virt-resize.pod:112
22410 " # rm -f outdisk\n"
22411 " # truncate -s 10G outdisk\n"
22416 #: ../resize/virt-resize.pod:115
22417 msgid "Or use L<lvcreate(1)> to create a logical volume:"
22421 #: ../resize/virt-resize.pod:117
22424 " # lvcreate -L 10G -n lv_name vg_name\n"
22429 #: ../resize/virt-resize.pod:119
22430 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
22434 #: ../resize/virt-resize.pod:121
22437 " # virsh pool-list\n"
22438 " # virsh vol-create-as poolname newvol 10G\n"
22443 #: ../resize/virt-resize.pod:124
22448 #: ../resize/virt-resize.pod:126
22450 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
22451 "file) and the output disk. The output disk is the one created in the "
22456 #: ../resize/virt-resize.pod:130
22459 " # virt-resize indisk outdisk\n"
22464 #: ../resize/virt-resize.pod:132
22466 "This command just copies disk image C<indisk> to disk image C<outdisk> "
22467 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
22468 "larger, then an extra, empty partition is created at the end of the disk "
22469 "covering the extra space. If C<outdisk> is smaller, then it will give an "
22474 #: ../resize/virt-resize.pod:138
22476 "More realistically you'd want to expand existing partitions in the disk "
22477 "image by passing extra options (for the full list see the L</OPTIONS> "
22482 #: ../resize/virt-resize.pod:142
22484 "L</--expand> is the most useful option. It expands the named partition "
22485 "within the disk to fill any extra space:"
22489 #: ../resize/virt-resize.pod:145
22492 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
22497 #: ../resize/virt-resize.pod:147
22499 "(In this case, an extra partition is I<not> created at the end of the disk, "
22500 "because there will be no unused space)."
22504 #: ../resize/virt-resize.pod:150
22506 "L</--resize> is the other commonly used option. The following would "
22507 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
22508 "rest of the available space:"
22512 #: ../resize/virt-resize.pod:154
22515 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22516 " indisk outdisk\n"
22521 #: ../resize/virt-resize.pod:157
22523 "If the expanded partition in the image contains a filesystem or LVM PV, then "
22524 "if virt-resize knows how, it will resize the contents, the equivalent of "
22525 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
22526 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
22527 "filesystems, so you would have to online resize them after booting the "
22532 #: ../resize/virt-resize.pod:164
22533 msgid "Other options are covered below."
22537 #: ../resize/virt-resize.pod:166
22542 #: ../resize/virt-resize.pod:168
22543 msgid "Thoroughly test the new disk image I<before> discarding the old one."
22547 #: ../resize/virt-resize.pod:170
22548 msgid "If you are using libvirt, edit the XML to point at the new disk:"
22552 #: ../resize/virt-resize.pod:172
22555 " # virsh edit guestname\n"
22560 #: ../resize/virt-resize.pod:174
22562 "Change E<lt>source ...E<gt>, see "
22563 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
22567 #: ../resize/virt-resize.pod:177
22568 msgid "Then start up the domain with the new, resized disk:"
22572 #: ../resize/virt-resize.pod:179
22575 " # virsh start guestname\n"
22580 #: ../resize/virt-resize.pod:181
22582 "and check that it still works. See also the L</NOTES> section below for "
22583 "additional information."
22587 #: ../resize/virt-resize.pod:184
22588 msgid "7. Resize LVs etc inside the guest"
22592 #: ../resize/virt-resize.pod:186
22593 msgid "(This can also be done offline using L<guestfish(1)>)"
22597 #: ../resize/virt-resize.pod:188
22599 "Once the guest has booted you should see the new space available, at least "
22600 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
22601 "may need to resize LVs inside PVs, and also resize filesystem types that "
22602 "virt-resize does not know how to expand."
22606 #: ../resize/virt-resize.pod:195
22607 msgid "SHRINKING A VIRTUAL MACHINE DISK"
22611 #: ../resize/virt-resize.pod:197
22613 "Shrinking is somewhat more complex than expanding, and only an overview is "
22618 #: ../resize/virt-resize.pod:200
22620 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
22621 "filesystems). The user has to shrink content before passing the disk image "
22622 "to virt-resize, and virt-resize will check that the content has been shrunk "
22627 #: ../resize/virt-resize.pod:205
22628 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
22632 #: ../resize/virt-resize.pod:207
22634 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
22635 "steps 3 and 4 above to allocate a new disk image."
22639 #: ../resize/virt-resize.pod:210
22640 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
22644 #: ../resize/virt-resize.pod:213
22645 msgid "IGNORING OR DELETING PARTITIONS"
22649 #: ../resize/virt-resize.pod:215
22651 "virt-resize also gives a convenient way to ignore or delete partitions when "
22652 "copying from the input disk to the output disk. Ignoring a partition speeds "
22653 "up the copy where you don't care about the existing contents of a "
22654 "partition. Deleting a partition removes it completely, but note that it "
22655 "also renumbers any partitions after the one which is deleted, which can "
22656 "leave some guests unbootable."
22660 #: ../resize/virt-resize.pod:222
22661 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
22665 #: ../resize/virt-resize.pod:224
22667 "If the input disk is in qcow2 format, then you may prefer that the output is "
22668 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
22669 "the fly. The output format is simply determined by the format of the empty "
22670 "output container that you provide. Thus to create qcow2 output, use:"
22674 #: ../resize/virt-resize.pod:230
22677 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
22682 #: ../resize/virt-resize.pod:232
22683 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
22687 #: ../resize/virt-resize.pod:234
22688 msgid "Similarly, to get non-sparse raw output use:"
22692 #: ../resize/virt-resize.pod:236
22695 " fallocate -l size outdisk\n"
22700 #: ../resize/virt-resize.pod:238
22702 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
22703 "if=/dev/zero of=outdisk bs=1M count=..>)"
22707 #: ../resize/virt-resize.pod:241
22708 msgid "LOGICAL PARTITIONS"
22712 #: ../resize/virt-resize.pod:243
22714 "Logical partitions (a.k.a. C</dev/sda5+> on disks using DOS partition "
22715 "tables) cannot be resized."
22719 #: ../resize/virt-resize.pod:246
22721 "To understand what is going on, firstly one of the four partitions "
22722 "C</dev/sda1-4> will have MBR partition type C<05> or C<0f>. This is called "
22723 "the B<extended partition>. Use L<virt-filesystems(1)> to see the MBR "
22728 #: ../resize/virt-resize.pod:251
22729 msgid "Logical partitions live inside the extended partition."
22733 #: ../resize/virt-resize.pod:253
22735 "The extended partition can be expanded, but not shrunk (unless you force it, "
22736 "which is not advisable). When the extended partition is copied across, all "
22737 "the logical partitions contained inside are copied over implicitly. "
22738 "Virt-resize does not look inside the extended partition, so it copies the "
22739 "logical partitions blindly."
22743 #: ../resize/virt-resize.pod:259
22745 "You cannot specify a logical partition (C</dev/sda5+>) at all on the command "
22746 "line. Doing so will give an error."
22750 #: ../resize/virt-resize.pod:268 ../sparsify/virt-sparsify.pod:105
22751 msgid "Display help."
22755 #: ../resize/virt-resize.pod:270
22756 msgid "B<--align-first auto>"
22760 #: ../resize/virt-resize.pod:272
22761 msgid "B<--align-first never>"
22765 #: ../resize/virt-resize.pod:274
22766 msgid "B<--align-first always>"
22770 #: ../resize/virt-resize.pod:276
22772 "Align the first partition for improved performance (see also the "
22773 "I<--alignment> option)."
22777 #: ../resize/virt-resize.pod:279
22779 "The default is I<--align-first auto> which only aligns the first partition "
22780 "if it is safe to do so. That is, only when we know how to fix the "
22781 "bootloader automatically, and at the moment that can only be done for "
22786 #: ../resize/virt-resize.pod:284
22788 "I<--align-first never> means we never move the first partition. This is the "
22789 "safest option. Try this if the guest does not boot after resizing."
22793 #: ../resize/virt-resize.pod:288
22795 "I<--align-first always> means we always align the first partition (if it "
22796 "needs to be aligned). For some guests this will break the bootloader, "
22797 "making the guest unbootable."
22801 #: ../resize/virt-resize.pod:292
22802 msgid "B<--alignment N>"
22806 #: ../resize/virt-resize.pod:294
22808 "Set the alignment of partitions to C<N> sectors. The default in virt-resize "
22809 "E<lt> 1.13.19 was 64 sectors, and after that is 128 sectors."
22813 #: ../resize/virt-resize.pod:298
22815 "Assuming 512 byte sector size inside the guest, here are some suitable "
22820 #: ../resize/virt-resize.pod:303
22821 msgid "I<--alignment 1> (512 bytes)"
22825 #: ../resize/virt-resize.pod:305
22827 "The partitions would be packed together as closely as possible, but would be "
22828 "completely unaligned. In some cases this can cause very poor performance. "
22829 "See L<virt-alignment-scan(1)> for further details."
22833 #: ../resize/virt-resize.pod:309
22834 msgid "I<--alignment 8> (4K)"
22838 #: ../resize/virt-resize.pod:311
22840 "This would be the minimum acceptable alignment for reasonable performance on "
22845 #: ../resize/virt-resize.pod:314
22846 msgid "I<--alignment 128> (64K)"
22850 #: ../resize/virt-resize.pod:316
22852 "This alignment provides good performance when the host is using high end "
22857 #: ../resize/virt-resize.pod:319
22858 msgid "I<--alignment 2048> (1M)"
22862 #: ../resize/virt-resize.pod:321
22864 "This is the standard alignment used by all newly installed guests since "
22869 #: ../resize/virt-resize.pod:326
22874 #: ../resize/virt-resize.pod:328 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
22879 #: ../resize/virt-resize.pod:330 ../tools/virt-win-reg.pl:122
22880 msgid "Enable debugging messages."
22884 #: ../resize/virt-resize.pod:332
22885 msgid "B<--delete part>"
22889 #: ../resize/virt-resize.pod:334
22891 "Delete the named partition. It would be more accurate to describe this as "
22892 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
22893 "the original disk image is left intact."
22897 #: ../resize/virt-resize.pod:338
22899 "Note that when you delete a partition, then anything contained in the "
22900 "partition is also deleted. Furthermore, this causes any partitions that "
22901 "come after to be I<renumbered>, which can easily make your guest unbootable."
22905 #: ../resize/virt-resize.pod:343 ../resize/virt-resize.pod:404 ../resize/virt-resize.pod:531 ../sparsify/virt-sparsify.pod:145
22906 msgid "You can give this option multiple times."
22910 #: ../resize/virt-resize.pod:345
22911 msgid "B<--expand part>"
22915 #: ../resize/virt-resize.pod:347
22917 "Expand the named partition so it uses up all extra space (space left over "
22918 "after any other resize changes that you request have been done)."
22922 #: ../resize/virt-resize.pod:350
22924 "If virt-resize knows how, it will expand the direct content of the "
22925 "partition. For example, if the partition is an LVM PV, it will expand the "
22926 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
22927 "content it doesn't know about alone."
22931 #: ../resize/virt-resize.pod:355
22932 msgid "Currently virt-resize can resize:"
22936 #: ../resize/virt-resize.pod:361
22937 msgid "ext2, ext3 and ext4 filesystems."
22941 #: ../resize/virt-resize.pod:365
22942 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
22946 #: ../resize/virt-resize.pod:367
22948 "The filesystem must have been shut down consistently last time it was used. "
22949 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
22950 "consistency check, so at the first boot after resizing Windows will check "
22955 #: ../resize/virt-resize.pod:374
22957 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
22958 "inside the PV, but see the I<--LV-expand> option. The user could also "
22959 "resize LVs as desired after boot."
22963 #: ../resize/virt-resize.pod:380
22964 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
22968 #: ../resize/virt-resize.pod:384 ../resize/virt-resize.pod:559
22969 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
22973 #: ../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
22974 msgid "B<--format> raw"
22978 #: ../resize/virt-resize.pod:388 ../sparsify/virt-sparsify.pod:129
22980 "Specify the format of the input disk image. If this flag is not given then "
22981 "it is auto-detected from the image itself."
22985 #: ../resize/virt-resize.pod:394
22987 "Note that this option I<does not> affect the output format. See L</QCOW2 "
22988 "AND NON-SPARSE RAW FORMATS>."
22992 #: ../resize/virt-resize.pod:397
22993 msgid "B<--ignore part>"
22997 #: ../resize/virt-resize.pod:399
22999 "Ignore the named partition. Effectively this means the partition is "
23000 "allocated on the destination disk, but the content is not copied across from "
23001 "the source disk. The content of the partition will be blank (all zero "
23006 #: ../resize/virt-resize.pod:406
23007 msgid "B<--LV-expand logvol>"
23011 #: ../resize/virt-resize.pod:408
23013 "This takes the logical volume and, as a final step, expands it to fill all "
23014 "the space available in its volume group. A typical usage, assuming a Linux "
23015 "guest with a single PV C</dev/sda2> and a root device called "
23016 "C</dev/vg_guest/lv_root> would be:"
23020 #: ../resize/virt-resize.pod:413
23023 " virt-resize indisk outdisk \\\n"
23024 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
23029 #: ../resize/virt-resize.pod:416
23031 "This would first expand the partition (and PV), and then expand the root "
23032 "device to fill the extra space in the PV."
23036 #: ../resize/virt-resize.pod:419
23038 "The contents of the LV are also resized if virt-resize knows how to do "
23039 "that. You can stop virt-resize from trying to expand the content by using "
23040 "the option I<--no-expand-content>."
23044 #: ../resize/virt-resize.pod:423
23045 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
23049 #: ../resize/virt-resize.pod:425
23051 "You can give this option multiple times, I<but> it doesn't make sense to do "
23052 "this unless the logical volumes you specify are all in different volume "
23057 #: ../resize/virt-resize.pod:429 ../sparsify/virt-sparsify.pod:147
23058 msgid "B<--machine-readable>"
23062 #: ../resize/virt-resize.pod:431 ../sparsify/virt-sparsify.pod:149
23064 "This option is used to make the output more machine friendly when being "
23065 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
23069 #: ../resize/virt-resize.pod:437
23070 msgid "B<--dryrun>"
23074 #: ../resize/virt-resize.pod:439
23075 msgid "Print a summary of what would be done, but don't do anything."
23079 #: ../resize/virt-resize.pod:441
23080 msgid "B<--no-copy-boot-loader>"
23084 #: ../resize/virt-resize.pod:443
23086 "By default, virt-resize copies over some sectors at the start of the disk "
23087 "(up to the beginning of the first partition). Commonly these sectors "
23088 "contain the Master Boot Record (MBR) and the boot loader, and are required "
23089 "in order for the guest to boot correctly."
23093 #: ../resize/virt-resize.pod:448
23095 "If you specify this flag, then this initial copy is not done. You may need "
23096 "to reinstall the boot loader in this case."
23100 #: ../resize/virt-resize.pod:451
23101 msgid "B<--no-extra-partition>"
23105 #: ../resize/virt-resize.pod:453
23107 "By default, virt-resize creates an extra partition if there is any extra, "
23108 "unused space after all resizing has happened. Use this option to prevent "
23109 "the extra partition from being created. If you do this then the extra space "
23110 "will be inaccessible until you run fdisk, parted, or some other partitioning "
23111 "tool in the guest."
23115 #: ../resize/virt-resize.pod:459
23117 "Note that if the surplus space is smaller than 10 MB, no extra partition "
23122 #: ../resize/virt-resize.pod:462
23123 msgid "B<--no-expand-content>"
23127 #: ../resize/virt-resize.pod:464
23129 "By default, virt-resize will try to expand the direct contents of "
23130 "partitions, if it knows how (see I<--expand> option above)."
23134 #: ../resize/virt-resize.pod:467
23136 "If you give the I<--no-expand-content> option then virt-resize will not "
23141 #: ../resize/virt-resize.pod:470
23142 msgid "B<--ntfsresize-force>"
23146 #: ../resize/virt-resize.pod:472
23148 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
23149 "the NTFS disk is marked as needing a consistency check. You have to use "
23150 "this option if you want to resize a Windows guest multiple times without "
23151 "booting into Windows between each resize."
23155 #: ../resize/virt-resize.pod:478
23156 msgid "B<--output-format> raw"
23160 #: ../resize/virt-resize.pod:480
23162 "Specify the format of the output disk image. If this flag is not given then "
23163 "it is auto-detected from the image itself."
23167 #: ../resize/virt-resize.pod:486
23169 "Note that this option I<does not create> the output format. This option "
23170 "just tells libguestfs what it is so it doesn't try to guess it. You still "
23171 "need to create the output disk with the right format. See L</QCOW2 AND "
23172 "NON-SPARSE RAW FORMATS>."
23176 #: ../resize/virt-resize.pod:495
23177 msgid "Don't print the summary."
23181 #: ../resize/virt-resize.pod:497
23182 msgid "B<--resize part=size>"
23186 #: ../resize/virt-resize.pod:499
23188 "Resize the named partition (expanding or shrinking it) so that it has the "
23193 #: ../resize/virt-resize.pod:502
23195 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
23196 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
23197 "size; or as a relative number or percentage. For example:"
23201 #: ../resize/virt-resize.pod:508
23204 " --resize /dev/sda2=10G\n"
23209 #: ../resize/virt-resize.pod:510
23212 " --resize /dev/sda4=90%\n"
23217 #: ../resize/virt-resize.pod:512
23220 " --resize /dev/sda2=+1G\n"
23225 #: ../resize/virt-resize.pod:514
23228 " --resize /dev/sda2=-200M\n"
23233 #: ../resize/virt-resize.pod:516
23236 " --resize /dev/sda1=+128K\n"
23241 #: ../resize/virt-resize.pod:518
23244 " --resize /dev/sda1=+10%\n"
23249 #: ../resize/virt-resize.pod:520
23252 " --resize /dev/sda1=-10%\n"
23257 #: ../resize/virt-resize.pod:522
23259 "You can increase the size of any partition. Virt-resize will expand the "
23260 "direct content of the partition if it knows how (see I<--expand> below)."
23264 #: ../resize/virt-resize.pod:526
23266 "You can only I<decrease> the size of partitions that contain filesystems or "
23267 "PVs which have already been shrunk. Virt-resize will check this has been "
23268 "done before proceeding, or else will print an error (see also "
23269 "I<--resize-force>)."
23273 #: ../resize/virt-resize.pod:533
23274 msgid "B<--resize-force part=size>"
23278 #: ../resize/virt-resize.pod:535
23280 "This is the same as I<--resize> except that it will let you decrease the "
23281 "size of any partition. Generally this means you will lose any data which "
23282 "was at the end of the partition you shrink, but you may not care about that "
23283 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
23284 "as a swap partition)."
23288 #: ../resize/virt-resize.pod:541
23289 msgid "See also the I<--ignore> option."
23293 #: ../resize/virt-resize.pod:543
23294 msgid "B<--shrink part>"
23298 #: ../resize/virt-resize.pod:545
23300 "Shrink the named partition until the overall disk image fits in the "
23301 "destination. The named partition B<must> contain a filesystem or PV which "
23302 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
23303 "online tools). Virt-resize will check this and give an error if it has not "
23308 #: ../resize/virt-resize.pod:551
23310 "The amount by which the overall disk must be shrunk (after carrying out all "
23311 "other operations requested by the user) is called the \"deficit\". For "
23312 "example, a straight copy (assume no other operations) from a 5GB disk image "
23313 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
23314 "would give an error unless the user specified a partition to shrink and that "
23315 "partition had more than a gigabyte of free space."
23319 #: ../resize/virt-resize.pod:569 ../sparsify/virt-sparsify.pod:177
23320 msgid "MACHINE READABLE OUTPUT"
23324 #: ../resize/virt-resize.pod:571
23326 "The I<--machine-readable> option can be used to make the output more machine "
23327 "friendly, which is useful when calling virt-resize from other programs, GUIs "
23332 #: ../resize/virt-resize.pod:575 ../sparsify/virt-sparsify.pod:183
23333 msgid "There are two ways to use this option."
23337 #: ../resize/virt-resize.pod:577
23339 "Firstly use the option on its own to query the capabilities of the "
23340 "virt-resize binary. Typical output looks like this:"
23344 #: ../resize/virt-resize.pod:580
23347 " $ virt-resize --machine-readable\n"
23349 " ntfsresize-force\n"
23357 #: ../resize/virt-resize.pod:587 ../sparsify/virt-sparsify.pod:193
23359 "A list of features is printed, one per line, and the program exits with "
23364 #: ../resize/virt-resize.pod:590 ../sparsify/virt-sparsify.pod:196
23366 "Secondly use the option in conjunction with other options to make the "
23367 "regular program output more machine friendly."
23371 #: ../resize/virt-resize.pod:593 ../sparsify/virt-sparsify.pod:199
23372 msgid "At the moment this means:"
23376 #: ../resize/virt-resize.pod:599 ../sparsify/virt-sparsify.pod:205
23378 "Progress bar messages can be parsed from stdout by looking for this regular "
23383 #: ../resize/virt-resize.pod:602 ../sparsify/virt-sparsify.pod:208
23386 " ^[0-9]+/[0-9]+$\n"
23391 #: ../resize/virt-resize.pod:606 ../sparsify/virt-sparsify.pod:212
23393 "The calling program should treat messages sent to stdout (except for "
23394 "progress bar messages) as status messages. They can be logged and/or "
23395 "displayed to the user."
23399 #: ../resize/virt-resize.pod:612
23401 "The calling program should treat messages sent to stderr as error messages. "
23402 "In addition, virt-resize exits with a non-zero status code if there was a "
23407 #: ../resize/virt-resize.pod:618
23409 "Versions of the program prior to 1.13.9 did not support the "
23410 "I<--machine-readable> option and will return an error."
23414 #: ../resize/virt-resize.pod:623
23415 msgid "\"Partition 1 does not end on cylinder boundary.\""
23419 #: ../resize/virt-resize.pod:625
23421 "Virt-resize aligns partitions to multiples of 128 sectors (see the "
23422 "I<--alignment> parameter). Usually this means the partitions will not be "
23423 "aligned to the ancient CHS geometry. However CHS geometry is meaningless "
23424 "for disks manufactured since the early 1990s, and doubly so for virtual hard "
23425 "drives. Alignment of partitions to cylinders is not required by any modern "
23426 "operating system."
23430 #: ../resize/virt-resize.pod:632
23431 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
23435 #: ../resize/virt-resize.pod:634
23437 "In Windows Vista and later versions, Microsoft switched to using a separate "
23438 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
23439 "and C</dev/sda2> is the main (C:) drive. Resizing the first (boot) "
23440 "partition causes the bootloader to fail with C<0xC0000225> error. Resizing "
23441 "the second partition (ie. C: drive) should work."
23445 #: ../resize/virt-resize.pod:641
23447 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
23448 "NTFS partitions have been expanded. This is just a safety check and (unless "
23449 "it find errors) is nothing to worry about."
23453 #: ../resize/virt-resize.pod:645
23454 msgid "GUEST BOOT STUCK AT \"GRUB\""
23458 #: ../resize/virt-resize.pod:647
23460 "If a Linux guest does not boot after resizing, and the boot is stuck after "
23461 "printing C<GRUB> on the console, try reinstalling grub."
23465 #: ../resize/virt-resize.pod:650
23468 " guestfish -i -a newdisk\n"
23469 " ><fs> cat /boot/grub/device.map\n"
23470 " # check the contents of this file are sensible or\n"
23471 " # edit the file if necessary\n"
23472 " ><fs> grub-install / /dev/vda\n"
23478 #: ../resize/virt-resize.pod:657
23480 "For more flexible guest reconfiguration, including if you need to specify "
23481 "other parameters to grub-install, use L<virt-rescue(1)>."
23485 #: ../resize/virt-resize.pod:660
23486 msgid "ALTERNATIVE TOOLS"
23490 #: ../resize/virt-resize.pod:662
23492 "There are several proprietary tools for resizing partitions. We won't "
23493 "mention any here."
23497 #: ../resize/virt-resize.pod:665
23499 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
23500 "operations on disk images. They can resize and move partitions, but I don't "
23501 "think they can do anything with the contents, and they certainly don't "
23506 #: ../resize/virt-resize.pod:670
23508 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
23509 "but at a much lower level. You will probably end up hand-calculating sector "
23510 "offsets, which is something that virt-resize was designed to avoid. If you "
23511 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
23516 #: ../resize/virt-resize.pod:690
23518 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
23519 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
23520 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
23521 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
23522 "L<virt-sparsify(1)>, L<virt-alignment-scan(1)>, L<http://libguestfs.org/>."
23526 #: ../ruby/examples/guestfs-ruby.pod:5
23527 msgid "guestfs-ruby - How to use libguestfs from Ruby"
23531 #: ../ruby/examples/guestfs-ruby.pod:9
23534 " require 'guestfs'\n"
23535 " g = Guestfs::Guestfs.new()\n"
23536 " g.add_drive_opts(\"disk.img\",\n"
23537 " :readonly => 1, :format => \"raw\")\n"
23543 #: ../ruby/examples/guestfs-ruby.pod:17
23545 "This manual page documents how to call libguestfs from the Ruby programming "
23546 "language. This page just documents the differences from the C API and gives "
23547 "some examples. If you are not familiar with using libguestfs, you also need "
23548 "to read L<guestfs(3)>."
23552 #: ../ruby/examples/guestfs-ruby.pod:24
23554 "Errors from libguestfs functions are mapped into the C<Error> exception. "
23555 "This has a single parameter which is the error message (a string)."
23559 #: ../ruby/examples/guestfs-ruby.pod:38
23561 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
23562 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
23563 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
23567 #: ../sparsify/virt-sparsify.pod:5
23568 msgid "virt-sparsify - Make a virtual machine disk sparse"
23572 #: ../sparsify/virt-sparsify.pod:9
23575 " virt-sparsify [--options] indisk outdisk\n"
23580 #: ../sparsify/virt-sparsify.pod:13
23582 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
23583 "image) sparse a.k.a. thin-provisioned. This means that free space within "
23584 "the disk image can be converted back to free space on the host."
23588 #: ../sparsify/virt-sparsify.pod:18
23590 "Virt-sparsify can locate and sparsify free space in most filesystems "
23591 "(eg. ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
23595 #: ../sparsify/virt-sparsify.pod:21
23597 "Virt-sparsify can also convert between some disk formats, for example "
23598 "converting a raw disk image to a thin-provisioned qcow2 image."
23602 #: ../sparsify/virt-sparsify.pod:24
23604 "Virt-sparsify can operate on any disk image, not just ones from virtual "
23605 "machines. If a virtual machine has more than one attached disk, you must "
23606 "sparsify each one separately."
23610 #: ../sparsify/virt-sparsify.pod:28
23611 msgid "IMPORTANT LIMITATIONS"
23615 #: ../sparsify/virt-sparsify.pod:34
23617 "Virt-sparsify does not do in-place modifications. It copies from a source "
23618 "image to a destination image, leaving the source unchanged. I<Check that "
23619 "the sparsification was successful before deleting the source image>."
23623 #: ../sparsify/virt-sparsify.pod:41
23624 msgid "The virtual machine I<must be shut down> before using this tool."
23628 #: ../sparsify/virt-sparsify.pod:45
23630 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
23631 "(1 temporary copy + 1 destination image). This is in the worst case and "
23632 "usually much less space is required."
23636 #: ../sparsify/virt-sparsify.pod:51
23637 msgid "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
23641 #: ../sparsify/virt-sparsify.pod:56
23642 msgid "Virt-sparsify cannot handle encrypted disks."
23646 #: ../sparsify/virt-sparsify.pod:60
23648 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
23649 "this space is often used for critical items like bootloaders so it's not "
23654 #: ../sparsify/virt-sparsify.pod:66
23656 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
23657 "to do this unless we can be sure there is no hibernation data, so at the "
23658 "moment swap partitions are ignored."
23662 #: ../sparsify/virt-sparsify.pod:72
23664 "You may also want to read the manual pages for the associated tools "
23665 "L<virt-filesystems(1)> and L<virt-df(1)> before starting."
23669 #: ../sparsify/virt-sparsify.pod:77
23670 msgid "Typical usage is:"
23674 #: ../sparsify/virt-sparsify.pod:79
23677 " virt-sparsify indisk outdisk\n"
23682 #: ../sparsify/virt-sparsify.pod:81
23684 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
23685 "is created, or overwritten if it already exists. The format of the input "
23686 "disk is detected (eg. qcow2) and the same format is used for the output "
23691 #: ../sparsify/virt-sparsify.pod:86
23692 msgid "To convert between formats, use the I<--convert> option:"
23696 #: ../sparsify/virt-sparsify.pod:88
23699 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
23704 #: ../sparsify/virt-sparsify.pod:90
23706 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
23707 "can find within the source disk image. You can get it to ignore (don't zero "
23708 "free space on) certain filesystems by doing:"
23712 #: ../sparsify/virt-sparsify.pod:94
23715 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
23720 #: ../sparsify/virt-sparsify.pod:96
23721 msgid "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
23725 #: ../sparsify/virt-sparsify.pod:107
23726 msgid "B<--convert> raw"
23730 #: ../sparsify/virt-sparsify.pod:109
23731 msgid "B<--convert> qcow2"
23735 #: ../sparsify/virt-sparsify.pod:111
23736 msgid "B<--convert> [other formats]"
23740 #: ../sparsify/virt-sparsify.pod:113
23742 "Use C<output-format> as the format for the destination image. If this is "
23743 "not specified, then the input format is used."
23747 #: ../sparsify/virt-sparsify.pod:116
23748 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
23752 #: ../sparsify/virt-sparsify.pod:118
23754 "You can also use any format supported by the L<qemu-img(1)> program, "
23755 "eg. C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
23759 #: ../sparsify/virt-sparsify.pod:122
23761 "Specifying the I<--convert> option is usually a good idea, because then "
23762 "virt-sparsify doesn't need to try to guess the input format."
23766 #: ../sparsify/virt-sparsify.pod:127
23767 msgid "B<--format> qcow2"
23771 #: ../sparsify/virt-sparsify.pod:135
23772 msgid "B<--ignore> filesystem"
23776 #: ../sparsify/virt-sparsify.pod:137
23777 msgid "B<--ignore> volgroup"
23781 #: ../sparsify/virt-sparsify.pod:139
23783 "Ignore the named filesystem. Free space on the filesystem will not be "
23784 "zeroed, but existing blocks of zeroes will still be sparsified."
23788 #: ../sparsify/virt-sparsify.pod:142
23790 "In the second form, this ignores the named volume group. Use the volume "
23791 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
23795 #: ../sparsify/virt-sparsify.pod:157
23796 msgid "This disables progress bars and other unnecessary output."
23800 #: ../sparsify/virt-sparsify.pod:179
23802 "The I<--machine-readable> option can be used to make the output more machine "
23803 "friendly, which is useful when calling virt-sparsify from other programs, "
23808 #: ../sparsify/virt-sparsify.pod:185
23810 "Firstly use the option on its own to query the capabilities of the "
23811 "virt-sparsify binary. Typical output looks like this:"
23815 #: ../sparsify/virt-sparsify.pod:188
23818 " $ virt-sparsify --machine-readable\n"
23826 #: ../sparsify/virt-sparsify.pod:218
23828 "The calling program should treat messages sent to stderr as error messages. "
23829 "In addition, virt-sparsify exits with a non-zero status code if there was a "
23834 #: ../sparsify/virt-sparsify.pod:224
23836 "All versions of virt-sparsify have supported the I<--machine-readable> "
23841 #: ../sparsify/virt-sparsify.pod:238
23843 "Location of the temporary directory used for the potentially large temporary "
23848 #: ../sparsify/virt-sparsify.pod:241
23850 "You should ensure there is enough free space in the worst case for a full "
23851 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
23852 "to another directory that has enough space."
23856 #: ../sparsify/virt-sparsify.pod:245
23857 msgid "This defaults to C</tmp>."
23861 #: ../sparsify/virt-sparsify.pod:249
23862 msgid "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
23866 #: ../sparsify/virt-sparsify.pod:253
23868 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
23869 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, "
23870 "L<qemu-img(1)>, L<http://libguestfs.org/>."
23874 #: ../src/guestfs-actions.pod:1
23875 msgid "guestfs_add_cdrom"
23879 #: ../src/guestfs-actions.pod:3
23883 " guestfs_add_cdrom (guestfs_h *g,\n"
23884 " const char *filename);\n"
23889 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:302 ../src/guestfs-actions.pod:323
23891 "I<This function is deprecated.> In new code, use the "
23892 "L</guestfs_add_drive_opts> call instead."
23896 #: ../src/guestfs-actions.pod:24
23898 "This call checks for the existence of C<filename>. This stops you from "
23899 "specifying other types of drive which are supported by qemu such as C<nbd:> "
23900 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
23905 #: ../src/guestfs-actions.pod:31
23907 "If you just want to add an ISO file (often you use this as an efficient way "
23908 "to transfer large files into the guest), then you should probably use "
23909 "C<guestfs_add_drive_ro> instead."
23913 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:187 ../src/guestfs-actions.pod:254 ../src/guestfs-actions.pod:291 ../src/guestfs-actions.pod:312 ../src/guestfs-actions.pod:333 ../src/guestfs-actions.pod:346 ../src/guestfs-actions.pod:360 ../src/guestfs-actions.pod:480 ../src/guestfs-actions.pod:500 ../src/guestfs-actions.pod:514 ../src/guestfs-actions.pod:559 ../src/guestfs-actions.pod:587 ../src/guestfs-actions.pod:605 ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:705 ../src/guestfs-actions.pod:719 ../src/guestfs-actions.pod:734 ../src/guestfs-actions.pod:833 ../src/guestfs-actions.pod:851 ../src/guestfs-actions.pod:865 ../src/guestfs-actions.pod:879 ../src/guestfs-actions.pod:916 ../src/guestfs-actions.pod:1099 ../src/guestfs-actions.pod:1119 ../src/guestfs-actions.pod:1137 ../src/guestfs-actions.pod:1227 ../src/guestfs-actions.pod:1286 ../src/guestfs-actions.pod:1332 ../src/guestfs-actions.pod:1372 ../src/guestfs-actions.pod:1425 ../src/guestfs-actions.pod:1478 ../src/guestfs-actions.pod:1536 ../src/guestfs-actions.pod:1590 ../src/guestfs-actions.pod:1609 ../src/guestfs-actions.pod:1623 ../src/guestfs-actions.pod:1651 ../src/guestfs-actions.pod:1721 ../src/guestfs-actions.pod:1752 ../src/guestfs-actions.pod:1777 ../src/guestfs-actions.pod:1819 ../src/guestfs-actions.pod:1932 ../src/guestfs-actions.pod:1959 ../src/guestfs-actions.pod:2174 ../src/guestfs-actions.pod:2196 ../src/guestfs-actions.pod:2283 ../src/guestfs-actions.pod:2791 ../src/guestfs-actions.pod:2935 ../src/guestfs-actions.pod:2996 ../src/guestfs-actions.pod:3031 ../src/guestfs-actions.pod:4088 ../src/guestfs-actions.pod:4103 ../src/guestfs-actions.pod:4128 ../src/guestfs-actions.pod:4317 ../src/guestfs-actions.pod:4331 ../src/guestfs-actions.pod:4344 ../src/guestfs-actions.pod:4358 ../src/guestfs-actions.pod:4373 ../src/guestfs-actions.pod:4409 ../src/guestfs-actions.pod:4481 ../src/guestfs-actions.pod:4501 ../src/guestfs-actions.pod:4518 ../src/guestfs-actions.pod:4538 ../src/guestfs-actions.pod:4558 ../src/guestfs-actions.pod:4593 ../src/guestfs-actions.pod:4612 ../src/guestfs-actions.pod:4631 ../src/guestfs-actions.pod:4666 ../src/guestfs-actions.pod:4678 ../src/guestfs-actions.pod:4711 ../src/guestfs-actions.pod:4727 ../src/guestfs-actions.pod:4740 ../src/guestfs-actions.pod:4755 ../src/guestfs-actions.pod:4772 ../src/guestfs-actions.pod:4865 ../src/guestfs-actions.pod:4885 ../src/guestfs-actions.pod:4898 ../src/guestfs-actions.pod:4949 ../src/guestfs-actions.pod:4967 ../src/guestfs-actions.pod:4985 ../src/guestfs-actions.pod:5001 ../src/guestfs-actions.pod:5015 ../src/guestfs-actions.pod:5029 ../src/guestfs-actions.pod:5046 ../src/guestfs-actions.pod:5061 ../src/guestfs-actions.pod:5088 ../src/guestfs-actions.pod:5151 ../src/guestfs-actions.pod:5224 ../src/guestfs-actions.pod:5255 ../src/guestfs-actions.pod:5274 ../src/guestfs-actions.pod:5293 ../src/guestfs-actions.pod:5305 ../src/guestfs-actions.pod:5322 ../src/guestfs-actions.pod:5335 ../src/guestfs-actions.pod:5350 ../src/guestfs-actions.pod:5365 ../src/guestfs-actions.pod:5397 ../src/guestfs-actions.pod:5423 ../src/guestfs-actions.pod:5462 ../src/guestfs-actions.pod:5482 ../src/guestfs-actions.pod:5496 ../src/guestfs-actions.pod:5513 ../src/guestfs-actions.pod:5562 ../src/guestfs-actions.pod:5615 ../src/guestfs-actions.pod:5662 ../src/guestfs-actions.pod:5705 ../src/guestfs-actions.pod:5733 ../src/guestfs-actions.pod:5750 ../src/guestfs-actions.pod:5768 ../src/guestfs-actions.pod:5905 ../src/guestfs-actions.pod:5962 ../src/guestfs-actions.pod:5984 ../src/guestfs-actions.pod:6002 ../src/guestfs-actions.pod:6054 ../src/guestfs-actions.pod:6120 ../src/guestfs-actions.pod:6137 ../src/guestfs-actions.pod:6150 ../src/guestfs-actions.pod:6164 ../src/guestfs-actions.pod:6453 ../src/guestfs-actions.pod:6472 ../src/guestfs-actions.pod:6491 ../src/guestfs-actions.pod:6505 ../src/guestfs-actions.pod:6517 ../src/guestfs-actions.pod:6531 ../src/guestfs-actions.pod:6543 ../src/guestfs-actions.pod:6557 ../src/guestfs-actions.pod:6573 ../src/guestfs-actions.pod:6591 ../src/guestfs-actions.pod:6610 ../src/guestfs-actions.pod:6629 ../src/guestfs-actions.pod:6659 ../src/guestfs-actions.pod:6677 ../src/guestfs-actions.pod:6700 ../src/guestfs-actions.pod:6718 ../src/guestfs-actions.pod:6737 ../src/guestfs-actions.pod:6758 ../src/guestfs-actions.pod:6777 ../src/guestfs-actions.pod:6794 ../src/guestfs-actions.pod:6813 ../src/guestfs-actions.pod:6841 ../src/guestfs-actions.pod:6865 ../src/guestfs-actions.pod:6884 ../src/guestfs-actions.pod:6900 ../src/guestfs-actions.pod:6924 ../src/guestfs-actions.pod:6943 ../src/guestfs-actions.pod:6958 ../src/guestfs-actions.pod:6977 ../src/guestfs-actions.pod:7021 ../src/guestfs-actions.pod:7048 ../src/guestfs-actions.pod:7078 ../src/guestfs-actions.pod:7190 ../src/guestfs-actions.pod:7311 ../src/guestfs-actions.pod:7323 ../src/guestfs-actions.pod:7336 ../src/guestfs-actions.pod:7349 ../src/guestfs-actions.pod:7371 ../src/guestfs-actions.pod:7384 ../src/guestfs-actions.pod:7397 ../src/guestfs-actions.pod:7410 ../src/guestfs-actions.pod:7425 ../src/guestfs-actions.pod:7484 ../src/guestfs-actions.pod:7501 ../src/guestfs-actions.pod:7517 ../src/guestfs-actions.pod:7533 ../src/guestfs-actions.pod:7550 ../src/guestfs-actions.pod:7563 ../src/guestfs-actions.pod:7583 ../src/guestfs-actions.pod:7619 ../src/guestfs-actions.pod:7633 ../src/guestfs-actions.pod:7674 ../src/guestfs-actions.pod:7687 ../src/guestfs-actions.pod:7705 ../src/guestfs-actions.pod:7739 ../src/guestfs-actions.pod:7775 ../src/guestfs-actions.pod:7891 ../src/guestfs-actions.pod:7906 ../src/guestfs-actions.pod:7920 ../src/guestfs-actions.pod:7975 ../src/guestfs-actions.pod:7988 ../src/guestfs-actions.pod:8033 ../src/guestfs-actions.pod:8073 ../src/guestfs-actions.pod:8129 ../src/guestfs-actions.pod:8149 ../src/guestfs-actions.pod:8182 ../src/guestfs-actions.pod:8246 ../src/guestfs-actions.pod:8269 ../src/guestfs-actions.pod:8295
23914 msgid "This function returns 0 on success or -1 on error."
23918 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:189 ../src/guestfs-actions.pod:1334 ../src/guestfs-actions.pod:2397 ../src/guestfs-actions.pod:2495 ../src/guestfs-actions.pod:2620 ../src/guestfs-actions.pod:4090 ../src/guestfs-actions.pod:4110 ../src/guestfs-actions.pod:5399 ../src/guestfs-actions.pod:6679 ../src/guestfs-actions.pod:6796 ../src/guestfs-actions.pod:6945 ../src/guestfs-actions.pod:7427 ../src/guestfs-actions.pod:7552 ../src/guestfs-actions.pod:8075
23919 msgid "(Added in 0.3)"
23923 #: ../src/guestfs-actions.pod:41
23924 msgid "guestfs_add_domain"
23928 #: ../src/guestfs-actions.pod:43
23932 " guestfs_add_domain (guestfs_h *g,\n"
23933 " const char *dom,\n"
23939 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:198 ../src/guestfs-actions.pod:890 ../src/guestfs-actions.pod:1214 ../src/guestfs-actions.pod:1266 ../src/guestfs-actions.pod:1344 ../src/guestfs-actions.pod:1413 ../src/guestfs-actions.pod:1466 ../src/guestfs-actions.pod:1519 ../src/guestfs-actions.pod:3288 ../src/guestfs-actions.pod:5100 ../src/guestfs-actions.pod:5409 ../src/guestfs-actions.pod:5626
23941 "You may supply a list of optional arguments to this call. Use zero or more "
23942 "of the following pairs of parameters, and terminate the list with C<-1> on "
23943 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
23947 #: ../src/guestfs-actions.pod:53
23950 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
23951 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
23952 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
23953 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
23954 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
23955 " GUESTFS_ADD_DOMAIN_READONLYDISK, const char *readonlydisk,\n"
23960 #: ../src/guestfs-actions.pod:60
23962 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
23963 "It works by connecting to libvirt, requesting the domain and domain XML from "
23964 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
23969 #: ../src/guestfs-actions.pod:141
23971 "The other optional parameters are passed directly through to "
23972 "C<guestfs_add_drive_opts>."
23976 #: ../src/guestfs-actions.pod:144 ../src/guestfs-actions.pod:403 ../src/guestfs-actions.pod:573 ../src/guestfs-actions.pod:751 ../src/guestfs-actions.pod:782 ../src/guestfs-actions.pod:800 ../src/guestfs-actions.pod:819 ../src/guestfs-actions.pod:1797 ../src/guestfs-actions.pod:2153 ../src/guestfs-actions.pod:2356 ../src/guestfs-actions.pod:2467 ../src/guestfs-actions.pod:2518 ../src/guestfs-actions.pod:2570 ../src/guestfs-actions.pod:2584 ../src/guestfs-actions.pod:2607 ../src/guestfs-actions.pod:2922 ../src/guestfs-actions.pod:3406 ../src/guestfs-actions.pod:3424 ../src/guestfs-actions.pod:5585 ../src/guestfs-actions.pod:5802 ../src/guestfs-actions.pod:6040 ../src/guestfs-actions.pod:6234 ../src/guestfs-actions.pod:6260 ../src/guestfs-actions.pod:7660 ../src/guestfs-actions.pod:8086 ../src/guestfs-actions.pod:8099 ../src/guestfs-actions.pod:8112
23977 msgid "On error this function returns -1."
23981 #: ../src/guestfs-actions.pod:146
23982 msgid "(Added in 1.7.4)"
23986 #: ../src/guestfs-actions.pod:148
23987 msgid "guestfs_add_domain_va"
23991 #: ../src/guestfs-actions.pod:150
23995 " guestfs_add_domain_va (guestfs_h *g,\n"
23996 " const char *dom,\n"
23997 " va_list args);\n"
24002 #: ../src/guestfs-actions.pod:155
24003 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
24007 #: ../src/guestfs-actions.pod:157 ../src/guestfs-actions.pod:168 ../src/guestfs-actions.pod:267 ../src/guestfs-actions.pod:278 ../src/guestfs-actions.pod:929 ../src/guestfs-actions.pod:940 ../src/guestfs-actions.pod:1242 ../src/guestfs-actions.pod:1255 ../src/guestfs-actions.pod:1301 ../src/guestfs-actions.pod:1314 ../src/guestfs-actions.pod:1391 ../src/guestfs-actions.pod:1403 ../src/guestfs-actions.pod:1444 ../src/guestfs-actions.pod:1456 ../src/guestfs-actions.pod:1497 ../src/guestfs-actions.pod:1509 ../src/guestfs-actions.pod:1555 ../src/guestfs-actions.pod:1567 ../src/guestfs-actions.pod:3372 ../src/guestfs-actions.pod:3384 ../src/guestfs-actions.pod:5165 ../src/guestfs-actions.pod:5177 ../src/guestfs-actions.pod:5437 ../src/guestfs-actions.pod:5449 ../src/guestfs-actions.pod:5675 ../src/guestfs-actions.pod:5686
24008 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
24012 #: ../src/guestfs-actions.pod:159
24013 msgid "guestfs_add_domain_argv"
24017 #: ../src/guestfs-actions.pod:161
24021 " guestfs_add_domain_argv (guestfs_h *g,\n"
24022 " const char *dom,\n"
24023 " const struct guestfs_add_domain_argv *optargs);\n"
24028 #: ../src/guestfs-actions.pod:166
24029 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
24033 #: ../src/guestfs-actions.pod:170
24034 msgid "guestfs_add_drive"
24038 #: ../src/guestfs-actions.pod:172
24042 " guestfs_add_drive (guestfs_h *g,\n"
24043 " const char *filename);\n"
24048 #: ../src/guestfs-actions.pod:176
24050 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
24051 "optional parameters, so the disk is added writable, with the format being "
24052 "detected automatically."
24056 #: ../src/guestfs-actions.pod:180
24058 "Automatic detection of the format opens you up to a potential security hole "
24059 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
24060 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
24061 "you should think about replacing calls to this function with calls to "
24062 "C<guestfs_add_drive_opts>, and specifying the format."
24066 #: ../src/guestfs-actions.pod:191
24067 msgid "guestfs_add_drive_opts"
24071 #: ../src/guestfs-actions.pod:193
24075 " guestfs_add_drive_opts (guestfs_h *g,\n"
24076 " const char *filename,\n"
24082 #: ../src/guestfs-actions.pod:203
24085 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
24086 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
24087 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
24088 " GUESTFS_ADD_DRIVE_OPTS_NAME, const char *name,\n"
24093 #: ../src/guestfs-actions.pod:233
24095 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
24096 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
24097 "Possible formats include C<raw> and C<qcow2>."
24101 #: ../src/guestfs-actions.pod:244
24103 "This rarely-used option lets you emulate the behaviour of the deprecated "
24104 "C<guestfs_add_drive_with_if> call (q.v.)"
24108 #: ../src/guestfs-actions.pod:256
24109 msgid "(Added in 1.5.23)"
24113 #: ../src/guestfs-actions.pod:258
24114 msgid "guestfs_add_drive_opts_va"
24118 #: ../src/guestfs-actions.pod:260
24122 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
24123 " const char *filename,\n"
24124 " va_list args);\n"
24129 #: ../src/guestfs-actions.pod:265
24130 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
24134 #: ../src/guestfs-actions.pod:269
24135 msgid "guestfs_add_drive_opts_argv"
24139 #: ../src/guestfs-actions.pod:271
24143 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
24144 " const char *filename,\n"
24145 " const struct guestfs_add_drive_opts_argv "
24151 #: ../src/guestfs-actions.pod:276
24152 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
24156 #: ../src/guestfs-actions.pod:280
24157 msgid "guestfs_add_drive_ro"
24161 #: ../src/guestfs-actions.pod:282
24165 " guestfs_add_drive_ro (guestfs_h *g,\n"
24166 " const char *filename);\n"
24171 #: ../src/guestfs-actions.pod:286
24173 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
24174 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
24175 "disk is added read-only, with the format being detected automatically."
24179 #: ../src/guestfs-actions.pod:293
24180 msgid "(Added in 1.0.38)"
24184 #: ../src/guestfs-actions.pod:295
24185 msgid "guestfs_add_drive_ro_with_if"
24189 #: ../src/guestfs-actions.pod:297
24193 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
24194 " const char *filename,\n"
24195 " const char *iface);\n"
24200 #: ../src/guestfs-actions.pod:309
24202 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
24203 "QEMU interface emulation to use at run time."
24207 #: ../src/guestfs-actions.pod:314 ../src/guestfs-actions.pod:335 ../src/guestfs-actions.pod:2881
24208 msgid "(Added in 1.0.84)"
24212 #: ../src/guestfs-actions.pod:316
24213 msgid "guestfs_add_drive_with_if"
24217 #: ../src/guestfs-actions.pod:318
24221 " guestfs_add_drive_with_if (guestfs_h *g,\n"
24222 " const char *filename,\n"
24223 " const char *iface);\n"
24228 #: ../src/guestfs-actions.pod:330
24230 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
24231 "QEMU interface emulation to use at run time."
24235 #: ../src/guestfs-actions.pod:337
24236 msgid "guestfs_aug_clear"
24240 #: ../src/guestfs-actions.pod:339
24244 " guestfs_aug_clear (guestfs_h *g,\n"
24245 " const char *augpath);\n"
24250 #: ../src/guestfs-actions.pod:348 ../src/guestfs-actions.pod:2609
24251 msgid "(Added in 1.3.4)"
24255 #: ../src/guestfs-actions.pod:350
24256 msgid "guestfs_aug_close"
24260 #: ../src/guestfs-actions.pod:352
24264 " guestfs_aug_close (guestfs_h *g);\n"
24269 #: ../src/guestfs-actions.pod:355
24271 "Close the current Augeas handle and free up any resources used by it. After "
24272 "calling this, you have to call C<guestfs_aug_init> again before you can use "
24273 "any other Augeas functions."
24277 #: ../src/guestfs-actions.pod:362 ../src/guestfs-actions.pod:387 ../src/guestfs-actions.pod:405 ../src/guestfs-actions.pod:419 ../src/guestfs-actions.pod:482 ../src/guestfs-actions.pod:502 ../src/guestfs-actions.pod:516 ../src/guestfs-actions.pod:547 ../src/guestfs-actions.pod:561 ../src/guestfs-actions.pod:575 ../src/guestfs-actions.pod:589 ../src/guestfs-actions.pod:607 ../src/guestfs-actions.pod:6311
24278 msgid "(Added in 0.7)"
24282 #: ../src/guestfs-actions.pod:364
24283 msgid "guestfs_aug_defnode"
24287 #: ../src/guestfs-actions.pod:366
24290 " struct guestfs_int_bool *\n"
24291 " guestfs_aug_defnode (guestfs_h *g,\n"
24292 " const char *name,\n"
24293 " const char *expr,\n"
24294 " const char *val);\n"
24299 #: ../src/guestfs-actions.pod:375
24301 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
24302 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
24303 "containing that single node."
24307 #: ../src/guestfs-actions.pod:383
24309 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
24310 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
24314 #: ../src/guestfs-actions.pod:389
24315 msgid "guestfs_aug_defvar"
24319 #: ../src/guestfs-actions.pod:391
24323 " guestfs_aug_defvar (guestfs_h *g,\n"
24324 " const char *name,\n"
24325 " const char *expr);\n"
24330 #: ../src/guestfs-actions.pod:407
24331 msgid "guestfs_aug_get"
24335 #: ../src/guestfs-actions.pod:409
24339 " guestfs_aug_get (guestfs_h *g,\n"
24340 " const char *augpath);\n"
24345 #: ../src/guestfs-actions.pod:416 ../src/guestfs-actions.pod:980 ../src/guestfs-actions.pod:998 ../src/guestfs-actions.pod:1058 ../src/guestfs-actions.pod:1074 ../src/guestfs-actions.pod:1177 ../src/guestfs-actions.pod:1666 ../src/guestfs-actions.pod:1683 ../src/guestfs-actions.pod:1702 ../src/guestfs-actions.pod:1836 ../src/guestfs-actions.pod:2024 ../src/guestfs-actions.pod:2136 ../src/guestfs-actions.pod:2299 ../src/guestfs-actions.pod:2316 ../src/guestfs-actions.pod:2383 ../src/guestfs-actions.pod:2426 ../src/guestfs-actions.pod:2447 ../src/guestfs-actions.pod:2632 ../src/guestfs-actions.pod:2846 ../src/guestfs-actions.pod:3050 ../src/guestfs-actions.pod:3152 ../src/guestfs-actions.pod:3256 ../src/guestfs-actions.pod:3275 ../src/guestfs-actions.pod:3490 ../src/guestfs-actions.pod:3518 ../src/guestfs-actions.pod:3539 ../src/guestfs-actions.pod:3573 ../src/guestfs-actions.pod:3636 ../src/guestfs-actions.pod:3656 ../src/guestfs-actions.pod:3676 ../src/guestfs-actions.pod:4303 ../src/guestfs-actions.pod:4650 ../src/guestfs-actions.pod:4817 ../src/guestfs-actions.pod:4927 ../src/guestfs-actions.pod:5820 ../src/guestfs-actions.pod:6021 ../src/guestfs-actions.pod:6209 ../src/guestfs-actions.pod:6387 ../src/guestfs-actions.pod:6436 ../src/guestfs-actions.pod:7096 ../src/guestfs-actions.pod:7112 ../src/guestfs-actions.pod:7136 ../src/guestfs-actions.pod:7160 ../src/guestfs-actions.pod:7834 ../src/guestfs-actions.pod:7853 ../src/guestfs-actions.pod:7871 ../src/guestfs-actions.pod:8045 ../src/guestfs-actions.pod:8359
24347 "This function returns a string, or NULL on error. I<The caller must free "
24348 "the returned string after use>."
24352 #: ../src/guestfs-actions.pod:421
24353 msgid "guestfs_aug_init"
24357 #: ../src/guestfs-actions.pod:423
24361 " guestfs_aug_init (guestfs_h *g,\n"
24362 " const char *root,\n"
24368 #: ../src/guestfs-actions.pod:432
24369 msgid "You must call this before using any other C<guestfs_aug_*> commands."
24373 #: ../src/guestfs-actions.pod:457
24375 "This option is only useful when debugging Augeas lenses. Use of this option "
24376 "may require additional memory for the libguestfs appliance. You may need to "
24377 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
24378 "C<guestfs_set_memsize>."
24382 #: ../src/guestfs-actions.pod:472
24383 msgid "Do not load the tree in C<guestfs_aug_init>."
24387 #: ../src/guestfs-actions.pod:476
24388 msgid "To close the handle, you can call C<guestfs_aug_close>."
24392 #: ../src/guestfs-actions.pod:484
24393 msgid "guestfs_aug_insert"
24397 #: ../src/guestfs-actions.pod:486
24401 " guestfs_aug_insert (guestfs_h *g,\n"
24402 " const char *augpath,\n"
24403 " const char *label,\n"
24409 #: ../src/guestfs-actions.pod:504
24410 msgid "guestfs_aug_load"
24414 #: ../src/guestfs-actions.pod:506
24418 " guestfs_aug_load (guestfs_h *g);\n"
24423 #: ../src/guestfs-actions.pod:518
24424 msgid "guestfs_aug_ls"
24428 #: ../src/guestfs-actions.pod:520
24432 " guestfs_aug_ls (guestfs_h *g,\n"
24433 " const char *augpath);\n"
24438 #: ../src/guestfs-actions.pod:524
24440 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
24441 "sorting the resulting nodes into alphabetical order."
24445 #: ../src/guestfs-actions.pod:527 ../src/guestfs-actions.pod:543 ../src/guestfs-actions.pod:689 ../src/guestfs-actions.pod:1196 ../src/guestfs-actions.pod:1851 ../src/guestfs-actions.pod:1870 ../src/guestfs-actions.pod:1973 ../src/guestfs-actions.pod:1992 ../src/guestfs-actions.pod:2238 ../src/guestfs-actions.pod:2704 ../src/guestfs-actions.pod:2720 ../src/guestfs-actions.pod:2739 ../src/guestfs-actions.pod:2804 ../src/guestfs-actions.pod:2828 ../src/guestfs-actions.pod:2899 ../src/guestfs-actions.pod:2948 ../src/guestfs-actions.pod:3217 ../src/guestfs-actions.pod:3592 ../src/guestfs-actions.pod:3872 ../src/guestfs-actions.pod:4186 ../src/guestfs-actions.pod:4203 ../src/guestfs-actions.pod:4223 ../src/guestfs-actions.pod:4285 ../src/guestfs-actions.pod:4390 ../src/guestfs-actions.pod:4789 ../src/guestfs-actions.pod:5546 ../src/guestfs-actions.pod:6181 ../src/guestfs-actions.pod:6307 ../src/guestfs-actions.pod:6421 ../src/guestfs-actions.pod:7176 ../src/guestfs-actions.pod:7237 ../src/guestfs-actions.pod:7292 ../src/guestfs-actions.pod:7438 ../src/guestfs-actions.pod:7462 ../src/guestfs-actions.pod:7938 ../src/guestfs-actions.pod:7958 ../src/guestfs-actions.pod:8005 ../src/guestfs-actions.pod:8199 ../src/guestfs-actions.pod:8218 ../src/guestfs-actions.pod:8309 ../src/guestfs-actions.pod:8328 ../src/guestfs-actions.pod:8374 ../src/guestfs-actions.pod:8393
24447 "This function returns a NULL-terminated array of strings (like "
24448 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
24449 "strings and the array after use>."
24453 #: ../src/guestfs-actions.pod:531 ../src/guestfs-actions.pod:1121 ../src/guestfs-actions.pod:1139 ../src/guestfs-actions.pod:1908 ../src/guestfs-actions.pod:3950 ../src/guestfs-actions.pod:3981 ../src/guestfs-actions.pod:4633 ../src/guestfs-actions.pod:4680 ../src/guestfs-actions.pod:4867 ../src/guestfs-actions.pod:4900 ../src/guestfs-actions.pod:5063 ../src/guestfs-actions.pod:5550 ../src/guestfs-actions.pod:6122 ../src/guestfs-actions.pod:6519 ../src/guestfs-actions.pod:6533 ../src/guestfs-actions.pod:6545 ../src/guestfs-actions.pod:7023 ../src/guestfs-actions.pod:7676 ../src/guestfs-actions.pod:7689 ../src/guestfs-actions.pod:7922 ../src/guestfs-actions.pod:8187
24454 msgid "(Added in 0.8)"
24458 #: ../src/guestfs-actions.pod:533
24459 msgid "guestfs_aug_match"
24463 #: ../src/guestfs-actions.pod:535
24467 " guestfs_aug_match (guestfs_h *g,\n"
24468 " const char *augpath);\n"
24473 #: ../src/guestfs-actions.pod:549
24474 msgid "guestfs_aug_mv"
24478 #: ../src/guestfs-actions.pod:551
24482 " guestfs_aug_mv (guestfs_h *g,\n"
24483 " const char *src,\n"
24484 " const char *dest);\n"
24489 #: ../src/guestfs-actions.pod:563
24490 msgid "guestfs_aug_rm"
24494 #: ../src/guestfs-actions.pod:565
24498 " guestfs_aug_rm (guestfs_h *g,\n"
24499 " const char *augpath);\n"
24504 #: ../src/guestfs-actions.pod:577
24505 msgid "guestfs_aug_save"
24509 #: ../src/guestfs-actions.pod:579
24513 " guestfs_aug_save (guestfs_h *g);\n"
24518 #: ../src/guestfs-actions.pod:584
24520 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
24525 #: ../src/guestfs-actions.pod:591
24526 msgid "guestfs_aug_set"
24530 #: ../src/guestfs-actions.pod:593
24534 " guestfs_aug_set (guestfs_h *g,\n"
24535 " const char *augpath,\n"
24536 " const char *val);\n"
24541 #: ../src/guestfs-actions.pod:600
24543 "In the Augeas API, it is possible to clear a node by setting the value to "
24544 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
24545 "this call. Instead you must use the C<guestfs_aug_clear> call."
24549 #: ../src/guestfs-actions.pod:609
24550 msgid "guestfs_available"
24554 #: ../src/guestfs-actions.pod:611
24558 " guestfs_available (guestfs_h *g,\n"
24559 " char *const *groups);\n"
24564 #: ../src/guestfs-actions.pod:619
24566 "The libguestfs groups, and the functions that those groups correspond to, "
24567 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
24568 "runtime by calling C<guestfs_available_all_groups>."
24572 #: ../src/guestfs-actions.pod:643
24573 msgid "You must call C<guestfs_launch> before calling this function."
24577 #: ../src/guestfs-actions.pod:665
24579 "This call was added in version C<1.0.80>. In previous versions of "
24580 "libguestfs all you could do would be to speculatively execute a command to "
24581 "find out if the daemon implemented it. See also C<guestfs_version>."
24585 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:1653
24586 msgid "(Added in 1.0.80)"
24590 #: ../src/guestfs-actions.pod:676
24591 msgid "guestfs_available_all_groups"
24595 #: ../src/guestfs-actions.pod:678
24599 " guestfs_available_all_groups (guestfs_h *g);\n"
24604 #: ../src/guestfs-actions.pod:681
24606 "This command returns a list of all optional groups that this daemon knows "
24607 "about. Note this returns both supported and unsupported groups. To find "
24608 "out which ones the daemon can actually support you have to call "
24609 "C<guestfs_available> on each member of the returned list."
24613 #: ../src/guestfs-actions.pod:687
24614 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
24618 #: ../src/guestfs-actions.pod:693
24619 msgid "(Added in 1.3.15)"
24623 #: ../src/guestfs-actions.pod:695
24624 msgid "guestfs_base64_in"
24628 #: ../src/guestfs-actions.pod:697
24632 " guestfs_base64_in (guestfs_h *g,\n"
24633 " const char *base64file,\n"
24634 " const char *filename);\n"
24639 #: ../src/guestfs-actions.pod:707 ../src/guestfs-actions.pod:721
24640 msgid "(Added in 1.3.5)"
24644 #: ../src/guestfs-actions.pod:709
24645 msgid "guestfs_base64_out"
24649 #: ../src/guestfs-actions.pod:711
24653 " guestfs_base64_out (guestfs_h *g,\n"
24654 " const char *filename,\n"
24655 " const char *base64file);\n"
24660 #: ../src/guestfs-actions.pod:723
24661 msgid "guestfs_blockdev_flushbufs"
24665 #: ../src/guestfs-actions.pod:725
24669 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
24670 " const char *device);\n"
24675 #: ../src/guestfs-actions.pod:736 ../src/guestfs-actions.pod:753 ../src/guestfs-actions.pod:768 ../src/guestfs-actions.pod:784 ../src/guestfs-actions.pod:802 ../src/guestfs-actions.pod:821 ../src/guestfs-actions.pod:835 ../src/guestfs-actions.pod:853 ../src/guestfs-actions.pod:867 ../src/guestfs-actions.pod:881
24676 msgid "(Added in 0.9.3)"
24680 #: ../src/guestfs-actions.pod:738
24681 msgid "guestfs_blockdev_getbsz"
24685 #: ../src/guestfs-actions.pod:740
24689 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
24690 " const char *device);\n"
24695 #: ../src/guestfs-actions.pod:755
24696 msgid "guestfs_blockdev_getro"
24700 #: ../src/guestfs-actions.pod:757
24704 " guestfs_blockdev_getro (guestfs_h *g,\n"
24705 " const char *device);\n"
24710 #: ../src/guestfs-actions.pod:766 ../src/guestfs-actions.pod:1891 ../src/guestfs-actions.pod:1906 ../src/guestfs-actions.pod:2395 ../src/guestfs-actions.pod:2406 ../src/guestfs-actions.pod:2478 ../src/guestfs-actions.pod:2504 ../src/guestfs-actions.pod:2544 ../src/guestfs-actions.pod:2559 ../src/guestfs-actions.pod:2595 ../src/guestfs-actions.pod:2618 ../src/guestfs-actions.pod:3693 ../src/guestfs-actions.pod:3709 ../src/guestfs-actions.pod:3727 ../src/guestfs-actions.pod:3889 ../src/guestfs-actions.pod:3903 ../src/guestfs-actions.pod:3918 ../src/guestfs-actions.pod:3932 ../src/guestfs-actions.pod:3948 ../src/guestfs-actions.pod:3963 ../src/guestfs-actions.pod:3979 ../src/guestfs-actions.pod:3993 ../src/guestfs-actions.pod:4006 ../src/guestfs-actions.pod:4020 ../src/guestfs-actions.pod:4035 ../src/guestfs-actions.pod:4050 ../src/guestfs-actions.pod:4063 ../src/guestfs-actions.pod:4077 ../src/guestfs-actions.pod:5784
24711 msgid "This function returns a C truth value on success or -1 on error."
24715 #: ../src/guestfs-actions.pod:770
24716 msgid "guestfs_blockdev_getsize64"
24720 #: ../src/guestfs-actions.pod:772
24724 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
24725 " const char *device);\n"
24730 #: ../src/guestfs-actions.pod:778
24731 msgid "See also C<guestfs_blockdev_getsz>."
24735 #: ../src/guestfs-actions.pod:786
24736 msgid "guestfs_blockdev_getss"
24740 #: ../src/guestfs-actions.pod:788
24744 " guestfs_blockdev_getss (guestfs_h *g,\n"
24745 " const char *device);\n"
24750 #: ../src/guestfs-actions.pod:795
24752 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
24757 #: ../src/guestfs-actions.pod:804
24758 msgid "guestfs_blockdev_getsz"
24762 #: ../src/guestfs-actions.pod:806
24766 " guestfs_blockdev_getsz (guestfs_h *g,\n"
24767 " const char *device);\n"
24772 #: ../src/guestfs-actions.pod:813
24774 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
24775 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
24779 #: ../src/guestfs-actions.pod:823
24780 msgid "guestfs_blockdev_rereadpt"
24784 #: ../src/guestfs-actions.pod:825
24788 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
24789 " const char *device);\n"
24794 #: ../src/guestfs-actions.pod:837
24795 msgid "guestfs_blockdev_setbsz"
24799 #: ../src/guestfs-actions.pod:839
24803 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
24804 " const char *device,\n"
24805 " int blocksize);\n"
24810 #: ../src/guestfs-actions.pod:855
24811 msgid "guestfs_blockdev_setro"
24815 #: ../src/guestfs-actions.pod:857
24819 " guestfs_blockdev_setro (guestfs_h *g,\n"
24820 " const char *device);\n"
24825 #: ../src/guestfs-actions.pod:869
24826 msgid "guestfs_blockdev_setrw"
24830 #: ../src/guestfs-actions.pod:871
24834 " guestfs_blockdev_setrw (guestfs_h *g,\n"
24835 " const char *device);\n"
24840 #: ../src/guestfs-actions.pod:883
24841 msgid "guestfs_btrfs_filesystem_resize"
24845 #: ../src/guestfs-actions.pod:885
24849 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
24850 " const char *mountpoint,\n"
24856 #: ../src/guestfs-actions.pod:895
24859 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
24864 #: ../src/guestfs-actions.pod:918
24865 msgid "(Added in 1.11.17)"
24869 #: ../src/guestfs-actions.pod:920
24870 msgid "guestfs_btrfs_filesystem_resize_va"
24874 #: ../src/guestfs-actions.pod:922
24878 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
24879 " const char *mountpoint,\n"
24880 " va_list args);\n"
24885 #: ../src/guestfs-actions.pod:927
24886 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
24890 #: ../src/guestfs-actions.pod:931
24891 msgid "guestfs_btrfs_filesystem_resize_argv"
24895 #: ../src/guestfs-actions.pod:933
24899 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
24900 " const char *mountpoint,\n"
24902 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
24907 #: ../src/guestfs-actions.pod:938
24908 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
24912 #: ../src/guestfs-actions.pod:942
24913 msgid "guestfs_case_sensitive_path"
24917 #: ../src/guestfs-actions.pod:944
24921 " guestfs_case_sensitive_path (guestfs_h *g,\n"
24922 " const char *path);\n"
24927 #: ../src/guestfs-actions.pod:970
24929 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
24930 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
24931 "how the directories were originally created under Windows)."
24935 #: ../src/guestfs-actions.pod:978
24936 msgid "See also C<guestfs_realpath>."
24940 #: ../src/guestfs-actions.pod:983 ../src/guestfs-actions.pod:7856
24941 msgid "(Added in 1.0.75)"
24945 #: ../src/guestfs-actions.pod:985
24946 msgid "guestfs_cat"
24950 #: ../src/guestfs-actions.pod:987
24954 " guestfs_cat (guestfs_h *g,\n"
24955 " const char *path);\n"
24960 #: ../src/guestfs-actions.pod:993
24962 "Note that this function cannot correctly handle binary files (specifically, "
24963 "files containing C<\\0> character which is treated as end of string). For "
24964 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
24965 "functions which have a more complex interface."
24969 #: ../src/guestfs-actions.pod:1004 ../src/guestfs-actions.pod:4207 ../src/guestfs-actions.pod:4289 ../src/guestfs-actions.pod:4306 ../src/guestfs-actions.pod:4394 ../src/guestfs-actions.pod:4793 ../src/guestfs-actions.pod:4807 ../src/guestfs-actions.pod:6185 ../src/guestfs-actions.pod:6199 ../src/guestfs-actions.pod:8009 ../src/guestfs-actions.pod:8023
24970 msgid "(Added in 0.4)"
24974 #: ../src/guestfs-actions.pod:1006
24975 msgid "guestfs_checksum"
24979 #: ../src/guestfs-actions.pod:1008
24983 " guestfs_checksum (guestfs_h *g,\n"
24984 " const char *csumtype,\n"
24985 " const char *path);\n"
24990 #: ../src/guestfs-actions.pod:1054
24991 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
24995 #: ../src/guestfs-actions.pod:1056
24996 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
25000 #: ../src/guestfs-actions.pod:1061 ../src/guestfs-actions.pod:1728 ../src/guestfs-actions.pod:2586 ../src/guestfs-actions.pod:3905 ../src/guestfs-actions.pod:3934 ../src/guestfs-actions.pod:3995 ../src/guestfs-actions.pod:4022 ../src/guestfs-actions.pod:7712
25001 msgid "(Added in 1.0.2)"
25005 #: ../src/guestfs-actions.pod:1063
25006 msgid "guestfs_checksum_device"
25010 #: ../src/guestfs-actions.pod:1065
25014 " guestfs_checksum_device (guestfs_h *g,\n"
25015 " const char *csumtype,\n"
25016 " const char *device);\n"
25021 #: ../src/guestfs-actions.pod:1070
25023 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
25024 "device named C<device>. For the types of checksums supported see the "
25025 "C<guestfs_checksum> command."
25029 #: ../src/guestfs-actions.pod:1077 ../src/guestfs-actions.pod:5617 ../src/guestfs-actions.pod:5752 ../src/guestfs-actions.pod:5786 ../src/guestfs-actions.pod:5804 ../src/guestfs-actions.pod:5986 ../src/guestfs-actions.pod:7621 ../src/guestfs-actions.pod:7635 ../src/guestfs-actions.pod:8035
25030 msgid "(Added in 1.3.2)"
25034 #: ../src/guestfs-actions.pod:1079
25035 msgid "guestfs_checksums_out"
25039 #: ../src/guestfs-actions.pod:1081
25043 " guestfs_checksums_out (guestfs_h *g,\n"
25044 " const char *csumtype,\n"
25045 " const char *directory,\n"
25046 " const char *sumsfile);\n"
25051 #: ../src/guestfs-actions.pod:1101
25052 msgid "(Added in 1.3.7)"
25056 #: ../src/guestfs-actions.pod:1103
25057 msgid "guestfs_chmod"
25061 #: ../src/guestfs-actions.pod:1105
25065 " guestfs_chmod (guestfs_h *g,\n"
25067 " const char *path);\n"
25072 #: ../src/guestfs-actions.pod:1123
25073 msgid "guestfs_chown"
25077 #: ../src/guestfs-actions.pod:1125
25081 " guestfs_chown (guestfs_h *g,\n"
25084 " const char *path);\n"
25089 #: ../src/guestfs-actions.pod:1141
25090 msgid "guestfs_command"
25094 #: ../src/guestfs-actions.pod:1143
25098 " guestfs_command (guestfs_h *g,\n"
25099 " char *const *arguments);\n"
25104 #: ../src/guestfs-actions.pod:1152
25106 "The single parameter is an argv-style list of arguments. The first element "
25107 "is the name of the program to run. Subsequent elements are parameters. The "
25108 "list must be non-empty (ie. must contain a program name). Note that the "
25109 "command runs directly, and is I<not> invoked via the shell (see "
25114 #: ../src/guestfs-actions.pod:1183 ../src/guestfs-actions.pod:1203 ../src/guestfs-actions.pod:2027
25115 msgid "(Added in 0.9.1)"
25119 #: ../src/guestfs-actions.pod:1185
25120 msgid "guestfs_command_lines"
25124 #: ../src/guestfs-actions.pod:1187
25128 " guestfs_command_lines (guestfs_h *g,\n"
25129 " char *const *arguments);\n"
25134 #: ../src/guestfs-actions.pod:1191
25136 "This is the same as C<guestfs_command>, but splits the result into a list of "
25141 #: ../src/guestfs-actions.pod:1194
25142 msgid "See also: C<guestfs_sh_lines>"
25146 #: ../src/guestfs-actions.pod:1205
25147 msgid "guestfs_compress_device_out"
25151 #: ../src/guestfs-actions.pod:1207
25155 " guestfs_compress_device_out (guestfs_h *g,\n"
25156 " const char *ctype,\n"
25157 " const char *device,\n"
25158 " const char *zdevice,\n"
25164 #: ../src/guestfs-actions.pod:1219
25167 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
25172 #: ../src/guestfs-actions.pod:1224
25174 "The C<ctype> and optional C<level> parameters have the same meaning as in "
25175 "C<guestfs_compress_out>."
25179 #: ../src/guestfs-actions.pod:1229 ../src/guestfs-actions.pod:1288 ../src/guestfs-actions.pod:2572 ../src/guestfs-actions.pod:6902
25180 msgid "(Added in 1.13.15)"
25184 #: ../src/guestfs-actions.pod:1231
25185 msgid "guestfs_compress_device_out_va"
25189 #: ../src/guestfs-actions.pod:1233
25193 " guestfs_compress_device_out_va (guestfs_h *g,\n"
25194 " const char *ctype,\n"
25195 " const char *device,\n"
25196 " const char *zdevice,\n"
25197 " va_list args);\n"
25202 #: ../src/guestfs-actions.pod:1240
25203 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
25207 #: ../src/guestfs-actions.pod:1244
25208 msgid "guestfs_compress_device_out_argv"
25212 #: ../src/guestfs-actions.pod:1246
25216 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
25217 " const char *ctype,\n"
25218 " const char *device,\n"
25219 " const char *zdevice,\n"
25221 "guestfs_compress_device_out_argv *optargs);\n"
25226 #: ../src/guestfs-actions.pod:1253
25227 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
25231 #: ../src/guestfs-actions.pod:1257
25232 msgid "guestfs_compress_out"
25236 #: ../src/guestfs-actions.pod:1259
25240 " guestfs_compress_out (guestfs_h *g,\n"
25241 " const char *ctype,\n"
25242 " const char *file,\n"
25243 " const char *zfile,\n"
25249 #: ../src/guestfs-actions.pod:1271
25252 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
25257 #: ../src/guestfs-actions.pod:1290
25258 msgid "guestfs_compress_out_va"
25262 #: ../src/guestfs-actions.pod:1292
25266 " guestfs_compress_out_va (guestfs_h *g,\n"
25267 " const char *ctype,\n"
25268 " const char *file,\n"
25269 " const char *zfile,\n"
25270 " va_list args);\n"
25275 #: ../src/guestfs-actions.pod:1299
25276 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
25280 #: ../src/guestfs-actions.pod:1303
25281 msgid "guestfs_compress_out_argv"
25285 #: ../src/guestfs-actions.pod:1305
25289 " guestfs_compress_out_argv (guestfs_h *g,\n"
25290 " const char *ctype,\n"
25291 " const char *file,\n"
25292 " const char *zfile,\n"
25293 " const struct guestfs_compress_out_argv "
25299 #: ../src/guestfs-actions.pod:1312
25300 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
25304 #: ../src/guestfs-actions.pod:1316
25305 msgid "guestfs_config"
25309 #: ../src/guestfs-actions.pod:1318
25313 " guestfs_config (guestfs_h *g,\n"
25314 " const char *qemuparam,\n"
25315 " const char *qemuvalue);\n"
25320 #: ../src/guestfs-actions.pod:1336
25321 msgid "guestfs_copy_device_to_device"
25325 #: ../src/guestfs-actions.pod:1338
25329 " guestfs_copy_device_to_device (guestfs_h *g,\n"
25330 " const char *src,\n"
25331 " const char *dest,\n"
25337 #: ../src/guestfs-actions.pod:1349
25340 " GUESTFS_COPY_DEVICE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
25341 " GUESTFS_COPY_DEVICE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
25342 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, int64_t size,\n"
25347 #: ../src/guestfs-actions.pod:1353
25349 "The four calls C<guestfs_copy_device_to_device>, "
25350 "C<guestfs_copy_device_to_file>, C<guestfs_copy_file_to_device>, and "
25351 "C<guestfs_copy_file_to_file> let you copy from a source (device|file) to a "
25352 "destination (device|file)."
25356 #: ../src/guestfs-actions.pod:1374 ../src/guestfs-actions.pod:1427 ../src/guestfs-actions.pod:1480 ../src/guestfs-actions.pod:1538 ../src/guestfs-actions.pod:1592 ../src/guestfs-actions.pod:1723 ../src/guestfs-actions.pod:1754 ../src/guestfs-actions.pod:1799 ../src/guestfs-actions.pod:2176 ../src/guestfs-actions.pod:2198 ../src/guestfs-actions.pod:4105 ../src/guestfs-actions.pod:7707 ../src/guestfs-actions.pod:7741 ../src/guestfs-actions.pod:8248 ../src/guestfs-actions.pod:8271
25358 "This long-running command can generate progress notification messages so "
25359 "that the caller can display a progress bar or indicator. To receive these "
25360 "messages, the caller must register a progress event callback. See "
25361 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
25365 #: ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1432 ../src/guestfs-actions.pod:1485 ../src/guestfs-actions.pod:1543 ../src/guestfs-actions.pod:6042
25366 msgid "(Added in 1.13.25)"
25370 #: ../src/guestfs-actions.pod:1381
25371 msgid "guestfs_copy_device_to_device_va"
25375 #: ../src/guestfs-actions.pod:1383
25379 " guestfs_copy_device_to_device_va (guestfs_h *g,\n"
25380 " const char *src,\n"
25381 " const char *dest,\n"
25382 " va_list args);\n"
25387 #: ../src/guestfs-actions.pod:1389
25388 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_device>."
25392 #: ../src/guestfs-actions.pod:1393
25393 msgid "guestfs_copy_device_to_device_argv"
25397 #: ../src/guestfs-actions.pod:1395
25401 " guestfs_copy_device_to_device_argv (guestfs_h *g,\n"
25402 " const char *src,\n"
25403 " const char *dest,\n"
25405 "guestfs_copy_device_to_device_argv *optargs);\n"
25410 #: ../src/guestfs-actions.pod:1401
25411 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_device>."
25415 #: ../src/guestfs-actions.pod:1405
25416 msgid "guestfs_copy_device_to_file"
25420 #: ../src/guestfs-actions.pod:1407
25424 " guestfs_copy_device_to_file (guestfs_h *g,\n"
25425 " const char *src,\n"
25426 " const char *dest,\n"
25432 #: ../src/guestfs-actions.pod:1418
25435 " GUESTFS_COPY_DEVICE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
25436 " GUESTFS_COPY_DEVICE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
25437 " GUESTFS_COPY_DEVICE_TO_FILE_SIZE, int64_t size,\n"
25442 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:1475 ../src/guestfs-actions.pod:1528
25443 msgid "See C<guestfs_copy_device_to_device> for a general overview of this call."
25447 #: ../src/guestfs-actions.pod:1434
25448 msgid "guestfs_copy_device_to_file_va"
25452 #: ../src/guestfs-actions.pod:1436
25456 " guestfs_copy_device_to_file_va (guestfs_h *g,\n"
25457 " const char *src,\n"
25458 " const char *dest,\n"
25459 " va_list args);\n"
25464 #: ../src/guestfs-actions.pod:1442
25465 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_file>."
25469 #: ../src/guestfs-actions.pod:1446
25470 msgid "guestfs_copy_device_to_file_argv"
25474 #: ../src/guestfs-actions.pod:1448
25478 " guestfs_copy_device_to_file_argv (guestfs_h *g,\n"
25479 " const char *src,\n"
25480 " const char *dest,\n"
25482 "guestfs_copy_device_to_file_argv *optargs);\n"
25487 #: ../src/guestfs-actions.pod:1454
25488 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_file>."
25492 #: ../src/guestfs-actions.pod:1458
25493 msgid "guestfs_copy_file_to_device"
25497 #: ../src/guestfs-actions.pod:1460
25501 " guestfs_copy_file_to_device (guestfs_h *g,\n"
25502 " const char *src,\n"
25503 " const char *dest,\n"
25509 #: ../src/guestfs-actions.pod:1471
25512 " GUESTFS_COPY_FILE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
25513 " GUESTFS_COPY_FILE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
25514 " GUESTFS_COPY_FILE_TO_DEVICE_SIZE, int64_t size,\n"
25519 #: ../src/guestfs-actions.pod:1487
25520 msgid "guestfs_copy_file_to_device_va"
25524 #: ../src/guestfs-actions.pod:1489
25528 " guestfs_copy_file_to_device_va (guestfs_h *g,\n"
25529 " const char *src,\n"
25530 " const char *dest,\n"
25531 " va_list args);\n"
25536 #: ../src/guestfs-actions.pod:1495
25537 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_device>."
25541 #: ../src/guestfs-actions.pod:1499
25542 msgid "guestfs_copy_file_to_device_argv"
25546 #: ../src/guestfs-actions.pod:1501
25550 " guestfs_copy_file_to_device_argv (guestfs_h *g,\n"
25551 " const char *src,\n"
25552 " const char *dest,\n"
25554 "guestfs_copy_file_to_device_argv *optargs);\n"
25559 #: ../src/guestfs-actions.pod:1507
25560 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_device>."
25564 #: ../src/guestfs-actions.pod:1511
25565 msgid "guestfs_copy_file_to_file"
25569 #: ../src/guestfs-actions.pod:1513
25573 " guestfs_copy_file_to_file (guestfs_h *g,\n"
25574 " const char *src,\n"
25575 " const char *dest,\n"
25581 #: ../src/guestfs-actions.pod:1524
25584 " GUESTFS_COPY_FILE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
25585 " GUESTFS_COPY_FILE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
25586 " GUESTFS_COPY_FILE_TO_FILE_SIZE, int64_t size,\n"
25591 #: ../src/guestfs-actions.pod:1531
25593 "This is B<not> the function you want for copying files. This is for copying "
25594 "blocks within existing files. See C<guestfs_cp>, C<guestfs_cp_a> and "
25595 "C<guestfs_mv> for general file copying and moving functions."
25599 #: ../src/guestfs-actions.pod:1545
25600 msgid "guestfs_copy_file_to_file_va"
25604 #: ../src/guestfs-actions.pod:1547
25608 " guestfs_copy_file_to_file_va (guestfs_h *g,\n"
25609 " const char *src,\n"
25610 " const char *dest,\n"
25611 " va_list args);\n"
25616 #: ../src/guestfs-actions.pod:1553
25617 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_file>."
25621 #: ../src/guestfs-actions.pod:1557
25622 msgid "guestfs_copy_file_to_file_argv"
25626 #: ../src/guestfs-actions.pod:1559
25630 " guestfs_copy_file_to_file_argv (guestfs_h *g,\n"
25631 " const char *src,\n"
25632 " const char *dest,\n"
25633 " const struct guestfs_copy_file_to_file_argv "
25639 #: ../src/guestfs-actions.pod:1565
25640 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_file>."
25644 #: ../src/guestfs-actions.pod:1569
25645 msgid "guestfs_copy_size"
25649 #: ../src/guestfs-actions.pod:1571
25653 " guestfs_copy_size (guestfs_h *g,\n"
25654 " const char *src,\n"
25655 " const char *dest,\n"
25656 " int64_t size);\n"
25661 #: ../src/guestfs-actions.pod:1577 ../src/guestfs-actions.pod:1634
25663 "I<This function is deprecated.> In new code, use the "
25664 "L</guestfs_copy_device_to_device> call instead."
25668 #: ../src/guestfs-actions.pod:1597 ../src/guestfs-actions.pod:4820 ../src/guestfs-actions.pod:6212 ../src/guestfs-actions.pod:7942 ../src/guestfs-actions.pod:7962 ../src/guestfs-actions.pod:8048
25669 msgid "(Added in 1.0.87)"
25673 #: ../src/guestfs-actions.pod:1599
25678 #: ../src/guestfs-actions.pod:1601
25682 " guestfs_cp (guestfs_h *g,\n"
25683 " const char *src,\n"
25684 " const char *dest);\n"
25689 #: ../src/guestfs-actions.pod:1611 ../src/guestfs-actions.pod:1625 ../src/guestfs-actions.pod:1705 ../src/guestfs-actions.pod:1779 ../src/guestfs-actions.pod:1893 ../src/guestfs-actions.pod:5564 ../src/guestfs-actions.pod:6056
25690 msgid "(Added in 1.0.18)"
25694 #: ../src/guestfs-actions.pod:1613
25695 msgid "guestfs_cp_a"
25699 #: ../src/guestfs-actions.pod:1615
25703 " guestfs_cp_a (guestfs_h *g,\n"
25704 " const char *src,\n"
25705 " const char *dest);\n"
25710 #: ../src/guestfs-actions.pod:1627
25715 #: ../src/guestfs-actions.pod:1629
25719 " guestfs_dd (guestfs_h *g,\n"
25720 " const char *src,\n"
25721 " const char *dest);\n"
25726 #: ../src/guestfs-actions.pod:1646
25728 "If the destination is a device, it must be as large or larger than the "
25729 "source file or device, otherwise the copy will fail. This command cannot do "
25730 "partial copies (see C<guestfs_copy_device_to_device>)."
25734 #: ../src/guestfs-actions.pod:1655
25739 #: ../src/guestfs-actions.pod:1657
25743 " guestfs_df (guestfs_h *g);\n"
25748 #: ../src/guestfs-actions.pod:1662 ../src/guestfs-actions.pod:1679
25750 "This command is mostly useful for interactive sessions. It is I<not> "
25751 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
25756 #: ../src/guestfs-actions.pod:1669 ../src/guestfs-actions.pod:1686 ../src/guestfs-actions.pod:1804 ../src/guestfs-actions.pod:2811 ../src/guestfs-actions.pod:2835 ../src/guestfs-actions.pod:2903 ../src/guestfs-actions.pod:4930 ../src/guestfs-actions.pod:5464 ../src/guestfs-actions.pod:7445 ../src/guestfs-actions.pod:7469 ../src/guestfs-actions.pod:8088 ../src/guestfs-actions.pod:8101 ../src/guestfs-actions.pod:8114
25757 msgid "(Added in 1.0.54)"
25761 #: ../src/guestfs-actions.pod:1671
25762 msgid "guestfs_df_h"
25766 #: ../src/guestfs-actions.pod:1673
25770 " guestfs_df_h (guestfs_h *g);\n"
25775 #: ../src/guestfs-actions.pod:1688
25776 msgid "guestfs_dmesg"
25780 #: ../src/guestfs-actions.pod:1690
25784 " guestfs_dmesg (guestfs_h *g);\n"
25789 #: ../src/guestfs-actions.pod:1697
25791 "Another way to get the same information is to enable verbose messages with "
25792 "C<guestfs_set_verbose> or by setting the environment variable "
25793 "C<LIBGUESTFS_DEBUG=1> before running the program."
25797 #: ../src/guestfs-actions.pod:1707
25798 msgid "guestfs_download"
25802 #: ../src/guestfs-actions.pod:1709
25806 " guestfs_download (guestfs_h *g,\n"
25807 " const char *remotefilename,\n"
25808 " const char *filename);\n"
25813 #: ../src/guestfs-actions.pod:1719
25814 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
25818 #: ../src/guestfs-actions.pod:1730
25819 msgid "guestfs_download_offset"
25823 #: ../src/guestfs-actions.pod:1732
25827 " guestfs_download_offset (guestfs_h *g,\n"
25828 " const char *remotefilename,\n"
25829 " const char *filename,\n"
25830 " int64_t offset,\n"
25831 " int64_t size);\n"
25836 #: ../src/guestfs-actions.pod:1745
25838 "Note that there is no limit on the amount of data that can be downloaded "
25839 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
25840 "full amount unless an error occurs."
25844 #: ../src/guestfs-actions.pod:1750
25845 msgid "See also C<guestfs_download>, C<guestfs_pread>."
25849 #: ../src/guestfs-actions.pod:1759 ../src/guestfs-actions.pod:7746
25850 msgid "(Added in 1.5.17)"
25854 #: ../src/guestfs-actions.pod:1761
25855 msgid "guestfs_drop_caches"
25859 #: ../src/guestfs-actions.pod:1763
25863 " guestfs_drop_caches (guestfs_h *g,\n"
25864 " int whattodrop);\n"
25869 #: ../src/guestfs-actions.pod:1781
25874 #: ../src/guestfs-actions.pod:1783
25878 " guestfs_du (guestfs_h *g,\n"
25879 " const char *path);\n"
25884 #: ../src/guestfs-actions.pod:1806
25885 msgid "guestfs_e2fsck_f"
25889 #: ../src/guestfs-actions.pod:1808
25893 " guestfs_e2fsck_f (guestfs_h *g,\n"
25894 " const char *device);\n"
25899 #: ../src/guestfs-actions.pod:1816
25901 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
25902 "Normally you should use C<guestfs_fsck>."
25906 #: ../src/guestfs-actions.pod:1821
25907 msgid "(Added in 1.0.29)"
25911 #: ../src/guestfs-actions.pod:1823
25912 msgid "guestfs_echo_daemon"
25916 #: ../src/guestfs-actions.pod:1825
25920 " guestfs_echo_daemon (guestfs_h *g,\n"
25921 " char *const *words);\n"
25926 #: ../src/guestfs-actions.pod:1834
25927 msgid "See also C<guestfs_ping_daemon>."
25931 #: ../src/guestfs-actions.pod:1839 ../src/guestfs-actions.pod:2597 ../src/guestfs-actions.pod:6926
25932 msgid "(Added in 1.0.69)"
25936 #: ../src/guestfs-actions.pod:1841
25937 msgid "guestfs_egrep"
25941 #: ../src/guestfs-actions.pod:1843
25945 " guestfs_egrep (guestfs_h *g,\n"
25946 " const char *regex,\n"
25947 " const char *path);\n"
25952 #: ../src/guestfs-actions.pod:1858 ../src/guestfs-actions.pod:1877 ../src/guestfs-actions.pod:1934 ../src/guestfs-actions.pod:1980 ../src/guestfs-actions.pod:1999 ../src/guestfs-actions.pod:2727 ../src/guestfs-actions.pod:2746 ../src/guestfs-actions.pod:2924 ../src/guestfs-actions.pod:2937 ../src/guestfs-actions.pod:2952 ../src/guestfs-actions.pod:2998 ../src/guestfs-actions.pod:3020 ../src/guestfs-actions.pod:3033 ../src/guestfs-actions.pod:4319 ../src/guestfs-actions.pod:4333 ../src/guestfs-actions.pod:4346 ../src/guestfs-actions.pod:4360 ../src/guestfs-actions.pod:5352 ../src/guestfs-actions.pod:6390 ../src/guestfs-actions.pod:6439 ../src/guestfs-actions.pod:7313 ../src/guestfs-actions.pod:7325 ../src/guestfs-actions.pod:7338 ../src/guestfs-actions.pod:7351 ../src/guestfs-actions.pod:7373 ../src/guestfs-actions.pod:7386 ../src/guestfs-actions.pod:7399 ../src/guestfs-actions.pod:7412 ../src/guestfs-actions.pod:8206 ../src/guestfs-actions.pod:8225 ../src/guestfs-actions.pod:8316 ../src/guestfs-actions.pod:8335 ../src/guestfs-actions.pod:8381 ../src/guestfs-actions.pod:8400
25953 msgid "(Added in 1.0.66)"
25957 #: ../src/guestfs-actions.pod:1860
25958 msgid "guestfs_egrepi"
25962 #: ../src/guestfs-actions.pod:1862
25966 " guestfs_egrepi (guestfs_h *g,\n"
25967 " const char *regex,\n"
25968 " const char *path);\n"
25973 #: ../src/guestfs-actions.pod:1879
25974 msgid "guestfs_equal"
25978 #: ../src/guestfs-actions.pod:1881
25982 " guestfs_equal (guestfs_h *g,\n"
25983 " const char *file1,\n"
25984 " const char *file2);\n"
25989 #: ../src/guestfs-actions.pod:1895
25990 msgid "guestfs_exists"
25994 #: ../src/guestfs-actions.pod:1897
25998 " guestfs_exists (guestfs_h *g,\n"
25999 " const char *path);\n"
26004 #: ../src/guestfs-actions.pod:1904
26005 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
26009 #: ../src/guestfs-actions.pod:1910
26010 msgid "guestfs_fallocate"
26014 #: ../src/guestfs-actions.pod:1912
26018 " guestfs_fallocate (guestfs_h *g,\n"
26019 " const char *path,\n"
26025 #: ../src/guestfs-actions.pod:1917
26027 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
26032 #: ../src/guestfs-actions.pod:1936
26033 msgid "guestfs_fallocate64"
26037 #: ../src/guestfs-actions.pod:1938
26041 " guestfs_fallocate64 (guestfs_h *g,\n"
26042 " const char *path,\n"
26048 #: ../src/guestfs-actions.pod:1947
26050 "Note that this call allocates disk blocks for the file. To create a sparse "
26051 "file use C<guestfs_truncate_size> instead."
26055 #: ../src/guestfs-actions.pod:1950
26057 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
26058 "oversight it only allowed 30 bit lengths to be specified, effectively "
26059 "limiting the maximum size of files created through that call to 1GB."
26063 #: ../src/guestfs-actions.pod:1961
26064 msgid "(Added in 1.3.17)"
26068 #: ../src/guestfs-actions.pod:1963
26069 msgid "guestfs_fgrep"
26073 #: ../src/guestfs-actions.pod:1965
26077 " guestfs_fgrep (guestfs_h *g,\n"
26078 " const char *pattern,\n"
26079 " const char *path);\n"
26084 #: ../src/guestfs-actions.pod:1982
26085 msgid "guestfs_fgrepi"
26089 #: ../src/guestfs-actions.pod:1984
26093 " guestfs_fgrepi (guestfs_h *g,\n"
26094 " const char *pattern,\n"
26095 " const char *path);\n"
26100 #: ../src/guestfs-actions.pod:2001
26101 msgid "guestfs_file"
26105 #: ../src/guestfs-actions.pod:2003
26109 " guestfs_file (guestfs_h *g,\n"
26110 " const char *path);\n"
26115 #: ../src/guestfs-actions.pod:2021
26117 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
26118 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
26122 #: ../src/guestfs-actions.pod:2029
26123 msgid "guestfs_file_architecture"
26127 #: ../src/guestfs-actions.pod:2031
26131 " guestfs_file_architecture (guestfs_h *g,\n"
26132 " const char *filename);\n"
26137 #: ../src/guestfs-actions.pod:2139 ../src/guestfs-actions.pod:2302 ../src/guestfs-actions.pod:2319 ../src/guestfs-actions.pod:3053 ../src/guestfs-actions.pod:3155 ../src/guestfs-actions.pod:3221 ../src/guestfs-actions.pod:3408 ../src/guestfs-actions.pod:3426 ../src/guestfs-actions.pod:3466 ../src/guestfs-actions.pod:3542 ../src/guestfs-actions.pod:3639 ../src/guestfs-actions.pod:3876 ../src/guestfs-actions.pod:4008
26138 msgid "(Added in 1.5.3)"
26142 #: ../src/guestfs-actions.pod:2141
26143 msgid "guestfs_filesize"
26147 #: ../src/guestfs-actions.pod:2143
26151 " guestfs_filesize (guestfs_h *g,\n"
26152 " const char *file);\n"
26157 #: ../src/guestfs-actions.pod:2149
26159 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
26160 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
26161 "devices, use C<guestfs_blockdev_getsize64>."
26165 #: ../src/guestfs-actions.pod:2155
26166 msgid "(Added in 1.0.82)"
26170 #: ../src/guestfs-actions.pod:2157
26171 msgid "guestfs_fill"
26175 #: ../src/guestfs-actions.pod:2159
26179 " guestfs_fill (guestfs_h *g,\n"
26182 " const char *path);\n"
26187 #: ../src/guestfs-actions.pod:2169
26189 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
26190 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
26191 "bytes use C<guestfs_fill_pattern>."
26195 #: ../src/guestfs-actions.pod:2181
26196 msgid "(Added in 1.0.79)"
26200 #: ../src/guestfs-actions.pod:2183
26201 msgid "guestfs_fill_pattern"
26205 #: ../src/guestfs-actions.pod:2185
26209 " guestfs_fill_pattern (guestfs_h *g,\n"
26210 " const char *pattern,\n"
26212 " const char *path);\n"
26217 #: ../src/guestfs-actions.pod:2191
26219 "This function is like C<guestfs_fill> except that it creates a new file of "
26220 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
26221 "pattern is truncated if necessary to ensure the length of the file is "
26222 "exactly C<len> bytes."
26226 #: ../src/guestfs-actions.pod:2203
26227 msgid "(Added in 1.3.12)"
26231 #: ../src/guestfs-actions.pod:2205
26232 msgid "guestfs_find"
26236 #: ../src/guestfs-actions.pod:2207
26240 " guestfs_find (guestfs_h *g,\n"
26241 " const char *directory);\n"
26246 #: ../src/guestfs-actions.pod:2223
26247 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
26251 #: ../src/guestfs-actions.pod:2236
26252 msgid "See also C<guestfs_find0>."
26256 #: ../src/guestfs-actions.pod:2245 ../src/guestfs-actions.pod:4757 ../src/guestfs-actions.pod:6474
26257 msgid "(Added in 1.0.27)"
26261 #: ../src/guestfs-actions.pod:2247
26262 msgid "guestfs_find0"
26266 #: ../src/guestfs-actions.pod:2249
26270 " guestfs_find0 (guestfs_h *g,\n"
26271 " const char *directory,\n"
26272 " const char *files);\n"
26277 #: ../src/guestfs-actions.pod:2258
26279 "This command works the same way as C<guestfs_find> with the following "
26284 #: ../src/guestfs-actions.pod:2285
26285 msgid "(Added in 1.0.74)"
26289 #: ../src/guestfs-actions.pod:2287
26290 msgid "guestfs_findfs_label"
26294 #: ../src/guestfs-actions.pod:2289
26298 " guestfs_findfs_label (guestfs_h *g,\n"
26299 " const char *label);\n"
26304 #: ../src/guestfs-actions.pod:2297
26305 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
26309 #: ../src/guestfs-actions.pod:2304
26310 msgid "guestfs_findfs_uuid"
26314 #: ../src/guestfs-actions.pod:2306
26318 " guestfs_findfs_uuid (guestfs_h *g,\n"
26319 " const char *uuid);\n"
26324 #: ../src/guestfs-actions.pod:2314
26325 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
26329 #: ../src/guestfs-actions.pod:2321
26330 msgid "guestfs_fsck"
26334 #: ../src/guestfs-actions.pod:2323
26338 " guestfs_fsck (guestfs_h *g,\n"
26339 " const char *fstype,\n"
26340 " const char *device);\n"
26345 #: ../src/guestfs-actions.pod:2358 ../src/guestfs-actions.pod:8253
26346 msgid "(Added in 1.0.16)"
26350 #: ../src/guestfs-actions.pod:2360
26351 msgid "guestfs_get_append"
26355 #: ../src/guestfs-actions.pod:2362
26359 " guestfs_get_append (guestfs_h *g);\n"
26364 #: ../src/guestfs-actions.pod:2370
26366 "This function returns a string which may be NULL. There is no way to return "
26367 "an error from this function. The string is owned by the guest handle and "
26368 "must I<not> be freed."
26372 #: ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:6152 ../src/guestfs-actions.pod:6631 ../src/guestfs-actions.pod:7080 ../src/guestfs-actions.pod:7099 ../src/guestfs-actions.pod:7115 ../src/guestfs-actions.pod:7139 ../src/guestfs-actions.pod:7893 ../src/guestfs-actions.pod:7908 ../src/guestfs-actions.pod:8297
26373 msgid "(Added in 1.0.26)"
26377 #: ../src/guestfs-actions.pod:2376
26378 msgid "guestfs_get_attach_method"
26382 #: ../src/guestfs-actions.pod:2378
26386 " guestfs_get_attach_method (guestfs_h *g);\n"
26391 #: ../src/guestfs-actions.pod:2381
26392 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
26396 #: ../src/guestfs-actions.pod:2386 ../src/guestfs-actions.pod:6661
26397 msgid "(Added in 1.9.8)"
26401 #: ../src/guestfs-actions.pod:2388
26402 msgid "guestfs_get_autosync"
26406 #: ../src/guestfs-actions.pod:2390
26410 " guestfs_get_autosync (guestfs_h *g);\n"
26415 #: ../src/guestfs-actions.pod:2399
26416 msgid "guestfs_get_direct"
26420 #: ../src/guestfs-actions.pod:2401
26424 " guestfs_get_direct (guestfs_h *g);\n"
26429 #: ../src/guestfs-actions.pod:2408 ../src/guestfs-actions.pod:6702
26430 msgid "(Added in 1.0.72)"
26434 #: ../src/guestfs-actions.pod:2410
26435 msgid "guestfs_get_e2label"
26439 #: ../src/guestfs-actions.pod:2412
26443 " guestfs_get_e2label (guestfs_h *g,\n"
26444 " const char *device);\n"
26449 #: ../src/guestfs-actions.pod:2416
26451 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
26456 #: ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:2450 ../src/guestfs-actions.pod:6720 ../src/guestfs-actions.pod:6739
26457 msgid "(Added in 1.0.15)"
26461 #: ../src/guestfs-actions.pod:2431
26462 msgid "guestfs_get_e2uuid"
26466 #: ../src/guestfs-actions.pod:2433
26470 " guestfs_get_e2uuid (guestfs_h *g,\n"
26471 " const char *device);\n"
26476 #: ../src/guestfs-actions.pod:2437
26478 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
26483 #: ../src/guestfs-actions.pod:2452
26484 msgid "guestfs_get_memsize"
26488 #: ../src/guestfs-actions.pod:2454
26492 " guestfs_get_memsize (guestfs_h *g);\n"
26497 #: ../src/guestfs-actions.pod:2460
26499 "If C<guestfs_set_memsize> was not called on this handle, and if "
26500 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
26501 "value for memsize."
26505 #: ../src/guestfs-actions.pod:2469 ../src/guestfs-actions.pod:5048 ../src/guestfs-actions.pod:5257 ../src/guestfs-actions.pod:5276 ../src/guestfs-actions.pod:5295 ../src/guestfs-actions.pod:5307 ../src/guestfs-actions.pod:5324 ../src/guestfs-actions.pod:5337 ../src/guestfs-actions.pod:6377 ../src/guestfs-actions.pod:6760 ../src/guestfs-actions.pod:7050 ../src/guestfs-actions.pod:7662
26506 msgid "(Added in 1.0.55)"
26510 #: ../src/guestfs-actions.pod:2471
26511 msgid "guestfs_get_network"
26515 #: ../src/guestfs-actions.pod:2473
26519 " guestfs_get_network (guestfs_h *g);\n"
26524 #: ../src/guestfs-actions.pod:2480 ../src/guestfs-actions.pod:6779
26525 msgid "(Added in 1.5.4)"
26529 #: ../src/guestfs-actions.pod:2482
26530 msgid "guestfs_get_path"
26534 #: ../src/guestfs-actions.pod:2484
26538 " guestfs_get_path (guestfs_h *g);\n"
26543 #: ../src/guestfs-actions.pod:2492 ../src/guestfs-actions.pod:2532
26545 "This function returns a string, or NULL on error. The string is owned by "
26546 "the guest handle and must I<not> be freed."
26550 #: ../src/guestfs-actions.pod:2497
26551 msgid "guestfs_get_pgroup"
26555 #: ../src/guestfs-actions.pod:2499
26559 " guestfs_get_pgroup (guestfs_h *g);\n"
26564 #: ../src/guestfs-actions.pod:2506 ../src/guestfs-actions.pod:6815 ../src/guestfs-actions.pod:8154
26565 msgid "(Added in 1.11.18)"
26569 #: ../src/guestfs-actions.pod:2508
26570 msgid "guestfs_get_pid"
26574 #: ../src/guestfs-actions.pod:2510
26578 " guestfs_get_pid (guestfs_h *g);\n"
26583 #: ../src/guestfs-actions.pod:2520
26584 msgid "(Added in 1.0.56)"
26588 #: ../src/guestfs-actions.pod:2522
26589 msgid "guestfs_get_qemu"
26593 #: ../src/guestfs-actions.pod:2524
26597 " guestfs_get_qemu (guestfs_h *g);\n"
26602 #: ../src/guestfs-actions.pod:2535 ../src/guestfs-actions.pod:6843
26603 msgid "(Added in 1.0.6)"
26607 #: ../src/guestfs-actions.pod:2537
26608 msgid "guestfs_get_recovery_proc"
26612 #: ../src/guestfs-actions.pod:2539
26616 " guestfs_get_recovery_proc (guestfs_h *g);\n"
26621 #: ../src/guestfs-actions.pod:2546 ../src/guestfs-actions.pod:4130 ../src/guestfs-actions.pod:4461 ../src/guestfs-actions.pod:4855 ../src/guestfs-actions.pod:4887 ../src/guestfs-actions.pod:6082 ../src/guestfs-actions.pod:6425 ../src/guestfs-actions.pod:6867 ../src/guestfs-actions.pod:7565 ../src/guestfs-actions.pod:7585 ../src/guestfs-actions.pod:7777
26622 msgid "(Added in 1.0.77)"
26626 #: ../src/guestfs-actions.pod:2548
26627 msgid "guestfs_get_selinux"
26631 #: ../src/guestfs-actions.pod:2550
26635 " guestfs_get_selinux (guestfs_h *g);\n"
26640 #: ../src/guestfs-actions.pod:2553
26642 "This returns the current setting of the selinux flag which is passed to the "
26643 "appliance at boot time. See C<guestfs_set_selinux>."
26647 #: ../src/guestfs-actions.pod:2561 ../src/guestfs-actions.pod:2635 ../src/guestfs-actions.pod:6886 ../src/guestfs-actions.pod:6960
26648 msgid "(Added in 1.0.67)"
26652 #: ../src/guestfs-actions.pod:2563
26653 msgid "guestfs_get_smp"
26657 #: ../src/guestfs-actions.pod:2565
26661 " guestfs_get_smp (guestfs_h *g);\n"
26666 #: ../src/guestfs-actions.pod:2574
26667 msgid "guestfs_get_state"
26671 #: ../src/guestfs-actions.pod:2576
26675 " guestfs_get_state (guestfs_h *g);\n"
26680 #: ../src/guestfs-actions.pod:2588
26681 msgid "guestfs_get_trace"
26685 #: ../src/guestfs-actions.pod:2590
26689 " guestfs_get_trace (guestfs_h *g);\n"
26694 #: ../src/guestfs-actions.pod:2599
26695 msgid "guestfs_get_umask"
26699 #: ../src/guestfs-actions.pod:2601
26703 " guestfs_get_umask (guestfs_h *g);\n"
26708 #: ../src/guestfs-actions.pod:2604
26710 "Return the current umask. By default the umask is C<022> unless it has been "
26711 "set by calling C<guestfs_umask>."
26715 #: ../src/guestfs-actions.pod:2611
26716 msgid "guestfs_get_verbose"
26720 #: ../src/guestfs-actions.pod:2613
26724 " guestfs_get_verbose (guestfs_h *g);\n"
26729 #: ../src/guestfs-actions.pod:2622
26730 msgid "guestfs_getcon"
26734 #: ../src/guestfs-actions.pod:2624
26738 " guestfs_getcon (guestfs_h *g);\n"
26743 #: ../src/guestfs-actions.pod:2629
26744 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
26748 #: ../src/guestfs-actions.pod:2637
26749 msgid "guestfs_getxattr"
26753 #: ../src/guestfs-actions.pod:2639
26757 " guestfs_getxattr (guestfs_h *g,\n"
26758 " const char *path,\n"
26759 " const char *name,\n"
26760 " size_t *size_r);\n"
26765 #: ../src/guestfs-actions.pod:2645
26767 "Get a single extended attribute from file C<path> named C<name>. This call "
26768 "follows symlinks. If you want to lookup an extended attribute for the "
26769 "symlink itself, use C<guestfs_lgetxattr>."
26773 #: ../src/guestfs-actions.pod:2649 ../src/guestfs-actions.pod:4144
26775 "Normally it is better to get all extended attributes from a file in one go "
26776 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
26777 "implementations are buggy and do not provide a way to list out attributes. "
26778 "For these filesystems (notably ntfs-3g) you have to know the names of the "
26779 "extended attributes you want in advance and call this function."
26783 #: ../src/guestfs-actions.pod:2659
26784 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
26788 #: ../src/guestfs-actions.pod:2661 ../src/guestfs-actions.pod:2874 ../src/guestfs-actions.pod:3356 ../src/guestfs-actions.pod:4156 ../src/guestfs-actions.pod:6075 ../src/guestfs-actions.pod:6101 ../src/guestfs-actions.pod:6282
26790 "This function returns a buffer, or NULL on error. The size of the returned "
26791 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
26796 #: ../src/guestfs-actions.pod:2665 ../src/guestfs-actions.pod:4160
26797 msgid "(Added in 1.7.24)"
26801 #: ../src/guestfs-actions.pod:2667
26802 msgid "guestfs_getxattrs"
26806 #: ../src/guestfs-actions.pod:2669
26809 " struct guestfs_xattr_list *\n"
26810 " guestfs_getxattrs (guestfs_h *g,\n"
26811 " const char *path);\n"
26816 #: ../src/guestfs-actions.pod:2679
26817 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
26821 #: ../src/guestfs-actions.pod:2681 ../src/guestfs-actions.pod:4172 ../src/guestfs-actions.pod:4851
26823 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
26824 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
26828 #: ../src/guestfs-actions.pod:2685 ../src/guestfs-actions.pod:4176 ../src/guestfs-actions.pod:4375 ../src/guestfs-actions.pod:4411 ../src/guestfs-actions.pod:6455 ../src/guestfs-actions.pod:6979 ../src/guestfs-actions.pod:8362
26829 msgid "(Added in 1.0.59)"
26833 #: ../src/guestfs-actions.pod:2687
26834 msgid "guestfs_glob_expand"
26838 #: ../src/guestfs-actions.pod:2689
26842 " guestfs_glob_expand (guestfs_h *g,\n"
26843 " const char *pattern);\n"
26848 #: ../src/guestfs-actions.pod:2708 ../src/guestfs-actions.pod:7163 ../src/guestfs-actions.pod:7180
26849 msgid "(Added in 1.0.50)"
26853 #: ../src/guestfs-actions.pod:2710
26854 msgid "guestfs_grep"
26858 #: ../src/guestfs-actions.pod:2712
26862 " guestfs_grep (guestfs_h *g,\n"
26863 " const char *regex,\n"
26864 " const char *path);\n"
26869 #: ../src/guestfs-actions.pod:2729
26870 msgid "guestfs_grepi"
26874 #: ../src/guestfs-actions.pod:2731
26878 " guestfs_grepi (guestfs_h *g,\n"
26879 " const char *regex,\n"
26880 " const char *path);\n"
26885 #: ../src/guestfs-actions.pod:2748
26886 msgid "guestfs_grub_install"
26890 #: ../src/guestfs-actions.pod:2750
26894 " guestfs_grub_install (guestfs_h *g,\n"
26895 " const char *root,\n"
26896 " const char *device);\n"
26901 #: ../src/guestfs-actions.pod:2793
26902 msgid "(Added in 1.0.17)"
26906 #: ../src/guestfs-actions.pod:2795
26907 msgid "guestfs_head"
26911 #: ../src/guestfs-actions.pod:2797
26915 " guestfs_head (guestfs_h *g,\n"
26916 " const char *path);\n"
26921 #: ../src/guestfs-actions.pod:2813
26922 msgid "guestfs_head_n"
26926 #: ../src/guestfs-actions.pod:2815
26930 " guestfs_head_n (guestfs_h *g,\n"
26932 " const char *path);\n"
26937 #: ../src/guestfs-actions.pod:2837
26938 msgid "guestfs_hexdump"
26942 #: ../src/guestfs-actions.pod:2839
26946 " guestfs_hexdump (guestfs_h *g,\n"
26947 " const char *path);\n"
26952 #: ../src/guestfs-actions.pod:2852 ../src/guestfs-actions.pod:7244 ../src/guestfs-actions.pod:7299
26953 msgid "(Added in 1.0.22)"
26957 #: ../src/guestfs-actions.pod:2854
26958 msgid "guestfs_initrd_cat"
26962 #: ../src/guestfs-actions.pod:2856
26966 " guestfs_initrd_cat (guestfs_h *g,\n"
26967 " const char *initrdpath,\n"
26968 " const char *filename,\n"
26969 " size_t *size_r);\n"
26974 #: ../src/guestfs-actions.pod:2872
26975 msgid "See also C<guestfs_initrd_list>."
26979 #: ../src/guestfs-actions.pod:2883
26980 msgid "guestfs_initrd_list"
26984 #: ../src/guestfs-actions.pod:2885
26988 " guestfs_initrd_list (guestfs_h *g,\n"
26989 " const char *path);\n"
26994 #: ../src/guestfs-actions.pod:2905
26995 msgid "guestfs_inotify_add_watch"
26999 #: ../src/guestfs-actions.pod:2907
27003 " guestfs_inotify_add_watch (guestfs_h *g,\n"
27004 " const char *path,\n"
27010 #: ../src/guestfs-actions.pod:2926
27011 msgid "guestfs_inotify_close"
27015 #: ../src/guestfs-actions.pod:2928
27019 " guestfs_inotify_close (guestfs_h *g);\n"
27024 #: ../src/guestfs-actions.pod:2939
27025 msgid "guestfs_inotify_files"
27029 #: ../src/guestfs-actions.pod:2941
27033 " guestfs_inotify_files (guestfs_h *g);\n"
27038 #: ../src/guestfs-actions.pod:2944
27040 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
27041 "returns a list of pathnames of objects that were touched. The returned "
27042 "pathnames are sorted and deduplicated."
27046 #: ../src/guestfs-actions.pod:2954
27047 msgid "guestfs_inotify_init"
27051 #: ../src/guestfs-actions.pod:2956
27055 " guestfs_inotify_init (guestfs_h *g,\n"
27056 " int maxevents);\n"
27061 #: ../src/guestfs-actions.pod:2964
27063 "C<maxevents> is the maximum number of events which will be queued up between "
27064 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
27065 "passed as C<0>, then the kernel (or previously set) default is used. For "
27066 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
27067 "throws away events, but records the fact that it threw them away by setting "
27068 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
27069 "C<guestfs_inotify_read>)."
27073 #: ../src/guestfs-actions.pod:2974
27075 "Before any events are generated, you have to add some watches to the "
27076 "internal watch list. See: C<guestfs_inotify_add_watch>, "
27077 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
27081 #: ../src/guestfs-actions.pod:2980
27083 "Queued up events should be read periodically by calling "
27084 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
27085 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
27086 "often enough then you risk the internal queue overflowing."
27090 #: ../src/guestfs-actions.pod:2987
27092 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
27093 "This also removes any watches automatically."
27097 #: ../src/guestfs-actions.pod:3000
27098 msgid "guestfs_inotify_read"
27102 #: ../src/guestfs-actions.pod:3002
27105 " struct guestfs_inotify_event_list *\n"
27106 " guestfs_inotify_read (guestfs_h *g);\n"
27111 #: ../src/guestfs-actions.pod:3016
27113 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
27114 "there was an error. I<The caller must call "
27115 "C<guestfs_free_inotify_event_list> after use>."
27119 #: ../src/guestfs-actions.pod:3022
27120 msgid "guestfs_inotify_rm_watch"
27124 #: ../src/guestfs-actions.pod:3024
27128 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
27134 #: ../src/guestfs-actions.pod:3028
27136 "Remove a previously defined inotify watch. See "
27137 "C<guestfs_inotify_add_watch>."
27141 #: ../src/guestfs-actions.pod:3035
27142 msgid "guestfs_inspect_get_arch"
27146 #: ../src/guestfs-actions.pod:3037
27150 " guestfs_inspect_get_arch (guestfs_h *g,\n"
27151 " const char *root);\n"
27156 #: ../src/guestfs-actions.pod:3041
27158 "This returns the architecture of the inspected operating system. The "
27159 "possible return values are listed under C<guestfs_file_architecture>."
27163 #: ../src/guestfs-actions.pod:3055
27164 msgid "guestfs_inspect_get_distro"
27168 #: ../src/guestfs-actions.pod:3057
27172 " guestfs_inspect_get_distro (guestfs_h *g,\n"
27173 " const char *root);\n"
27178 #: ../src/guestfs-actions.pod:3157
27179 msgid "guestfs_inspect_get_drive_mappings"
27183 #: ../src/guestfs-actions.pod:3159
27187 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
27188 " const char *root);\n"
27193 #: ../src/guestfs-actions.pod:3188
27195 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27196 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
27200 #: ../src/guestfs-actions.pod:3192 ../src/guestfs-actions.pod:3460 ../src/guestfs-actions.pod:4263 ../src/guestfs-actions.pod:5526 ../src/guestfs-actions.pod:7601
27202 "This function returns a NULL-terminated array of strings, or NULL if there "
27203 "was an error. The array of strings will always have length C<2n+1>, where "
27204 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
27205 "caller must free the strings and the array after use>."
27209 #: ../src/guestfs-actions.pod:3198 ../src/guestfs-actions.pod:3659
27210 msgid "(Added in 1.9.17)"
27214 #: ../src/guestfs-actions.pod:3200
27215 msgid "guestfs_inspect_get_filesystems"
27219 #: ../src/guestfs-actions.pod:3202
27223 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
27224 " const char *root);\n"
27229 #: ../src/guestfs-actions.pod:3214
27231 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27232 "C<guestfs_inspect_get_mountpoints>."
27236 #: ../src/guestfs-actions.pod:3223
27237 msgid "guestfs_inspect_get_format"
27241 #: ../src/guestfs-actions.pod:3225
27245 " guestfs_inspect_get_format (guestfs_h *g,\n"
27246 " const char *root);\n"
27251 #: ../src/guestfs-actions.pod:3259 ../src/guestfs-actions.pod:3695 ../src/guestfs-actions.pod:3711 ../src/guestfs-actions.pod:3729 ../src/guestfs-actions.pod:6493
27252 msgid "(Added in 1.9.4)"
27256 #: ../src/guestfs-actions.pod:3261
27257 msgid "guestfs_inspect_get_hostname"
27261 #: ../src/guestfs-actions.pod:3263
27265 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
27266 " const char *root);\n"
27271 #: ../src/guestfs-actions.pod:3278
27272 msgid "(Added in 1.7.9)"
27276 #: ../src/guestfs-actions.pod:3280
27277 msgid "guestfs_inspect_get_icon"
27281 #: ../src/guestfs-actions.pod:3282
27285 " guestfs_inspect_get_icon (guestfs_h *g,\n"
27286 " const char *root,\n"
27287 " size_t *size_r,\n"
27293 #: ../src/guestfs-actions.pod:3293
27296 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
27297 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
27302 #: ../src/guestfs-actions.pod:3360 ../src/guestfs-actions.pod:4190 ../src/guestfs-actions.pod:5425
27303 msgid "(Added in 1.11.12)"
27307 #: ../src/guestfs-actions.pod:3362
27308 msgid "guestfs_inspect_get_icon_va"
27312 #: ../src/guestfs-actions.pod:3364
27316 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
27317 " const char *root,\n"
27318 " size_t *size_r,\n"
27319 " va_list args);\n"
27324 #: ../src/guestfs-actions.pod:3370
27325 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
27329 #: ../src/guestfs-actions.pod:3374
27330 msgid "guestfs_inspect_get_icon_argv"
27334 #: ../src/guestfs-actions.pod:3376
27338 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
27339 " const char *root,\n"
27340 " size_t *size_r,\n"
27341 " const struct guestfs_inspect_get_icon_argv "
27347 #: ../src/guestfs-actions.pod:3382
27348 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
27352 #: ../src/guestfs-actions.pod:3386
27353 msgid "guestfs_inspect_get_major_version"
27357 #: ../src/guestfs-actions.pod:3388
27361 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
27362 " const char *root);\n"
27367 #: ../src/guestfs-actions.pod:3410
27368 msgid "guestfs_inspect_get_minor_version"
27372 #: ../src/guestfs-actions.pod:3412
27376 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
27377 " const char *root);\n"
27382 #: ../src/guestfs-actions.pod:3421
27384 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27385 "C<guestfs_inspect_get_major_version>."
27389 #: ../src/guestfs-actions.pod:3428
27390 msgid "guestfs_inspect_get_mountpoints"
27394 #: ../src/guestfs-actions.pod:3430
27398 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
27399 " const char *root);\n"
27404 #: ../src/guestfs-actions.pod:3451
27406 "For operating systems like Windows which still use drive letters, this call "
27407 "will only return an entry for the first drive \"mounted on\" C</>. For "
27408 "information about the mapping of drive letters to partitions, see "
27409 "C<guestfs_inspect_get_drive_mappings>."
27413 #: ../src/guestfs-actions.pod:3457
27415 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27416 "C<guestfs_inspect_get_filesystems>."
27420 #: ../src/guestfs-actions.pod:3468
27421 msgid "guestfs_inspect_get_package_format"
27425 #: ../src/guestfs-actions.pod:3470
27429 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
27430 " const char *root);\n"
27435 #: ../src/guestfs-actions.pod:3474
27437 "This function and C<guestfs_inspect_get_package_management> return the "
27438 "package format and package management tool used by the inspected operating "
27439 "system. For example for Fedora these functions would return C<rpm> (package "
27440 "format) and C<yum> (package management)."
27444 #: ../src/guestfs-actions.pod:3493 ../src/guestfs-actions.pod:3521
27445 msgid "(Added in 1.7.5)"
27449 #: ../src/guestfs-actions.pod:3495
27450 msgid "guestfs_inspect_get_package_management"
27454 #: ../src/guestfs-actions.pod:3497
27458 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
27459 " const char *root);\n"
27464 #: ../src/guestfs-actions.pod:3501
27466 "C<guestfs_inspect_get_package_format> and this function return the package "
27467 "format and package management tool used by the inspected operating system. "
27468 "For example for Fedora these functions would return C<rpm> (package format) "
27469 "and C<yum> (package management)."
27473 #: ../src/guestfs-actions.pod:3523
27474 msgid "guestfs_inspect_get_product_name"
27478 #: ../src/guestfs-actions.pod:3525
27482 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
27483 " const char *root);\n"
27488 #: ../src/guestfs-actions.pod:3544
27489 msgid "guestfs_inspect_get_product_variant"
27493 #: ../src/guestfs-actions.pod:3546
27497 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
27498 " const char *root);\n"
27503 #: ../src/guestfs-actions.pod:3569
27505 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
27506 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
27510 #: ../src/guestfs-actions.pod:3576
27511 msgid "(Added in 1.9.13)"
27515 #: ../src/guestfs-actions.pod:3578
27516 msgid "guestfs_inspect_get_roots"
27520 #: ../src/guestfs-actions.pod:3580
27524 " guestfs_inspect_get_roots (guestfs_h *g);\n"
27529 #: ../src/guestfs-actions.pod:3583
27531 "This function is a convenient way to get the list of root devices, as "
27532 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
27533 "the whole inspection process."
27537 #: ../src/guestfs-actions.pod:3587
27539 "This returns an empty list if either no root devices were found or the "
27540 "caller has not called C<guestfs_inspect_os>."
27544 #: ../src/guestfs-actions.pod:3596
27545 msgid "(Added in 1.7.3)"
27549 #: ../src/guestfs-actions.pod:3598
27550 msgid "guestfs_inspect_get_type"
27554 #: ../src/guestfs-actions.pod:3600
27558 " guestfs_inspect_get_type (guestfs_h *g,\n"
27559 " const char *root);\n"
27564 #: ../src/guestfs-actions.pod:3641
27565 msgid "guestfs_inspect_get_windows_current_control_set"
27569 #: ../src/guestfs-actions.pod:3643
27573 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
27574 " const char *root);\n"
27579 #: ../src/guestfs-actions.pod:3661
27580 msgid "guestfs_inspect_get_windows_systemroot"
27584 #: ../src/guestfs-actions.pod:3663
27588 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
27589 " const char *root);\n"
27594 #: ../src/guestfs-actions.pod:3679
27595 msgid "(Added in 1.5.25)"
27599 #: ../src/guestfs-actions.pod:3681
27600 msgid "guestfs_inspect_is_live"
27604 #: ../src/guestfs-actions.pod:3683
27608 " guestfs_inspect_is_live (guestfs_h *g,\n"
27609 " const char *root);\n"
27614 #: ../src/guestfs-actions.pod:3687
27616 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27617 "disk), then this returns true if a live image was detected on the disk."
27621 #: ../src/guestfs-actions.pod:3697
27622 msgid "guestfs_inspect_is_multipart"
27626 #: ../src/guestfs-actions.pod:3699
27630 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
27631 " const char *root);\n"
27636 #: ../src/guestfs-actions.pod:3703
27638 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27639 "disk), then this returns true if the disk is part of a set."
27643 #: ../src/guestfs-actions.pod:3713
27644 msgid "guestfs_inspect_is_netinst"
27648 #: ../src/guestfs-actions.pod:3715
27652 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
27653 " const char *root);\n"
27658 #: ../src/guestfs-actions.pod:3719
27660 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27661 "disk), then this returns true if the disk is a network installer, ie. not a "
27662 "self-contained install CD but one which is likely to require network access "
27663 "to complete the install."
27667 #: ../src/guestfs-actions.pod:3731
27668 msgid "guestfs_inspect_list_applications"
27672 #: ../src/guestfs-actions.pod:3733
27675 " struct guestfs_application_list *\n"
27676 " guestfs_inspect_list_applications (guestfs_h *g,\n"
27677 " const char *root);\n"
27682 #: ../src/guestfs-actions.pod:3739
27684 "I<Note:> This call works differently from other parts of the inspection "
27685 "API. You have to call C<guestfs_inspect_os>, then "
27686 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
27687 "this. Listing applications is a significantly more difficult operation "
27688 "which requires access to the full filesystem. Also note that unlike the "
27689 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
27690 "the libguestfs handle, this call actually reads parts of the mounted "
27691 "filesystems during the call."
27695 #: ../src/guestfs-actions.pod:3829
27697 "This function returns a C<struct guestfs_application_list *>, or NULL if "
27698 "there was an error. I<The caller must call C<guestfs_free_application_list> "
27703 #: ../src/guestfs-actions.pod:3833
27704 msgid "(Added in 1.7.8)"
27708 #: ../src/guestfs-actions.pod:3835
27709 msgid "guestfs_inspect_os"
27713 #: ../src/guestfs-actions.pod:3837
27717 " guestfs_inspect_os (guestfs_h *g);\n"
27722 #: ../src/guestfs-actions.pod:3853
27724 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
27725 "functions in order to query further information about each operating system, "
27726 "such as the name and version."
27730 #: ../src/guestfs-actions.pod:3858
27732 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
27733 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
27734 "the contents. This should be called with no disks currently mounted. The "
27735 "function may also use Augeas, so any existing Augeas handle will be closed."
27739 #: ../src/guestfs-actions.pod:3870 ../src/guestfs-actions.pod:4201 ../src/guestfs-actions.pod:4283
27740 msgid "See also C<guestfs_list_filesystems>."
27744 #: ../src/guestfs-actions.pod:3878
27745 msgid "guestfs_is_blockdev"
27749 #: ../src/guestfs-actions.pod:3880
27753 " guestfs_is_blockdev (guestfs_h *g,\n"
27754 " const char *path);\n"
27759 #: ../src/guestfs-actions.pod:3887 ../src/guestfs-actions.pod:3916 ../src/guestfs-actions.pod:3946 ../src/guestfs-actions.pod:3961 ../src/guestfs-actions.pod:3977 ../src/guestfs-actions.pod:4033 ../src/guestfs-actions.pod:4048
27760 msgid "See also C<guestfs_stat>."
27764 #: ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:3920 ../src/guestfs-actions.pod:3965 ../src/guestfs-actions.pod:4037 ../src/guestfs-actions.pod:4052
27765 msgid "(Added in 1.5.10)"
27769 #: ../src/guestfs-actions.pod:3893
27770 msgid "guestfs_is_busy"
27774 #: ../src/guestfs-actions.pod:3895
27778 " guestfs_is_busy (guestfs_h *g);\n"
27783 #: ../src/guestfs-actions.pod:3907
27784 msgid "guestfs_is_chardev"
27788 #: ../src/guestfs-actions.pod:3909
27792 " guestfs_is_chardev (guestfs_h *g,\n"
27793 " const char *path);\n"
27798 #: ../src/guestfs-actions.pod:3922
27799 msgid "guestfs_is_config"
27803 #: ../src/guestfs-actions.pod:3924
27807 " guestfs_is_config (guestfs_h *g);\n"
27812 #: ../src/guestfs-actions.pod:3936
27813 msgid "guestfs_is_dir"
27817 #: ../src/guestfs-actions.pod:3938
27821 " guestfs_is_dir (guestfs_h *g,\n"
27822 " const char *path);\n"
27827 #: ../src/guestfs-actions.pod:3952
27828 msgid "guestfs_is_fifo"
27832 #: ../src/guestfs-actions.pod:3954
27836 " guestfs_is_fifo (guestfs_h *g,\n"
27837 " const char *path);\n"
27842 #: ../src/guestfs-actions.pod:3967
27843 msgid "guestfs_is_file"
27847 #: ../src/guestfs-actions.pod:3969
27851 " guestfs_is_file (guestfs_h *g,\n"
27852 " const char *path);\n"
27857 #: ../src/guestfs-actions.pod:3983
27858 msgid "guestfs_is_launching"
27862 #: ../src/guestfs-actions.pod:3985
27866 " guestfs_is_launching (guestfs_h *g);\n"
27871 #: ../src/guestfs-actions.pod:3997
27872 msgid "guestfs_is_lv"
27876 #: ../src/guestfs-actions.pod:3999
27880 " guestfs_is_lv (guestfs_h *g,\n"
27881 " const char *device);\n"
27886 #: ../src/guestfs-actions.pod:4010
27887 msgid "guestfs_is_ready"
27891 #: ../src/guestfs-actions.pod:4012
27895 " guestfs_is_ready (guestfs_h *g);\n"
27900 #: ../src/guestfs-actions.pod:4024
27901 msgid "guestfs_is_socket"
27905 #: ../src/guestfs-actions.pod:4026
27909 " guestfs_is_socket (guestfs_h *g,\n"
27910 " const char *path);\n"
27915 #: ../src/guestfs-actions.pod:4039
27916 msgid "guestfs_is_symlink"
27920 #: ../src/guestfs-actions.pod:4041
27924 " guestfs_is_symlink (guestfs_h *g,\n"
27925 " const char *path);\n"
27930 #: ../src/guestfs-actions.pod:4054
27931 msgid "guestfs_is_zero"
27935 #: ../src/guestfs-actions.pod:4056
27939 " guestfs_is_zero (guestfs_h *g,\n"
27940 " const char *path);\n"
27945 #: ../src/guestfs-actions.pod:4065 ../src/guestfs-actions.pod:4079
27946 msgid "(Added in 1.11.8)"
27950 #: ../src/guestfs-actions.pod:4067
27951 msgid "guestfs_is_zero_device"
27955 #: ../src/guestfs-actions.pod:4069
27959 " guestfs_is_zero_device (guestfs_h *g,\n"
27960 " const char *device);\n"
27965 #: ../src/guestfs-actions.pod:4081
27966 msgid "guestfs_kill_subprocess"
27970 #: ../src/guestfs-actions.pod:4083
27974 " guestfs_kill_subprocess (guestfs_h *g);\n"
27979 #: ../src/guestfs-actions.pod:4092
27980 msgid "guestfs_launch"
27984 #: ../src/guestfs-actions.pod:4094
27988 " guestfs_launch (guestfs_h *g);\n"
27993 #: ../src/guestfs-actions.pod:4112
27994 msgid "guestfs_lchown"
27998 #: ../src/guestfs-actions.pod:4114
28002 " guestfs_lchown (guestfs_h *g,\n"
28005 " const char *path);\n"
28010 #: ../src/guestfs-actions.pod:4120
28012 "Change the file owner to C<owner> and group to C<group>. This is like "
28013 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
28014 "changed, not the target."
28018 #: ../src/guestfs-actions.pod:4132
28019 msgid "guestfs_lgetxattr"
28023 #: ../src/guestfs-actions.pod:4134
28027 " guestfs_lgetxattr (guestfs_h *g,\n"
28028 " const char *path,\n"
28029 " const char *name,\n"
28030 " size_t *size_r);\n"
28035 #: ../src/guestfs-actions.pod:4154
28036 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
28040 #: ../src/guestfs-actions.pod:4162
28041 msgid "guestfs_lgetxattrs"
28045 #: ../src/guestfs-actions.pod:4164
28048 " struct guestfs_xattr_list *\n"
28049 " guestfs_lgetxattrs (guestfs_h *g,\n"
28050 " const char *path);\n"
28055 #: ../src/guestfs-actions.pod:4168
28057 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
28058 "then it returns the extended attributes of the link itself."
28062 #: ../src/guestfs-actions.pod:4178
28063 msgid "guestfs_list_9p"
28067 #: ../src/guestfs-actions.pod:4180
28071 " guestfs_list_9p (guestfs_h *g);\n"
28076 #: ../src/guestfs-actions.pod:4192
28077 msgid "guestfs_list_devices"
28081 #: ../src/guestfs-actions.pod:4194
28085 " guestfs_list_devices (guestfs_h *g);\n"
28090 #: ../src/guestfs-actions.pod:4209
28091 msgid "guestfs_list_dm_devices"
28095 #: ../src/guestfs-actions.pod:4211
28099 " guestfs_list_dm_devices (guestfs_h *g);\n"
28104 #: ../src/guestfs-actions.pod:4216
28106 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
28107 "previous call to C<guestfs_luks_open>."
28111 #: ../src/guestfs-actions.pod:4219
28113 "Device mapper devices which correspond to logical volumes are I<not> "
28114 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
28119 #: ../src/guestfs-actions.pod:4227 ../src/guestfs-actions.pod:5664
28120 msgid "(Added in 1.11.15)"
28124 #: ../src/guestfs-actions.pod:4229
28125 msgid "guestfs_list_filesystems"
28129 #: ../src/guestfs-actions.pod:4231
28133 " guestfs_list_filesystems (guestfs_h *g);\n"
28138 #: ../src/guestfs-actions.pod:4251
28140 "This command runs other libguestfs commands, which might include "
28141 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
28142 "soon after launch and only when nothing is mounted."
28146 #: ../src/guestfs-actions.pod:4255
28148 "Not all of the filesystems returned will be mountable. In particular, swap "
28149 "partitions are returned in the list. Also this command does not check that "
28150 "each filesystem found is valid and mountable, and some filesystems might be "
28151 "mountable but require special options. Filesystems may not all belong to a "
28152 "single logical operating system (use C<guestfs_inspect_os> to look for "
28157 #: ../src/guestfs-actions.pod:4269 ../src/guestfs-actions.pod:6024
28158 msgid "(Added in 1.5.15)"
28162 #: ../src/guestfs-actions.pod:4271
28163 msgid "guestfs_list_partitions"
28167 #: ../src/guestfs-actions.pod:4273
28171 " guestfs_list_partitions (guestfs_h *g);\n"
28176 #: ../src/guestfs-actions.pod:4280
28178 "This does not return logical volumes. For that you will need to call "
28183 #: ../src/guestfs-actions.pod:4291
28188 #: ../src/guestfs-actions.pod:4293
28192 " guestfs_ll (guestfs_h *g,\n"
28193 " const char *directory);\n"
28198 #: ../src/guestfs-actions.pod:4308
28203 #: ../src/guestfs-actions.pod:4310
28207 " guestfs_ln (guestfs_h *g,\n"
28208 " const char *target,\n"
28209 " const char *linkname);\n"
28214 #: ../src/guestfs-actions.pod:4321
28215 msgid "guestfs_ln_f"
28219 #: ../src/guestfs-actions.pod:4323
28223 " guestfs_ln_f (guestfs_h *g,\n"
28224 " const char *target,\n"
28225 " const char *linkname);\n"
28230 #: ../src/guestfs-actions.pod:4335
28231 msgid "guestfs_ln_s"
28235 #: ../src/guestfs-actions.pod:4337
28239 " guestfs_ln_s (guestfs_h *g,\n"
28240 " const char *target,\n"
28241 " const char *linkname);\n"
28246 #: ../src/guestfs-actions.pod:4348
28247 msgid "guestfs_ln_sf"
28251 #: ../src/guestfs-actions.pod:4350
28255 " guestfs_ln_sf (guestfs_h *g,\n"
28256 " const char *target,\n"
28257 " const char *linkname);\n"
28262 #: ../src/guestfs-actions.pod:4362
28263 msgid "guestfs_lremovexattr"
28267 #: ../src/guestfs-actions.pod:4364
28271 " guestfs_lremovexattr (guestfs_h *g,\n"
28272 " const char *xattr,\n"
28273 " const char *path);\n"
28278 #: ../src/guestfs-actions.pod:4369
28280 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
28281 "link, then it removes an extended attribute of the link itself."
28285 #: ../src/guestfs-actions.pod:4377
28290 #: ../src/guestfs-actions.pod:4379
28294 " guestfs_ls (guestfs_h *g,\n"
28295 " const char *directory);\n"
28300 #: ../src/guestfs-actions.pod:4387
28302 "This command is mostly useful for interactive sessions. Programs should "
28303 "probably use C<guestfs_readdir> instead."
28307 #: ../src/guestfs-actions.pod:4396
28308 msgid "guestfs_lsetxattr"
28312 #: ../src/guestfs-actions.pod:4398
28316 " guestfs_lsetxattr (guestfs_h *g,\n"
28317 " const char *xattr,\n"
28318 " const char *val,\n"
28320 " const char *path);\n"
28325 #: ../src/guestfs-actions.pod:4405
28327 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
28328 "then it sets an extended attribute of the link itself."
28332 #: ../src/guestfs-actions.pod:4413
28333 msgid "guestfs_lstat"
28337 #: ../src/guestfs-actions.pod:4415
28340 " struct guestfs_stat *\n"
28341 " guestfs_lstat (guestfs_h *g,\n"
28342 " const char *path);\n"
28347 #: ../src/guestfs-actions.pod:4421
28349 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
28350 "link, then the link is stat-ed, not the file it refers to."
28354 #: ../src/guestfs-actions.pod:4427 ../src/guestfs-actions.pod:7204
28356 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
28357 "error. I<The caller must call C<guestfs_free_stat> after use>."
28361 #: ../src/guestfs-actions.pod:4431 ../src/guestfs-actions.pod:7208 ../src/guestfs-actions.pod:7226 ../src/guestfs-actions.pod:7607
28362 msgid "(Added in 0.9.2)"
28366 #: ../src/guestfs-actions.pod:4433
28367 msgid "guestfs_lstatlist"
28371 #: ../src/guestfs-actions.pod:4435
28374 " struct guestfs_stat_list *\n"
28375 " guestfs_lstatlist (guestfs_h *g,\n"
28376 " const char *path,\n"
28377 " char *const *names);\n"
28382 #: ../src/guestfs-actions.pod:4440
28384 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
28385 "files, where all files are in the directory C<path>. C<names> is the list "
28386 "of files from this directory."
28390 #: ../src/guestfs-actions.pod:4449
28392 "This call is intended for programs that want to efficiently list a directory "
28393 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
28394 "for a similarly efficient call for getting extended attributes. Very long "
28395 "directory listings might cause the protocol message size to be exceeded, "
28396 "causing this call to fail. The caller must split up such requests into "
28397 "smaller groups of names."
28401 #: ../src/guestfs-actions.pod:4457
28403 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
28404 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
28408 #: ../src/guestfs-actions.pod:4463
28409 msgid "guestfs_luks_add_key"
28413 #: ../src/guestfs-actions.pod:4465
28417 " guestfs_luks_add_key (guestfs_h *g,\n"
28418 " const char *device,\n"
28419 " const char *key,\n"
28420 " const char *newkey,\n"
28426 #: ../src/guestfs-actions.pod:4477
28428 "Note that if C<keyslot> already contains a key, then this command will "
28429 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
28433 #: ../src/guestfs-actions.pod:4483 ../src/guestfs-actions.pod:4520 ../src/guestfs-actions.pod:4540 ../src/guestfs-actions.pod:4560 ../src/guestfs-actions.pod:4595 ../src/guestfs-actions.pod:4614
28435 "This function takes a key or passphrase parameter which could contain "
28436 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
28441 #: ../src/guestfs-actions.pod:4487 ../src/guestfs-actions.pod:4524 ../src/guestfs-actions.pod:4544 ../src/guestfs-actions.pod:4564
28442 msgid "(Added in 1.5.2)"
28446 #: ../src/guestfs-actions.pod:4489
28447 msgid "guestfs_luks_close"
28451 #: ../src/guestfs-actions.pod:4491
28455 " guestfs_luks_close (guestfs_h *g,\n"
28456 " const char *device);\n"
28461 #: ../src/guestfs-actions.pod:4495
28463 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
28464 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
28465 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
28466 "underlying block device."
28470 #: ../src/guestfs-actions.pod:4503 ../src/guestfs-actions.pod:4599 ../src/guestfs-actions.pod:4618 ../src/guestfs-actions.pod:4668 ../src/guestfs-actions.pod:4713
28471 msgid "(Added in 1.5.1)"
28475 #: ../src/guestfs-actions.pod:4505
28476 msgid "guestfs_luks_format"
28480 #: ../src/guestfs-actions.pod:4507
28484 " guestfs_luks_format (guestfs_h *g,\n"
28485 " const char *device,\n"
28486 " const char *key,\n"
28492 #: ../src/guestfs-actions.pod:4526
28493 msgid "guestfs_luks_format_cipher"
28497 #: ../src/guestfs-actions.pod:4528
28501 " guestfs_luks_format_cipher (guestfs_h *g,\n"
28502 " const char *device,\n"
28503 " const char *key,\n"
28505 " const char *cipher);\n"
28510 #: ../src/guestfs-actions.pod:4535
28512 "This command is the same as C<guestfs_luks_format> but it also allows you to "
28513 "set the C<cipher> used."
28517 #: ../src/guestfs-actions.pod:4546
28518 msgid "guestfs_luks_kill_slot"
28522 #: ../src/guestfs-actions.pod:4548
28526 " guestfs_luks_kill_slot (guestfs_h *g,\n"
28527 " const char *device,\n"
28528 " const char *key,\n"
28534 #: ../src/guestfs-actions.pod:4566
28535 msgid "guestfs_luks_open"
28539 #: ../src/guestfs-actions.pod:4568
28543 " guestfs_luks_open (guestfs_h *g,\n"
28544 " const char *device,\n"
28545 " const char *key,\n"
28546 " const char *mapname);\n"
28551 #: ../src/guestfs-actions.pod:4586
28553 "If this block device contains LVM volume groups, then calling "
28554 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
28559 #: ../src/guestfs-actions.pod:4590
28560 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
28564 #: ../src/guestfs-actions.pod:4601
28565 msgid "guestfs_luks_open_ro"
28569 #: ../src/guestfs-actions.pod:4603
28573 " guestfs_luks_open_ro (guestfs_h *g,\n"
28574 " const char *device,\n"
28575 " const char *key,\n"
28576 " const char *mapname);\n"
28581 #: ../src/guestfs-actions.pod:4609
28583 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
28588 #: ../src/guestfs-actions.pod:4620
28589 msgid "guestfs_lvcreate"
28593 #: ../src/guestfs-actions.pod:4622
28597 " guestfs_lvcreate (guestfs_h *g,\n"
28598 " const char *logvol,\n"
28599 " const char *volgroup,\n"
28605 #: ../src/guestfs-actions.pod:4635
28606 msgid "guestfs_lvm_canonical_lv_name"
28610 #: ../src/guestfs-actions.pod:4637
28614 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
28615 " const char *lvname);\n"
28620 #: ../src/guestfs-actions.pod:4648
28621 msgid "See also C<guestfs_is_lv>."
28625 #: ../src/guestfs-actions.pod:4653
28626 msgid "(Added in 1.5.24)"
28630 #: ../src/guestfs-actions.pod:4655
28631 msgid "guestfs_lvm_clear_filter"
28635 #: ../src/guestfs-actions.pod:4657
28639 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
28644 #: ../src/guestfs-actions.pod:4660
28646 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
28647 "see every block device."
28651 #: ../src/guestfs-actions.pod:4670
28652 msgid "guestfs_lvm_remove_all"
28656 #: ../src/guestfs-actions.pod:4672
28660 " guestfs_lvm_remove_all (guestfs_h *g);\n"
28665 #: ../src/guestfs-actions.pod:4682
28666 msgid "guestfs_lvm_set_filter"
28670 #: ../src/guestfs-actions.pod:4684
28674 " guestfs_lvm_set_filter (guestfs_h *g,\n"
28675 " char *const *devices);\n"
28680 #: ../src/guestfs-actions.pod:4715
28681 msgid "guestfs_lvremove"
28685 #: ../src/guestfs-actions.pod:4717
28689 " guestfs_lvremove (guestfs_h *g,\n"
28690 " const char *device);\n"
28695 #: ../src/guestfs-actions.pod:4729 ../src/guestfs-actions.pod:6139 ../src/guestfs-actions.pod:7977
28696 msgid "(Added in 1.0.13)"
28700 #: ../src/guestfs-actions.pod:4731
28701 msgid "guestfs_lvrename"
28705 #: ../src/guestfs-actions.pod:4733
28709 " guestfs_lvrename (guestfs_h *g,\n"
28710 " const char *logvol,\n"
28711 " const char *newlogvol);\n"
28716 #: ../src/guestfs-actions.pod:4742 ../src/guestfs-actions.pod:7990
28717 msgid "(Added in 1.0.83)"
28721 #: ../src/guestfs-actions.pod:4744
28722 msgid "guestfs_lvresize"
28726 #: ../src/guestfs-actions.pod:4746
28730 " guestfs_lvresize (guestfs_h *g,\n"
28731 " const char *device,\n"
28737 #: ../src/guestfs-actions.pod:4759
28738 msgid "guestfs_lvresize_free"
28742 #: ../src/guestfs-actions.pod:4761
28746 " guestfs_lvresize_free (guestfs_h *g,\n"
28747 " const char *lv,\n"
28753 #: ../src/guestfs-actions.pod:4774
28754 msgid "(Added in 1.3.3)"
28758 #: ../src/guestfs-actions.pod:4776
28759 msgid "guestfs_lvs"
28763 #: ../src/guestfs-actions.pod:4778
28767 " guestfs_lvs (guestfs_h *g);\n"
28772 #: ../src/guestfs-actions.pod:4787
28773 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
28777 #: ../src/guestfs-actions.pod:4795
28778 msgid "guestfs_lvs_full"
28782 #: ../src/guestfs-actions.pod:4797
28785 " struct guestfs_lvm_lv_list *\n"
28786 " guestfs_lvs_full (guestfs_h *g);\n"
28791 #: ../src/guestfs-actions.pod:4803
28793 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
28794 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
28799 #: ../src/guestfs-actions.pod:4809
28800 msgid "guestfs_lvuuid"
28804 #: ../src/guestfs-actions.pod:4811
28808 " guestfs_lvuuid (guestfs_h *g,\n"
28809 " const char *device);\n"
28814 #: ../src/guestfs-actions.pod:4822
28815 msgid "guestfs_lxattrlist"
28819 #: ../src/guestfs-actions.pod:4824
28822 " struct guestfs_xattr_list *\n"
28823 " guestfs_lxattrlist (guestfs_h *g,\n"
28824 " const char *path,\n"
28825 " char *const *names);\n"
28830 #: ../src/guestfs-actions.pod:4843
28832 "This call is intended for programs that want to efficiently list a directory "
28833 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
28834 "a similarly efficient call for getting standard stats. Very long directory "
28835 "listings might cause the protocol message size to be exceeded, causing this "
28836 "call to fail. The caller must split up such requests into smaller groups of "
28841 #: ../src/guestfs-actions.pod:4857
28842 msgid "guestfs_mkdir"
28846 #: ../src/guestfs-actions.pod:4859
28850 " guestfs_mkdir (guestfs_h *g,\n"
28851 " const char *path);\n"
28856 #: ../src/guestfs-actions.pod:4869
28857 msgid "guestfs_mkdir_mode"
28861 #: ../src/guestfs-actions.pod:4871
28865 " guestfs_mkdir_mode (guestfs_h *g,\n"
28866 " const char *path,\n"
28872 #: ../src/guestfs-actions.pod:4883
28873 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
28877 #: ../src/guestfs-actions.pod:4889
28878 msgid "guestfs_mkdir_p"
28882 #: ../src/guestfs-actions.pod:4891
28886 " guestfs_mkdir_p (guestfs_h *g,\n"
28887 " const char *path);\n"
28892 #: ../src/guestfs-actions.pod:4902
28893 msgid "guestfs_mkdtemp"
28897 #: ../src/guestfs-actions.pod:4904
28901 " guestfs_mkdtemp (guestfs_h *g,\n"
28902 " const char *template);\n"
28907 #: ../src/guestfs-actions.pod:4932
28908 msgid "guestfs_mke2fs_J"
28912 #: ../src/guestfs-actions.pod:4934
28916 " guestfs_mke2fs_J (guestfs_h *g,\n"
28917 " const char *fstype,\n"
28918 " int blocksize,\n"
28919 " const char *device,\n"
28920 " const char *journal);\n"
28925 #: ../src/guestfs-actions.pod:4947
28926 msgid "See also C<guestfs_mke2journal>."
28930 #: ../src/guestfs-actions.pod:4951 ../src/guestfs-actions.pod:4969 ../src/guestfs-actions.pod:4987 ../src/guestfs-actions.pod:5003 ../src/guestfs-actions.pod:5017 ../src/guestfs-actions.pod:5031 ../src/guestfs-actions.pod:5090 ../src/guestfs-actions.pod:5367
28931 msgid "(Added in 1.0.68)"
28935 #: ../src/guestfs-actions.pod:4953
28936 msgid "guestfs_mke2fs_JL"
28940 #: ../src/guestfs-actions.pod:4955
28944 " guestfs_mke2fs_JL (guestfs_h *g,\n"
28945 " const char *fstype,\n"
28946 " int blocksize,\n"
28947 " const char *device,\n"
28948 " const char *label);\n"
28953 #: ../src/guestfs-actions.pod:4965
28954 msgid "See also C<guestfs_mke2journal_L>."
28958 #: ../src/guestfs-actions.pod:4971
28959 msgid "guestfs_mke2fs_JU"
28963 #: ../src/guestfs-actions.pod:4973
28967 " guestfs_mke2fs_JU (guestfs_h *g,\n"
28968 " const char *fstype,\n"
28969 " int blocksize,\n"
28970 " const char *device,\n"
28971 " const char *uuid);\n"
28976 #: ../src/guestfs-actions.pod:4983
28977 msgid "See also C<guestfs_mke2journal_U>."
28981 #: ../src/guestfs-actions.pod:4989
28982 msgid "guestfs_mke2journal"
28986 #: ../src/guestfs-actions.pod:4991
28990 " guestfs_mke2journal (guestfs_h *g,\n"
28991 " int blocksize,\n"
28992 " const char *device);\n"
28997 #: ../src/guestfs-actions.pod:5005
28998 msgid "guestfs_mke2journal_L"
29002 #: ../src/guestfs-actions.pod:5007
29006 " guestfs_mke2journal_L (guestfs_h *g,\n"
29007 " int blocksize,\n"
29008 " const char *label,\n"
29009 " const char *device);\n"
29014 #: ../src/guestfs-actions.pod:5019
29015 msgid "guestfs_mke2journal_U"
29019 #: ../src/guestfs-actions.pod:5021
29023 " guestfs_mke2journal_U (guestfs_h *g,\n"
29024 " int blocksize,\n"
29025 " const char *uuid,\n"
29026 " const char *device);\n"
29031 #: ../src/guestfs-actions.pod:5033
29032 msgid "guestfs_mkfifo"
29036 #: ../src/guestfs-actions.pod:5035
29040 " guestfs_mkfifo (guestfs_h *g,\n"
29042 " const char *path);\n"
29047 #: ../src/guestfs-actions.pod:5040
29049 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
29050 "is just a convenient wrapper around C<guestfs_mknod>."
29054 #: ../src/guestfs-actions.pod:5050
29055 msgid "guestfs_mkfs"
29059 #: ../src/guestfs-actions.pod:5052
29063 " guestfs_mkfs (guestfs_h *g,\n"
29064 " const char *fstype,\n"
29065 " const char *device);\n"
29070 #: ../src/guestfs-actions.pod:5065
29071 msgid "guestfs_mkfs_b"
29075 #: ../src/guestfs-actions.pod:5067
29079 " guestfs_mkfs_b (guestfs_h *g,\n"
29080 " const char *fstype,\n"
29081 " int blocksize,\n"
29082 " const char *device);\n"
29087 #: ../src/guestfs-actions.pod:5073
29089 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
29094 #: ../src/guestfs-actions.pod:5080
29096 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
29097 "block size of the resulting filesystem. Supported block sizes depend on the "
29098 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
29102 #: ../src/guestfs-actions.pod:5092
29103 msgid "guestfs_mkfs_opts"
29107 #: ../src/guestfs-actions.pod:5094
29111 " guestfs_mkfs_opts (guestfs_h *g,\n"
29112 " const char *fstype,\n"
29113 " const char *device,\n"
29119 #: ../src/guestfs-actions.pod:5105
29122 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
29123 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
29124 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
29125 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
29130 #: ../src/guestfs-actions.pod:5153
29131 msgid "(Added in 1.7.19)"
29135 #: ../src/guestfs-actions.pod:5155
29136 msgid "guestfs_mkfs_opts_va"
29140 #: ../src/guestfs-actions.pod:5157
29144 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
29145 " const char *fstype,\n"
29146 " const char *device,\n"
29147 " va_list args);\n"
29152 #: ../src/guestfs-actions.pod:5163
29153 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
29157 #: ../src/guestfs-actions.pod:5167
29158 msgid "guestfs_mkfs_opts_argv"
29162 #: ../src/guestfs-actions.pod:5169
29166 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
29167 " const char *fstype,\n"
29168 " const char *device,\n"
29169 " const struct guestfs_mkfs_opts_argv *optargs);\n"
29174 #: ../src/guestfs-actions.pod:5175
29175 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
29179 #: ../src/guestfs-actions.pod:5179
29180 msgid "guestfs_mkmountpoint"
29184 #: ../src/guestfs-actions.pod:5181
29188 " guestfs_mkmountpoint (guestfs_h *g,\n"
29189 " const char *exemptpath);\n"
29194 #: ../src/guestfs-actions.pod:5185
29196 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
29197 "that can be used to create extra mountpoints before mounting the first "
29202 #: ../src/guestfs-actions.pod:5209
29204 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
29205 "may get unexpected errors if you try to mix these calls. It is safest to "
29206 "manually unmount filesystems and remove mountpoints after use."
29210 #: ../src/guestfs-actions.pod:5213
29212 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
29213 "first, so for this to work for manual mountpoints, you must ensure that the "
29214 "innermost mountpoints have the longest pathnames, as in the example code "
29219 #: ../src/guestfs-actions.pod:5220
29221 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
29222 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
29223 "can also trigger these issues."
29227 #: ../src/guestfs-actions.pod:5226 ../src/guestfs-actions.pod:5532 ../src/guestfs-actions.pod:6559
29228 msgid "(Added in 1.0.62)"
29232 #: ../src/guestfs-actions.pod:5228
29233 msgid "guestfs_mknod"
29237 #: ../src/guestfs-actions.pod:5230
29241 " guestfs_mknod (guestfs_h *g,\n"
29245 " const char *path);\n"
29250 #: ../src/guestfs-actions.pod:5245
29252 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
29253 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
29254 "regular file). These constants are available in the standard Linux header "
29255 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
29256 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
29257 "the appropriate constant for you."
29261 #: ../src/guestfs-actions.pod:5259
29262 msgid "guestfs_mknod_b"
29266 #: ../src/guestfs-actions.pod:5261
29270 " guestfs_mknod_b (guestfs_h *g,\n"
29274 " const char *path);\n"
29279 #: ../src/guestfs-actions.pod:5268
29281 "This call creates a block device node called C<path> with mode C<mode> and "
29282 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29283 "wrapper around C<guestfs_mknod>."
29287 #: ../src/guestfs-actions.pod:5278
29288 msgid "guestfs_mknod_c"
29292 #: ../src/guestfs-actions.pod:5280
29296 " guestfs_mknod_c (guestfs_h *g,\n"
29300 " const char *path);\n"
29305 #: ../src/guestfs-actions.pod:5287
29307 "This call creates a char device node called C<path> with mode C<mode> and "
29308 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
29309 "wrapper around C<guestfs_mknod>."
29313 #: ../src/guestfs-actions.pod:5297
29314 msgid "guestfs_mkswap"
29318 #: ../src/guestfs-actions.pod:5299
29322 " guestfs_mkswap (guestfs_h *g,\n"
29323 " const char *device);\n"
29328 #: ../src/guestfs-actions.pod:5309
29329 msgid "guestfs_mkswap_L"
29333 #: ../src/guestfs-actions.pod:5311
29337 " guestfs_mkswap_L (guestfs_h *g,\n"
29338 " const char *label,\n"
29339 " const char *device);\n"
29344 #: ../src/guestfs-actions.pod:5326
29345 msgid "guestfs_mkswap_U"
29349 #: ../src/guestfs-actions.pod:5328
29353 " guestfs_mkswap_U (guestfs_h *g,\n"
29354 " const char *uuid,\n"
29355 " const char *device);\n"
29360 #: ../src/guestfs-actions.pod:5339
29361 msgid "guestfs_mkswap_file"
29365 #: ../src/guestfs-actions.pod:5341
29369 " guestfs_mkswap_file (guestfs_h *g,\n"
29370 " const char *path);\n"
29375 #: ../src/guestfs-actions.pod:5347
29377 "This command just writes a swap file signature to an existing file. To "
29378 "create the file itself, use something like C<guestfs_fallocate>."
29382 #: ../src/guestfs-actions.pod:5354
29383 msgid "guestfs_modprobe"
29387 #: ../src/guestfs-actions.pod:5356
29391 " guestfs_modprobe (guestfs_h *g,\n"
29392 " const char *modulename);\n"
29397 #: ../src/guestfs-actions.pod:5369
29398 msgid "guestfs_mount"
29402 #: ../src/guestfs-actions.pod:5371
29406 " guestfs_mount (guestfs_h *g,\n"
29407 " const char *device,\n"
29408 " const char *mountpoint);\n"
29413 #: ../src/guestfs-actions.pod:5390
29415 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
29416 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
29417 "problems for users. If your program might need to work with older versions "
29418 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
29419 "for the first parameter if you don't want any options)."
29423 #: ../src/guestfs-actions.pod:5401
29424 msgid "guestfs_mount_9p"
29428 #: ../src/guestfs-actions.pod:5403
29432 " guestfs_mount_9p (guestfs_h *g,\n"
29433 " const char *mounttag,\n"
29434 " const char *mountpoint,\n"
29440 #: ../src/guestfs-actions.pod:5414
29443 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
29448 #: ../src/guestfs-actions.pod:5427
29449 msgid "guestfs_mount_9p_va"
29453 #: ../src/guestfs-actions.pod:5429
29457 " guestfs_mount_9p_va (guestfs_h *g,\n"
29458 " const char *mounttag,\n"
29459 " const char *mountpoint,\n"
29460 " va_list args);\n"
29465 #: ../src/guestfs-actions.pod:5435
29466 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
29470 #: ../src/guestfs-actions.pod:5439
29471 msgid "guestfs_mount_9p_argv"
29475 #: ../src/guestfs-actions.pod:5441
29479 " guestfs_mount_9p_argv (guestfs_h *g,\n"
29480 " const char *mounttag,\n"
29481 " const char *mountpoint,\n"
29482 " const struct guestfs_mount_9p_argv *optargs);\n"
29487 #: ../src/guestfs-actions.pod:5447
29488 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
29492 #: ../src/guestfs-actions.pod:5451
29493 msgid "guestfs_mount_loop"
29497 #: ../src/guestfs-actions.pod:5453
29501 " guestfs_mount_loop (guestfs_h *g,\n"
29502 " const char *file,\n"
29503 " const char *mountpoint);\n"
29508 #: ../src/guestfs-actions.pod:5466
29509 msgid "guestfs_mount_options"
29513 #: ../src/guestfs-actions.pod:5468
29517 " guestfs_mount_options (guestfs_h *g,\n"
29518 " const char *options,\n"
29519 " const char *device,\n"
29520 " const char *mountpoint);\n"
29525 #: ../src/guestfs-actions.pod:5474
29527 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29528 "the mount options as for the L<mount(8)> I<-o> flag."
29532 #: ../src/guestfs-actions.pod:5484 ../src/guestfs-actions.pod:5498 ../src/guestfs-actions.pod:5515
29533 msgid "(Added in 1.0.10)"
29537 #: ../src/guestfs-actions.pod:5486
29538 msgid "guestfs_mount_ro"
29542 #: ../src/guestfs-actions.pod:5488
29546 " guestfs_mount_ro (guestfs_h *g,\n"
29547 " const char *device,\n"
29548 " const char *mountpoint);\n"
29553 #: ../src/guestfs-actions.pod:5493
29555 "This is the same as the C<guestfs_mount> command, but it mounts the "
29556 "filesystem with the read-only (I<-o ro>) flag."
29560 #: ../src/guestfs-actions.pod:5500
29561 msgid "guestfs_mount_vfs"
29565 #: ../src/guestfs-actions.pod:5502
29569 " guestfs_mount_vfs (guestfs_h *g,\n"
29570 " const char *options,\n"
29571 " const char *vfstype,\n"
29572 " const char *device,\n"
29573 " const char *mountpoint);\n"
29578 #: ../src/guestfs-actions.pod:5509
29580 "This is the same as the C<guestfs_mount> command, but it allows you to set "
29581 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
29586 #: ../src/guestfs-actions.pod:5517
29587 msgid "guestfs_mountpoints"
29591 #: ../src/guestfs-actions.pod:5519
29595 " guestfs_mountpoints (guestfs_h *g);\n"
29600 #: ../src/guestfs-actions.pod:5522
29602 "This call is similar to C<guestfs_mounts>. That call returns a list of "
29603 "devices. This one returns a hash table (map) of device name to directory "
29604 "where the device is mounted."
29608 #: ../src/guestfs-actions.pod:5534
29609 msgid "guestfs_mounts"
29613 #: ../src/guestfs-actions.pod:5536
29617 " guestfs_mounts (guestfs_h *g);\n"
29622 #: ../src/guestfs-actions.pod:5544
29623 msgid "See also: C<guestfs_mountpoints>"
29627 #: ../src/guestfs-actions.pod:5552
29632 #: ../src/guestfs-actions.pod:5554
29636 " guestfs_mv (guestfs_h *g,\n"
29637 " const char *src,\n"
29638 " const char *dest);\n"
29643 #: ../src/guestfs-actions.pod:5566
29644 msgid "guestfs_ntfs_3g_probe"
29648 #: ../src/guestfs-actions.pod:5568
29652 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
29654 " const char *device);\n"
29659 #: ../src/guestfs-actions.pod:5587
29660 msgid "(Added in 1.0.43)"
29664 #: ../src/guestfs-actions.pod:5589
29665 msgid "guestfs_ntfsresize"
29669 #: ../src/guestfs-actions.pod:5591
29673 " guestfs_ntfsresize (guestfs_h *g,\n"
29674 " const char *device);\n"
29679 #: ../src/guestfs-actions.pod:5595 ../src/guestfs-actions.pod:5695
29681 "I<This function is deprecated.> In new code, use the "
29682 "L</guestfs_ntfsresize_opts> call instead."
29686 #: ../src/guestfs-actions.pod:5619
29687 msgid "guestfs_ntfsresize_opts"
29691 #: ../src/guestfs-actions.pod:5621
29695 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
29696 " const char *device,\n"
29702 #: ../src/guestfs-actions.pod:5631
29705 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
29706 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
29711 #: ../src/guestfs-actions.pod:5651
29713 "After the resize operation, the filesystem is always marked as requiring a "
29714 "consistency check (for safety). You have to boot into Windows to perform "
29715 "this check and clear this condition. If you I<don't> set the C<force> "
29716 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
29717 "times on a single filesystem without booting into Windows between each "
29722 #: ../src/guestfs-actions.pod:5666
29723 msgid "guestfs_ntfsresize_opts_va"
29727 #: ../src/guestfs-actions.pod:5668
29731 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
29732 " const char *device,\n"
29733 " va_list args);\n"
29738 #: ../src/guestfs-actions.pod:5673
29739 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
29743 #: ../src/guestfs-actions.pod:5677
29744 msgid "guestfs_ntfsresize_opts_argv"
29748 #: ../src/guestfs-actions.pod:5679
29752 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
29753 " const char *device,\n"
29754 " const struct guestfs_ntfsresize_opts_argv "
29760 #: ../src/guestfs-actions.pod:5684
29761 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
29765 #: ../src/guestfs-actions.pod:5688
29766 msgid "guestfs_ntfsresize_size"
29770 #: ../src/guestfs-actions.pod:5690
29774 " guestfs_ntfsresize_size (guestfs_h *g,\n"
29775 " const char *device,\n"
29776 " int64_t size);\n"
29781 #: ../src/guestfs-actions.pod:5702
29783 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
29784 "to specify the new size (in bytes) explicitly."
29788 #: ../src/guestfs-actions.pod:5707 ../src/guestfs-actions.pod:6166 ../src/guestfs-actions.pod:6239 ../src/guestfs-actions.pod:6507 ../src/guestfs-actions.pod:8134
29789 msgid "(Added in 1.3.14)"
29793 #: ../src/guestfs-actions.pod:5709
29794 msgid "guestfs_part_add"
29798 #: ../src/guestfs-actions.pod:5711
29802 " guestfs_part_add (guestfs_h *g,\n"
29803 " const char *device,\n"
29804 " const char *prlogex,\n"
29805 " int64_t startsect,\n"
29806 " int64_t endsect);\n"
29811 #: ../src/guestfs-actions.pod:5718
29813 "This command adds a partition to C<device>. If there is no partition table "
29814 "on the device, call C<guestfs_part_init> first."
29818 #: ../src/guestfs-actions.pod:5730
29820 "Creating a partition which covers the whole disk is not so easy. Use "
29821 "C<guestfs_part_disk> to do that."
29825 #: ../src/guestfs-actions.pod:5735 ../src/guestfs-actions.pod:5770 ../src/guestfs-actions.pod:5823 ../src/guestfs-actions.pod:5907 ../src/guestfs-actions.pod:5945 ../src/guestfs-actions.pod:5964 ../src/guestfs-actions.pod:6004
29826 msgid "(Added in 1.0.78)"
29830 #: ../src/guestfs-actions.pod:5737
29831 msgid "guestfs_part_del"
29835 #: ../src/guestfs-actions.pod:5739
29839 " guestfs_part_del (guestfs_h *g,\n"
29840 " const char *device,\n"
29846 #: ../src/guestfs-actions.pod:5754
29847 msgid "guestfs_part_disk"
29851 #: ../src/guestfs-actions.pod:5756
29855 " guestfs_part_disk (guestfs_h *g,\n"
29856 " const char *device,\n"
29857 " const char *parttype);\n"
29862 #: ../src/guestfs-actions.pod:5761
29864 "This command is simply a combination of C<guestfs_part_init> followed by "
29865 "C<guestfs_part_add> to create a single primary partition covering the whole "
29870 #: ../src/guestfs-actions.pod:5765
29872 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
29873 "possible values are described in C<guestfs_part_init>."
29877 #: ../src/guestfs-actions.pod:5772
29878 msgid "guestfs_part_get_bootable"
29882 #: ../src/guestfs-actions.pod:5774
29886 " guestfs_part_get_bootable (guestfs_h *g,\n"
29887 " const char *device,\n"
29893 #: ../src/guestfs-actions.pod:5782
29894 msgid "See also C<guestfs_part_set_bootable>."
29898 #: ../src/guestfs-actions.pod:5788
29899 msgid "guestfs_part_get_mbr_id"
29903 #: ../src/guestfs-actions.pod:5790
29907 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
29908 " const char *device,\n"
29914 #: ../src/guestfs-actions.pod:5798 ../src/guestfs-actions.pod:5980
29916 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
29917 "undefined results for other partition table types (see "
29918 "C<guestfs_part_get_parttype>)."
29922 #: ../src/guestfs-actions.pod:5806
29923 msgid "guestfs_part_get_parttype"
29927 #: ../src/guestfs-actions.pod:5808
29931 " guestfs_part_get_parttype (guestfs_h *g,\n"
29932 " const char *device);\n"
29937 #: ../src/guestfs-actions.pod:5815
29939 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
29940 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
29941 "possible, although unusual. See C<guestfs_part_init> for a full list."
29945 #: ../src/guestfs-actions.pod:5825
29946 msgid "guestfs_part_init"
29950 #: ../src/guestfs-actions.pod:5827
29954 " guestfs_part_init (guestfs_h *g,\n"
29955 " const char *device,\n"
29956 " const char *parttype);\n"
29961 #: ../src/guestfs-actions.pod:5836
29963 "Initially there are no partitions. Following this, you should call "
29964 "C<guestfs_part_add> for each partition required."
29968 #: ../src/guestfs-actions.pod:5909
29969 msgid "guestfs_part_list"
29973 #: ../src/guestfs-actions.pod:5911
29976 " struct guestfs_partition_list *\n"
29977 " guestfs_part_list (guestfs_h *g,\n"
29978 " const char *device);\n"
29983 #: ../src/guestfs-actions.pod:5928
29985 "Start of the partition I<in bytes>. To get sectors you have to divide by "
29986 "the device's sector size, see C<guestfs_blockdev_getss>."
29990 #: ../src/guestfs-actions.pod:5941
29992 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
29993 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
29998 #: ../src/guestfs-actions.pod:5947
29999 msgid "guestfs_part_set_bootable"
30003 #: ../src/guestfs-actions.pod:5949
30007 " guestfs_part_set_bootable (guestfs_h *g,\n"
30008 " const char *device,\n"
30010 " int bootable);\n"
30015 #: ../src/guestfs-actions.pod:5966
30016 msgid "guestfs_part_set_mbr_id"
30020 #: ../src/guestfs-actions.pod:5968
30024 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
30025 " const char *device,\n"
30032 #: ../src/guestfs-actions.pod:5988
30033 msgid "guestfs_part_set_name"
30037 #: ../src/guestfs-actions.pod:5990
30041 " guestfs_part_set_name (guestfs_h *g,\n"
30042 " const char *device,\n"
30044 " const char *name);\n"
30049 #: ../src/guestfs-actions.pod:6006
30050 msgid "guestfs_part_to_dev"
30054 #: ../src/guestfs-actions.pod:6008
30058 " guestfs_part_to_dev (guestfs_h *g,\n"
30059 " const char *partition);\n"
30064 #: ../src/guestfs-actions.pod:6016 ../src/guestfs-actions.pod:6035
30066 "The named partition must exist, for example as a string returned from "
30067 "C<guestfs_list_partitions>."
30071 #: ../src/guestfs-actions.pod:6019
30072 msgid "See also C<guestfs_part_to_partnum>."
30076 #: ../src/guestfs-actions.pod:6026
30077 msgid "guestfs_part_to_partnum"
30081 #: ../src/guestfs-actions.pod:6028
30085 " guestfs_part_to_partnum (guestfs_h *g,\n"
30086 " const char *partition);\n"
30091 #: ../src/guestfs-actions.pod:6038
30092 msgid "See also C<guestfs_part_to_dev>."
30096 #: ../src/guestfs-actions.pod:6044
30097 msgid "guestfs_ping_daemon"
30101 #: ../src/guestfs-actions.pod:6046
30105 " guestfs_ping_daemon (guestfs_h *g);\n"
30110 #: ../src/guestfs-actions.pod:6058
30111 msgid "guestfs_pread"
30115 #: ../src/guestfs-actions.pod:6060
30119 " guestfs_pread (guestfs_h *g,\n"
30120 " const char *path,\n"
30122 " int64_t offset,\n"
30123 " size_t *size_r);\n"
30128 #: ../src/guestfs-actions.pod:6073
30129 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
30133 #: ../src/guestfs-actions.pod:6084
30134 msgid "guestfs_pread_device"
30138 #: ../src/guestfs-actions.pod:6086
30142 " guestfs_pread_device (guestfs_h *g,\n"
30143 " const char *device,\n"
30145 " int64_t offset,\n"
30146 " size_t *size_r);\n"
30151 #: ../src/guestfs-actions.pod:6099
30152 msgid "See also C<guestfs_pread>."
30156 #: ../src/guestfs-actions.pod:6108
30157 msgid "(Added in 1.5.21)"
30161 #: ../src/guestfs-actions.pod:6110
30162 msgid "guestfs_pvcreate"
30166 #: ../src/guestfs-actions.pod:6112
30170 " guestfs_pvcreate (guestfs_h *g,\n"
30171 " const char *device);\n"
30176 #: ../src/guestfs-actions.pod:6124
30177 msgid "guestfs_pvremove"
30181 #: ../src/guestfs-actions.pod:6126
30185 " guestfs_pvremove (guestfs_h *g,\n"
30186 " const char *device);\n"
30191 #: ../src/guestfs-actions.pod:6141
30192 msgid "guestfs_pvresize"
30196 #: ../src/guestfs-actions.pod:6143
30200 " guestfs_pvresize (guestfs_h *g,\n"
30201 " const char *device);\n"
30206 #: ../src/guestfs-actions.pod:6154
30207 msgid "guestfs_pvresize_size"
30211 #: ../src/guestfs-actions.pod:6156
30215 " guestfs_pvresize_size (guestfs_h *g,\n"
30216 " const char *device,\n"
30217 " int64_t size);\n"
30222 #: ../src/guestfs-actions.pod:6161
30224 "This command is the same as C<guestfs_pvresize> except that it allows you to "
30225 "specify the new size (in bytes) explicitly."
30229 #: ../src/guestfs-actions.pod:6168
30230 msgid "guestfs_pvs"
30234 #: ../src/guestfs-actions.pod:6170
30238 " guestfs_pvs (guestfs_h *g);\n"
30243 #: ../src/guestfs-actions.pod:6179
30244 msgid "See also C<guestfs_pvs_full>."
30248 #: ../src/guestfs-actions.pod:6187
30249 msgid "guestfs_pvs_full"
30253 #: ../src/guestfs-actions.pod:6189
30256 " struct guestfs_lvm_pv_list *\n"
30257 " guestfs_pvs_full (guestfs_h *g);\n"
30262 #: ../src/guestfs-actions.pod:6195
30264 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
30265 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
30270 #: ../src/guestfs-actions.pod:6201
30271 msgid "guestfs_pvuuid"
30275 #: ../src/guestfs-actions.pod:6203
30279 " guestfs_pvuuid (guestfs_h *g,\n"
30280 " const char *device);\n"
30285 #: ../src/guestfs-actions.pod:6214
30286 msgid "guestfs_pwrite"
30290 #: ../src/guestfs-actions.pod:6216
30294 " guestfs_pwrite (guestfs_h *g,\n"
30295 " const char *path,\n"
30296 " const char *content,\n"
30297 " size_t content_size,\n"
30298 " int64_t offset);\n"
30303 #: ../src/guestfs-actions.pod:6232
30304 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
30308 #: ../src/guestfs-actions.pod:6241
30309 msgid "guestfs_pwrite_device"
30313 #: ../src/guestfs-actions.pod:6243
30317 " guestfs_pwrite_device (guestfs_h *g,\n"
30318 " const char *device,\n"
30319 " const char *content,\n"
30320 " size_t content_size,\n"
30321 " int64_t offset);\n"
30326 #: ../src/guestfs-actions.pod:6258
30327 msgid "See also C<guestfs_pwrite>."
30331 #: ../src/guestfs-actions.pod:6265
30332 msgid "(Added in 1.5.20)"
30336 #: ../src/guestfs-actions.pod:6267
30337 msgid "guestfs_read_file"
30341 #: ../src/guestfs-actions.pod:6269
30345 " guestfs_read_file (guestfs_h *g,\n"
30346 " const char *path,\n"
30347 " size_t *size_r);\n"
30352 #: ../src/guestfs-actions.pod:6277
30354 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
30355 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
30356 "function is limited in the total size of file that can be handled."
30360 #: ../src/guestfs-actions.pod:6289
30361 msgid "(Added in 1.0.63)"
30365 #: ../src/guestfs-actions.pod:6291
30366 msgid "guestfs_read_lines"
30370 #: ../src/guestfs-actions.pod:6293
30374 " guestfs_read_lines (guestfs_h *g,\n"
30375 " const char *path);\n"
30380 #: ../src/guestfs-actions.pod:6302
30382 "Note that this function cannot correctly handle binary files (specifically, "
30383 "files containing C<\\0> character which is treated as end of line). For "
30384 "those you need to use the C<guestfs_read_file> function which has a more "
30385 "complex interface."
30389 #: ../src/guestfs-actions.pod:6313
30390 msgid "guestfs_readdir"
30394 #: ../src/guestfs-actions.pod:6315
30397 " struct guestfs_dirent_list *\n"
30398 " guestfs_readdir (guestfs_h *g,\n"
30399 " const char *dir);\n"
30404 #: ../src/guestfs-actions.pod:6369
30406 "This function is primarily intended for use by programs. To get a simple "
30407 "list of names, use C<guestfs_ls>. To get a printable directory for human "
30408 "consumption, use C<guestfs_ll>."
30412 #: ../src/guestfs-actions.pod:6373
30414 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
30415 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
30420 #: ../src/guestfs-actions.pod:6379
30421 msgid "guestfs_readlink"
30425 #: ../src/guestfs-actions.pod:6381
30429 " guestfs_readlink (guestfs_h *g,\n"
30430 " const char *path);\n"
30435 #: ../src/guestfs-actions.pod:6392
30436 msgid "guestfs_readlinklist"
30440 #: ../src/guestfs-actions.pod:6394
30444 " guestfs_readlinklist (guestfs_h *g,\n"
30445 " const char *path,\n"
30446 " char *const *names);\n"
30451 #: ../src/guestfs-actions.pod:6427
30452 msgid "guestfs_realpath"
30456 #: ../src/guestfs-actions.pod:6429
30460 " guestfs_realpath (guestfs_h *g,\n"
30461 " const char *path);\n"
30466 #: ../src/guestfs-actions.pod:6441
30467 msgid "guestfs_removexattr"
30471 #: ../src/guestfs-actions.pod:6443
30475 " guestfs_removexattr (guestfs_h *g,\n"
30476 " const char *xattr,\n"
30477 " const char *path);\n"
30482 #: ../src/guestfs-actions.pod:6451
30483 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
30487 #: ../src/guestfs-actions.pod:6457
30488 msgid "guestfs_resize2fs"
30492 #: ../src/guestfs-actions.pod:6459
30496 " guestfs_resize2fs (guestfs_h *g,\n"
30497 " const char *device);\n"
30502 #: ../src/guestfs-actions.pod:6466
30504 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
30505 "C<device> before calling this command. For unknown reasons C<resize2fs> "
30506 "sometimes gives an error about this and sometimes not. In any case, it is "
30507 "always safe to call C<guestfs_e2fsck_f> before calling this function."
30511 #: ../src/guestfs-actions.pod:6476
30512 msgid "guestfs_resize2fs_M"
30516 #: ../src/guestfs-actions.pod:6478
30520 " guestfs_resize2fs_M (guestfs_h *g,\n"
30521 " const char *device);\n"
30526 #: ../src/guestfs-actions.pod:6482
30528 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
30529 "resized to its minimum size. This works like the I<-M> option to the "
30530 "C<resize2fs> command."
30534 #: ../src/guestfs-actions.pod:6486
30536 "To get the resulting size of the filesystem you should call "
30537 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
30538 "These two numbers, multiplied together, give the resulting size of the "
30539 "minimal filesystem in bytes."
30543 #: ../src/guestfs-actions.pod:6495
30544 msgid "guestfs_resize2fs_size"
30548 #: ../src/guestfs-actions.pod:6497
30552 " guestfs_resize2fs_size (guestfs_h *g,\n"
30553 " const char *device,\n"
30554 " int64_t size);\n"
30559 #: ../src/guestfs-actions.pod:6502
30561 "This command is the same as C<guestfs_resize2fs> except that it allows you "
30562 "to specify the new size (in bytes) explicitly."
30566 #: ../src/guestfs-actions.pod:6509
30571 #: ../src/guestfs-actions.pod:6511
30575 " guestfs_rm (guestfs_h *g,\n"
30576 " const char *path);\n"
30581 #: ../src/guestfs-actions.pod:6521
30582 msgid "guestfs_rm_rf"
30586 #: ../src/guestfs-actions.pod:6523
30590 " guestfs_rm_rf (guestfs_h *g,\n"
30591 " const char *path);\n"
30596 #: ../src/guestfs-actions.pod:6535
30597 msgid "guestfs_rmdir"
30601 #: ../src/guestfs-actions.pod:6537
30605 " guestfs_rmdir (guestfs_h *g,\n"
30606 " const char *path);\n"
30611 #: ../src/guestfs-actions.pod:6547
30612 msgid "guestfs_rmmountpoint"
30616 #: ../src/guestfs-actions.pod:6549
30620 " guestfs_rmmountpoint (guestfs_h *g,\n"
30621 " const char *exemptpath);\n"
30626 #: ../src/guestfs-actions.pod:6553
30628 "This calls removes a mountpoint that was previously created with "
30629 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
30633 #: ../src/guestfs-actions.pod:6561
30634 msgid "guestfs_scrub_device"
30638 #: ../src/guestfs-actions.pod:6563
30642 " guestfs_scrub_device (guestfs_h *g,\n"
30643 " const char *device);\n"
30648 #: ../src/guestfs-actions.pod:6575 ../src/guestfs-actions.pod:6593 ../src/guestfs-actions.pod:6612
30649 msgid "(Added in 1.0.52)"
30653 #: ../src/guestfs-actions.pod:6577
30654 msgid "guestfs_scrub_file"
30658 #: ../src/guestfs-actions.pod:6579
30662 " guestfs_scrub_file (guestfs_h *g,\n"
30663 " const char *file);\n"
30668 #: ../src/guestfs-actions.pod:6595
30669 msgid "guestfs_scrub_freespace"
30673 #: ../src/guestfs-actions.pod:6597
30677 " guestfs_scrub_freespace (guestfs_h *g,\n"
30678 " const char *dir);\n"
30683 #: ../src/guestfs-actions.pod:6601
30685 "This command creates the directory C<dir> and then fills it with files until "
30686 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
30687 "and deletes them. The intention is to scrub any free space on the partition "
30688 "containing C<dir>."
30692 #: ../src/guestfs-actions.pod:6614
30693 msgid "guestfs_set_append"
30697 #: ../src/guestfs-actions.pod:6616
30701 " guestfs_set_append (guestfs_h *g,\n"
30702 " const char *append);\n"
30707 #: ../src/guestfs-actions.pod:6633
30708 msgid "guestfs_set_attach_method"
30712 #: ../src/guestfs-actions.pod:6635
30716 " guestfs_set_attach_method (guestfs_h *g,\n"
30717 " const char *attachmethod);\n"
30722 #: ../src/guestfs-actions.pod:6663
30723 msgid "guestfs_set_autosync"
30727 #: ../src/guestfs-actions.pod:6665
30731 " guestfs_set_autosync (guestfs_h *g,\n"
30732 " int autosync);\n"
30737 #: ../src/guestfs-actions.pod:6681
30738 msgid "guestfs_set_direct"
30742 #: ../src/guestfs-actions.pod:6683
30746 " guestfs_set_direct (guestfs_h *g,\n"
30752 #: ../src/guestfs-actions.pod:6691
30754 "One consequence of this is that log messages aren't caught by the library "
30755 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
30760 #: ../src/guestfs-actions.pod:6704
30761 msgid "guestfs_set_e2label"
30765 #: ../src/guestfs-actions.pod:6706
30769 " guestfs_set_e2label (guestfs_h *g,\n"
30770 " const char *device,\n"
30771 " const char *label);\n"
30776 #: ../src/guestfs-actions.pod:6715
30778 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
30779 "the existing label on a filesystem."
30783 #: ../src/guestfs-actions.pod:6722
30784 msgid "guestfs_set_e2uuid"
30788 #: ../src/guestfs-actions.pod:6724
30792 " guestfs_set_e2uuid (guestfs_h *g,\n"
30793 " const char *device,\n"
30794 " const char *uuid);\n"
30799 #: ../src/guestfs-actions.pod:6734
30801 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
30802 "the existing UUID of a filesystem."
30806 #: ../src/guestfs-actions.pod:6741
30807 msgid "guestfs_set_memsize"
30811 #: ../src/guestfs-actions.pod:6743
30815 " guestfs_set_memsize (guestfs_h *g,\n"
30821 #: ../src/guestfs-actions.pod:6747
30823 "This sets the memory size in megabytes allocated to the qemu subprocess. "
30824 "This only has any effect if called before C<guestfs_launch>."
30828 #: ../src/guestfs-actions.pod:6762
30829 msgid "guestfs_set_network"
30833 #: ../src/guestfs-actions.pod:6764
30837 " guestfs_set_network (guestfs_h *g,\n"
30843 #: ../src/guestfs-actions.pod:6774
30845 "You must call this before calling C<guestfs_launch>, otherwise it has no "
30850 #: ../src/guestfs-actions.pod:6781
30851 msgid "guestfs_set_path"
30855 #: ../src/guestfs-actions.pod:6783
30859 " guestfs_set_path (guestfs_h *g,\n"
30860 " const char *searchpath);\n"
30865 #: ../src/guestfs-actions.pod:6798
30866 msgid "guestfs_set_pgroup"
30870 #: ../src/guestfs-actions.pod:6800
30874 " guestfs_set_pgroup (guestfs_h *g,\n"
30880 #: ../src/guestfs-actions.pod:6817
30881 msgid "guestfs_set_qemu"
30885 #: ../src/guestfs-actions.pod:6819
30889 " guestfs_set_qemu (guestfs_h *g,\n"
30890 " const char *qemu);\n"
30895 #: ../src/guestfs-actions.pod:6845
30896 msgid "guestfs_set_recovery_proc"
30900 #: ../src/guestfs-actions.pod:6847
30904 " guestfs_set_recovery_proc (guestfs_h *g,\n"
30905 " int recoveryproc);\n"
30910 #: ../src/guestfs-actions.pod:6851
30912 "If this is called with the parameter C<false> then C<guestfs_launch> does "
30913 "not create a recovery process. The purpose of the recovery process is to "
30914 "stop runaway qemu processes in the case where the main program aborts "
30919 #: ../src/guestfs-actions.pod:6856
30921 "This only has any effect if called before C<guestfs_launch>, and the default "
30926 #: ../src/guestfs-actions.pod:6869
30927 msgid "guestfs_set_selinux"
30931 #: ../src/guestfs-actions.pod:6871
30935 " guestfs_set_selinux (guestfs_h *g,\n"
30941 #: ../src/guestfs-actions.pod:6888
30942 msgid "guestfs_set_smp"
30946 #: ../src/guestfs-actions.pod:6890
30950 " guestfs_set_smp (guestfs_h *g,\n"
30956 #: ../src/guestfs-actions.pod:6898
30957 msgid "This function must be called before C<guestfs_launch>."
30961 #: ../src/guestfs-actions.pod:6904
30962 msgid "guestfs_set_trace"
30966 #: ../src/guestfs-actions.pod:6906
30970 " guestfs_set_trace (guestfs_h *g,\n"
30976 #: ../src/guestfs-actions.pod:6920
30978 "Trace messages are normally sent to C<stderr>, unless you register a "
30979 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30983 #: ../src/guestfs-actions.pod:6928
30984 msgid "guestfs_set_verbose"
30988 #: ../src/guestfs-actions.pod:6930
30992 " guestfs_set_verbose (guestfs_h *g,\n"
30998 #: ../src/guestfs-actions.pod:6939
31000 "Verbose messages are normally sent to C<stderr>, unless you register a "
31001 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
31005 #: ../src/guestfs-actions.pod:6947
31006 msgid "guestfs_setcon"
31010 #: ../src/guestfs-actions.pod:6949
31014 " guestfs_setcon (guestfs_h *g,\n"
31015 " const char *context);\n"
31020 #: ../src/guestfs-actions.pod:6962
31021 msgid "guestfs_setxattr"
31025 #: ../src/guestfs-actions.pod:6964
31029 " guestfs_setxattr (guestfs_h *g,\n"
31030 " const char *xattr,\n"
31031 " const char *val,\n"
31033 " const char *path);\n"
31038 #: ../src/guestfs-actions.pod:6975
31039 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
31043 #: ../src/guestfs-actions.pod:6981
31044 msgid "guestfs_sfdisk"
31048 #: ../src/guestfs-actions.pod:6983
31052 " guestfs_sfdisk (guestfs_h *g,\n"
31053 " const char *device,\n"
31057 " char *const *lines);\n"
31062 #: ../src/guestfs-actions.pod:6991 ../src/guestfs-actions.pod:7032 ../src/guestfs-actions.pod:7063
31064 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
31069 #: ../src/guestfs-actions.pod:7018
31070 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
31074 #: ../src/guestfs-actions.pod:7025
31075 msgid "guestfs_sfdiskM"
31079 #: ../src/guestfs-actions.pod:7027
31083 " guestfs_sfdiskM (guestfs_h *g,\n"
31084 " const char *device,\n"
31085 " char *const *lines);\n"
31090 #: ../src/guestfs-actions.pod:7039
31092 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
31093 "partition sizes are specified in megabytes only (rounded to the nearest "
31094 "cylinder) and you don't need to specify the cyls, heads and sectors "
31095 "parameters which were rarely if ever used anyway."
31099 #: ../src/guestfs-actions.pod:7045
31101 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
31102 "C<guestfs_part_disk>"
31106 #: ../src/guestfs-actions.pod:7052
31107 msgid "guestfs_sfdisk_N"
31111 #: ../src/guestfs-actions.pod:7054
31115 " guestfs_sfdisk_N (guestfs_h *g,\n"
31116 " const char *device,\n"
31121 " const char *line);\n"
31126 #: ../src/guestfs-actions.pod:7073
31128 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
31129 "for the cyls/heads/sectors parameters."
31133 #: ../src/guestfs-actions.pod:7076
31134 msgid "See also: C<guestfs_part_add>"
31138 #: ../src/guestfs-actions.pod:7082
31139 msgid "guestfs_sfdisk_disk_geometry"
31143 #: ../src/guestfs-actions.pod:7084
31147 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
31148 " const char *device);\n"
31153 #: ../src/guestfs-actions.pod:7088
31155 "This displays the disk geometry of C<device> read from the partition table. "
31156 "Especially in the case where the underlying block device has been resized, "
31157 "this can be different from the kernel's idea of the geometry (see "
31158 "C<guestfs_sfdisk_kernel_geometry>)."
31162 #: ../src/guestfs-actions.pod:7101
31163 msgid "guestfs_sfdisk_kernel_geometry"
31167 #: ../src/guestfs-actions.pod:7103
31171 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
31172 " const char *device);\n"
31177 #: ../src/guestfs-actions.pod:7117
31178 msgid "guestfs_sfdisk_l"
31182 #: ../src/guestfs-actions.pod:7119
31186 " guestfs_sfdisk_l (guestfs_h *g,\n"
31187 " const char *device);\n"
31192 #: ../src/guestfs-actions.pod:7123
31194 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
31199 #: ../src/guestfs-actions.pod:7134
31200 msgid "See also: C<guestfs_part_list>"
31204 #: ../src/guestfs-actions.pod:7141
31209 #: ../src/guestfs-actions.pod:7143
31213 " guestfs_sh (guestfs_h *g,\n"
31214 " const char *command);\n"
31219 #: ../src/guestfs-actions.pod:7150
31220 msgid "This is like C<guestfs_command>, but passes the command to:"
31224 #: ../src/guestfs-actions.pod:7158
31225 msgid "All the provisos about C<guestfs_command> apply to this call."
31229 #: ../src/guestfs-actions.pod:7165
31230 msgid "guestfs_sh_lines"
31234 #: ../src/guestfs-actions.pod:7167
31238 " guestfs_sh_lines (guestfs_h *g,\n"
31239 " const char *command);\n"
31244 #: ../src/guestfs-actions.pod:7171
31246 "This is the same as C<guestfs_sh>, but splits the result into a list of "
31251 #: ../src/guestfs-actions.pod:7174
31252 msgid "See also: C<guestfs_command_lines>"
31256 #: ../src/guestfs-actions.pod:7182
31257 msgid "guestfs_sleep"
31261 #: ../src/guestfs-actions.pod:7184
31265 " guestfs_sleep (guestfs_h *g,\n"
31271 #: ../src/guestfs-actions.pod:7192
31272 msgid "(Added in 1.0.41)"
31276 #: ../src/guestfs-actions.pod:7194 ../src/guestfs-structs.pod:109
31277 msgid "guestfs_stat"
31281 #: ../src/guestfs-actions.pod:7196
31284 " struct guestfs_stat *\n"
31285 " guestfs_stat (guestfs_h *g,\n"
31286 " const char *path);\n"
31291 #: ../src/guestfs-actions.pod:7210 ../src/guestfs-structs.pod:135
31292 msgid "guestfs_statvfs"
31296 #: ../src/guestfs-actions.pod:7212
31299 " struct guestfs_statvfs *\n"
31300 " guestfs_statvfs (guestfs_h *g,\n"
31301 " const char *path);\n"
31306 #: ../src/guestfs-actions.pod:7222
31308 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
31309 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
31313 #: ../src/guestfs-actions.pod:7228
31314 msgid "guestfs_strings"
31318 #: ../src/guestfs-actions.pod:7230
31322 " guestfs_strings (guestfs_h *g,\n"
31323 " const char *path);\n"
31328 #: ../src/guestfs-actions.pod:7246
31329 msgid "guestfs_strings_e"
31333 #: ../src/guestfs-actions.pod:7248
31337 " guestfs_strings_e (guestfs_h *g,\n"
31338 " const char *encoding,\n"
31339 " const char *path);\n"
31344 #: ../src/guestfs-actions.pod:7253
31346 "This is like the C<guestfs_strings> command, but allows you to specify the "
31347 "encoding of strings that are looked for in the source file C<path>."
31351 #: ../src/guestfs-actions.pod:7263
31353 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
31354 "ISO-8859-X (this is what C<guestfs_strings> uses)."
31358 #: ../src/guestfs-actions.pod:7301
31359 msgid "guestfs_swapoff_device"
31363 #: ../src/guestfs-actions.pod:7303
31367 " guestfs_swapoff_device (guestfs_h *g,\n"
31368 " const char *device);\n"
31373 #: ../src/guestfs-actions.pod:7307
31375 "This command disables the libguestfs appliance swap device or partition "
31376 "named C<device>. See C<guestfs_swapon_device>."
31380 #: ../src/guestfs-actions.pod:7315
31381 msgid "guestfs_swapoff_file"
31385 #: ../src/guestfs-actions.pod:7317
31389 " guestfs_swapoff_file (guestfs_h *g,\n"
31390 " const char *file);\n"
31395 #: ../src/guestfs-actions.pod:7327
31396 msgid "guestfs_swapoff_label"
31400 #: ../src/guestfs-actions.pod:7329
31404 " guestfs_swapoff_label (guestfs_h *g,\n"
31405 " const char *label);\n"
31410 #: ../src/guestfs-actions.pod:7340
31411 msgid "guestfs_swapoff_uuid"
31415 #: ../src/guestfs-actions.pod:7342
31419 " guestfs_swapoff_uuid (guestfs_h *g,\n"
31420 " const char *uuid);\n"
31425 #: ../src/guestfs-actions.pod:7353
31426 msgid "guestfs_swapon_device"
31430 #: ../src/guestfs-actions.pod:7355
31434 " guestfs_swapon_device (guestfs_h *g,\n"
31435 " const char *device);\n"
31440 #: ../src/guestfs-actions.pod:7359
31442 "This command enables the libguestfs appliance to use the swap device or "
31443 "partition named C<device>. The increased memory is made available for all "
31444 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
31448 #: ../src/guestfs-actions.pod:7375
31449 msgid "guestfs_swapon_file"
31453 #: ../src/guestfs-actions.pod:7377
31457 " guestfs_swapon_file (guestfs_h *g,\n"
31458 " const char *file);\n"
31463 #: ../src/guestfs-actions.pod:7381
31465 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
31470 #: ../src/guestfs-actions.pod:7388
31471 msgid "guestfs_swapon_label"
31475 #: ../src/guestfs-actions.pod:7390
31479 " guestfs_swapon_label (guestfs_h *g,\n"
31480 " const char *label);\n"
31485 #: ../src/guestfs-actions.pod:7394
31487 "This command enables swap to a labeled swap partition. See "
31488 "C<guestfs_swapon_device> for other notes."
31492 #: ../src/guestfs-actions.pod:7401
31493 msgid "guestfs_swapon_uuid"
31497 #: ../src/guestfs-actions.pod:7403
31501 " guestfs_swapon_uuid (guestfs_h *g,\n"
31502 " const char *uuid);\n"
31507 #: ../src/guestfs-actions.pod:7407
31509 "This command enables swap to a swap partition with the given UUID. See "
31510 "C<guestfs_swapon_device> for other notes."
31514 #: ../src/guestfs-actions.pod:7414
31515 msgid "guestfs_sync"
31519 #: ../src/guestfs-actions.pod:7416
31523 " guestfs_sync (guestfs_h *g);\n"
31528 #: ../src/guestfs-actions.pod:7429
31529 msgid "guestfs_tail"
31533 #: ../src/guestfs-actions.pod:7431
31537 " guestfs_tail (guestfs_h *g,\n"
31538 " const char *path);\n"
31543 #: ../src/guestfs-actions.pod:7447
31544 msgid "guestfs_tail_n"
31548 #: ../src/guestfs-actions.pod:7449
31552 " guestfs_tail_n (guestfs_h *g,\n"
31554 " const char *path);\n"
31559 #: ../src/guestfs-actions.pod:7471
31560 msgid "guestfs_tar_in"
31564 #: ../src/guestfs-actions.pod:7473
31568 " guestfs_tar_in (guestfs_h *g,\n"
31569 " const char *tarfile,\n"
31570 " const char *directory);\n"
31575 #: ../src/guestfs-actions.pod:7481
31576 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
31580 #: ../src/guestfs-actions.pod:7486 ../src/guestfs-actions.pod:7503 ../src/guestfs-actions.pod:7519 ../src/guestfs-actions.pod:7535
31581 msgid "(Added in 1.0.3)"
31585 #: ../src/guestfs-actions.pod:7488
31586 msgid "guestfs_tar_out"
31590 #: ../src/guestfs-actions.pod:7490
31594 " guestfs_tar_out (guestfs_h *g,\n"
31595 " const char *directory,\n"
31596 " const char *tarfile);\n"
31601 #: ../src/guestfs-actions.pod:7498
31603 "To download a compressed tarball, use C<guestfs_tgz_out> or "
31604 "C<guestfs_txz_out>."
31608 #: ../src/guestfs-actions.pod:7505
31609 msgid "guestfs_tgz_in"
31613 #: ../src/guestfs-actions.pod:7507
31617 " guestfs_tgz_in (guestfs_h *g,\n"
31618 " const char *tarball,\n"
31619 " const char *directory);\n"
31624 #: ../src/guestfs-actions.pod:7515
31625 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
31629 #: ../src/guestfs-actions.pod:7521
31630 msgid "guestfs_tgz_out"
31634 #: ../src/guestfs-actions.pod:7523
31638 " guestfs_tgz_out (guestfs_h *g,\n"
31639 " const char *directory,\n"
31640 " const char *tarball);\n"
31645 #: ../src/guestfs-actions.pod:7531
31646 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
31650 #: ../src/guestfs-actions.pod:7537
31651 msgid "guestfs_touch"
31655 #: ../src/guestfs-actions.pod:7539
31659 " guestfs_touch (guestfs_h *g,\n"
31660 " const char *path);\n"
31665 #: ../src/guestfs-actions.pod:7554
31666 msgid "guestfs_truncate"
31670 #: ../src/guestfs-actions.pod:7556
31674 " guestfs_truncate (guestfs_h *g,\n"
31675 " const char *path);\n"
31680 #: ../src/guestfs-actions.pod:7567
31681 msgid "guestfs_truncate_size"
31685 #: ../src/guestfs-actions.pod:7569
31689 " guestfs_truncate_size (guestfs_h *g,\n"
31690 " const char *path,\n"
31691 " int64_t size);\n"
31696 #: ../src/guestfs-actions.pod:7577
31698 "If the current file size is less than C<size> then the file is extended to "
31699 "the required size with zero bytes. This creates a sparse file (ie. disk "
31700 "blocks are not allocated for the file until you write to it). To create a "
31701 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
31705 #: ../src/guestfs-actions.pod:7587
31706 msgid "guestfs_tune2fs_l"
31710 #: ../src/guestfs-actions.pod:7589
31714 " guestfs_tune2fs_l (guestfs_h *g,\n"
31715 " const char *device);\n"
31720 #: ../src/guestfs-actions.pod:7609
31721 msgid "guestfs_txz_in"
31725 #: ../src/guestfs-actions.pod:7611
31729 " guestfs_txz_in (guestfs_h *g,\n"
31730 " const char *tarball,\n"
31731 " const char *directory);\n"
31736 #: ../src/guestfs-actions.pod:7623
31737 msgid "guestfs_txz_out"
31741 #: ../src/guestfs-actions.pod:7625
31745 " guestfs_txz_out (guestfs_h *g,\n"
31746 " const char *directory,\n"
31747 " const char *tarball);\n"
31752 #: ../src/guestfs-actions.pod:7637
31753 msgid "guestfs_umask"
31757 #: ../src/guestfs-actions.pod:7639
31761 " guestfs_umask (guestfs_h *g,\n"
31767 #: ../src/guestfs-actions.pod:7655
31769 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
31770 "C<guestfs_mkdir>."
31774 #: ../src/guestfs-actions.pod:7664
31775 msgid "guestfs_umount"
31779 #: ../src/guestfs-actions.pod:7666
31783 " guestfs_umount (guestfs_h *g,\n"
31784 " const char *pathordevice);\n"
31789 #: ../src/guestfs-actions.pod:7678
31790 msgid "guestfs_umount_all"
31794 #: ../src/guestfs-actions.pod:7680
31798 " guestfs_umount_all (guestfs_h *g);\n"
31803 #: ../src/guestfs-actions.pod:7691
31804 msgid "guestfs_upload"
31808 #: ../src/guestfs-actions.pod:7693
31812 " guestfs_upload (guestfs_h *g,\n"
31813 " const char *filename,\n"
31814 " const char *remotefilename);\n"
31819 #: ../src/guestfs-actions.pod:7703
31820 msgid "See also C<guestfs_download>."
31824 #: ../src/guestfs-actions.pod:7714
31825 msgid "guestfs_upload_offset"
31829 #: ../src/guestfs-actions.pod:7716
31833 " guestfs_upload_offset (guestfs_h *g,\n"
31834 " const char *filename,\n"
31835 " const char *remotefilename,\n"
31836 " int64_t offset);\n"
31841 #: ../src/guestfs-actions.pod:7732
31843 "Note that there is no limit on the amount of data that can be uploaded with "
31844 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
31845 "full amount unless an error occurs."
31849 #: ../src/guestfs-actions.pod:7737
31850 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
31854 #: ../src/guestfs-actions.pod:7748
31855 msgid "guestfs_utimens"
31859 #: ../src/guestfs-actions.pod:7750
31863 " guestfs_utimens (guestfs_h *g,\n"
31864 " const char *path,\n"
31865 " int64_t atsecs,\n"
31866 " int64_t atnsecs,\n"
31867 " int64_t mtsecs,\n"
31868 " int64_t mtnsecs);\n"
31873 #: ../src/guestfs-actions.pod:7779 ../src/guestfs-structs.pod:175
31874 msgid "guestfs_version"
31878 #: ../src/guestfs-actions.pod:7781
31881 " struct guestfs_version *\n"
31882 " guestfs_version (guestfs_h *g);\n"
31887 #: ../src/guestfs-actions.pod:7809
31889 "I<Note:> Don't use this call to test for availability of features. In "
31890 "enterprise distributions we backport features from later versions into "
31891 "earlier versions, making this an unreliable way to test for features. Use "
31892 "C<guestfs_available> instead."
31896 #: ../src/guestfs-actions.pod:7815
31898 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
31899 "error. I<The caller must call C<guestfs_free_version> after use>."
31903 #: ../src/guestfs-actions.pod:7819
31904 msgid "(Added in 1.0.58)"
31908 #: ../src/guestfs-actions.pod:7821
31909 msgid "guestfs_vfs_label"
31913 #: ../src/guestfs-actions.pod:7823
31917 " guestfs_vfs_label (guestfs_h *g,\n"
31918 " const char *device);\n"
31923 #: ../src/guestfs-actions.pod:7832
31924 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
31928 #: ../src/guestfs-actions.pod:7837 ../src/guestfs-actions.pod:7874
31929 msgid "(Added in 1.3.18)"
31933 #: ../src/guestfs-actions.pod:7839
31934 msgid "guestfs_vfs_type"
31938 #: ../src/guestfs-actions.pod:7841
31942 " guestfs_vfs_type (guestfs_h *g,\n"
31943 " const char *device);\n"
31948 #: ../src/guestfs-actions.pod:7858
31949 msgid "guestfs_vfs_uuid"
31953 #: ../src/guestfs-actions.pod:7860
31957 " guestfs_vfs_uuid (guestfs_h *g,\n"
31958 " const char *device);\n"
31963 #: ../src/guestfs-actions.pod:7869
31964 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
31968 #: ../src/guestfs-actions.pod:7876
31969 msgid "guestfs_vg_activate"
31973 #: ../src/guestfs-actions.pod:7878
31977 " guestfs_vg_activate (guestfs_h *g,\n"
31979 " char *const *volgroups);\n"
31984 #: ../src/guestfs-actions.pod:7895
31985 msgid "guestfs_vg_activate_all"
31989 #: ../src/guestfs-actions.pod:7897
31993 " guestfs_vg_activate_all (guestfs_h *g,\n"
31994 " int activate);\n"
31999 #: ../src/guestfs-actions.pod:7910
32000 msgid "guestfs_vgcreate"
32004 #: ../src/guestfs-actions.pod:7912
32008 " guestfs_vgcreate (guestfs_h *g,\n"
32009 " const char *volgroup,\n"
32010 " char *const *physvols);\n"
32015 #: ../src/guestfs-actions.pod:7924
32016 msgid "guestfs_vglvuuids"
32020 #: ../src/guestfs-actions.pod:7926
32024 " guestfs_vglvuuids (guestfs_h *g,\n"
32025 " const char *vgname);\n"
32030 #: ../src/guestfs-actions.pod:7933
32032 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
32033 "associate logical volumes and volume groups."
32037 #: ../src/guestfs-actions.pod:7936
32038 msgid "See also C<guestfs_vgpvuuids>."
32042 #: ../src/guestfs-actions.pod:7944
32043 msgid "guestfs_vgpvuuids"
32047 #: ../src/guestfs-actions.pod:7946
32051 " guestfs_vgpvuuids (guestfs_h *g,\n"
32052 " const char *vgname);\n"
32057 #: ../src/guestfs-actions.pod:7953
32059 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
32060 "associate physical volumes and volume groups."
32064 #: ../src/guestfs-actions.pod:7956
32065 msgid "See also C<guestfs_vglvuuids>."
32069 #: ../src/guestfs-actions.pod:7964
32070 msgid "guestfs_vgremove"
32074 #: ../src/guestfs-actions.pod:7966
32078 " guestfs_vgremove (guestfs_h *g,\n"
32079 " const char *vgname);\n"
32084 #: ../src/guestfs-actions.pod:7979
32085 msgid "guestfs_vgrename"
32089 #: ../src/guestfs-actions.pod:7981
32093 " guestfs_vgrename (guestfs_h *g,\n"
32094 " const char *volgroup,\n"
32095 " const char *newvolgroup);\n"
32100 #: ../src/guestfs-actions.pod:7992
32101 msgid "guestfs_vgs"
32105 #: ../src/guestfs-actions.pod:7994
32109 " guestfs_vgs (guestfs_h *g);\n"
32114 #: ../src/guestfs-actions.pod:8003
32115 msgid "See also C<guestfs_vgs_full>."
32119 #: ../src/guestfs-actions.pod:8011
32120 msgid "guestfs_vgs_full"
32124 #: ../src/guestfs-actions.pod:8013
32127 " struct guestfs_lvm_vg_list *\n"
32128 " guestfs_vgs_full (guestfs_h *g);\n"
32133 #: ../src/guestfs-actions.pod:8019
32135 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
32136 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
32141 #: ../src/guestfs-actions.pod:8025
32142 msgid "guestfs_vgscan"
32146 #: ../src/guestfs-actions.pod:8027
32150 " guestfs_vgscan (guestfs_h *g);\n"
32155 #: ../src/guestfs-actions.pod:8037
32156 msgid "guestfs_vguuid"
32160 #: ../src/guestfs-actions.pod:8039
32164 " guestfs_vguuid (guestfs_h *g,\n"
32165 " const char *vgname);\n"
32170 #: ../src/guestfs-actions.pod:8050
32171 msgid "guestfs_wait_ready"
32175 #: ../src/guestfs-actions.pod:8052
32179 " guestfs_wait_ready (guestfs_h *g);\n"
32184 #: ../src/guestfs-actions.pod:8055
32186 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
32191 #: ../src/guestfs-actions.pod:8062
32192 msgid "This function is a no op."
32196 #: ../src/guestfs-actions.pod:8064
32198 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
32199 "calling C<guestfs_launch> to wait for the launch to complete. However this "
32200 "is no longer necessary because C<guestfs_launch> now does the waiting."
32204 #: ../src/guestfs-actions.pod:8069
32206 "If you see any calls to this function in code then you can just remove them, "
32207 "unless you want to retain compatibility with older versions of the API."
32211 #: ../src/guestfs-actions.pod:8077
32212 msgid "guestfs_wc_c"
32216 #: ../src/guestfs-actions.pod:8079
32220 " guestfs_wc_c (guestfs_h *g,\n"
32221 " const char *path);\n"
32226 #: ../src/guestfs-actions.pod:8090
32227 msgid "guestfs_wc_l"
32231 #: ../src/guestfs-actions.pod:8092
32235 " guestfs_wc_l (guestfs_h *g,\n"
32236 " const char *path);\n"
32241 #: ../src/guestfs-actions.pod:8103
32242 msgid "guestfs_wc_w"
32246 #: ../src/guestfs-actions.pod:8105
32250 " guestfs_wc_w (guestfs_h *g,\n"
32251 " const char *path);\n"
32256 #: ../src/guestfs-actions.pod:8116
32257 msgid "guestfs_write"
32261 #: ../src/guestfs-actions.pod:8118
32265 " guestfs_write (guestfs_h *g,\n"
32266 " const char *path,\n"
32267 " const char *content,\n"
32268 " size_t content_size);\n"
32273 #: ../src/guestfs-actions.pod:8127
32274 msgid "See also C<guestfs_write_append>."
32278 #: ../src/guestfs-actions.pod:8136
32279 msgid "guestfs_write_append"
32283 #: ../src/guestfs-actions.pod:8138
32287 " guestfs_write_append (guestfs_h *g,\n"
32288 " const char *path,\n"
32289 " const char *content,\n"
32290 " size_t content_size);\n"
32295 #: ../src/guestfs-actions.pod:8147
32296 msgid "See also C<guestfs_write>."
32300 #: ../src/guestfs-actions.pod:8156
32301 msgid "guestfs_write_file"
32305 #: ../src/guestfs-actions.pod:8158
32309 " guestfs_write_file (guestfs_h *g,\n"
32310 " const char *path,\n"
32311 " const char *content,\n"
32317 #: ../src/guestfs-actions.pod:8164
32319 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
32324 #: ../src/guestfs-actions.pod:8189
32325 msgid "guestfs_zegrep"
32329 #: ../src/guestfs-actions.pod:8191
32333 " guestfs_zegrep (guestfs_h *g,\n"
32334 " const char *regex,\n"
32335 " const char *path);\n"
32340 #: ../src/guestfs-actions.pod:8208
32341 msgid "guestfs_zegrepi"
32345 #: ../src/guestfs-actions.pod:8210
32349 " guestfs_zegrepi (guestfs_h *g,\n"
32350 " const char *regex,\n"
32351 " const char *path);\n"
32356 #: ../src/guestfs-actions.pod:8227
32357 msgid "guestfs_zero"
32361 #: ../src/guestfs-actions.pod:8229
32365 " guestfs_zero (guestfs_h *g,\n"
32366 " const char *device);\n"
32371 #: ../src/guestfs-actions.pod:8243
32373 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
32374 "C<guestfs_is_zero_device>"
32378 #: ../src/guestfs-actions.pod:8255
32379 msgid "guestfs_zero_device"
32383 #: ../src/guestfs-actions.pod:8257
32387 " guestfs_zero_device (guestfs_h *g,\n"
32388 " const char *device);\n"
32393 #: ../src/guestfs-actions.pod:8261
32395 "This command writes zeroes over the entire C<device>. Compare with "
32396 "C<guestfs_zero> which just zeroes the first few blocks of a device."
32400 #: ../src/guestfs-actions.pod:8276
32401 msgid "(Added in 1.3.1)"
32405 #: ../src/guestfs-actions.pod:8278
32406 msgid "guestfs_zerofree"
32410 #: ../src/guestfs-actions.pod:8280
32414 " guestfs_zerofree (guestfs_h *g,\n"
32415 " const char *device);\n"
32420 #: ../src/guestfs-actions.pod:8299
32421 msgid "guestfs_zfgrep"
32425 #: ../src/guestfs-actions.pod:8301
32429 " guestfs_zfgrep (guestfs_h *g,\n"
32430 " const char *pattern,\n"
32431 " const char *path);\n"
32436 #: ../src/guestfs-actions.pod:8318
32437 msgid "guestfs_zfgrepi"
32441 #: ../src/guestfs-actions.pod:8320
32445 " guestfs_zfgrepi (guestfs_h *g,\n"
32446 " const char *pattern,\n"
32447 " const char *path);\n"
32452 #: ../src/guestfs-actions.pod:8337
32453 msgid "guestfs_zfile"
32457 #: ../src/guestfs-actions.pod:8339
32461 " guestfs_zfile (guestfs_h *g,\n"
32462 " const char *meth,\n"
32463 " const char *path);\n"
32468 #: ../src/guestfs-actions.pod:8344
32470 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
32475 #: ../src/guestfs-actions.pod:8356
32477 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
32482 #: ../src/guestfs-actions.pod:8364
32483 msgid "guestfs_zgrep"
32487 #: ../src/guestfs-actions.pod:8366
32491 " guestfs_zgrep (guestfs_h *g,\n"
32492 " const char *regex,\n"
32493 " const char *path);\n"
32498 #: ../src/guestfs-actions.pod:8383
32499 msgid "guestfs_zgrepi"
32503 #: ../src/guestfs-actions.pod:8385
32507 " guestfs_zgrepi (guestfs_h *g,\n"
32508 " const char *regex,\n"
32509 " const char *path);\n"
32514 #: ../src/guestfs-availability.pod:3
32519 #: ../src/guestfs-availability.pod:5
32521 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
32522 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
32523 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
32524 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
32525 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
32529 #: ../src/guestfs-availability.pod:21
32534 #: ../src/guestfs-availability.pod:23
32535 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
32539 #: ../src/guestfs-availability.pod:26
32544 #: ../src/guestfs-availability.pod:28
32545 msgid "The following functions: L</guestfs_grub_install>"
32549 #: ../src/guestfs-availability.pod:31
32554 #: ../src/guestfs-availability.pod:33
32556 "The following functions: L</guestfs_inotify_add_watch> "
32557 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
32558 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
32562 #: ../src/guestfs-availability.pod:41
32563 msgid "B<linuxfsuuid>"
32567 #: ../src/guestfs-availability.pod:43
32569 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
32570 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
32574 #: ../src/guestfs-availability.pod:50
32575 msgid "B<linuxmodules>"
32579 #: ../src/guestfs-availability.pod:52
32580 msgid "The following functions: L</guestfs_modprobe>"
32584 #: ../src/guestfs-availability.pod:55
32585 msgid "B<linuxxattrs>"
32589 #: ../src/guestfs-availability.pod:57
32591 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
32592 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
32593 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
32594 "L</guestfs_setxattr>"
32598 #: ../src/guestfs-availability.pod:68
32603 #: ../src/guestfs-availability.pod:70
32605 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
32606 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
32607 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
32611 #: ../src/guestfs-availability.pod:79
32616 #: ../src/guestfs-availability.pod:81
32618 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
32619 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
32620 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
32621 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
32622 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
32623 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
32624 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
32625 "L</guestfs_vgs_full>"
32629 #: ../src/guestfs-availability.pod:104
32634 #: ../src/guestfs-availability.pod:106
32636 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
32637 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
32641 #: ../src/guestfs-availability.pod:112
32646 #: ../src/guestfs-availability.pod:114
32647 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
32651 #: ../src/guestfs-availability.pod:117
32652 msgid "B<ntfsprogs>"
32656 #: ../src/guestfs-availability.pod:119
32658 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
32659 "L</guestfs_ntfsresize_size>"
32663 #: ../src/guestfs-availability.pod:124
32664 msgid "B<realpath>"
32668 #: ../src/guestfs-availability.pod:126
32669 msgid "The following functions: L</guestfs_realpath>"
32673 #: ../src/guestfs-availability.pod:129
32678 #: ../src/guestfs-availability.pod:131
32680 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
32681 "L</guestfs_scrub_freespace>"
32685 #: ../src/guestfs-availability.pod:136
32690 #: ../src/guestfs-availability.pod:138
32691 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
32695 #: ../src/guestfs-availability.pod:142
32700 #: ../src/guestfs-availability.pod:144
32701 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
32705 #: ../src/guestfs-availability.pod:148
32706 msgid "B<zerofree>"
32710 #: ../src/guestfs-availability.pod:150
32711 msgid "The following functions: L</guestfs_zerofree>"
32715 #: ../src/guestfs-structs.pod:1
32716 msgid "guestfs_int_bool"
32720 #: ../src/guestfs-structs.pod:3
32723 " struct guestfs_int_bool {\n"
32731 #: ../src/guestfs-structs.pod:8
32734 " struct guestfs_int_bool_list {\n"
32735 " uint32_t len; /* Number of elements in list. */\n"
32736 " struct guestfs_int_bool *val; /* Elements. */\n"
32742 #: ../src/guestfs-structs.pod:13
32745 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
32746 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
32751 #: ../src/guestfs-structs.pod:16
32752 msgid "guestfs_lvm_pv"
32756 #: ../src/guestfs-structs.pod:18
32759 " struct guestfs_lvm_pv {\n"
32760 " char *pv_name;\n"
32761 " /* The next field is NOT nul-terminated, be careful when printing it: "
32763 " char pv_uuid[32];\n"
32765 " uint64_t pv_size;\n"
32766 " uint64_t dev_size;\n"
32767 " uint64_t pv_free;\n"
32768 " uint64_t pv_used;\n"
32769 " char *pv_attr;\n"
32770 " int64_t pv_pe_count;\n"
32771 " int64_t pv_pe_alloc_count;\n"
32772 " char *pv_tags;\n"
32773 " uint64_t pe_start;\n"
32774 " int64_t pv_mda_count;\n"
32775 " uint64_t pv_mda_free;\n"
32781 #: ../src/guestfs-structs.pod:36
32784 " struct guestfs_lvm_pv_list {\n"
32785 " uint32_t len; /* Number of elements in list. */\n"
32786 " struct guestfs_lvm_pv *val; /* Elements. */\n"
32792 #: ../src/guestfs-structs.pod:41
32795 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
32796 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
32801 #: ../src/guestfs-structs.pod:44
32802 msgid "guestfs_lvm_vg"
32806 #: ../src/guestfs-structs.pod:46
32809 " struct guestfs_lvm_vg {\n"
32810 " char *vg_name;\n"
32811 " /* The next field is NOT nul-terminated, be careful when printing it: "
32813 " char vg_uuid[32];\n"
32815 " char *vg_attr;\n"
32816 " uint64_t vg_size;\n"
32817 " uint64_t vg_free;\n"
32818 " char *vg_sysid;\n"
32819 " uint64_t vg_extent_size;\n"
32820 " int64_t vg_extent_count;\n"
32821 " int64_t vg_free_count;\n"
32822 " int64_t max_lv;\n"
32823 " int64_t max_pv;\n"
32824 " int64_t pv_count;\n"
32825 " int64_t lv_count;\n"
32826 " int64_t snap_count;\n"
32827 " int64_t vg_seqno;\n"
32828 " char *vg_tags;\n"
32829 " int64_t vg_mda_count;\n"
32830 " uint64_t vg_mda_free;\n"
32836 #: ../src/guestfs-structs.pod:69
32839 " struct guestfs_lvm_vg_list {\n"
32840 " uint32_t len; /* Number of elements in list. */\n"
32841 " struct guestfs_lvm_vg *val; /* Elements. */\n"
32847 #: ../src/guestfs-structs.pod:74
32850 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
32851 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
32856 #: ../src/guestfs-structs.pod:77
32857 msgid "guestfs_lvm_lv"
32861 #: ../src/guestfs-structs.pod:79
32864 " struct guestfs_lvm_lv {\n"
32865 " char *lv_name;\n"
32866 " /* The next field is NOT nul-terminated, be careful when printing it: "
32868 " char lv_uuid[32];\n"
32869 " char *lv_attr;\n"
32870 " int64_t lv_major;\n"
32871 " int64_t lv_minor;\n"
32872 " int64_t lv_kernel_major;\n"
32873 " int64_t lv_kernel_minor;\n"
32874 " uint64_t lv_size;\n"
32875 " int64_t seg_count;\n"
32877 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32878 " float snap_percent;\n"
32879 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32880 " float copy_percent;\n"
32881 " char *move_pv;\n"
32882 " char *lv_tags;\n"
32883 " char *mirror_log;\n"
32884 " char *modules;\n"
32890 #: ../src/guestfs-structs.pod:101
32893 " struct guestfs_lvm_lv_list {\n"
32894 " uint32_t len; /* Number of elements in list. */\n"
32895 " struct guestfs_lvm_lv *val; /* Elements. */\n"
32901 #: ../src/guestfs-structs.pod:106
32904 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
32905 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
32910 #: ../src/guestfs-structs.pod:111
32913 " struct guestfs_stat {\n"
32917 " int64_t nlink;\n"
32922 " int64_t blksize;\n"
32923 " int64_t blocks;\n"
32924 " int64_t atime;\n"
32925 " int64_t mtime;\n"
32926 " int64_t ctime;\n"
32932 #: ../src/guestfs-structs.pod:127
32935 " struct guestfs_stat_list {\n"
32936 " uint32_t len; /* Number of elements in list. */\n"
32937 " struct guestfs_stat *val; /* Elements. */\n"
32943 #: ../src/guestfs-structs.pod:132
32946 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
32947 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
32952 #: ../src/guestfs-structs.pod:137
32955 " struct guestfs_statvfs {\n"
32956 " int64_t bsize;\n"
32957 " int64_t frsize;\n"
32958 " int64_t blocks;\n"
32959 " int64_t bfree;\n"
32960 " int64_t bavail;\n"
32961 " int64_t files;\n"
32962 " int64_t ffree;\n"
32963 " int64_t favail;\n"
32966 " int64_t namemax;\n"
32972 #: ../src/guestfs-structs.pod:151
32975 " struct guestfs_statvfs_list {\n"
32976 " uint32_t len; /* Number of elements in list. */\n"
32977 " struct guestfs_statvfs *val; /* Elements. */\n"
32983 #: ../src/guestfs-structs.pod:156
32986 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
32987 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
32992 #: ../src/guestfs-structs.pod:159
32993 msgid "guestfs_dirent"
32997 #: ../src/guestfs-structs.pod:161
33000 " struct guestfs_dirent {\n"
33009 #: ../src/guestfs-structs.pod:167
33012 " struct guestfs_dirent_list {\n"
33013 " uint32_t len; /* Number of elements in list. */\n"
33014 " struct guestfs_dirent *val; /* Elements. */\n"
33020 #: ../src/guestfs-structs.pod:172
33023 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
33024 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
33029 #: ../src/guestfs-structs.pod:177
33032 " struct guestfs_version {\n"
33033 " int64_t major;\n"
33034 " int64_t minor;\n"
33035 " int64_t release;\n"
33042 #: ../src/guestfs-structs.pod:184
33045 " struct guestfs_version_list {\n"
33046 " uint32_t len; /* Number of elements in list. */\n"
33047 " struct guestfs_version *val; /* Elements. */\n"
33053 #: ../src/guestfs-structs.pod:189
33056 " void guestfs_free_version (struct guestfs_free_version *);\n"
33057 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
33062 #: ../src/guestfs-structs.pod:192
33063 msgid "guestfs_xattr"
33067 #: ../src/guestfs-structs.pod:194
33070 " struct guestfs_xattr {\n"
33071 " char *attrname;\n"
33072 " /* The next two fields describe a byte array. */\n"
33073 " uint32_t attrval_len;\n"
33074 " char *attrval;\n"
33080 #: ../src/guestfs-structs.pod:201
33083 " struct guestfs_xattr_list {\n"
33084 " uint32_t len; /* Number of elements in list. */\n"
33085 " struct guestfs_xattr *val; /* Elements. */\n"
33091 #: ../src/guestfs-structs.pod:206
33094 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
33095 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
33100 #: ../src/guestfs-structs.pod:209
33101 msgid "guestfs_inotify_event"
33105 #: ../src/guestfs-structs.pod:211
33108 " struct guestfs_inotify_event {\n"
33109 " int64_t in_wd;\n"
33110 " uint32_t in_mask;\n"
33111 " uint32_t in_cookie;\n"
33112 " char *in_name;\n"
33118 #: ../src/guestfs-structs.pod:218
33121 " struct guestfs_inotify_event_list {\n"
33122 " uint32_t len; /* Number of elements in list. */\n"
33123 " struct guestfs_inotify_event *val; /* Elements. */\n"
33129 #: ../src/guestfs-structs.pod:223
33132 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
33133 " void guestfs_free_inotify_event_list (struct "
33134 "guestfs_free_inotify_event_list *);\n"
33139 #: ../src/guestfs-structs.pod:226
33140 msgid "guestfs_partition"
33144 #: ../src/guestfs-structs.pod:228
33147 " struct guestfs_partition {\n"
33148 " int32_t part_num;\n"
33149 " uint64_t part_start;\n"
33150 " uint64_t part_end;\n"
33151 " uint64_t part_size;\n"
33157 #: ../src/guestfs-structs.pod:235
33160 " struct guestfs_partition_list {\n"
33161 " uint32_t len; /* Number of elements in list. */\n"
33162 " struct guestfs_partition *val; /* Elements. */\n"
33168 #: ../src/guestfs-structs.pod:240
33171 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
33172 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
33177 #: ../src/guestfs-structs.pod:243
33178 msgid "guestfs_application"
33182 #: ../src/guestfs-structs.pod:245
33185 " struct guestfs_application {\n"
33186 " char *app_name;\n"
33187 " char *app_display_name;\n"
33188 " int32_t app_epoch;\n"
33189 " char *app_version;\n"
33190 " char *app_release;\n"
33191 " char *app_install_path;\n"
33192 " char *app_trans_path;\n"
33193 " char *app_publisher;\n"
33194 " char *app_url;\n"
33195 " char *app_source_package;\n"
33196 " char *app_summary;\n"
33197 " char *app_description;\n"
33203 #: ../src/guestfs-structs.pod:260
33206 " struct guestfs_application_list {\n"
33207 " uint32_t len; /* Number of elements in list. */\n"
33208 " struct guestfs_application *val; /* Elements. */\n"
33214 #: ../src/guestfs-structs.pod:265
33217 " void guestfs_free_application (struct guestfs_free_application *);\n"
33218 " void guestfs_free_application_list (struct guestfs_free_application_list "
33224 #: ../src/guestfs.pod:5
33225 msgid "guestfs - Library for accessing and modifying virtual machine images"
33229 #: ../src/guestfs.pod:11
33232 " guestfs_h *g = guestfs_create ();\n"
33233 " guestfs_add_drive (g, \"guest.img\");\n"
33234 " guestfs_launch (g);\n"
33235 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33236 " guestfs_touch (g, \"/hello\");\n"
33237 " guestfs_umount (g, \"/\");\n"
33238 " guestfs_close (g);\n"
33243 #: ../src/guestfs.pod:25
33245 "Libguestfs is a library for accessing and modifying guest disk images. "
33246 "Amongst the things this is good for: making batch configuration changes to "
33247 "guests, getting disk used/free statistics (see also: virt-df), migrating "
33248 "between virtualization systems (see also: virt-p2v), performing partial "
33249 "backups, performing partial guest clones, cloning guests and changing "
33250 "registry/UUID/hostname info, and much else besides."
33254 #: ../src/guestfs.pod:33
33256 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
33257 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
33258 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
33263 #: ../src/guestfs.pod:38
33265 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
33266 "what filesystem is in each LV, etc.). It can also run commands in the "
33267 "context of the guest. Also you can access filesystems over FUSE."
33271 #: ../src/guestfs.pod:43
33273 "Libguestfs is a library that can be linked with C and C++ management "
33274 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
33275 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
33280 #: ../src/guestfs.pod:48
33282 "You don't need to be root to use libguestfs, although obviously you do need "
33283 "enough permissions to access the disk images."
33287 #: ../src/guestfs.pod:51
33289 "Libguestfs is a large API because it can do many things. For a gentle "
33290 "introduction, please read the L</API OVERVIEW> section next."
33294 #: ../src/guestfs.pod:54
33296 "There are also some example programs in the L<guestfs-examples(3)> manual "
33301 #: ../src/guestfs.pod:57
33302 msgid "API OVERVIEW"
33306 #: ../src/guestfs.pod:59
33308 "This section provides a gentler overview of the libguestfs API. We also try "
33309 "to group API calls together, where that may not be obvious from reading "
33310 "about the individual calls in the main section of this manual."
33314 #: ../src/guestfs.pod:64
33319 #: ../src/guestfs.pod:66
33321 "Before you can use libguestfs calls, you have to create a handle. Then you "
33322 "must add at least one disk image to the handle, followed by launching the "
33323 "handle, then performing whatever operations you want, and finally closing "
33324 "the handle. By convention we use the single letter C<g> for the name of the "
33325 "handle variable, although of course you can use any name you want."
33329 #: ../src/guestfs.pod:73
33330 msgid "The general structure of all libguestfs-using programs looks like this:"
33334 #: ../src/guestfs.pod:76
33337 " guestfs_h *g = guestfs_create ();\n"
33342 #: ../src/guestfs.pod:78
33345 " /* Call guestfs_add_drive additional times if there are\n"
33346 " * multiple disk images.\n"
33348 " guestfs_add_drive (g, \"guest.img\");\n"
33353 #: ../src/guestfs.pod:83
33356 " /* Most manipulation calls won't work until you've launched\n"
33357 " * the handle 'g'. You have to do this _after_ adding drives\n"
33358 " * and _before_ other commands.\n"
33360 " guestfs_launch (g);\n"
33365 #: ../src/guestfs.pod:89
33368 " /* Now you can examine what partitions, LVs etc are available.\n"
33370 " char **partitions = guestfs_list_partitions (g);\n"
33371 " char **logvols = guestfs_lvs (g);\n"
33376 #: ../src/guestfs.pod:94
33379 " /* To access a filesystem in the image, you must mount it.\n"
33381 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
33386 #: ../src/guestfs.pod:98
33389 " /* Now you can perform filesystem actions on the guest\n"
33392 " guestfs_touch (g, \"/hello\");\n"
33397 #: ../src/guestfs.pod:103
33400 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
33401 " * it is done automatically when you close the handle. See\n"
33402 " * discussion of autosync in this page.\n"
33404 " guestfs_sync (g);\n"
33409 #: ../src/guestfs.pod:109
33412 " /* Close the handle 'g'. */\n"
33413 " guestfs_close (g);\n"
33418 #: ../src/guestfs.pod:112
33420 "The code above doesn't include any error checking. In real code you should "
33421 "check return values carefully for errors. In general all functions that "
33422 "return integers return C<-1> on error, and all functions that return "
33423 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
33424 "how to handle errors, and consult the documentation for each function call "
33425 "below to see precisely how they return error indications. See "
33426 "L<guestfs-examples(3)> for fully worked examples."
33430 #: ../src/guestfs.pod:121
33431 msgid "DISK IMAGES"
33435 #: ../src/guestfs.pod:123
33437 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
33438 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
33439 "actual block device, or simply an empty file of zeroes that you have created "
33440 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
33445 #: ../src/guestfs.pod:129
33447 "The call you should use in modern code for adding drives is "
33448 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
33449 "specifying that the format is raw, do:"
33453 #: ../src/guestfs.pod:133
33456 " guestfs_add_drive_opts (g, filename,\n"
33457 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33463 #: ../src/guestfs.pod:137
33464 msgid "You can add a disk read-only using:"
33468 #: ../src/guestfs.pod:139
33471 " guestfs_add_drive_opts (g, filename,\n"
33472 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
33473 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
33479 #: ../src/guestfs.pod:144
33481 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
33482 "libguestfs won't modify the file."
33486 #: ../src/guestfs.pod:147
33488 "Be extremely cautious if the disk image is in use, eg. if it is being used "
33489 "by a virtual machine. Adding it read-write will almost certainly cause disk "
33490 "corruption, but adding it read-only is safe."
33494 #: ../src/guestfs.pod:151
33496 "You must add at least one disk image, and you may add multiple disk images. "
33497 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
33498 "first one you added), C</dev/sdb> (for the second one you added), etc."
33502 #: ../src/guestfs.pod:156
33504 "Once L</guestfs_launch> has been called you cannot add any more images. You "
33505 "can call L</guestfs_list_devices> to get a list of the device names, in the "
33506 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
33510 #: ../src/guestfs.pod:161
33515 #: ../src/guestfs.pod:163
33517 "Before you can read or write files, create directories and so on in a disk "
33518 "image that contains filesystems, you have to mount those filesystems using "
33519 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
33520 "a disk image contains (for example) one partition with a filesystem on that "
33521 "partition, then you can mount it directly:"
33525 #: ../src/guestfs.pod:170
33528 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
33533 #: ../src/guestfs.pod:172
33535 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
33536 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
33537 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
33538 "that these are libguestfs virtual devices, and are nothing to do with host "
33543 #: ../src/guestfs.pod:178
33545 "If you are given a disk image and you don't know what it contains then you "
33546 "have to find out. Libguestfs can do that too: use "
33547 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
33548 "and LVs, and either try mounting each to see what is mountable, or else "
33549 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
33550 "filesystems, use L</guestfs_list_filesystems>."
33554 #: ../src/guestfs.pod:186
33556 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
33557 "L</INSPECTION> below). But you might find it easier to look at higher level "
33558 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
33562 #: ../src/guestfs.pod:191
33564 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
33565 "several other variations of the C<guestfs_mount_*> call."
33569 #: ../src/guestfs.pod:194
33570 msgid "FILESYSTEM ACCESS AND MODIFICATION"
33574 #: ../src/guestfs.pod:196
33576 "The majority of the libguestfs API consists of fairly low-level calls for "
33577 "accessing and modifying the files, directories, symlinks etc on mounted "
33578 "filesystems. There are over a hundred such calls which you can find listed "
33579 "in detail below in this man page, and we don't even pretend to cover them "
33580 "all in this overview."
33584 #: ../src/guestfs.pod:202
33586 "Specify filenames as full paths, starting with C<\"/\"> and including the "
33591 #: ../src/guestfs.pod:205
33593 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
33594 "the file called C<\"etc/passwd\"> then you could do:"
33598 #: ../src/guestfs.pod:208
33601 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
33606 #: ../src/guestfs.pod:210
33608 "This would return C<data> as a newly allocated buffer containing the full "
33609 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
33610 "or C<NULL> if there was an error."
33614 #: ../src/guestfs.pod:214
33616 "As another example, to create a top-level directory on that filesystem "
33617 "called C<\"var\"> you would do:"
33621 #: ../src/guestfs.pod:217
33624 " guestfs_mkdir (g, \"/var\");\n"
33629 #: ../src/guestfs.pod:219
33630 msgid "To create a symlink you could do:"
33634 #: ../src/guestfs.pod:221
33637 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
33638 " \"/etc/rc3.d/S30portmap\");\n"
33643 #: ../src/guestfs.pod:224
33645 "Libguestfs will reject attempts to use relative paths and there is no "
33646 "concept of a current working directory."
33650 #: ../src/guestfs.pod:227
33652 "Libguestfs can return errors in many situations: for example if the "
33653 "filesystem isn't writable, or if a file or directory that you requested "
33654 "doesn't exist. If you are using the C API (documented here) you have to "
33655 "check for those error conditions after each call. (Other language bindings "
33656 "turn these errors into exceptions)."
33660 #: ../src/guestfs.pod:233
33662 "File writes are affected by the per-handle umask, set by calling "
33663 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
33667 #: ../src/guestfs.pod:236
33668 msgid "PARTITIONING"
33672 #: ../src/guestfs.pod:238
33674 "Libguestfs contains API calls to read, create and modify partition tables on "
33679 #: ../src/guestfs.pod:241
33681 "In the common case where you want to create a single partition covering the "
33682 "whole disk, you should use the L</guestfs_part_disk> call:"
33686 #: ../src/guestfs.pod:245
33689 " const char *parttype = \"mbr\";\n"
33690 " if (disk_is_larger_than_2TB)\n"
33691 " parttype = \"gpt\";\n"
33692 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
33697 #: ../src/guestfs.pod:250
33699 "Obviously this effectively wipes anything that was on that disk image "
33704 #: ../src/guestfs.pod:253
33709 #: ../src/guestfs.pod:255
33711 "Libguestfs provides access to a large part of the LVM2 API, such as "
33712 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
33713 "unless you familiarize yourself with the concepts of physical volumes, "
33714 "volume groups and logical volumes."
33718 #: ../src/guestfs.pod:260
33720 "This author strongly recommends reading the LVM HOWTO, online at "
33721 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
33725 #: ../src/guestfs.pod:263
33726 msgid "DOWNLOADING"
33730 #: ../src/guestfs.pod:265
33732 "Use L</guestfs_cat> to download small, text only files. This call is "
33733 "limited to files which are less than 2 MB and which cannot contain any ASCII "
33734 "NUL (C<\\0>) characters. However the API is very simple to use."
33738 #: ../src/guestfs.pod:269
33740 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
33741 "bit data, since it returns a (pointer, size) pair. However it is still "
33742 "limited to \"small\" files, less than 2 MB."
33746 #: ../src/guestfs.pod:273
33748 "L</guestfs_download> can be used to download any file, with no limits on "
33749 "content or size (even files larger than 4 GB)."
33753 #: ../src/guestfs.pod:276
33754 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
33758 #: ../src/guestfs.pod:279
33763 #: ../src/guestfs.pod:281
33765 "It's often the case that you want to write a file or files to the disk "
33770 #: ../src/guestfs.pod:284
33772 "To write a small file with fixed content, use L</guestfs_write>. To create "
33773 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
33774 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
33775 "variety of other functions for creating test files, for example "
33776 "L</guestfs_fill> and L</guestfs_fill_pattern>."
33780 #: ../src/guestfs.pod:290
33782 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
33783 "file content or size (even files larger than 4 GB)."
33787 #: ../src/guestfs.pod:293
33788 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
33792 #: ../src/guestfs.pod:295
33794 "However the fastest way to upload I<large numbers of arbitrary files> is to "
33795 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
33796 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
33797 "the drive in a predictable way (eg. adding it last after all other drives) "
33798 "then you can get the device name from L</guestfs_list_devices> and mount it "
33799 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
33800 "sometimes non-portable between kernel versions, and they don't support "
33801 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
33802 "using a label or UUID, use an ISO image instead."
33806 #: ../src/guestfs.pod:306
33811 #: ../src/guestfs.pod:308
33813 "There are various different commands for copying between files and devices "
33814 "and in and out of the guest filesystem. These are summarised in the table "
33819 #: ../src/guestfs.pod:314
33820 msgid "B<file> to B<file>"
33824 #: ../src/guestfs.pod:316
33826 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
33827 "directories recursively."
33831 #: ../src/guestfs.pod:319
33832 msgid "To copy part of a file (offset and size) use L</guestfs_copy_file_to_file>."
33836 #: ../src/guestfs.pod:322
33837 msgid "B<file> to B<device>"
33841 #: ../src/guestfs.pod:324
33842 msgid "B<device> to B<file>"
33846 #: ../src/guestfs.pod:326
33847 msgid "B<device> to B<device>"
33851 #: ../src/guestfs.pod:328
33853 "Use L</guestfs_copy_file_to_device>, L</guestfs_copy_device_to_file>, or "
33854 "L</guestfs_copy_device_to_device>."
33858 #: ../src/guestfs.pod:331
33859 msgid "Example: duplicate the contents of an LV:"
33863 #: ../src/guestfs.pod:333
33866 " guestfs_copy_device_to_device (g,\n"
33867 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
33868 " /* -1 marks the end of the list of optional parameters */\n"
33874 #: ../src/guestfs.pod:338
33876 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
33877 "(C</dev/VG/Original>). To copy less than the whole source device, use the "
33878 "optional C<size> parameter:"
33882 #: ../src/guestfs.pod:342
33885 " guestfs_copy_device_to_device (g,\n"
33886 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
33887 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, 10000,\n"
33893 #: ../src/guestfs.pod:347
33894 msgid "B<file on the host> to B<file or device>"
33898 #: ../src/guestfs.pod:349
33899 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
33903 #: ../src/guestfs.pod:351
33904 msgid "B<file or device> to B<file on the host>"
33908 #: ../src/guestfs.pod:353
33909 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
33913 #: ../src/guestfs.pod:357
33914 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
33918 #: ../src/guestfs.pod:359
33920 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
33921 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
33922 "appears you can only upload and download to files. However many Un*x-like "
33923 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
33924 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
33925 "stderr, and arbitrary file descriptor N."
33929 #: ../src/guestfs.pod:367
33930 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
33934 #: ../src/guestfs.pod:370
33937 " guestfs_download (g, filename, \"/dev/stdout\");\n"
33942 #: ../src/guestfs.pod:372
33943 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
33947 #: ../src/guestfs.pod:374
33950 " char devfd[64];\n"
33951 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
33952 " guestfs_tar_out (g, \"/\", devfd);\n"
33957 #: ../src/guestfs.pod:378
33958 msgid "LISTING FILES"
33962 #: ../src/guestfs.pod:380
33964 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
33965 "L<guestfish(1)>-equivalent command C<ll>)."
33969 #: ../src/guestfs.pod:383
33971 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
33972 "programs, as a flat list of strings."
33976 #: ../src/guestfs.pod:386
33978 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
33979 "directory, plus additional information about each one. It is more "
33980 "equivalent to using the L<readdir(3)> call on a local filesystem."
33984 #: ../src/guestfs.pod:390
33986 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
33991 #: ../src/guestfs.pod:393
33992 msgid "RUNNING COMMANDS"
33996 #: ../src/guestfs.pod:395
33998 "Although libguestfs is primarily an API for manipulating files inside guest "
33999 "images, we also provide some limited facilities for running commands inside "
34004 #: ../src/guestfs.pod:399
34005 msgid "There are many limitations to this:"
34009 #: ../src/guestfs.pod:405
34011 "The kernel version that the command runs under will be different from what "
34016 #: ../src/guestfs.pod:410
34018 "If the command needs to communicate with daemons, then most likely they "
34019 "won't be running."
34023 #: ../src/guestfs.pod:415
34024 msgid "The command will be running in limited memory."
34028 #: ../src/guestfs.pod:419
34030 "The network may not be available unless you enable it (see "
34031 "L</guestfs_set_network>)."
34035 #: ../src/guestfs.pod:424
34036 msgid "Only supports Linux guests (not Windows, BSD, etc)."
34040 #: ../src/guestfs.pod:428
34041 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
34045 #: ../src/guestfs.pod:433
34047 "For SELinux guests, you may need to enable SELinux and load policy first. "
34048 "See L</SELINUX> in this manpage."
34052 #: ../src/guestfs.pod:438
34054 "I<Security:> It is not safe to run commands from untrusted, possibly "
34055 "malicious guests. These commands may attempt to exploit your program by "
34056 "sending unexpected output. They could also try to exploit the Linux kernel "
34057 "or qemu provided by the libguestfs appliance. They could use the network "
34058 "provided by the libguestfs appliance to bypass ordinary network partitions "
34059 "and firewalls. They could use the elevated privileges or different SELinux "
34060 "context of your program to their advantage."
34064 #: ../src/guestfs.pod:447
34066 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
34067 "(a script which runs when the guest next boots normally), and to have this "
34068 "script run the commands you want in the normal context of the running guest, "
34069 "network security and so on. For information about other security issues, "
34070 "see L</SECURITY>."
34074 #: ../src/guestfs.pod:455
34076 "The two main API calls to run commands are L</guestfs_command> and "
34077 "L</guestfs_sh> (there are also variations)."
34081 #: ../src/guestfs.pod:458
34083 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
34084 "shell globs, redirections, etc will work."
34088 #: ../src/guestfs.pod:461
34089 msgid "CONFIGURATION FILES"
34093 #: ../src/guestfs.pod:463
34095 "To read and write configuration files in Linux guest filesystems, we "
34096 "strongly recommend using Augeas. For example, Augeas understands how to "
34097 "read and write, say, a Linux shadow password file or X.org configuration "
34098 "file, and so avoids you having to write that code."
34102 #: ../src/guestfs.pod:468
34104 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
34105 "document Augeas itself here because there is excellent documentation on the "
34106 "L<http://augeas.net/> website."
34110 #: ../src/guestfs.pod:472
34112 "If you don't want to use Augeas (you fool!) then try calling "
34113 "L</guestfs_read_lines> to get the file as a list of lines which you can "
34118 #: ../src/guestfs.pod:476
34123 #: ../src/guestfs.pod:478
34125 "We support SELinux guests. To ensure that labeling happens correctly in "
34126 "SELinux guests, you need to enable SELinux and load the guest's policy:"
34130 #: ../src/guestfs.pod:486
34131 msgid "Before launching, do:"
34135 #: ../src/guestfs.pod:488
34138 " guestfs_set_selinux (g, 1);\n"
34143 #: ../src/guestfs.pod:492
34145 "After mounting the guest's filesystem(s), load the policy. This is best "
34146 "done by running the L<load_policy(8)> command in the guest itself:"
34150 #: ../src/guestfs.pod:496
34153 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
34158 #: ../src/guestfs.pod:498
34160 "(Older versions of C<load_policy> require you to specify the name of the "
34165 #: ../src/guestfs.pod:503
34167 "Optionally, set the security context for the API. The correct security "
34168 "context to use can only be known by inspecting the guest. As an example:"
34172 #: ../src/guestfs.pod:507
34175 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
34180 #: ../src/guestfs.pod:511
34181 msgid "This will work for running commands and editing existing files."
34185 #: ../src/guestfs.pod:513
34187 "When new files are created, you may need to label them explicitly, for "
34188 "example by running the external command C<restorecon pathname>."
34192 #: ../src/guestfs.pod:517
34197 #: ../src/guestfs.pod:519
34199 "Certain calls are affected by the current file mode creation mask (the "
34200 "\"umask\"). In particular ones which create files or directories, such as "
34201 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
34202 "either the default mode that the file is created with or modifies the mode "
34207 #: ../src/guestfs.pod:525
34209 "The default umask is C<022>, so files are created with modes such as C<0644> "
34210 "and directories with C<0755>."
34214 #: ../src/guestfs.pod:528
34216 "There are two ways to avoid being affected by umask. Either set umask to 0 "
34217 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
34218 "L</guestfs_chmod> after creating each file or directory."
34222 #: ../src/guestfs.pod:532
34223 msgid "For more information about umask, see L<umask(2)>."
34227 #: ../src/guestfs.pod:536
34229 "Libguestfs allows you to access Linux guests which have been encrypted using "
34230 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
34231 "standard. This includes nearly all whole disk encryption systems used by "
34232 "modern Linux guests."
34236 #: ../src/guestfs.pod:542
34238 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
34239 "returns the string C<crypto_LUKS>)."
34243 #: ../src/guestfs.pod:545
34245 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
34246 "will require the passphrase!"
34250 #: ../src/guestfs.pod:548
34252 "Opening a LUKS device creates a new device mapper device called "
34253 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
34254 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
34255 "decrypted from and encrypted to the underlying block device respectively."
34259 #: ../src/guestfs.pod:554
34261 "LVM volume groups on the device can be made visible by calling "
34262 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
34263 "volume(s) can now be mounted in the usual way."
34267 #: ../src/guestfs.pod:558
34269 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
34270 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
34271 "[\"/dev/VG\"])>. Then close the mapper device by calling "
34272 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
34273 "underlying encrypted block device)."
34277 #: ../src/guestfs.pod:565
34282 #: ../src/guestfs.pod:567
34284 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
34285 "contains operating systems, an install CD or a live CD. (These APIs used to "
34286 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
34287 "version 1.5.3 the most frequently used part of this library has been "
34288 "rewritten in C and moved into the core code)."
34292 #: ../src/guestfs.pod:574
34294 "Add all disks belonging to the unknown virtual machine and call "
34295 "L</guestfs_launch> in the usual way."
34299 #: ../src/guestfs.pod:577
34301 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
34302 "and certain heuristics, and returns a list of operating systems that were "
34303 "found. An empty list means none were found. A single element is the root "
34304 "filesystem of the operating system. For dual- or multi-boot guests, "
34305 "multiple roots can be returned, each one corresponding to a separate "
34306 "operating system. (Multi-boot virtual machines are extremely rare in the "
34307 "world of virtualization, but since this scenario can happen, we have built "
34308 "libguestfs to deal with it.)"
34312 #: ../src/guestfs.pod:586
34314 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
34315 "to get additional details about that operating system. For example, call "
34316 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
34317 "Windows and Linux-based operating systems respectively."
34321 #: ../src/guestfs.pod:592
34323 "Un*x-like and Linux-based operating systems usually consist of several "
34324 "filesystems which are mounted at boot time (for example, a separate boot "
34325 "partition mounted on C</boot>). The inspection rules are able to detect how "
34326 "filesystems correspond to mount points. Call "
34327 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
34328 "hash table like this example:"
34332 #: ../src/guestfs.pod:599
34335 " /boot => /dev/sda1\n"
34336 " / => /dev/vg_guest/lv_root\n"
34337 " /usr => /dev/vg_guest/lv_usr\n"
34342 #: ../src/guestfs.pod:603
34344 "The caller can then make calls to L</guestfs_mount_options> to mount the "
34345 "filesystems as suggested."
34349 #: ../src/guestfs.pod:606
34351 "Be careful to mount filesystems in the right order (eg. C</> before "
34352 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
34357 #: ../src/guestfs.pod:610
34359 "Inspection currently only works for some common operating systems. "
34360 "Contributors are welcome to send patches for other operating systems that we "
34361 "currently cannot detect."
34365 #: ../src/guestfs.pod:614
34367 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
34368 "for more details. The L</guestfs_inspect_os> function just ignores any "
34369 "encrypted devices."
34373 #: ../src/guestfs.pod:618
34375 "A note on the implementation: The call L</guestfs_inspect_os> performs "
34376 "inspection and caches the results in the guest handle. Subsequent calls to "
34377 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
34378 "re-read the disks. If you change the content of the guest disks, you can "
34379 "redo inspection by calling L</guestfs_inspect_os> again. "
34380 "(L</guestfs_inspect_list_applications> works a little differently from the "
34381 "other calls and does read the disks. See documentation for that function "
34386 #: ../src/guestfs.pod:627
34387 msgid "INSPECTING INSTALL DISKS"
34391 #: ../src/guestfs.pod:629
34393 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
34398 #: ../src/guestfs.pod:632
34400 "Call L</guestfs_inspect_get_format> to return the format of the operating "
34401 "system, which currently can be C<installed> (a regular operating system) or "
34402 "C<installer> (some sort of install disk)."
34406 #: ../src/guestfs.pod:636
34408 "Further information is available about the operating system that can be "
34409 "installed using the regular inspection APIs like "
34410 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
34415 #: ../src/guestfs.pod:641
34417 "Some additional information specific to installer disks is also available "
34418 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
34419 "L</guestfs_inspect_is_multipart> calls."
34423 #: ../src/guestfs.pod:646
34424 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
34428 #: ../src/guestfs.pod:648
34430 "Libguestfs can mount NTFS partitions. It does this using the "
34431 "L<http://www.ntfs-3g.org/> driver."
34435 #: ../src/guestfs.pod:651
34436 msgid "DRIVE LETTERS AND PATHS"
34440 #: ../src/guestfs.pod:653
34442 "DOS and Windows still use drive letters, and the filesystems are always "
34443 "treated as case insensitive by Windows itself, and therefore you might find "
34444 "a Windows configuration file referring to a path like "
34445 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
34446 "that directory might be referred to as C</WINDOWS/System32>."
34450 #: ../src/guestfs.pod:659
34452 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
34453 "L</guestfs_inspect_get_drive_mappings>)"
34457 #: ../src/guestfs.pod:662
34459 "Dealing with separator characters (backslash vs forward slash) is outside "
34460 "the scope of libguestfs, but usually a simple character replacement will "
34465 #: ../src/guestfs.pod:666
34467 "To resolve the case insensitivity of paths, call "
34468 "L</guestfs_case_sensitive_path>."
34472 #: ../src/guestfs.pod:669
34473 msgid "ACCESSING THE WINDOWS REGISTRY"
34477 #: ../src/guestfs.pod:671
34479 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
34480 "files, through the library C<hivex> which is part of the libguestfs project "
34481 "although ships as a separate tarball. You have to locate and download the "
34482 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
34483 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
34484 "L<virt-win-reg(1)> for more help on this issue."
34488 #: ../src/guestfs.pod:679
34489 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
34493 #: ../src/guestfs.pod:681
34495 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
34496 "provide something which looks like a Linux symlink. The way it tries to do "
34497 "the rewriting is described here:"
34501 #: ../src/guestfs.pod:685
34502 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
34506 #: ../src/guestfs.pod:687
34508 "The essential problem is that ntfs-3g simply does not have enough "
34509 "information to do a correct job. NTFS links can contain drive letters and "
34510 "references to external device GUIDs that ntfs-3g has no way of resolving. "
34511 "It is almost certainly the case that libguestfs callers should ignore what "
34512 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
34516 #: ../src/guestfs.pod:694
34518 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
34519 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
34520 "attribute, and read the raw reparse data from that (you can find the format "
34521 "documented in various places around the web)."
34525 #: ../src/guestfs.pod:699
34526 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
34530 #: ../src/guestfs.pod:701
34532 "There are other useful extended attributes that can be read from ntfs-3g "
34533 "filesystems (using L</guestfs_getxattr>). See:"
34537 #: ../src/guestfs.pod:704
34538 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
34542 #: ../src/guestfs.pod:706
34543 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
34547 #: ../src/guestfs.pod:708
34549 "Although we don't want to discourage you from using the C API, we will "
34550 "mention here that the same API is also available in other languages."
34554 #: ../src/guestfs.pod:711
34556 "The API is broadly identical in all supported languages. This means that "
34557 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
34558 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
34559 "OCaml. In other words, a straightforward, predictable isomorphism between "
34564 #: ../src/guestfs.pod:717
34566 "Error messages are automatically transformed into exceptions if the language "
34571 #: ../src/guestfs.pod:720
34573 "We don't try to \"object orientify\" parts of the API in OO languages, "
34574 "although contributors are welcome to write higher level APIs above what we "
34575 "provide in their favourite languages if they wish."
34579 #: ../src/guestfs.pod:726
34584 #: ../src/guestfs.pod:728
34586 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
34587 "identical to the C API. C++ classes and exceptions are not used."
34591 #: ../src/guestfs.pod:732
34596 #: ../src/guestfs.pod:734
34598 "The C# bindings are highly experimental. Please read the warnings at the "
34599 "top of C<csharp/Libguestfs.cs>."
34603 #: ../src/guestfs.pod:737
34608 #: ../src/guestfs.pod:739
34609 msgid "See L<guestfs-erlang(3)>."
34613 #: ../src/guestfs.pod:741
34618 #: ../src/guestfs.pod:743
34620 "This is the only language binding that is working but incomplete. Only "
34621 "calls which return simple integers have been bound in Haskell, and we are "
34622 "looking for help to complete this binding."
34626 #: ../src/guestfs.pod:747
34631 #: ../src/guestfs.pod:749
34633 "Full documentation is contained in the Javadoc which is distributed with "
34634 "libguestfs. For examples, see L<guestfs-java(3)>."
34638 #: ../src/guestfs.pod:752
34643 #: ../src/guestfs.pod:754
34644 msgid "See L<guestfs-ocaml(3)>."
34648 #: ../src/guestfs.pod:756
34653 #: ../src/guestfs.pod:758
34654 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
34658 #: ../src/guestfs.pod:760
34663 #: ../src/guestfs.pod:762
34665 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
34666 "the php-libguestfs package for your distribution."
34670 #: ../src/guestfs.pod:765
34671 msgid "The PHP binding only works correctly on 64 bit machines."
34675 #: ../src/guestfs.pod:767
34680 #: ../src/guestfs.pod:769
34681 msgid "See L<guestfs-python(3)>."
34685 #: ../src/guestfs.pod:771
34690 #: ../src/guestfs.pod:773
34691 msgid "See L<guestfs-ruby(3)>."
34695 #: ../src/guestfs.pod:775
34696 msgid "B<shell scripts>"
34700 #: ../src/guestfs.pod:777
34701 msgid "See L<guestfish(1)>."
34705 #: ../src/guestfs.pod:781
34706 msgid "LIBGUESTFS GOTCHAS"
34710 #: ../src/guestfs.pod:783
34712 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
34713 "system [...] that works in the way it is documented but is counterintuitive "
34714 "and almost invites mistakes.\""
34718 #: ../src/guestfs.pod:787
34720 "Since we developed libguestfs and the associated tools, there are several "
34721 "things we would have designed differently, but are now stuck with for "
34722 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
34723 "release, you can expect these to change. Beware of them."
34727 #: ../src/guestfs.pod:795
34728 msgid "Autosync / forgetting to sync."
34732 #: ../src/guestfs.pod:797
34734 "I<Update:> Autosync is enabled by default for all API users starting from "
34735 "libguestfs 1.5.24. This section only applies to older versions."
34739 #: ../src/guestfs.pod:800
34741 "When modifying a filesystem from C or another language, you B<must> unmount "
34742 "all filesystems and call L</guestfs_sync> explicitly before you close the "
34743 "libguestfs handle. You can also call:"
34747 #: ../src/guestfs.pod:804
34750 " guestfs_set_autosync (g, 1);\n"
34755 #: ../src/guestfs.pod:806
34757 "to have the unmount/sync done automatically for you when the handle 'g' is "
34758 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
34763 #: ../src/guestfs.pod:810
34765 "If you forget to do this, then it is entirely possible that your changes "
34766 "won't be written out, or will be partially written, or (very rarely) that "
34767 "you'll get disk corruption."
34771 #: ../src/guestfs.pod:814
34773 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
34774 "guestfish scripts that forget to sync will work just fine, which can make "
34775 "this very puzzling if you are trying to debug a problem."
34779 #: ../src/guestfs.pod:818
34780 msgid "Mount option C<-o sync> should not be the default."
34784 #: ../src/guestfs.pod:820
34786 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
34787 "libguestfs 1.13.16. This section only applies to older versions."
34791 #: ../src/guestfs.pod:823
34793 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
34794 "However C<-o sync> does not add any reliability benefit, but does have a "
34795 "very large performance impact."
34799 #: ../src/guestfs.pod:827
34801 "The work around is to use L</guestfs_mount_options> and set the mount "
34802 "options that you actually want to use."
34806 #: ../src/guestfs.pod:830
34807 msgid "Read-only should be the default."
34811 #: ../src/guestfs.pod:832
34813 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
34814 "specify I<--rw> if you want to make changes to the image."
34818 #: ../src/guestfs.pod:835
34819 msgid "This would reduce the potential to corrupt live VM images."
34823 #: ../src/guestfs.pod:837
34825 "Note that many filesystems change the disk when you just mount and unmount, "
34826 "even if you didn't perform any writes. You need to use "
34827 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
34831 #: ../src/guestfs.pod:841
34832 msgid "guestfish command line is hard to use."
34836 #: ../src/guestfs.pod:843
34838 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
34839 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
34840 "exist, so it fails. In earlier versions of guestfish the error message was "
34841 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
34842 "we should have used C<guestfish -c command> to run commands."
34846 #: ../src/guestfs.pod:850
34847 msgid "guestfish megabyte modifiers don't work right on all commands"
34851 #: ../src/guestfs.pod:852
34853 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
34854 "other modifiers). What guestfish actually does is to multiply the number "
34855 "part by the modifier part and pass the result to the C API. However this "
34856 "doesn't work for a few APIs which aren't expecting bytes, but are already "
34857 "expecting some other unit (eg. megabytes)."
34861 #: ../src/guestfs.pod:859
34862 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
34866 #: ../src/guestfs.pod:861
34869 " lvcreate LV VG 100M\n"
34874 #: ../src/guestfs.pod:863
34876 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
34877 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
34878 "megabytes * megabytes) logical volume. The error message you get from this "
34879 "is also a little obscure."
34883 #: ../src/guestfs.pod:868
34885 "This could be fixed in the generator by specially marking parameters and "
34886 "return values which take bytes or other units."
34890 #: ../src/guestfs.pod:871
34891 msgid "Ambiguity between devices and paths"
34895 #: ../src/guestfs.pod:873
34897 "There is a subtle ambiguity in the API between a device name "
34898 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
34899 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
34903 #: ../src/guestfs.pod:878
34905 "In the current API we usually resolve this ambiguity by having two separate "
34906 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
34907 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
34908 "detecting if the path supplied begins with C</dev/>."
34912 #: ../src/guestfs.pod:884
34914 "To avoid both the ambiguity and the need to duplicate some calls, we could "
34915 "make paths/devices into structured names. One way to do this would be to "
34916 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
34917 "aspect of grub. Another way would be to use a structured type, equivalent "
34918 "to this OCaml type:"
34922 #: ../src/guestfs.pod:890
34925 " type path = Path of string | Device of int | Partition of int * int\n"
34930 #: ../src/guestfs.pod:892
34931 msgid "which would allow you to pass arguments like:"
34935 #: ../src/guestfs.pod:894
34938 " Path \"/foo/bar\"\n"
34939 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
34940 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
34941 " Path \"/dev/sdb2\" (* not a device *)\n"
34946 #: ../src/guestfs.pod:899
34948 "As you can see there are still problems to resolve even with this "
34949 "representation. Also consider how it might work in guestfish."
34953 #: ../src/guestfs.pod:904
34954 msgid "KEYS AND PASSPHRASES"
34958 #: ../src/guestfs.pod:906
34960 "Certain libguestfs calls take a parameter that contains sensitive key "
34961 "material, passed in as a C string."
34965 #: ../src/guestfs.pod:909
34967 "In the future we would hope to change the libguestfs implementation so that "
34968 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
34969 "swap. However this is I<not> done at the moment, because of the complexity "
34970 "of such an implementation."
34974 #: ../src/guestfs.pod:914
34976 "Therefore you should be aware that any key parameter you pass to libguestfs "
34977 "might end up being written out to the swap partition. If this is a concern, "
34978 "scrub the swap partition or don't use libguestfs on encrypted devices."
34982 #: ../src/guestfs.pod:919
34983 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
34987 #: ../src/guestfs.pod:921
34989 "All high-level libguestfs actions are synchronous. If you want to use "
34990 "libguestfs asynchronously then you must create a thread."
34994 #: ../src/guestfs.pod:924
34996 "Only use the handle from a single thread. Either use the handle exclusively "
34997 "from one thread, or provide your own mutex so that two threads cannot issue "
34998 "calls on the same handle at the same time."
35002 #: ../src/guestfs.pod:928
35004 "See the graphical program guestfs-browser for one possible architecture for "
35005 "multithreaded programs using libvirt and libguestfs."
35009 #: ../src/guestfs.pod:931
35014 #: ../src/guestfs.pod:933
35016 "Libguestfs needs a supermin appliance, which it finds by looking along an "
35021 #: ../src/guestfs.pod:936
35023 "By default it looks for these in the directory C<$libdir/guestfs> "
35024 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
35028 #: ../src/guestfs.pod:939
35030 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
35031 "to change the directories that libguestfs will search in. The value is a "
35032 "colon-separated list of paths. The current directory is I<not> searched "
35033 "unless the path contains an empty element or C<.>. For example "
35034 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
35035 "then C</usr/lib/guestfs>."
35039 #: ../src/guestfs.pod:946
35040 msgid "QEMU WRAPPERS"
35044 #: ../src/guestfs.pod:948
35046 "If you want to compile your own qemu, run qemu from a non-standard location, "
35047 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
35052 #: ../src/guestfs.pod:952
35054 "There is one important rule to remember: you I<must C<exec qemu>> as the "
35055 "last command in the shell script (so that qemu replaces the shell and "
35056 "becomes the direct child of the libguestfs-using program). If you don't do "
35057 "this, then the qemu process won't be cleaned up correctly."
35061 #: ../src/guestfs.pod:957
35063 "Here is an example of a wrapper, where I have built my own copy of qemu from "
35068 #: ../src/guestfs.pod:960
35072 " qemudir=/home/rjones/d/qemu\n"
35073 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
35079 #: ../src/guestfs.pod:964
35081 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
35082 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
35087 #: ../src/guestfs.pod:968
35090 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
35095 #: ../src/guestfs.pod:970
35097 "Note that libguestfs also calls qemu with the -help and -version options in "
35098 "order to determine features."
35102 #: ../src/guestfs.pod:973
35104 "Wrappers can also be used to edit the options passed to qemu. In the "
35105 "following example, the C<-machine ...> option (C<-machine> and the following "
35106 "argument) are removed from the command line and replaced with C<-machine "
35107 "pc,accel=tcg>. The while loop iterates over the options until it finds the "
35108 "right one to remove, putting the remaining options into the C<args> array."
35112 #: ../src/guestfs.pod:982
35116 " while [ $# -gt 0 ]; do\n"
35117 " case \"$1\" in\n"
35121 " args[i]=\"$1\"\n"
35130 #: ../src/guestfs.pod:994
35133 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
35138 #: ../src/guestfs.pod:996
35139 msgid "ATTACHING TO RUNNING DAEMONS"
35143 #: ../src/guestfs.pod:998
35145 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
35146 "babies. Use with caution."
35150 #: ../src/guestfs.pod:1001
35152 "I<Note (2):> This section explains how to attach to a running daemon from a "
35153 "low level perspective. For most users, simply using virt tools such as "
35154 "L<guestfish(1)> with the I<--live> option will \"just work\"."
35158 #: ../src/guestfs.pod:1005
35159 msgid "Using guestfs_set_attach_method"
35163 #: ../src/guestfs.pod:1007
35165 "By calling L</guestfs_set_attach_method> you can change how the library "
35166 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
35167 "L</ARCHITECTURE> for some background)."
35171 #: ../src/guestfs.pod:1011
35173 "The normal attach method is C<appliance>, where a small appliance is created "
35174 "containing the daemon, and then the library connects to this."
35178 #: ../src/guestfs.pod:1014
35180 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
35181 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
35182 "daemon over the Unix domain socket."
35186 #: ../src/guestfs.pod:1018
35188 "The normal use for this is to connect to a running virtual machine that "
35189 "contains a C<guestfsd> daemon, and send commands so you can read and write "
35190 "files inside the live virtual machine."
35194 #: ../src/guestfs.pod:1022
35195 msgid "Using guestfs_add_domain with live flag"
35199 #: ../src/guestfs.pod:1024
35201 "L</guestfs_add_domain> provides some help for getting the correct attach "
35202 "method. If you pass the C<live> option to this function, then (if the "
35203 "virtual machine is running) it will examine the libvirt XML looking for a "
35204 "virtio-serial channel to connect to:"
35208 #: ../src/guestfs.pod:1030
35215 " <channel type='unix'>\n"
35216 " <source mode='bind' path='/path/to/socket'/>\n"
35217 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
35226 #: ../src/guestfs.pod:1042
35228 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
35229 "method to C<unix:/path/to/socket>."
35233 #: ../src/guestfs.pod:1045
35235 "Some of the libguestfs tools (including guestfish) support a I<--live> "
35236 "option which is passed through to L</guestfs_add_domain> thus allowing you "
35237 "to attach to and modify live virtual machines."
35241 #: ../src/guestfs.pod:1049
35243 "The virtual machine needs to have been set up beforehand so that it has the "
35244 "virtio-serial channel and so that guestfsd is running inside it."
35248 #: ../src/guestfs.pod:1053
35249 msgid "ABI GUARANTEE"
35253 #: ../src/guestfs.pod:1055
35255 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
35256 "actions as outlined in this section. Although we will deprecate some "
35257 "actions, for example if they get replaced by newer calls, we will keep the "
35258 "old actions forever. This allows you the developer to program in confidence "
35259 "against the libguestfs API."
35263 #: ../src/guestfs.pod:1061
35264 msgid "BLOCK DEVICE NAMING"
35268 #: ../src/guestfs.pod:1063
35270 "In the kernel there is now quite a profusion of schemata for naming block "
35271 "devices (in this context, by I<block device> I mean a physical or virtual "
35272 "hard drive). The original Linux IDE driver used names starting with "
35273 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
35274 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
35275 "replacement for the old IDE driver (particularly for SATA devices) those "
35276 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
35277 "machines with paravirtualized drivers. This has created several different "
35278 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
35283 #: ../src/guestfs.pod:1075
35285 "As discussed above, libguestfs uses a qemu appliance running an embedded "
35286 "Linux kernel to access block devices. We can run a variety of appliances "
35287 "based on a variety of Linux kernels."
35291 #: ../src/guestfs.pod:1079
35293 "This causes a problem for libguestfs because many API calls use device or "
35294 "partition names. Working scripts and the recipe (example) scripts that we "
35295 "make available over the internet could fail if the naming scheme changes."
35299 #: ../src/guestfs.pod:1084
35301 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
35302 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
35303 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
35304 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
35308 #: ../src/guestfs.pod:1090
35310 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
35311 "L</guestfs_list_partitions> and similar calls return the true names of the "
35312 "devices and partitions as known to the appliance."
35316 #: ../src/guestfs.pod:1095
35317 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
35321 #: ../src/guestfs.pod:1097
35323 "Usually this translation is transparent. However in some (very rare) cases "
35324 "you may need to know the exact algorithm. Such cases include where you use "
35325 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
35326 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
35331 #: ../src/guestfs.pod:1103
35333 "The algorithm is applied only to I<parameters> which are known to be either "
35334 "device or partition names. Return values from functions such as "
35335 "L</guestfs_list_devices> are never changed."
35339 #: ../src/guestfs.pod:1111
35340 msgid "Is the string a parameter which is a device or partition name?"
35344 #: ../src/guestfs.pod:1115
35345 msgid "Does the string begin with C</dev/sd>?"
35349 #: ../src/guestfs.pod:1119
35351 "Does the named device exist? If so, we use that device. However if I<not> "
35352 "then we continue with this algorithm."
35356 #: ../src/guestfs.pod:1124
35357 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
35361 #: ../src/guestfs.pod:1126
35362 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
35366 #: ../src/guestfs.pod:1128
35367 msgid "If that named device exists, use it. If not, continue."
35371 #: ../src/guestfs.pod:1132
35372 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
35376 #: ../src/guestfs.pod:1134
35377 msgid "If that named device exists, use it. If not, return an error."
35381 #: ../src/guestfs.pod:1138
35382 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
35386 #: ../src/guestfs.pod:1140
35388 "Although the standard naming scheme and automatic translation is useful for "
35389 "simple programs and guestfish scripts, for larger programs it is best not to "
35390 "rely on this mechanism."
35394 #: ../src/guestfs.pod:1144
35396 "Where possible for maximum future portability programs using libguestfs "
35397 "should use these future-proof techniques:"
35401 #: ../src/guestfs.pod:1151
35403 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
35404 "device names, and then use those names directly."
35408 #: ../src/guestfs.pod:1154
35409 msgid "Since those device names exist by definition, they will never be translated."
35413 #: ../src/guestfs.pod:1159
35415 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
35416 "filesystem labels."
35420 #: ../src/guestfs.pod:1166
35422 "This section discusses security implications of using libguestfs, "
35423 "particularly with untrusted or malicious guests or disk images."
35427 #: ../src/guestfs.pod:1169
35428 msgid "GENERAL SECURITY CONSIDERATIONS"
35432 #: ../src/guestfs.pod:1171
35434 "Be careful with any files or data that you download from a guest (by "
35435 "\"download\" we mean not just the L</guestfs_download> command but any "
35436 "command that reads files, filenames, directories or anything else from a "
35437 "disk image). An attacker could manipulate the data to fool your program "
35438 "into doing the wrong thing. Consider cases such as:"
35442 #: ../src/guestfs.pod:1181
35443 msgid "the data (file etc) not being present"
35447 #: ../src/guestfs.pod:1185
35448 msgid "being present but empty"
35452 #: ../src/guestfs.pod:1189
35453 msgid "being much larger than normal"
35457 #: ../src/guestfs.pod:1193
35458 msgid "containing arbitrary 8 bit data"
35462 #: ../src/guestfs.pod:1197
35463 msgid "being in an unexpected character encoding"
35467 #: ../src/guestfs.pod:1201
35468 msgid "containing homoglyphs."
35472 #: ../src/guestfs.pod:1205
35473 msgid "SECURITY OF MOUNTING FILESYSTEMS"
35477 #: ../src/guestfs.pod:1207
35479 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
35480 "(VFS) module can sometimes be escalated into exploits by deliberately "
35481 "creating a malicious, malformed filesystem. These exploits are very severe "
35482 "for two reasons. Firstly there are very many filesystem drivers in the "
35483 "kernel, and many of them are infrequently used and not much developer "
35484 "attention has been paid to the code. Linux userspace helps potential "
35485 "crackers by detecting the filesystem type and automatically choosing the "
35486 "right VFS driver, even if that filesystem type is obscure or unexpected for "
35487 "the administrator. Secondly, a kernel-level exploit is like a local root "
35488 "exploit (worse in some ways), giving immediate and total access to the "
35489 "system right down to the hardware level."
35493 #: ../src/guestfs.pod:1220
35495 "That explains why you should never mount a filesystem from an untrusted "
35496 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
35497 "inside a qemu virtual machine, usually running as a non-root user. The "
35498 "attacker would need to write a filesystem which first exploited the kernel, "
35499 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
35500 "the libguestfs protocol, and finally to be as serious as the host kernel "
35501 "exploit it would need to escalate its privileges to root. This multi-step "
35502 "escalation, performed by a static piece of data, is thought to be extremely "
35503 "hard to do, although we never say 'never' about security issues."
35507 #: ../src/guestfs.pod:1231
35509 "In any case callers can reduce the attack surface by forcing the filesystem "
35510 "type when mounting (use L</guestfs_mount_vfs>)."
35514 #: ../src/guestfs.pod:1234
35515 msgid "PROTOCOL SECURITY"
35519 #: ../src/guestfs.pod:1236
35521 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
35522 "defined upper message size. However a program that uses libguestfs must "
35523 "also take care - for example you can write a program that downloads a binary "
35524 "from a disk image and executes it locally, and no amount of protocol "
35525 "security will save you from the consequences."
35529 #: ../src/guestfs.pod:1242
35530 msgid "INSPECTION SECURITY"
35534 #: ../src/guestfs.pod:1244
35536 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
35537 "directly from the guest, and these could contain any 8 bit data. Callers "
35538 "should be careful to escape these before printing them to a structured file "
35539 "(for example, use HTML escaping if creating a web page)."
35543 #: ../src/guestfs.pod:1250
35545 "Guest configuration may be altered in unusual ways by the administrator of "
35546 "the virtual machine, and may not reflect reality (particularly for untrusted "
35547 "or actively malicious guests). For example we parse the hostname from "
35548 "configuration files like C</etc/sysconfig/network> that we find in the "
35549 "guest, but the guest administrator can easily manipulate these files to "
35550 "provide the wrong hostname."
35554 #: ../src/guestfs.pod:1258
35556 "The inspection API parses guest configuration using two external libraries: "
35557 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
35558 "designed to be robust in the face of malicious data, although denial of "
35559 "service attacks are still possible, for example with oversized configuration "
35564 #: ../src/guestfs.pod:1264
35565 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
35569 #: ../src/guestfs.pod:1266
35571 "Be very cautious about running commands from the guest. By running a "
35572 "command in the guest, you are giving CPU time to a binary that you do not "
35573 "control, under the same user account as the library, albeit wrapped in qemu "
35574 "virtualization. More information and alternatives can be found in the "
35575 "section L</RUNNING COMMANDS>."
35579 #: ../src/guestfs.pod:1272
35580 msgid "CVE-2010-3851"
35584 #: ../src/guestfs.pod:1274
35585 msgid "https://bugzilla.redhat.com/642934"
35589 #: ../src/guestfs.pod:1276
35591 "This security bug concerns the automatic disk format detection that qemu "
35592 "does on disk images."
35596 #: ../src/guestfs.pod:1279
35598 "A raw disk image is just the raw bytes, there is no header. Other disk "
35599 "images like qcow2 contain a special header. Qemu deals with this by looking "
35600 "for one of the known headers, and if none is found then assuming the disk "
35601 "image must be raw."
35605 #: ../src/guestfs.pod:1284
35607 "This allows a guest which has been given a raw disk image to write some "
35608 "other header. At next boot (or when the disk image is accessed by "
35609 "libguestfs) qemu would do autodetection and think the disk image format was, "
35610 "say, qcow2 based on the header written by the guest."
35614 #: ../src/guestfs.pod:1289
35616 "This in itself would not be a problem, but qcow2 offers many features, one "
35617 "of which is to allow a disk image to refer to another image (called the "
35618 "\"backing disk\"). It does this by placing the path to the backing disk "
35619 "into the qcow2 header. This path is not validated and could point to any "
35620 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
35621 "\"holes\" in the qcow2 disk image, which of course is completely under the "
35622 "control of the attacker."
35626 #: ../src/guestfs.pod:1297
35627 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
35631 #: ../src/guestfs.pod:1304
35632 msgid "You have enabled the network or have opened the disk in write mode."
35636 #: ../src/guestfs.pod:1308
35638 "You are also running untrusted code from the guest (see L</RUNNING "
35643 #: ../src/guestfs.pod:1313
35645 "The way to avoid this is to specify the expected disk format when adding "
35646 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
35647 "should always do this if the disk is raw format, and it's a good idea for "
35652 #: ../src/guestfs.pod:1318
35654 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
35655 "format is fetched from libvirt and passed through."
35659 #: ../src/guestfs.pod:1321
35661 "For libguestfs tools, use the I<--format> command line parameter as "
35666 #: ../src/guestfs.pod:1324
35667 msgid "CONNECTION MANAGEMENT"
35671 #: ../src/guestfs.pod:1326
35672 msgid "guestfs_h *"
35676 #: ../src/guestfs.pod:1328
35678 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
35679 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
35680 "handle and release all resources used."
35684 #: ../src/guestfs.pod:1332
35686 "For information on using multiple handles and threads, see the section "
35687 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
35691 #: ../src/guestfs.pod:1335
35692 msgid "guestfs_create"
35696 #: ../src/guestfs.pod:1337
35699 " guestfs_h *guestfs_create (void);\n"
35704 #: ../src/guestfs.pod:1339
35705 msgid "Create a connection handle."
35709 #: ../src/guestfs.pod:1341
35711 "On success this returns a non-NULL pointer to a handle. On error it returns "
35716 #: ../src/guestfs.pod:1344
35718 "You have to \"configure\" the handle after creating it. This includes "
35719 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
35720 "handle at least once."
35724 #: ../src/guestfs.pod:1348
35725 msgid "After configuring the handle, you have to call L</guestfs_launch>."
35729 #: ../src/guestfs.pod:1350
35731 "You may also want to configure error handling for the handle. See the "
35732 "L</ERROR HANDLING> section below."
35736 #: ../src/guestfs.pod:1353
35737 msgid "guestfs_close"
35741 #: ../src/guestfs.pod:1355
35744 " void guestfs_close (guestfs_h *g);\n"
35749 #: ../src/guestfs.pod:1357
35750 msgid "This closes the connection handle and frees up all resources used."
35754 #: ../src/guestfs.pod:1359
35756 "If autosync was set on the handle and the handle was launched, then this "
35757 "implicitly calls various functions to unmount filesystems and sync the "
35758 "disk. See L</guestfs_set_autosync> for more details."
35762 #: ../src/guestfs.pod:1363
35763 msgid "If a close callback was set on the handle, then it is called."
35767 #: ../src/guestfs.pod:1365
35768 msgid "ERROR HANDLING"
35772 #: ../src/guestfs.pod:1367
35774 "API functions can return errors. For example, almost all functions that "
35775 "return C<int> will return C<-1> to indicate an error."
35779 #: ../src/guestfs.pod:1370
35781 "Additional information is available for errors: an error message string and "
35782 "optionally an error number (errno) if the thing that failed was a system "
35787 #: ../src/guestfs.pod:1374
35789 "You can get at the additional information about the last error on the handle "
35790 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
35791 "up an error handler with L</guestfs_set_error_handler>."
35795 #: ../src/guestfs.pod:1379
35797 "When the handle is created, a default error handler is installed which "
35798 "prints the error message string to C<stderr>. For small short-running "
35799 "command line programs it is sufficient to do:"
35803 #: ../src/guestfs.pod:1383
35806 " if (guestfs_launch (g) == -1)\n"
35807 " exit (EXIT_FAILURE);\n"
35812 #: ../src/guestfs.pod:1386
35814 "since the default error handler will ensure that an error message has been "
35815 "printed to C<stderr> before the program exits."
35819 #: ../src/guestfs.pod:1389
35821 "For other programs the caller will almost certainly want to install an "
35822 "alternate error handler or do error handling in-line like this:"
35826 #: ../src/guestfs.pod:1392
35829 " /* This disables the default behaviour of printing errors\n"
35831 " guestfs_set_error_handler (g, NULL, NULL);\n"
35836 #: ../src/guestfs.pod:1396
35839 " if (guestfs_launch (g) == -1) {\n"
35840 " /* Examine the error message and print it etc. */\n"
35841 " char *msg = guestfs_last_error (g);\n"
35842 " int errnum = guestfs_last_errno (g);\n"
35843 " fprintf (stderr, \"%s\", msg);\n"
35844 " if (errnum != 0)\n"
35845 " fprintf (stderr, \": %s\", strerror (errnum));\n"
35846 " fprintf (stderr, \"\\n\");\n"
35853 #: ../src/guestfs.pod:1407
35855 "Out of memory errors are handled differently. The default action is to call "
35856 "L<abort(3)>. If this is undesirable, then you can set a handler using "
35857 "L</guestfs_set_out_of_memory_handler>."
35861 #: ../src/guestfs.pod:1411
35863 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
35864 "because there is no handle if this happens there is no way to get additional "
35865 "error information. However L</guestfs_create> is supposed to be a "
35866 "lightweight operation which can only fail because of insufficient memory (it "
35867 "returns NULL in this case)."
35871 #: ../src/guestfs.pod:1417
35872 msgid "guestfs_last_error"
35876 #: ../src/guestfs.pod:1419
35879 " const char *guestfs_last_error (guestfs_h *g);\n"
35884 #: ../src/guestfs.pod:1421
35886 "This returns the last error message that happened on C<g>. If there has not "
35887 "been an error since the handle was created, then this returns C<NULL>."
35891 #: ../src/guestfs.pod:1425
35893 "The lifetime of the returned string is until the next error occurs, or "
35894 "L</guestfs_close> is called."
35898 #: ../src/guestfs.pod:1428
35899 msgid "guestfs_last_errno"
35903 #: ../src/guestfs.pod:1430
35906 " int guestfs_last_errno (guestfs_h *g);\n"
35911 #: ../src/guestfs.pod:1432
35912 msgid "This returns the last error number (errno) that happened on C<g>."
35916 #: ../src/guestfs.pod:1434
35917 msgid "If successful, an errno integer not equal to zero is returned."
35921 #: ../src/guestfs.pod:1436
35922 msgid "If no error, this returns 0. This call can return 0 in three situations:"
35926 #: ../src/guestfs.pod:1443
35927 msgid "There has not been any error on the handle."
35931 #: ../src/guestfs.pod:1447
35933 "There has been an error but the errno was meaningless. This corresponds to "
35934 "the case where the error did not come from a failed system call, but for "
35935 "some other reason."
35939 #: ../src/guestfs.pod:1453
35941 "There was an error from a failed system call, but for some reason the errno "
35942 "was not captured and returned. This usually indicates a bug in libguestfs."
35946 #: ../src/guestfs.pod:1459
35948 "Libguestfs tries to convert the errno from inside the applicance into a "
35949 "corresponding errno for the caller (not entirely trivial: the appliance "
35950 "might be running a completely different operating system from the library "
35951 "and error numbers are not standardized across Un*xen). If this could not be "
35952 "done, then the error is translated to C<EINVAL>. In practice this should "
35953 "only happen in very rare circumstances."
35957 #: ../src/guestfs.pod:1467
35958 msgid "guestfs_set_error_handler"
35962 #: ../src/guestfs.pod:1469
35965 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
35967 " const char *msg);\n"
35968 " void guestfs_set_error_handler (guestfs_h *g,\n"
35969 " guestfs_error_handler_cb cb,\n"
35970 " void *opaque);\n"
35975 #: ../src/guestfs.pod:1476
35977 "The callback C<cb> will be called if there is an error. The parameters "
35978 "passed to the callback are an opaque data pointer and the error message "
35983 #: ../src/guestfs.pod:1480
35985 "C<errno> is not passed to the callback. To get that the callback must call "
35986 "L</guestfs_last_errno>."
35990 #: ../src/guestfs.pod:1483
35992 "Note that the message string C<msg> is freed as soon as the callback "
35993 "function returns, so if you want to stash it somewhere you must make your "
35998 #: ../src/guestfs.pod:1487
35999 msgid "The default handler prints messages on C<stderr>."
36003 #: ../src/guestfs.pod:1489
36004 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
36008 #: ../src/guestfs.pod:1491
36009 msgid "guestfs_get_error_handler"
36013 #: ../src/guestfs.pod:1493
36016 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
36017 " void **opaque_rtn);\n"
36022 #: ../src/guestfs.pod:1496
36023 msgid "Returns the current error handler callback."
36027 #: ../src/guestfs.pod:1498
36028 msgid "guestfs_set_out_of_memory_handler"
36032 #: ../src/guestfs.pod:1500
36035 " typedef void (*guestfs_abort_cb) (void);\n"
36036 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
36037 " guestfs_abort_cb);\n"
36042 #: ../src/guestfs.pod:1504
36044 "The callback C<cb> will be called if there is an out of memory situation. "
36045 "I<Note this callback must not return>."
36049 #: ../src/guestfs.pod:1507
36050 msgid "The default is to call L<abort(3)>."
36054 #: ../src/guestfs.pod:1509
36055 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
36059 #: ../src/guestfs.pod:1512
36060 msgid "guestfs_get_out_of_memory_handler"
36064 #: ../src/guestfs.pod:1514
36067 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
36072 #: ../src/guestfs.pod:1516
36073 msgid "This returns the current out of memory handler."
36077 #: ../src/guestfs.pod:1518
36082 #: ../src/guestfs.pod:1522
36087 #: ../src/guestfs.pod:1524
36092 #: ../src/guestfs.pod:1526
36093 msgid "AVAILABILITY"
36097 #: ../src/guestfs.pod:1528
36098 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
36102 #: ../src/guestfs.pod:1530
36104 "Using L</guestfs_available> you can test availability of the following "
36105 "groups of functions. This test queries the appliance to see if the "
36106 "appliance you are currently using supports the functionality."
36110 #: ../src/guestfs.pod:1535
36111 msgid "@AVAILABILITY@"
36115 #: ../src/guestfs.pod:1537
36116 msgid "GUESTFISH supported COMMAND"
36120 #: ../src/guestfs.pod:1539
36122 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
36123 "prints out the available groups and whether they are supported by this build "
36124 "of libguestfs. Note however that you have to do C<run> first."
36128 #: ../src/guestfs.pod:1544
36129 msgid "SINGLE CALLS AT COMPILE TIME"
36133 #: ../src/guestfs.pod:1546
36135 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
36136 "function, such as:"
36140 #: ../src/guestfs.pod:1549
36143 " #define LIBGUESTFS_HAVE_DD 1\n"
36148 #: ../src/guestfs.pod:1551
36149 msgid "if L</guestfs_dd> is available."
36153 #: ../src/guestfs.pod:1553
36155 "Before version 1.5.8, if you needed to test whether a single libguestfs "
36156 "function is available at compile time, we recommended using build tools such "
36157 "as autoconf or cmake. For example in autotools you could use:"
36161 #: ../src/guestfs.pod:1558
36164 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
36165 " AC_CHECK_FUNCS([guestfs_dd])\n"
36170 #: ../src/guestfs.pod:1561
36172 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
36177 #: ../src/guestfs.pod:1564
36178 msgid "SINGLE CALLS AT RUN TIME"
36182 #: ../src/guestfs.pod:1566
36184 "Testing at compile time doesn't guarantee that a function really exists in "
36185 "the library. The reason is that you might be dynamically linked against a "
36186 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
36187 "This situation unfortunately results in a segmentation fault, which is a "
36188 "shortcoming of the C dynamic linking system itself."
36192 #: ../src/guestfs.pod:1573
36194 "You can use L<dlopen(3)> to test if a function is available at run time, as "
36195 "in this example program (note that you still need the compile time check as "
36200 #: ../src/guestfs.pod:1577
36203 " #include <stdio.h>\n"
36204 " #include <stdlib.h>\n"
36205 " #include <unistd.h>\n"
36206 " #include <dlfcn.h>\n"
36207 " #include <guestfs.h>\n"
36212 #: ../src/guestfs.pod:1583
36217 " #ifdef LIBGUESTFS_HAVE_DD\n"
36219 " int has_function;\n"
36224 #: ../src/guestfs.pod:1589
36227 " /* Test if the function guestfs_dd is really available. */\n"
36228 " dl = dlopen (NULL, RTLD_LAZY);\n"
36230 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
36231 " exit (EXIT_FAILURE);\n"
36233 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
36239 #: ../src/guestfs.pod:1598
36242 " if (!has_function)\n"
36243 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
36245 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
36246 " /* Now it's safe to call\n"
36247 " guestfs_dd (g, \"foo\", \"bar\");\n"
36251 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
36258 #: ../src/guestfs.pod:1611
36260 "You may think the above is an awful lot of hassle, and it is. There are "
36261 "other ways outside of the C linking system to ensure that this kind of "
36262 "incompatibility never arises, such as using package versioning:"
36266 #: ../src/guestfs.pod:1616
36269 " Requires: libguestfs >= 1.0.80\n"
36274 #: ../src/guestfs.pod:1618
36275 msgid "CALLS WITH OPTIONAL ARGUMENTS"
36279 #: ../src/guestfs.pod:1620
36281 "A recent feature of the API is the introduction of calls which take optional "
36282 "arguments. In C these are declared 3 ways. The main way is as a call which "
36283 "takes variable arguments (ie. C<...>), as in this example:"
36287 #: ../src/guestfs.pod:1625
36290 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
36295 #: ../src/guestfs.pod:1627
36297 "Call this with a list of optional arguments, terminated by C<-1>. So to "
36298 "call with no optional arguments specified:"
36302 #: ../src/guestfs.pod:1630
36305 " guestfs_add_drive_opts (g, filename, -1);\n"
36310 #: ../src/guestfs.pod:1632
36311 msgid "With a single optional argument:"
36315 #: ../src/guestfs.pod:1634
36318 " guestfs_add_drive_opts (g, filename,\n"
36319 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36325 #: ../src/guestfs.pod:1638
36330 #: ../src/guestfs.pod:1640
36333 " guestfs_add_drive_opts (g, filename,\n"
36334 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
36335 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
36341 #: ../src/guestfs.pod:1645
36343 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
36348 #: ../src/guestfs.pod:1648
36349 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
36353 #: ../src/guestfs.pod:1650
36355 "The second variant has the same name with the suffix C<_va>, which works the "
36356 "same way but takes a C<va_list>. See the C manual for details. For the "
36357 "example function, this is declared:"
36361 #: ../src/guestfs.pod:1654
36364 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
36365 " va_list args);\n"
36370 #: ../src/guestfs.pod:1657
36371 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
36375 #: ../src/guestfs.pod:1659
36377 "The third variant is useful where you need to construct these calls. You "
36378 "pass in a structure where you fill in the optional fields. The structure "
36379 "has a bitmask as the first element which you must set to indicate which "
36380 "fields you have filled in. For our example function the structure and call "
36385 #: ../src/guestfs.pod:1665
36388 " struct guestfs_add_drive_opts_argv {\n"
36389 " uint64_t bitmask;\n"
36391 " const char *format;\n"
36394 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
36395 " const struct guestfs_add_drive_opts_argv *optargs);\n"
36400 #: ../src/guestfs.pod:1674
36401 msgid "You could call it like this:"
36405 #: ../src/guestfs.pod:1676
36408 " struct guestfs_add_drive_opts_argv optargs = {\n"
36409 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
36410 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
36411 " .readonly = 1,\n"
36412 " .format = \"qcow2\"\n"
36418 #: ../src/guestfs.pod:1683
36421 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
36426 #: ../src/guestfs.pod:1691
36427 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
36431 #: ../src/guestfs.pod:1696
36432 msgid "You do not need to fill in all fields of the structure."
36436 #: ../src/guestfs.pod:1700
36438 "There must be a one-to-one correspondence between fields of the structure "
36439 "that are filled in, and bits set in the bitmask."
36443 #: ../src/guestfs.pod:1705
36444 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
36448 #: ../src/guestfs.pod:1707
36450 "In other languages, optional arguments are expressed in the way that is "
36451 "natural for that language. We refer you to the language-specific "
36452 "documentation for more details on that."
36456 #: ../src/guestfs.pod:1711
36457 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
36461 #: ../src/guestfs.pod:1713
36462 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
36466 #: ../src/guestfs.pod:1715
36468 "B<Note:> This section documents the generic event mechanism introduced in "
36469 "libguestfs 1.10, which you should use in new code if possible. The old "
36470 "functions C<guestfs_set_log_message_callback>, "
36471 "C<guestfs_set_subprocess_quit_callback>, "
36472 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
36473 "C<guestfs_set_progress_callback> are no longer documented in this manual "
36474 "page. Because of the ABI guarantee, the old functions continue to work."
36478 #: ../src/guestfs.pod:1724
36480 "Handles generate events when certain things happen, such as log messages "
36481 "being generated, progress messages during long-running operations, or the "
36482 "handle being closed. The API calls described below let you register a "
36483 "callback to be called when events happen. You can register multiple "
36484 "callbacks (for the same, different or overlapping sets of events), and "
36485 "individually remove callbacks. If callbacks are not removed, then they "
36486 "remain in force until the handle is closed."
36490 #: ../src/guestfs.pod:1732
36492 "In the current implementation, events are only generated synchronously: that "
36493 "means that events (and hence callbacks) can only happen while you are in the "
36494 "middle of making another libguestfs call. The callback is called in the "
36499 #: ../src/guestfs.pod:1737
36501 "Events may contain a payload, usually nothing (void), an array of 64 bit "
36502 "unsigned integers, or a message buffer. Payloads are discussed later on."
36506 #: ../src/guestfs.pod:1741
36507 msgid "CLASSES OF EVENTS"
36511 #: ../src/guestfs.pod:1745
36512 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
36516 #: ../src/guestfs.pod:1748
36518 "The callback function will be called while the handle is being closed "
36519 "(synchronously from L</guestfs_close>)."
36523 #: ../src/guestfs.pod:1751
36525 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
36526 "handles that are open when the program exits. This means that this callback "
36527 "might be called indirectly from L<exit(3)>, which can cause unexpected "
36528 "problems in higher-level languages (eg. if your HLL interpreter has already "
36529 "been cleaned up by the time this is called, and if your callback then jumps "
36530 "into some HLL function)."
36534 #: ../src/guestfs.pod:1758
36536 "If no callback is registered: the handle is closed without any callback "
36541 #: ../src/guestfs.pod:1761
36542 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
36546 #: ../src/guestfs.pod:1764
36548 "The callback function will be called when the child process quits, either "
36549 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
36550 "corresponds to a transition from any state to the CONFIG state)."
36554 #: ../src/guestfs.pod:1768 ../src/guestfs.pod:1777 ../src/guestfs.pod:1894
36555 msgid "If no callback is registered: the event is ignored."
36559 #: ../src/guestfs.pod:1770
36560 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
36564 #: ../src/guestfs.pod:1773
36566 "The callback function will be called when the child process becomes ready "
36567 "first time after it has been launched. (This corresponds to a transition "
36568 "from LAUNCHING to the READY state)."
36572 #: ../src/guestfs.pod:1779
36573 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
36577 #: ../src/guestfs.pod:1782
36579 "Some long-running operations can generate progress messages. If this "
36580 "callback is registered, then it will be called each time a progress message "
36581 "is generated (usually two seconds after the operation started, and three "
36582 "times per second thereafter until it completes, although the frequency may "
36583 "change in future versions)."
36587 #: ../src/guestfs.pod:1788
36589 "The callback receives in the payload four unsigned 64 bit numbers which are "
36590 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
36594 #: ../src/guestfs.pod:1791
36596 "The units of C<total> are not defined, although for some operations C<total> "
36597 "may relate in some way to the amount of data to be transferred (eg. in bytes "
36598 "or megabytes), and C<position> may be the portion which has been "
36603 #: ../src/guestfs.pod:1796
36604 msgid "The only defined and stable parts of the API are:"
36608 #: ../src/guestfs.pod:1802
36610 "The callback can display to the user some type of progress bar or indicator "
36611 "which shows the ratio of C<position>:C<total>."
36615 #: ../src/guestfs.pod:1807
36616 msgid "0 E<lt>= C<position> E<lt>= C<total>"
36620 #: ../src/guestfs.pod:1811
36622 "If any progress notification is sent during a call, then a final progress "
36623 "notification is always sent when C<position> = C<total> (I<unless> the call "
36624 "fails with an error)."
36628 #: ../src/guestfs.pod:1815
36630 "This is to simplify caller code, so callers can easily set the progress "
36631 "indicator to \"100%\" at the end of the operation, without requiring special "
36632 "code to detect this case."
36636 #: ../src/guestfs.pod:1821
36638 "For some calls we are unable to estimate the progress of the call, but we "
36639 "can still generate progress messages to indicate activity. This is known as "
36640 "\"pulse mode\", and is directly supported by certain progress bar "
36641 "implementations (eg. GtkProgressBar)."
36645 #: ../src/guestfs.pod:1826
36647 "For these calls, zero or more progress messages are generated with "
36648 "C<position = 0> and C<total = 1>, followed by a final message with "
36649 "C<position = total = 1>."
36653 #: ../src/guestfs.pod:1830
36655 "As noted above, if the call fails with an error then the final message may "
36656 "not be generated."
36660 #: ../src/guestfs.pod:1835
36662 "The callback also receives the procedure number (C<proc_nr>) and serial "
36663 "number (C<serial>) of the call. These are only useful for debugging "
36664 "protocol issues, and the callback can normally ignore them. The callback "
36665 "may want to print these numbers in error messages or debugging messages."
36669 #: ../src/guestfs.pod:1841
36670 msgid "If no callback is registered: progress messages are discarded."
36674 #: ../src/guestfs.pod:1843
36675 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
36679 #: ../src/guestfs.pod:1846
36681 "The callback function is called whenever a log message is generated by qemu, "
36682 "the appliance kernel, guestfsd (daemon), or utility programs."
36686 #: ../src/guestfs.pod:1849
36688 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
36689 "(L</guestfs_launch>) then additional debug messages are generated."
36693 #: ../src/guestfs.pod:1852 ../src/guestfs.pod:1866
36695 "If no callback is registered: the messages are discarded unless the verbose "
36696 "flag is set in which case they are sent to stderr. You can override the "
36697 "printing of verbose messages to stderr by setting up a callback."
36701 #: ../src/guestfs.pod:1857
36702 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
36706 #: ../src/guestfs.pod:1860
36708 "The callback function is called whenever a log message is generated by the "
36709 "library part of libguestfs."
36713 #: ../src/guestfs.pod:1863
36715 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
36716 "messages are generated."
36720 #: ../src/guestfs.pod:1871
36721 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
36725 #: ../src/guestfs.pod:1874
36727 "The callback function is called whenever a trace message is generated. This "
36728 "only applies if the trace flag (L</guestfs_set_trace>) is set."
36732 #: ../src/guestfs.pod:1877
36734 "If no callback is registered: the messages are sent to stderr. You can "
36735 "override the printing of trace messages to stderr by setting up a callback."
36739 #: ../src/guestfs.pod:1881
36740 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
36744 #: ../src/guestfs.pod:1884
36745 msgid "The callback function is called whenever a libguestfs function is entered."
36749 #: ../src/guestfs.pod:1887
36751 "The payload is a string which contains the name of the function that we are "
36752 "entering (not including C<guestfs_> prefix)."
36756 #: ../src/guestfs.pod:1890
36758 "Note that libguestfs functions can call themselves, so you may see many "
36759 "events from a single call. A few libguestfs functions do not generate this "
36764 #: ../src/guestfs.pod:1898
36765 msgid "guestfs_set_event_callback"
36769 #: ../src/guestfs.pod:1900
36772 " int guestfs_set_event_callback (guestfs_h *g,\n"
36773 " guestfs_event_callback cb,\n"
36774 " uint64_t event_bitmask,\n"
36776 " void *opaque);\n"
36781 #: ../src/guestfs.pod:1906
36783 "This function registers a callback (C<cb>) for all event classes in the "
36784 "C<event_bitmask>."
36788 #: ../src/guestfs.pod:1909
36790 "For example, to register for all log message events, you could call this "
36791 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
36792 "To register a single callback for all possible classes of events, use "
36793 "C<GUESTFS_EVENT_ALL>."
36797 #: ../src/guestfs.pod:1915
36798 msgid "C<flags> should always be passed as 0."
36802 #: ../src/guestfs.pod:1917
36804 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
36805 "it for any purpose."
36809 #: ../src/guestfs.pod:1920
36811 "The return value is the event handle (an integer) which you can use to "
36812 "delete the callback (see below)."
36816 #: ../src/guestfs.pod:1923
36818 "If there is an error, this function returns C<-1>, and sets the error in the "
36819 "handle in the usual way (see L</guestfs_last_error> etc.)"
36823 #: ../src/guestfs.pod:1926
36825 "Callbacks remain in effect until they are deleted, or until the handle is "
36830 #: ../src/guestfs.pod:1929
36832 "In the case where multiple callbacks are registered for a particular event "
36833 "class, all of the callbacks are called. The order in which multiple "
36834 "callbacks are called is not defined."
36838 #: ../src/guestfs.pod:1933
36839 msgid "guestfs_delete_event_callback"
36843 #: ../src/guestfs.pod:1935
36846 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
36851 #: ../src/guestfs.pod:1937
36853 "Delete a callback that was previously registered. C<event_handle> should be "
36854 "the integer that was returned by a previous call to "
36855 "C<guestfs_set_event_callback> on the same handle."
36859 #: ../src/guestfs.pod:1941
36860 msgid "guestfs_event_callback"
36864 #: ../src/guestfs.pod:1943
36867 " typedef void (*guestfs_event_callback) (\n"
36870 " uint64_t event,\n"
36871 " int event_handle,\n"
36873 " const char *buf, size_t buf_len,\n"
36874 " const uint64_t *array, size_t array_len);\n"
36879 #: ../src/guestfs.pod:1952
36880 msgid "This is the type of the event callback function that you have to provide."
36884 #: ../src/guestfs.pod:1955
36886 "The basic parameters are: the handle (C<g>), the opaque user pointer "
36887 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
36888 "handle, and C<flags> which in the current API you should ignore."
36892 #: ../src/guestfs.pod:1959
36894 "The remaining parameters contain the event payload (if any). Each event may "
36895 "contain a payload, which usually relates to the event class, but for future "
36896 "proofing your code should be written to handle any payload for any event "
36901 #: ../src/guestfs.pod:1964
36903 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
36904 "there is no message buffer). Note that this message buffer can contain "
36905 "arbitrary 8 bit data, including NUL bytes."
36909 #: ../src/guestfs.pod:1968
36911 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
36912 "moment this is only used for progress messages."
36916 #: ../src/guestfs.pod:1971
36917 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
36921 #: ../src/guestfs.pod:1973
36923 "One motivation for the generic event API was to allow GUI programs to "
36924 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
36925 "unconditionally to C<stderr>."
36929 #: ../src/guestfs.pod:1977
36931 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
36932 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
36933 "messages are not events; you must capture error messages separately)."
36937 #: ../src/guestfs.pod:1982
36939 "Programs have to set up a callback to capture the classes of events of "
36944 #: ../src/guestfs.pod:1985
36948 " guestfs_set_event_callback\n"
36949 " (g, message_callback,\n"
36950 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
36951 " GUESTFS_EVENT_TRACE,\n"
36952 " 0, NULL) == -1)\n"
36953 " if (eh == -1) {\n"
36954 " // handle error in the usual way\n"
36960 #: ../src/guestfs.pod:1995
36962 "The callback can then direct messages to the appropriate place. In this "
36963 "example, messages are directed to syslog:"
36967 #: ../src/guestfs.pod:1998
36971 " message_callback (\n"
36974 " uint64_t event,\n"
36975 " int event_handle,\n"
36977 " const char *buf, size_t buf_len,\n"
36978 " const uint64_t *array, size_t array_len)\n"
36980 " const int priority = LOG_USER|LOG_INFO;\n"
36981 " if (buf_len > 0)\n"
36982 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
36988 #: ../src/guestfs.pod:2013
36989 msgid "CANCELLING LONG TRANSFERS"
36993 #: ../src/guestfs.pod:2015
36995 "Some operations can be cancelled by the caller while they are in progress. "
36996 "Currently only operations that involve uploading or downloading data can be "
36997 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
36998 "parameters in the generator)."
37002 #: ../src/guestfs.pod:2020
37003 msgid "guestfs_user_cancel"
37007 #: ../src/guestfs.pod:2022
37010 " void guestfs_user_cancel (guestfs_h *g);\n"
37015 #: ../src/guestfs.pod:2024
37016 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
37020 #: ../src/guestfs.pod:2027
37022 "Unlike most other libguestfs calls, this function is signal safe and thread "
37023 "safe. You can call it from a signal handler or from another thread, without "
37024 "needing to do any locking."
37028 #: ../src/guestfs.pod:2031
37030 "The transfer that was in progress (if there is one) will stop shortly "
37031 "afterwards, and will return an error. The errno (see "
37032 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
37033 "out if the operation was cancelled or failed because of another error."
37037 #: ../src/guestfs.pod:2037
37039 "No cleanup is performed: for example, if a file was being uploaded then "
37040 "after cancellation there may be a partially uploaded file. It is the "
37041 "caller's responsibility to clean up if necessary."
37045 #: ../src/guestfs.pod:2041
37046 msgid "There are two common places that you might call C<guestfs_user_cancel>."
37050 #: ../src/guestfs.pod:2043
37052 "In an interactive text-based program, you might call it from a C<SIGINT> "
37053 "signal handler so that pressing C<^C> cancels the current operation. (You "
37054 "also need to call L</guestfs_set_pgroup> so that child processes don't "
37055 "receive the C<^C> signal)."
37059 #: ../src/guestfs.pod:2048
37061 "In a graphical program, when the main thread is displaying a progress bar "
37062 "with a cancel button, wire up the cancel button to call this function."
37066 #: ../src/guestfs.pod:2052
37067 msgid "PRIVATE DATA AREA"
37071 #: ../src/guestfs.pod:2054
37073 "You can attach named pieces of private data to the libguestfs handle, fetch "
37074 "them by name, and walk over them, for the lifetime of the handle. This is "
37075 "called the private data area and is only available from the C API."
37079 #: ../src/guestfs.pod:2059
37080 msgid "To attach a named piece of data, use the following call:"
37084 #: ../src/guestfs.pod:2061
37087 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
37092 #: ../src/guestfs.pod:2063
37094 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
37095 "pointer (which can be C<NULL>). Any previous item with the same key is "
37100 #: ../src/guestfs.pod:2067
37102 "You can use any C<key> you want, but your key should I<not> start with an "
37103 "underscore character. Keys beginning with an underscore character are "
37104 "reserved for internal libguestfs purposes (eg. for implementing language "
37105 "bindings). It is recommended that you prefix the key with some unique "
37106 "string to avoid collisions with other users."
37110 #: ../src/guestfs.pod:2073
37111 msgid "To retrieve the pointer, use:"
37115 #: ../src/guestfs.pod:2075
37118 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
37123 #: ../src/guestfs.pod:2077
37125 "This function returns C<NULL> if either no data is found associated with "
37126 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
37131 #: ../src/guestfs.pod:2081
37133 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
37134 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
37135 "all. In particular, libguestfs does I<not> try to free the data when the "
37136 "handle is closed. If the data must be freed, then the caller must either "
37137 "free it before calling L</guestfs_close> or must set up a close callback to "
37138 "do it (see L</GUESTFS_EVENT_CLOSE>)."
37142 #: ../src/guestfs.pod:2088
37143 msgid "To walk over all entries, use these two functions:"
37147 #: ../src/guestfs.pod:2090
37150 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
37155 #: ../src/guestfs.pod:2092
37158 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
37163 #: ../src/guestfs.pod:2094
37165 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
37166 "not have any particular meaning -- keys are not returned in any defined "
37167 "order). A pointer to the key is returned in C<*key_rtn> and the "
37168 "corresponding data pointer is returned from the function. C<NULL> is "
37169 "returned if there are no keys stored in the handle."
37173 #: ../src/guestfs.pod:2100
37175 "C<guestfs_next_private> returns the next key, pointer pair. The return "
37176 "value of this function is also C<NULL> is there are no further entries to "
37181 #: ../src/guestfs.pod:2104
37182 msgid "Notes about walking over entries:"
37186 #: ../src/guestfs.pod:2110
37187 msgid "You must not call C<guestfs_set_private> while walking over the entries."
37191 #: ../src/guestfs.pod:2115
37193 "The handle maintains an internal iterator which is reset when you call "
37194 "C<guestfs_first_private>. This internal iterator is invalidated when you "
37195 "call C<guestfs_set_private>."
37199 #: ../src/guestfs.pod:2121
37200 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
37204 #: ../src/guestfs.pod:2123
37207 " guestfs_set_private (g, key, NULL);\n"
37212 #: ../src/guestfs.pod:2125
37213 msgid "then that C<key> is not returned when walking."
37217 #: ../src/guestfs.pod:2129
37219 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
37220 "C<guestfs_next_private> or C<guestfs_set_private>."
37224 #: ../src/guestfs.pod:2135
37226 "The following example code shows how to print all keys and data pointers "
37227 "that are associated with the handle C<g>:"
37231 #: ../src/guestfs.pod:2138
37234 " const char *key;\n"
37235 " void *data = guestfs_first_private (g, &key);\n"
37236 " while (data != NULL)\n"
37238 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37239 " data = guestfs_next_private (g, &key);\n"
37245 #: ../src/guestfs.pod:2146
37247 "More commonly you are only interested in keys that begin with an "
37248 "application-specific prefix C<foo_>. Modify the loop like so:"
37252 #: ../src/guestfs.pod:2149
37255 " const char *key;\n"
37256 " void *data = guestfs_first_private (g, &key);\n"
37257 " while (data != NULL)\n"
37259 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37260 " printf (\"key = %s, data = %p\\n\", key, data);\n"
37261 " data = guestfs_next_private (g, &key);\n"
37267 #: ../src/guestfs.pod:2158
37269 "If you need to modify keys while walking, then you have to jump back to the "
37270 "beginning of the loop. For example, to delete all keys prefixed with "
37275 #: ../src/guestfs.pod:2162
37278 " const char *key;\n"
37281 " data = guestfs_first_private (g, &key);\n"
37282 " while (data != NULL)\n"
37284 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
37286 " guestfs_set_private (g, key, NULL);\n"
37287 " /* note that 'key' pointer is now invalid, and so is\n"
37288 " the internal iterator */\n"
37291 " data = guestfs_next_private (g, &key);\n"
37297 #: ../src/guestfs.pod:2178
37299 "Note that the above loop is guaranteed to terminate because the keys are "
37300 "being deleted, but other manipulations of keys within the loop might not "
37301 "terminate unless you also maintain an indication of which keys have been "
37306 #: ../src/guestfs.pod:2183
37311 #: ../src/guestfs.pod:2185
37313 "The libguestfs C library can be probed using systemtap or DTrace. This is "
37314 "true of any library, not just libguestfs. However libguestfs also contains "
37315 "static markers to help in probing internal operations."
37319 #: ../src/guestfs.pod:2189
37320 msgid "You can list all the static markers by doing:"
37324 #: ../src/guestfs.pod:2191
37327 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
37328 " .provider(\"guestfs\").mark(\"*\")'\n"
37333 #: ../src/guestfs.pod:2194
37335 "B<Note:> These static markers are I<not> part of the stable API and may "
37336 "change in future versions."
37340 #: ../src/guestfs.pod:2197
37341 msgid "SYSTEMTAP SCRIPT EXAMPLE"
37345 #: ../src/guestfs.pod:2199
37347 "This script contains examples of displaying both the static markers and some "
37348 "ordinary C entry points:"
37352 #: ../src/guestfs.pod:2202
37360 #: ../src/guestfs.pod:2204
37363 " function display_time () {\n"
37364 " now = gettimeofday_us ();\n"
37367 " delta = now - last;\n"
37373 #: ../src/guestfs.pod:2211
37376 " printf (\"%d (+%d):\", now, delta);\n"
37382 #: ../src/guestfs.pod:2214
37387 " printf (\"ready\\n\");\n"
37393 #: ../src/guestfs.pod:2219
37396 " /* Display all calls to static markers. */\n"
37397 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37398 " .provider(\"guestfs\").mark(\"*\") ? {\n"
37399 " display_time();\n"
37400 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
37406 #: ../src/guestfs.pod:2226
37409 " /* Display all calls to guestfs_mkfs* functions. */\n"
37410 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
37411 " .function(\"guestfs_mkfs*\") ? {\n"
37412 " display_time();\n"
37413 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
37419 #: ../src/guestfs.pod:2233
37421 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
37422 "program. Note that you either have to be root, or you have to add yourself "
37423 "to several special stap groups. Consult the systemtap documentation for "
37424 "more information."
37428 #: ../src/guestfs.pod:2238
37431 " # stap /tmp/test.stap\n"
37437 #: ../src/guestfs.pod:2241
37438 msgid "In another terminal, run a guestfish command such as this:"
37442 #: ../src/guestfs.pod:2245
37443 msgid "In the first terminal, stap trace output similar to this is shown:"
37447 #: ../src/guestfs.pod:2247
37450 " 1318248056692655 (+0):\tlaunch_start\n"
37451 " 1318248056692850 (+195): launch_build_appliance_start\n"
37452 " 1318248056818285 (+125435): launch_build_appliance_end\n"
37453 " 1318248056838059 (+19774): launch_run_qemu\n"
37454 " 1318248061071167 (+4233108): launch_end\n"
37455 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f "
37456 "device=0x1024e60\n"
37461 #: ../src/guestfs.pod:2254 ../src/guestfs.pod:2259
37466 #: ../src/guestfs.pod:2256
37468 "<!-- old anchor for the next section --> <a "
37469 "name=\"state_machine_and_low_level_event_api\"/>"
37473 #: ../src/guestfs.pod:2261
37474 msgid "ARCHITECTURE"
37478 #: ../src/guestfs.pod:2263
37480 "Internally, libguestfs is implemented by running an appliance (a special "
37481 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
37482 "process of the main program."
37486 #: ../src/guestfs.pod:2267
37489 " ___________________\n"
37491 " | main program |\n"
37493 " | | child process / appliance\n"
37494 " | | __________________________\n"
37496 " +-------------------+ RPC | +-----------------+ |\n"
37497 " | libguestfs <--------------------> guestfsd | |\n"
37498 " | | | +-----------------+ |\n"
37499 " \\___________________/ | | Linux kernel | |\n"
37500 " | +--^--------------+ |\n"
37501 " \\_________|________________/\n"
37503 " _______v______\n"
37506 " | disk image |\n"
37507 " \\______________/\n"
37512 #: ../src/guestfs.pod:2287
37514 "The library, linked to the main program, creates the child process and hence "
37515 "the appliance in the L</guestfs_launch> function."
37519 #: ../src/guestfs.pod:2290
37521 "Inside the appliance is a Linux kernel and a complete stack of userspace "
37522 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
37523 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
37524 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
37525 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
37526 "attached to the qemu process which translates device access by the "
37527 "appliance's Linux kernel into accesses to the image."
37531 #: ../src/guestfs.pod:2299
37533 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
37534 "Although the disk image you are attached to might also be used by some "
37535 "virtual machine, libguestfs doesn't know or care about this. (But you will "
37536 "care if both libguestfs's qemu process and your virtual machine are trying "
37537 "to update the disk image at the same time, since these usually results in "
37538 "massive disk corruption)."
37542 #: ../src/guestfs.pod:2306
37543 msgid "STATE MACHINE"
37547 #: ../src/guestfs.pod:2308
37548 msgid "libguestfs uses a state machine to model the child process:"
37552 #: ../src/guestfs.pod:2310
37556 " guestfs_create\n"
37564 " / | \\ \\ guestfs_launch\n"
37565 " / | _\\__V______\n"
37567 " / | | LAUNCHING |\n"
37568 " / | \\___________/\n"
37570 " / | guestfs_launch\n"
37572 " ______ / __|____V\n"
37573 " / \\ ------> / \\\n"
37574 " | BUSY | | READY |\n"
37575 " \\______/ <------ \\________/\n"
37580 #: ../src/guestfs.pod:2332
37582 "The normal transitions are (1) CONFIG (when the handle is created, but there "
37583 "is no child process), (2) LAUNCHING (when the child process is booting up), "
37584 "(3) alternating between READY and BUSY as commands are issued to, and "
37585 "carried out by, the child process."
37589 #: ../src/guestfs.pod:2337
37591 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
37592 "asynchronously at any time (eg. due to some internal error), and that causes "
37593 "the state to transition back to CONFIG."
37597 #: ../src/guestfs.pod:2341
37599 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
37600 "issued when in the CONFIG state."
37604 #: ../src/guestfs.pod:2344
37606 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
37607 "L</guestfs_launch> blocks until the child process is READY to accept "
37608 "commands (or until some failure or timeout). L</guestfs_launch> internally "
37609 "moves the state from CONFIG to LAUNCHING while it is running."
37613 #: ../src/guestfs.pod:2350
37615 "API actions such as L</guestfs_mount> can only be issued when in the READY "
37616 "state. These API calls block waiting for the command to be carried out "
37617 "(ie. the state to transition to BUSY and then back to READY). There are no "
37618 "non-blocking versions, and no way to issue more than one command per handle "
37619 "at the same time."
37623 #: ../src/guestfs.pod:2356
37625 "Finally, the child process sends asynchronous messages back to the main "
37626 "program, such as kernel log messages. You can register a callback to "
37627 "receive these messages."
37631 #: ../src/guestfs.pod:2360
37636 #: ../src/guestfs.pod:2362
37637 msgid "APPLIANCE BOOT PROCESS"
37641 #: ../src/guestfs.pod:2364
37643 "This process has evolved and continues to evolve. The description here "
37644 "corresponds only to the current version of libguestfs and is provided for "
37645 "information only."
37649 #: ../src/guestfs.pod:2368
37651 "In order to follow the stages involved below, enable libguestfs debugging "
37652 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
37656 #: ../src/guestfs.pod:2373
37657 msgid "Create the appliance"
37661 #: ../src/guestfs.pod:2375
37663 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
37664 "initrd and the appliance."
37668 #: ../src/guestfs.pod:2378
37670 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
37671 "directory if C<TMPDIR> is set)."
37675 #: ../src/guestfs.pod:2381
37677 "For a complete description of how the appliance is created and cached, read "
37678 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
37682 #: ../src/guestfs.pod:2385
37683 msgid "Start qemu and boot the kernel"
37687 #: ../src/guestfs.pod:2387
37688 msgid "qemu is invoked to boot the kernel."
37692 #: ../src/guestfs.pod:2389
37693 msgid "Run the initrd"
37697 #: ../src/guestfs.pod:2391
37699 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
37700 "appliance. The purpose of the initrd is to load enough kernel modules in "
37701 "order that the appliance itself can be mounted and started."
37705 #: ../src/guestfs.pod:2395
37707 "The initrd is a cpio archive called "
37708 "C</var/tmp/.guestfs-E<lt>UIDE<gt>/initrd>."
37712 #: ../src/guestfs.pod:2398
37714 "When the initrd has started you will see messages showing that kernel "
37715 "modules are being loaded, similar to this:"
37719 #: ../src/guestfs.pod:2401
37722 " febootstrap: ext2 mini initrd starting up\n"
37723 " febootstrap: mounting /sys\n"
37724 " febootstrap: internal insmod libcrc32c.ko\n"
37725 " febootstrap: internal insmod crc32c-intel.ko\n"
37730 #: ../src/guestfs.pod:2406
37731 msgid "Find and mount the appliance device"
37735 #: ../src/guestfs.pod:2408
37737 "The appliance is a sparse file containing an ext2 filesystem which contains "
37738 "a familiar (although reduced in size) Linux operating system. It would "
37739 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
37743 #: ../src/guestfs.pod:2412
37745 "The regular disks being inspected by libguestfs are the first devices "
37746 "exposed by qemu (eg. as C</dev/vda>)."
37750 #: ../src/guestfs.pod:2415
37752 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
37753 "there was only one regular disk)."
37757 #: ../src/guestfs.pod:2418
37759 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
37760 "and switch root into the appliance, and run C</init> from the appliance."
37764 #: ../src/guestfs.pod:2422
37765 msgid "If this works successfully you will see messages such as:"
37769 #: ../src/guestfs.pod:2424
37772 " febootstrap: picked /sys/block/vdb/dev as root device\n"
37773 " febootstrap: creating /dev/root as block special 252:16\n"
37774 " febootstrap: mounting new root on /root\n"
37775 " febootstrap: chroot\n"
37776 " Starting /init script ...\n"
37781 #: ../src/guestfs.pod:2430
37783 "Note that C<Starting /init script ...> indicates that the appliance's init "
37784 "script is now running."
37788 #: ../src/guestfs.pod:2433
37789 msgid "Initialize the appliance"
37793 #: ../src/guestfs.pod:2435
37795 "The appliance itself now initializes itself. This involves starting certain "
37796 "processes like C<udev>, possibly printing some debug information, and "
37797 "finally running the daemon (C<guestfsd>)."
37801 #: ../src/guestfs.pod:2439
37806 #: ../src/guestfs.pod:2441
37808 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
37813 #: ../src/guestfs.pod:2444
37816 " verbose daemon enabled\n"
37821 #: ../src/guestfs.pod:2446
37823 "The daemon expects to see a named virtio-serial port exposed by qemu and "
37824 "connected on the other end to the library."
37828 #: ../src/guestfs.pod:2449
37830 "The daemon connects to this port (and hence to the library) and sends a four "
37831 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
37832 "protocol (see below)."
37836 #: ../src/guestfs.pod:2455
37837 msgid "COMMUNICATION PROTOCOL"
37841 #: ../src/guestfs.pod:2457
37843 "Don't rely on using this protocol directly. This section documents how it "
37844 "currently works, but it may change at any time."
37848 #: ../src/guestfs.pod:2460
37850 "The protocol used to talk between the library and the daemon running inside "
37851 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
37852 "1014, RFC 1832, RFC 4506)."
37856 #: ../src/guestfs.pod:2464
37858 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
37859 "this file is automatically generated)."
37863 #: ../src/guestfs.pod:2467
37865 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
37866 "and C<FileOut> parameters, which are handled with very simple request/reply "
37867 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
37868 "parameters, which use the same request and reply messages, but they may also "
37869 "be followed by files sent using a chunked encoding."
37873 #: ../src/guestfs.pod:2474
37874 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
37878 #: ../src/guestfs.pod:2476
37879 msgid "For ordinary functions, the request message is:"
37883 #: ../src/guestfs.pod:2478
37886 " total length (header + arguments,\n"
37887 " but not including the length word itself)\n"
37888 " struct guestfs_message_header (encoded as XDR)\n"
37889 " struct guestfs_<foo>_args (encoded as XDR)\n"
37894 #: ../src/guestfs.pod:2483
37896 "The total length field allows the daemon to allocate a fixed size buffer "
37897 "into which it slurps the rest of the message. As a result, the total length "
37898 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
37899 "effective size of any request is limited to somewhere under this size."
37903 #: ../src/guestfs.pod:2489
37905 "Note also that many functions don't take any arguments, in which case the "
37906 "C<guestfs_I<foo>_args> is completely omitted."
37910 #: ../src/guestfs.pod:2492
37912 "The header contains the procedure number (C<guestfs_proc>) which is how the "
37913 "receiver knows what type of args structure to expect, or none at all."
37917 #: ../src/guestfs.pod:2496
37919 "For functions that take optional arguments, the optional arguments are "
37920 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
37921 "arguments. A bitmask in the header indicates which optional arguments are "
37922 "meaningful. The bitmask is also checked to see if it contains bits set "
37923 "which the daemon does not know about (eg. if more optional arguments were "
37924 "added in a later version of the library), and this causes the call to be "
37929 #: ../src/guestfs.pod:2504
37930 msgid "The reply message for ordinary functions is:"
37934 #: ../src/guestfs.pod:2506
37937 " total length (header + ret,\n"
37938 " but not including the length word itself)\n"
37939 " struct guestfs_message_header (encoded as XDR)\n"
37940 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37945 #: ../src/guestfs.pod:2511
37947 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
37948 "functions that return no formal return values."
37952 #: ../src/guestfs.pod:2514
37953 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
37957 #: ../src/guestfs.pod:2517
37959 "In the case of an error, a flag is set in the header, and the reply message "
37960 "is slightly changed:"
37964 #: ../src/guestfs.pod:2520
37967 " total length (header + error,\n"
37968 " but not including the length word itself)\n"
37969 " struct guestfs_message_header (encoded as XDR)\n"
37970 " struct guestfs_message_error (encoded as XDR)\n"
37975 #: ../src/guestfs.pod:2525
37977 "The C<guestfs_message_error> structure contains the error message as a "
37982 #: ../src/guestfs.pod:2528
37983 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
37987 #: ../src/guestfs.pod:2530
37989 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
37990 "The normal request message is sent (see above). However this is followed by "
37991 "a sequence of file chunks."
37995 #: ../src/guestfs.pod:2534
37998 " total length (header + arguments,\n"
37999 " but not including the length word itself,\n"
38000 " and not including the chunks)\n"
38001 " struct guestfs_message_header (encoded as XDR)\n"
38002 " struct guestfs_<foo>_args (encoded as XDR)\n"
38003 " sequence of chunks for FileIn param #0\n"
38004 " sequence of chunks for FileIn param #1 etc.\n"
38009 #: ../src/guestfs.pod:2542
38010 msgid "The \"sequence of chunks\" is:"
38014 #: ../src/guestfs.pod:2544
38017 " length of chunk (not including length word itself)\n"
38018 " struct guestfs_chunk (encoded as XDR)\n"
38019 " length of chunk\n"
38020 " struct guestfs_chunk (encoded as XDR)\n"
38022 " length of chunk\n"
38023 " struct guestfs_chunk (with data.data_len == 0)\n"
38028 #: ../src/guestfs.pod:2552
38030 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
38031 "is set in the final chunk to indicate either successful completion or early "
38036 #: ../src/guestfs.pod:2556
38038 "At time of writing there are no functions that have more than one FileIn "
38039 "parameter. However this is (theoretically) supported, by sending the "
38040 "sequence of chunks for each FileIn parameter one after another (from left to "
38045 #: ../src/guestfs.pod:2561
38047 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
38048 "transfer. The library does this by sending a chunk with a special flag set "
38049 "to indicate cancellation. When the daemon sees this, it cancels the whole "
38050 "RPC, does I<not> send any reply, and goes back to reading the next request."
38054 #: ../src/guestfs.pod:2567
38056 "The daemon may also cancel. It does this by writing a special word "
38057 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
38058 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
38059 "cancel chunk). The special word is chosen so that even if cancellation "
38060 "happens right at the end of the transfer (after the library has finished "
38061 "writing and has started listening for the reply), the \"spurious\" cancel "
38062 "flag will not be confused with the reply message."
38066 #: ../src/guestfs.pod:2576
38068 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
38069 "limit), and also files where the size is not known in advance (eg. from "
38070 "pipes or sockets). However the chunks are rather small "
38071 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
38072 "to keep much in memory."
38076 #: ../src/guestfs.pod:2582
38077 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
38081 #: ../src/guestfs.pod:2584
38083 "The protocol for FileOut parameters is exactly the same as for FileIn "
38084 "parameters, but with the roles of daemon and library reversed."
38088 #: ../src/guestfs.pod:2587
38091 " total length (header + ret,\n"
38092 " but not including the length word itself,\n"
38093 " and not including the chunks)\n"
38094 " struct guestfs_message_header (encoded as XDR)\n"
38095 " struct guestfs_<foo>_ret (encoded as XDR)\n"
38096 " sequence of chunks for FileOut param #0\n"
38097 " sequence of chunks for FileOut param #1 etc.\n"
38102 #: ../src/guestfs.pod:2595
38103 msgid "INITIAL MESSAGE"
38107 #: ../src/guestfs.pod:2597
38109 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
38110 "which indicates that the guest and daemon is alive. This is what "
38111 "L</guestfs_launch> waits for."
38115 #: ../src/guestfs.pod:2601
38116 msgid "PROGRESS NOTIFICATION MESSAGES"
38120 #: ../src/guestfs.pod:2603
38122 "The daemon may send progress notification messages at any time. These are "
38123 "distinguished by the normal length word being replaced by "
38124 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
38128 #: ../src/guestfs.pod:2607
38130 "The library turns them into progress callbacks (see "
38131 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
38136 #: ../src/guestfs.pod:2611
38138 "The daemon self-limits the frequency of progress messages it sends (see "
38139 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
38144 #: ../src/guestfs.pod:2615
38145 msgid "LIBGUESTFS VERSION NUMBERS"
38149 #: ../src/guestfs.pod:2617
38151 "Since April 2010, libguestfs has started to make separate development and "
38152 "stable releases, along with corresponding branches in our git repository. "
38153 "These separate releases can be identified by version number:"
38157 #: ../src/guestfs.pod:2622
38160 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
38161 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
38167 " | `-------- sub-version\n"
38169 " `------ always '1' because we don't change the ABI\n"
38174 #: ../src/guestfs.pod:2633
38175 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
38179 #: ../src/guestfs.pod:2635
38181 "As time passes we cherry pick fixes from the development branch and backport "
38182 "those into the stable branch, the effect being that the stable branch should "
38183 "get more stable and less buggy over time. So the stable releases are ideal "
38184 "for people who don't need new features but would just like the software to "
38189 #: ../src/guestfs.pod:2641
38190 msgid "Our criteria for backporting changes are:"
38194 #: ../src/guestfs.pod:2647
38196 "Documentation changes which don't affect any code are backported unless the "
38197 "documentation refers to a future feature which is not in stable."
38201 #: ../src/guestfs.pod:2653
38203 "Bug fixes which are not controversial, fix obvious problems, and have been "
38204 "well tested are backported."
38208 #: ../src/guestfs.pod:2658
38210 "Simple rearrangements of code which shouldn't affect how it works get "
38211 "backported. This is so that the code in the two branches doesn't get too "
38212 "far out of step, allowing us to backport future fixes more easily."
38216 #: ../src/guestfs.pod:2664
38218 "We I<don't> backport new features, new APIs, new tools etc, except in one "
38219 "exceptional case: the new feature is required in order to implement an "
38220 "important bug fix."
38224 #: ../src/guestfs.pod:2670
38226 "A new stable branch starts when we think the new features in development are "
38227 "substantial and compelling enough over the current stable branch to warrant "
38228 "it. When that happens we create new stable and development versions 1.N.0 "
38229 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
38230 "stable at this point, but by backporting fixes from development, that branch "
38231 "will stabilize over time."
38235 #: ../src/guestfs.pod:2678
38236 msgid "EXTENDING LIBGUESTFS"
38240 #: ../src/guestfs.pod:2680
38241 msgid "ADDING A NEW API ACTION"
38245 #: ../src/guestfs.pod:2682
38247 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
38248 "documentation) are generated, and this makes it easy to extend the "
38253 #: ../src/guestfs.pod:2686
38254 msgid "To add a new API action there are two changes:"
38258 #: ../src/guestfs.pod:2692
38260 "You need to add a description of the call (name, parameters, return type, "
38261 "tests, documentation) to C<generator/generator_actions.ml>."
38265 #: ../src/guestfs.pod:2695
38267 "There are two sorts of API action, depending on whether the call goes "
38268 "through to the daemon in the appliance, or is serviced entirely by the "
38269 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
38270 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
38271 "an example of the latter, since a trace flag is maintained in the handle and "
38272 "all tracing is done on the library side."
38276 #: ../src/guestfs.pod:2703
38278 "Most new actions are of the first type, and get added to the "
38279 "C<daemon_functions> list. Each function has a unique procedure number used "
38280 "in the RPC protocol which is assigned to that action when we publish "
38281 "libguestfs and cannot be reused. Take the latest procedure number and "
38286 #: ../src/guestfs.pod:2709
38288 "For library-only actions of the second type, add to the "
38289 "C<non_daemon_functions> list. Since these functions are serviced by the "
38290 "library and do not travel over the RPC mechanism to the daemon, these "
38291 "functions do not need a procedure number, and so the procedure number is set "
38296 #: ../src/guestfs.pod:2717
38297 msgid "Implement the action (in C):"
38301 #: ../src/guestfs.pod:2719
38303 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
38304 "C<daemon/> directory."
38308 #: ../src/guestfs.pod:2722
38310 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
38311 "(note: double underscore) in the C<src/> directory."
38315 #: ../src/guestfs.pod:2725
38316 msgid "In either case, use another function as an example of what to do."
38320 #: ../src/guestfs.pod:2729
38321 msgid "After making these changes, use C<make> to compile."
38325 #: ../src/guestfs.pod:2731
38327 "Note that you don't need to implement the RPC, language bindings, manual "
38328 "pages or anything else. It's all automatically generated from the OCaml "
38333 #: ../src/guestfs.pod:2735
38334 msgid "ADDING TESTS FOR AN API ACTION"
38338 #: ../src/guestfs.pod:2737
38340 "You can supply zero or as many tests as you want per API call. The tests "
38341 "can either be added as part of the API description "
38342 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
38343 "drop a script into C<regressions/>. Note that adding a script to "
38344 "C<regressions/> is slower, so if possible use the first method."
38348 #: ../src/guestfs.pod:2743
38350 "The following describes the test environment used when you add an API test "
38351 "in C<generator_actions.ml>."
38355 #: ../src/guestfs.pod:2746
38356 msgid "The test environment has 4 block devices:"
38360 #: ../src/guestfs.pod:2750
38361 msgid "C</dev/sda> 500MB"
38365 #: ../src/guestfs.pod:2752
38366 msgid "General block device for testing."
38370 #: ../src/guestfs.pod:2754
38371 msgid "C</dev/sdb> 50MB"
38375 #: ../src/guestfs.pod:2756
38377 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
38382 #: ../src/guestfs.pod:2759
38383 msgid "C</dev/sdc> 10MB"
38387 #: ../src/guestfs.pod:2761
38388 msgid "Used in a few tests where two block devices are needed."
38392 #: ../src/guestfs.pod:2763
38393 msgid "C</dev/sdd>"
38397 #: ../src/guestfs.pod:2765
38398 msgid "ISO with fixed content (see C<images/test.iso>)."
38402 #: ../src/guestfs.pod:2769
38404 "To be able to run the tests in a reasonable amount of time, the libguestfs "
38405 "appliance and block devices are reused between tests. So don't try testing "
38406 "L</guestfs_kill_subprocess> :-x"
38410 #: ../src/guestfs.pod:2773
38412 "Each test starts with an initial scenario, selected using one of the "
38413 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
38414 "initialize the disks mentioned above in a particular way as documented in "
38415 "C<generator_types.ml>. You should not assume anything about the previous "
38416 "contents of other disks that are not initialized."
38420 #: ../src/guestfs.pod:2779
38422 "You can add a prerequisite clause to any individual test. This is a "
38423 "run-time check, which, if it fails, causes the test to be skipped. Useful "
38424 "if testing a command which might not work on all variations of libguestfs "
38425 "builds. A test that has prerequisite of C<Always> means to run "
38430 #: ../src/guestfs.pod:2785
38432 "In addition, packagers can skip individual tests by setting environment "
38433 "variables before running C<make check>."
38437 #: ../src/guestfs.pod:2788
38440 " SKIP_TEST_<CMD>_<NUM>=1\n"
38445 #: ../src/guestfs.pod:2790
38446 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
38450 #: ../src/guestfs.pod:2792
38455 #: ../src/guestfs.pod:2794
38458 " SKIP_TEST_<CMD>=1\n"
38463 #: ../src/guestfs.pod:2796
38464 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
38468 #: ../src/guestfs.pod:2798
38469 msgid "Packagers can run only certain tests by setting for example:"
38473 #: ../src/guestfs.pod:2800
38476 " TEST_ONLY=\"vfs_type zerofree\"\n"
38481 #: ../src/guestfs.pod:2802
38483 "See C<capitests/tests.c> for more details of how these environment variables "
38488 #: ../src/guestfs.pod:2805
38489 msgid "DEBUGGING NEW API ACTIONS"
38493 #: ../src/guestfs.pod:2807
38494 msgid "Test new actions work before submitting them."
38498 #: ../src/guestfs.pod:2809
38499 msgid "You can use guestfish to try out new commands."
38503 #: ../src/guestfs.pod:2811
38505 "Debugging the daemon is a problem because it runs inside a minimal "
38506 "environment. However you can fprintf messages in the daemon to stderr, and "
38507 "they will show up if you use C<guestfish -v>."
38511 #: ../src/guestfs.pod:2815
38512 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
38516 #: ../src/guestfs.pod:2817
38518 "Our C source code generally adheres to some basic code-formatting "
38519 "conventions. The existing code base is not totally consistent on this "
38520 "front, but we do prefer that contributed code be formatted similarly. In "
38521 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
38522 "indentation level, and other than that, follow the K&R style."
38526 #: ../src/guestfs.pod:2823
38528 "If you use Emacs, add the following to one of one of your start-up files "
38529 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
38533 #: ../src/guestfs.pod:2826
38536 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
38537 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
38538 " (add-hook 'find-file-hook\n"
38539 " '(lambda () (if (and buffer-file-name\n"
38540 " (string-match \"/libguestfs\\\\>\"\n"
38541 " (buffer-file-name))\n"
38542 " (not (string-equal mode-name \"Change Log\"))\n"
38543 " (not (string-equal mode-name \"Makefile\")))\n"
38544 " (setq indent-tabs-mode nil))))\n"
38549 #: ../src/guestfs.pod:2836
38552 " ;;; When editing C sources in libguestfs, use this style.\n"
38553 " (defun libguestfs-c-mode ()\n"
38554 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
38556 " (c-set-style \"K&R\")\n"
38557 " (setq c-indent-level 2)\n"
38558 " (setq c-basic-offset 2))\n"
38559 " (add-hook 'c-mode-hook\n"
38560 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
38561 " (buffer-file-name))\n"
38562 " (libguestfs-c-mode))))\n"
38567 #: ../src/guestfs.pod:2848
38568 msgid "Enable warnings when compiling (and fix any problems this finds):"
38572 #: ../src/guestfs.pod:2851
38575 " ./configure --enable-gcc-warnings\n"
38580 #: ../src/guestfs.pod:2853
38581 msgid "Useful targets are:"
38585 #: ../src/guestfs.pod:2855
38588 " make syntax-check # checks the syntax of the C code\n"
38589 " make check # runs the test suite\n"
38594 #: ../src/guestfs.pod:2858
38595 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
38599 #: ../src/guestfs.pod:2860
38601 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
38602 "which are used to do shell quoting."
38606 #: ../src/guestfs.pod:2865
38611 #: ../src/guestfs.pod:2867
38613 "Simple shell quoted string. Any spaces or other shell characters are "
38618 #: ../src/guestfs.pod:2870
38623 #: ../src/guestfs.pod:2872
38625 "Same as C<%Q> except the string is treated as a path which is prefixed by "
38630 #: ../src/guestfs.pod:2879
38633 " asprintf (&cmd, \"cat %R\", path);\n"
38638 #: ../src/guestfs.pod:2881
38639 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
38643 #: ../src/guestfs.pod:2883
38645 "I<Note:> Do I<not> use these when you are passing parameters to the "
38646 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
38647 "because they are not passed via the shell (instead, straight to exec). You "
38648 "probably want to use the C<sysroot_path()> function however."
38652 #: ../src/guestfs.pod:2889
38653 msgid "SUBMITTING YOUR NEW API ACTIONS"
38657 #: ../src/guestfs.pod:2891
38659 "Submit patches to the mailing list: "
38660 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
38661 "L<rjones@redhat.com>."
38665 #: ../src/guestfs.pod:2895
38666 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
38670 #: ../src/guestfs.pod:2897
38671 msgid "We support i18n (gettext anyhow) in the library."
38675 #: ../src/guestfs.pod:2899
38677 "However many messages come from the daemon, and we don't translate those at "
38678 "the moment. One reason is that the appliance generally has all locale files "
38679 "removed from it, because they take up a lot of space. So we'd have to readd "
38680 "some of those, as well as copying our PO files into the appliance."
38684 #: ../src/guestfs.pod:2905
38686 "Debugging messages are never translated, since they are intended for the "
38691 #: ../src/guestfs.pod:2908
38692 msgid "SOURCE CODE SUBDIRECTORIES"
38696 #: ../src/guestfs.pod:2912
38701 #: ../src/guestfs.pod:2914
38702 msgid "L<virt-alignment-scan(1)> command and documentation."
38706 #: ../src/guestfs.pod:2918
38707 msgid "The libguestfs appliance, build scripts and so on."
38711 #: ../src/guestfs.pod:2920
38712 msgid "C<capitests>"
38716 #: ../src/guestfs.pod:2922
38717 msgid "Automated tests of the C API."
38721 #: ../src/guestfs.pod:2924
38726 #: ../src/guestfs.pod:2926
38728 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
38733 #: ../src/guestfs.pod:2929
38738 #: ../src/guestfs.pod:2931
38740 "Safety and liveness tests of components that libguestfs depends upon (not of "
38741 "libguestfs itself). Mainly this is for qemu and the kernel."
38745 #: ../src/guestfs.pod:2934
38750 #: ../src/guestfs.pod:2936
38752 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
38753 "command and documentation."
38757 #: ../src/guestfs.pod:2939
38762 #: ../src/guestfs.pod:2941
38763 msgid "Outside contributions, experimental parts."
38767 #: ../src/guestfs.pod:2943
38772 #: ../src/guestfs.pod:2945
38774 "The daemon that runs inside the libguestfs appliance and carries out "
38779 #: ../src/guestfs.pod:2948
38784 #: ../src/guestfs.pod:2950
38785 msgid "L<virt-df(1)> command and documentation."
38789 #: ../src/guestfs.pod:2952
38794 #: ../src/guestfs.pod:2954
38795 msgid "L<virt-edit(1)> command and documentation."
38799 #: ../src/guestfs.pod:2956
38800 msgid "C<examples>"
38804 #: ../src/guestfs.pod:2958
38805 msgid "C API example code."
38809 #: ../src/guestfs.pod:2960
38814 #: ../src/guestfs.pod:2962
38816 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
38817 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
38818 "L<virt-tar-out(1)>."
38822 #: ../src/guestfs.pod:2966
38827 #: ../src/guestfs.pod:2968
38828 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
38832 #: ../src/guestfs.pod:2970
38833 msgid "C<generator>"
38837 #: ../src/guestfs.pod:2972
38839 "The crucially important generator, used to automatically generate large "
38840 "amounts of boilerplate C code for things like RPC and bindings."
38844 #: ../src/guestfs.pod:2975
38849 #: ../src/guestfs.pod:2977
38850 msgid "Files used by the test suite."
38854 #: ../src/guestfs.pod:2979
38855 msgid "Some \"phony\" guest images which we test against."
38859 #: ../src/guestfs.pod:2981
38860 msgid "C<inspector>"
38864 #: ../src/guestfs.pod:2983
38865 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
38869 #: ../src/guestfs.pod:2985
38874 #: ../src/guestfs.pod:2987
38875 msgid "Logo used on the website. The fish is called Arthur by the way."
38879 #: ../src/guestfs.pod:2989
38884 #: ../src/guestfs.pod:2991
38885 msgid "M4 macros used by autoconf."
38889 #: ../src/guestfs.pod:2993
38894 #: ../src/guestfs.pod:2995
38895 msgid "Translations of simple gettext strings."
38899 #: ../src/guestfs.pod:2997
38904 #: ../src/guestfs.pod:2999
38906 "The build infrastructure and PO files for translations of manpages and POD "
38907 "files. Eventually this will be combined with the C<po> directory, but that "
38908 "is rather complicated."
38912 #: ../src/guestfs.pod:3003
38913 msgid "C<regressions>"
38917 #: ../src/guestfs.pod:3005
38918 msgid "Regression tests."
38922 #: ../src/guestfs.pod:3007
38927 #: ../src/guestfs.pod:3009
38928 msgid "L<virt-rescue(1)> command and documentation."
38932 #: ../src/guestfs.pod:3011
38937 #: ../src/guestfs.pod:3013
38938 msgid "L<virt-resize(1)> command and documentation."
38942 #: ../src/guestfs.pod:3015
38943 msgid "C<sparsify>"
38947 #: ../src/guestfs.pod:3017
38948 msgid "L<virt-sparsify(1)> command and documentation."
38952 #: ../src/guestfs.pod:3019
38957 #: ../src/guestfs.pod:3021
38958 msgid "Source code to the C library."
38962 #: ../src/guestfs.pod:3023
38967 #: ../src/guestfs.pod:3025
38968 msgid "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
38972 #: ../src/guestfs.pod:3027
38973 msgid "C<test-tool>"
38977 #: ../src/guestfs.pod:3029
38979 "Test tool for end users to test if their qemu/kernel combination will work "
38984 #: ../src/guestfs.pod:3032
38989 #: ../src/guestfs.pod:3034
38994 #: ../src/guestfs.pod:3036
38999 #: ../src/guestfs.pod:3038
39004 #: ../src/guestfs.pod:3040
39009 #: ../src/guestfs.pod:3042
39014 #: ../src/guestfs.pod:3044
39019 #: ../src/guestfs.pod:3046
39024 #: ../src/guestfs.pod:3048
39029 #: ../src/guestfs.pod:3050
39030 msgid "Language bindings."
39034 #: ../src/guestfs.pod:3054
39035 msgid "MAKING A STABLE RELEASE"
39039 #: ../src/guestfs.pod:3056
39041 "When we make a stable release, there are several steps documented here. See "
39042 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
39047 #: ../src/guestfs.pod:3064
39048 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
39052 #: ../src/guestfs.pod:3069
39053 msgid "Finalize RELEASE-NOTES."
39057 #: ../src/guestfs.pod:3073
39058 msgid "Update ROADMAP."
39062 #: ../src/guestfs.pod:3077
39063 msgid "Run C<src/api-support/update-from-tarballs.sh>."
39067 #: ../src/guestfs.pod:3081
39068 msgid "Push and pull from Transifex."
39072 #: ../src/guestfs.pod:3083
39077 #: ../src/guestfs.pod:3085
39085 #: ../src/guestfs.pod:3087
39086 msgid "to push the latest POT files to Transifex. Then run:"
39090 #: ../src/guestfs.pod:3089
39098 #: ../src/guestfs.pod:3091
39099 msgid "which is a wrapper to pull the latest translated C<*.po> files."
39103 #: ../src/guestfs.pod:3095
39105 "Create new stable and development directories under "
39106 "L<http://libguestfs.org/download>."
39110 #: ../src/guestfs.pod:3100
39111 msgid "Create the branch in git:"
39115 #: ../src/guestfs.pod:3102
39118 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
39119 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
39120 " git branch stable-1.XX\n"
39121 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
39126 #: ../src/guestfs.pod:3109
39131 #: ../src/guestfs.pod:3111
39132 msgid "PROTOCOL LIMITS"
39136 #: ../src/guestfs.pod:3113
39138 "Internally libguestfs uses a message-based protocol to pass API calls and "
39139 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
39140 "plenty more detail about this). The maximum message size used by the "
39141 "protocol is slightly less than 4 MB. For some API calls you may need to be "
39142 "aware of this limit. The API calls which may be affected are individually "
39143 "documented, with a link back to this section of the documentation."
39147 #: ../src/guestfs.pod:3121
39149 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
39150 "a simple string. Because this string is at some point internally encoded as "
39151 "a message, the maximum size that it can return is slightly under 4 MB. If "
39152 "the requested file is larger than this then you will get an error."
39156 #: ../src/guestfs.pod:3127
39158 "In order to transfer large files into and out of the guest filesystem, you "
39159 "need to use particular calls that support this. The sections L</UPLOADING> "
39160 "and L</DOWNLOADING> document how to do this."
39164 #: ../src/guestfs.pod:3131
39166 "You might also consider mounting the disk image using our FUSE filesystem "
39167 "support (L<guestmount(1)>)."
39171 #: ../src/guestfs.pod:3134
39172 msgid "MAXIMUM NUMBER OF DISKS"
39176 #: ../src/guestfs.pod:3136
39177 msgid "When using virtio disks (the default) the current limit is B<25> disks."
39181 #: ../src/guestfs.pod:3139
39183 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
39184 "slots. However febootstrap only understands disks with names C</dev/vda> "
39185 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
39190 #: ../src/guestfs.pod:3144
39192 "We are working to substantially raise this limit in future versions but it "
39193 "requires complex changes to qemu."
39197 #: ../src/guestfs.pod:3147
39199 "In future versions of libguestfs it should also be possible to \"hot plug\" "
39200 "disks (add and remove disks after calling L</guestfs_launch>). This also "
39201 "requires changes to qemu."
39205 #: ../src/guestfs.pod:3151
39206 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
39210 #: ../src/guestfs.pod:3153
39211 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
39215 #: ../src/guestfs.pod:3155
39217 "This is because it reserves 4 bits for the minor device number (thus "
39218 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
39222 #: ../src/guestfs.pod:3158
39224 "If you attach a disk with more than 15 partitions, the extra partitions are "
39225 "ignored by libguestfs."
39229 #: ../src/guestfs.pod:3161
39230 msgid "MAXIMUM SIZE OF A DISK"
39234 #: ../src/guestfs.pod:3163
39235 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
39239 #: ../src/guestfs.pod:3165
39241 "We have tested block devices up to 1 exabyte (2**60 or "
39242 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
39247 #: ../src/guestfs.pod:3169
39249 "Although libguestfs probably does not impose any limit, the underlying host "
39250 "storage will. If you store disk images on a host ext4 filesystem, then the "
39251 "maximum size will be limited by the maximum ext4 file size (currently 16 "
39252 "TB). If you store disk images as host logical volumes then you are limited "
39253 "by the maximum size of an LV."
39257 #: ../src/guestfs.pod:3175
39259 "For the hugest disk image files, we recommend using XFS on the host for "
39264 #: ../src/guestfs.pod:3178
39265 msgid "MAXIMUM SIZE OF A PARTITION"
39269 #: ../src/guestfs.pod:3180
39271 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
39272 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
39273 "address a partition located beyond 2 TB on the disk."
39277 #: ../src/guestfs.pod:3184
39279 "It is recommended that you use GPT partitions on disks which are larger than "
39280 "this size. GPT uses 64 bit sector numbers and so can address partitions "
39281 "which are theoretically larger than the largest disk we could support."
39285 #: ../src/guestfs.pod:3189
39286 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
39290 #: ../src/guestfs.pod:3191
39292 "This depends on the filesystem type. libguestfs itself does not impose any "
39293 "known limit. Consult Wikipedia or the filesystem documentation to find out "
39294 "what these limits are."
39298 #: ../src/guestfs.pod:3195
39299 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
39303 #: ../src/guestfs.pod:3197
39305 "The API functions L</guestfs_upload>, L</guestfs_download>, "
39306 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
39307 "uploads and downloads."
39311 #: ../src/guestfs.pod:3201
39312 msgid "INSPECTION LIMITS"
39316 #: ../src/guestfs.pod:3203
39318 "The inspection code has several arbitrary limits on things like the size of "
39319 "Windows Registry hive it will read, and the length of product name. These "
39320 "are intended to stop a malicious guest from consuming arbitrary amounts of "
39321 "memory and disk space on the host, and should not be reached in practice. "
39322 "See the source code for more information."
39326 #: ../src/guestfs.pod:3229
39328 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
39329 "effect as calling C<guestfs_set_verbose (g, 1)>."
39333 #: ../src/guestfs.pod:3241
39335 "Set the path that libguestfs uses to search for a supermin appliance. See "
39336 "the discussion of paths in section L</PATH> above."
39340 #: ../src/guestfs.pod:3250
39341 msgid "See also L</QEMU WRAPPERS> above."
39345 #: ../src/guestfs.pod:3254
39347 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
39348 "effect as calling C<guestfs_set_trace (g, 1)>."
39352 #: ../src/guestfs.pod:3272
39354 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
39355 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
39356 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, "
39357 "L<virt-alignment-scan(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
39358 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
39359 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
39360 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
39361 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, "
39362 "L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
39363 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
39364 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)>, "
39365 "L<http://libguestfs.org/>."
39369 #: ../src/guestfs.pod:3308
39371 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
39372 "L<lvm(8)>, L<disktype(1)>."
39376 #: ../src/guestfs.pod:3315 ../tools/virt-make-fs.pl:571 ../tools/virt-win-reg.pl:772
39381 #: ../src/guestfs.pod:3317
39382 msgid "To get a list of bugs against libguestfs use this link:"
39386 #: ../src/guestfs.pod:3319
39387 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
39391 #: ../src/guestfs.pod:3321
39392 msgid "To report a new bug against libguestfs use this link:"
39396 #: ../src/guestfs.pod:3323
39397 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
39401 #: ../src/guestfs.pod:3325
39402 msgid "When reporting a bug, please check:"
39406 #: ../src/guestfs.pod:3331
39407 msgid "That the bug hasn't been reported already."
39411 #: ../src/guestfs.pod:3335
39412 msgid "That you are testing a recent version."
39416 #: ../src/guestfs.pod:3339
39417 msgid "Describe the bug accurately, and give a way to reproduce it."
39421 #: ../src/guestfs.pod:3343
39423 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
39428 #: ../test-tool/libguestfs-test-tool.pod:5
39429 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
39433 #: ../test-tool/libguestfs-test-tool.pod:9
39436 " libguestfs-test-tool [--options]\n"
39441 #: ../test-tool/libguestfs-test-tool.pod:13
39443 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
39444 "to check basic libguestfs functionality is working. This is needed because "
39445 "libguestfs occasionally breaks for reasons beyond our control: usually "
39446 "because of changes in the underlying qemu or kernel packages, or the host "
39451 #: ../test-tool/libguestfs-test-tool.pod:19
39452 msgid "If you suspect a problem in libguestfs, then just run:"
39456 #: ../test-tool/libguestfs-test-tool.pod:21
39459 " libguestfs-test-tool\n"
39464 #: ../test-tool/libguestfs-test-tool.pod:23
39465 msgid "It will print lots of diagnostic messages."
39469 #: ../test-tool/libguestfs-test-tool.pod:25
39470 msgid "If it runs to completion successfully, you will see this near the end:"
39474 #: ../test-tool/libguestfs-test-tool.pod:27
39477 " ===== TEST FINISHED OK =====\n"
39482 #: ../test-tool/libguestfs-test-tool.pod:29
39483 msgid "and the test tool will exit with code 0."
39487 #: ../test-tool/libguestfs-test-tool.pod:31
39489 "If it fails (and/or exits with non-zero error code), please paste the "
39490 "I<complete, unedited> output of the test tool into a bug report. More "
39491 "information about reporting bugs can be found on the "
39492 "L<http://libguestfs.org/> website."
39496 #: ../test-tool/libguestfs-test-tool.pod:42
39497 msgid "Display short usage information and exit."
39501 #: ../test-tool/libguestfs-test-tool.pod:44
39502 msgid "B<--qemu qemu_binary>"
39506 #: ../test-tool/libguestfs-test-tool.pod:46
39508 "If you have downloaded another qemu binary, point this option at the full "
39509 "path of the binary to try it."
39513 #: ../test-tool/libguestfs-test-tool.pod:49
39514 msgid "B<--qemudir qemu_source_dir>"
39518 #: ../test-tool/libguestfs-test-tool.pod:51
39520 "If you have compiled qemu from source, point this option at the source "
39521 "directory to try it."
39525 #: ../test-tool/libguestfs-test-tool.pod:54
39530 #: ../test-tool/libguestfs-test-tool.pod:56
39531 msgid "B<--timeout N>"
39535 #: ../test-tool/libguestfs-test-tool.pod:58
39537 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
39538 "minutes) which does not usually need to be adjusted."
39542 #: ../test-tool/libguestfs-test-tool.pod:63
39543 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
39547 #: ../test-tool/libguestfs-test-tool.pod:65
39549 "If you have compiled another version of qemu from source and would like to "
39550 "try that, then you can use the I<--qemudir> option to point to the qemu "
39551 "source directory."
39555 #: ../test-tool/libguestfs-test-tool.pod:69
39557 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
39558 "option to point to the binary."
39562 #: ../test-tool/libguestfs-test-tool.pod:72
39564 "Note when using these options, you can ignore the business of qemu wrapper "
39565 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
39566 "wrapper script for you if one is needed."
39570 #: ../test-tool/libguestfs-test-tool.pod:76
39571 msgid "TRYING OUT A DIFFERENT KERNEL"
39575 #: ../test-tool/libguestfs-test-tool.pod:78
39577 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
39578 "libguestfs tries. You do this by setting the environment variables "
39579 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
39583 #: ../test-tool/libguestfs-test-tool.pod:82
39585 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
39590 #: ../test-tool/libguestfs-test-tool.pod:85
39591 msgid "SELF-DIAGNOSIS"
39595 #: ../test-tool/libguestfs-test-tool.pod:87
39597 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
39598 "produced by libguestfs-test-tool and/or possible errors."
39602 #: ../test-tool/libguestfs-test-tool.pod:92
39604 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
39605 "I<1> if there was an error."
39609 #: ../test-tool/libguestfs-test-tool.pod:97
39611 "For the full list of environment variables which may affect libguestfs, "
39612 "please see the L<guestfs(3)> manual page."
39616 #: ../test-tool/libguestfs-test-tool.pod:102
39617 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
39621 #: ../tools/virt-list-filesystems.pl:32
39622 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
39626 #: ../tools/virt-list-filesystems.pl:36
39629 " virt-list-filesystems [--options] domname\n"
39634 #: ../tools/virt-list-filesystems.pl:38
39637 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
39642 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
39644 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
39649 #: ../tools/virt-list-filesystems.pl:45
39651 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
39652 "are contained in a virtual machine or disk image."
39656 #: ../tools/virt-list-filesystems.pl:49
39658 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
39659 "functionality. For more complex cases you should look at the "
39660 "L<guestfish(1)> tool."
39664 #: ../tools/virt-list-filesystems.pl:112
39666 "With this option, C<virt-list-filesystems> displays the type of each "
39667 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
39671 #: ../tools/virt-list-filesystems.pl:119
39676 #: ../tools/virt-list-filesystems.pl:123
39678 "Normally we only show mountable filesystems. If this option is given then "
39679 "swap devices are shown too."
39683 #: ../tools/virt-list-filesystems.pl:197
39685 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
39686 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
39687 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39691 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
39692 msgid "Copyright (C) 2009 Red Hat Inc."
39696 #: ../tools/virt-list-partitions.pl:32
39697 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
39701 #: ../tools/virt-list-partitions.pl:36
39704 " virt-list-partitions [--options] domname\n"
39709 #: ../tools/virt-list-partitions.pl:38
39712 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
39717 #: ../tools/virt-list-partitions.pl:45
39719 "C<virt-list-partitions> is a command line tool to list the partitions that "
39720 "are contained in a virtual machine or disk image. It is mainly useful as a "
39721 "first step to using L<virt-resize(1)>."
39725 #: ../tools/virt-list-partitions.pl:50
39727 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
39728 "functionality. For more complex cases you should look at the "
39729 "L<guestfish(1)> tool."
39733 #: ../tools/virt-list-partitions.pl:113
39734 msgid "Show sizes in human-readable form (eg. \"1G\")."
39738 #: ../tools/virt-list-partitions.pl:123
39740 "With this option, C<virt-list-partitions> displays the type and size of each "
39741 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
39745 #: ../tools/virt-list-partitions.pl:130
39750 #: ../tools/virt-list-partitions.pl:132
39755 #: ../tools/virt-list-partitions.pl:134
39756 msgid "Display the total size of each block device (as a separate row or rows)."
39760 #: ../tools/virt-list-partitions.pl:267
39762 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
39763 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
39764 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39768 #: ../tools/virt-list-partitions.pl:283
39769 msgid "Copyright (C) 2009-2010 Red Hat Inc."
39773 #: ../tools/virt-make-fs.pl:37
39774 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
39778 #: ../tools/virt-make-fs.pl:41
39781 " virt-make-fs [--options] input.tar output.img\n"
39786 #: ../tools/virt-make-fs.pl:43
39789 " virt-make-fs [--options] input.tar.gz output.img\n"
39794 #: ../tools/virt-make-fs.pl:45
39797 " virt-make-fs [--options] directory output.img\n"
39802 #: ../tools/virt-make-fs.pl:49
39804 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
39805 "archive or some files in a directory. It is similar to tools like "
39806 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
39807 "it can create common filesystem types like ext2/3 or NTFS, which can be "
39808 "useful if you want to attach these filesystems to existing virtual machines "
39809 "(eg. to import large amounts of read-only data to a VM)."
39813 #: ../tools/virt-make-fs.pl:57
39814 msgid "Basic usage is:"
39818 #: ../tools/virt-make-fs.pl:59
39821 " virt-make-fs input output.img\n"
39826 #: ../tools/virt-make-fs.pl:61
39828 "where C<input> is either a directory containing files that you want to add, "
39829 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
39830 "C<output.img> is a disk image. The input type is detected automatically. "
39831 "The output disk image defaults to a raw ext2 sparse image unless you specify "
39832 "extra flags (see L</OPTIONS> below)."
39836 #: ../tools/virt-make-fs.pl:67
39837 msgid "FILESYSTEM TYPE"
39841 #: ../tools/virt-make-fs.pl:69
39843 "The default filesystem type is C<ext2>. Just about any filesystem type that "
39844 "libguestfs supports can be used (but I<not> read-only formats like "
39845 "ISO9660). Here are some of the more common choices:"
39849 #: ../tools/virt-make-fs.pl:75
39854 #: ../tools/virt-make-fs.pl:77
39856 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
39857 "you are not going to use the filesystem in a way that requires the journal, "
39858 "then this is just wasted overhead."
39862 #: ../tools/virt-make-fs.pl:81
39863 msgid "I<ntfs> or I<vfat>"
39867 #: ../tools/virt-make-fs.pl:83
39868 msgid "Useful if exporting data to a Windows guest."
39872 #: ../tools/virt-make-fs.pl:85
39874 "I<Note for vfat>: The tar archive or local directory must only contain files "
39875 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
39876 "program running within libguestfs is unable to change the ownership of "
39877 "non-root files, since vfat itself does not support this."
39881 #: ../tools/virt-make-fs.pl:90
39886 #: ../tools/virt-make-fs.pl:92
39888 "Lower overhead than C<ext2>, but certain limitations on filename length and "
39889 "total filesystem size."
39893 #: ../tools/virt-make-fs.pl:97 ../tools/virt-make-fs.pl:116 ../tools/virt-make-fs.pl:149
39898 #: ../tools/virt-make-fs.pl:99
39901 " virt-make-fs --type=minix input minixfs.img\n"
39906 #: ../tools/virt-make-fs.pl:101
39907 msgid "TO PARTITION OR NOT TO PARTITION"
39911 #: ../tools/virt-make-fs.pl:103
39912 msgid "Optionally virt-make-fs can add a partition table to the output disk."
39916 #: ../tools/virt-make-fs.pl:105
39918 "Adding a partition can make the disk image more compatible with certain "
39919 "virtualized operating systems which don't expect to see a filesystem "
39920 "directly located on a block device (Linux doesn't care and will happily "
39921 "handle both types)."
39925 #: ../tools/virt-make-fs.pl:110
39927 "On the other hand, if you have a partition table then the output image is no "
39928 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
39929 "directly on a partitioned disk image. (However libguestfs tools such as "
39930 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
39934 #: ../tools/virt-make-fs.pl:118
39935 msgid "Add an MBR partition:"
39939 #: ../tools/virt-make-fs.pl:120
39942 " virt-make-fs --partition -- input disk.img\n"
39947 #: ../tools/virt-make-fs.pl:122
39949 "If the output disk image could be terabyte-sized or larger, it's better to "
39950 "use an EFI/GPT-compatible partition table:"
39954 #: ../tools/virt-make-fs.pl:125
39957 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
39962 #: ../tools/virt-make-fs.pl:127
39963 msgid "EXTRA SPACE"
39967 #: ../tools/virt-make-fs.pl:129
39969 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
39970 "the files that it contains, but might have extra space. Depending on how "
39971 "you are going to use the output, you might think this extra space is wasted "
39972 "and want to minimize it, or you might want to leave space so that more files "
39973 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
39974 "but you can use the I<--size> flag to leave space in the filesystem if you "
39979 #: ../tools/virt-make-fs.pl:137
39981 "An alternative way to leave extra space but not make the output image any "
39982 "bigger is to use an alternative disk image format (instead of the default "
39983 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
39984 "image format (check your hypervisor supports this before using it). This "
39985 "allows you to choose a large I<--size> but the extra space won't actually be "
39986 "allocated in the image until you try to store something in it."
39990 #: ../tools/virt-make-fs.pl:145
39992 "Don't forget that you can also use local commands including L<resize2fs(8)> "
39993 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
39994 "to build another image from scratch."
39998 #: ../tools/virt-make-fs.pl:151
40001 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
40006 #: ../tools/virt-make-fs.pl:179
40007 msgid "Enable debugging information."
40011 #: ../tools/virt-make-fs.pl:185
40012 msgid "B<--size=E<lt>NE<gt>>"
40016 #: ../tools/virt-make-fs.pl:187
40017 msgid "B<--size=+E<lt>NE<gt>>"
40021 #: ../tools/virt-make-fs.pl:189
40022 msgid "B<-s E<lt>NE<gt>>"
40026 #: ../tools/virt-make-fs.pl:191
40027 msgid "B<-s +E<lt>NE<gt>>"
40031 #: ../tools/virt-make-fs.pl:193
40032 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
40036 #: ../tools/virt-make-fs.pl:196
40038 "If this option is I<not> given, then the output image will be just large "
40039 "enough to contain all the files, with not much wasted space."
40043 #: ../tools/virt-make-fs.pl:199
40045 "To choose a fixed size output disk, specify an absolute number followed by "
40046 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
40047 "Petabytes or Exabytes. This must be large enough to contain all the input "
40048 "files, else you will get an error."
40052 #: ../tools/virt-make-fs.pl:204
40054 "To leave extra space, specify C<+> (plus sign) and a number followed by "
40055 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
40056 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
40057 "the input files, and (approximately) an extra 200 MB free space."
40061 #: ../tools/virt-make-fs.pl:210
40063 "Note that virt-make-fs estimates free space, and therefore will not produce "
40064 "filesystems containing precisely the free space requested. (It is much more "
40065 "expensive and time-consuming to produce a filesystem which has precisely the "
40066 "desired free space)."
40070 #: ../tools/virt-make-fs.pl:219
40071 msgid "B<--format=E<lt>fmtE<gt>>"
40075 #: ../tools/virt-make-fs.pl:221
40076 msgid "B<-F E<lt>fmtE<gt>>"
40080 #: ../tools/virt-make-fs.pl:223
40081 msgid "Choose the output disk image format."
40085 #: ../tools/virt-make-fs.pl:225
40086 msgid "The default is C<raw> (raw sparse disk image)."
40090 #: ../tools/virt-make-fs.pl:227
40092 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
40093 "that would really make sense here is C<qcow2>."
40097 #: ../tools/virt-make-fs.pl:234
40098 msgid "B<--type=E<lt>fsE<gt>>"
40102 #: ../tools/virt-make-fs.pl:236
40103 msgid "B<-t E<lt>fsE<gt>>"
40107 #: ../tools/virt-make-fs.pl:238
40108 msgid "Choose the output filesystem type."
40112 #: ../tools/virt-make-fs.pl:240
40113 msgid "The default is C<ext2>."
40117 #: ../tools/virt-make-fs.pl:242
40118 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
40122 #: ../tools/virt-make-fs.pl:249
40123 msgid "B<--partition>"
40127 #: ../tools/virt-make-fs.pl:251
40128 msgid "B<--partition=E<lt>parttypeE<gt>>"
40132 #: ../tools/virt-make-fs.pl:253
40134 "If specified, this flag adds an MBR partition table to the output disk "
40139 #: ../tools/virt-make-fs.pl:256
40141 "You can change the partition table type, eg. I<--partition=gpt> for large "
40146 #: ../tools/virt-make-fs.pl:259
40148 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
40149 "might consider the next parameter to be the partition type. For example:"
40153 #: ../tools/virt-make-fs.pl:263
40156 " virt-make-fs --partition input.tar output.img\n"
40161 #: ../tools/virt-make-fs.pl:265
40163 "would cause virt-make-fs to think you wanted to use a partition type of "
40164 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
40165 "dash) between options and the input and output arguments:"
40169 #: ../tools/virt-make-fs.pl:269
40172 " virt-make-fs --partition -- input.tar output.img\n"
40177 #: ../tools/virt-make-fs.pl:271
40178 msgid "For MBR, virt-make-fs sets the partition type byte automatically."
40182 #: ../tools/virt-make-fs.pl:559
40184 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
40185 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
40186 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
40190 #: ../tools/virt-make-fs.pl:573 ../tools/virt-win-reg.pl:774
40192 "When reporting bugs, please enable debugging and capture the I<complete> "
40197 #: ../tools/virt-make-fs.pl:576
40200 " export LIBGUESTFS_DEBUG=1\n"
40201 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
40206 #: ../tools/virt-make-fs.pl:579
40208 "Attach /tmp/virt-make-fs.log to a new bug report at "
40209 "L<https://bugzilla.redhat.com/>"
40213 #: ../tools/virt-tar.pl:33
40214 msgid "virt-tar - Extract or upload files to a virtual machine"
40218 #: ../tools/virt-tar.pl:37
40221 " virt-tar [--options] -x domname directory tarball\n"
40226 #: ../tools/virt-tar.pl:39
40229 " virt-tar [--options] -u domname tarball directory\n"
40234 #: ../tools/virt-tar.pl:41
40237 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
40242 #: ../tools/virt-tar.pl:43
40245 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
40250 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
40255 #: ../tools/virt-tar.pl:47
40257 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
40258 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
40262 #: ../tools/virt-tar.pl:52
40263 msgid "Download C</home> from the VM into a local tarball:"
40267 #: ../tools/virt-tar.pl:54
40270 " virt-tar -x domname /home home.tar\n"
40275 #: ../tools/virt-tar.pl:56
40278 " virt-tar -zx domname /home home.tar.gz\n"
40283 #: ../tools/virt-tar.pl:58
40284 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
40288 #: ../tools/virt-tar.pl:60
40291 " virt-tar -u domname uploadstuff.tar /tmp\n"
40296 #: ../tools/virt-tar.pl:62
40299 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
40304 #: ../tools/virt-tar.pl:66
40306 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
40307 "virtual machines. If you do this, you risk disk corruption in the VM. "
40308 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
40312 #: ../tools/virt-tar.pl:71
40314 "You can use I<-x> (extract) on live virtual machines, but you might get "
40315 "inconsistent results or errors if there is filesystem activity inside the "
40316 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
40317 "work, but the only way to guarantee consistent results is if the virtual "
40318 "machine is shut down."
40322 #: ../tools/virt-tar.pl:79
40324 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
40325 "parts of a guest filesystem. There are many possibilities: making backups, "
40326 "uploading data files, snooping on guest activity, fixing or customizing "
40331 #: ../tools/virt-tar.pl:84
40333 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
40334 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
40335 "should look at the L<guestfish(1)> tool."
40339 #: ../tools/virt-tar.pl:88
40341 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
40342 "its contents (recursively) from the virtual machine into a local tarball. "
40343 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
40344 "virtual machine. You cannot use these two options together."
40348 #: ../tools/virt-tar.pl:94
40350 "In addition, you may need to use the I<-z> (gZip) option to enable "
40351 "compression. When uploading, you have to specify I<-z> if the upload file "
40352 "is compressed because virt-tar won't detect this on its own."
40356 #: ../tools/virt-tar.pl:98
40358 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
40359 "example it cannot do PKZip files or bzip2 compression. If you want that "
40360 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
40361 "the L<libguestfs(3)> API)."
40365 #: ../tools/virt-tar.pl:160
40366 msgid "B<--extract>"
40370 #: ../tools/virt-tar.pl:162
40371 msgid "B<--download>"
40375 #: ../tools/virt-tar.pl:164
40380 #: ../tools/virt-tar.pl:166
40381 msgid "B<--upload>"
40385 #: ../tools/virt-tar.pl:168
40387 "Use I<-x> to extract (download) a directory from a virtual machine to a "
40392 #: ../tools/virt-tar.pl:171
40394 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
40395 "Please read the L</WARNING> section above before using this option."
40399 #: ../tools/virt-tar.pl:175
40400 msgid "You must specify exactly one of these options."
40404 #: ../tools/virt-tar.pl:181
40409 #: ../tools/virt-tar.pl:183
40414 #: ../tools/virt-tar.pl:185
40415 msgid "Specify that the input or output tarball is gzip-compressed."
40419 #: ../tools/virt-tar.pl:298
40421 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
40422 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
40423 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
40424 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40428 #: ../tools/virt-win-reg.pl:37
40430 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
40435 #: ../tools/virt-win-reg.pl:41
40438 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
40443 #: ../tools/virt-win-reg.pl:43
40446 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
40451 #: ../tools/virt-win-reg.pl:45
40454 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
40459 #: ../tools/virt-win-reg.pl:47
40462 " virt-win-reg --merge domname [input.reg ...]\n"
40467 #: ../tools/virt-win-reg.pl:49
40470 " virt-win-reg [--options] disk.img ... # instead of domname\n"
40475 #: ../tools/virt-win-reg.pl:53
40477 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
40478 "virtual machines. If you do this, you I<will> get irreversible disk "
40479 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
40480 "but doesn't catch all cases."
40484 #: ../tools/virt-win-reg.pl:58
40486 "Modifying the Windows Registry is an inherently risky operation. The format "
40487 "is deliberately obscure and undocumented, and Registry changes can leave the "
40488 "system unbootable. Therefore when using the I<--merge> option, make sure "
40489 "you have a reliable backup first."
40493 #: ../tools/virt-win-reg.pl:65
40495 "This program can export and merge Windows Registry entries from a Windows "
40500 #: ../tools/virt-win-reg.pl:68
40502 "The first parameter is the libvirt guest name or the raw disk image of a "
40507 #: ../tools/virt-win-reg.pl:71
40509 "If I<--merge> is I<not> specified, then the chosen registry key is "
40510 "displayed/exported (recursively). For example:"
40514 #: ../tools/virt-win-reg.pl:74
40517 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
40522 #: ../tools/virt-win-reg.pl:76
40523 msgid "You can also display single values from within registry keys, for example:"
40527 #: ../tools/virt-win-reg.pl:79
40530 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
40531 " $ virt-win-reg Windows7 $cvkey ProductName\n"
40532 " Windows 7 Enterprise\n"
40537 #: ../tools/virt-win-reg.pl:83
40539 "With I<--merge>, you can merge a textual regedit file into the Windows "
40544 #: ../tools/virt-win-reg.pl:86
40547 " $ virt-win-reg --merge Windows7 changes.reg\n"
40552 #: ../tools/virt-win-reg.pl:90
40554 "This program is only meant for simple access to the registry. If you want "
40555 "to do complicated things with the registry, we suggest you download the "
40556 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
40557 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
40558 "L<hivexregedit(1)>."
40562 #: ../tools/virt-win-reg.pl:159
40567 #: ../tools/virt-win-reg.pl:161
40569 "In merge mode, this merges a textual regedit file into the Windows Registry "
40570 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
40571 "displays or exports Registry entries instead."
40575 #: ../tools/virt-win-reg.pl:165
40577 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
40578 "result in disk corruption. However exporting (without this flag) is always "
40583 #: ../tools/virt-win-reg.pl:173
40584 msgid "B<--encoding> UTF-16LE|ASCII"
40588 #: ../tools/virt-win-reg.pl:175
40590 "When merging (only), you may need to specify the encoding for strings to be "
40591 "used in the hive file. This is explained in detail in "
40592 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
40596 #: ../tools/virt-win-reg.pl:179
40598 "The default is to use UTF-16LE, which should work with recent versions of "
40603 #: ../tools/virt-win-reg.pl:186
40604 msgid "B<--unsafe-printable-strings>"
40608 #: ../tools/virt-win-reg.pl:188
40610 "When exporting (only), assume strings are UTF-16LE and print them as strings "
40611 "instead of hex sequences. Remove the final zero codepoint from strings if "
40616 #: ../tools/virt-win-reg.pl:192
40618 "This is unsafe and does not preserve the fidelity of strings in the original "
40619 "Registry for various reasons:"
40623 #: ../tools/virt-win-reg.pl:199
40625 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
40626 "other encodings will be corrupted by this transformation."
40630 #: ../tools/virt-win-reg.pl:204
40632 "Assumes that everything which has type 1 or 2 is really a string and that "
40633 "everything else is not a string, but the type field in real Registries is "
40638 #: ../tools/virt-win-reg.pl:210
40640 "Loses information about whether a zero codepoint followed the string in the "
40645 #: ../tools/virt-win-reg.pl:215
40647 "This all happens because the Registry itself contains no information about "
40648 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
40652 #: ../tools/virt-win-reg.pl:219
40654 "You should only use this option for quick hacking and debugging of the "
40655 "Registry contents, and I<never> use it if the output is going to be passed "
40656 "into another program or stored in another Registry."
40660 #: ../tools/virt-win-reg.pl:556
40661 msgid "SUPPORTED SYSTEMS"
40665 #: ../tools/virt-win-reg.pl:558
40667 "The program currently supports Windows NT-derived guests starting with "
40668 "Windows XP through to at least Windows 7."
40672 #: ../tools/virt-win-reg.pl:561
40673 msgid "The following Registry keys are supported:"
40677 #: ../tools/virt-win-reg.pl:565
40678 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
40682 #: ../tools/virt-win-reg.pl:567
40683 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
40687 #: ../tools/virt-win-reg.pl:569
40688 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
40692 #: ../tools/virt-win-reg.pl:571
40693 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
40697 #: ../tools/virt-win-reg.pl:573
40698 msgid "C<HKEY_USERS\\.DEFAULT>"
40702 #: ../tools/virt-win-reg.pl:575
40703 msgid "C<HKEY_USERS\\I<SID>>"
40707 #: ../tools/virt-win-reg.pl:577
40708 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
40712 #: ../tools/virt-win-reg.pl:579
40713 msgid "C<HKEY_USERS\\I<username>>"
40717 #: ../tools/virt-win-reg.pl:581
40718 msgid "where I<username> is a local user name (this is a libguestfs extension)."
40722 #: ../tools/virt-win-reg.pl:585
40724 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
40729 #: ../tools/virt-win-reg.pl:588
40731 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
40732 "supported (there is no \"current user\")."
40736 #: ../tools/virt-win-reg.pl:591
40741 #: ../tools/virt-win-reg.pl:593
40743 "C<virt-win-reg> expects that regedit files have already been reencoded in "
40744 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
40745 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
40746 "with Windows-style line endings, you may need to reencode the whole file "
40747 "before or after processing."
40751 #: ../tools/virt-win-reg.pl:599
40753 "To reencode a file from Windows format to Linux (before processing it with "
40754 "the I<--merge> option), you would do something like this:"
40758 #: ../tools/virt-win-reg.pl:602
40761 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
40766 #: ../tools/virt-win-reg.pl:604
40768 "To go in the opposite direction, after exporting and before sending the file "
40769 "to a Windows user, do something like this:"
40773 #: ../tools/virt-win-reg.pl:607
40776 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
40781 #: ../tools/virt-win-reg.pl:609
40782 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
40786 #: ../tools/virt-win-reg.pl:611
40788 "If you are unsure about the current encoding, use the L<file(1)> command. "
40789 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
40790 "Windows-style (CRLF) line endings, like this:"
40794 #: ../tools/virt-win-reg.pl:615
40797 " $ file software.reg\n"
40798 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
40799 " with CRLF line terminators\n"
40804 #: ../tools/virt-win-reg.pl:619
40805 msgid "This file would need conversion before you could I<--merge> it."
40809 #: ../tools/virt-win-reg.pl:621
40810 msgid "CurrentControlSet etc."
40814 #: ../tools/virt-win-reg.pl:623
40816 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
40817 "Registry at the level of the hive file, and therefore you cannot modify "
40822 #: ../tools/virt-win-reg.pl:627
40824 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
40825 "circumstances it might refer to another control set. The way to find out is "
40826 "to look at the C<HKLM\\SYSTEM\\Select> key:"
40830 #: ../tools/virt-win-reg.pl:631
40833 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
40834 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
40835 " \"Current\"=dword:00000001\n"
40836 " \"Default\"=dword:00000001\n"
40837 " \"Failed\"=dword:00000000\n"
40838 " \"LastKnownGood\"=dword:00000002\n"
40843 #: ../tools/virt-win-reg.pl:638
40844 msgid "\"Current\" is the one which Windows will choose when it boots."
40848 #: ../tools/virt-win-reg.pl:640
40849 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
40853 #: ../tools/virt-win-reg.pl:643
40854 msgid "DELETING REGISTRY KEYS AND VALUES"
40858 #: ../tools/virt-win-reg.pl:645
40859 msgid "To delete a whole registry key, use the syntax:"
40863 #: ../tools/virt-win-reg.pl:647
40866 " [-HKEY_LOCAL_MACHINE\\Foo]\n"
40871 #: ../tools/virt-win-reg.pl:649
40872 msgid "To delete a single value within a key, use the syntax:"
40876 #: ../tools/virt-win-reg.pl:651
40879 " [HKEY_LOCAL_MACHINE\\Foo]\n"
40885 #: ../tools/virt-win-reg.pl:654
40886 msgid "WINDOWS TIPS"
40890 #: ../tools/virt-win-reg.pl:656
40892 "Note that some of these tips modify the guest disk image. The guest I<must> "
40893 "be shut off, else you will get disk corruption."
40897 #: ../tools/virt-win-reg.pl:659
40898 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
40902 #: ../tools/virt-win-reg.pl:661
40904 "Prepare a DOS batch script, VBScript or executable. Upload this using "
40905 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
40906 "is uploaded into C<C:\\>:"
40910 #: ../tools/virt-win-reg.pl:665
40913 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
40918 #: ../tools/virt-win-reg.pl:667
40919 msgid "Prepare a regedit file containing the registry change:"
40923 #: ../tools/virt-win-reg.pl:669
40926 " cat > test.reg <<'EOF'\n"
40927 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
40928 " \"Test\"=\"c:\\\\test.bat\"\n"
40934 #: ../tools/virt-win-reg.pl:674
40936 "In this example we use the key C<RunOnce> which means that the script will "
40937 "run precisely once when the first user logs in. If you want it to run every "
40938 "time a user logs in, replace C<RunOnce> with C<Run>."
40942 #: ../tools/virt-win-reg.pl:678
40943 msgid "Now update the registry:"
40947 #: ../tools/virt-win-reg.pl:680
40950 " virt-win-reg --merge WindowsGuest test.reg\n"
40955 #: ../tools/virt-win-reg.pl:682
40956 msgid "INSTALLING A SERVICE"
40960 #: ../tools/virt-win-reg.pl:684
40962 "This section assumes you are familiar with Windows services, and you either "
40963 "have a program which handles the Windows Service Control Protocol directly "
40964 "or you want to run any program using a service wrapper like SrvAny or the "
40969 #: ../tools/virt-win-reg.pl:689
40971 "First upload the program and optionally the service wrapper. In this case "
40972 "the test program is called C<test.exe> and we are using the RHSrvAny "
40977 #: ../tools/virt-win-reg.pl:693
40980 " guestfish -i -d WindowsGuest <<EOF\n"
40981 " upload rhsrvany.exe /rhsrvany.exe\n"
40982 " upload test.exe /test.exe\n"
40988 #: ../tools/virt-win-reg.pl:698
40990 "Prepare a regedit file containing the registry changes. In this example, "
40991 "the first registry change is needed for the service itself or the service "
40992 "wrapper (if used). The second registry change is only needed because I am "
40993 "using the RHSrvAny service wrapper."
40997 #: ../tools/virt-win-reg.pl:703
41000 " cat > service.reg <<'EOF'\n"
41001 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
41002 " \"Type\"=dword:00000010\n"
41003 " \"Start\"=dword:00000002\n"
41004 " \"ErrorControl\"=dword:00000001\n"
41005 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
41006 " \"DisplayName\"=\"RHSrvAny\"\n"
41007 " \"ObjectName\"=\"NetworkService\"\n"
41012 #: ../tools/virt-win-reg.pl:712
41015 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
41016 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
41017 " \"PWD\"=\"c:\\\\Temp\"\n"
41023 #: ../tools/virt-win-reg.pl:723
41025 "For use of C<ControlSet001> see the section above in this manual page. You "
41026 "may need to adjust this according to the control set that is in use by the "
41031 #: ../tools/virt-win-reg.pl:729
41033 "C<\"ObjectName\"> controls the privileges that the service will have. An "
41034 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
41035 "privileged account."
41039 #: ../tools/virt-win-reg.pl:735
41041 "For the meaning of the magic numbers, see this Microsoft KB article: "
41042 "L<http://support.microsoft.com/kb/103000>."
41046 #: ../tools/virt-win-reg.pl:740
41047 msgid "Update the registry:"
41051 #: ../tools/virt-win-reg.pl:742
41054 " virt-win-reg --merge WindowsGuest service.reg\n"
41059 #: ../tools/virt-win-reg.pl:746
41061 "Be careful when passing parameters containing C<\\> (backslash) in the "
41062 "shell. Usually you will have to use 'single quotes' or double backslashes "
41063 "(but not both) to protect them from the shell."
41067 #: ../tools/virt-win-reg.pl:750
41068 msgid "Paths and value names are case-insensitive."
41072 #: ../tools/virt-win-reg.pl:759
41074 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
41075 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
41076 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
41077 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
41081 #: ../tools/virt-win-reg.pl:777
41084 " export LIBGUESTFS_DEBUG=1\n"
41085 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
41090 #: ../tools/virt-win-reg.pl:780
41092 "Attach /tmp/virt-win-reg.log to a new bug report at "
41093 "L<https://bugzilla.redhat.com/>"