1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: libguestfs 1.15.6\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-11-24 20:18+0000\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
21 #: ../align/virt-alignment-scan.pod:3 ../cat/virt-cat.pod:3 ../cat/virt-filesystems.pod:3 ../cat/virt-ls.pod:3 ../clone/virt-sysprep.pod:3 ../df/virt-df.pod:3 ../edit/virt-edit.pod:3 ../erlang/examples/guestfs-erlang.pod:3 ../examples/guestfs-examples.pod:3 ../examples/guestfs-recipes.pod:14 ../examples/guestfs-testing.pod:3 ../fish/guestfish.pod:3 ../fish/virt-copy-in.pod:3 ../fish/virt-copy-out.pod:3 ../fish/virt-tar-in.pod:3 ../fish/virt-tar-out.pod:3 ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pod:3 ../java/examples/guestfs-java.pod:3 ../ocaml/examples/guestfs-ocaml.pod:3 ../perl/examples/guestfs-perl.pod:3 ../python/examples/guestfs-python.pod:3 ../rescue/virt-rescue.pod:3 ../resize/virt-resize.pod:3 ../ruby/examples/guestfs-ruby.pod:3 ../sparsify/virt-sparsify.pod:3 ../src/guestfs.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30 ../tools/virt-make-fs.pl:35 ../tools/virt-tar.pl:31 ../tools/virt-win-reg.pl:35
26 #: ../align/virt-alignment-scan.pod:5
27 msgid "virt-alignment-scan - Check alignment of virtual machine partitions"
31 #: ../align/virt-alignment-scan.pod:7 ../cat/virt-cat.pod:7 ../cat/virt-filesystems.pod:7 ../cat/virt-ls.pod:7 ../clone/virt-sysprep.pod:7 ../df/virt-df.pod:7 ../edit/virt-edit.pod:7 ../erlang/examples/guestfs-erlang.pod:7 ../examples/guestfs-examples.pod:7 ../fish/guestfish.pod:7 ../fish/virt-copy-in.pod:7 ../fish/virt-copy-out.pod:7 ../fish/virt-tar-in.pod:7 ../fish/virt-tar-out.pod:7 ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pod:7 ../java/examples/guestfs-java.pod:7 ../ocaml/examples/guestfs-ocaml.pod:7 ../perl/examples/guestfs-perl.pod:7 ../python/examples/guestfs-python.pod:7 ../rescue/virt-rescue.pod:7 ../resize/virt-resize.pod:7 ../ruby/examples/guestfs-ruby.pod:7 ../sparsify/virt-sparsify.pod:7 ../src/guestfs.pod:7 ../test-tool/libguestfs-test-tool.pod:7 ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34 ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35 ../tools/virt-win-reg.pl:39
36 #: ../align/virt-alignment-scan.pod:9
39 " virt-alignment-scan [--options] -d domname\n"
44 #: ../align/virt-alignment-scan.pod:11
47 " virt-alignment-scan [--options] -a disk.img [-a disk.img ...]\n"
52 #: ../align/virt-alignment-scan.pod:13 ../cat/virt-cat.pod:19 ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19 ../clone/virt-sysprep.pod:13 ../df/virt-df.pod:21 ../edit/virt-edit.pod:27 ../erlang/examples/guestfs-erlang.pod:16 ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18 ../examples/guestfs-testing.pod:7 ../fish/guestfish.pod:30 ../fish/virt-copy-in.pod:19 ../fish/virt-copy-out.pod:13 ../fish/virt-tar-in.pod:21 ../fish/virt-tar-out.pod:15 ../fuse/guestmount.pod:20 ../inspector/virt-inspector.pod:19 ../java/examples/guestfs-java.pod:15 ../ocaml/examples/guestfs-ocaml.pod:25 ../perl/examples/guestfs-perl.pod:18 ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:31 ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15 ../sparsify/virt-sparsify.pod:11 ../src/guestfs.pod:23 ../test-tool/libguestfs-test-tool.pod:11 ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40 ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77 ../tools/virt-win-reg.pl:63
57 #: ../align/virt-alignment-scan.pod:15
59 "When older operating systems install themselves, the partitioning tools "
60 "place partitions at a sector misaligned with the underlying storage "
61 "(commonly the first partition starts on sector C<63>). Misaligned "
62 "partitions can result in an operating system issuing more I/O than should be "
67 #: ../align/virt-alignment-scan.pod:21
69 "The virt-alignment-scan tool checks the alignment of partitions in virtual "
70 "machines and disk images and warns you if there are alignment problems."
74 #: ../align/virt-alignment-scan.pod:25
76 "Currently there is no virt tool for fixing alignment problems. You can only "
77 "reinstall the guest operating system. The following NetApp document "
78 "summarises the problem and possible solutions: "
79 "L<http://media.netapp.com/documents/tr-3747.pdf>"
83 #: ../align/virt-alignment-scan.pod:30
88 #: ../align/virt-alignment-scan.pod:32
89 msgid "To run this tool on a disk image directly, use the I<-a> option:"
93 #: ../align/virt-alignment-scan.pod:34
96 " $ virt-alignment-scan -a winxp.img\n"
97 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
102 #: ../align/virt-alignment-scan.pod:37
105 " $ virt-alignment-scan -a fedora16.img\n"
106 " /dev/sda1 1048576 1024K ok\n"
107 " /dev/sda2 2097152 2048K ok\n"
108 " /dev/sda3 526385152 2048K ok\n"
113 #: ../align/virt-alignment-scan.pod:42
115 "To run the tool on a guest known to libvirt, use the I<-d> option and "
116 "possibly the I<-c> option:"
120 #: ../align/virt-alignment-scan.pod:45
123 " # virt-alignment-scan -d RHEL5\n"
124 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
125 " /dev/sda2 106928640 512 bad (alignment < 4K)\n"
130 #: ../align/virt-alignment-scan.pod:49
133 " $ virt-alignment-scan -c qemu:///system -d Win7TwoDisks\n"
134 " /dev/sda1 1048576 1024K ok\n"
135 " /dev/sda2 105906176 1024K ok\n"
136 " /dev/sdb1 65536 64K ok\n"
141 #: ../align/virt-alignment-scan.pod:54
143 "The output consists of 4 or more whitespace-separated columns. Only the "
144 "first 4 columns are signficant if you want to parse this from a program. "
149 #: ../align/virt-alignment-scan.pod:60
154 #: ../align/virt-alignment-scan.pod:62
156 "the device and partition name (eg. C</dev/sda1> meaning the first partition "
157 "on the first block device)"
161 #: ../align/virt-alignment-scan.pod:65
166 #: ../align/virt-alignment-scan.pod:67
167 msgid "the start of the partition in bytes"
171 #: ../align/virt-alignment-scan.pod:69
176 #: ../align/virt-alignment-scan.pod:71
177 msgid "the alignment in bytes or Kbytes (eg. C<512> or C<4K>)"
181 #: ../align/virt-alignment-scan.pod:73
186 #: ../align/virt-alignment-scan.pod:75
188 "C<ok> if the alignment is best for performance, or C<bad> if the alignment "
189 "can cause performance problems"
193 #: ../align/virt-alignment-scan.pod:78
198 #: ../align/virt-alignment-scan.pod:80
199 msgid "optional free-text explanation."
203 #: ../align/virt-alignment-scan.pod:84
205 "The exit code from the program changes depending on whether poorly aligned "
206 "partitions were found. See L</EXIT STATUS> below."
210 #: ../align/virt-alignment-scan.pod:87
211 msgid "If you just want the exit code with no output, use the I<-q> option."
215 #: ../align/virt-alignment-scan.pod:89 ../cat/virt-cat.pod:62 ../cat/virt-filesystems.pod:91 ../cat/virt-ls.pod:261 ../clone/virt-sysprep.pod:42 ../df/virt-df.pod:59 ../edit/virt-edit.pod:62 ../fish/guestfish.pod:148 ../fish/virt-copy-in.pod:45 ../fish/virt-copy-out.pod:34 ../fish/virt-tar-in.pod:42 ../fish/virt-tar-out.pod:36 ../fuse/guestmount.pod:92 ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:112 ../resize/virt-resize.pod:262 ../sparsify/virt-sparsify.pod:99 ../test-tool/libguestfs-test-tool.pod:36 ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54 ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103 ../tools/virt-win-reg.pl:96
220 #: ../align/virt-alignment-scan.pod:93 ../cat/virt-cat.pod:66 ../cat/virt-filesystems.pod:95 ../cat/virt-ls.pod:265 ../clone/virt-sysprep.pod:46 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66 ../fish/guestfish.pod:152 ../fuse/guestmount.pod:160 ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:116 ../resize/virt-resize.pod:266 ../sparsify/virt-sparsify.pod:103 ../test-tool/libguestfs-test-tool.pod:40 ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62 ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111 ../tools/virt-win-reg.pl:104
225 #: ../align/virt-alignment-scan.pod:95 ../cat/virt-cat.pod:68 ../cat/virt-filesystems.pod:97 ../cat/virt-ls.pod:267 ../clone/virt-sysprep.pod:48 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68 ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod:118 ../tools/virt-list-filesystems.pl:63 ../tools/virt-list-partitions.pl:64 ../tools/virt-make-fs.pl:163 ../tools/virt-tar.pl:113 ../tools/virt-win-reg.pl:106
226 msgid "Display brief help."
230 #: ../align/virt-alignment-scan.pod:97 ../cat/virt-cat.pod:70 ../cat/virt-filesystems.pod:99 ../cat/virt-ls.pod:269 ../clone/virt-sysprep.pod:50 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70 ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:120
235 #: ../align/virt-alignment-scan.pod:99 ../cat/virt-cat.pod:72 ../cat/virt-filesystems.pod:101 ../cat/virt-ls.pod:271 ../clone/virt-sysprep.pod:52 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72 ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:122
236 msgid "B<--add> file"
240 #: ../align/virt-alignment-scan.pod:101 ../clone/virt-sysprep.pod:54
241 msgid "Add I<file> which should be a disk image from a virtual machine."
245 #: ../align/virt-alignment-scan.pod:103 ../cat/virt-cat.pod:78 ../cat/virt-filesystems.pod:107 ../cat/virt-ls.pod:277 ../clone/virt-sysprep.pod:56 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78 ../fish/guestfish.pod:174 ../fuse/guestmount.pod:102 ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:128
247 "The format of the disk image is auto-detected. To override this and force a "
248 "particular format use the I<--format=..> option."
252 #: ../align/virt-alignment-scan.pod:106 ../cat/virt-cat.pod:81 ../cat/virt-filesystems.pod:125 ../cat/virt-ls.pod:291 ../clone/virt-sysprep.pod:59 ../df/virt-df.pod:78 ../rescue/virt-rescue.pod:135
257 #: ../align/virt-alignment-scan.pod:108 ../cat/virt-cat.pod:83 ../cat/virt-filesystems.pod:127 ../cat/virt-ls.pod:293 ../clone/virt-sysprep.pod:61 ../df/virt-df.pod:80 ../rescue/virt-rescue.pod:137
258 msgid "B<--connect> URI"
262 #: ../align/virt-alignment-scan.pod:110 ../cat/virt-cat.pod:85 ../cat/virt-filesystems.pod:129 ../cat/virt-ls.pod:295 ../clone/virt-sysprep.pod:63 ../df/virt-df.pod:82 ../edit/virt-edit.pod:99 ../inspector/virt-inspector.pod:78 ../rescue/virt-rescue.pod:139 ../tools/virt-list-filesystems.pl:81 ../tools/virt-list-partitions.pl:82 ../tools/virt-tar.pl:131 ../tools/virt-win-reg.pl:132
264 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
265 "to the default libvirt hypervisor."
269 #: ../align/virt-alignment-scan.pod:113 ../cat/virt-cat.pod:88 ../cat/virt-filesystems.pod:132 ../cat/virt-ls.pod:298 ../clone/virt-sysprep.pod:66 ../df/virt-df.pod:85 ../rescue/virt-rescue.pod:142
271 "If you specify guest block devices directly (I<-a>), then libvirt is not "
276 #: ../align/virt-alignment-scan.pod:116 ../cat/virt-cat.pod:91 ../cat/virt-filesystems.pod:141 ../cat/virt-ls.pod:307 ../clone/virt-sysprep.pod:69 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105 ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:145
281 #: ../align/virt-alignment-scan.pod:118 ../cat/virt-cat.pod:93 ../cat/virt-filesystems.pod:143 ../cat/virt-ls.pod:309 ../clone/virt-sysprep.pod:71 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107 ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:147
282 msgid "B<--domain> guest"
286 #: ../align/virt-alignment-scan.pod:120 ../cat/virt-cat.pod:95 ../cat/virt-filesystems.pod:145 ../cat/virt-ls.pod:311 ../clone/virt-sysprep.pod:73 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109 ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:149
288 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
293 #: ../align/virt-alignment-scan.pod:123 ../cat/virt-cat.pod:105 ../cat/virt-filesystems.pod:170 ../cat/virt-ls.pod:328 ../clone/virt-sysprep.pod:95 ../df/virt-df.pod:101 ../fish/guestfish.pod:233 ../fuse/guestmount.pod:142 ../inspector/virt-inspector.pod:99 ../rescue/virt-rescue.pod:152
294 msgid "B<--format=raw|qcow2|..>"
298 #: ../align/virt-alignment-scan.pod:125 ../cat/virt-cat.pod:107 ../cat/virt-filesystems.pod:172 ../cat/virt-ls.pod:330 ../clone/virt-sysprep.pod:97 ../df/virt-df.pod:103 ../edit/virt-edit.pod:134 ../fish/guestfish.pod:235 ../fuse/guestmount.pod:144 ../inspector/virt-inspector.pod:101 ../rescue/virt-rescue.pod:154
303 #: ../align/virt-alignment-scan.pod:127 ../cat/virt-cat.pod:109 ../cat/virt-filesystems.pod:174 ../cat/virt-ls.pod:332 ../clone/virt-sysprep.pod:99 ../df/virt-df.pod:105 ../edit/virt-edit.pod:136 ../fish/guestfish.pod:237 ../fuse/guestmount.pod:146 ../rescue/virt-rescue.pod:156
305 "The default for the I<-a> option is to auto-detect the format of the disk "
306 "image. Using this forces the disk format for I<-a> options which follow on "
307 "the command line. Using I<--format> with no argument switches back to "
308 "auto-detection for subsequent I<-a> options."
312 #: ../align/virt-alignment-scan.pod:132 ../cat/virt-cat.pod:114 ../cat/virt-filesystems.pod:179 ../cat/virt-ls.pod:337 ../clone/virt-sysprep.pod:104 ../df/virt-df.pod:110 ../edit/virt-edit.pod:141 ../fish/guestfish.pod:242 ../fish/guestfish.pod:673 ../inspector/virt-inspector.pod:351 ../rescue/virt-rescue.pod:161 ../src/guestfs.pod: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:165
326 msgid "forces raw format (no auto-detection) for C<disk.img>."
330 #: ../align/virt-alignment-scan.pod:138
333 " virt-alignment-scan --format=raw -a disk.img --format -a another.img\n"
338 #: ../align/virt-alignment-scan.pod:140 ../cat/virt-cat.pod:122 ../cat/virt-filesystems.pod:187 ../cat/virt-ls.pod:345 ../clone/virt-sysprep.pod:112 ../df/virt-df.pod:118 ../edit/virt-edit.pod:149 ../fish/guestfish.pod:250 ../rescue/virt-rescue.pod:169
340 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
341 "auto-detection for C<another.img>."
345 #: ../align/virt-alignment-scan.pod:143 ../cat/virt-cat.pod:125 ../cat/virt-filesystems.pod:190 ../cat/virt-ls.pod:348 ../clone/virt-sysprep.pod:115 ../df/virt-df.pod:121 ../edit/virt-edit.pod:152 ../rescue/virt-rescue.pod:172
347 "If you have untrusted raw-format guest disk images, you should use this "
348 "option to specify the disk format. This avoids a possible security problem "
349 "with malicious guests (CVE-2010-3851)."
353 #: ../align/virt-alignment-scan.pod:147 ../resize/virt-resize.pod:491 ../sparsify/virt-sparsify.pod:171
358 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:493 ../sparsify/virt-sparsify.pod:173
363 #: ../align/virt-alignment-scan.pod:151
365 "Don't produce any output. Just set the exit code (see L</EXIT STATUS> "
370 #: ../align/virt-alignment-scan.pod:154 ../cat/virt-cat.pod:134 ../cat/virt-filesystems.pod:261 ../cat/virt-ls.pod:425 ../clone/virt-sysprep.pod:138 ../df/virt-df.pod:173 ../edit/virt-edit.pod:161 ../fish/guestfish.pod:390 ../fuse/guestmount.pod:266 ../inspector/virt-inspector.pod:119 ../rescue/virt-rescue.pod:219 ../sparsify/virt-sparsify.pod:177
375 #: ../align/virt-alignment-scan.pod:156 ../cat/virt-cat.pod:136 ../cat/virt-filesystems.pod:263 ../cat/virt-ls.pod:427 ../clone/virt-sysprep.pod:140 ../df/virt-df.pod:175 ../edit/virt-edit.pod:163 ../fish/guestfish.pod:392 ../fuse/guestmount.pod:268 ../inspector/virt-inspector.pod:121 ../rescue/virt-rescue.pod:221 ../sparsify/virt-sparsify.pod:179
380 #: ../align/virt-alignment-scan.pod:158 ../cat/virt-cat.pod:138 ../cat/virt-filesystems.pod:265 ../cat/virt-ls.pod:429 ../clone/virt-sysprep.pod:142 ../df/virt-df.pod:177 ../edit/virt-edit.pod:165 ../inspector/virt-inspector.pod:123 ../rescue/virt-rescue.pod:223 ../sparsify/virt-sparsify.pod:181
381 msgid "Enable verbose messages for debugging."
385 #: ../align/virt-alignment-scan.pod:160 ../cat/virt-cat.pod:140 ../cat/virt-filesystems.pod:267 ../cat/virt-ls.pod:431 ../clone/virt-sysprep.pod:144 ../df/virt-df.pod:179 ../edit/virt-edit.pod:167 ../fish/guestfish.pod:397 ../fuse/guestmount.pod:272 ../inspector/virt-inspector.pod:125 ../rescue/virt-rescue.pod:225 ../resize/virt-resize.pod:561 ../sparsify/virt-sparsify.pod:183
390 #: ../align/virt-alignment-scan.pod:162 ../cat/virt-cat.pod:142 ../cat/virt-filesystems.pod:269 ../cat/virt-ls.pod:433 ../clone/virt-sysprep.pod:146 ../df/virt-df.pod:181 ../edit/virt-edit.pod:169 ../fish/guestfish.pod:399 ../fuse/guestmount.pod:274 ../inspector/virt-inspector.pod:127 ../rescue/virt-rescue.pod:227 ../resize/virt-resize.pod:563 ../sparsify/virt-sparsify.pod:185 ../tools/virt-list-filesystems.pl:69 ../tools/virt-list-partitions.pl:70 ../tools/virt-make-fs.pl:169 ../tools/virt-tar.pl:119 ../tools/virt-win-reg.pl:112
395 #: ../align/virt-alignment-scan.pod:164 ../cat/virt-cat.pod:144 ../cat/virt-filesystems.pod:271 ../cat/virt-ls.pod:435 ../clone/virt-sysprep.pod:148 ../df/virt-df.pod:183 ../edit/virt-edit.pod:171 ../inspector/virt-inspector.pod:129 ../rescue/virt-rescue.pod:229 ../resize/virt-resize.pod:565 ../sparsify/virt-sparsify.pod:187 ../tools/virt-list-filesystems.pl:71 ../tools/virt-list-partitions.pl:72 ../tools/virt-make-fs.pl:171 ../tools/virt-tar.pl:121 ../tools/virt-win-reg.pl:114
396 msgid "Display version number and exit."
400 #: ../align/virt-alignment-scan.pod:166 ../cat/virt-cat.pod:146 ../cat/virt-filesystems.pod:281 ../cat/virt-ls.pod:437 ../clone/virt-sysprep.pod:150 ../df/virt-df.pod:185 ../edit/virt-edit.pod:173 ../fish/guestfish.pod:412 ../fuse/guestmount.pod:287 ../inspector/virt-inspector.pod:131 ../rescue/virt-rescue.pod:240 ../sparsify/virt-sparsify.pod:189 ../tools/virt-tar.pl:158
405 #: ../align/virt-alignment-scan.pod:168 ../cat/virt-cat.pod:148 ../cat/virt-filesystems.pod:283 ../cat/virt-ls.pod:439 ../clone/virt-sysprep.pod:152 ../df/virt-df.pod:187 ../edit/virt-edit.pod:175 ../inspector/virt-inspector.pod:133 ../rescue/virt-rescue.pod:242 ../sparsify/virt-sparsify.pod:191
406 msgid "Enable tracing of libguestfs API calls."
410 #: ../align/virt-alignment-scan.pod:172
411 msgid "RECOMMENDED ALIGNMENT"
415 #: ../align/virt-alignment-scan.pod:174
417 "Operating systems older than Windows 2008 and Linux before ca.2010 place the "
418 "first sector of the first partition at sector 63, with a 512 byte sector "
419 "size. This happens because of a historical accident. Drives have to report "
420 "a cylinder / head / sector (CHS) geometry to the BIOS. The geometry is "
421 "completely meaningless on modern drives, but it happens that the geometry "
422 "reported always has 63 sectors per track. The operating system therefore "
423 "places the first partition at the start of the second \"track\", at sector "
428 #: ../align/virt-alignment-scan.pod:183
430 "When the guest OS is virtualized, the host operating system and hypervisor "
431 "may prefer accesses aligned to one of:"
435 #: ../align/virt-alignment-scan.pod:188
440 #: ../align/virt-alignment-scan.pod:190
442 "if the host OS uses local storage directly on hard drive partitions, and the "
443 "hard drive has 512 byte physical sectors."
447 #: ../align/virt-alignment-scan.pod:193
452 #: ../align/virt-alignment-scan.pod:195
454 "for local storage on new hard drives with 4Kbyte physical sectors; for "
455 "file-backed storage on filesystems with 4Kbyte block size; or for some types "
456 "of network-attached storage."
460 #: ../align/virt-alignment-scan.pod:199
465 #: ../align/virt-alignment-scan.pod:201
467 "for high-end network-attached storage. This is the optimal block size for "
468 "some NetApp hardware."
472 #: ../align/virt-alignment-scan.pod:204
477 #: ../align/virt-alignment-scan.pod:206
478 msgid "see L</1 MB PARTITION ALIGNMENT> below."
482 #: ../align/virt-alignment-scan.pod:210
484 "Partitions which are not aligned correctly to the underlying storage cause "
485 "extra I/O. For example:"
489 #: ../align/virt-alignment-scan.pod:213
493 " +--------------------------+------\n"
495 " | filesystem block |\n"
496 " ---+------------------+------+-------------------+-----+---\n"
497 " | host block | host block |\n"
499 " ---+-------------------------+-------------------------+---\n"
504 #: ../align/virt-alignment-scan.pod:222
506 "In this example, each time a 4K guest block is read, two blocks on the host "
507 "must be accessed (so twice as much I/O is done). When a 4K guest block is "
508 "written, two host blocks must first be read, the old and new data combined, "
509 "and the two blocks written back (4x I/O)."
513 #: ../align/virt-alignment-scan.pod:227
514 msgid "LINUX HOST BLOCK AND I/O SIZE"
518 #: ../align/virt-alignment-scan.pod:229
520 "New versions of the Linux kernel expose the physical and logical block size, "
521 "and minimum and recommended I/O size."
525 #: ../align/virt-alignment-scan.pod:232
526 msgid "For a typical consumer hard drive with 512 byte sectors:"
530 #: ../align/virt-alignment-scan.pod:234
533 " $ cat /sys/block/sda/queue/hw_sector_size\n"
535 " $ cat /sys/block/sda/queue/physical_block_size\n"
537 " $ cat /sys/block/sda/queue/logical_block_size\n"
539 " $ cat /sys/block/sda/queue/minimum_io_size\n"
541 " $ cat /sys/block/sda/queue/optimal_io_size\n"
547 #: ../align/virt-alignment-scan.pod:245
548 msgid "For a new consumer hard drive with 4Kbyte sectors:"
552 #: ../align/virt-alignment-scan.pod:247
555 " $ cat /sys/block/sda/queue/hw_sector_size\n"
557 " $ cat /sys/block/sda/queue/physical_block_size\n"
559 " $ cat /sys/block/sda/queue/logical_block_size\n"
561 " $ cat /sys/block/sda/queue/minimum_io_size\n"
563 " $ cat /sys/block/sda/queue/optimal_io_size\n"
569 #: ../align/virt-alignment-scan.pod:258
570 msgid "For a NetApp LUN:"
574 #: ../align/virt-alignment-scan.pod:260
577 " $ cat /sys/block/sdc/queue/logical_block_size\n"
579 " $ cat /sys/block/sdc/queue/physical_block_size\n"
581 " $ cat /sys/block/sdc/queue/minimum_io_size\n"
583 " $ cat /sys/block/sdc/queue/optimal_io_size\n"
589 #: ../align/virt-alignment-scan.pod:269
591 "The NetApp allows 512 byte accesses (but they will be very inefficient), "
592 "prefers a minimum 4K I/O size, but the optimal I/O size is 64K."
596 #: ../align/virt-alignment-scan.pod:273
598 "For detailed information about what these numbers mean, see "
599 "L<http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/newstorage-iolimits.html>"
603 #: ../align/virt-alignment-scan.pod:276
605 "[Thanks to Matt Booth for providing 4K drive data. Thanks to Mike Snitzer "
606 "for providing NetApp data and additional information.]"
610 #: ../align/virt-alignment-scan.pod:279
611 msgid "1 MB PARTITION ALIGNMENT"
615 #: ../align/virt-alignment-scan.pod:281
617 "Microsoft picked 1 MB as the default alignment for all partitions starting "
618 "with Windows 2008 Server, and Linux has followed this."
622 #: ../align/virt-alignment-scan.pod:284
624 "Assuming 512 byte sectors in the guest, you will now see the first partition "
625 "starting at sector 2048, and subsequent partitions (if any) will start at a "
626 "multiple of 2048 sectors."
630 #: ../align/virt-alignment-scan.pod:288
632 "1 MB alignment is compatible with all current alignment requirements (4K, "
633 "64K) and provides room for future growth in physical block sizes."
637 #: ../align/virt-alignment-scan.pod:291
638 msgid "SETTING ALIGNMENT"
642 #: ../align/virt-alignment-scan.pod:293
644 "L<virt-resize(1)> can change the alignment of the partitions of some "
645 "guests. Currently it can fully align all the partitions of all Windows "
646 "guests, and it will fix the bootloader where necessary. For Linux guests, "
647 "it can align the second and subsequent partitions, so the majority of OS "
648 "accesses except at boot will be aligned."
652 #: ../align/virt-alignment-scan.pod:299
654 "Another way to correct partition alignment problems is to reinstall your "
655 "guest operating systems. If you install operating systems from templates, "
656 "ensure these have correct partition alignment too."
660 #: ../align/virt-alignment-scan.pod:303
662 "For older versions of Windows, the following NetApp document contains useful "
663 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
667 #: ../align/virt-alignment-scan.pod:306
669 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
670 "an explicit C<%pre> section that creates aligned partitions using "
671 "L<parted(8)>. Do not use the Kickstart C<part> command. The NetApp "
672 "document above contains an example."
676 #: ../align/virt-alignment-scan.pod:311 ../cat/virt-cat.pod:231 ../cat/virt-filesystems.pod:373 ../cat/virt-ls.pod:483 ../clone/virt-sysprep.pod:475 ../df/virt-df.pod:241 ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:367 ../rescue/virt-rescue.pod:303 ../resize/virt-resize.pod: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:243 ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:369 ../rescue/virt-rescue.pod:305 ../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:248 ../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:245 ../test-tool/libguestfs-test-tool.pod:90
695 #: ../align/virt-alignment-scan.pod:320
696 msgid "This program returns:"
700 #: ../align/virt-alignment-scan.pod:324 ../align/virt-alignment-scan.pod:330 ../align/virt-alignment-scan.pod:336 ../align/virt-alignment-scan.pod:343 ../cat/virt-cat.pod:177 ../cat/virt-cat.pod:182 ../cat/virt-cat.pod:187 ../cat/virt-cat.pod:198 ../cat/virt-cat.pod:202 ../clone/virt-sysprep.pod:283 ../clone/virt-sysprep.pod:287 ../clone/virt-sysprep.pod:291 ../clone/virt-sysprep.pod:295 ../clone/virt-sysprep.pod:310 ../clone/virt-sysprep.pod:314 ../clone/virt-sysprep.pod:318 ../clone/virt-sysprep.pod:322 ../clone/virt-sysprep.pod:326 ../clone/virt-sysprep.pod:362 ../clone/virt-sysprep.pod:384 ../clone/virt-sysprep.pod:388 ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266 ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276 ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291 ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102 ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132 ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227 ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235 ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243 ../examples/guestfs-testing.pod:110 ../examples/guestfs-testing.pod:114 ../examples/guestfs-testing.pod:118 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:441 ../fish/guestfish-actions.pod:449 ../fish/guestfish-actions.pod:456 ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod: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:3067 ../src/guestfs.pod:3072 ../src/guestfs.pod:3076 ../src/guestfs.pod:3080 ../src/guestfs.pod:3084 ../src/guestfs.pod:3098 ../src/guestfs.pod:3103 ../src/guestfs.pod:3335 ../src/guestfs.pod:3339 ../src/guestfs.pod:3343 ../src/guestfs.pod:3347 ../tools/virt-win-reg.pl:197 ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208 ../tools/virt-win-reg.pl:721 ../tools/virt-win-reg.pl:727 ../tools/virt-win-reg.pl:733
705 #: ../align/virt-alignment-scan.pod:326
710 #: ../align/virt-alignment-scan.pod:328
711 msgid "successful exit, all partitions are aligned E<ge> 64K for best performance"
715 #: ../align/virt-alignment-scan.pod:332
720 #: ../align/virt-alignment-scan.pod:334
721 msgid "an error scanning the disk image or guest"
725 #: ../align/virt-alignment-scan.pod:338
730 #: ../align/virt-alignment-scan.pod:340
732 "successful exit, some partitions have alignment E<lt> 64K which can result "
733 "in poor performance on high end network storage"
737 #: ../align/virt-alignment-scan.pod:345
742 #: ../align/virt-alignment-scan.pod:347
744 "successful exit, some partitions have alignment E<lt> 4K which can result in "
745 "poor performance on most hypervisors"
749 #: ../align/virt-alignment-scan.pod:352 ../cat/virt-cat.pod:243 ../cat/virt-filesystems.pod:385 ../cat/virt-ls.pod:495 ../clone/virt-sysprep.pod:486 ../df/virt-df.pod:253 ../edit/virt-edit.pod:354 ../erlang/examples/guestfs-erlang.pod:97 ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384 ../examples/guestfs-testing.pod:291 ../fish/guestfish.pod:1268 ../fish/virt-copy-in.pod:50 ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47 ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:317 ../inspector/virt-inspector.pod:395 ../java/examples/guestfs-java.pod:45 ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39 ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:325 ../resize/virt-resize.pod:688 ../ruby/examples/guestfs-ruby.pod:36 ../sparsify/virt-sparsify.pod:269 ../src/guestfs.pod:3275 ../test-tool/libguestfs-test-tool.pod:100 ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265 ../tools/virt-make-fs.pl:557 ../tools/virt-tar.pl:296 ../tools/virt-win-reg.pl:757
754 #: ../align/virt-alignment-scan.pod:354
756 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
757 "L<virt-resize(1)>, L<http://libguestfs.org/>."
761 #: ../align/virt-alignment-scan.pod:361 ../cat/virt-cat.pod:252 ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:507 ../clone/virt-sysprep.pod:501 ../df/virt-df.pod:261 ../edit/virt-edit.pod:368 ../rescue/virt-rescue.pod:334 ../resize/virt-resize.pod:711 ../sparsify/virt-sparsify.pod:282 ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277 ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:311 ../tools/virt-win-reg.pl:783
766 #: ../align/virt-alignment-scan.pod:363 ../cat/virt-cat.pod:254 ../cat/virt-filesystems.pod:398 ../cat/virt-ls.pod:509 ../clone/virt-sysprep.pod:503 ../df/virt-df.pod:263 ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:410 ../rescue/virt-rescue.pod:336 ../resize/virt-resize.pod:713 ../sparsify/virt-sparsify.pod:284 ../tools/virt-list-filesystems.pl:210 ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:584 ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:785
767 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
771 #: ../align/virt-alignment-scan.pod:365 ../cat/virt-cat.pod:256 ../cat/virt-filesystems.pod:400 ../cat/virt-ls.pod:511 ../clone/virt-sysprep.pod:505 ../df/virt-df.pod:265 ../edit/virt-edit.pod:372 ../erlang/examples/guestfs-erlang.pod:114 ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401 ../examples/guestfs-testing.pod:302 ../fish/guestfish.pod:1300 ../fish/virt-copy-in.pod:64 ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62 ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:332 ../inspector/virt-inspector.pod:418 ../java/examples/guestfs-java.pod:62 ../ocaml/examples/guestfs-ocaml.pod:95 ../perl/examples/guestfs-perl.pod:56 ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod:338 ../resize/virt-resize.pod:715 ../ruby/examples/guestfs-ruby.pod:52 ../sparsify/virt-sparsify.pod:286 ../src/guestfs.pod:3358 ../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:288
777 msgid "Copyright (C) 2011 Red Hat Inc."
781 #: ../align/virt-alignment-scan.pod:369 ../cat/virt-cat.pod:260 ../cat/virt-filesystems.pod:404 ../cat/virt-ls.pod:515 ../clone/virt-sysprep.pod:509 ../df/virt-df.pod:269 ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1305 ../fish/virt-copy-in.pod:69 ../fish/virt-copy-out.pod:58 ../fish/virt-tar-in.pod:67 ../fish/virt-tar-out.pod:60 ../fuse/guestmount.pod:337 ../inspector/virt-inspector.pod:422 ../rescue/virt-rescue.pod:342 ../resize/virt-resize.pod:719 ../sparsify/virt-sparsify.pod:290 ../test-tool/libguestfs-test-tool.pod:115 ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285 ../tools/virt-make-fs.pl:590 ../tools/virt-tar.pl:319 ../tools/virt-win-reg.pl:791
783 "This program is free software; you can redistribute it and/or modify it "
784 "under the terms of the GNU General Public License as published by the Free "
785 "Software Foundation; either version 2 of the License, or (at your option) "
790 #: ../align/virt-alignment-scan.pod:374 ../cat/virt-cat.pod:265 ../cat/virt-filesystems.pod:409 ../cat/virt-ls.pod:520 ../clone/virt-sysprep.pod:514 ../df/virt-df.pod:274 ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1310 ../fish/virt-copy-in.pod:74 ../fish/virt-copy-out.pod:63 ../fish/virt-tar-in.pod:72 ../fish/virt-tar-out.pod:65 ../fuse/guestmount.pod:342 ../inspector/virt-inspector.pod:427 ../rescue/virt-rescue.pod:347 ../resize/virt-resize.pod:724 ../sparsify/virt-sparsify.pod:295 ../test-tool/libguestfs-test-tool.pod:120 ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290 ../tools/virt-make-fs.pl:595 ../tools/virt-tar.pl:324 ../tools/virt-win-reg.pl:796
792 "This program is distributed in the hope that it will be useful, but WITHOUT "
793 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
794 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
799 #: ../align/virt-alignment-scan.pod:379 ../cat/virt-cat.pod:270 ../cat/virt-filesystems.pod:414 ../cat/virt-ls.pod:525 ../clone/virt-sysprep.pod:519 ../df/virt-df.pod:279 ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1315 ../fish/virt-copy-in.pod:79 ../fish/virt-copy-out.pod:68 ../fish/virt-tar-in.pod:77 ../fish/virt-tar-out.pod:70 ../fuse/guestmount.pod:347 ../inspector/virt-inspector.pod:432 ../rescue/virt-rescue.pod:352 ../resize/virt-resize.pod:729 ../sparsify/virt-sparsify.pod:300 ../test-tool/libguestfs-test-tool.pod:125 ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295 ../tools/virt-make-fs.pl:600 ../tools/virt-tar.pl:329 ../tools/virt-win-reg.pl:801
801 "You should have received a copy of the GNU General Public License along with "
802 "this program; if not, write to the Free Software Foundation, Inc., 51 "
803 "Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA."
807 #: ../cat/virt-cat.pod:5
808 msgid "virt-cat - Display files in a virtual machine"
812 #: ../cat/virt-cat.pod:9
815 " virt-cat [--options] -d domname file [file ...]\n"
820 #: ../cat/virt-cat.pod:11
823 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
828 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15 ../inspector/virt-inspector.pod:13
833 #: ../cat/virt-cat.pod:15
836 " virt-cat domname file\n"
841 #: ../cat/virt-cat.pod:17
844 " virt-cat disk.img file\n"
849 #: ../cat/virt-cat.pod:21
851 "C<virt-cat> is a command line tool to display the contents of C<file> where "
852 "C<file> exists in the named virtual machine (or disk image)."
856 #: ../cat/virt-cat.pod:24
858 "Multiple filenames can be given, in which case they are concatenated "
859 "together. Each filename must be a full path, starting at the root directory "
860 "(starting with '/')."
864 #: ../cat/virt-cat.pod:28
866 "C<virt-cat> can be used to quickly view a file. To edit a file, use "
867 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
868 "tool (see L</USING GUESTFISH> below)."
872 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43 ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41 ../fish/guestfish.pod:1051 ../fish/virt-copy-in.pod:29 ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30 ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39 ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75 ../tools/virt-tar.pl:50
877 #: ../cat/virt-cat.pod:34
878 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
882 #: ../cat/virt-cat.pod:37
885 " virt-cat -d mydomain /etc/fstab\n"
890 #: ../cat/virt-cat.pod:39
891 msgid "List syslog messages from a VM disk image file:"
895 #: ../cat/virt-cat.pod:41
898 " virt-cat -a disk.img /var/log/messages | tail\n"
903 #: ../cat/virt-cat.pod:43
904 msgid "Find out what DHCP IP address a VM acquired:"
908 #: ../cat/virt-cat.pod:45
911 " virt-cat -d mydomain /var/log/messages | \\\n"
912 " grep 'dhclient: bound to' | tail\n"
917 #: ../cat/virt-cat.pod:48
918 msgid "Find out what packages were recently installed:"
922 #: ../cat/virt-cat.pod:50
925 " virt-cat -d mydomain /var/log/yum.log | tail\n"
930 #: ../cat/virt-cat.pod:52
931 msgid "Find out who is logged on inside a virtual machine:"
935 #: ../cat/virt-cat.pod:54
938 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
944 #: ../cat/virt-cat.pod:57
945 msgid "or who was logged on:"
949 #: ../cat/virt-cat.pod:59
952 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
953 " last -f /tmp/wtmp\n"
958 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103 ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74 ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:124
960 "Add I<file> which should be a disk image from a virtual machine. If the "
961 "virtual machine has multiple block devices, you must supply all of them with "
962 "separate I<-a> options."
966 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148 ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217 ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:92
967 msgid "B<--echo-keys>"
971 #: ../cat/virt-cat.pod:100
973 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
974 "so you cannot see what you are typing. If you are not worried about Tempest "
975 "attacks and there is no one else in the room you can specify this flag to "
976 "see what you are typing."
980 #: ../cat/virt-cat.pod:116
983 " virt-cat --format=raw -a disk.img file\n"
988 #: ../cat/virt-cat.pod:120
991 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
996 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200 ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289 ../fuse/guestmount.pod:172 ../inspector/virt-inspector.pod:114
997 msgid "B<--keys-from-stdin>"
1001 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202 ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291 ../fuse/guestmount.pod:174 ../inspector/virt-inspector.pod:116
1003 "Read key or passphrase parameters from stdin. The default is to try to read "
1004 "passphrases from the user by opening C</dev/tty>."
1008 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179 ../inspector/virt-inspector.pod:144 ../rescue/virt-rescue.pod:246
1009 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
1013 #: ../cat/virt-cat.pod:154
1014 msgid "Previous versions of virt-cat allowed you to write either:"
1018 #: ../cat/virt-cat.pod:156
1021 " virt-cat disk.img [disk.img ...] file\n"
1026 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185 ../inspector/virt-inspector.pod:150 ../rescue/virt-rescue.pod:252
1031 #: ../cat/virt-cat.pod:160
1034 " virt-cat guestname file\n"
1039 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189 ../inspector/virt-inspector.pod:154 ../rescue/virt-rescue.pod:256
1041 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1042 "the confusing case where a disk image might have the same name as a guest."
1046 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193 ../inspector/virt-inspector.pod:158 ../rescue/virt-rescue.pod:260
1047 msgid "For compatibility the old style is still supported."
1051 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
1052 msgid "WINDOWS PATHS"
1056 #: ../cat/virt-cat.pod:170
1058 "C<virt-cat> has a limited ability to understand Windows drive letters and "
1059 "paths (eg. C<E:\\foo\\bar.txt>)."
1063 #: ../cat/virt-cat.pod:173 ../edit/virt-edit.pod:262
1064 msgid "If and only if the guest is running Windows then:"
1068 #: ../cat/virt-cat.pod:179 ../edit/virt-edit.pod:268
1070 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
1071 "to the correct filesystem."
1075 #: ../cat/virt-cat.pod:184 ../edit/virt-edit.pod:273
1077 "Any backslash (C<\\>) characters in the path are replaced with forward "
1078 "slashes so that libguestfs can process it."
1082 #: ../cat/virt-cat.pod:189
1084 "The path is resolved case insensitively to locate the file that should be "
1089 #: ../cat/virt-cat.pod:194 ../edit/virt-edit.pod:283
1090 msgid "There are some known shortcomings:"
1094 #: ../cat/virt-cat.pod:200 ../edit/virt-edit.pod:289
1095 msgid "Some NTFS symbolic links may not be followed correctly."
1099 #: ../cat/virt-cat.pod:204 ../edit/virt-edit.pod:293
1100 msgid "NTFS junction points that cross filesystems are not followed."
1104 #: ../cat/virt-cat.pod:208 ../edit/virt-edit.pod:297
1105 msgid "USING GUESTFISH"
1109 #: ../cat/virt-cat.pod:210
1111 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1112 "C<virt-cat> doesn't work."
1116 #: ../cat/virt-cat.pod:213
1117 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1121 #: ../cat/virt-cat.pod:215
1124 " guestfish --ro -i -d domname download file -\n"
1129 #: ../cat/virt-cat.pod:217
1131 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1132 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1136 #: ../cat/virt-cat.pod:221
1138 "The command above uses libguestfs's guest inspection feature and so does not "
1139 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1140 "disk images that don't contain guests. To display a file from a disk image "
1145 #: ../cat/virt-cat.pod:226
1148 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1153 #: ../cat/virt-cat.pod:228
1155 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1156 "the disk image, and C<file> is the full path to the file."
1160 #: ../cat/virt-cat.pod:240 ../cat/virt-filesystems.pod:382 ../cat/virt-ls.pod:492 ../df/virt-df.pod:250 ../edit/virt-edit.pod:351 ../fuse/guestmount.pod:314 ../inspector/virt-inspector.pod:392 ../resize/virt-resize.pod:685 ../sparsify/virt-sparsify.pod:247
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:217
1761 msgid "NOTE ABOUT CSV FORMAT"
1765 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:461 ../df/virt-df.pod:219
1767 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1768 "should be easy to parse, but it is definitely not easy to parse."
1772 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:464 ../df/virt-df.pod:222
1774 "Myth: Just split fields at commas. Reality: This does I<not> work "
1775 "reliably. This example has two columns:"
1779 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:467 ../df/virt-df.pod:225
1782 " \"foo,bar\",baz\n"
1787 #: ../cat/virt-filesystems.pod:359 ../cat/virt-ls.pod:469 ../df/virt-df.pod:227
1789 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1790 "reliably. This example has one row:"
1794 #: ../cat/virt-filesystems.pod:362 ../cat/virt-ls.pod:472 ../df/virt-df.pod:230
1803 #: ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:475 ../df/virt-df.pod:233
1805 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1806 "packaged in major Linux distributions)."
1810 #: ../cat/virt-filesystems.pod:368 ../cat/virt-ls.pod:478 ../df/virt-df.pod:236
1812 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1813 "or Python's built-in csv library)."
1817 #: ../cat/virt-filesystems.pod:371 ../cat/virt-ls.pod:481 ../df/virt-df.pod:239
1818 msgid "Most spreadsheets and databases can import CSV directly."
1822 #: ../cat/virt-filesystems.pod:387
1824 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
1825 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, "
1826 "L<http://libguestfs.org/>."
1830 #: ../cat/virt-filesystems.pod:402 ../tools/virt-win-reg.pl:789
1831 msgid "Copyright (C) 2010 Red Hat Inc."
1835 #: ../cat/virt-ls.pod:5
1836 msgid "virt-ls - List files in a virtual machine"
1840 #: ../cat/virt-ls.pod:9
1843 " virt-ls [--options] -d domname directory [directory ...]\n"
1848 #: ../cat/virt-ls.pod:11
1851 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory "
1857 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:15
1862 #: ../cat/virt-ls.pod:15
1865 " virt-ls [--options] domname directory\n"
1870 #: ../cat/virt-ls.pod:17
1873 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1878 #: ../cat/virt-ls.pod:21
1880 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1881 "more from a virtual machine or disk image."
1885 #: ../cat/virt-ls.pod:24
1887 "Multiple directory names can be given, in which case the output from each is "
1892 #: ../cat/virt-ls.pod:27
1894 "To list directories from a libvirt guest use the I<-d> option to specify the "
1895 "name of the guest. For a disk image, use the I<-a> option."
1899 #: ../cat/virt-ls.pod:31
1901 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1902 "may need to use L<guestfish(1)>, or write a program directly to the "
1903 "L<guestfs(3)> API."
1907 #: ../cat/virt-ls.pod:37
1908 msgid "Get a list of all files and directories in a virtual machine:"
1912 #: ../cat/virt-ls.pod:39
1915 " virt-ls -R -d guest /\n"
1920 #: ../cat/virt-ls.pod:41 ../examples/guestfs-testing.pod:182
1921 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1925 #: ../cat/virt-ls.pod:43
1928 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1933 #: ../cat/virt-ls.pod:45 ../examples/guestfs-testing.pod:186
1934 msgid "List all public-writable directories in a Linux virtual machine:"
1938 #: ../cat/virt-ls.pod:47
1941 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1946 #: ../cat/virt-ls.pod:49 ../examples/guestfs-testing.pod:190
1947 msgid "List all Unix domain sockets in a Linux virtual machine:"
1951 #: ../cat/virt-ls.pod:51
1954 " virt-ls -lR -d guest / | grep '^s'\n"
1959 #: ../cat/virt-ls.pod:53 ../examples/guestfs-testing.pod:194
1960 msgid "List all regular files with filenames ending in '.png':"
1964 #: ../cat/virt-ls.pod:55
1967 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1972 #: ../cat/virt-ls.pod:57
1973 msgid "To display files larger than 10MB in home directories:"
1977 #: ../cat/virt-ls.pod:59
1980 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1985 #: ../cat/virt-ls.pod:61 ../examples/guestfs-testing.pod:202
1986 msgid "Find everything modified in the last 7 days:"
1990 #: ../cat/virt-ls.pod:63
1993 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1998 #: ../cat/virt-ls.pod:65 ../examples/guestfs-testing.pod:206
1999 msgid "Find regular files modified in the last 24 hours:"
2003 #: ../cat/virt-ls.pod:67
2006 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
2011 #: ../cat/virt-ls.pod:69
2012 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
2016 #: ../cat/virt-ls.pod:71
2018 "Find the differences between files in a guest and an earlier snapshot of the "
2023 #: ../cat/virt-ls.pod:74
2026 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
2027 " virt-ls -lR -a current.img / --uids --time-t > new\n"
2028 " diff -u old new | less\n"
2033 #: ../cat/virt-ls.pod:78
2035 "The commands above won't find files where the content has changed but the "
2036 "metadata (eg. file size and modification date) is the same. To do that, you "
2037 "need to add the I<--checksum> parameter to both C<virt-ls> commands. "
2038 "I<--checksum> can be quite slow since it has to read and compute a checksum "
2039 "of every regular file in the virtual machine."
2043 #: ../cat/virt-ls.pod:84
2044 msgid "OUTPUT MODES"
2048 #: ../cat/virt-ls.pod:86
2050 "C<virt-ls> has four output modes, controlled by different combinations of "
2051 "the I<-l> and I<-R> options."
2055 #: ../cat/virt-ls.pod:89
2056 msgid "SIMPLE LISTING"
2060 #: ../cat/virt-ls.pod:91
2061 msgid "A simple listing is like the ordinary L<ls(1)> command:"
2065 #: ../cat/virt-ls.pod:93
2068 " $ virt-ls -d guest /\n"
2076 #: ../cat/virt-ls.pod:98
2077 msgid "LONG LISTING"
2081 #: ../cat/virt-ls.pod:100
2083 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
2084 "(more specifically, like the C<guestfs_ll> function)."
2088 #: ../cat/virt-ls.pod:103
2091 " $ virt-ls -l -d guest /\n"
2093 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
2094 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2100 #: ../cat/virt-ls.pod:109
2102 "Note that while this is useful for displaying a directory, do not try "
2103 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2108 #: ../cat/virt-ls.pod:113
2109 msgid "RECURSIVE LISTING"
2113 #: ../cat/virt-ls.pod:115
2115 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2116 "and directories recursively:"
2120 #: ../cat/virt-ls.pod:118
2123 " $ virt-ls -R -d guest /tmp\n"
2131 #: ../cat/virt-ls.pod:123
2133 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2134 "converts C<\\0> characters to C<\\n>."
2138 #: ../cat/virt-ls.pod:126
2139 msgid "RECURSIVE LONG LISTING"
2143 #: ../cat/virt-ls.pod:128
2145 "Using I<-lR> options together changes the output to display directories "
2146 "recursively, with file stats, and optionally other features such as "
2147 "checksums and extended attributes."
2151 #: ../cat/virt-ls.pod:132
2153 "Most of the interesting features of C<virt-ls> are only available when using "
2158 #: ../cat/virt-ls.pod:135
2160 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2161 "you cannot use the output in another program (because filenames can contain "
2162 "spaces and other unsafe characters). If the guest was untrusted and someone "
2163 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2164 "on you by creating filenames with embedded newline characters. To B<safely> "
2165 "parse the output in another program, use the I<--csv> (Comma-Separated "
2170 #: ../cat/virt-ls.pod:143
2172 "Note that this output format is completely unrelated to the C<ls -lR> "
2177 #: ../cat/virt-ls.pod:146
2180 " $ virt-ls -lR -d guest /bin\n"
2181 " d 0555 4096 /bin\n"
2182 " - 0755 123 /bin/alsaunmute\n"
2183 " - 0755 28328 /bin/arch\n"
2184 " l 0777 4 /bin/awk -> gawk\n"
2185 " - 0755 27216 /bin/basename\n"
2186 " - 0755 943360 /bin/bash\n"
2192 #: ../cat/virt-ls.pod:155
2193 msgid "These basic fields are always shown:"
2197 #: ../cat/virt-ls.pod:159
2202 #: ../cat/virt-ls.pod:161
2204 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2205 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2206 "link), C<s> (socket) or C<u> (unknown)."
2210 #: ../cat/virt-ls.pod:171
2215 #: ../cat/virt-ls.pod:173
2216 msgid "The Unix permissions, displayed as a 4 digit octal number."
2220 #: ../cat/virt-ls.pod:175
2225 #: ../cat/virt-ls.pod:177
2227 "The size of the file. This is shown in bytes unless I<-h> or "
2228 "I<--human-readable> option is given, in which case this is shown as a "
2229 "human-readable number."
2233 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4494
2238 #: ../cat/virt-ls.pod:183
2239 msgid "The full path of the file or directory."
2243 #: ../cat/virt-ls.pod:185
2248 #: ../cat/virt-ls.pod:187
2249 msgid "For symbolic links only, the link target."
2253 #: ../cat/virt-ls.pod:191
2255 "In I<-lR> mode, additional command line options enable the display of more "
2260 #: ../cat/virt-ls.pod:194
2262 "With the I<--uids> flag, these additional fields are displayed before the "
2267 #: ../cat/virt-ls.pod:199
2272 #: ../cat/virt-ls.pod:201
2277 #: ../cat/virt-ls.pod:203
2279 "The UID and GID of the owner of the file (displayed numerically). Note "
2280 "these only make sense in the context of a Unix-like guest."
2284 #: ../cat/virt-ls.pod:208
2285 msgid "With the I<--times> flag, these additional fields are displayed:"
2289 #: ../cat/virt-ls.pod:212
2294 #: ../cat/virt-ls.pod:214
2295 msgid "The time of last access."
2299 #: ../cat/virt-ls.pod:216
2304 #: ../cat/virt-ls.pod:218
2305 msgid "The time of last modification."
2309 #: ../cat/virt-ls.pod:220
2314 #: ../cat/virt-ls.pod:222
2315 msgid "The time of last status change."
2319 #: ../cat/virt-ls.pod:226
2321 "The time fields are displayed as string dates and times, unless one of the "
2322 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2326 #: ../cat/virt-ls.pod:229
2327 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2331 #: ../cat/virt-ls.pod:233
2336 #: ../cat/virt-ls.pod:235
2338 "The device containing the file (displayed as major:minor). This may not "
2339 "match devices as known to the guest."
2343 #: ../cat/virt-ls.pod:238
2348 #: ../cat/virt-ls.pod:240
2349 msgid "The inode number."
2353 #: ../cat/virt-ls.pod:242
2358 #: ../cat/virt-ls.pod:244
2359 msgid "The number of hard links."
2363 #: ../cat/virt-ls.pod:246
2368 #: ../cat/virt-ls.pod:248
2369 msgid "For block and char special files, the device (displayed as major:minor)."
2373 #: ../cat/virt-ls.pod:251
2378 #: ../cat/virt-ls.pod:253
2379 msgid "The number of 512 byte blocks allocated to the file."
2383 #: ../cat/virt-ls.pod:257
2385 "With the I<--checksum> flag, the checksum of the file contents is shown "
2386 "(only for regular files). Computing file checksums can take a considerable "
2391 #: ../cat/virt-ls.pod:280
2392 msgid "B<--checksum>"
2396 #: ../cat/virt-ls.pod:282
2397 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2401 #: ../cat/virt-ls.pod:284
2403 "Display checksum over file contents for regular files. With no argument, "
2404 "this defaults to using I<md5>. Using an argument, you can select the "
2405 "checksum type to use."
2409 #: ../cat/virt-ls.pod:288 ../cat/virt-ls.pod:325 ../cat/virt-ls.pod:358 ../cat/virt-ls.pod:391 ../cat/virt-ls.pod:401 ../cat/virt-ls.pod:408 ../cat/virt-ls.pod:415 ../cat/virt-ls.pod:422
2411 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2416 #: ../cat/virt-ls.pod:316
2418 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2419 "so you cannot see what you are typing. If you are not worried about Tempest "
2420 "attacks and there is no one else in the room you can specify this flag to "
2421 "see what you are typing."
2425 #: ../cat/virt-ls.pod:321
2426 msgid "B<--extra-stats>"
2430 #: ../cat/virt-ls.pod:323
2431 msgid "Display extra stats."
2435 #: ../cat/virt-ls.pod:339
2438 " virt-ls --format=raw -a disk.img /dir\n"
2443 #: ../cat/virt-ls.pod:343
2446 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2451 #: ../cat/virt-ls.pod:356
2452 msgid "Display file sizes in human-readable format."
2456 #: ../cat/virt-ls.pod:370
2461 #: ../cat/virt-ls.pod:372
2462 msgid "B<--recursive>"
2466 #: ../cat/virt-ls.pod:374
2468 "Select the mode. With neither of these options, C<virt-ls> produces a "
2469 "simple, flat list of the files in the named directory. See L</SIMPLE "
2474 #: ../cat/virt-ls.pod:378
2476 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See "
2481 #: ../cat/virt-ls.pod:381
2483 "C<virt-ls -R> produces a recursive list of files starting at the named "
2484 "directory. See L</RECURSIVE LISTING>."
2488 #: ../cat/virt-ls.pod:384
2490 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2491 "parsed. See L</RECURSIVE LONG LISTING>."
2495 #: ../cat/virt-ls.pod:387
2500 #: ../cat/virt-ls.pod:389
2501 msgid "Display time fields."
2505 #: ../cat/virt-ls.pod:394
2506 msgid "B<--time-days>"
2510 #: ../cat/virt-ls.pod:396
2511 msgid "Display time fields as days before now (negative if in the future)."
2515 #: ../cat/virt-ls.pod:398
2517 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2518 "of the file is between 0 and 86399 seconds."
2522 #: ../cat/virt-ls.pod:404
2523 msgid "B<--time-relative>"
2527 #: ../cat/virt-ls.pod:406
2528 msgid "Display time fields as seconds before now (negative if in the future)."
2532 #: ../cat/virt-ls.pod:411
2537 #: ../cat/virt-ls.pod:413
2538 msgid "Display time fields as seconds since the Unix epoch."
2542 #: ../cat/virt-ls.pod:418
2547 #: ../cat/virt-ls.pod:420
2548 msgid "Display UID and GID fields."
2552 #: ../cat/virt-ls.pod:445
2553 msgid "Previous versions of virt-ls allowed you to write either:"
2557 #: ../cat/virt-ls.pod:447
2560 " virt-ls disk.img [disk.img ...] /dir\n"
2565 #: ../cat/virt-ls.pod:451
2568 " virt-ls guestname /dir\n"
2573 #: ../cat/virt-ls.pod:497
2575 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, "
2576 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
2577 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
2581 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:267 ../edit/virt-edit.pod:374 ../rescue/virt-rescue.pod:340
2582 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2586 #: ../clone/virt-sysprep.pod:5
2587 msgid "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
2591 #: ../clone/virt-sysprep.pod:9
2594 " virt-sysprep [--options] -d domname\n"
2599 #: ../clone/virt-sysprep.pod:11
2602 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
2607 #: ../clone/virt-sysprep.pod:15
2609 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
2610 "can be made from it. Steps in this process include removing SSH host keys, "
2611 "removing persistent network MAC configuration, and removing user accounts. "
2612 "Each step can be enabled or disabled as required."
2616 #: ../clone/virt-sysprep.pod:21
2618 "Virt-sysprep is a simple shell script, allowing easy inspection or "
2619 "customization by the system administrator."
2623 #: ../clone/virt-sysprep.pod:24
2625 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
2626 "be shut down. If you want to preserve the existing contents of the guest, "
2627 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> "
2632 #: ../clone/virt-sysprep.pod:29
2634 "You do I<not> need to run virt-sysprep as root. In fact we'd generally "
2635 "recommend that you don't. The time you might want to run it as root is when "
2636 "you need root in order to access the disk image, but even in this case it "
2637 "would be better to change the permissions on the disk image to be writable "
2638 "as the non-root user running virt-sysprep."
2642 #: ../clone/virt-sysprep.pod:35
2644 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
2645 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
2646 "machines in preparation for cloning them. Having said that, virt-sysprep "
2647 "does I<not> currently work on Microsoft Windows guests. We plan to support "
2648 "Windows sysprepping in a future version, and we already have code to do it."
2652 #: ../clone/virt-sysprep.pod:76
2653 msgid "B<--enable=...>"
2657 #: ../clone/virt-sysprep.pod:78
2659 "Choose which sysprep operations to perform. Give a comma-separated list of "
2660 "operations, for example:"
2664 #: ../clone/virt-sysprep.pod:81
2667 " --enable=ssh-hostkeys,udev-persistent-net\n"
2672 #: ../clone/virt-sysprep.pod:83
2673 msgid "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
2677 #: ../clone/virt-sysprep.pod:85
2679 "If the I<--enable> option is not given, then we default to trying all "
2680 "possible sysprep operations. But some sysprep operations are skipped for "
2685 #: ../clone/virt-sysprep.pod:89
2687 "Use I<--list-operations> to list operations supported by a particular "
2688 "version of virt-sysprep."
2692 #: ../clone/virt-sysprep.pod:92
2693 msgid "See L</OPERATIONS> below for a list and an explanation of each operation."
2697 #: ../clone/virt-sysprep.pod:106
2700 " virt-sysprep --format=raw -a disk.img\n"
2705 #: ../clone/virt-sysprep.pod:110
2708 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
2713 #: ../clone/virt-sysprep.pod:119
2714 msgid "B<--hostname> newhostname"
2718 #: ../clone/virt-sysprep.pod:121
2720 "Change the hostname. See the L</hostname> operation below. If not given, "
2721 "defaults to C<localhost.localdomain>."
2725 #: ../clone/virt-sysprep.pod:124
2726 msgid "B<--list-operations>"
2730 #: ../clone/virt-sysprep.pod:126
2731 msgid "List the operations supported by the virt-sysprep program."
2735 #: ../clone/virt-sysprep.pod:128
2736 msgid "B<--selinux-relabel>"
2740 #: ../clone/virt-sysprep.pod:130
2741 msgid "B<--no-selinux-relabel>"
2745 #: ../clone/virt-sysprep.pod:132
2747 "I<--selinux-relabel> forces SELinux relabelling next time the guest boots. "
2748 "I<--no-selinux-relabel> disables relabelling."
2752 #: ../clone/virt-sysprep.pod:135
2754 "The default is to try to detect if SELinux relabelling is required. See "
2755 "L</SELINUX RELABELLING> below for more details."
2759 #: ../clone/virt-sysprep.pod:156
2764 #: ../clone/virt-sysprep.pod:158
2766 "If the I<--enable> option is I<not> given, then I<all sysprep operations are "
2767 "enabled>, although some are skipped depending on the type of guest."
2771 #: ../clone/virt-sysprep.pod:162
2773 "Operations can be individually enabled using the I<--enable> option. Use a "
2774 "comma-separated list, for example:"
2778 #: ../clone/virt-sysprep.pod:165
2781 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
2786 #: ../clone/virt-sysprep.pod:167
2788 "To list the operations supported by the current version of virt-sysprep, use "
2789 "I<--list-operations>."
2793 #: ../clone/virt-sysprep.pod:170
2795 "Future versions of virt-sysprep may add more operations. If you are using "
2796 "virt-sysprep and want predictable behaviour, specify only the operations "
2797 "that you want to have enabled."
2801 #: ../clone/virt-sysprep.pod:174
2806 #: ../clone/virt-sysprep.pod:176
2807 msgid "Remove user at-jobs and cron-jobs."
2811 #: ../clone/virt-sysprep.pod:178
2812 msgid "dhcp-client-state"
2816 #: ../clone/virt-sysprep.pod:180
2817 msgid "Remove DHCP client leases."
2821 #: ../clone/virt-sysprep.pod:182
2822 msgid "dhcp-server-state"
2826 #: ../clone/virt-sysprep.pod:184
2827 msgid "Remove DHCP server leases."
2831 #: ../clone/virt-sysprep.pod:186
2836 #: ../clone/virt-sysprep.pod:188
2838 "Changes the hostname of the guest to the value given in the I<--hostname> "
2843 #: ../clone/virt-sysprep.pod:191
2845 "If the I<--hostname> parameter is not given, then the hostname is changed to "
2846 "C<localhost.localdomain>."
2850 #: ../clone/virt-sysprep.pod:194
2855 #: ../clone/virt-sysprep.pod:196
2856 msgid "Remove many log files."
2860 #: ../clone/virt-sysprep.pod:198
2865 #: ../clone/virt-sysprep.pod:200
2866 msgid "Remove email from the local mail spool directory."
2870 #: ../clone/virt-sysprep.pod:202
2875 #: ../clone/virt-sysprep.pod:204
2877 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
2878 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
2882 #: ../clone/virt-sysprep.pod:207
2887 #: ../clone/virt-sysprep.pod:209
2889 "Write some random bytes from the host into the random seed file of the "
2894 #: ../clone/virt-sysprep.pod:212
2895 msgid "See L</RANDOM SEED> below."
2899 #: ../clone/virt-sysprep.pod:214
2900 msgid "rhn-systemid"
2904 #: ../clone/virt-sysprep.pod:216
2905 msgid "Remove the RHN system ID."
2909 #: ../clone/virt-sysprep.pod:218
2914 #: ../clone/virt-sysprep.pod:220
2915 msgid "Remove the Smolt hardware UUID."
2919 #: ../clone/virt-sysprep.pod:222
2920 msgid "ssh-hostkeys"
2924 #: ../clone/virt-sysprep.pod:224
2925 msgid "Remove the SSH host keys in the guest."
2929 #: ../clone/virt-sysprep.pod:226
2931 "The SSH host keys are regenerated (differently) next time the guest is "
2936 #: ../clone/virt-sysprep.pod:229
2938 "If, after cloning, the guest gets the same IP address, ssh will give you a "
2939 "stark warning about the host key changing:"
2943 #: ../clone/virt-sysprep.pod:232
2946 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2947 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
2948 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2949 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
2954 #: ../clone/virt-sysprep.pod:237
2955 msgid "udev-persistent-net"
2959 #: ../clone/virt-sysprep.pod:239
2961 "Remove udev persistent net rules which map the guest's existing MAC address "
2962 "to a fixed ethernet device (eg. eth0)."
2966 #: ../clone/virt-sysprep.pod:242
2968 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
2969 "address occupies the old name (eg. eth0), this means the fresh MAC address "
2970 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
2971 "Erasing the udev persistent net rules avoids this."
2975 #: ../clone/virt-sysprep.pod:247
2980 #: ../clone/virt-sysprep.pod:249
2981 msgid "Remove the utmp file."
2985 #: ../clone/virt-sysprep.pod:251
2987 "This records who is currently logged in on a machine. In modern Linux "
2988 "distros it is stored in a ramdisk and hence not part of the virtual "
2989 "machine's disk, but it was stored on disk in older distros."
2993 #: ../clone/virt-sysprep.pod:255
2998 #: ../clone/virt-sysprep.pod:257
2999 msgid "Remove the yum UUID."
3003 #: ../clone/virt-sysprep.pod:259
3005 "Yum creates a fresh UUID the next time it runs when it notices that the "
3006 "original UUID has been erased."
3010 #: ../clone/virt-sysprep.pod:262
3011 msgid "COPYING AND CLONING"
3015 #: ../clone/virt-sysprep.pod:264
3017 "Virt-sysprep can be used as part of a process of cloning guests, or to "
3018 "prepare a template from which guests can be cloned. There are many "
3019 "different ways to achieve this using the virt tools, and this section is "
3020 "just an introduction."
3024 #: ../clone/virt-sysprep.pod:269
3025 msgid "A virtual machine (when switched off) consists of two parts:"
3029 #: ../clone/virt-sysprep.pod:273
3030 msgid "I<configuration>"
3034 #: ../clone/virt-sysprep.pod:275
3036 "The configuration or description of the guest. eg. The libvirt XML (see "
3037 "C<virsh dumpxml>), the running configuration of the guest, or another "
3038 "external format like OVF."
3042 #: ../clone/virt-sysprep.pod:279
3043 msgid "Some configuration items that might need to be changed:"
3047 #: ../clone/virt-sysprep.pod:285
3052 #: ../clone/virt-sysprep.pod:289 ../clone/virt-sysprep.pod:316
3057 #: ../clone/virt-sysprep.pod:293
3058 msgid "path to block device(s)"
3062 #: ../clone/virt-sysprep.pod:297
3063 msgid "network card MAC address"
3067 #: ../clone/virt-sysprep.pod:301
3068 msgid "I<block device(s)>"
3072 #: ../clone/virt-sysprep.pod:303
3074 "One or more hard disk images, themselves containing files, directories, "
3075 "applications, kernels, configuration, etc."
3079 #: ../clone/virt-sysprep.pod:306
3080 msgid "Some things inside the block devices that might need to be changed:"
3084 #: ../clone/virt-sysprep.pod:312
3085 msgid "hostname and other net configuration"
3089 #: ../clone/virt-sysprep.pod:320
3090 msgid "SSH host keys"
3094 #: ../clone/virt-sysprep.pod:324
3095 msgid "Windows unique security ID (SID)"
3099 #: ../clone/virt-sysprep.pod:328
3100 msgid "Puppet registration"
3104 #: ../clone/virt-sysprep.pod:334
3105 msgid "COPYING THE BLOCK DEVICE"
3109 #: ../clone/virt-sysprep.pod:336
3111 "Starting with an original guest, you probably wish to copy the guest block "
3112 "device and its configuration to make a template. Then once you are happy "
3113 "with the template, you will want to make many clones from it."
3117 #: ../clone/virt-sysprep.pod:341
3123 " original guest --------> template ---------->\n"
3124 " \\------> cloned\n"
3125 " \\-----> guests\n"
3131 #: ../clone/virt-sysprep.pod:349
3133 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3138 #: ../clone/virt-sysprep.pod:352
3142 " original guest --------> template ---------->\n"
3143 " \\------> cloned\n"
3144 " \\-----> guests\n"
3150 #: ../clone/virt-sysprep.pod:358
3151 msgid "There are some smarter (and faster) ways too:"
3155 #: ../clone/virt-sysprep.pod:364
3159 " template ---------->\n"
3160 " \\------> cloned\n"
3161 " \\-----> guests\n"
3167 #: ../clone/virt-sysprep.pod:370
3169 "Use the block device as a backing file and create a snapshot on top for each "
3170 "guest. The advantage is that you don't need to copy the block device (very "
3171 "fast) and only changes are stored (less storage required)."
3175 #: ../clone/virt-sysprep.pod:375
3177 "Note that writing to the backing file once you have created guests on top of "
3178 "it is not possible: you will corrupt the guests."
3182 #: ../clone/virt-sysprep.pod:378
3184 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 "
3185 "-o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3186 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3187 "also create cheap snapshots from files or LUNs."
3191 #: ../clone/virt-sysprep.pod:386
3192 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3196 #: ../clone/virt-sysprep.pod:390
3197 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3201 #: ../clone/virt-sysprep.pod:394
3206 #: ../clone/virt-sysprep.pod:396
3208 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3209 "and/or modify the external libvirt configuration of a guest. It will reset "
3210 "the name, UUID and MAC address of the guest in the libvirt XML."
3214 #: ../clone/virt-sysprep.pod:401
3216 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3217 "image. This was the original motivation to write virt-sysprep."
3221 #: ../clone/virt-sysprep.pod:404
3226 #: ../clone/virt-sysprep.pod:406
3230 " original guest --------> template\n"
3235 #: ../clone/virt-sysprep.pod:409
3237 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3238 "it easier to compress and/or faster to copy."
3242 #: ../clone/virt-sysprep.pod:412
3244 "Notice that since virt-sparsify also copies the image, you can use it to "
3245 "make the initial copy (instead of C<dd>)."
3249 #: ../clone/virt-sysprep.pod:415
3254 #: ../clone/virt-sysprep.pod:417
3258 " template ---------->\n"
3259 " \\------> cloned\n"
3260 " \\-----> guests\n"
3266 #: ../clone/virt-sysprep.pod:423
3268 "If you want to give people cloned guests, but let them pick the size of the "
3269 "guest themselves (eg. depending on how much they are prepared to pay for "
3270 "disk space), then instead of copying the template, you can run "
3271 "L<virt-resize(1)>. Virt-resize performs a copy and resize, and thus is "
3272 "ideal for cloning guests from a template."
3276 #: ../clone/virt-sysprep.pod:429 ../src/guestfs.pod:1164
3281 #: ../clone/virt-sysprep.pod:431
3283 "Although virt-sysprep removes some sensitive information from the guest, it "
3284 "does not pretend to remove all of it. You should examine the L</OPERATIONS> "
3285 "above, and the implementation of the operations in the shell script. You "
3286 "should also examine the guest afterwards."
3290 #: ../clone/virt-sysprep.pod:436
3292 "Sensitive files are simply removed. The data they contained may still exist "
3293 "on the disk, easily recovered with a hex editor or undelete tool. Use "
3294 "L<virt-sparsify(1)> as one way to remove this content. See also the "
3295 "L<scrub(1)> command to get rid of deleted content in directory entries and "
3300 #: ../clone/virt-sysprep.pod:442
3305 #: ../clone/virt-sysprep.pod:444
3306 msgid "I<(This section applies to Linux guests only)>"
3310 #: ../clone/virt-sysprep.pod:446
3312 "The virt-sysprep C<random-seed> operation writes a few bytes of randomness "
3313 "from the host into the guest's random seed file."
3317 #: ../clone/virt-sysprep.pod:449
3319 "If this is just done once and the guest is cloned from the same template, "
3320 "then each guest will start with the same entropy, and things like SSH host "
3321 "keys and TCP sequence numbers may be predictable."
3325 #: ../clone/virt-sysprep.pod:453
3327 "Therefore you should arrange to add more randomness I<after> cloning from a "
3328 "template too, which can be done by just enabling the C<random-seed> "
3333 #: ../clone/virt-sysprep.pod:457
3336 " cp template.img newguest.img\n"
3337 " virt-sysprep --enable=random-seed -a newguest.img\n"
3342 #: ../clone/virt-sysprep.pod:460
3343 msgid "SELINUX RELABELLING"
3347 #: ../clone/virt-sysprep.pod:462
3348 msgid "I<(This section applies to Linux guests using SELinux only)>"
3352 #: ../clone/virt-sysprep.pod:464
3354 "If any new files are created by virt-sysprep, then virt-sysprep touches "
3355 "C</.autorelabel> so that these will be correctly labelled by SELinux the "
3356 "next time the guest is booted. This process interrupts boot and can take "
3361 #: ../clone/virt-sysprep.pod:469
3363 "You can force relabelling for all guests by supplying the "
3364 "I<--selinux-relabel> option."
3368 #: ../clone/virt-sysprep.pod:472
3370 "You can disable relabelling entirely by supplying the "
3371 "I<--no-selinux-relabel> option."
3375 #: ../clone/virt-sysprep.pod:484
3376 msgid "This program returns 0 on success, or 1 if there was an error."
3380 #: ../clone/virt-sysprep.pod:488
3382 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, "
3383 "L<virt-resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<lvcreate(8)>, "
3384 "L<qemu-img(1)>, L<scrub(1)>, L<http://libguestfs.org/>, "
3385 "L<http://libvirt.org/>."
3389 #: ../df/virt-df.pod:5
3390 msgid "virt-df - Display free space on virtual filesystems"
3394 #: ../df/virt-df.pod:9
3397 " virt-df [--options]\n"
3402 #: ../df/virt-df.pod:11
3405 " virt-df [--options] -d domname\n"
3410 #: ../df/virt-df.pod:13
3413 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3418 #: ../df/virt-df.pod:17
3421 " virt-df [--options] domname\n"
3426 #: ../df/virt-df.pod:19
3429 " virt-df [--options] disk.img [disk.img ...]\n"
3434 #: ../df/virt-df.pod:23
3436 "C<virt-df> is a command line tool to display free space on virtual machine "
3437 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3438 "allocated to a virtual machine, but can look inside disk images to see how "
3439 "much space is really being used."
3443 #: ../df/virt-df.pod:28
3445 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3446 "to get a list of all active and inactive guests, and performs a C<df>-type "
3447 "operation on each one in turn, printing out the results."
3451 #: ../df/virt-df.pod:32
3453 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a "
3454 "C<df>-type operation on either the single named libvirt domain, or on the "
3455 "disk image(s) listed on the command line (which must all belong to a single "
3456 "VM). In this mode (with arguments), C<virt-df> will I<only work for a "
3457 "single guest>. If you want to run on multiple guests, then you have to "
3458 "invoke C<virt-df> multiple times."
3462 #: ../df/virt-df.pod:39
3464 "Use the I<--csv> option to get a format which can be easily parsed by other "
3465 "programs. Other options are similar to the standard L<df(1)> command."
3469 #: ../df/virt-df.pod:45
3471 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3472 "output human-readable:"
3476 #: ../df/virt-df.pod:48
3479 " # virt-df -d F14x64 -h\n"
3480 " Filesystem Size Used Available Use%\n"
3481 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3482 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3487 #: ../df/virt-df.pod:53
3488 msgid "Show disk usage for a disk image file called C<test.img>:"
3492 #: ../df/virt-df.pod:55
3495 " $ virt-df -a test1.img\n"
3496 " Filesystem 1K-blocks Used Available Use%\n"
3497 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3502 #: ../df/virt-df.pod:112
3505 " virt-df --format=raw -a disk.img\n"
3510 #: ../df/virt-df.pod:116
3513 " virt-df --format=raw -a disk.img --format -a another.img\n"
3518 #: ../df/virt-df.pod:129
3519 msgid "Print sizes in human-readable format."
3523 #: ../df/virt-df.pod:131
3524 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3528 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:164
3533 #: ../df/virt-df.pod:135
3538 #: ../df/virt-df.pod:137
3539 msgid "Print inodes instead of blocks."
3543 #: ../df/virt-df.pod:139
3544 msgid "B<--one-per-guest>"
3548 #: ../df/virt-df.pod:141
3550 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3551 "disks from several guests to a single libguestfs appliance."
3555 #: ../df/virt-df.pod:144
3556 msgid "You might use this option in the following circumstances:"
3560 #: ../df/virt-df.pod:150
3562 "If you think an untrusted guest might actively try to exploit the libguestfs "
3563 "appliance kernel, then this prevents one guest from interfering with the "
3564 "stats printed for another guest."
3568 #: ../df/virt-df.pod:156
3570 "If the kernel has a bug which stops it from accessing a filesystem in one "
3571 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3572 "and report stats for further guests."
3576 #: ../df/virt-df.pod:165
3578 "Print UUIDs instead of names. This is useful for following a guest even "
3579 "when the guest is migrated or renamed, or when two guests happen to have the "
3584 #: ../df/virt-df.pod:169
3586 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3587 "images, we still print the disk image name even when this option is "
3592 #: ../df/virt-df.pod:191
3593 msgid "STATVFS NUMBERS"
3597 #: ../df/virt-df.pod:193
3599 "C<virt-df> (and L<df(1)>) get information by issuing a L<statvfs(3)> system "
3600 "call. You can get the same information directly, either from the host "
3601 "(using libguestfs) or inside the guest:"
3605 #: ../df/virt-df.pod:199
3606 msgid "From the host"
3610 #: ../df/virt-df.pod:201 ../df/virt-df.pod:209
3611 msgid "Run this command:"
3615 #: ../df/virt-df.pod:203
3618 " guestfish --ro -d GuestName -i statvfs /\n"
3623 #: ../df/virt-df.pod:205 ../df/virt-df.pod:213
3624 msgid "(change C</> to see stats for other filesystems)."
3628 #: ../df/virt-df.pod:207
3629 msgid "From inside the guest"
3633 #: ../df/virt-df.pod:211
3636 " python -c 'import os; s = os.statvfs (\"/\"); print s'\n"
3641 #: ../df/virt-df.pod:255
3643 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
3644 "L<http://libguestfs.org/>."
3648 #: ../edit/virt-edit.pod:5
3649 msgid "virt-edit - Edit a file in a virtual machine"
3653 #: ../edit/virt-edit.pod:9
3656 " virt-edit [--options] -d domname file [file ...]\n"
3661 #: ../edit/virt-edit.pod:11
3664 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
3669 #: ../edit/virt-edit.pod:13
3672 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
3677 #: ../edit/virt-edit.pod:17
3680 " virt-edit domname file\n"
3685 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
3688 " virt-edit disk.img [disk.img ...] file\n"
3693 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23 ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15 ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:21 ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
3698 #: ../edit/virt-edit.pod:23
3700 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
3701 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
3702 "doing this, but doesn't catch all cases."
3706 #: ../edit/virt-edit.pod:29
3708 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
3709 "exists in the named virtual machine (or disk image)."
3713 #: ../edit/virt-edit.pod:32
3715 "Multiple filenames can be given, in which case they are each edited in "
3716 "turn. Each filename must be a full path, starting at the root directory "
3717 "(starting with '/')."
3721 #: ../edit/virt-edit.pod:36
3722 msgid "If you want to just view a file, use L<virt-cat(1)>."
3726 #: ../edit/virt-edit.pod:38
3728 "For more complex cases you should look at the L<guestfish(1)> tool (see "
3729 "L</USING GUESTFISH> below)."
3733 #: ../edit/virt-edit.pod:41
3735 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
3736 "that and much more."
3740 #: ../edit/virt-edit.pod:46
3741 msgid "Edit the named files interactively:"
3745 #: ../edit/virt-edit.pod:48
3748 " virt-edit -d mydomain /boot/grub/grub.conf\n"
3753 #: ../edit/virt-edit.pod:50
3756 " virt-edit -d mydomain /etc/passwd\n"
3761 #: ../edit/virt-edit.pod:52
3762 msgid "For Windows guests, some Windows paths are understood:"
3766 #: ../edit/virt-edit.pod:54
3769 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
3774 #: ../edit/virt-edit.pod:56
3776 "If Perl is installed, you can also edit files non-interactively (see "
3777 "L</NON-INTERACTIVE EDITING> below). To change the init default level to 5:"
3781 #: ../edit/virt-edit.pod:60
3784 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
3789 #: ../edit/virt-edit.pod:81
3790 msgid "B<-b> extension"
3794 #: ../edit/virt-edit.pod:83
3795 msgid "B<--backup> extension"
3799 #: ../edit/virt-edit.pod:85
3801 "Create a backup of the original file I<in the guest disk image>. The backup "
3802 "has the original filename with C<extension> added."
3806 #: ../edit/virt-edit.pod:88
3808 "Usually the first character of C<extension> would be a dot C<.> so you would "
3813 #: ../edit/virt-edit.pod:91
3816 " virt-edit -b .orig [etc]\n"
3821 #: ../edit/virt-edit.pod:93
3822 msgid "By default, no backup file is made."
3826 #: ../edit/virt-edit.pod:95 ../fish/guestfish.pod:181 ../fuse/guestmount.pod:105 ../inspector/virt-inspector.pod:74 ../tools/virt-list-filesystems.pl:77 ../tools/virt-list-partitions.pl:78 ../tools/virt-tar.pl:127 ../tools/virt-win-reg.pl:128
3831 #: ../edit/virt-edit.pod:97 ../fish/guestfish.pod:183 ../fuse/guestmount.pod:107 ../inspector/virt-inspector.pod:76 ../tools/virt-list-filesystems.pl:79 ../tools/virt-list-partitions.pl:80 ../tools/virt-tar.pl:129 ../tools/virt-win-reg.pl:130
3832 msgid "B<--connect URI>"
3836 #: ../edit/virt-edit.pod:102 ../tools/virt-list-filesystems.pl:84 ../tools/virt-list-partitions.pl:85 ../tools/virt-tar.pl:134 ../tools/virt-win-reg.pl:135
3838 "If you specify guest block devices directly, then libvirt is not used at "
3843 #: ../edit/virt-edit.pod:114
3845 "When prompting for keys and passphrases, virt-edit normally turns echoing "
3846 "off so you cannot see what you are typing. If you are not worried about "
3847 "Tempest attacks and there is no one else in the room you can specify this "
3848 "flag to see what you are typing."
3852 #: ../edit/virt-edit.pod:119
3857 #: ../edit/virt-edit.pod:121
3858 msgid "B<--expr> EXPR"
3862 #: ../edit/virt-edit.pod:123
3864 "Instead of launching the external editor, non-interactively apply the Perl "
3865 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
3870 #: ../edit/virt-edit.pod:127
3872 "Be careful to properly quote the expression to prevent it from being altered "
3877 #: ../edit/virt-edit.pod:130
3878 msgid "Note that this option is only available when Perl 5 is installed."
3882 #: ../edit/virt-edit.pod:132
3883 msgid "B<--format> raw|qcow2|..."
3887 #: ../edit/virt-edit.pod:143
3890 " virt-edit --format=raw -a disk.img file\n"
3895 #: ../edit/virt-edit.pod:147
3898 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
3903 #: ../edit/virt-edit.pod:181
3904 msgid "Previous versions of virt-edit allowed you to write either:"
3908 #: ../edit/virt-edit.pod:187
3911 " virt-edit guestname file\n"
3916 #: ../edit/virt-edit.pod:195
3917 msgid "NON-INTERACTIVE EDITING"
3921 #: ../edit/virt-edit.pod:197
3923 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
3924 "administrator can interactively edit the file."
3928 #: ../edit/virt-edit.pod:200
3930 "There are two ways also to use C<virt-edit> from scripts in order to make "
3931 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
3932 "like this, it's less error-prone to write scripts directly using the "
3933 "libguestfs API and Augeas for configuration file editing.)"
3937 #: ../edit/virt-edit.pod:206
3939 "The first method is to temporarily set C<$EDITOR> to any script or program "
3940 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
3941 "update C<tmpfile> in place however it likes."
3945 #: ../edit/virt-edit.pod:210
3947 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
3948 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
3949 "instances of C<foo> with C<bar> in a file:"
3953 #: ../edit/virt-edit.pod:214
3956 " virt-edit -d domname filename -e 's/foo/bar/'\n"
3961 #: ../edit/virt-edit.pod:216
3963 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
3964 "For example to delete root's password you could do:"
3968 #: ../edit/virt-edit.pod:219
3971 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3976 #: ../edit/virt-edit.pod:221
3978 "What really happens is that the snippet is evaluated as a Perl expression "
3979 "for each line of the file. The line, including the final C<\\n>, is passed "
3980 "in C<$_> and the expression should update C<$_> or leave it unchanged."
3984 #: ../edit/virt-edit.pod:226
3986 "To delete a line, set C<$_> to the empty string. For example, to delete the "
3987 "C<apache> user account from the password file you can do:"
3991 #: ../edit/virt-edit.pod:229
3994 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
3999 #: ../edit/virt-edit.pod:231
4001 "To insert a line, prepend or append it to C<$_>. However appending lines to "
4002 "the end of the file is rather difficult this way since there is no concept "
4003 "of \"last line of the file\" - your expression just doesn't get called "
4004 "again. You might want to use the first method (setting C<$EDITOR>) if you "
4009 #: ../edit/virt-edit.pod:237
4011 "The variable C<$lineno> contains the current line number. As is "
4012 "traditional, the first line in the file is number C<1>."
4016 #: ../edit/virt-edit.pod:240
4018 "The return value from the expression is ignored, but the expression may call "
4019 "C<die> in order to abort the whole program, leaving the original file "
4024 #: ../edit/virt-edit.pod:244
4026 "Remember when matching the end of a line that C<$_> may contain the final "
4027 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
4028 "newline then neither of these. Thus to match or substitute some text at the "
4029 "end of a line, use this regular expression:"
4033 #: ../edit/virt-edit.pod:249
4036 " /some text(\\r?\\n)?$/\n"
4041 #: ../edit/virt-edit.pod:251
4043 "Alternately, use the perl C<chomp> function, being careful not to chomp "
4044 "C<$_> itself (since that would remove all newlines from the file):"
4048 #: ../edit/virt-edit.pod:255
4051 " my $m = $_; chomp $m; $m =~ /some text$/\n"
4056 #: ../edit/virt-edit.pod:259
4058 "C<virt-edit> has a limited ability to understand Windows drive letters and "
4059 "paths (eg. C<E:\\foo\\bar.txt>)."
4063 #: ../edit/virt-edit.pod:278
4065 "The path is resolved case insensitively to locate the file that should be "
4070 #: ../edit/virt-edit.pod:299
4072 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
4073 "C<virt-edit> doesn't work."
4077 #: ../edit/virt-edit.pod:302
4078 msgid "Using C<virt-edit> is approximately equivalent to doing:"
4082 #: ../edit/virt-edit.pod:304
4085 " guestfish --rw -i -d domname edit /file\n"
4090 #: ../edit/virt-edit.pod:306
4092 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
4097 #: ../edit/virt-edit.pod:309
4099 "The command above uses libguestfs's guest inspection feature and so does not "
4100 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
4101 "disk images that don't contain guests. To edit a file on a disk image "
4106 #: ../edit/virt-edit.pod:314
4109 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4114 #: ../edit/virt-edit.pod:316
4116 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4117 "the disk image to edit, and C</file> is the full path to the file."
4121 #: ../edit/virt-edit.pod:320
4123 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4124 "C<write> or C<upload> instead:"
4128 #: ../edit/virt-edit.pod:323
4131 " guestfish --rw -i -d domname touch /newfile\n"
4136 #: ../edit/virt-edit.pod:325
4139 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4144 #: ../edit/virt-edit.pod:327
4147 " guestfish --rw -i -d domname upload localfile /newfile\n"
4152 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1119 ../rescue/virt-rescue.pod:298 ../sparsify/virt-sparsify.pod:250 ../src/guestfs.pod:3214 ../test-tool/libguestfs-test-tool.pod:95
4153 msgid "ENVIRONMENT VARIABLES"
4157 #: ../edit/virt-edit.pod:333
4162 #: ../edit/virt-edit.pod:335
4164 "If set, this string is used as the editor. It may contain arguments, "
4165 "eg. C<\"emacs -nw\">"
4169 #: ../edit/virt-edit.pod:338
4170 msgid "If not set, C<vi> is used."
4174 #: ../edit/virt-edit.pod:356
4176 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
4177 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
4178 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4182 #: ../erlang/examples/guestfs-erlang.pod:5
4183 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4187 #: ../erlang/examples/guestfs-erlang.pod:9
4190 " {ok, G} = guestfs:create(),\n"
4191 " ok = guestfs:add_drive_opts(G, Disk,\n"
4192 " [{format, \"raw\"}, {readonly, true}]),\n"
4193 " ok = guestfs:launch(G),\n"
4194 " [Device] = guestfs:list_devices(G),\n"
4195 " ok = guestfs:close(G).\n"
4200 #: ../erlang/examples/guestfs-erlang.pod:18
4202 "This manual page documents how to call libguestfs from the Erlang "
4203 "programming language. This page just documents the differences from the C "
4204 "API and gives some examples. If you are not familiar with using libguestfs, "
4205 "you also need to read L<guestfs(3)>."
4209 #: ../erlang/examples/guestfs-erlang.pod:23
4210 msgid "OPENING AND CLOSING THE HANDLE"
4214 #: ../erlang/examples/guestfs-erlang.pod:25
4216 "The Erlang bindings are implemented using an external program called "
4217 "C<erl-guestfs>. This program must be on the current PATH, or else you "
4218 "should specify the full path to the program:"
4222 #: ../erlang/examples/guestfs-erlang.pod:29
4225 " {ok, G} = guestfs:create().\n"
4230 #: ../erlang/examples/guestfs-erlang.pod:31
4233 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4238 #: ../erlang/examples/guestfs-erlang.pod:33
4239 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4243 #: ../erlang/examples/guestfs-erlang.pod:36
4244 msgid "To close the handle:"
4248 #: ../erlang/examples/guestfs-erlang.pod:38
4251 " ok = guestfs:close(G).\n"
4256 #: ../erlang/examples/guestfs-erlang.pod:40
4257 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4261 #: ../erlang/examples/guestfs-erlang.pod:42
4263 "For functions that take optional arguments, the first arguments are the "
4264 "non-optional ones. The last argument is a list of tuples supplying the "
4265 "remaining optional arguments."
4269 #: ../erlang/examples/guestfs-erlang.pod:46
4272 " ok = guestfs:add_drive_opts(G, Disk,\n"
4273 " [{format, \"raw\"}, {readonly, true}]).\n"
4278 #: ../erlang/examples/guestfs-erlang.pod:49
4279 msgid "If the last argument would be an empty list, you can also omit it:"
4283 #: ../erlang/examples/guestfs-erlang.pod:51
4286 " ok = guestfs:add_drive_opts(G, Disk).\n"
4291 #: ../erlang/examples/guestfs-erlang.pod:53
4292 msgid "RETURN VALUES AND ERRORS"
4296 #: ../erlang/examples/guestfs-erlang.pod:55
4298 "On success, most functions return a C<Result> term (which could be a list, "
4299 "string, tuple etc.). If there is nothing for the function to return, then "
4300 "the atom C<ok> is returned."
4304 #: ../erlang/examples/guestfs-erlang.pod:59
4305 msgid "On error, you would see one of the following tuples:"
4309 #: ../erlang/examples/guestfs-erlang.pod:63
4310 msgid "C<{error, Msg, Errno}>"
4314 #: ../erlang/examples/guestfs-erlang.pod:65
4315 msgid "This indicates an ordinary error from the function."
4319 #: ../erlang/examples/guestfs-erlang.pod:67
4321 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4326 #: ../erlang/examples/guestfs-erlang.pod:70
4327 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4331 #: ../erlang/examples/guestfs-erlang.pod:72
4332 msgid "C<{unknown, Function}>"
4336 #: ../erlang/examples/guestfs-erlang.pod:74
4338 "This indicates that the function you called is not known. Generally this "
4339 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4340 "which you should not do."
4344 #: ../erlang/examples/guestfs-erlang.pod:78
4345 msgid "C<Function> is the name of the unknown function."
4349 #: ../erlang/examples/guestfs-erlang.pod:80
4350 msgid "C<{unknownarg, Arg}>"
4354 #: ../erlang/examples/guestfs-erlang.pod:82
4356 "This indicates that you called a function with optional arguments, with an "
4357 "unknown argument name."
4361 #: ../erlang/examples/guestfs-erlang.pod:85
4362 msgid "C<Arg> is the name of the unknown argument."
4366 #: ../erlang/examples/guestfs-erlang.pod:89 ../examples/guestfs-examples.pod:25 ../java/examples/guestfs-java.pod:37 ../ocaml/examples/guestfs-ocaml.pod:70 ../perl/examples/guestfs-perl.pod:31 ../python/examples/guestfs-python.pod:34 ../ruby/examples/guestfs-ruby.pod:28
4367 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4371 #: ../erlang/examples/guestfs-erlang.pod:91 ../examples/guestfs-examples.pod:27 ../java/examples/guestfs-java.pod:39 ../ocaml/examples/guestfs-ocaml.pod:72 ../perl/examples/guestfs-perl.pod:33 ../python/examples/guestfs-python.pod:36 ../ruby/examples/guestfs-ruby.pod:30
4376 #: ../erlang/examples/guestfs-erlang.pod:93 ../examples/guestfs-examples.pod:29 ../java/examples/guestfs-java.pod:41 ../ocaml/examples/guestfs-ocaml.pod:74 ../perl/examples/guestfs-perl.pod:35 ../python/examples/guestfs-python.pod:38 ../ruby/examples/guestfs-ruby.pod:32
4377 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4381 #: ../erlang/examples/guestfs-erlang.pod:95 ../examples/guestfs-examples.pod:31 ../java/examples/guestfs-java.pod:43 ../ocaml/examples/guestfs-ocaml.pod:76 ../perl/examples/guestfs-perl.pod:37 ../python/examples/guestfs-python.pod:40 ../ruby/examples/guestfs-ruby.pod:34
4386 #: ../erlang/examples/guestfs-erlang.pod:99
4388 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
4389 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4390 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://www.erlang.org/>. "
4391 "L<http://libguestfs.org/>."
4395 #: ../erlang/examples/guestfs-erlang.pod:110 ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397 ../examples/guestfs-testing.pod:298 ../fish/guestfish.pod:1296 ../fish/virt-copy-in.pod:60 ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58 ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:328 ../inspector/virt-inspector.pod:404 ../java/examples/guestfs-java.pod:58 ../ocaml/examples/guestfs-ocaml.pod:91 ../perl/examples/guestfs-perl.pod:52 ../python/examples/guestfs-python.pod:54 ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3354 ../test-tool/libguestfs-test-tool.pod:106
4400 #: ../erlang/examples/guestfs-erlang.pod:112 ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399 ../examples/guestfs-testing.pod:300 ../fish/guestfish.pod:1298 ../fish/virt-copy-in.pod:62 ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60 ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:330 ../java/examples/guestfs-java.pod:60 ../ocaml/examples/guestfs-ocaml.pod:93 ../perl/examples/guestfs-perl.pod:54 ../python/examples/guestfs-python.pod:56 ../ruby/examples/guestfs-ruby.pod:50 ../src/guestfs.pod:3356 ../test-tool/libguestfs-test-tool.pod:108
4401 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4405 #: ../erlang/examples/guestfs-erlang.pod:116 ../examples/guestfs-testing.pod:304 ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4406 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4410 #: ../erlang/examples/guestfs-erlang.pod:118 ../examples/guestfs-examples.pod:53 ../examples/guestfs-recipes.pod:405 ../java/examples/guestfs-java.pod:66 ../ocaml/examples/guestfs-ocaml.pod:99 ../perl/examples/guestfs-perl.pod:60 ../python/examples/guestfs-python.pod:62 ../ruby/examples/guestfs-ruby.pod:56
4412 "The examples in this manual page may be freely copied, modified and "
4413 "distributed without any restrictions."
4417 #: ../erlang/examples/guestfs-erlang.pod:121 ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408 ../examples/guestfs-testing.pod:306 ../java/examples/guestfs-java.pod:69 ../ocaml/examples/guestfs-ocaml.pod:102 ../perl/examples/guestfs-perl.pod:63 ../python/examples/guestfs-python.pod:65 ../ruby/examples/guestfs-ruby.pod:59 ../src/guestfs.pod:3363
4419 "This library is free software; you can redistribute it and/or modify it "
4420 "under the terms of the GNU Lesser General Public License as published by the "
4421 "Free Software Foundation; either version 2 of the License, or (at your "
4422 "option) any later version."
4426 #: ../erlang/examples/guestfs-erlang.pod:126 ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413 ../examples/guestfs-testing.pod:311 ../java/examples/guestfs-java.pod:74 ../ocaml/examples/guestfs-ocaml.pod:107 ../perl/examples/guestfs-perl.pod:68 ../python/examples/guestfs-python.pod:70 ../ruby/examples/guestfs-ruby.pod:64 ../src/guestfs.pod:3368
4428 "This library is distributed in the hope that it will be useful, but WITHOUT "
4429 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4430 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4435 #: ../erlang/examples/guestfs-erlang.pod:131 ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418 ../examples/guestfs-testing.pod:316 ../java/examples/guestfs-java.pod:79 ../ocaml/examples/guestfs-ocaml.pod:112 ../perl/examples/guestfs-perl.pod:73 ../python/examples/guestfs-python.pod:75 ../ruby/examples/guestfs-ruby.pod:69 ../src/guestfs.pod:3373
4437 "You should have received a copy of the GNU Lesser General Public License "
4438 "along with this library; if not, write to the Free Software Foundation, "
4439 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4443 #: ../examples/guestfs-examples.pod:5
4444 msgid "guestfs-examples - Examples of using libguestfs from C"
4448 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4451 " #include <guestfs.h>\n"
4456 #: ../examples/guestfs-examples.pod:11
4459 " guestfs_h *g = guestfs_create ();\n"
4460 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4461 " guestfs_launch (g);\n"
4466 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4469 " cc prog.c -o prog -lguestfs\n"
4471 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4476 #: ../examples/guestfs-examples.pod:21
4478 "This manual page contains examples of calling libguestfs from the C "
4479 "programming language. If you are not familiar with using libguestfs, you "
4480 "also need to read L<guestfs(3)>."
4484 #: ../examples/guestfs-examples.pod:35
4486 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
4487 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4488 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4492 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97 ../python/examples/guestfs-python.pod:60 ../ruby/examples/guestfs-ruby.pod:54
4493 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4497 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4502 #: ../examples/guestfs-recipes.pod:5
4504 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4505 "here. The only way which works for both sorts of output is to just write "
4506 "the URL directly. Do NOT use L<...> for URLs."
4510 #: ../examples/guestfs-recipes.pod:9
4512 "We break with tradition here and don't use ALL CAPS for the section "
4513 "headings, as this makes them much easier to read."
4517 #: ../examples/guestfs-recipes.pod:16
4518 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4522 #: ../examples/guestfs-recipes.pod:20
4524 "This page contains recipes for and links to things you can do using "
4525 "libguestfs, L<guestfish(1)> and the virt tools."
4529 #: ../examples/guestfs-recipes.pod:23
4530 msgid "Audit a virtual machine for setuid files"
4534 #: ../examples/guestfs-recipes.pod:25
4536 "The link below contains a small program which can be used to audit a Linux "
4537 "virtual machine to see what setuid and setgid files it contains."
4541 #: ../examples/guestfs-recipes.pod:28
4542 msgid "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-files/#content"
4546 #: ../examples/guestfs-recipes.pod:30
4547 msgid "Change the background image in a Windows XP VM"
4551 #: ../examples/guestfs-recipes.pod:32
4553 "The links below explain how to use L<guestfish(1)> to change the background "
4554 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4555 "be substantially different for each version of Windows."
4559 #: ../examples/guestfs-recipes.pod:37
4561 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html "
4562 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4566 #: ../examples/guestfs-recipes.pod:40
4567 msgid "Cloning a virtual machine (Linux)"
4571 #: ../examples/guestfs-recipes.pod:42
4573 "The guestfish technique described in the link below works well for most "
4574 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4579 #: ../examples/guestfs-recipes.pod:46
4580 msgid "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/#content"
4584 #: ../examples/guestfs-recipes.pod:48
4586 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
4591 #: ../examples/guestfs-recipes.pod:51
4592 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4596 #: ../examples/guestfs-recipes.pod:53
4597 msgid "Cloning a virtual machine (Windows)"
4601 #: ../examples/guestfs-recipes.pod:55
4603 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
4604 "straightforward. Currently there is code in the Aeolus Oz project which "
4605 "does this (using libguestfs). As part of our review of the virt-clone tool, "
4606 "we may add sysprepping ability."
4610 #: ../examples/guestfs-recipes.pod:60
4612 "https://github.com/clalancette/oz "
4613 "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4617 #: ../examples/guestfs-recipes.pod:63
4618 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
4622 #: ../examples/guestfs-recipes.pod:65
4623 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
4627 #: ../examples/guestfs-recipes.pod:67
4630 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
4635 #: ../examples/guestfs-recipes.pod:69
4636 msgid "To export just a subdirectory, eg. C</files>, do:"
4640 #: ../examples/guestfs-recipes.pod:71
4643 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
4648 #: ../examples/guestfs-recipes.pod:73
4649 msgid "Create empty disk images"
4653 #: ../examples/guestfs-recipes.pod:75
4655 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
4656 "The useful guide below explains the options available."
4660 #: ../examples/guestfs-recipes.pod:78
4661 msgid "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/#content"
4665 #: ../examples/guestfs-recipes.pod:80
4666 msgid "Dump raw filesystem content from inside a disk image or VM"
4670 #: ../examples/guestfs-recipes.pod:82
4672 "You can use the L<guestfish(1)> C<download> command to extract the raw "
4673 "filesystem content from any filesystem in a disk image or a VM (even one "
4674 "which is encrypted or buried inside an LV):"
4678 #: ../examples/guestfs-recipes.pod:86
4681 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
4686 #: ../examples/guestfs-recipes.pod:88
4689 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
4694 #: ../examples/guestfs-recipes.pod:90
4695 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
4699 #: ../examples/guestfs-recipes.pod:92
4700 msgid "Edit grub configuration in a VM"
4704 #: ../examples/guestfs-recipes.pod:94
4705 msgid "You can use this to:"
4709 #: ../examples/guestfs-recipes.pod:100
4710 msgid "Fix a virtual machine that does not boot."
4714 #: ../examples/guestfs-recipes.pod:104
4715 msgid "Change which kernel is used to boot the VM."
4719 #: ../examples/guestfs-recipes.pod:108
4720 msgid "Change kernel command line options."
4724 #: ../examples/guestfs-recipes.pod:112
4725 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
4729 #: ../examples/guestfs-recipes.pod:114
4732 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
4737 #: ../examples/guestfs-recipes.pod:116
4739 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
4744 #: ../examples/guestfs-recipes.pod:119
4747 " virt-rescue -d BrokenGuest\n"
4752 #: ../examples/guestfs-recipes.pod:121
4753 msgid "Export any directory from a VM"
4757 #: ../examples/guestfs-recipes.pod:123
4758 msgid "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
4762 #: ../examples/guestfs-recipes.pod:126 ../examples/guestfs-testing.pod:93
4765 " virt-copy-out -d Guest /home .\n"
4770 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod: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
4775 #: ../examples/guestfs-recipes.pod:134
4777 "The final dot of the command is not a printing error. It means we want to "
4778 "copy out to the current directory."
4782 #: ../examples/guestfs-recipes.pod:139
4783 msgid "This creates a directory called C<home> under the current directory."
4787 #: ../examples/guestfs-recipes.pod:143
4789 "If the guest is a Windows guest then you can use drive letters and "
4790 "backslashes, but you must prefix the path with C<win:> and quote it to "
4791 "protect it from the shell, like this:"
4795 #: ../examples/guestfs-recipes.pod:147
4798 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
4803 #: ../examples/guestfs-recipes.pod:149
4804 msgid "To get the output as a compressed tarball, do:"
4808 #: ../examples/guestfs-recipes.pod:151
4811 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
4816 #: ../examples/guestfs-recipes.pod:153
4818 "Although it sounds tempting, this is usually not a reliable way to get a "
4819 "backup from a running guest. See the entry in the FAQ: "
4820 "http://libguestfs.org/FAQ.html#backup"
4824 #: ../examples/guestfs-recipes.pod:157
4825 msgid "Find out which user is using the most space"
4829 #: ../examples/guestfs-recipes.pod:159
4831 "This simple script examines a Linux guest to find out which user is using "
4832 "the most space in their home directory:"
4836 #: ../examples/guestfs-recipes.pod:162
4844 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
4852 #: ../examples/guestfs-recipes.pod:166
4861 #: ../examples/guestfs-recipes.pod:169
4864 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
4869 #: ../examples/guestfs-recipes.pod:171
4872 " for d in $(guestfish --remote ls \"$dir\"); do\n"
4873 " echo -n \"$dir/$d\"\n"
4875 " guestfish --remote du \"$dir/$d\";\n"
4876 " done | sort -nr -k 2\n"
4881 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
4884 " guestfish --remote exit\n"
4889 #: ../examples/guestfs-recipes.pod:179
4890 msgid "Get DHCP address from a VM"
4894 #: ../examples/guestfs-recipes.pod:181
4896 "The link below explains the many different possible techniques for getting "
4897 "the last assigned DHCP address of a virtual machine."
4901 #: ../examples/guestfs-recipes.pod:184
4902 msgid "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-a-virtual-machine-disk-image/#content"
4906 #: ../examples/guestfs-recipes.pod:186
4908 "In the libguestfs source examples directory you will find the latest version "
4909 "of the C<virt-dhcp-address.c> program."
4913 #: ../examples/guestfs-recipes.pod:189
4914 msgid "Get the operating system product name string"
4918 #: ../examples/guestfs-recipes.pod:191
4919 msgid "Save the following script into a file called C<product-name.sh>:"
4923 #: ../examples/guestfs-recipes.pod:193
4928 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4929 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4930 " guestfish --remote inspect-get-product-name \"$root\"\n"
4931 " guestfish --remote exit\n"
4936 #: ../examples/guestfs-recipes.pod:200
4937 msgid "Make the script executable and run it on a named guest:"
4941 #: ../examples/guestfs-recipes.pod:202
4944 " # product-name.sh RHEL60x64\n"
4945 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
4950 #: ../examples/guestfs-recipes.pod:205
4952 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
4953 "C<xpath> command line tool or from your favourite programming language:"
4957 #: ../examples/guestfs-recipes.pod:209
4960 " # virt-inspector RHEL60x64 > xml\n"
4961 " # xpath '//product_name' < xml\n"
4964 " <product_name>Red Hat Enterprise Linux Server release 6.0 "
4965 "(Santiago)</product_name>\n"
4970 #: ../examples/guestfs-recipes.pod:215
4971 msgid "Get the default boot kernel for a Linux VM"
4975 #: ../examples/guestfs-recipes.pod:217
4977 "The link below contains a program to print the default boot kernel for a "
4982 #: ../examples/guestfs-recipes.pod:220
4983 msgid "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-kernel-for-a-vm/#content"
4987 #: ../examples/guestfs-recipes.pod:222
4989 "It uses Augeas, and the technique is generally applicable for many different "
4994 #: ../examples/guestfs-recipes.pod:229
4995 msgid "listing the user accounts in the guest"
4999 #: ../examples/guestfs-recipes.pod:233
5000 msgid "what repositories is it configured to use"
5004 #: ../examples/guestfs-recipes.pod:237
5005 msgid "what NTP servers does it connect to"
5009 #: ../examples/guestfs-recipes.pod:241
5010 msgid "what were the boot messages last time it booted"
5014 #: ../examples/guestfs-recipes.pod:245
5015 msgid "listing who was logged in recently"
5019 #: ../examples/guestfs-recipes.pod:249
5020 msgid "http://augeas.net/"
5024 #: ../examples/guestfs-recipes.pod:251
5025 msgid "Install RPMs in a guest"
5029 #: ../examples/guestfs-recipes.pod:253
5031 "The link below contains a method to install RPMs in a guest. In fact the "
5032 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
5033 "installs them next time the guest is booted. You could use this technique "
5034 "to install vital security updates in an offline guest."
5038 #: ../examples/guestfs-recipes.pod:259
5039 msgid "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
5043 #: ../examples/guestfs-recipes.pod:261
5044 msgid "List applications installed in a VM"
5048 #: ../examples/guestfs-recipes.pod:263
5049 msgid "Save the following to a file C<list-apps.sh>:"
5053 #: ../examples/guestfs-recipes.pod:265
5058 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
5059 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
5060 " guestfish --remote inspect-list-applications \"$root\"\n"
5061 " guestfish --remote exit\n"
5066 #: ../examples/guestfs-recipes.pod:272
5068 "Make the file executable and then you can run it on any named virtual "
5073 #: ../examples/guestfs-recipes.pod:275
5076 " # list-apps.sh WinGuest\n"
5078 " app_name: Mozilla Firefox (3.6.12)\n"
5079 " app_display_name: Mozilla Firefox (3.6.12)\n"
5081 " app_version: 3.6.12 (en-GB)\n"
5083 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
5084 " app_trans_path:\n"
5085 " app_publisher: Mozilla\n"
5086 " app_url: http://www.mozilla.com/en-GB/\n"
5087 " app_source_package:\n"
5089 " app_description: Mozilla Firefox\n"
5092 " app_name: VLC media player\n"
5093 " app_display_name: VLC media player 1.1.5\n"
5095 " app_version: 1.1.5\n"
5097 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
5098 " app_trans_path:\n"
5099 " app_publisher: VideoLAN\n"
5100 " app_url: http://www.videolan.org/\n"
5101 " app_source_package:\n"
5103 " app_description:\n"
5109 #: ../examples/guestfs-recipes.pod:305
5111 "If you want to run the script on disk images (instead of libvirt virtual "
5112 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also "
5113 "L<virt-inspector(1)>."
5117 #: ../examples/guestfs-recipes.pod:309
5118 msgid "List files and directories in a VM"
5122 #: ../examples/guestfs-recipes.pod:311
5123 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5127 #: ../examples/guestfs-recipes.pod:313
5130 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5135 #: ../examples/guestfs-recipes.pod:315
5136 msgid "List services in a Windows VM"
5140 #: ../examples/guestfs-recipes.pod:317
5142 "The link below contains a script that can be used to list out the services "
5143 "from a Windows VM, and whether those services run at boot time or are loaded "
5148 #: ../examples/guestfs-recipes.pod:321
5149 msgid "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/#content"
5153 #: ../examples/guestfs-recipes.pod:323
5154 msgid "Make a disk image sparse"
5158 #: ../examples/guestfs-recipes.pod:325
5160 "The link below contains some guides for making a disk image sparse (or "
5161 "reintroducing sparseness)."
5165 #: ../examples/guestfs-recipes.pod:328
5166 msgid "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5170 #: ../examples/guestfs-recipes.pod:330
5171 msgid "Monitor disk usage over time"
5175 #: ../examples/guestfs-recipes.pod:332
5177 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5178 "The link below contains a guide."
5182 #: ../examples/guestfs-recipes.pod:335
5183 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5187 #: ../examples/guestfs-recipes.pod:337
5188 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5192 #: ../examples/guestfs-recipes.pod:339
5194 "L<guestfish(1)> plus the tools described in the link below can be used to "
5195 "read out the Windows Event Log from any virtual machine running Windows "
5196 "Vista or a later version."
5200 #: ../examples/guestfs-recipes.pod:343
5201 msgid "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-guestfish/#content"
5205 #: ../examples/guestfs-recipes.pod:345
5206 msgid "Remove root password (Linux)"
5210 #: ../examples/guestfs-recipes.pod:347
5212 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5213 "files. One use is to remove the root password from a Linux guest:"
5217 #: ../examples/guestfs-recipes.pod:350
5220 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5225 #: ../examples/guestfs-recipes.pod:352
5226 msgid "Remove Administrator password (Windows)"
5230 #: ../examples/guestfs-recipes.pod:354
5232 "The link below contains one technique for removing the Administrator "
5233 "password from a Windows VM, or to be more precise, it gives you a command "
5234 "prompt the next time you log in which you can use to bypass any security:"
5238 #: ../examples/guestfs-recipes.pod:359
5239 msgid "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-administrator-password-with-guestfish/"
5243 #: ../examples/guestfs-recipes.pod:361
5244 msgid "Unpack a live CD"
5248 #: ../examples/guestfs-recipes.pod:363
5250 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5251 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5252 "layers, as outlined in the guide below."
5256 #: ../examples/guestfs-recipes.pod:367
5257 msgid "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/#content"
5261 #: ../examples/guestfs-recipes.pod:369
5262 msgid "Uploading and downloading files"
5266 #: ../examples/guestfs-recipes.pod:371
5268 "The link below contains general tips on uploading (copying in) and "
5269 "downloading (copying out) files from VMs."
5273 #: ../examples/guestfs-recipes.pod:374
5274 msgid "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5278 #: ../examples/guestfs-recipes.pod:376
5279 msgid "Use libguestfs tools on VMware ESX guests"
5283 #: ../examples/guestfs-recipes.pod:378
5285 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5286 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5290 #: ../examples/guestfs-recipes.pod:382
5291 msgid "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/#content"
5295 #: ../examples/guestfs-recipes.pod:386
5297 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, "
5298 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
5299 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
5300 "L<http://libguestfs.org/>."
5304 #: ../examples/guestfs-recipes.pod:403
5305 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5309 #: ../examples/guestfs-testing.pod:5
5310 msgid "guestfs-testing - manual testing of libguestfs, you can help!"
5314 #: ../examples/guestfs-testing.pod:9
5316 "This page has manual tests you can try on libguestfs. Everyone has a "
5317 "slightly different combination of platform, hardware and guests, so this "
5318 "testing is very valuable. Thanks for helping out!"
5322 #: ../examples/guestfs-testing.pod:13
5323 msgid "These tests require libguestfs E<ge> 1.14."
5327 #: ../examples/guestfs-testing.pod:15
5329 "Tests marked with a B<*> (asterisk) can B<destroy data> if you're not "
5330 "careful. The others are safe and won't modify anything."
5334 #: ../examples/guestfs-testing.pod:18
5335 msgid "You can report bugs you find through this link:"
5339 #: ../examples/guestfs-testing.pod:20
5340 msgid "https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools"
5344 #: ../examples/guestfs-testing.pod:22
5346 "or post on the mailing list (registration is B<not> required, but if you're "
5347 "not registered then you'll have to wait for a moderator to manually approve "
5352 #: ../examples/guestfs-testing.pod:26
5353 msgid "https://www.redhat.com/mailman/listinfo/libguestfs"
5357 #: ../examples/guestfs-testing.pod:28
5362 #: ../examples/guestfs-testing.pod:30
5363 msgid "Check KVM acceleration is being used."
5367 #: ../examples/guestfs-testing.pod:32
5369 "If your host has hardware virt acceleration, then with a hot cache "
5370 "libguestfs should be able to start up in a few seconds. Run the following "
5371 "command a few times:"
5375 #: ../examples/guestfs-testing.pod:36
5378 " time guestfish -a /dev/null run\n"
5383 #: ../examples/guestfs-testing.pod:38
5385 "After a few runs, the time should settle down to a few seconds (under 5 "
5386 "seconds on fast 64 bit hardware)."
5390 #: ../examples/guestfs-testing.pod:41
5391 msgid "How to check for hardware virt:"
5395 #: ../examples/guestfs-testing.pod:43
5396 msgid "http://virt-tools.org/learning/check-hardware-virt/"
5400 #: ../examples/guestfs-testing.pod:45
5401 msgid "If the command above does not work at all, use L<libguestfs-test-tool(1)>."
5405 #: ../examples/guestfs-testing.pod:48
5406 msgid "Run virt-alignment-scan on all your guests."
5410 #: ../examples/guestfs-testing.pod:50
5411 msgid "Run L<virt-alignment-scan(1)> on guests or disk images:"
5415 #: ../examples/guestfs-testing.pod:52
5418 " virt-alignment-scan -a /path/to/disk.img\n"
5423 #: ../examples/guestfs-testing.pod:54 ../examples/guestfs-testing.pod:161 ../examples/guestfs-testing.pod:174 ../examples/guestfs-testing.pod:234 ../src/guestfs.pod:2792
5428 #: ../examples/guestfs-testing.pod:56
5431 " virt-alignment-scan -d Guest\n"
5436 #: ../examples/guestfs-testing.pod:58
5437 msgid "Does the alignment report match how the guest partitions are aligned?"
5441 #: ../examples/guestfs-testing.pod:60
5442 msgid "Run virt-cat on some files in guests."
5446 #: ../examples/guestfs-testing.pod:62
5447 msgid "L<virt-cat(1)> can display files from guests. For a Linux guest, try:"
5451 #: ../examples/guestfs-testing.pod:64
5454 " virt-cat LinuxGuest /etc/passwd\n"
5459 #: ../examples/guestfs-testing.pod:66
5460 msgid "A recent feature is support for Windows paths, for example:"
5464 #: ../examples/guestfs-testing.pod:68
5467 " virt-cat WindowsGuest 'c:\\windows\\win.ini'\n"
5472 #: ../examples/guestfs-testing.pod:70
5474 "An even better test is if you have a Windows guest with multiple drives. Do "
5475 "C<D:>, C<E:> etc paths work correctly?"
5479 #: ../examples/guestfs-testing.pod:73
5480 msgid "B<*> Copy some files into a B<shut off> guest."
5484 #: ../examples/guestfs-testing.pod:75
5486 "L<virt-copy-in(1)> can recursively copy files and directories into a guest "
5491 #: ../examples/guestfs-testing.pod:78
5494 " virt-copy-in -d Guest /etc /tmp\n"
5499 #: ../examples/guestfs-testing.pod:80
5501 "This should copy local directory C</etc> to C</tmp/etc> in the guest "
5502 "(recursively). If you boot the guest, can you see all of the copied files "
5507 #: ../examples/guestfs-testing.pod:84
5508 msgid "Shut the guest down and try copying multiple files and directories:"
5512 #: ../examples/guestfs-testing.pod:86
5515 " virt-copy-in -d Guest /home /etc/issue /tmp\n"
5520 #: ../examples/guestfs-testing.pod:88
5521 msgid "Copy some files out of a guest."
5525 #: ../examples/guestfs-testing.pod:90
5527 "L<virt-copy-out(1)> can recursively copy files and directories out of a "
5528 "guest or disk image."
5532 #: ../examples/guestfs-testing.pod:95
5533 msgid "Note the final space and period in the command is not a typo."
5537 #: ../examples/guestfs-testing.pod:97
5538 msgid "This should copy C</home> from the guest into the current directory."
5542 #: ../examples/guestfs-testing.pod:99
5543 msgid "Run virt-df."
5547 #: ../examples/guestfs-testing.pod:101
5548 msgid "L<virt-df(1)> lists disk space. Run:"
5552 #: ../examples/guestfs-testing.pod:103
5560 #: ../examples/guestfs-testing.pod:105
5562 "You can try comparing this to the results from L<df(1)> inside the guest, "
5563 "but there are some provisos:"
5567 #: ../examples/guestfs-testing.pod:112
5568 msgid "The guest must be idle."
5572 #: ../examples/guestfs-testing.pod:116
5573 msgid "The guest disks must be synched using L<sync(1)>."
5577 #: ../examples/guestfs-testing.pod:120
5579 "Any action such as booting the guest will write log files causing the "
5580 "numbers to change."
5584 #: ../examples/guestfs-testing.pod:125
5586 "We don't guarantee that the numbers will be identical even under these "
5587 "circumstances. They should be similar. It would indicate a bug if you saw "
5588 "greatly differing numbers."
5592 #: ../examples/guestfs-testing.pod:129
5593 msgid "Try importing virt-df CSV output into a spreadsheet or database."
5597 #: ../examples/guestfs-testing.pod:131 ../src/guestfs.pod:3088
5602 #: ../examples/guestfs-testing.pod:133
5605 " virt-df --csv > /tmp/report.csv\n"
5610 #: ../examples/guestfs-testing.pod:135
5612 "Now try to load this into your favorite spreadsheet or database. Are the "
5613 "results reproduced faithfully in the spreadsheet/database?"
5617 #: ../examples/guestfs-testing.pod:138
5619 "http://www.postgresql.org/docs/8.1/static/sql-copy.html "
5620 "http://dev.mysql.com/doc/refman/5.1/en/load-data.html"
5624 #: ../examples/guestfs-testing.pod:141
5625 msgid "B<*> Edit a file in a B<shut off> guest."
5629 #: ../examples/guestfs-testing.pod:143
5631 "L<virt-edit(1)> can edit files in guests. Try this command on a RHEL or "
5636 #: ../examples/guestfs-testing.pod:146
5639 " virt-edit LinuxGuest /etc/sysconfig/network\n"
5644 #: ../examples/guestfs-testing.pod:148
5645 msgid "On other Linux guests try editing other files such as:"
5649 #: ../examples/guestfs-testing.pod:150
5652 " virt-edit LinuxGuest /etc/motd\n"
5657 #: ../examples/guestfs-testing.pod:152
5658 msgid "Are the changes seen inside the guest when it is booted?"
5662 #: ../examples/guestfs-testing.pod:154
5663 msgid "Display the filesystems / partitions / LVs in a guest."
5667 #: ../examples/guestfs-testing.pod:156
5669 "L<virt-filesystems(1)> can be used to display filesystems in a guest. Try "
5670 "this command on any disk image or guest:"
5674 #: ../examples/guestfs-testing.pod:159
5677 " virt-filesystems -a /path/to/disk.img --all --long -h\n"
5682 #: ../examples/guestfs-testing.pod:163
5685 " virt-filesystems -d Guest --all --long -h\n"
5690 #: ../examples/guestfs-testing.pod:165
5691 msgid "Do the results match what is seen in the guest?"
5695 #: ../examples/guestfs-testing.pod:167
5696 msgid "Run virt-inspector on all your guests."
5700 #: ../examples/guestfs-testing.pod:169
5702 "Use L<virt-inspector(1)> to get a report on all of your guests or disk "
5707 #: ../examples/guestfs-testing.pod:172
5710 " virt-inspector -a /path/to/disk.img | less\n"
5715 #: ../examples/guestfs-testing.pod:176
5718 " virt-inspector -d Guest | less\n"
5723 #: ../examples/guestfs-testing.pod:178
5724 msgid "Do the results match what is actually in the guest?"
5728 #: ../examples/guestfs-testing.pod:180
5729 msgid "Try the auditing features of virt-ls on all your guests."
5733 #: ../examples/guestfs-testing.pod:184
5736 " virt-ls -lR -d Guest / | grep '^- [42]'\n"
5741 #: ../examples/guestfs-testing.pod:188
5744 " virt-ls -lR -d Guest / | grep '^d ...7'\n"
5749 #: ../examples/guestfs-testing.pod:192
5752 " virt-ls -lR -d Guest / | grep '^s'\n"
5757 #: ../examples/guestfs-testing.pod:196
5760 " virt-ls -lR -d Guest / | grep -i '^-.*\\.png$'\n"
5765 #: ../examples/guestfs-testing.pod:198
5766 msgid "Display files larger than 10MB in home directories:"
5770 #: ../examples/guestfs-testing.pod:200
5773 " virt-ls -lR -d Guest /home | awk '$3 > 10*1024*1024'\n"
5778 #: ../examples/guestfs-testing.pod:204
5781 " virt-ls -lR -d Guest --time-days / | awk '$6 <= 7'\n"
5786 #: ../examples/guestfs-testing.pod:208
5789 " virt-ls -lR -d Guest --time-days / | grep '^-' | awk '$6 < 1'\n"
5794 #: ../examples/guestfs-testing.pod:210
5795 msgid "Do the results match what is in the guest?"
5799 #: ../examples/guestfs-testing.pod:212
5800 msgid "Create a disk image from a tarball."
5804 #: ../examples/guestfs-testing.pod:214
5806 "Use L<virt-make-fs(1)> to create a disk image from any tarball that you "
5811 #: ../examples/guestfs-testing.pod:217
5814 " virt-make-fs --partition=mbr --type=vfat /any/tarball.tar.gz output.img\n"
5819 #: ../examples/guestfs-testing.pod:219
5821 "Add 'output.img' as a raw disk to an existing guest. Check the guest can "
5822 "see the files. This test is particularly useful if you try it with a "
5827 #: ../examples/guestfs-testing.pod:223
5828 msgid "Try other partitioning schemes, eg. I<--partition=gpt>."
5832 #: ../examples/guestfs-testing.pod:225
5833 msgid "Try other filesystem formats, eg. I<--type=ntfs>, I<--type=ext2>."
5837 #: ../examples/guestfs-testing.pod:227
5838 msgid "B<*> Run virt-rescue on a B<shut off> disk image or guest."
5842 #: ../examples/guestfs-testing.pod:229
5844 "Use L<virt-rescue(1)> to examine, rescue or repair a B<shut off> guest or "
5849 #: ../examples/guestfs-testing.pod:232
5852 " virt-rescue -a /path/to/disk.img\n"
5857 #: ../examples/guestfs-testing.pod:236
5860 " virt-rescue -d Guest\n"
5865 #: ../examples/guestfs-testing.pod:238
5866 msgid "Can you use ordinary shell commands to examine the guest?"
5870 #: ../examples/guestfs-testing.pod:240
5871 msgid "B<*> Resize your guests."
5875 #: ../examples/guestfs-testing.pod:242
5877 "Use L<virt-resize(1)> to give a guest some more disk space. For example, if "
5878 "you have a disk image that is smaller than 30G, increase it to 30G by doing:"
5882 #: ../examples/guestfs-testing.pod:246
5885 " truncate -s 30G newdisk.img\n"
5886 " virt-filesystems -a /path/to/olddisk.img --all --long -h\n"
5887 " virt-resize /path/to/olddisk.img newdisk.img --expand /dev/sda1\n"
5888 " qemu-kvm -m 1024 -hda newdisk.img\n"
5893 #: ../examples/guestfs-testing.pod:251
5894 msgid "Does the guest still boot? Try expanding other partitions."
5898 #: ../examples/guestfs-testing.pod:253
5899 msgid "B<*> Sparsify a guest disk."
5903 #: ../examples/guestfs-testing.pod:255
5904 msgid "Using L<virt-sparsify(1)>, make a disk image more sparse:"
5908 #: ../examples/guestfs-testing.pod:257
5911 " virt-sparsify /path/to/olddisk.img newdisk.img\n"
5916 #: ../examples/guestfs-testing.pod:259
5918 "Is C<newdisk.img> still bootable after sparsifying? Is the resulting disk "
5919 "image smaller (use C<du> to check)?"
5923 #: ../examples/guestfs-testing.pod:262
5924 msgid "B<*> \"sysprep\" a B<shut off> Linux guest."
5928 #: ../examples/guestfs-testing.pod:264
5930 "Note that this really will mess up an existing guest, so it's better to "
5931 "clone the guest before trying this."
5935 #: ../examples/guestfs-testing.pod:267
5938 " virt-sysprep --hostname newhost.example.com -a /path/to/disk.img\n"
5943 #: ../examples/guestfs-testing.pod:269
5945 "Was the sysprep successful? After booting, what changes were made and were "
5950 #: ../examples/guestfs-testing.pod:272
5951 msgid "Dump the Windows Registry from your Windows guests."
5955 #: ../examples/guestfs-testing.pod:274
5957 "Use L<virt-win-reg(1)> to dump out the Windows Registry from any Windows "
5958 "guests that you have."
5962 #: ../examples/guestfs-testing.pod:277
5965 " virt-win-reg --unsafe-printable-strings WindowsGuest 'HKLM\\Software' |\n"
5971 #: ../examples/guestfs-testing.pod:280
5974 " virt-win-reg --unsafe-printable-strings WindowsGuest 'HKLM\\System' |\n"
5980 #: ../examples/guestfs-testing.pod:283
5981 msgid "Does the output match running C<regedit> inside the guest?"
5985 #: ../examples/guestfs-testing.pod:285
5987 "A recent feature is the ability to dump user registries, so try this, "
5988 "replacing I<username> with the name of a local user in the guest:"
5992 #: ../examples/guestfs-testing.pod:288
5995 " virt-win-reg --unsafe-printable-strings WindowsGuest 'HKEY_USERS\\username' "
6002 #: ../examples/guestfs-testing.pod:293
6004 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, "
6005 "L<http://libguestfs.org/>."
6009 #: ../fish/guestfish-actions.pod:1
6014 #: ../fish/guestfish-actions.pod:3
6017 " add-cdrom filename\n"
6022 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
6023 msgid "This function adds a virtual CD-ROM disk image to the guest."
6027 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
6028 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
6032 #: ../fish/guestfish-actions.pod:15
6034 "This call checks for the existence of C<filename>. This stops you from "
6035 "specifying other types of drive which are supported by qemu such as C<nbd:> "
6036 "and C<http:> URLs. To specify those, use the general L</config> call "
6041 #: ../fish/guestfish-actions.pod:22
6043 "If you just want to add an ISO file (often you use this as an efficient way "
6044 "to transfer large files into the guest), then you should probably use "
6045 "L</add-drive-ro> instead."
6049 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:214 ../fish/guestfish-actions.pod:228
6051 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
6056 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:217 ../fish/guestfish-actions.pod:231 ../fish/guestfish-actions.pod: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:3398 ../fish/guestfish-actions.pod:3709 ../fish/guestfish-actions.pod:3757 ../fish/guestfish-actions.pod:4675 ../fish/guestfish-actions.pod:4695 ../fish/guestfish-actions.pod:4714 ../fish/guestfish-actions.pod:4752 ../fish/guestfish-actions.pod:5480 ../fish/guestfish-actions.pod:5583 ../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:5248 ../src/guestfs-actions.pod:5770 ../src/guestfs-actions.pod:5870 ../src/guestfs-actions.pod:7166 ../src/guestfs-actions.pod:7207 ../src/guestfs-actions.pod:7238 ../src/guestfs-actions.pod:7298 ../src/guestfs-actions.pod:8352 ../src/guestfs-actions.pod:8461 ../src/guestfs-actions.pod:8641
6058 "Deprecated functions will not be removed from the API, but the fact that "
6059 "they are deprecated indicates that there are problems with correct use of "
6064 #: ../fish/guestfish-actions.pod:35
6069 #: ../fish/guestfish-actions.pod:37
6074 #: ../fish/guestfish-actions.pod:39
6077 " add-domain dom [libvirturi:..] [readonly:true|false] [iface:..] "
6078 "[live:true|false] [allowuuid:true|false] [readonlydisk:..]\n"
6083 #: ../fish/guestfish-actions.pod:41
6085 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
6086 "It works by connecting to libvirt, requesting the domain and domain XML from "
6087 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
6091 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:65
6093 "The number of disks added is returned. This operation is atomic: if an "
6094 "error is returned, then no disks are added."
6098 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:68
6100 "This function does some minimal checks to make sure the libvirt domain is "
6101 "not running (unless C<readonly> is true). In a future version we will try "
6102 "to acquire the libvirt lock on each disk."
6106 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:72
6108 "Disks must be accessible locally. This often means that adding disks from a "
6109 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
6110 "unless those disks are accessible via the same device path locally too."
6114 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:77
6116 "The optional C<libvirturi> parameter sets the libvirt URI (see "
6117 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
6118 "default libvirt URI (or one set through an environment variable, see the "
6119 "libvirt documentation for full details)."
6123 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:83
6125 "The optional C<live> flag controls whether this call will try to connect to "
6126 "a running virtual machine C<guestfsd> process if it sees a suitable "
6127 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
6128 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
6129 "DAEMONS> for more information."
6133 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:90
6135 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
6136 "passed instead of the domain name. The C<dom> string is treated as a UUID "
6137 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
6142 #: ../fish/guestfish-actions.pod:76 ../src/guestfs-actions.pod:95
6144 "The optional C<readonlydisk> parameter controls what we do for disks which "
6145 "are marked E<lt>readonly/E<gt> in the libvirt XML. Possible values are:"
6149 #: ../fish/guestfish-actions.pod:82 ../src/guestfs-actions.pod:101
6150 msgid "readonlydisk = \"error\""
6154 #: ../fish/guestfish-actions.pod:84 ../fish/guestfish-actions.pod:95 ../fish/guestfish-actions.pod:106 ../src/guestfs-actions.pod:103 ../src/guestfs-actions.pod:114 ../src/guestfs-actions.pod:125
6155 msgid "If C<readonly> is false:"
6159 #: ../fish/guestfish-actions.pod:86 ../src/guestfs-actions.pod:105
6161 "The whole call is aborted with an error if any disk with the "
6162 "E<lt>readonly/E<gt> flag is found."
6166 #: ../fish/guestfish-actions.pod:89 ../fish/guestfish-actions.pod:100 ../fish/guestfish-actions.pod:110 ../src/guestfs-actions.pod:108 ../src/guestfs-actions.pod:119 ../src/guestfs-actions.pod:129
6167 msgid "If C<readonly> is true:"
6171 #: ../fish/guestfish-actions.pod:91 ../fish/guestfish-actions.pod:102 ../fish/guestfish-actions.pod:112 ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:131
6172 msgid "Disks with the E<lt>readonly/E<gt> flag are added read-only."
6176 #: ../fish/guestfish-actions.pod:93 ../src/guestfs-actions.pod:112
6177 msgid "readonlydisk = \"read\""
6181 #: ../fish/guestfish-actions.pod:97 ../src/guestfs-actions.pod:116
6183 "Disks with the E<lt>readonly/E<gt> flag are added read-only. Other disks "
6184 "are added read/write."
6188 #: ../fish/guestfish-actions.pod:104 ../src/guestfs-actions.pod:123
6189 msgid "readonlydisk = \"write\" (default)"
6193 #: ../fish/guestfish-actions.pod:108 ../src/guestfs-actions.pod:127
6194 msgid "Disks with the E<lt>readonly/E<gt> flag are added read/write."
6198 #: ../fish/guestfish-actions.pod:114 ../src/guestfs-actions.pod:133
6199 msgid "readonlydisk = \"ignore\""
6203 #: ../fish/guestfish-actions.pod:116 ../src/guestfs-actions.pod:135
6204 msgid "If C<readonly> is true or false:"
6208 #: ../fish/guestfish-actions.pod:118 ../src/guestfs-actions.pod:137
6209 msgid "Disks with the E<lt>readonly/E<gt> flag are skipped."
6213 #: ../fish/guestfish-actions.pod:122
6215 "The other optional parameters are passed directly through to "
6216 "L</add-drive-opts>."
6220 #: ../fish/guestfish-actions.pod:125 ../fish/guestfish-actions.pod:194 ../fish/guestfish-actions.pod: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:3215 ../fish/guestfish-actions.pod:3447 ../fish/guestfish-actions.pod:3610 ../fish/guestfish-actions.pod:3745 ../fish/guestfish-actions.pod:5116
6222 "This command has one or more optional arguments. See L</OPTIONAL "
6227 #: ../fish/guestfish-actions.pod:127
6232 #: ../fish/guestfish-actions.pod:129
6235 " add-drive filename\n"
6240 #: ../fish/guestfish-actions.pod:131
6242 "This function is the equivalent of calling L</add-drive-opts> with no "
6243 "optional parameters, so the disk is added writable, with the format being "
6244 "detected automatically."
6248 #: ../fish/guestfish-actions.pod:135
6250 "Automatic detection of the format opens you up to a potential security hole "
6251 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6252 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
6253 "you should think about replacing calls to this function with calls to "
6254 "L</add-drive-opts>, and specifying the format."
6258 #: ../fish/guestfish-actions.pod:142
6259 msgid "add-drive-opts"
6263 #: ../fish/guestfish-actions.pod:144
6268 #: ../fish/guestfish-actions.pod:146
6271 " add-drive-opts filename [readonly:true|false] [format:..] [iface:..] "
6277 #: ../fish/guestfish-actions.pod:148 ../src/guestfs-actions.pod:208
6279 "This function adds a virtual machine disk image C<filename> to libguestfs. "
6280 "The first time you call this function, the disk appears as C</dev/sda>, the "
6281 "second time as C</dev/sdb>, and so on."
6285 #: ../fish/guestfish-actions.pod:153 ../src/guestfs-actions.pod:213
6287 "You don't necessarily need to be root when using libguestfs. However you "
6288 "obviously do need sufficient permissions to access the filename for whatever "
6289 "operations you want to perform (ie. read access if you just want to read the "
6290 "image or write access if you want to modify the image)."
6294 #: ../fish/guestfish-actions.pod:159 ../src/guestfs-actions.pod:219
6295 msgid "This call checks that C<filename> exists."
6299 #: ../fish/guestfish-actions.pod:161 ../fish/guestfish-actions.pod:3409 ../src/guestfs-actions.pod:221 ../src/guestfs-actions.pod:5285
6300 msgid "The optional arguments are:"
6304 #: ../fish/guestfish-actions.pod:165 ../src/guestfs-actions.pod:225
6309 #: ../fish/guestfish-actions.pod:167 ../src/guestfs-actions.pod:227
6311 "If true then the image is treated as read-only. Writes are still allowed, "
6312 "but they are stored in a temporary snapshot overlay which is discarded at "
6313 "the end. The disk that you add is not modified."
6317 #: ../fish/guestfish-actions.pod:171 ../src/guestfs-actions.pod:231
6322 #: ../fish/guestfish-actions.pod:173
6324 "This forces the image format. If you omit this (or use L</add-drive> or "
6325 "L</add-drive-ro>) then the format is automatically detected. Possible "
6326 "formats include C<raw> and C<qcow2>."
6330 #: ../fish/guestfish-actions.pod:177 ../src/guestfs-actions.pod:237
6332 "Automatic detection of the format opens you up to a potential security hole "
6333 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
6334 "RHBZ#642934. Specifying the format closes this security hole."
6338 #: ../fish/guestfish-actions.pod:182 ../src/guestfs-actions.pod:242
6343 #: ../fish/guestfish-actions.pod:184
6345 "This rarely-used option lets you emulate the behaviour of the deprecated "
6346 "L</add-drive-with-if> call (q.v.)"
6350 #: ../fish/guestfish-actions.pod:187 ../fish/guestfish-actions.pod:3242 ../src/guestfs-actions.pod:247 ../src/guestfs-actions.pod:4996
6355 #: ../fish/guestfish-actions.pod:189 ../src/guestfs-actions.pod:249
6357 "The name the drive had in the original guest, e.g. /dev/sdb. This is used as "
6358 "a hint to the guest inspection process if it is available."
6362 #: ../fish/guestfish-actions.pod:196
6363 msgid "add-drive-ro"
6367 #: ../fish/guestfish-actions.pod:198
6372 #: ../fish/guestfish-actions.pod:200
6375 " add-drive-ro filename\n"
6380 #: ../fish/guestfish-actions.pod:202
6382 "This function is the equivalent of calling L</add-drive-opts> with the "
6383 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
6384 "is added read-only, with the format being detected automatically."
6388 #: ../fish/guestfish-actions.pod:207
6389 msgid "add-drive-ro-with-if"
6393 #: ../fish/guestfish-actions.pod:209
6396 " add-drive-ro-with-if filename iface\n"
6401 #: ../fish/guestfish-actions.pod:211
6403 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
6404 "interface emulation to use at run time."
6408 #: ../fish/guestfish-actions.pod:221
6409 msgid "add-drive-with-if"
6413 #: ../fish/guestfish-actions.pod:223
6416 " add-drive-with-if filename iface\n"
6421 #: ../fish/guestfish-actions.pod:225
6423 "This is the same as L</add-drive> but it allows you to specify the QEMU "
6424 "interface emulation to use at run time."
6428 #: ../fish/guestfish-actions.pod:235
6433 #: ../fish/guestfish-actions.pod:237
6436 " aug-clear augpath\n"
6441 #: ../fish/guestfish-actions.pod:239 ../src/guestfs-actions.pod:343
6443 "Set the value associated with C<path> to C<NULL>. This is the same as the "
6444 "L<augtool(1)> C<clear> command."
6448 #: ../fish/guestfish-actions.pod:242
6453 #: ../fish/guestfish-actions.pod:244
6461 #: ../fish/guestfish-actions.pod:246
6463 "Close the current Augeas handle and free up any resources used by it. After "
6464 "calling this, you have to call L</aug-init> again before you can use any "
6465 "other Augeas functions."
6469 #: ../fish/guestfish-actions.pod:251
6474 #: ../fish/guestfish-actions.pod:253
6477 " aug-defnode name expr val\n"
6482 #: ../fish/guestfish-actions.pod:255 ../src/guestfs-actions.pod:372
6483 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
6487 #: ../fish/guestfish-actions.pod:258
6489 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
6490 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
6491 "containing that single node."
6495 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:379
6497 "On success this returns a pair containing the number of nodes in the "
6498 "nodeset, and a boolean flag if a node was created."
6502 #: ../fish/guestfish-actions.pod:266
6507 #: ../fish/guestfish-actions.pod:268
6510 " aug-defvar name expr\n"
6515 #: ../fish/guestfish-actions.pod:270 ../src/guestfs-actions.pod:396
6517 "Defines an Augeas variable C<name> whose value is the result of evaluating "
6518 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
6522 #: ../fish/guestfish-actions.pod:274 ../src/guestfs-actions.pod:400
6524 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
6525 "evaluates to something which is not a nodeset."
6529 #: ../fish/guestfish-actions.pod:277
6534 #: ../fish/guestfish-actions.pod:279
6537 " aug-get augpath\n"
6542 #: ../fish/guestfish-actions.pod:281 ../src/guestfs-actions.pod:413
6544 "Look up the value associated with C<path>. If C<path> matches exactly one "
6545 "node, the C<value> is returned."
6549 #: ../fish/guestfish-actions.pod:284
6554 #: ../fish/guestfish-actions.pod:286
6557 " aug-init root flags\n"
6562 #: ../fish/guestfish-actions.pod:288 ../src/guestfs-actions.pod:428
6564 "Create a new Augeas handle for editing configuration files. If there was "
6565 "any previous Augeas handle associated with this guestfs session, then it is "
6570 #: ../fish/guestfish-actions.pod:292
6571 msgid "You must call this before using any other L</aug-*> commands."
6575 #: ../fish/guestfish-actions.pod:295 ../src/guestfs-actions.pod:435
6576 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
6580 #: ../fish/guestfish-actions.pod:298 ../src/guestfs-actions.pod:438
6582 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
6583 "logical I<or> of the following integers:"
6587 #: ../fish/guestfish-actions.pod:304 ../src/guestfs-actions.pod:444
6588 msgid "C<AUG_SAVE_BACKUP> = 1"
6592 #: ../fish/guestfish-actions.pod:306 ../src/guestfs-actions.pod:446
6593 msgid "Keep the original file with a C<.augsave> extension."
6597 #: ../fish/guestfish-actions.pod:308 ../src/guestfs-actions.pod:448
6598 msgid "C<AUG_SAVE_NEWFILE> = 2"
6602 #: ../fish/guestfish-actions.pod:310 ../src/guestfs-actions.pod:450
6604 "Save changes into a file with extension C<.augnew>, and do not overwrite "
6605 "original. Overrides C<AUG_SAVE_BACKUP>."
6609 #: ../fish/guestfish-actions.pod:313 ../src/guestfs-actions.pod:453
6610 msgid "C<AUG_TYPE_CHECK> = 4"
6614 #: ../fish/guestfish-actions.pod:315 ../src/guestfs-actions.pod:455
6615 msgid "Typecheck lenses."
6619 #: ../fish/guestfish-actions.pod:317
6621 "This option is only useful when debugging Augeas lenses. Use of this option "
6622 "may require additional memory for the libguestfs appliance. You may need to "
6623 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
6627 #: ../fish/guestfish-actions.pod:322 ../src/guestfs-actions.pod:462
6628 msgid "C<AUG_NO_STDINC> = 8"
6632 #: ../fish/guestfish-actions.pod:324 ../src/guestfs-actions.pod:464
6633 msgid "Do not use standard load path for modules."
6637 #: ../fish/guestfish-actions.pod:326 ../src/guestfs-actions.pod:466
6638 msgid "C<AUG_SAVE_NOOP> = 16"
6642 #: ../fish/guestfish-actions.pod:328 ../src/guestfs-actions.pod:468
6643 msgid "Make save a no-op, just record what would have been changed."
6647 #: ../fish/guestfish-actions.pod:330 ../src/guestfs-actions.pod:470
6648 msgid "C<AUG_NO_LOAD> = 32"
6652 #: ../fish/guestfish-actions.pod:332
6653 msgid "Do not load the tree in L</aug-init>."
6657 #: ../fish/guestfish-actions.pod:336
6658 msgid "To close the handle, you can call L</aug-close>."
6662 #: ../fish/guestfish-actions.pod:338 ../src/guestfs-actions.pod:478
6663 msgid "To find out more about Augeas, see L<http://augeas.net/>."
6667 #: ../fish/guestfish-actions.pod:340
6672 #: ../fish/guestfish-actions.pod:342
6675 " aug-insert augpath label true|false\n"
6680 #: ../fish/guestfish-actions.pod:344 ../src/guestfs-actions.pod:492
6682 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
6683 "or after C<path> (depending on the boolean flag C<before>)."
6687 #: ../fish/guestfish-actions.pod:348 ../src/guestfs-actions.pod:496
6689 "C<path> must match exactly one existing node in the tree, and C<label> must "
6690 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
6694 #: ../fish/guestfish-actions.pod:352
6699 #: ../fish/guestfish-actions.pod:354
6707 #: ../fish/guestfish-actions.pod:356 ../src/guestfs-actions.pod:509
6708 msgid "Load files into the tree."
6712 #: ../fish/guestfish-actions.pod:358 ../src/guestfs-actions.pod:511
6713 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
6717 #: ../fish/guestfish-actions.pod:361
6722 #: ../fish/guestfish-actions.pod:363
6730 #: ../fish/guestfish-actions.pod:365
6732 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
6733 "resulting nodes into alphabetical order."
6737 #: ../fish/guestfish-actions.pod:368
6742 #: ../fish/guestfish-actions.pod:370
6745 " aug-match augpath\n"
6750 #: ../fish/guestfish-actions.pod:372 ../src/guestfs-actions.pod:539
6752 "Returns a list of paths which match the path expression C<path>. The "
6753 "returned paths are sufficiently qualified so that they match exactly one "
6754 "node in the current tree."
6758 #: ../fish/guestfish-actions.pod:376
6763 #: ../fish/guestfish-actions.pod:378
6766 " aug-mv src dest\n"
6771 #: ../fish/guestfish-actions.pod:380 ../src/guestfs-actions.pod:556
6773 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
6774 "C<dest> is overwritten if it exists."
6778 #: ../fish/guestfish-actions.pod:383
6783 #: ../fish/guestfish-actions.pod:385
6791 #: ../fish/guestfish-actions.pod:387 ../src/guestfs-actions.pod:569
6792 msgid "Remove C<path> and all of its children."
6796 #: ../fish/guestfish-actions.pod:389 ../src/guestfs-actions.pod:571
6797 msgid "On success this returns the number of entries which were removed."
6801 #: ../fish/guestfish-actions.pod:391
6806 #: ../fish/guestfish-actions.pod:393
6814 #: ../fish/guestfish-actions.pod:395 ../src/guestfs-actions.pod:582
6815 msgid "This writes all pending changes to disk."
6819 #: ../fish/guestfish-actions.pod:397
6821 "The flags which were passed to L</aug-init> affect exactly how files are "
6826 #: ../fish/guestfish-actions.pod:400
6831 #: ../fish/guestfish-actions.pod:402
6834 " aug-set augpath val\n"
6839 #: ../fish/guestfish-actions.pod:404 ../src/guestfs-actions.pod:598
6840 msgid "Set the value associated with C<path> to C<val>."
6844 #: ../fish/guestfish-actions.pod:406
6846 "In the Augeas API, it is possible to clear a node by setting the value to "
6847 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
6848 "this call. Instead you must use the L</aug-clear> call."
6852 #: ../fish/guestfish-actions.pod:411
6857 #: ../fish/guestfish-actions.pod:413
6860 " available 'groups ...'\n"
6865 #: ../fish/guestfish-actions.pod:415 ../src/guestfs-actions.pod:615
6867 "This command is used to check the availability of some groups of "
6868 "functionality in the appliance, which not all builds of the libguestfs "
6869 "appliance will be able to provide."
6873 #: ../fish/guestfish-actions.pod:419
6875 "The libguestfs groups, and the functions that those groups correspond to, "
6876 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6877 "runtime by calling L</available-all-groups>."
6881 #: ../fish/guestfish-actions.pod:424 ../src/guestfs-actions.pod:624
6883 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
6884 "\"augeas\"]> would check for the availability of the Linux inotify functions "
6885 "and Augeas (configuration file editing) functions."
6889 #: ../fish/guestfish-actions.pod:429 ../src/guestfs-actions.pod:629
6890 msgid "The command returns no error if I<all> requested groups are available."
6894 #: ../fish/guestfish-actions.pod:431 ../src/guestfs-actions.pod:631
6896 "It fails with an error if one or more of the requested groups is unavailable "
6901 #: ../fish/guestfish-actions.pod:434 ../src/guestfs-actions.pod:634
6903 "If an unknown group name is included in the list of groups then an error is "
6908 #: ../fish/guestfish-actions.pod:437 ../src/guestfs-actions.pod:637
6913 #: ../fish/guestfish-actions.pod:443
6914 msgid "You must call L</launch> before calling this function."
6918 #: ../fish/guestfish-actions.pod:445 ../src/guestfs-actions.pod:645
6920 "The reason is because we don't know what groups are supported by the "
6921 "appliance/daemon until it is running and can be queried."
6925 #: ../fish/guestfish-actions.pod:451 ../src/guestfs-actions.pod:651
6927 "If a group of functions is available, this does not necessarily mean that "
6928 "they will work. You still have to check for errors when calling individual "
6929 "API functions even if they are available."
6933 #: ../fish/guestfish-actions.pod:458 ../src/guestfs-actions.pod:658
6935 "It is usually the job of distro packagers to build complete functionality "
6936 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6937 "with all requirements satisfied, will support everything."
6941 #: ../fish/guestfish-actions.pod:465
6943 "This call was added in version C<1.0.80>. In previous versions of "
6944 "libguestfs all you could do would be to speculatively execute a command to "
6945 "find out if the daemon implemented it. See also L</version>."
6949 #: ../fish/guestfish-actions.pod:472
6950 msgid "available-all-groups"
6954 #: ../fish/guestfish-actions.pod:474
6957 " available-all-groups\n"
6962 #: ../fish/guestfish-actions.pod:476
6964 "This command returns a list of all optional groups that this daemon knows "
6965 "about. Note this returns both supported and unsupported groups. To find "
6966 "out which ones the daemon can actually support you have to call "
6967 "L</available> on each member of the returned list."
6971 #: ../fish/guestfish-actions.pod:482
6972 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6976 #: ../fish/guestfish-actions.pod:484
6981 #: ../fish/guestfish-actions.pod:486
6984 " base64-in (base64file|-) filename\n"
6989 #: ../fish/guestfish-actions.pod:488 ../src/guestfs-actions.pod:702
6990 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
6994 #: ../fish/guestfish-actions.pod:491 ../fish/guestfish-actions.pod:500 ../fish/guestfish-actions.pod: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:4972 ../fish/guestfish-actions.pod:4984 ../fish/guestfish-actions.pod:4995 ../fish/guestfish-actions.pod:5006 ../fish/guestfish-actions.pod:5137 ../fish/guestfish-actions.pod:5146 ../fish/guestfish-actions.pod:5200 ../fish/guestfish-actions.pod:5223
6995 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6999 #: ../fish/guestfish-actions.pod:493
7004 #: ../fish/guestfish-actions.pod:495
7007 " base64-out filename (base64file|-)\n"
7012 #: ../fish/guestfish-actions.pod:497 ../src/guestfs-actions.pod:716
7014 "This command downloads the contents of C<filename>, writing it out to local "
7015 "file C<base64file> encoded as base64."
7019 #: ../fish/guestfish-actions.pod:502
7020 msgid "blockdev-flushbufs"
7024 #: ../fish/guestfish-actions.pod:504
7027 " blockdev-flushbufs device\n"
7032 #: ../fish/guestfish-actions.pod:506 ../src/guestfs-actions.pod:729
7033 msgid "This tells the kernel to flush internal buffers associated with C<device>."
7037 #: ../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
7038 msgid "This uses the L<blockdev(8)> command."
7042 #: ../fish/guestfish-actions.pod:511
7043 msgid "blockdev-getbsz"
7047 #: ../fish/guestfish-actions.pod:513
7050 " blockdev-getbsz device\n"
7055 #: ../fish/guestfish-actions.pod:515 ../src/guestfs-actions.pod:744
7056 msgid "This returns the block size of a device."
7060 #: ../fish/guestfish-actions.pod:517 ../fish/guestfish-actions.pod:580 ../src/guestfs-actions.pod:746 ../src/guestfs-actions.pod:846
7062 "(Note this is different from both I<size in blocks> and I<filesystem block "
7067 #: ../fish/guestfish-actions.pod:522
7068 msgid "blockdev-getro"
7072 #: ../fish/guestfish-actions.pod:524
7075 " blockdev-getro device\n"
7080 #: ../fish/guestfish-actions.pod:526 ../src/guestfs-actions.pod:761
7082 "Returns a boolean indicating if the block device is read-only (true if "
7083 "read-only, false if not)."
7087 #: ../fish/guestfish-actions.pod:531
7088 msgid "blockdev-getsize64"
7092 #: ../fish/guestfish-actions.pod:533
7095 " blockdev-getsize64 device\n"
7100 #: ../fish/guestfish-actions.pod:535 ../src/guestfs-actions.pod:776
7101 msgid "This returns the size of the device in bytes."
7105 #: ../fish/guestfish-actions.pod:537
7106 msgid "See also L</blockdev-getsz>."
7110 #: ../fish/guestfish-actions.pod:541
7111 msgid "blockdev-getss"
7115 #: ../fish/guestfish-actions.pod:543
7118 " blockdev-getss device\n"
7123 #: ../fish/guestfish-actions.pod:545 ../src/guestfs-actions.pod:792
7125 "This returns the size of sectors on a block device. Usually 512, but can be "
7126 "larger for modern devices."
7130 #: ../fish/guestfish-actions.pod:548
7131 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
7135 #: ../fish/guestfish-actions.pod:553
7136 msgid "blockdev-getsz"
7140 #: ../fish/guestfish-actions.pod:555
7143 " blockdev-getsz device\n"
7148 #: ../fish/guestfish-actions.pod:557 ../src/guestfs-actions.pod:810
7150 "This returns the size of the device in units of 512-byte sectors (even if "
7151 "the sectorsize isn't 512 bytes ... weird)."
7155 #: ../fish/guestfish-actions.pod:560
7157 "See also L</blockdev-getss> for the real sector size of the device, and "
7158 "L</blockdev-getsize64> for the more useful I<size in bytes>."
7162 #: ../fish/guestfish-actions.pod:566
7163 msgid "blockdev-rereadpt"
7167 #: ../fish/guestfish-actions.pod:568
7170 " blockdev-rereadpt device\n"
7175 #: ../fish/guestfish-actions.pod:570 ../src/guestfs-actions.pod:829
7176 msgid "Reread the partition table on C<device>."
7180 #: ../fish/guestfish-actions.pod:574
7181 msgid "blockdev-setbsz"
7185 #: ../fish/guestfish-actions.pod:576
7188 " blockdev-setbsz device blocksize\n"
7193 #: ../fish/guestfish-actions.pod:578 ../src/guestfs-actions.pod:844
7194 msgid "This sets the block size of a device."
7198 #: ../fish/guestfish-actions.pod:585
7199 msgid "blockdev-setro"
7203 #: ../fish/guestfish-actions.pod:587
7206 " blockdev-setro device\n"
7211 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:861
7212 msgid "Sets the block device named C<device> to read-only."
7216 #: ../fish/guestfish-actions.pod:593
7217 msgid "blockdev-setrw"
7221 #: ../fish/guestfish-actions.pod:595
7224 " blockdev-setrw device\n"
7229 #: ../fish/guestfish-actions.pod:597 ../src/guestfs-actions.pod:875
7230 msgid "Sets the block device named C<device> to read-write."
7234 #: ../fish/guestfish-actions.pod:601
7235 msgid "btrfs-filesystem-resize"
7239 #: ../fish/guestfish-actions.pod:603
7242 " btrfs-filesystem-resize mountpoint [size:N]\n"
7247 #: ../fish/guestfish-actions.pod:605 ../src/guestfs-actions.pod:897
7248 msgid "This command resizes a btrfs filesystem."
7252 #: ../fish/guestfish-actions.pod:607 ../src/guestfs-actions.pod:899
7254 "Note that unlike other resize calls, the filesystem has to be mounted and "
7255 "the parameter is the mountpoint not the device (this is a requirement of "
7260 #: ../fish/guestfish-actions.pod:611 ../fish/guestfish-actions.pod:3164 ../fish/guestfish-actions.pod:3720 ../fish/guestfish-actions.pod:5046 ../src/guestfs-actions.pod:903 ../src/guestfs-actions.pod:4892 ../src/guestfs-actions.pod:5809 ../src/guestfs-actions.pod:7785
7261 msgid "The optional parameters are:"
7265 #: ../fish/guestfish-actions.pod:615 ../fish/guestfish-actions.pod:3724 ../src/guestfs-actions.pod:907 ../src/guestfs-actions.pod:5813
7270 #: ../fish/guestfish-actions.pod:617 ../src/guestfs-actions.pod:909
7272 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
7273 "resized to the maximum size."
7277 #: ../fish/guestfish-actions.pod:622 ../src/guestfs-actions.pod:914
7278 msgid "See also L<btrfs(8)>."
7282 #: ../fish/guestfish-actions.pod:626
7283 msgid "case-sensitive-path"
7287 #: ../fish/guestfish-actions.pod:628
7290 " case-sensitive-path path\n"
7295 #: ../fish/guestfish-actions.pod:630 ../src/guestfs-actions.pod:948
7297 "This can be used to resolve case insensitive paths on a filesystem which is "
7298 "case sensitive. The use case is to resolve paths which you have read from "
7299 "Windows configuration files or the Windows Registry, to the true path."
7303 #: ../fish/guestfish-actions.pod:635 ../src/guestfs-actions.pod:953
7305 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
7306 "(and probably others), which is that although the underlying filesystem is "
7307 "case-insensitive, the driver exports the filesystem to Linux as "
7312 #: ../fish/guestfish-actions.pod:640 ../src/guestfs-actions.pod:958
7314 "One consequence of this is that special directories such as C<c:\\windows> "
7315 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
7316 "precise details of how they were created. In Windows itself this would not "
7321 #: ../fish/guestfish-actions.pod:646 ../src/guestfs-actions.pod:964
7323 "Bug or feature? You decide: "
7324 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
7328 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:967
7330 "This function resolves the true case of each element in the path and returns "
7331 "the case-sensitive path."
7335 #: ../fish/guestfish-actions.pod:652
7337 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
7338 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
7339 "how the directories were originally created under Windows)."
7343 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:975
7344 msgid "I<Note>: This function does not handle drive names, backslashes etc."
7348 #: ../fish/guestfish-actions.pod:660
7349 msgid "See also L</realpath>."
7353 #: ../fish/guestfish-actions.pod:662
7358 #: ../fish/guestfish-actions.pod:664
7366 #: ../fish/guestfish-actions.pod:666 ../fish/guestfish-actions.pod:4151 ../src/guestfs-actions.pod:991 ../src/guestfs-actions.pod:6469
7367 msgid "Return the contents of the file named C<path>."
7371 #: ../fish/guestfish-actions.pod:668
7373 "Note that this function cannot correctly handle binary files (specifically, "
7374 "files containing C<\\0> character which is treated as end of string). For "
7375 "those you need to use the L</read-file> or L</download> functions which have "
7376 "a more complex interface."
7380 #: ../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:4021 ../fish/guestfish-actions.pod:4036 ../fish/guestfish-actions.pod:4112 ../fish/guestfish-actions.pod:4129 ../fish/guestfish-actions.pod:4144 ../fish/guestfish-actions.pod:4813 ../fish/guestfish-actions.pod:4859 ../fish/guestfish-actions.pod:4944 ../fish/guestfish-actions.pod:4959 ../fish/guestfish-actions.pod:5444 ../fish/guestfish-actions.pod:5456 ../fish/guestfish-actions.pod:5474 ../fish/guestfish-actions.pod:5491 ../fish/guestfish-actions.pod:5501 ../fish/guestfish-actions.pod:5555 ../fish/guestfish-actions.pod:5565 ../fish/guestfish-actions.pod:5594 ../fish/guestfish-actions.pod:5604 ../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:6251 ../src/guestfs-actions.pod:6277 ../src/guestfs-actions.pod:6408 ../src/guestfs-actions.pod:6434 ../src/guestfs-actions.pod:6458 ../src/guestfs-actions.pod:7413 ../src/guestfs-actions.pod:7468 ../src/guestfs-actions.pod:7614 ../src/guestfs-actions.pod:7638 ../src/guestfs-actions.pod:8425 ../src/guestfs-actions.pod:8445 ../src/guestfs-actions.pod:8478 ../src/guestfs-actions.pod:8497 ../src/guestfs-actions.pod:8516 ../src/guestfs-actions.pod:8607 ../src/guestfs-actions.pod:8626 ../src/guestfs-actions.pod:8672 ../src/guestfs-actions.pod:8691
7382 "Because of the message protocol, there is a transfer limit of somewhere "
7383 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
7387 #: ../fish/guestfish-actions.pod:676
7392 #: ../fish/guestfish-actions.pod:678
7395 " checksum csumtype path\n"
7400 #: ../fish/guestfish-actions.pod:680 ../src/guestfs-actions.pod:1013
7401 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
7405 #: ../fish/guestfish-actions.pod:683 ../src/guestfs-actions.pod:1016
7407 "The type of checksum to compute is given by the C<csumtype> parameter which "
7408 "must have one of the following values:"
7412 #: ../fish/guestfish-actions.pod:688 ../src/guestfs-actions.pod:1021
7417 #: ../fish/guestfish-actions.pod:690 ../src/guestfs-actions.pod:1023
7419 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
7424 #: ../fish/guestfish-actions.pod:693 ../src/guestfs-actions.pod:1026
7429 #: ../fish/guestfish-actions.pod:695 ../src/guestfs-actions.pod:1028
7430 msgid "Compute the MD5 hash (using the C<md5sum> program)."
7434 #: ../fish/guestfish-actions.pod:697 ../src/guestfs-actions.pod:1030
7439 #: ../fish/guestfish-actions.pod:699 ../src/guestfs-actions.pod:1032
7440 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
7444 #: ../fish/guestfish-actions.pod:701 ../src/guestfs-actions.pod:1034
7449 #: ../fish/guestfish-actions.pod:703 ../src/guestfs-actions.pod:1036
7450 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
7454 #: ../fish/guestfish-actions.pod:705 ../src/guestfs-actions.pod:1038
7459 #: ../fish/guestfish-actions.pod:707 ../src/guestfs-actions.pod:1040
7460 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
7464 #: ../fish/guestfish-actions.pod:709 ../src/guestfs-actions.pod:1042
7469 #: ../fish/guestfish-actions.pod:711 ../src/guestfs-actions.pod:1044
7470 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
7474 #: ../fish/guestfish-actions.pod:713 ../src/guestfs-actions.pod:1046
7479 #: ../fish/guestfish-actions.pod:715 ../src/guestfs-actions.pod:1048
7480 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
7484 #: ../fish/guestfish-actions.pod:719 ../src/guestfs-actions.pod:1052
7485 msgid "The checksum is returned as a printable string."
7489 #: ../fish/guestfish-actions.pod:721
7490 msgid "To get the checksum for a device, use L</checksum-device>."
7494 #: ../fish/guestfish-actions.pod:723
7495 msgid "To get the checksums for many files, use L</checksums-out>."
7499 #: ../fish/guestfish-actions.pod:725
7500 msgid "checksum-device"
7504 #: ../fish/guestfish-actions.pod:727
7507 " checksum-device csumtype device\n"
7512 #: ../fish/guestfish-actions.pod:729
7514 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
7515 "device named C<device>. For the types of checksums supported see the "
7516 "L</checksum> command."
7520 #: ../fish/guestfish-actions.pod:733
7521 msgid "checksums-out"
7525 #: ../fish/guestfish-actions.pod:735
7528 " checksums-out csumtype directory (sumsfile|-)\n"
7533 #: ../fish/guestfish-actions.pod:737 ../src/guestfs-actions.pod:1087
7535 "This command computes the checksums of all regular files in C<directory> and "
7536 "then emits a list of those checksums to the local output file C<sumsfile>."
7540 #: ../fish/guestfish-actions.pod:741 ../src/guestfs-actions.pod:1091
7542 "This can be used for verifying the integrity of a virtual machine. However "
7543 "to be properly secure you should pay attention to the output of the checksum "
7544 "command (it uses the ones from GNU coreutils). In particular when the "
7545 "filename is not printable, coreutils uses a special backslash syntax. For "
7546 "more information, see the GNU coreutils info file."
7550 #: ../fish/guestfish-actions.pod:751
7555 #: ../fish/guestfish-actions.pod:753
7558 " chmod mode path\n"
7563 #: ../fish/guestfish-actions.pod:755 ../src/guestfs-actions.pod:1110
7565 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
7570 #: ../fish/guestfish-actions.pod:758 ../src/guestfs-actions.pod:1113
7572 "I<Note>: When using this command from guestfish, C<mode> by default would be "
7573 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
7578 #: ../fish/guestfish-actions.pod:762 ../fish/guestfish-actions.pod:3373 ../fish/guestfish-actions.pod:3512 ../fish/guestfish-actions.pod:3522 ../fish/guestfish-actions.pod:3532 ../src/guestfs-actions.pod:1117 ../src/guestfs-actions.pod:5216 ../src/guestfs-actions.pod:5425 ../src/guestfs-actions.pod:5444 ../src/guestfs-actions.pod:5463
7579 msgid "The mode actually set is affected by the umask."
7583 #: ../fish/guestfish-actions.pod:764
7588 #: ../fish/guestfish-actions.pod:766
7591 " chown owner group path\n"
7596 #: ../fish/guestfish-actions.pod:768 ../src/guestfs-actions.pod:1131
7597 msgid "Change the file owner to C<owner> and group to C<group>."
7601 #: ../fish/guestfish-actions.pod:770 ../fish/guestfish-actions.pod:2703 ../src/guestfs-actions.pod:1133 ../src/guestfs-actions.pod:4124
7603 "Only numeric uid and gid are supported. If you want to use names, you will "
7604 "need to locate and parse the password file yourself (Augeas support makes "
7605 "this relatively easy)."
7609 #: ../fish/guestfish-actions.pod:774
7614 #: ../fish/guestfish-actions.pod:776
7617 " command 'arguments ...'\n"
7622 #: ../fish/guestfish-actions.pod:778 ../src/guestfs-actions.pod:1147
7624 "This call runs a command from the guest filesystem. The filesystem must be "
7625 "mounted, and must contain a compatible operating system (ie. something "
7626 "Linux, with the same or compatible processor architecture)."
7630 #: ../fish/guestfish-actions.pod:783
7632 "The single parameter is an argv-style list of arguments. The first element "
7633 "is the name of the program to run. Subsequent elements are parameters. The "
7634 "list must be non-empty (ie. must contain a program name). Note that the "
7635 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
7639 #: ../fish/guestfish-actions.pod:790 ../src/guestfs-actions.pod:1159
7640 msgid "The return value is anything printed to I<stdout> by the command."
7644 #: ../fish/guestfish-actions.pod:793 ../src/guestfs-actions.pod:1162
7646 "If the command returns a non-zero exit status, then this function returns an "
7647 "error message. The error message string is the content of I<stderr> from "
7652 #: ../fish/guestfish-actions.pod:797 ../src/guestfs-actions.pod:1166
7654 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
7655 "C</bin>. If you require a program from another location, you should provide "
7656 "the full path in the first parameter."
7660 #: ../fish/guestfish-actions.pod:802 ../src/guestfs-actions.pod:1171
7662 "Shared libraries and data files required by the program must be available on "
7663 "filesystems which are mounted in the correct places. It is the caller's "
7664 "responsibility to ensure all filesystems that are needed are mounted at the "
7669 #: ../fish/guestfish-actions.pod:811
7670 msgid "command-lines"
7674 #: ../fish/guestfish-actions.pod:813
7677 " command-lines 'arguments ...'\n"
7682 #: ../fish/guestfish-actions.pod:815
7683 msgid "This is the same as L</command>, but splits the result into a list of lines."
7687 #: ../fish/guestfish-actions.pod:818
7688 msgid "See also: L</sh-lines>"
7692 #: ../fish/guestfish-actions.pod:823
7693 msgid "compress-device-out"
7697 #: ../fish/guestfish-actions.pod:825
7700 " compress-device-out ctype device (zdevice|-) [level:N]\n"
7705 #: ../fish/guestfish-actions.pod:827 ../src/guestfs-actions.pod:1221
7707 "This command compresses C<device> and writes it out to the local file "
7712 #: ../fish/guestfish-actions.pod:830
7714 "The C<ctype> and optional C<level> parameters have the same meaning as in "
7719 #: ../fish/guestfish-actions.pod:837
7720 msgid "compress-out"
7724 #: ../fish/guestfish-actions.pod:839
7727 " compress-out ctype file (zfile|-) [level:N]\n"
7732 #: ../fish/guestfish-actions.pod:841 ../src/guestfs-actions.pod:1273
7734 "This command compresses C<file> and writes it out to the local file "
7739 #: ../fish/guestfish-actions.pod:844 ../src/guestfs-actions.pod:1276
7741 "The compression program used is controlled by the C<ctype> parameter. "
7742 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
7743 "Some compression types may not be supported by particular builds of "
7744 "libguestfs, in which case you will get an error containing the substring "
7745 "\"not supported\"."
7749 #: ../fish/guestfish-actions.pod:850 ../src/guestfs-actions.pod:1282
7751 "The optional C<level> parameter controls compression level. The meaning and "
7752 "default for this parameter depends on the compression program being used."
7756 #: ../fish/guestfish-actions.pod:858
7761 #: ../fish/guestfish-actions.pod:860
7764 " config qemuparam qemuvalue\n"
7769 #: ../fish/guestfish-actions.pod:862 ../src/guestfs-actions.pod:1323
7771 "This can be used to add arbitrary qemu command line parameters of the form "
7772 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
7773 "setting some parameters which would interfere with parameters that we use."
7777 #: ../fish/guestfish-actions.pod:867 ../src/guestfs-actions.pod:1328
7778 msgid "The first character of C<param> string must be a C<-> (dash)."
7782 #: ../fish/guestfish-actions.pod:869 ../src/guestfs-actions.pod:1330
7783 msgid "C<value> can be NULL."
7787 #: ../fish/guestfish-actions.pod:871
7788 msgid "copy-device-to-device"
7792 #: ../fish/guestfish-actions.pod:873
7795 " copy-device-to-device src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7800 #: ../fish/guestfish-actions.pod:875
7802 "The four calls L</copy-device-to-device>, L</copy-device-to-file>, "
7803 "L</copy-file-to-device>, and L</copy-file-to-file> let you copy from a "
7804 "source (device|file) to a destination (device|file)."
7808 #: ../fish/guestfish-actions.pod:882 ../src/guestfs-actions.pod:1360
7810 "Partial copies can be made since you can specify optionally the source "
7811 "offset, destination offset and size to copy. These values are all specified "
7812 "in bytes. If not given, the offsets both default to zero, and the size "
7813 "defaults to copying as much as possible until we hit the end of the source."
7817 #: ../fish/guestfish-actions.pod:888 ../src/guestfs-actions.pod:1366
7819 "The source and destination may be the same object. However overlapping "
7820 "regions may not be copied correctly."
7824 #: ../fish/guestfish-actions.pod:891 ../src/guestfs-actions.pod:1369
7826 "If the destination is a file, it is created if required. If the destination "
7827 "file is not large enough, it is extended."
7831 #: ../fish/guestfish-actions.pod:896
7832 msgid "copy-device-to-file"
7836 #: ../fish/guestfish-actions.pod:898
7839 " copy-device-to-file src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7844 #: ../fish/guestfish-actions.pod:900 ../fish/guestfish-actions.pod:909 ../fish/guestfish-actions.pod:918
7845 msgid "See L</copy-device-to-device> for a general overview of this call."
7849 #: ../fish/guestfish-actions.pod:905
7850 msgid "copy-file-to-device"
7854 #: ../fish/guestfish-actions.pod:907
7857 " copy-file-to-device src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7862 #: ../fish/guestfish-actions.pod:914
7863 msgid "copy-file-to-file"
7867 #: ../fish/guestfish-actions.pod:916
7870 " copy-file-to-file src dest [srcoffset:N] [destoffset:N] [size:N]\n"
7875 #: ../fish/guestfish-actions.pod:921
7877 "This is B<not> the function you want for copying files. This is for copying "
7878 "blocks within existing files. See L</cp>, L</cp-a> and L</mv> for general "
7879 "file copying and moving functions."
7883 #: ../fish/guestfish-actions.pod:928
7888 #: ../fish/guestfish-actions.pod:930
7891 " copy-size src dest size\n"
7896 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1584
7898 "This command copies exactly C<size> bytes from one source device or file "
7899 "C<src> to another destination device or file C<dest>."
7903 #: ../fish/guestfish-actions.pod:935 ../src/guestfs-actions.pod:1587
7905 "Note this will fail if the source is too short or if the destination is not "
7910 #: ../fish/guestfish-actions.pod:938 ../fish/guestfish-actions.pod:973
7912 "I<This function is deprecated.> In new code, use the "
7913 "L</copy_device_to_device> call instead."
7917 #: ../fish/guestfish-actions.pod:945
7922 #: ../fish/guestfish-actions.pod:947
7930 #: ../fish/guestfish-actions.pod:949 ../src/guestfs-actions.pod:1606
7932 "This copies a file from C<src> to C<dest> where C<dest> is either a "
7933 "destination filename or destination directory."
7937 #: ../fish/guestfish-actions.pod:952
7942 #: ../fish/guestfish-actions.pod:954
7950 #: ../fish/guestfish-actions.pod:956 ../src/guestfs-actions.pod:1620
7952 "This copies a file or directory from C<src> to C<dest> recursively using the "
7957 #: ../fish/guestfish-actions.pod:959
7962 #: ../fish/guestfish-actions.pod:961
7970 #: ../fish/guestfish-actions.pod:963 ../src/guestfs-actions.pod:1641
7972 "This command copies from one source device or file C<src> to another "
7973 "destination device or file C<dest>. Normally you would use this to copy to "
7974 "or from a device or partition, for example to duplicate a filesystem."
7978 #: ../fish/guestfish-actions.pod:968
7980 "If the destination is a device, it must be as large or larger than the "
7981 "source file or device, otherwise the copy will fail. This command cannot do "
7982 "partial copies (see L</copy-device-to-device>)."
7986 #: ../fish/guestfish-actions.pod:980
7991 #: ../fish/guestfish-actions.pod:982
7999 #: ../fish/guestfish-actions.pod:984 ../src/guestfs-actions.pod:1660
8000 msgid "This command runs the C<df> command to report disk space used."
8004 #: ../fish/guestfish-actions.pod:986 ../fish/guestfish-actions.pod:997
8006 "This command is mostly useful for interactive sessions. It is I<not> "
8007 "intended that you try to parse the output string. Use L</statvfs> from "
8012 #: ../fish/guestfish-actions.pod:990
8017 #: ../fish/guestfish-actions.pod:992
8025 #: ../fish/guestfish-actions.pod:994 ../src/guestfs-actions.pod:1676
8027 "This command runs the C<df -h> command to report disk space used in "
8028 "human-readable format."
8032 #: ../fish/guestfish-actions.pod:1001
8037 #: ../fish/guestfish-actions.pod:1003
8045 #: ../fish/guestfish-actions.pod:1005 ../src/guestfs-actions.pod:1693
8047 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
8048 "This is sometimes useful for extended debugging of problems."
8052 #: ../fish/guestfish-actions.pod:1009
8054 "Another way to get the same information is to enable verbose messages with "
8055 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
8056 "before running the program."
8060 #: ../fish/guestfish-actions.pod:1014
8065 #: ../fish/guestfish-actions.pod:1016
8068 " download remotefilename (filename|-)\n"
8073 #: ../fish/guestfish-actions.pod:1018 ../fish/guestfish-actions.pod:1031 ../src/guestfs-actions.pod:1714 ../src/guestfs-actions.pod:1739
8075 "Download file C<remotefilename> and save it as C<filename> on the local "
8080 #: ../fish/guestfish-actions.pod:1021 ../fish/guestfish-actions.pod:5196 ../src/guestfs-actions.pod:1717 ../src/guestfs-actions.pod:7995
8081 msgid "C<filename> can also be a named pipe."
8085 #: ../fish/guestfish-actions.pod:1023
8086 msgid "See also L</upload>, L</cat>."
8090 #: ../fish/guestfish-actions.pod:1027
8091 msgid "download-offset"
8095 #: ../fish/guestfish-actions.pod:1029
8098 " download-offset remotefilename (filename|-) offset size\n"
8103 #: ../fish/guestfish-actions.pod:1034 ../src/guestfs-actions.pod:1742
8105 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
8106 "region must be within the file or device)."
8110 #: ../fish/guestfish-actions.pod:1037
8112 "Note that there is no limit on the amount of data that can be downloaded "
8113 "with this call, unlike with L</pread>, and this call always reads the full "
8114 "amount unless an error occurs."
8118 #: ../fish/guestfish-actions.pod:1042
8119 msgid "See also L</download>, L</pread>."
8123 #: ../fish/guestfish-actions.pod:1046
8128 #: ../fish/guestfish-actions.pod:1048
8131 " drop-caches whattodrop\n"
8136 #: ../fish/guestfish-actions.pod:1050 ../src/guestfs-actions.pod:1767
8138 "This instructs the guest kernel to drop its page cache, and/or dentries and "
8139 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
8140 "to drop, see L<http://linux-mm.org/Drop_Caches>"
8144 #: ../fish/guestfish-actions.pod:1055 ../src/guestfs-actions.pod:1772
8145 msgid "Setting C<whattodrop> to 3 should drop everything."
8149 #: ../fish/guestfish-actions.pod:1057 ../src/guestfs-actions.pod:1774
8151 "This automatically calls L<sync(2)> before the operation, so that the "
8152 "maximum guest memory is freed."
8156 #: ../fish/guestfish-actions.pod:1060
8161 #: ../fish/guestfish-actions.pod:1062
8169 #: ../fish/guestfish-actions.pod:1064 ../src/guestfs-actions.pod:1787
8171 "This command runs the C<du -s> command to estimate file space usage for "
8176 #: ../fish/guestfish-actions.pod:1067 ../src/guestfs-actions.pod:1790
8178 "C<path> can be a file or a directory. If C<path> is a directory then the "
8179 "estimate includes the contents of the directory and all subdirectories "
8184 #: ../fish/guestfish-actions.pod:1071 ../src/guestfs-actions.pod:1794
8185 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
8189 #: ../fish/guestfish-actions.pod:1074
8194 #: ../fish/guestfish-actions.pod:1076
8197 " e2fsck-f device\n"
8202 #: ../fish/guestfish-actions.pod:1078 ../src/guestfs-actions.pod:1812
8204 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
8205 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
8210 #: ../fish/guestfish-actions.pod:1082
8212 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
8213 "should use L</fsck>."
8217 #: ../fish/guestfish-actions.pod:1085
8222 #: ../fish/guestfish-actions.pod:1087
8225 " echo-daemon 'words ...'\n"
8230 #: ../fish/guestfish-actions.pod:1089 ../src/guestfs-actions.pod:1829
8232 "This command concatenates the list of C<words> passed with single spaces "
8233 "between them and returns the resulting string."
8237 #: ../fish/guestfish-actions.pod:1092 ../src/guestfs-actions.pod:1832
8238 msgid "You can use this command to test the connection through to the daemon."
8242 #: ../fish/guestfish-actions.pod:1094
8243 msgid "See also L</ping-daemon>."
8247 #: ../fish/guestfish-actions.pod:1096
8252 #: ../fish/guestfish-actions.pod:1098
8255 " egrep regex path\n"
8260 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1848
8261 msgid "This calls the external C<egrep> program and returns the matching lines."
8265 #: ../fish/guestfish-actions.pod:1106
8270 #: ../fish/guestfish-actions.pod:1108
8273 " egrepi regex path\n"
8278 #: ../fish/guestfish-actions.pod:1110 ../src/guestfs-actions.pod:1867
8279 msgid "This calls the external C<egrep -i> program and returns the matching lines."
8283 #: ../fish/guestfish-actions.pod:1116
8288 #: ../fish/guestfish-actions.pod:1118
8291 " equal file1 file2\n"
8296 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1886
8298 "This compares the two files C<file1> and C<file2> and returns true if their "
8299 "content is exactly equal, or false otherwise."
8303 #: ../fish/guestfish-actions.pod:1123 ../src/guestfs-actions.pod:1889
8304 msgid "The external L<cmp(1)> program is used for the comparison."
8308 #: ../fish/guestfish-actions.pod:1125
8313 #: ../fish/guestfish-actions.pod:1127
8321 #: ../fish/guestfish-actions.pod:1129 ../src/guestfs-actions.pod:1901
8323 "This returns C<true> if and only if there is a file, directory (or anything) "
8324 "with the given C<path> name."
8328 #: ../fish/guestfish-actions.pod:1132
8329 msgid "See also L</is-file>, L</is-dir>, L</stat>."
8333 #: ../fish/guestfish-actions.pod:1134
8338 #: ../fish/guestfish-actions.pod:1136
8341 " fallocate path len\n"
8346 #: ../fish/guestfish-actions.pod:1138 ../fish/guestfish-actions.pod:1157 ../src/guestfs-actions.pod:1924 ../src/guestfs-actions.pod:1943
8348 "This command preallocates a file (containing zero bytes) named C<path> of "
8349 "size C<len> bytes. If the file exists already, it is overwritten."
8353 #: ../fish/guestfish-actions.pod:1142 ../src/guestfs-actions.pod:1928
8355 "Do not confuse this with the guestfish-specific C<alloc> command which "
8356 "allocates a file in the host and attaches it as a device."
8360 #: ../fish/guestfish-actions.pod:1146
8362 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
8367 #: ../fish/guestfish-actions.pod:1153
8372 #: ../fish/guestfish-actions.pod:1155
8375 " fallocate64 path len\n"
8380 #: ../fish/guestfish-actions.pod:1161
8382 "Note that this call allocates disk blocks for the file. To create a sparse "
8383 "file use L</truncate-size> instead."
8387 #: ../fish/guestfish-actions.pod:1164
8389 "The deprecated call L</fallocate> does the same, but owing to an oversight "
8390 "it only allowed 30 bit lengths to be specified, effectively limiting the "
8391 "maximum size of files created through that call to 1GB."
8395 #: ../fish/guestfish-actions.pod:1169 ../src/guestfs-actions.pod:1955
8397 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
8398 "commands which create a file in the host and attach it as a device."
8402 #: ../fish/guestfish-actions.pod:1173
8407 #: ../fish/guestfish-actions.pod:1175
8410 " fgrep pattern path\n"
8415 #: ../fish/guestfish-actions.pod:1177 ../src/guestfs-actions.pod:1970
8416 msgid "This calls the external C<fgrep> program and returns the matching lines."
8420 #: ../fish/guestfish-actions.pod:1183
8425 #: ../fish/guestfish-actions.pod:1185
8428 " fgrepi pattern path\n"
8433 #: ../fish/guestfish-actions.pod:1187 ../src/guestfs-actions.pod:1989
8434 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
8438 #: ../fish/guestfish-actions.pod:1193
8443 #: ../fish/guestfish-actions.pod:1195
8451 #: ../fish/guestfish-actions.pod:1197 ../src/guestfs-actions.pod:2007
8453 "This call uses the standard L<file(1)> command to determine the type or "
8454 "contents of the file."
8458 #: ../fish/guestfish-actions.pod:1200 ../src/guestfs-actions.pod:2010
8460 "This call will also transparently look inside various types of compressed "
8465 #: ../fish/guestfish-actions.pod:1203 ../src/guestfs-actions.pod:2013
8467 "The exact command which runs is C<file -zb path>. Note in particular that "
8468 "the filename is not prepended to the output (the I<-b> option)."
8472 #: ../fish/guestfish-actions.pod:1207 ../src/guestfs-actions.pod:2017
8474 "The output depends on the output of the underlying L<file(1)> command and it "
8475 "can change in future in ways beyond our control. In other words, the output "
8476 "is not guaranteed by the ABI."
8480 #: ../fish/guestfish-actions.pod:1211
8482 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
8483 "(etc), L</is-zero>."
8487 #: ../fish/guestfish-actions.pod:1214
8488 msgid "file-architecture"
8492 #: ../fish/guestfish-actions.pod:1216
8495 " file-architecture filename\n"
8500 #: ../fish/guestfish-actions.pod:1218 ../src/guestfs-actions.pod:2035
8502 "This detects the architecture of the binary C<filename>, and returns it if "
8507 #: ../fish/guestfish-actions.pod:1221 ../src/guestfs-actions.pod:2038
8508 msgid "Currently defined architectures are:"
8512 #: ../fish/guestfish-actions.pod:1225 ../src/guestfs-actions.pod:2042
8517 #: ../fish/guestfish-actions.pod:1227 ../src/guestfs-actions.pod:2044
8519 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
8520 "irrespective of the precise processor requirements of the binary."
8524 #: ../fish/guestfish-actions.pod:1230 ../src/guestfs-actions.pod:2047
8529 #: ../fish/guestfish-actions.pod:1232 ../src/guestfs-actions.pod:2049
8530 msgid "64 bit x86-64."
8534 #: ../fish/guestfish-actions.pod:1234 ../src/guestfs-actions.pod:2051
8539 #: ../fish/guestfish-actions.pod:1236 ../src/guestfs-actions.pod:2053
8540 msgid "32 bit SPARC."
8544 #: ../fish/guestfish-actions.pod:1238 ../src/guestfs-actions.pod:2055
8549 #: ../fish/guestfish-actions.pod:1240 ../src/guestfs-actions.pod:2057
8550 msgid "64 bit SPARC V9 and above."
8554 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:2059
8559 #: ../fish/guestfish-actions.pod:1244 ../src/guestfs-actions.pod:2061
8560 msgid "Intel Itanium."
8564 #: ../fish/guestfish-actions.pod:1246 ../src/guestfs-actions.pod:2063
8569 #: ../fish/guestfish-actions.pod:1248 ../src/guestfs-actions.pod:2065
8570 msgid "32 bit Power PC."
8574 #: ../fish/guestfish-actions.pod:1250 ../src/guestfs-actions.pod:2067
8579 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:2069
8580 msgid "64 bit Power PC."
8584 #: ../fish/guestfish-actions.pod:1256 ../src/guestfs-actions.pod:2073
8585 msgid "Libguestfs may return other architecture strings in future."
8589 #: ../fish/guestfish-actions.pod:1258 ../src/guestfs-actions.pod:2075
8590 msgid "The function works on at least the following types of files:"
8594 #: ../fish/guestfish-actions.pod:1264 ../src/guestfs-actions.pod:2081
8595 msgid "many types of Un*x and Linux binary"
8599 #: ../fish/guestfish-actions.pod:1268 ../src/guestfs-actions.pod:2085
8600 msgid "many types of Un*x and Linux shared library"
8604 #: ../fish/guestfish-actions.pod:1272 ../src/guestfs-actions.pod:2089
8605 msgid "Windows Win32 and Win64 binaries"
8609 #: ../fish/guestfish-actions.pod:1276 ../src/guestfs-actions.pod:2093
8610 msgid "Windows Win32 and Win64 DLLs"
8614 #: ../fish/guestfish-actions.pod:1278 ../src/guestfs-actions.pod:2095
8615 msgid "Win32 binaries and DLLs return C<i386>."
8619 #: ../fish/guestfish-actions.pod:1280 ../src/guestfs-actions.pod:2097
8620 msgid "Win64 binaries and DLLs return C<x86_64>."
8624 #: ../fish/guestfish-actions.pod:1284 ../src/guestfs-actions.pod:2101
8625 msgid "Linux kernel modules"
8629 #: ../fish/guestfish-actions.pod:1288 ../src/guestfs-actions.pod:2105
8630 msgid "Linux new-style initrd images"
8634 #: ../fish/guestfish-actions.pod:1292 ../src/guestfs-actions.pod:2109
8635 msgid "some non-x86 Linux vmlinuz kernels"
8639 #: ../fish/guestfish-actions.pod:1296 ../src/guestfs-actions.pod:2113
8640 msgid "What it can't do currently:"
8644 #: ../fish/guestfish-actions.pod:1302 ../src/guestfs-actions.pod:2119
8645 msgid "static libraries (libfoo.a)"
8649 #: ../fish/guestfish-actions.pod:1306 ../src/guestfs-actions.pod:2123
8650 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
8654 #: ../fish/guestfish-actions.pod:1310 ../src/guestfs-actions.pod:2127
8655 msgid "x86 Linux vmlinuz kernels"
8659 #: ../fish/guestfish-actions.pod:1312 ../src/guestfs-actions.pod:2129
8661 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
8662 "compressed code, and are horribly hard to unpack. If you want to find the "
8663 "architecture of a kernel, use the architecture of the associated initrd or "
8664 "kernel module(s) instead."
8668 #: ../fish/guestfish-actions.pod:1319
8673 #: ../fish/guestfish-actions.pod:1321
8681 #: ../fish/guestfish-actions.pod:1323 ../src/guestfs-actions.pod:2147
8682 msgid "This command returns the size of C<file> in bytes."
8686 #: ../fish/guestfish-actions.pod:1325
8688 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
8689 "L</is-file> etc. To get the size of block devices, use "
8690 "L</blockdev-getsize64>."
8694 #: ../fish/guestfish-actions.pod:1329
8699 #: ../fish/guestfish-actions.pod:1331
8702 " fill c len path\n"
8707 #: ../fish/guestfish-actions.pod:1333 ../src/guestfs-actions.pod:2165
8709 "This command creates a new file called C<path>. The initial content of the "
8710 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
8715 #: ../fish/guestfish-actions.pod:1337
8717 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
8718 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
8723 #: ../fish/guestfish-actions.pod:1342
8724 msgid "fill-pattern"
8728 #: ../fish/guestfish-actions.pod:1344
8731 " fill-pattern pattern len path\n"
8736 #: ../fish/guestfish-actions.pod:1346
8738 "This function is like L</fill> except that it creates a new file of length "
8739 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
8740 "is truncated if necessary to ensure the length of the file is exactly C<len> "
8745 #: ../fish/guestfish-actions.pod:1351
8750 #: ../fish/guestfish-actions.pod:1353
8758 #: ../fish/guestfish-actions.pod:1355 ../src/guestfs-actions.pod:2211
8760 "This command lists out all files and directories, recursively, starting at "
8761 "C<directory>. It is essentially equivalent to running the shell command "
8762 "C<find directory -print> but some post-processing happens on the output, "
8767 #: ../fish/guestfish-actions.pod:1360 ../src/guestfs-actions.pod:2216
8769 "This returns a list of strings I<without any prefix>. Thus if the directory "
8774 #: ../fish/guestfish-actions.pod:1363 ../src/guestfs-actions.pod:2219
8784 #: ../fish/guestfish-actions.pod:1367
8785 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
8789 #: ../fish/guestfish-actions.pod:1370 ../src/guestfs-actions.pod:2226
8800 #: ../fish/guestfish-actions.pod:1375 ../src/guestfs-actions.pod:2231
8801 msgid "If C<directory> is not a directory, then this command returns an error."
8805 #: ../fish/guestfish-actions.pod:1378 ../src/guestfs-actions.pod:2234
8806 msgid "The returned list is sorted."
8810 #: ../fish/guestfish-actions.pod:1380
8811 msgid "See also L</find0>."
8815 #: ../fish/guestfish-actions.pod:1385
8820 #: ../fish/guestfish-actions.pod:1387
8823 " find0 directory (files|-)\n"
8828 #: ../fish/guestfish-actions.pod:1389 ../src/guestfs-actions.pod:2254
8830 "This command lists out all files and directories, recursively, starting at "
8831 "C<directory>, placing the resulting list in the external file called "
8836 #: ../fish/guestfish-actions.pod:1393
8837 msgid "This command works the same way as L</find> with the following exceptions:"
8841 #: ../fish/guestfish-actions.pod:1400 ../src/guestfs-actions.pod:2265
8842 msgid "The resulting list is written to an external file."
8846 #: ../fish/guestfish-actions.pod:1404 ../src/guestfs-actions.pod:2269
8848 "Items (filenames) in the result are separated by C<\\0> characters. See "
8849 "L<find(1)> option I<-print0>."
8853 #: ../fish/guestfish-actions.pod:1409 ../src/guestfs-actions.pod:2274
8854 msgid "This command is not limited in the number of names that it can return."
8858 #: ../fish/guestfish-actions.pod:1414 ../src/guestfs-actions.pod:2279
8859 msgid "The result list is not sorted."
8863 #: ../fish/guestfish-actions.pod:1420
8864 msgid "findfs-label"
8868 #: ../fish/guestfish-actions.pod:1422
8871 " findfs-label label\n"
8876 #: ../fish/guestfish-actions.pod:1424 ../src/guestfs-actions.pod:2293
8878 "This command searches the filesystems and returns the one which has the "
8879 "given label. An error is returned if no such filesystem can be found."
8883 #: ../fish/guestfish-actions.pod:1428
8884 msgid "To find the label of a filesystem, use L</vfs-label>."
8888 #: ../fish/guestfish-actions.pod:1430
8893 #: ../fish/guestfish-actions.pod:1432
8896 " findfs-uuid uuid\n"
8901 #: ../fish/guestfish-actions.pod:1434 ../src/guestfs-actions.pod:2310
8903 "This command searches the filesystems and returns the one which has the "
8904 "given UUID. An error is returned if no such filesystem can be found."
8908 #: ../fish/guestfish-actions.pod:1438
8909 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
8913 #: ../fish/guestfish-actions.pod:1440
8918 #: ../fish/guestfish-actions.pod:1442
8921 " fsck fstype device\n"
8926 #: ../fish/guestfish-actions.pod:1444 ../src/guestfs-actions.pod:2328
8928 "This runs the filesystem checker (fsck) on C<device> which should have "
8929 "filesystem type C<fstype>."
8933 #: ../fish/guestfish-actions.pod:1447 ../src/guestfs-actions.pod:2331
8935 "The returned integer is the status. See L<fsck(8)> for the list of status "
8936 "codes from C<fsck>."
8940 #: ../fish/guestfish-actions.pod:1456 ../src/guestfs-actions.pod:2340
8941 msgid "Multiple status codes can be summed together."
8945 #: ../fish/guestfish-actions.pod:1460 ../src/guestfs-actions.pod:2344
8947 "A non-zero return code can mean \"success\", for example if errors have been "
8948 "corrected on the filesystem."
8952 #: ../fish/guestfish-actions.pod:1465 ../src/guestfs-actions.pod:2349
8953 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
8957 #: ../fish/guestfish-actions.pod:1470 ../src/guestfs-actions.pod:2354
8958 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
8962 #: ../fish/guestfish-actions.pod:1472
8967 #: ../fish/guestfish-actions.pod:1474
8975 #: ../fish/guestfish-actions.pod:1476 ../src/guestfs-actions.pod:2365
8977 "Return the additional kernel options which are added to the guest kernel "
8982 #: ../fish/guestfish-actions.pod:1479 ../src/guestfs-actions.pod:2368
8983 msgid "If C<NULL> then no options are added."
8987 #: ../fish/guestfish-actions.pod:1481
8988 msgid "get-attach-method"
8992 #: ../fish/guestfish-actions.pod:1483
8995 " get-attach-method\n"
9000 #: ../fish/guestfish-actions.pod:1485
9001 msgid "Return the current attach method. See L</set-attach-method>."
9005 #: ../fish/guestfish-actions.pod:1487
9006 msgid "get-autosync"
9010 #: ../fish/guestfish-actions.pod:1489
9018 #: ../fish/guestfish-actions.pod:1491 ../src/guestfs-actions.pod:2393
9019 msgid "Get the autosync flag."
9023 #: ../fish/guestfish-actions.pod:1493
9028 #: ../fish/guestfish-actions.pod:1495
9036 #: ../fish/guestfish-actions.pod:1497 ../src/guestfs-actions.pod:2404
9037 msgid "Return the direct appliance mode flag."
9041 #: ../fish/guestfish-actions.pod:1499
9046 #: ../fish/guestfish-actions.pod:1501
9049 " get-e2label device\n"
9054 #: ../fish/guestfish-actions.pod:1503 ../src/guestfs-actions.pod:2423
9055 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
9059 #: ../fish/guestfish-actions.pod:1506
9061 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
9066 #: ../fish/guestfish-actions.pod:1513
9071 #: ../fish/guestfish-actions.pod:1515
9074 " get-e2uuid device\n"
9079 #: ../fish/guestfish-actions.pod:1517 ../src/guestfs-actions.pod:2444
9080 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
9084 #: ../fish/guestfish-actions.pod:1520
9086 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
9091 #: ../fish/guestfish-actions.pod:1527
9096 #: ../fish/guestfish-actions.pod:1529
9104 #: ../fish/guestfish-actions.pod:1531 ../src/guestfs-actions.pod:2457
9105 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
9109 #: ../fish/guestfish-actions.pod:1534
9111 "If L</set-memsize> was not called on this handle, and if "
9112 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
9113 "value for memsize."
9117 #: ../fish/guestfish-actions.pod:1538 ../fish/guestfish-actions.pod:1595 ../fish/guestfish-actions.pod:4474 ../fish/guestfish-actions.pod:4576 ../src/guestfs-actions.pod:2464 ../src/guestfs-actions.pod:2556 ../src/guestfs-actions.pod:6927 ../src/guestfs-actions.pod:7053
9118 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
9122 #: ../fish/guestfish-actions.pod:1541
9127 #: ../fish/guestfish-actions.pod:1543
9135 #: ../fish/guestfish-actions.pod:1545 ../src/guestfs-actions.pod:2476
9136 msgid "This returns the enable network flag."
9140 #: ../fish/guestfish-actions.pod:1547
9145 #: ../fish/guestfish-actions.pod:1549
9153 #: ../fish/guestfish-actions.pod:1551 ../src/guestfs-actions.pod:2487
9154 msgid "Return the current search path."
9158 #: ../fish/guestfish-actions.pod:1553 ../src/guestfs-actions.pod:2489
9160 "This is always non-NULL. If it wasn't set already, then this will return "
9165 #: ../fish/guestfish-actions.pod:1556
9170 #: ../fish/guestfish-actions.pod:1558
9178 #: ../fish/guestfish-actions.pod:1560 ../src/guestfs-actions.pod:2502
9179 msgid "This returns the process group flag."
9183 #: ../fish/guestfish-actions.pod:1562
9188 #: ../fish/guestfish-actions.pod:1564
9193 #: ../fish/guestfish-actions.pod:1566
9201 #: ../fish/guestfish-actions.pod:1568 ../src/guestfs-actions.pod:2513
9203 "Return the process ID of the qemu subprocess. If there is no qemu "
9204 "subprocess, then this will return an error."
9208 #: ../fish/guestfish-actions.pod:1571 ../src/guestfs-actions.pod:2516
9209 msgid "This is an internal call used for debugging and testing."
9213 #: ../fish/guestfish-actions.pod:1573
9218 #: ../fish/guestfish-actions.pod:1575
9226 #: ../fish/guestfish-actions.pod:1577 ../src/guestfs-actions.pod:2527
9227 msgid "Return the current qemu binary."
9231 #: ../fish/guestfish-actions.pod:1579 ../src/guestfs-actions.pod:2529
9233 "This is always non-NULL. If it wasn't set already, then this will return "
9234 "the default qemu binary name."
9238 #: ../fish/guestfish-actions.pod:1582
9239 msgid "get-recovery-proc"
9243 #: ../fish/guestfish-actions.pod:1584
9246 " get-recovery-proc\n"
9251 #: ../fish/guestfish-actions.pod:1586 ../src/guestfs-actions.pod:2542
9252 msgid "Return the recovery process enabled flag."
9256 #: ../fish/guestfish-actions.pod:1588
9261 #: ../fish/guestfish-actions.pod:1590
9269 #: ../fish/guestfish-actions.pod:1592
9271 "This returns the current setting of the selinux flag which is passed to the "
9272 "appliance at boot time. See L</set-selinux>."
9276 #: ../fish/guestfish-actions.pod:1598
9281 #: ../fish/guestfish-actions.pod:1600
9289 #: ../fish/guestfish-actions.pod:1602 ../src/guestfs-actions.pod:2568
9290 msgid "This returns the number of virtual CPUs assigned to the appliance."
9294 #: ../fish/guestfish-actions.pod:1604
9299 #: ../fish/guestfish-actions.pod:1606
9307 #: ../fish/guestfish-actions.pod:1608 ../src/guestfs-actions.pod:2579
9309 "This returns the current state as an opaque integer. This is only useful "
9310 "for printing debug and internal error messages."
9314 #: ../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
9315 msgid "For more information on states, see L<guestfs(3)>."
9319 #: ../fish/guestfish-actions.pod:1613
9324 #: ../fish/guestfish-actions.pod:1615
9332 #: ../fish/guestfish-actions.pod:1617 ../src/guestfs-actions.pod:2593
9333 msgid "Return the command trace flag."
9337 #: ../fish/guestfish-actions.pod:1619
9342 #: ../fish/guestfish-actions.pod:1621
9350 #: ../fish/guestfish-actions.pod:1623
9352 "Return the current umask. By default the umask is C<022> unless it has been "
9353 "set by calling L</umask>."
9357 #: ../fish/guestfish-actions.pod:1626
9362 #: ../fish/guestfish-actions.pod:1628
9370 #: ../fish/guestfish-actions.pod:1630 ../src/guestfs-actions.pod:2616
9371 msgid "This returns the verbose messages flag."
9375 #: ../fish/guestfish-actions.pod:1632
9380 #: ../fish/guestfish-actions.pod:1634
9388 #: ../fish/guestfish-actions.pod:1636 ../src/guestfs-actions.pod:2627
9389 msgid "This gets the SELinux security context of the daemon."
9393 #: ../fish/guestfish-actions.pod:1638
9394 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
9398 #: ../fish/guestfish-actions.pod:1641
9403 #: ../fish/guestfish-actions.pod:1643
9406 " getxattr path name\n"
9411 #: ../fish/guestfish-actions.pod:1645
9413 "Get a single extended attribute from file C<path> named C<name>. This call "
9414 "follows symlinks. If you want to lookup an extended attribute for the "
9415 "symlink itself, use L</lgetxattr>."
9419 #: ../fish/guestfish-actions.pod:1649 ../fish/guestfish-actions.pod:2715
9421 "Normally it is better to get all extended attributes from a file in one go "
9422 "by calling L</getxattrs>. However some Linux filesystem implementations are "
9423 "buggy and do not provide a way to list out attributes. For these "
9424 "filesystems (notably ntfs-3g) you have to know the names of the extended "
9425 "attributes you want in advance and call this function."
9429 #: ../fish/guestfish-actions.pod:1656 ../fish/guestfish-actions.pod:2722 ../src/guestfs-actions.pod:2656 ../src/guestfs-actions.pod:4151
9431 "Extended attribute values are blobs of binary data. If there is no extended "
9432 "attribute named C<name>, this returns an error."
9436 #: ../fish/guestfish-actions.pod:1659
9437 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
9441 #: ../fish/guestfish-actions.pod:1661
9446 #: ../fish/guestfish-actions.pod:1663
9454 #: ../fish/guestfish-actions.pod:1665 ../src/guestfs-actions.pod:2673
9455 msgid "This call lists the extended attributes of the file or directory C<path>."
9459 #: ../fish/guestfish-actions.pod:1668 ../src/guestfs-actions.pod:2676
9461 "At the system call level, this is a combination of the L<listxattr(2)> and "
9462 "L<getxattr(2)> calls."
9466 #: ../fish/guestfish-actions.pod:1671
9467 msgid "See also: L</lgetxattrs>, L<attr(5)>."
9471 #: ../fish/guestfish-actions.pod:1673
9476 #: ../fish/guestfish-actions.pod:1675
9479 " glob-expand pattern\n"
9484 #: ../fish/guestfish-actions.pod:1677 ../src/guestfs-actions.pod:2693
9486 "This command searches for all the pathnames matching C<pattern> according to "
9487 "the wildcard expansion rules used by the shell."
9491 #: ../fish/guestfish-actions.pod:1681 ../src/guestfs-actions.pod:2697
9492 msgid "If no paths match, then this returns an empty list (note: not an error)."
9496 #: ../fish/guestfish-actions.pod:1684 ../src/guestfs-actions.pod:2700
9498 "It is just a wrapper around the C L<glob(3)> function with flags "
9499 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
9503 #: ../fish/guestfish-actions.pod:1688
9508 #: ../fish/guestfish-actions.pod:1690
9511 " grep regex path\n"
9516 #: ../fish/guestfish-actions.pod:1692 ../src/guestfs-actions.pod:2717
9517 msgid "This calls the external C<grep> program and returns the matching lines."
9521 #: ../fish/guestfish-actions.pod:1698
9526 #: ../fish/guestfish-actions.pod:1700
9529 " grepi regex path\n"
9534 #: ../fish/guestfish-actions.pod:1702 ../src/guestfs-actions.pod:2736
9535 msgid "This calls the external C<grep -i> program and returns the matching lines."
9539 #: ../fish/guestfish-actions.pod:1708
9540 msgid "grub-install"
9544 #: ../fish/guestfish-actions.pod:1710
9547 " grub-install root device\n"
9552 #: ../fish/guestfish-actions.pod:1712 ../src/guestfs-actions.pod:2755
9554 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
9555 "with the root directory being C<root>."
9559 #: ../fish/guestfish-actions.pod:1721 ../src/guestfs-actions.pod:2764
9561 "There is currently no way in the API to install grub2, which is used by most "
9562 "modern Linux guests. It is possible to run the grub2 command from the "
9563 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
9567 #: ../fish/guestfish-actions.pod:1728 ../src/guestfs-actions.pod:2771
9569 "This uses C<grub-install> from the host. Unfortunately grub is not always "
9570 "compatible with itself, so this only works in rather narrow circumstances. "
9571 "Careful testing with each guest version is advisable."
9575 #: ../fish/guestfish-actions.pod:1735 ../src/guestfs-actions.pod:2778
9577 "If grub-install reports the error \"No suitable drive was found in the "
9578 "generated device map.\" it may be that you need to create a "
9579 "C</boot/grub/device.map> file first that contains the mapping between grub "
9580 "device names and Linux device names. It is usually sufficient to create a "
9585 #: ../fish/guestfish-actions.pod:1742 ../src/guestfs-actions.pod:2785
9593 #: ../fish/guestfish-actions.pod:1744 ../src/guestfs-actions.pod:2787
9594 msgid "replacing C</dev/vda> with the name of the installation device."
9598 #: ../fish/guestfish-actions.pod:1748
9603 #: ../fish/guestfish-actions.pod:1750
9611 #: ../fish/guestfish-actions.pod:1752 ../src/guestfs-actions.pod:2801
9613 "This command returns up to the first 10 lines of a file as a list of "
9618 #: ../fish/guestfish-actions.pod:1758
9623 #: ../fish/guestfish-actions.pod:1760
9626 " head-n nrlines path\n"
9631 #: ../fish/guestfish-actions.pod:1762 ../src/guestfs-actions.pod:2820
9633 "If the parameter C<nrlines> is a positive number, this returns the first "
9634 "C<nrlines> lines of the file C<path>."
9638 #: ../fish/guestfish-actions.pod:1765 ../src/guestfs-actions.pod:2823
9640 "If the parameter C<nrlines> is a negative number, this returns lines from "
9641 "the file C<path>, excluding the last C<nrlines> lines."
9645 #: ../fish/guestfish-actions.pod:1768 ../fish/guestfish-actions.pod:4957 ../src/guestfs-actions.pod:2826 ../src/guestfs-actions.pod:7632
9646 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
9650 #: ../fish/guestfish-actions.pod:1773
9655 #: ../fish/guestfish-actions.pod:1775
9663 #: ../fish/guestfish-actions.pod:1777 ../src/guestfs-actions.pod:2843
9665 "This runs C<hexdump -C> on the given C<path>. The result is the "
9666 "human-readable, canonical hex dump of the file."
9670 #: ../fish/guestfish-actions.pod:1783
9675 #: ../fish/guestfish-actions.pod:1785
9678 " initrd-cat initrdpath filename\n"
9683 #: ../fish/guestfish-actions.pod:1787 ../src/guestfs-actions.pod:2862
9685 "This command unpacks the file C<filename> from the initrd file called "
9686 "C<initrdpath>. The filename must be given I<without> the initial C</> "
9691 #: ../fish/guestfish-actions.pod:1791 ../src/guestfs-actions.pod:2866
9693 "For example, in guestfish you could use the following command to examine the "
9694 "boot script (usually called C</init>) contained in a Linux initrd or "
9699 #: ../fish/guestfish-actions.pod:1795 ../src/guestfs-actions.pod:2870
9702 " initrd-cat /boot/initrd-<version>.img init\n"
9707 #: ../fish/guestfish-actions.pod:1797
9708 msgid "See also L</initrd-list>."
9712 #: ../fish/guestfish-actions.pod:1802
9717 #: ../fish/guestfish-actions.pod:1804
9720 " initrd-list path\n"
9725 #: ../fish/guestfish-actions.pod:1806 ../src/guestfs-actions.pod:2889
9726 msgid "This command lists out files contained in an initrd."
9730 #: ../fish/guestfish-actions.pod:1808 ../src/guestfs-actions.pod:2891
9732 "The files are listed without any initial C</> character. The files are "
9733 "listed in the order they appear (not necessarily alphabetical). Directory "
9734 "names are listed as separate items."
9738 #: ../fish/guestfish-actions.pod:1812 ../src/guestfs-actions.pod:2895
9740 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
9741 "initrd. We I<only> support the newer initramfs format (compressed cpio "
9746 #: ../fish/guestfish-actions.pod:1816
9747 msgid "inotify-add-watch"
9751 #: ../fish/guestfish-actions.pod:1818
9754 " inotify-add-watch path mask\n"
9759 #: ../fish/guestfish-actions.pod:1820 ../src/guestfs-actions.pod:2912
9760 msgid "Watch C<path> for the events listed in C<mask>."
9764 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2914
9766 "Note that if C<path> is a directory then events within that directory are "
9767 "watched, but this does I<not> happen recursively (in subdirectories)."
9771 #: ../fish/guestfish-actions.pod:1826 ../src/guestfs-actions.pod:2918
9773 "Note for non-C or non-Linux callers: the inotify events are defined by the "
9774 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
9778 #: ../fish/guestfish-actions.pod:1830
9779 msgid "inotify-close"
9783 #: ../fish/guestfish-actions.pod:1832
9791 #: ../fish/guestfish-actions.pod:1834 ../src/guestfs-actions.pod:2931
9793 "This closes the inotify handle which was previously opened by inotify_init. "
9794 "It removes all watches, throws away any pending events, and deallocates all "
9799 #: ../fish/guestfish-actions.pod:1838
9800 msgid "inotify-files"
9804 #: ../fish/guestfish-actions.pod:1840
9812 #: ../fish/guestfish-actions.pod:1842
9814 "This function is a helpful wrapper around L</inotify-read> which just "
9815 "returns a list of pathnames of objects that were touched. The returned "
9816 "pathnames are sorted and deduplicated."
9820 #: ../fish/guestfish-actions.pod:1846
9821 msgid "inotify-init"
9825 #: ../fish/guestfish-actions.pod:1848
9828 " inotify-init maxevents\n"
9833 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2960
9835 "This command creates a new inotify handle. The inotify subsystem can be "
9836 "used to notify events which happen to objects in the guest filesystem."
9840 #: ../fish/guestfish-actions.pod:1854
9842 "C<maxevents> is the maximum number of events which will be queued up between "
9843 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
9844 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
9845 "default was 16384 events. Beyond this limit, the kernel throws away events, "
9846 "but records the fact that it threw them away by setting a flag "
9847 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
9851 #: ../fish/guestfish-actions.pod:1864
9853 "Before any events are generated, you have to add some watches to the "
9854 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
9855 "L</inotify-watch-all>."
9859 #: ../fish/guestfish-actions.pod:1870
9861 "Queued up events should be read periodically by calling L</inotify-read> (or "
9862 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
9863 "If you don't read the events out often enough then you risk the internal "
9864 "queue overflowing."
9868 #: ../fish/guestfish-actions.pod:1877
9870 "The handle should be closed after use by calling L</inotify-close>. This "
9871 "also removes any watches automatically."
9875 #: ../fish/guestfish-actions.pod:1881 ../src/guestfs-actions.pod:2991
9877 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
9878 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
9879 "that there is one global inotify handle per libguestfs instance."
9883 #: ../fish/guestfish-actions.pod:1886
9884 msgid "inotify-read"
9888 #: ../fish/guestfish-actions.pod:1888
9896 #: ../fish/guestfish-actions.pod:1890 ../src/guestfs-actions.pod:3005
9898 "Return the complete queue of events that have happened since the previous "
9903 #: ../fish/guestfish-actions.pod:1893 ../src/guestfs-actions.pod:3008
9904 msgid "If no events have happened, this returns an empty list."
9908 #: ../fish/guestfish-actions.pod:1895 ../src/guestfs-actions.pod:3010
9910 "I<Note>: In order to make sure that all events have been read, you must call "
9911 "this function repeatedly until it returns an empty list. The reason is that "
9912 "the call will read events up to the maximum appliance-to-host message size "
9913 "and leave remaining events in the queue."
9917 #: ../fish/guestfish-actions.pod:1901
9918 msgid "inotify-rm-watch"
9922 #: ../fish/guestfish-actions.pod:1903
9925 " inotify-rm-watch wd\n"
9930 #: ../fish/guestfish-actions.pod:1905
9931 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
9935 #: ../fish/guestfish-actions.pod:1908
9936 msgid "inspect-get-arch"
9940 #: ../fish/guestfish-actions.pod:1910
9943 " inspect-get-arch root\n"
9948 #: ../fish/guestfish-actions.pod:1912
9950 "This returns the architecture of the inspected operating system. The "
9951 "possible return values are listed under L</file-architecture>."
9955 #: ../fish/guestfish-actions.pod:1916 ../src/guestfs-actions.pod:3045
9957 "If the architecture could not be determined, then the string C<unknown> is "
9962 #: ../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
9963 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
9967 #: ../fish/guestfish-actions.pod:1921
9968 msgid "inspect-get-distro"
9972 #: ../fish/guestfish-actions.pod:1923
9975 " inspect-get-distro root\n"
9980 #: ../fish/guestfish-actions.pod:1925 ../src/guestfs-actions.pod:3061
9981 msgid "This returns the distro (distribution) of the inspected operating system."
9985 #: ../fish/guestfish-actions.pod:1928 ../src/guestfs-actions.pod:3064
9986 msgid "Currently defined distros are:"
9990 #: ../fish/guestfish-actions.pod:1932 ../src/guestfs-actions.pod:3068
9991 msgid "\"archlinux\""
9995 #: ../fish/guestfish-actions.pod:1934 ../src/guestfs-actions.pod:3070
10000 #: ../fish/guestfish-actions.pod:1936 ../src/guestfs-actions.pod:3072
10005 #: ../fish/guestfish-actions.pod:1938 ../src/guestfs-actions.pod:3074
10010 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:3076
10015 #: ../fish/guestfish-actions.pod:1942 ../src/guestfs-actions.pod:3078
10020 #: ../fish/guestfish-actions.pod:1944 ../src/guestfs-actions.pod:3080
10025 #: ../fish/guestfish-actions.pod:1946 ../src/guestfs-actions.pod:3082
10030 #: ../fish/guestfish-actions.pod:1948 ../src/guestfs-actions.pod:3084
10035 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:3086
10040 #: ../fish/guestfish-actions.pod:1952 ../src/guestfs-actions.pod:3088
10041 msgid "\"linuxmint\""
10045 #: ../fish/guestfish-actions.pod:1954 ../src/guestfs-actions.pod:3090
10046 msgid "Linux Mint."
10050 #: ../fish/guestfish-actions.pod:1956 ../src/guestfs-actions.pod:3092
10055 #: ../fish/guestfish-actions.pod:1958 ../src/guestfs-actions.pod:3094
10060 #: ../fish/guestfish-actions.pod:1960 ../src/guestfs-actions.pod:3096
10061 msgid "\"mandriva\""
10065 #: ../fish/guestfish-actions.pod:1962 ../src/guestfs-actions.pod:3098
10070 #: ../fish/guestfish-actions.pod:1964 ../src/guestfs-actions.pod:3100
10075 #: ../fish/guestfish-actions.pod:1966 ../src/guestfs-actions.pod:3102
10080 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:3104
10081 msgid "\"opensuse\""
10085 #: ../fish/guestfish-actions.pod:1970 ../src/guestfs-actions.pod:3106
10090 #: ../fish/guestfish-actions.pod:1972 ../src/guestfs-actions.pod:3108
10095 #: ../fish/guestfish-actions.pod:1974 ../src/guestfs-actions.pod:3110
10100 #: ../fish/guestfish-actions.pod:1976 ../src/guestfs-actions.pod:3112
10101 msgid "\"redhat-based\""
10105 #: ../fish/guestfish-actions.pod:1978 ../src/guestfs-actions.pod:3114
10106 msgid "Some Red Hat-derived distro."
10110 #: ../fish/guestfish-actions.pod:1980 ../src/guestfs-actions.pod:3116
10115 #: ../fish/guestfish-actions.pod:1982 ../src/guestfs-actions.pod:3118
10116 msgid "Red Hat Enterprise Linux."
10120 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:3120
10121 msgid "\"scientificlinux\""
10125 #: ../fish/guestfish-actions.pod:1986 ../src/guestfs-actions.pod:3122
10126 msgid "Scientific Linux."
10130 #: ../fish/guestfish-actions.pod:1988 ../src/guestfs-actions.pod:3124
10131 msgid "\"slackware\""
10135 #: ../fish/guestfish-actions.pod:1990 ../src/guestfs-actions.pod:3126
10140 #: ../fish/guestfish-actions.pod:1992 ../src/guestfs-actions.pod:3128
10141 msgid "\"ttylinux\""
10145 #: ../fish/guestfish-actions.pod:1994 ../src/guestfs-actions.pod:3130
10150 #: ../fish/guestfish-actions.pod:1996 ../src/guestfs-actions.pod:3132
10155 #: ../fish/guestfish-actions.pod:1998 ../src/guestfs-actions.pod:3134
10160 #: ../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
10161 msgid "\"unknown\""
10165 #: ../fish/guestfish-actions.pod:2002 ../src/guestfs-actions.pod:3138
10166 msgid "The distro could not be determined."
10170 #: ../fish/guestfish-actions.pod:2004 ../fish/guestfish-actions.pod:2341 ../src/guestfs-actions.pod:3140 ../src/guestfs-actions.pod:3613
10171 msgid "\"windows\""
10175 #: ../fish/guestfish-actions.pod:2006 ../src/guestfs-actions.pod:3142
10177 "Windows does not have distributions. This string is returned if the OS type "
10182 #: ../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
10184 "Future versions of libguestfs may return other strings here. The caller "
10185 "should be prepared to handle any string."
10189 #: ../fish/guestfish-actions.pod:2016
10190 msgid "inspect-get-drive-mappings"
10194 #: ../fish/guestfish-actions.pod:2018
10197 " inspect-get-drive-mappings root\n"
10202 #: ../fish/guestfish-actions.pod:2020 ../src/guestfs-actions.pod:3163
10204 "This call is useful for Windows which uses a primitive system of assigning "
10205 "drive letters (like \"C:\") to partitions. This inspection API examines the "
10206 "Windows Registry to find out how disks/partitions are mapped to drive "
10207 "letters, and returns a hash table as in the example below:"
10211 #: ../fish/guestfish-actions.pod:2026 ../src/guestfs-actions.pod:3169
10214 " C => /dev/vda2\n"
10215 " E => /dev/vdb1\n"
10216 " F => /dev/vdc1\n"
10221 #: ../fish/guestfish-actions.pod:2030 ../src/guestfs-actions.pod:3173
10223 "Note that keys are drive letters. For Windows, the key is case insensitive "
10224 "and just contains the drive letter, without the customary colon separator "
10229 #: ../fish/guestfish-actions.pod:2034 ../src/guestfs-actions.pod:3177
10231 "In future we may support other operating systems that also used drive "
10232 "letters, but the keys for those might not be case insensitive and might be "
10233 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
10238 #: ../fish/guestfish-actions.pod:2039 ../src/guestfs-actions.pod:3182
10240 "For Windows guests, currently only hard drive mappings are returned. "
10241 "Removable disks (eg. DVD-ROMs) are ignored."
10245 #: ../fish/guestfish-actions.pod:2042 ../src/guestfs-actions.pod:3185
10247 "For guests that do not use drive mappings, or if the drive mappings could "
10248 "not be determined, this returns an empty hash table."
10252 #: ../fish/guestfish-actions.pod:2045
10254 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10255 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
10259 #: ../fish/guestfish-actions.pod:2049
10260 msgid "inspect-get-filesystems"
10264 #: ../fish/guestfish-actions.pod:2051
10267 " inspect-get-filesystems root\n"
10272 #: ../fish/guestfish-actions.pod:2053 ../src/guestfs-actions.pod:3206
10274 "This returns a list of all the filesystems that we think are associated with "
10275 "this operating system. This includes the root filesystem, other ordinary "
10276 "filesystems, and non-mounted devices like swap partitions."
10280 #: ../fish/guestfish-actions.pod:2058 ../src/guestfs-actions.pod:3211
10282 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
10283 "to be shared between operating systems."
10287 #: ../fish/guestfish-actions.pod:2061
10289 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10290 "L</inspect-get-mountpoints>."
10294 #: ../fish/guestfish-actions.pod:2064
10295 msgid "inspect-get-format"
10299 #: ../fish/guestfish-actions.pod:2066
10302 " inspect-get-format root\n"
10307 #: ../fish/guestfish-actions.pod:2068 ../src/guestfs-actions.pod:3229
10309 "This returns the format of the inspected operating system. You can use it "
10310 "to detect install images, live CDs and similar."
10314 #: ../fish/guestfish-actions.pod:2071 ../src/guestfs-actions.pod:3232
10315 msgid "Currently defined formats are:"
10319 #: ../fish/guestfish-actions.pod:2075 ../src/guestfs-actions.pod:3236
10320 msgid "\"installed\""
10324 #: ../fish/guestfish-actions.pod:2077 ../src/guestfs-actions.pod:3238
10325 msgid "This is an installed operating system."
10329 #: ../fish/guestfish-actions.pod:2079 ../src/guestfs-actions.pod:3240
10330 msgid "\"installer\""
10334 #: ../fish/guestfish-actions.pod:2081 ../src/guestfs-actions.pod:3242
10336 "The disk image being inspected is not an installed operating system, but a "
10337 "I<bootable> install disk, live CD, or similar."
10341 #: ../fish/guestfish-actions.pod:2086 ../src/guestfs-actions.pod:3247
10342 msgid "The format of this disk image is not known."
10346 #: ../fish/guestfish-actions.pod:2095
10347 msgid "inspect-get-hostname"
10351 #: ../fish/guestfish-actions.pod:2097
10354 " inspect-get-hostname root\n"
10359 #: ../fish/guestfish-actions.pod:2099 ../src/guestfs-actions.pod:3267
10361 "This function returns the hostname of the operating system as found by "
10362 "inspection of the guest's configuration files."
10366 #: ../fish/guestfish-actions.pod:2102 ../src/guestfs-actions.pod:3270
10368 "If the hostname could not be determined, then the string C<unknown> is "
10373 #: ../fish/guestfish-actions.pod:2107
10374 msgid "inspect-get-icon"
10378 #: ../fish/guestfish-actions.pod:2109
10381 " inspect-get-icon root [favicon:true|false] [highquality:true|false]\n"
10386 #: ../fish/guestfish-actions.pod:2111 ../src/guestfs-actions.pod:3296
10388 "This function returns an icon corresponding to the inspected operating "
10389 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
10390 "to PNG if necessary)."
10394 #: ../fish/guestfish-actions.pod:2115 ../src/guestfs-actions.pod:3300
10396 "If it was not possible to get an icon this function returns a zero-length "
10397 "(non-NULL) buffer. I<Callers must check for this case>."
10401 #: ../fish/guestfish-actions.pod:2118 ../src/guestfs-actions.pod:3303
10403 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
10404 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
10405 "this file will be returned. You can disable favicons by passing the "
10406 "optional C<favicon> boolean as false (default is true)."
10410 #: ../fish/guestfish-actions.pod:2124 ../src/guestfs-actions.pod:3309
10412 "If finding the favicon fails, then we look in other places in the guest for "
10417 #: ../fish/guestfish-actions.pod:2127 ../src/guestfs-actions.pod:3312
10419 "If the optional C<highquality> boolean is true then only high quality icons "
10420 "are returned, which means only icons of high resolution with an alpha "
10421 "channel. The default (false) is to return any icon we can, even if it is of "
10422 "substandard quality."
10426 #: ../fish/guestfish-actions.pod:2138 ../src/guestfs-actions.pod:3323
10428 "Unlike most other inspection API calls, the guest's disks must be mounted up "
10429 "before you call this, since it needs to read information from the guest "
10430 "filesystem during the call."
10434 #: ../fish/guestfish-actions.pod:2144 ../src/guestfs-actions.pod:3329
10436 "B<Security:> The icon data comes from the untrusted guest, and should be "
10437 "treated with caution. PNG files have been known to contain exploits. "
10438 "Ensure that libpng (or other relevant libraries) are fully up to date before "
10439 "trying to process or display the icon."
10443 #: ../fish/guestfish-actions.pod:2152 ../src/guestfs-actions.pod:3337
10445 "The PNG image returned can be any size. It might not be square. Libguestfs "
10446 "tries to return the largest, highest quality icon available. The "
10447 "application must scale the icon to the required size."
10451 #: ../fish/guestfish-actions.pod:2159 ../src/guestfs-actions.pod:3344
10453 "Extracting icons from Windows guests requires the external C<wrestool> "
10454 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
10455 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
10456 "installed separately."
10460 #: ../fish/guestfish-actions.pod:2166 ../src/guestfs-actions.pod:3351
10462 "Operating system icons are usually trademarks. Seek legal advice before "
10463 "using trademarks in applications."
10467 #: ../fish/guestfish-actions.pod:2173
10468 msgid "inspect-get-major-version"
10472 #: ../fish/guestfish-actions.pod:2175
10475 " inspect-get-major-version root\n"
10480 #: ../fish/guestfish-actions.pod:2177 ../src/guestfs-actions.pod:3392
10481 msgid "This returns the major version number of the inspected operating system."
10485 #: ../fish/guestfish-actions.pod:2180 ../src/guestfs-actions.pod:3395
10487 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
10488 "popular public names used by the operating system. Notably the operating "
10489 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
10490 "1). You can find out the real versions corresponding to releases of Windows "
10491 "by consulting Wikipedia or MSDN."
10495 #: ../fish/guestfish-actions.pod:2187 ../fish/guestfish-actions.pod:2198 ../src/guestfs-actions.pod:3402 ../src/guestfs-actions.pod:3419
10496 msgid "If the version could not be determined, then C<0> is returned."
10500 #: ../fish/guestfish-actions.pod:2191
10501 msgid "inspect-get-minor-version"
10505 #: ../fish/guestfish-actions.pod:2193
10508 " inspect-get-minor-version root\n"
10513 #: ../fish/guestfish-actions.pod:2195 ../src/guestfs-actions.pod:3416
10514 msgid "This returns the minor version number of the inspected operating system."
10518 #: ../fish/guestfish-actions.pod:2200
10520 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10521 "L</inspect-get-major-version>."
10525 #: ../fish/guestfish-actions.pod:2203
10526 msgid "inspect-get-mountpoints"
10530 #: ../fish/guestfish-actions.pod:2205
10533 " inspect-get-mountpoints root\n"
10538 #: ../fish/guestfish-actions.pod:2207 ../src/guestfs-actions.pod:3434
10540 "This returns a hash of where we think the filesystems associated with this "
10541 "operating system should be mounted. Callers should note that this is at "
10542 "best an educated guess made by reading configuration files such as "
10543 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
10544 "are non-existent or not mountable and callers should be prepared to handle "
10545 "or ignore failures if they try to mount them."
10549 #: ../fish/guestfish-actions.pod:2216 ../src/guestfs-actions.pod:3443
10551 "Each element in the returned hashtable has a key which is the path of the "
10552 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
10553 "mounted there (eg. C</dev/sda1>)."
10557 #: ../fish/guestfish-actions.pod:2221 ../src/guestfs-actions.pod:3448
10558 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
10562 #: ../fish/guestfish-actions.pod:2224
10564 "For operating systems like Windows which still use drive letters, this call "
10565 "will only return an entry for the first drive \"mounted on\" C</>. For "
10566 "information about the mapping of drive letters to partitions, see "
10567 "L</inspect-get-drive-mappings>."
10571 #: ../fish/guestfish-actions.pod:2230
10573 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10574 "L</inspect-get-filesystems>."
10578 #: ../fish/guestfish-actions.pod:2233
10579 msgid "inspect-get-package-format"
10583 #: ../fish/guestfish-actions.pod:2235
10586 " inspect-get-package-format root\n"
10591 #: ../fish/guestfish-actions.pod:2237
10593 "This function and L</inspect-get-package-management> return the package "
10594 "format and package management tool used by the inspected operating system. "
10595 "For example for Fedora these functions would return C<rpm> (package format) "
10596 "and C<yum> (package management)."
10600 #: ../fish/guestfish-actions.pod:2243 ../src/guestfs-actions.pod:3480
10602 "This returns the string C<unknown> if we could not determine the package "
10603 "format I<or> if the operating system does not have a real packaging system "
10608 #: ../fish/guestfish-actions.pod:2247 ../src/guestfs-actions.pod:3484
10610 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
10611 "C<pkgsrc>. Future versions of libguestfs may return other strings."
10615 #: ../fish/guestfish-actions.pod:2253
10616 msgid "inspect-get-package-management"
10620 #: ../fish/guestfish-actions.pod:2255
10623 " inspect-get-package-management root\n"
10628 #: ../fish/guestfish-actions.pod:2257
10630 "L</inspect-get-package-format> and this function return the package format "
10631 "and package management tool used by the inspected operating system. For "
10632 "example for Fedora these functions would return C<rpm> (package format) and "
10633 "C<yum> (package management)."
10637 #: ../fish/guestfish-actions.pod:2263 ../src/guestfs-actions.pod:3507
10639 "This returns the string C<unknown> if we could not determine the package "
10640 "management tool I<or> if the operating system does not have a real packaging "
10641 "system (eg. Windows)."
10645 #: ../fish/guestfish-actions.pod:2267 ../src/guestfs-actions.pod:3511
10647 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
10648 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
10649 "versions of libguestfs may return other strings."
10653 #: ../fish/guestfish-actions.pod:2274
10654 msgid "inspect-get-product-name"
10658 #: ../fish/guestfish-actions.pod:2276
10661 " inspect-get-product-name root\n"
10666 #: ../fish/guestfish-actions.pod:2278 ../src/guestfs-actions.pod:3529
10668 "This returns the product name of the inspected operating system. The "
10669 "product name is generally some freeform string which can be displayed to the "
10670 "user, but should not be parsed by programs."
10674 #: ../fish/guestfish-actions.pod:2283 ../src/guestfs-actions.pod:3534
10676 "If the product name could not be determined, then the string C<unknown> is "
10681 #: ../fish/guestfish-actions.pod:2288
10682 msgid "inspect-get-product-variant"
10686 #: ../fish/guestfish-actions.pod:2290
10689 " inspect-get-product-variant root\n"
10694 #: ../fish/guestfish-actions.pod:2292 ../src/guestfs-actions.pod:3550
10695 msgid "This returns the product variant of the inspected operating system."
10699 #: ../fish/guestfish-actions.pod:2295 ../src/guestfs-actions.pod:3553
10701 "For Windows guests, this returns the contents of the Registry key "
10702 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
10703 "which is usually a string such as C<Client> or C<Server> (other values are "
10704 "possible). This can be used to distinguish consumer and enterprise versions "
10705 "of Windows that have the same version number (for example, Windows 7 and "
10706 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
10707 "the latter is C<Server>)."
10711 #: ../fish/guestfish-actions.pod:2304 ../src/guestfs-actions.pod:3562
10713 "For enterprise Linux guests, in future we intend this to return the product "
10714 "variant such as C<Desktop>, C<Server> and so on. But this is not "
10715 "implemented at present."
10719 #: ../fish/guestfish-actions.pod:2308 ../src/guestfs-actions.pod:3566
10721 "If the product variant could not be determined, then the string C<unknown> "
10726 #: ../fish/guestfish-actions.pod:2311
10728 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
10729 "L</inspect-get-product-name>, L</inspect-get-major-version>."
10733 #: ../fish/guestfish-actions.pod:2315
10734 msgid "inspect-get-roots"
10738 #: ../fish/guestfish-actions.pod:2317
10741 " inspect-get-roots\n"
10746 #: ../fish/guestfish-actions.pod:2319
10748 "This function is a convenient way to get the list of root devices, as "
10749 "returned from a previous call to L</inspect-os>, but without redoing the "
10750 "whole inspection process."
10754 #: ../fish/guestfish-actions.pod:2323
10756 "This returns an empty list if either no root devices were found or the "
10757 "caller has not called L</inspect-os>."
10761 #: ../fish/guestfish-actions.pod:2328
10762 msgid "inspect-get-type"
10766 #: ../fish/guestfish-actions.pod:2330
10769 " inspect-get-type root\n"
10774 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3604
10776 "This returns the type of the inspected operating system. Currently defined "
10781 #: ../fish/guestfish-actions.pod:2337 ../src/guestfs-actions.pod:3609
10786 #: ../fish/guestfish-actions.pod:2339 ../src/guestfs-actions.pod:3611
10787 msgid "Any Linux-based operating system."
10791 #: ../fish/guestfish-actions.pod:2343 ../src/guestfs-actions.pod:3615
10792 msgid "Any Microsoft Windows operating system."
10796 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3617
10797 msgid "\"freebsd\""
10801 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3619
10806 #: ../fish/guestfish-actions.pod:2349 ../src/guestfs-actions.pod:3621
10811 #: ../fish/guestfish-actions.pod:2351 ../src/guestfs-actions.pod:3623
10816 #: ../fish/guestfish-actions.pod:2355 ../src/guestfs-actions.pod:3627
10817 msgid "The operating system type could not be determined."
10821 #: ../fish/guestfish-actions.pod:2364
10822 msgid "inspect-get-windows-current-control-set"
10826 #: ../fish/guestfish-actions.pod:2366
10829 " inspect-get-windows-current-control-set root\n"
10834 #: ../fish/guestfish-actions.pod:2368 ../src/guestfs-actions.pod:3647
10836 "This returns the Windows CurrentControlSet of the inspected guest. The "
10837 "CurrentControlSet is a registry key name such as C<ControlSet001>."
10841 #: ../fish/guestfish-actions.pod:2371 ../src/guestfs-actions.pod:3650
10843 "This call assumes that the guest is Windows and that the Registry could be "
10844 "examined by inspection. If this is not the case then an error is returned."
10848 #: ../fish/guestfish-actions.pod:2377
10849 msgid "inspect-get-windows-systemroot"
10853 #: ../fish/guestfish-actions.pod:2379
10856 " inspect-get-windows-systemroot root\n"
10861 #: ../fish/guestfish-actions.pod:2381 ../src/guestfs-actions.pod:3667
10863 "This returns the Windows systemroot of the inspected guest. The systemroot "
10864 "is a directory path such as C</WINDOWS>."
10868 #: ../fish/guestfish-actions.pod:2384 ../src/guestfs-actions.pod:3670
10870 "This call assumes that the guest is Windows and that the systemroot could be "
10871 "determined by inspection. If this is not the case then an error is "
10876 #: ../fish/guestfish-actions.pod:2390
10877 msgid "inspect-is-live"
10881 #: ../fish/guestfish-actions.pod:2392
10884 " inspect-is-live root\n"
10889 #: ../fish/guestfish-actions.pod:2394
10891 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10892 "then this returns true if a live image was detected on the disk."
10896 #: ../fish/guestfish-actions.pod:2400
10897 msgid "inspect-is-multipart"
10901 #: ../fish/guestfish-actions.pod:2402
10904 " inspect-is-multipart root\n"
10909 #: ../fish/guestfish-actions.pod:2404
10911 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10912 "then this returns true if the disk is part of a set."
10916 #: ../fish/guestfish-actions.pod:2410
10917 msgid "inspect-is-netinst"
10921 #: ../fish/guestfish-actions.pod:2412
10924 " inspect-is-netinst root\n"
10929 #: ../fish/guestfish-actions.pod:2414
10931 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
10932 "then this returns true if the disk is a network installer, ie. not a "
10933 "self-contained install CD but one which is likely to require network access "
10934 "to complete the install."
10938 #: ../fish/guestfish-actions.pod:2422
10939 msgid "inspect-list-applications"
10943 #: ../fish/guestfish-actions.pod:2424
10946 " inspect-list-applications root\n"
10951 #: ../fish/guestfish-actions.pod:2426 ../src/guestfs-actions.pod:3737
10952 msgid "Return the list of applications installed in the operating system."
10956 #: ../fish/guestfish-actions.pod:2428
10958 "I<Note:> This call works differently from other parts of the inspection "
10959 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
10960 "then mount up the disks, before calling this. Listing applications is a "
10961 "significantly more difficult operation which requires access to the full "
10962 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
10963 "are just returning data cached in the libguestfs handle, this call actually "
10964 "reads parts of the mounted filesystems during the call."
10968 #: ../fish/guestfish-actions.pod:2438 ../src/guestfs-actions.pod:3749
10970 "This returns an empty list if the inspection code was not able to determine "
10971 "the list of applications."
10975 #: ../fish/guestfish-actions.pod:2441 ../src/guestfs-actions.pod:3752
10976 msgid "The application structure contains the following fields:"
10980 #: ../fish/guestfish-actions.pod:2445 ../src/guestfs-actions.pod:3756
10981 msgid "C<app_name>"
10985 #: ../fish/guestfish-actions.pod:2447 ../src/guestfs-actions.pod:3758
10987 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10988 "guests, this is the package name."
10992 #: ../fish/guestfish-actions.pod:2450 ../src/guestfs-actions.pod:3761
10993 msgid "C<app_display_name>"
10997 #: ../fish/guestfish-actions.pod:2452 ../src/guestfs-actions.pod:3763
10999 "The display name of the application, sometimes localized to the install "
11000 "language of the guest operating system."
11004 #: ../fish/guestfish-actions.pod:2455 ../src/guestfs-actions.pod:3766
11006 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
11007 "to display something can use C<app_name> instead."
11011 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3769
11012 msgid "C<app_epoch>"
11016 #: ../fish/guestfish-actions.pod:2460 ../src/guestfs-actions.pod:3771
11018 "For package managers which use epochs, this contains the epoch of the "
11019 "package (an integer). If unavailable, this is returned as C<0>."
11023 #: ../fish/guestfish-actions.pod:2463 ../src/guestfs-actions.pod:3774
11024 msgid "C<app_version>"
11028 #: ../fish/guestfish-actions.pod:2465 ../src/guestfs-actions.pod:3776
11030 "The version string of the application or package. If unavailable this is "
11031 "returned as an empty string C<\"\">."
11035 #: ../fish/guestfish-actions.pod:2468 ../src/guestfs-actions.pod:3779
11036 msgid "C<app_release>"
11040 #: ../fish/guestfish-actions.pod:2470 ../src/guestfs-actions.pod:3781
11042 "The release string of the application or package, for package managers that "
11043 "use this. If unavailable this is returned as an empty string C<\"\">."
11047 #: ../fish/guestfish-actions.pod:2474 ../src/guestfs-actions.pod:3785
11048 msgid "C<app_install_path>"
11052 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3787
11054 "The installation path of the application (on operating systems such as "
11055 "Windows which use installation paths). This path is in the format used by "
11056 "the guest operating system, it is not a libguestfs path."
11060 #: ../fish/guestfish-actions.pod:2481 ../src/guestfs-actions.pod:3792
11061 msgid "If unavailable this is returned as an empty string C<\"\">."
11065 #: ../fish/guestfish-actions.pod:2483 ../src/guestfs-actions.pod:3794
11066 msgid "C<app_trans_path>"
11070 #: ../fish/guestfish-actions.pod:2485 ../src/guestfs-actions.pod:3796
11072 "The install path translated into a libguestfs path. If unavailable this is "
11073 "returned as an empty string C<\"\">."
11077 #: ../fish/guestfish-actions.pod:2488 ../src/guestfs-actions.pod:3799
11078 msgid "C<app_publisher>"
11082 #: ../fish/guestfish-actions.pod:2490 ../src/guestfs-actions.pod:3801
11084 "The name of the publisher of the application, for package managers that use "
11085 "this. If unavailable this is returned as an empty string C<\"\">."
11089 #: ../fish/guestfish-actions.pod:2494 ../src/guestfs-actions.pod:3805
11094 #: ../fish/guestfish-actions.pod:2496 ../src/guestfs-actions.pod:3807
11096 "The URL (eg. upstream URL) of the application. If unavailable this is "
11097 "returned as an empty string C<\"\">."
11101 #: ../fish/guestfish-actions.pod:2499 ../src/guestfs-actions.pod:3810
11102 msgid "C<app_source_package>"
11106 #: ../fish/guestfish-actions.pod:2501 ../src/guestfs-actions.pod:3812
11108 "For packaging systems which support this, the name of the source package. "
11109 "If unavailable this is returned as an empty string C<\"\">."
11113 #: ../fish/guestfish-actions.pod:2504 ../src/guestfs-actions.pod:3815
11114 msgid "C<app_summary>"
11118 #: ../fish/guestfish-actions.pod:2506 ../src/guestfs-actions.pod:3817
11120 "A short (usually one line) description of the application or package. If "
11121 "unavailable this is returned as an empty string C<\"\">."
11125 #: ../fish/guestfish-actions.pod:2509 ../src/guestfs-actions.pod:3820
11126 msgid "C<app_description>"
11130 #: ../fish/guestfish-actions.pod:2511 ../src/guestfs-actions.pod:3822
11132 "A longer description of the application or package. If unavailable this is "
11133 "returned as an empty string C<\"\">."
11137 #: ../fish/guestfish-actions.pod:2518
11142 #: ../fish/guestfish-actions.pod:2520
11150 #: ../fish/guestfish-actions.pod:2522 ../src/guestfs-actions.pod:3840
11152 "This function uses other libguestfs functions and certain heuristics to "
11153 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
11154 "for operating systems."
11158 #: ../fish/guestfish-actions.pod:2526 ../src/guestfs-actions.pod:3844
11159 msgid "The list returned is empty if no operating systems were found."
11163 #: ../fish/guestfish-actions.pod:2528 ../src/guestfs-actions.pod:3846
11165 "If one operating system was found, then this returns a list with a single "
11166 "element, which is the name of the root filesystem of this operating system. "
11167 "It is also possible for this function to return a list containing more than "
11168 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
11169 "element being the root filesystem of one of the operating systems."
11173 #: ../fish/guestfish-actions.pod:2535
11175 "You can pass the root string(s) returned to other L</inspect-get-*> "
11176 "functions in order to query further information about each operating system, "
11177 "such as the name and version."
11181 #: ../fish/guestfish-actions.pod:2540
11183 "This function uses other libguestfs features such as L</mount-ro> and "
11184 "L</umount-all> in order to mount and unmount filesystems and look at the "
11185 "contents. This should be called with no disks currently mounted. The "
11186 "function may also use Augeas, so any existing Augeas handle will be closed."
11190 #: ../fish/guestfish-actions.pod:2546 ../src/guestfs-actions.pod:3864
11192 "This function cannot decrypt encrypted disks. The caller must do that first "
11193 "(supplying the necessary keys) if the disk is encrypted."
11197 #: ../fish/guestfish-actions.pod:2552 ../fish/guestfish-actions.pod:2750 ../fish/guestfish-actions.pod:2815
11198 msgid "See also L</list-filesystems>."
11202 #: ../fish/guestfish-actions.pod:2554
11203 msgid "is-blockdev"
11207 #: ../fish/guestfish-actions.pod:2556
11210 " is-blockdev path\n"
11215 #: ../fish/guestfish-actions.pod:2558 ../src/guestfs-actions.pod:3884
11217 "This returns C<true> if and only if there is a block device with the given "
11222 #: ../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
11223 msgid "See also L</stat>."
11227 #: ../fish/guestfish-actions.pod:2563
11232 #: ../fish/guestfish-actions.pod:2565
11240 #: ../fish/guestfish-actions.pod:2567 ../src/guestfs-actions.pod:3898
11242 "This returns true iff this handle is busy processing a command (in the "
11247 #: ../fish/guestfish-actions.pod:2572
11252 #: ../fish/guestfish-actions.pod:2574
11255 " is-chardev path\n"
11260 #: ../fish/guestfish-actions.pod:2576 ../src/guestfs-actions.pod:3913
11262 "This returns C<true> if and only if there is a character device with the "
11263 "given C<path> name."
11267 #: ../fish/guestfish-actions.pod:2581
11272 #: ../fish/guestfish-actions.pod:2583
11280 #: ../fish/guestfish-actions.pod:2585 ../src/guestfs-actions.pod:3927
11282 "This returns true iff this handle is being configured (in the C<CONFIG> "
11287 #: ../fish/guestfish-actions.pod:2590
11292 #: ../fish/guestfish-actions.pod:2592
11300 #: ../fish/guestfish-actions.pod:2594 ../src/guestfs-actions.pod:3942
11302 "This returns C<true> if and only if there is a directory with the given "
11303 "C<path> name. Note that it returns false for other objects like files."
11307 #: ../fish/guestfish-actions.pod:2600
11312 #: ../fish/guestfish-actions.pod:2602
11320 #: ../fish/guestfish-actions.pod:2604 ../src/guestfs-actions.pod:3958
11322 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
11323 "given C<path> name."
11327 #: ../fish/guestfish-actions.pod:2609
11332 #: ../fish/guestfish-actions.pod:2611
11340 #: ../fish/guestfish-actions.pod:2613 ../src/guestfs-actions.pod:3973
11342 "This returns C<true> if and only if there is a regular file with the given "
11343 "C<path> name. Note that it returns false for other objects like "
11348 #: ../fish/guestfish-actions.pod:2619
11349 msgid "is-launching"
11353 #: ../fish/guestfish-actions.pod:2621
11361 #: ../fish/guestfish-actions.pod:2623 ../src/guestfs-actions.pod:3988
11363 "This returns true iff this handle is launching the subprocess (in the "
11364 "C<LAUNCHING> state)."
11368 #: ../fish/guestfish-actions.pod:2628
11373 #: ../fish/guestfish-actions.pod:2630
11381 #: ../fish/guestfish-actions.pod:2632 ../src/guestfs-actions.pod:4003
11383 "This command tests whether C<device> is a logical volume, and returns true "
11384 "iff this is the case."
11388 #: ../fish/guestfish-actions.pod:2635
11393 #: ../fish/guestfish-actions.pod:2637
11401 #: ../fish/guestfish-actions.pod:2639 ../src/guestfs-actions.pod:4015
11403 "This returns true iff this handle is ready to accept commands (in the "
11408 #: ../fish/guestfish-actions.pod:2644
11413 #: ../fish/guestfish-actions.pod:2646
11416 " is-socket path\n"
11421 #: ../fish/guestfish-actions.pod:2648 ../src/guestfs-actions.pod:4030
11423 "This returns C<true> if and only if there is a Unix domain socket with the "
11424 "given C<path> name."
11428 #: ../fish/guestfish-actions.pod:2653
11433 #: ../fish/guestfish-actions.pod:2655
11436 " is-symlink path\n"
11441 #: ../fish/guestfish-actions.pod:2657 ../src/guestfs-actions.pod:4045
11443 "This returns C<true> if and only if there is a symbolic link with the given "
11448 #: ../fish/guestfish-actions.pod:2662
11453 #: ../fish/guestfish-actions.pod:2664
11461 #: ../fish/guestfish-actions.pod:2666 ../src/guestfs-actions.pod:4060
11463 "This returns true iff the file exists and the file is empty or it contains "
11468 #: ../fish/guestfish-actions.pod:2669
11469 msgid "is-zero-device"
11473 #: ../fish/guestfish-actions.pod:2671
11476 " is-zero-device device\n"
11481 #: ../fish/guestfish-actions.pod:2673 ../src/guestfs-actions.pod:4073
11482 msgid "This returns true iff the device exists and contains all zero bytes."
11486 #: ../fish/guestfish-actions.pod:2675 ../src/guestfs-actions.pod:4075
11487 msgid "Note that for large devices this can take a long time to run."
11491 #: ../fish/guestfish-actions.pod:2677
11492 msgid "kill-subprocess"
11496 #: ../fish/guestfish-actions.pod:2679
11499 " kill-subprocess\n"
11504 #: ../fish/guestfish-actions.pod:2681 ../src/guestfs-actions.pod:4086
11505 msgid "This kills the qemu subprocess. You should never need to call this."
11509 #: ../fish/guestfish-actions.pod:2683
11514 #: ../fish/guestfish-actions.pod:2685
11519 #: ../fish/guestfish-actions.pod:2687
11527 #: ../fish/guestfish-actions.pod:2689 ../src/guestfs-actions.pod:4097
11529 "Internally libguestfs is implemented by running a virtual machine using "
11534 #: ../fish/guestfish-actions.pod:2692 ../src/guestfs-actions.pod:4100
11536 "You should call this after configuring the handle (eg. adding drives) but "
11537 "before performing any actions."
11541 #: ../fish/guestfish-actions.pod:2695
11546 #: ../fish/guestfish-actions.pod:2697
11549 " lchown owner group path\n"
11554 #: ../fish/guestfish-actions.pod:2699
11556 "Change the file owner to C<owner> and group to C<group>. This is like "
11557 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
11562 #: ../fish/guestfish-actions.pod:2707
11567 #: ../fish/guestfish-actions.pod:2709
11570 " lgetxattr path name\n"
11575 #: ../fish/guestfish-actions.pod:2711 ../src/guestfs-actions.pod:4140
11577 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
11578 "is a symlink, then this call returns an extended attribute from the symlink."
11582 #: ../fish/guestfish-actions.pod:2725
11583 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
11587 #: ../fish/guestfish-actions.pod:2727
11592 #: ../fish/guestfish-actions.pod:2729
11595 " lgetxattrs path\n"
11600 #: ../fish/guestfish-actions.pod:2731
11602 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
11603 "it returns the extended attributes of the link itself."
11607 #: ../fish/guestfish-actions.pod:2735
11612 #: ../fish/guestfish-actions.pod:2737
11620 #: ../fish/guestfish-actions.pod:2739 ../src/guestfs-actions.pod:4183
11622 "List all 9p filesystems attached to the guest. A list of mount tags is "
11627 #: ../fish/guestfish-actions.pod:2742
11628 msgid "list-devices"
11632 #: ../fish/guestfish-actions.pod:2744
11640 #: ../fish/guestfish-actions.pod:2746 ../src/guestfs-actions.pod:4197
11641 msgid "List all the block devices."
11645 #: ../fish/guestfish-actions.pod:2748 ../src/guestfs-actions.pod:4199
11646 msgid "The full block device names are returned, eg. C</dev/sda>."
11650 #: ../fish/guestfish-actions.pod:2752
11651 msgid "list-dm-devices"
11655 #: ../fish/guestfish-actions.pod:2754
11658 " list-dm-devices\n"
11663 #: ../fish/guestfish-actions.pod:2756 ../src/guestfs-actions.pod:4214
11664 msgid "List all device mapper devices."
11668 #: ../fish/guestfish-actions.pod:2758
11670 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
11671 "previous call to L</luks-open>."
11675 #: ../fish/guestfish-actions.pod:2761
11677 "Device mapper devices which correspond to logical volumes are I<not> "
11678 "returned in this list. Call L</lvs> if you want to list logical volumes."
11682 #: ../fish/guestfish-actions.pod:2765
11683 msgid "list-filesystems"
11687 #: ../fish/guestfish-actions.pod:2767
11690 " list-filesystems\n"
11695 #: ../fish/guestfish-actions.pod:2769 ../src/guestfs-actions.pod:4234
11697 "This inspection command looks for filesystems on partitions, block devices "
11698 "and logical volumes, returning a list of devices containing filesystems and "
11703 #: ../fish/guestfish-actions.pod:2773 ../src/guestfs-actions.pod:4238
11705 "The return value is a hash, where the keys are the devices containing "
11706 "filesystems, and the values are the filesystem types. For example:"
11710 #: ../fish/guestfish-actions.pod:2777 ../src/guestfs-actions.pod:4242
11713 " \"/dev/sda1\" => \"ntfs\"\n"
11714 " \"/dev/sda2\" => \"ext2\"\n"
11715 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
11716 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
11721 #: ../fish/guestfish-actions.pod:2782 ../src/guestfs-actions.pod:4247
11723 "The value can have the special value \"unknown\", meaning the content of the "
11724 "device is undetermined or empty. \"swap\" means a Linux swap partition."
11728 #: ../fish/guestfish-actions.pod:2786
11730 "This command runs other libguestfs commands, which might include L</mount> "
11731 "and L</umount>, and therefore you should use this soon after launch and only "
11732 "when nothing is mounted."
11736 #: ../fish/guestfish-actions.pod:2790
11738 "Not all of the filesystems returned will be mountable. In particular, swap "
11739 "partitions are returned in the list. Also this command does not check that "
11740 "each filesystem found is valid and mountable, and some filesystems might be "
11741 "mountable but require special options. Filesystems may not all belong to a "
11742 "single logical operating system (use L</inspect-os> to look for OSes)."
11746 #: ../fish/guestfish-actions.pod:2798
11747 msgid "list-md-devices"
11751 #: ../fish/guestfish-actions.pod:2800
11754 " list-md-devices\n"
11759 #: ../fish/guestfish-actions.pod:2802 ../src/guestfs-actions.pod:4276
11760 msgid "List all Linux md devices."
11764 #: ../fish/guestfish-actions.pod:2804
11765 msgid "list-partitions"
11769 #: ../fish/guestfish-actions.pod:2806
11772 " list-partitions\n"
11777 #: ../fish/guestfish-actions.pod:2808 ../src/guestfs-actions.pod:4289
11778 msgid "List all the partitions detected on all block devices."
11782 #: ../fish/guestfish-actions.pod:2810 ../src/guestfs-actions.pod:4291
11783 msgid "The full partition device names are returned, eg. C</dev/sda1>"
11787 #: ../fish/guestfish-actions.pod:2812
11789 "This does not return logical volumes. For that you will need to call "
11794 #: ../fish/guestfish-actions.pod:2817
11799 #: ../fish/guestfish-actions.pod:2819
11807 #: ../fish/guestfish-actions.pod:2821 ../src/guestfs-actions.pod:4310
11809 "List the files in C<directory> (relative to the root directory, there is no "
11810 "cwd) in the format of 'ls -la'."
11814 #: ../fish/guestfish-actions.pod:2824 ../src/guestfs-actions.pod:4313
11816 "This command is mostly useful for interactive sessions. It is I<not> "
11817 "intended that you try to parse the output string."
11821 #: ../fish/guestfish-actions.pod:2827
11826 #: ../fish/guestfish-actions.pod:2829
11829 " ln target linkname\n"
11834 #: ../fish/guestfish-actions.pod:2831 ../src/guestfs-actions.pod:4328
11835 msgid "This command creates a hard link using the C<ln> command."
11839 #: ../fish/guestfish-actions.pod:2833
11844 #: ../fish/guestfish-actions.pod:2835
11847 " ln-f target linkname\n"
11852 #: ../fish/guestfish-actions.pod:2837 ../src/guestfs-actions.pod:4341
11854 "This command creates a hard link using the C<ln -f> command. The I<-f> "
11855 "option removes the link (C<linkname>) if it exists already."
11859 #: ../fish/guestfish-actions.pod:2840
11864 #: ../fish/guestfish-actions.pod:2842
11867 " ln-s target linkname\n"
11872 #: ../fish/guestfish-actions.pod:2844 ../src/guestfs-actions.pod:4355
11873 msgid "This command creates a symbolic link using the C<ln -s> command."
11877 #: ../fish/guestfish-actions.pod:2846
11882 #: ../fish/guestfish-actions.pod:2848
11885 " ln-sf target linkname\n"
11890 #: ../fish/guestfish-actions.pod:2850 ../src/guestfs-actions.pod:4368
11892 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
11893 "option removes the link (C<linkname>) if it exists already."
11897 #: ../fish/guestfish-actions.pod:2853
11898 msgid "lremovexattr"
11902 #: ../fish/guestfish-actions.pod:2855
11905 " lremovexattr xattr path\n"
11910 #: ../fish/guestfish-actions.pod:2857
11912 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
11913 "it removes an extended attribute of the link itself."
11917 #: ../fish/guestfish-actions.pod:2861
11922 #: ../fish/guestfish-actions.pod:2863
11930 #: ../fish/guestfish-actions.pod:2865 ../src/guestfs-actions.pod:4396
11932 "List the files in C<directory> (relative to the root directory, there is no "
11933 "cwd). The '.' and '..' entries are not returned, but hidden files are "
11938 #: ../fish/guestfish-actions.pod:2869
11940 "This command is mostly useful for interactive sessions. Programs should "
11941 "probably use L</readdir> instead."
11945 #: ../fish/guestfish-actions.pod:2872
11950 #: ../fish/guestfish-actions.pod:2874
11953 " lsetxattr xattr val vallen path\n"
11958 #: ../fish/guestfish-actions.pod:2876
11960 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
11961 "sets an extended attribute of the link itself."
11965 #: ../fish/guestfish-actions.pod:2880
11970 #: ../fish/guestfish-actions.pod:2882
11978 #: ../fish/guestfish-actions.pod:2884 ../fish/guestfish-actions.pod:4792 ../src/guestfs-actions.pod:4432 ../src/guestfs-actions.pod:7372
11979 msgid "Returns file information for the given C<path>."
11983 #: ../fish/guestfish-actions.pod:2886
11985 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
11986 "the link is stat-ed, not the file it refers to."
11990 #: ../fish/guestfish-actions.pod:2890 ../src/guestfs-actions.pod:4438
11991 msgid "This is the same as the C<lstat(2)> system call."
11995 #: ../fish/guestfish-actions.pod:2892
12000 #: ../fish/guestfish-actions.pod:2894
12003 " lstatlist path 'names ...'\n"
12008 #: ../fish/guestfish-actions.pod:2896
12010 "This call allows you to perform the L</lstat> operation on multiple files, "
12011 "where all files are in the directory C<path>. C<names> is the list of files "
12012 "from this directory."
12016 #: ../fish/guestfish-actions.pod:2900 ../src/guestfs-actions.pod:4457
12018 "On return you get a list of stat structs, with a one-to-one correspondence "
12019 "to the C<names> list. If any name did not exist or could not be lstat'd, "
12020 "then the C<ino> field of that structure is set to C<-1>."
12024 #: ../fish/guestfish-actions.pod:2905
12026 "This call is intended for programs that want to efficiently list a directory "
12027 "contents without making many round-trips. See also L</lxattrlist> for a "
12028 "similarly efficient call for getting extended attributes. Very long "
12029 "directory listings might cause the protocol message size to be exceeded, "
12030 "causing this call to fail. The caller must split up such requests into "
12031 "smaller groups of names."
12035 #: ../fish/guestfish-actions.pod:2913
12036 msgid "luks-add-key"
12040 #: ../fish/guestfish-actions.pod:2915
12043 " luks-add-key device keyslot\n"
12048 #: ../fish/guestfish-actions.pod:2917 ../src/guestfs-actions.pod:4485
12050 "This command adds a new key on LUKS device C<device>. C<key> is any "
12051 "existing key, and is used to access the device. C<newkey> is the new key to "
12052 "add. C<keyslot> is the key slot that will be replaced."
12056 #: ../fish/guestfish-actions.pod:2922
12058 "Note that if C<keyslot> already contains a key, then this command will "
12059 "fail. You have to use L</luks-kill-slot> first to remove that key."
12063 #: ../fish/guestfish-actions.pod:2926 ../fish/guestfish-actions.pod:2948 ../fish/guestfish-actions.pod:2958 ../fish/guestfish-actions.pod:2969 ../fish/guestfish-actions.pod:2995 ../fish/guestfish-actions.pod:3005
12065 "This command has one or more key or passphrase parameters. Guestfish will "
12066 "prompt for these separately."
12070 #: ../fish/guestfish-actions.pod:2929
12075 #: ../fish/guestfish-actions.pod:2931
12078 " luks-close device\n"
12083 #: ../fish/guestfish-actions.pod:2933
12085 "This closes a LUKS device that was created earlier by L</luks-open> or "
12086 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
12087 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
12088 "underlying block device."
12092 #: ../fish/guestfish-actions.pod:2939
12093 msgid "luks-format"
12097 #: ../fish/guestfish-actions.pod:2941
12100 " luks-format device keyslot\n"
12105 #: ../fish/guestfish-actions.pod:2943 ../src/guestfs-actions.pod:4526
12107 "This command erases existing data on C<device> and formats the device as a "
12108 "LUKS encrypted device. C<key> is the initial key, which is added to key "
12109 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
12113 #: ../fish/guestfish-actions.pod:2951
12114 msgid "luks-format-cipher"
12118 #: ../fish/guestfish-actions.pod:2953
12121 " luks-format-cipher device keyslot cipher\n"
12126 #: ../fish/guestfish-actions.pod:2955
12128 "This command is the same as L</luks-format> but it also allows you to set "
12129 "the C<cipher> used."
12133 #: ../fish/guestfish-actions.pod:2961
12134 msgid "luks-kill-slot"
12138 #: ../fish/guestfish-actions.pod:2963
12141 " luks-kill-slot device keyslot\n"
12146 #: ../fish/guestfish-actions.pod:2965 ../src/guestfs-actions.pod:4567
12148 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
12149 "device C<device>. C<key> must be one of the I<other> keys."
12153 #: ../fish/guestfish-actions.pod:2972
12158 #: ../fish/guestfish-actions.pod:2974
12161 " luks-open device mapname\n"
12166 #: ../fish/guestfish-actions.pod:2976 ../src/guestfs-actions.pod:4587
12168 "This command opens a block device which has been encrypted according to the "
12169 "Linux Unified Key Setup (LUKS) standard."
12173 #: ../fish/guestfish-actions.pod:2979 ../src/guestfs-actions.pod:4590
12174 msgid "C<device> is the encrypted block device or partition."
12178 #: ../fish/guestfish-actions.pod:2981 ../src/guestfs-actions.pod:4592
12180 "The caller must supply one of the keys associated with the LUKS block "
12181 "device, in the C<key> parameter."
12185 #: ../fish/guestfish-actions.pod:2984 ../src/guestfs-actions.pod:4595
12187 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
12188 "writes to this block device are decrypted from and encrypted to the "
12189 "underlying C<device> respectively."
12193 #: ../fish/guestfish-actions.pod:2988
12195 "If this block device contains LVM volume groups, then calling L</vgscan> "
12196 "followed by L</vg-activate-all> will make them visible."
12200 #: ../fish/guestfish-actions.pod:2992
12201 msgid "Use L</list-dm-devices> to list all device mapper devices."
12205 #: ../fish/guestfish-actions.pod:2998
12206 msgid "luks-open-ro"
12210 #: ../fish/guestfish-actions.pod:3000
12213 " luks-open-ro device mapname\n"
12218 #: ../fish/guestfish-actions.pod:3002
12220 "This is the same as L</luks-open> except that a read-only mapping is "
12225 #: ../fish/guestfish-actions.pod:3008
12230 #: ../fish/guestfish-actions.pod:3010
12233 " lvcreate logvol volgroup mbytes\n"
12238 #: ../fish/guestfish-actions.pod:3012 ../src/guestfs-actions.pod:4641
12240 "This creates an LVM logical volume called C<logvol> on the volume group "
12241 "C<volgroup>, with C<size> megabytes."
12245 #: ../fish/guestfish-actions.pod:3015
12246 msgid "lvm-canonical-lv-name"
12250 #: ../fish/guestfish-actions.pod:3017
12253 " lvm-canonical-lv-name lvname\n"
12258 #: ../fish/guestfish-actions.pod:3019 ../src/guestfs-actions.pod:4654
12260 "This converts alternative naming schemes for LVs that you might find to the "
12261 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
12266 #: ../fish/guestfish-actions.pod:3023 ../src/guestfs-actions.pod:4658
12268 "This command returns an error if the C<lvname> parameter does not refer to a "
12273 #: ../fish/guestfish-actions.pod:3026
12274 msgid "See also L</is-lv>."
12278 #: ../fish/guestfish-actions.pod:3028
12279 msgid "lvm-clear-filter"
12283 #: ../fish/guestfish-actions.pod:3030
12286 " lvm-clear-filter\n"
12291 #: ../fish/guestfish-actions.pod:3032
12293 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
12298 #: ../fish/guestfish-actions.pod:3035 ../fish/guestfish-actions.pod:3063 ../src/guestfs-actions.pod:4676 ../src/guestfs-actions.pod:4715
12299 msgid "This command also clears the LVM cache and performs a volume group scan."
12303 #: ../fish/guestfish-actions.pod:3038
12304 msgid "lvm-remove-all"
12308 #: ../fish/guestfish-actions.pod:3040
12311 " lvm-remove-all\n"
12316 #: ../fish/guestfish-actions.pod:3042 ../src/guestfs-actions.pod:4688
12318 "This command removes all LVM logical volumes, volume groups and physical "
12323 #: ../fish/guestfish-actions.pod:3045
12324 msgid "lvm-set-filter"
12328 #: ../fish/guestfish-actions.pod:3047
12331 " lvm-set-filter 'devices ...'\n"
12336 #: ../fish/guestfish-actions.pod:3049 ../src/guestfs-actions.pod:4701
12338 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
12339 "block devices in the list C<devices>, and will ignore all other attached "
12344 #: ../fish/guestfish-actions.pod:3053 ../src/guestfs-actions.pod:4705
12346 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
12347 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
12348 "there are two types of duplication possible: either cloned PVs/VGs which "
12349 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
12350 "same name. In normal operation you cannot create this situation, but you "
12351 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
12352 "inside the LVM metadata."
12356 #: ../fish/guestfish-actions.pod:3066 ../src/guestfs-actions.pod:4718
12357 msgid "You can filter whole block devices or individual partitions."
12361 #: ../fish/guestfish-actions.pod:3068 ../src/guestfs-actions.pod:4720
12363 "You cannot use this if any VG is currently in use (eg. contains a mounted "
12364 "filesystem), even if you are not filtering out that VG."
12368 #: ../fish/guestfish-actions.pod:3072
12373 #: ../fish/guestfish-actions.pod:3074
12376 " lvremove device\n"
12381 #: ../fish/guestfish-actions.pod:3076 ../src/guestfs-actions.pod:4734
12383 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
12384 "LV, such as C</dev/VG/LV>."
12388 #: ../fish/guestfish-actions.pod:3079 ../src/guestfs-actions.pod:4737
12390 "You can also remove all LVs in a volume group by specifying the VG name, "
12395 #: ../fish/guestfish-actions.pod:3082
12400 #: ../fish/guestfish-actions.pod:3084
12403 " lvrename logvol newlogvol\n"
12408 #: ../fish/guestfish-actions.pod:3086 ../src/guestfs-actions.pod:4751
12409 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
12413 #: ../fish/guestfish-actions.pod:3088
12418 #: ../fish/guestfish-actions.pod:3090
12421 " lvresize device mbytes\n"
12426 #: ../fish/guestfish-actions.pod:3092 ../src/guestfs-actions.pod:4764
12428 "This resizes (expands or shrinks) an existing LVM logical volume to "
12429 "C<mbytes>. When reducing, data in the reduced part is lost."
12433 #: ../fish/guestfish-actions.pod:3096
12434 msgid "lvresize-free"
12438 #: ../fish/guestfish-actions.pod:3098
12441 " lvresize-free lv percent\n"
12446 #: ../fish/guestfish-actions.pod:3100 ../src/guestfs-actions.pod:4779
12448 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
12449 "remaining free space in the volume group. Commonly you would call this with "
12450 "pc = 100 which expands the logical volume as much as possible, using all "
12451 "remaining free space in the volume group."
12455 #: ../fish/guestfish-actions.pod:3106
12460 #: ../fish/guestfish-actions.pod:3108
12468 #: ../fish/guestfish-actions.pod:3110 ../src/guestfs-actions.pod:4794
12470 "List all the logical volumes detected. This is the equivalent of the "
12471 "L<lvs(8)> command."
12475 #: ../fish/guestfish-actions.pod:3113 ../src/guestfs-actions.pod:4797
12477 "This returns a list of the logical volume device names "
12478 "(eg. C</dev/VolGroup00/LogVol00>)."
12482 #: ../fish/guestfish-actions.pod:3116
12483 msgid "See also L</lvs-full>, L</list-filesystems>."
12487 #: ../fish/guestfish-actions.pod:3118
12492 #: ../fish/guestfish-actions.pod:3120
12500 #: ../fish/guestfish-actions.pod:3122 ../src/guestfs-actions.pod:4813
12502 "List all the logical volumes detected. This is the equivalent of the "
12503 "L<lvs(8)> command. The \"full\" version includes all fields."
12507 #: ../fish/guestfish-actions.pod:3125
12512 #: ../fish/guestfish-actions.pod:3127
12520 #: ../fish/guestfish-actions.pod:3129 ../src/guestfs-actions.pod:4828
12521 msgid "This command returns the UUID of the LVM LV C<device>."
12525 #: ../fish/guestfish-actions.pod:3131
12530 #: ../fish/guestfish-actions.pod:3133
12533 " lxattrlist path 'names ...'\n"
12538 #: ../fish/guestfish-actions.pod:3135 ../src/guestfs-actions.pod:4842
12540 "This call allows you to get the extended attributes of multiple files, where "
12541 "all files are in the directory C<path>. C<names> is the list of files from "
12546 #: ../fish/guestfish-actions.pod:3139 ../src/guestfs-actions.pod:4846
12548 "On return you get a flat list of xattr structs which must be interpreted "
12549 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
12550 "C<attrval> in this struct is zero-length to indicate there was an error "
12551 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
12552 "number (the number of following attributes for this file, which could be "
12553 "C<\"0\">). Then after the first xattr struct are the zero or more "
12554 "attributes for the first named file. This repeats for the second and "
12555 "subsequent files."
12559 #: ../fish/guestfish-actions.pod:3149
12561 "This call is intended for programs that want to efficiently list a directory "
12562 "contents without making many round-trips. See also L</lstatlist> for a "
12563 "similarly efficient call for getting standard stats. Very long directory "
12564 "listings might cause the protocol message size to be exceeded, causing this "
12565 "call to fail. The caller must split up such requests into smaller groups of "
12570 #: ../fish/guestfish-actions.pod:3157
12575 #: ../fish/guestfish-actions.pod:3159
12578 " md-create name 'devices ...' [missingbitmap:N] [nrdevices:N] [spare:N] "
12579 "[chunk:N] [level:..]\n"
12584 #: ../fish/guestfish-actions.pod:3161 ../src/guestfs-actions.pod:4889
12586 "Create a Linux md (RAID) device named C<name> on the devices in the list "
12591 #: ../fish/guestfish-actions.pod:3168 ../src/guestfs-actions.pod:4896
12592 msgid "C<missingbitmap>"
12596 #: ../fish/guestfish-actions.pod:3170 ../src/guestfs-actions.pod:4898
12598 "A bitmap of missing devices. If a bit is set it means that a missing device "
12599 "is added to the array. The least significant bit corresponds to the first "
12600 "device in the array."
12604 #: ../fish/guestfish-actions.pod:3174 ../src/guestfs-actions.pod:4902
12605 msgid "As examples:"
12609 #: ../fish/guestfish-actions.pod:3176 ../src/guestfs-actions.pod:4904
12611 "If C<devices = [\"/dev/sda\"]> and C<missingbitmap = 0x1> then the resulting "
12612 "array would be C<[E<lt>missingE<gt>, \"/dev/sda\"]>."
12616 #: ../fish/guestfish-actions.pod:3179 ../src/guestfs-actions.pod:4907
12618 "If C<devices = [\"/dev/sda\"]> and C<missingbitmap = 0x2> then the resulting "
12619 "array would be C<[\"/dev/sda\", E<lt>missingE<gt>]>."
12623 #: ../fish/guestfish-actions.pod:3182 ../src/guestfs-actions.pod:4910
12624 msgid "This defaults to C<0> (no missing devices)."
12628 #: ../fish/guestfish-actions.pod:3184 ../src/guestfs-actions.pod:4912
12630 "The length of C<devices> + the number of bits set in C<missingbitmap> must "
12631 "equal C<nrdevices> + C<spare>."
12635 #: ../fish/guestfish-actions.pod:3187 ../src/guestfs-actions.pod:4915
12636 msgid "C<nrdevices>"
12640 #: ../fish/guestfish-actions.pod:3189 ../src/guestfs-actions.pod:4917
12641 msgid "The number of active RAID devices."
12645 #: ../fish/guestfish-actions.pod:3191 ../src/guestfs-actions.pod:4919
12647 "If not set, this defaults to the length of C<devices> plus the number of "
12648 "bits set in C<missingbitmap>."
12652 #: ../fish/guestfish-actions.pod:3194 ../src/guestfs-actions.pod:4922
12657 #: ../fish/guestfish-actions.pod:3196 ../src/guestfs-actions.pod:4924
12658 msgid "The number of spare devices."
12662 #: ../fish/guestfish-actions.pod:3198 ../src/guestfs-actions.pod:4926
12663 msgid "If not set, this defaults to C<0>."
12667 #: ../fish/guestfish-actions.pod:3200 ../src/guestfs-actions.pod:4928
12672 #: ../fish/guestfish-actions.pod:3202 ../src/guestfs-actions.pod:4930
12673 msgid "The chunk size in bytes."
12677 #: ../fish/guestfish-actions.pod:3204 ../fish/guestfish-actions.pod:3226 ../src/guestfs-actions.pod:4932 ../src/guestfs-actions.pod:4980
12682 #: ../fish/guestfish-actions.pod:3206 ../src/guestfs-actions.pod:4934
12684 "The RAID level, which can be one of: I<linear>, I<raid0>, I<0>, I<stripe>, "
12685 "I<raid1>, I<1>, I<mirror>, I<raid4>, I<4>, I<raid5>, I<5>, I<raid6>, I<6>, "
12686 "I<raid10>, I<10>. Some of these are synonymous, and more levels may be "
12691 #: ../fish/guestfish-actions.pod:3211 ../src/guestfs-actions.pod:4939
12692 msgid "If not set, this defaults to C<raid1>."
12696 #: ../fish/guestfish-actions.pod:3217
12701 #: ../fish/guestfish-actions.pod:3219
12709 #: ../fish/guestfish-actions.pod:3221 ../src/guestfs-actions.pod:4975
12711 "This command exposes the output of 'mdadm -DY <md>'. The following fields "
12712 "are usually present in the returned hash. Other fields may also be present."
12716 #: ../fish/guestfish-actions.pod:3228 ../src/guestfs-actions.pod:4982
12717 msgid "The raid level of the MD device."
12721 #: ../fish/guestfish-actions.pod:3230 ../src/guestfs-actions.pod:4984
12726 #: ../fish/guestfish-actions.pod:3232 ../src/guestfs-actions.pod:4986
12727 msgid "The number of underlying devices in the MD device."
12731 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4988
12732 msgid "C<metadata>"
12736 #: ../fish/guestfish-actions.pod:3236 ../src/guestfs-actions.pod:4990
12737 msgid "The metadata version used."
12741 #: ../fish/guestfish-actions.pod:3238 ../src/guestfs-actions.pod:4992
12746 #: ../fish/guestfish-actions.pod:3240 ../src/guestfs-actions.pod:4994
12747 msgid "The UUID of the MD device."
12751 #: ../fish/guestfish-actions.pod:3244 ../src/guestfs-actions.pod:4998
12752 msgid "The name of the MD device."
12756 #: ../fish/guestfish-actions.pod:3248
12761 #: ../fish/guestfish-actions.pod:3250
12769 #: ../fish/guestfish-actions.pod:3252 ../src/guestfs-actions.pod:5014
12771 "This command deactivates the MD array named C<md>. The device is stopped, "
12772 "but it is not destroyed or zeroed."
12776 #: ../fish/guestfish-actions.pod:3255 ../src/guestfs-actions.pod:5017
12777 msgid "The parameter is:"
12781 #: ../fish/guestfish-actions.pod:3259 ../src/guestfs-actions.pod:5021
12786 #: ../fish/guestfish-actions.pod:3261 ../src/guestfs-actions.pod:5023
12787 msgid "The md (RAID) device which to be deactivated."
12791 #: ../fish/guestfish-actions.pod:3265
12796 #: ../fish/guestfish-actions.pod:3267
12804 #: ../fish/guestfish-actions.pod:3269 ../src/guestfs-actions.pod:5035
12805 msgid "Create a directory named C<path>."
12809 #: ../fish/guestfish-actions.pod:3271
12814 #: ../fish/guestfish-actions.pod:3273
12817 " mkdir-mode path mode\n"
12822 #: ../fish/guestfish-actions.pod:3275 ../src/guestfs-actions.pod:5048
12824 "This command creates a directory, setting the initial permissions of the "
12825 "directory to C<mode>."
12829 #: ../fish/guestfish-actions.pod:3278 ../src/guestfs-actions.pod:5051
12831 "For common Linux filesystems, the actual mode which is set will be C<mode & "
12832 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
12837 #: ../fish/guestfish-actions.pod:3282
12838 msgid "See also L</mkdir>, L</umask>"
12842 #: ../fish/guestfish-actions.pod:3284
12847 #: ../fish/guestfish-actions.pod:3286
12855 #: ../fish/guestfish-actions.pod:3288 ../src/guestfs-actions.pod:5067
12857 "Create a directory named C<path>, creating any parent directories as "
12858 "necessary. This is like the C<mkdir -p> shell command."
12862 #: ../fish/guestfish-actions.pod:3291
12867 #: ../fish/guestfish-actions.pod:3293
12870 " mkdtemp template\n"
12875 #: ../fish/guestfish-actions.pod:3295 ../src/guestfs-actions.pod:5080
12877 "This command creates a temporary directory. The C<template> parameter "
12878 "should be a full pathname for the temporary directory name with the final "
12879 "six characters being \"XXXXXX\"."
12883 #: ../fish/guestfish-actions.pod:3300 ../src/guestfs-actions.pod:5085
12885 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
12886 "being suitable for Windows filesystems."
12890 #: ../fish/guestfish-actions.pod:3303 ../src/guestfs-actions.pod:5088
12891 msgid "The name of the temporary directory that was created is returned."
12895 #: ../fish/guestfish-actions.pod:3306 ../src/guestfs-actions.pod:5091
12896 msgid "The temporary directory is created with mode 0700 and is owned by root."
12900 #: ../fish/guestfish-actions.pod:3309 ../src/guestfs-actions.pod:5094
12902 "The caller is responsible for deleting the temporary directory and its "
12903 "contents after use."
12907 #: ../fish/guestfish-actions.pod:3312 ../src/guestfs-actions.pod:5097
12908 msgid "See also: L<mkdtemp(3)>"
12912 #: ../fish/guestfish-actions.pod:3314
12917 #: ../fish/guestfish-actions.pod:3316
12920 " mke2fs-J fstype blocksize device journal\n"
12925 #: ../fish/guestfish-actions.pod:3318 ../src/guestfs-actions.pod:5113
12927 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12928 "C<journal>. It is equivalent to the command:"
12932 #: ../fish/guestfish-actions.pod:3322 ../src/guestfs-actions.pod:5117
12935 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
12940 #: ../fish/guestfish-actions.pod:3324
12941 msgid "See also L</mke2journal>."
12945 #: ../fish/guestfish-actions.pod:3326
12950 #: ../fish/guestfish-actions.pod:3328
12953 " mke2fs-JL fstype blocksize device label\n"
12958 #: ../fish/guestfish-actions.pod:3330 ../src/guestfs-actions.pod:5134
12960 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12961 "the journal labeled C<label>."
12965 #: ../fish/guestfish-actions.pod:3333
12966 msgid "See also L</mke2journal-L>."
12970 #: ../fish/guestfish-actions.pod:3335
12975 #: ../fish/guestfish-actions.pod:3337
12978 " mke2fs-JU fstype blocksize device uuid\n"
12983 #: ../fish/guestfish-actions.pod:3339 ../src/guestfs-actions.pod:5152
12985 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
12986 "the journal with UUID C<uuid>."
12990 #: ../fish/guestfish-actions.pod:3342
12991 msgid "See also L</mke2journal-U>."
12995 #: ../fish/guestfish-actions.pod:3344
12996 msgid "mke2journal"
13000 #: ../fish/guestfish-actions.pod:3346
13003 " mke2journal blocksize device\n"
13008 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5168
13010 "This creates an ext2 external journal on C<device>. It is equivalent to the "
13015 #: ../fish/guestfish-actions.pod:3351 ../src/guestfs-actions.pod:5171
13018 " mke2fs -O journal_dev -b blocksize device\n"
13023 #: ../fish/guestfish-actions.pod:3353
13024 msgid "mke2journal-L"
13028 #: ../fish/guestfish-actions.pod:3355
13031 " mke2journal-L blocksize label device\n"
13036 #: ../fish/guestfish-actions.pod:3357 ../src/guestfs-actions.pod:5185
13037 msgid "This creates an ext2 external journal on C<device> with label C<label>."
13041 #: ../fish/guestfish-actions.pod:3359
13042 msgid "mke2journal-U"
13046 #: ../fish/guestfish-actions.pod:3361
13049 " mke2journal-U blocksize uuid device\n"
13054 #: ../fish/guestfish-actions.pod:3363 ../src/guestfs-actions.pod:5199
13055 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
13059 #: ../fish/guestfish-actions.pod:3365
13064 #: ../fish/guestfish-actions.pod:3367
13067 " mkfifo mode path\n"
13072 #: ../fish/guestfish-actions.pod:3369
13074 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
13075 "is just a convenient wrapper around L</mknod>."
13079 #: ../fish/guestfish-actions.pod:3375
13084 #: ../fish/guestfish-actions.pod:3377
13087 " mkfs fstype device\n"
13092 #: ../fish/guestfish-actions.pod:3379 ../src/guestfs-actions.pod:5229
13094 "This creates a filesystem on C<device> (usually a partition or LVM logical "
13095 "volume). The filesystem type is C<fstype>, for example C<ext3>."
13099 #: ../fish/guestfish-actions.pod:3383
13104 #: ../fish/guestfish-actions.pod:3385
13107 " mkfs-b fstype blocksize device\n"
13112 #: ../fish/guestfish-actions.pod:3387
13114 "This call is similar to L</mkfs>, but it allows you to control the block "
13115 "size of the resulting filesystem. Supported block sizes depend on the "
13116 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
13120 #: ../fish/guestfish-actions.pod:3392 ../fish/guestfish-actions.pod:3419 ../src/guestfs-actions.pod:5257 ../src/guestfs-actions.pod:5295
13122 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
13127 #: ../fish/guestfish-actions.pod:3395
13129 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
13134 #: ../fish/guestfish-actions.pod:3402
13139 #: ../fish/guestfish-actions.pod:3404
13142 " mkfs-opts fstype device [blocksize:N] [features:..] [inode:N] "
13148 #: ../fish/guestfish-actions.pod:3406 ../src/guestfs-actions.pod:5282
13150 "This function creates a filesystem on C<device>. The filesystem type is "
13151 "C<fstype>, for example C<ext3>."
13155 #: ../fish/guestfish-actions.pod:3413 ../src/guestfs-actions.pod:5289
13156 msgid "C<blocksize>"
13160 #: ../fish/guestfish-actions.pod:3415 ../src/guestfs-actions.pod:5291
13162 "The filesystem block size. Supported block sizes depend on the filesystem "
13163 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
13168 #: ../fish/guestfish-actions.pod:3422 ../src/guestfs-actions.pod:5298
13169 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
13173 #: ../fish/guestfish-actions.pod:3424 ../src/guestfs-actions.pod:5300
13174 msgid "C<features>"
13178 #: ../fish/guestfish-actions.pod:3426 ../src/guestfs-actions.pod:5302
13179 msgid "This passes the I<-O> parameter to the external mkfs program."
13183 #: ../fish/guestfish-actions.pod:3428 ../src/guestfs-actions.pod:5304
13185 "For certain filesystem types, this allows extra filesystem features to be "
13186 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
13190 #: ../fish/guestfish-actions.pod:3432 ../src/guestfs-actions.pod:5308
13192 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
13197 #: ../fish/guestfish-actions.pod:3435 ../src/guestfs-actions.pod:5311
13202 #: ../fish/guestfish-actions.pod:3437 ../src/guestfs-actions.pod:5313
13204 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
13205 "sets the inode size (only for ext2/3/4 filesystems at present)."
13209 #: ../fish/guestfish-actions.pod:3440 ../src/guestfs-actions.pod:5316
13210 msgid "C<sectorsize>"
13214 #: ../fish/guestfish-actions.pod:3442 ../src/guestfs-actions.pod:5318
13216 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
13217 "sets sector size for ufs filesystem."
13221 #: ../fish/guestfish-actions.pod:3449
13222 msgid "mkmountpoint"
13226 #: ../fish/guestfish-actions.pod:3451
13229 " mkmountpoint exemptpath\n"
13234 #: ../fish/guestfish-actions.pod:3453
13236 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
13237 "to create extra mountpoints before mounting the first filesystem."
13241 #: ../fish/guestfish-actions.pod:3457 ../src/guestfs-actions.pod:5361
13243 "These calls are I<only> necessary in some very limited circumstances, mainly "
13244 "the case where you want to mount a mix of unrelated and/or read-only "
13245 "filesystems together."
13249 #: ../fish/guestfish-actions.pod:3461 ../src/guestfs-actions.pod:5365
13251 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
13252 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
13253 "inside that. You can unpack this as follows in guestfish:"
13257 #: ../fish/guestfish-actions.pod:3466 ../src/guestfs-actions.pod:5370
13260 " add-ro Fedora-11-i686-Live.iso\n"
13262 " mkmountpoint /cd\n"
13263 " mkmountpoint /sqsh\n"
13264 " mkmountpoint /ext3fs\n"
13265 " mount /dev/sda /cd\n"
13266 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
13267 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
13272 #: ../fish/guestfish-actions.pod:3475 ../src/guestfs-actions.pod:5379
13273 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
13277 #: ../fish/guestfish-actions.pod:3477
13279 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
13280 "unexpected errors if you try to mix these calls. It is safest to manually "
13281 "unmount filesystems and remove mountpoints after use."
13285 #: ../fish/guestfish-actions.pod:3481
13287 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
13288 "for this to work for manual mountpoints, you must ensure that the innermost "
13289 "mountpoints have the longest pathnames, as in the example code above."
13293 #: ../fish/guestfish-actions.pod:3486 ../src/guestfs-actions.pod:5390
13294 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
13298 #: ../fish/guestfish-actions.pod:3488
13300 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
13301 "L</umount-all> to be called when the handle is closed which can also trigger "
13306 #: ../fish/guestfish-actions.pod:3492
13311 #: ../fish/guestfish-actions.pod:3494
13314 " mknod mode devmajor devminor path\n"
13319 #: ../fish/guestfish-actions.pod:3496 ../src/guestfs-actions.pod:5409
13321 "This call creates block or character special devices, or named pipes "
13326 #: ../fish/guestfish-actions.pod:3499 ../src/guestfs-actions.pod:5412
13328 "The C<mode> parameter should be the mode, using the standard constants. "
13329 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
13330 "used when creating block and character special devices."
13334 #: ../fish/guestfish-actions.pod:3504
13336 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
13337 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
13338 "regular file). These constants are available in the standard Linux header "
13339 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
13340 "wrappers around this command which bitwise OR in the appropriate constant "
13345 #: ../fish/guestfish-actions.pod:3514
13350 #: ../fish/guestfish-actions.pod:3516
13353 " mknod-b mode devmajor devminor path\n"
13358 #: ../fish/guestfish-actions.pod:3518
13360 "This call creates a block device node called C<path> with mode C<mode> and "
13361 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
13362 "wrapper around L</mknod>."
13366 #: ../fish/guestfish-actions.pod:3524
13371 #: ../fish/guestfish-actions.pod:3526
13374 " mknod-c mode devmajor devminor path\n"
13379 #: ../fish/guestfish-actions.pod:3528
13381 "This call creates a char device node called C<path> with mode C<mode> and "
13382 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
13383 "wrapper around L</mknod>."
13387 #: ../fish/guestfish-actions.pod:3534
13392 #: ../fish/guestfish-actions.pod:3536
13400 #: ../fish/guestfish-actions.pod:3538 ../src/guestfs-actions.pod:5475
13401 msgid "Create a swap partition on C<device>."
13405 #: ../fish/guestfish-actions.pod:3540
13410 #: ../fish/guestfish-actions.pod:3542
13413 " mkswap-L label device\n"
13418 #: ../fish/guestfish-actions.pod:3544 ../src/guestfs-actions.pod:5488
13419 msgid "Create a swap partition on C<device> with label C<label>."
13423 #: ../fish/guestfish-actions.pod:3546 ../src/guestfs-actions.pod:5490
13425 "Note that you cannot attach a swap label to a block device "
13426 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
13427 "the kernel or swap tools."
13431 #: ../fish/guestfish-actions.pod:3550
13436 #: ../fish/guestfish-actions.pod:3552
13439 " mkswap-U uuid device\n"
13444 #: ../fish/guestfish-actions.pod:3554 ../src/guestfs-actions.pod:5505
13445 msgid "Create a swap partition on C<device> with UUID C<uuid>."
13449 #: ../fish/guestfish-actions.pod:3556
13450 msgid "mkswap-file"
13454 #: ../fish/guestfish-actions.pod:3558
13457 " mkswap-file path\n"
13462 #: ../fish/guestfish-actions.pod:3560 ../src/guestfs-actions.pod:5517
13463 msgid "Create a swap file."
13467 #: ../fish/guestfish-actions.pod:3562
13469 "This command just writes a swap file signature to an existing file. To "
13470 "create the file itself, use something like L</fallocate>."
13474 #: ../fish/guestfish-actions.pod:3565
13479 #: ../fish/guestfish-actions.pod:3567
13482 " modprobe modulename\n"
13487 #: ../fish/guestfish-actions.pod:3569 ../src/guestfs-actions.pod:5532
13488 msgid "This loads a kernel module in the appliance."
13492 #: ../fish/guestfish-actions.pod:3571 ../src/guestfs-actions.pod:5534
13494 "The kernel module must have been whitelisted when libguestfs was built (see "
13495 "C<appliance/kmod.whitelist.in> in the source)."
13499 #: ../fish/guestfish-actions.pod:3574
13504 #: ../fish/guestfish-actions.pod:3576
13507 " mount device mountpoint\n"
13512 #: ../fish/guestfish-actions.pod:3578 ../src/guestfs-actions.pod:5548
13514 "Mount a guest disk at a position in the filesystem. Block devices are named "
13515 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
13516 "those block devices contain partitions, they will have the usual names "
13517 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
13521 #: ../fish/guestfish-actions.pod:3584 ../src/guestfs-actions.pod:5554
13523 "The rules are the same as for L<mount(2)>: A filesystem must first be "
13524 "mounted on C</> before others can be mounted. Other filesystems can only be "
13525 "mounted on directories which already exist."
13529 #: ../fish/guestfish-actions.pod:3589 ../src/guestfs-actions.pod:5559
13531 "The mounted filesystem is writable, if we have sufficient permissions on the "
13532 "underlying device."
13536 #: ../fish/guestfish-actions.pod:3592
13538 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
13539 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
13540 "problems for users. If your program might need to work with older versions "
13541 "of libguestfs, use L</mount-options> instead (using an empty string for the "
13542 "first parameter if you don't want any options)."
13546 #: ../fish/guestfish-actions.pod:3599
13551 #: ../fish/guestfish-actions.pod:3601
13554 " mount-9p mounttag mountpoint [options:..]\n"
13559 #: ../fish/guestfish-actions.pod:3603 ../src/guestfs-actions.pod:5588
13561 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
13566 #: ../fish/guestfish-actions.pod:3606 ../src/guestfs-actions.pod:5591
13568 "If required, C<trans=virtio> will be automatically added to the options. "
13569 "Any other options required can be passed in the optional C<options> "
13574 #: ../fish/guestfish-actions.pod:3612
13579 #: ../fish/guestfish-actions.pod:3614
13582 " mount-loop file mountpoint\n"
13587 #: ../fish/guestfish-actions.pod:3616 ../src/guestfs-actions.pod:5630
13589 "This command lets you mount C<file> (a filesystem image in a file) on a "
13590 "mount point. It is entirely equivalent to the command C<mount -o loop file "
13595 #: ../fish/guestfish-actions.pod:3620
13596 msgid "mount-options"
13600 #: ../fish/guestfish-actions.pod:3622
13603 " mount-options options device mountpoint\n"
13608 #: ../fish/guestfish-actions.pod:3624
13610 "This is the same as the L</mount> command, but it allows you to set the "
13611 "mount options as for the L<mount(8)> I<-o> flag."
13615 #: ../fish/guestfish-actions.pod:3628 ../src/guestfs-actions.pod:5650
13617 "If the C<options> parameter is an empty string, then no options are passed "
13618 "(all options default to whatever the filesystem uses)."
13622 #: ../fish/guestfish-actions.pod:3632
13627 #: ../fish/guestfish-actions.pod:3634
13630 " mount-ro device mountpoint\n"
13635 #: ../fish/guestfish-actions.pod:3636
13637 "This is the same as the L</mount> command, but it mounts the filesystem with "
13638 "the read-only (I<-o ro>) flag."
13642 #: ../fish/guestfish-actions.pod:3639
13647 #: ../fish/guestfish-actions.pod:3641
13650 " mount-vfs options vfstype device mountpoint\n"
13655 #: ../fish/guestfish-actions.pod:3643
13657 "This is the same as the L</mount> command, but it allows you to set both the "
13658 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
13662 #: ../fish/guestfish-actions.pod:3647
13663 msgid "mountpoints"
13667 #: ../fish/guestfish-actions.pod:3649
13675 #: ../fish/guestfish-actions.pod:3651
13677 "This call is similar to L</mounts>. That call returns a list of devices. "
13678 "This one returns a hash table (map) of device name to directory where the "
13679 "device is mounted."
13683 #: ../fish/guestfish-actions.pod:3655
13688 #: ../fish/guestfish-actions.pod:3657
13696 #: ../fish/guestfish-actions.pod:3659 ../src/guestfs-actions.pod:5711
13698 "This returns the list of currently mounted filesystems. It returns the list "
13699 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
13703 #: ../fish/guestfish-actions.pod:3662 ../src/guestfs-actions.pod:5714
13704 msgid "Some internal mounts are not shown."
13708 #: ../fish/guestfish-actions.pod:3664
13709 msgid "See also: L</mountpoints>"
13713 #: ../fish/guestfish-actions.pod:3666
13718 #: ../fish/guestfish-actions.pod:3668
13726 #: ../fish/guestfish-actions.pod:3670 ../src/guestfs-actions.pod:5731
13728 "This moves a file from C<src> to C<dest> where C<dest> is either a "
13729 "destination filename or destination directory."
13733 #: ../fish/guestfish-actions.pod:3673
13734 msgid "ntfs-3g-probe"
13738 #: ../fish/guestfish-actions.pod:3675
13741 " ntfs-3g-probe true|false device\n"
13746 #: ../fish/guestfish-actions.pod:3677 ../src/guestfs-actions.pod:5745
13748 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
13749 "C<device> for mountability. (Not all NTFS volumes can be mounted "
13750 "read-write, and some cannot be mounted at all)."
13754 #: ../fish/guestfish-actions.pod:3681 ../src/guestfs-actions.pod:5749
13756 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
13757 "can be mounted read-write. Set it to false if you want to test if the "
13758 "volume can be mounted read-only."
13762 #: ../fish/guestfish-actions.pod:3685 ../src/guestfs-actions.pod:5753
13764 "The return value is an integer which C<0> if the operation would succeed, or "
13765 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
13769 #: ../fish/guestfish-actions.pod:3689
13774 #: ../fish/guestfish-actions.pod:3691
13777 " ntfsresize device\n"
13782 #: ../fish/guestfish-actions.pod:3693 ../fish/guestfish-actions.pod:3717 ../src/guestfs-actions.pod:5774 ../src/guestfs-actions.pod:5806
13784 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
13785 "size of the underlying device."
13789 #: ../fish/guestfish-actions.pod:3696 ../src/guestfs-actions.pod:5777
13791 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
13792 "consistency check (for safety). You have to boot into Windows to perform "
13793 "this check and clear this condition. Furthermore, ntfsresize refuses to "
13794 "resize filesystems which have been marked in this way. So in effect it is "
13795 "not possible to call ntfsresize multiple times on a single filesystem "
13796 "without booting into Windows between each resize."
13800 #: ../fish/guestfish-actions.pod:3704 ../fish/guestfish-actions.pod:3743 ../src/guestfs-actions.pod:5785 ../src/guestfs-actions.pod:5832
13801 msgid "See also L<ntfsresize(8)>."
13805 #: ../fish/guestfish-actions.pod:3706 ../fish/guestfish-actions.pod:3754
13807 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
13812 #: ../fish/guestfish-actions.pod:3713
13813 msgid "ntfsresize-opts"
13817 #: ../fish/guestfish-actions.pod:3715
13820 " ntfsresize-opts device [size:N] [force:true|false]\n"
13825 #: ../fish/guestfish-actions.pod:3726 ../src/guestfs-actions.pod:5815
13827 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
13828 "resized to fit the container (eg. partition)."
13832 #: ../fish/guestfish-actions.pod:3729 ../fish/guestfish-actions.pod:5050 ../src/guestfs-actions.pod:5818 ../src/guestfs-actions.pod:7789
13837 #: ../fish/guestfish-actions.pod:3731 ../src/guestfs-actions.pod:5820
13839 "If this option is true, then force the resize of the filesystem even if the "
13840 "filesystem is marked as requiring a consistency check."
13844 #: ../fish/guestfish-actions.pod:3734
13846 "After the resize operation, the filesystem is always marked as requiring a "
13847 "consistency check (for safety). You have to boot into Windows to perform "
13848 "this check and clear this condition. If you I<don't> set the C<force> "
13849 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
13850 "a single filesystem without booting into Windows between each resize."
13854 #: ../fish/guestfish-actions.pod:3747
13855 msgid "ntfsresize-size"
13859 #: ../fish/guestfish-actions.pod:3749
13862 " ntfsresize-size device size\n"
13867 #: ../fish/guestfish-actions.pod:3751
13869 "This command is the same as L</ntfsresize> except that it allows you to "
13870 "specify the new size (in bytes) explicitly."
13874 #: ../fish/guestfish-actions.pod:3761
13879 #: ../fish/guestfish-actions.pod:3763
13882 " part-add device prlogex startsect endsect\n"
13887 #: ../fish/guestfish-actions.pod:3765
13889 "This command adds a partition to C<device>. If there is no partition table "
13890 "on the device, call L</part-init> first."
13894 #: ../fish/guestfish-actions.pod:3768 ../src/guestfs-actions.pod:5893
13896 "The C<prlogex> parameter is the type of partition. Normally you should pass "
13897 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
13898 "C<logical>) and C<e> (or C<extended>) partition types."
13902 #: ../fish/guestfish-actions.pod:3773 ../src/guestfs-actions.pod:5898
13904 "C<startsect> and C<endsect> are the start and end of the partition in "
13905 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
13906 "from the end of the disk (C<-1> is the last sector)."
13910 #: ../fish/guestfish-actions.pod:3777
13912 "Creating a partition which covers the whole disk is not so easy. Use "
13913 "L</part-disk> to do that."
13917 #: ../fish/guestfish-actions.pod:3780
13922 #: ../fish/guestfish-actions.pod:3782
13925 " part-del device partnum\n"
13930 #: ../fish/guestfish-actions.pod:3784 ../src/guestfs-actions.pod:5916
13931 msgid "This command deletes the partition numbered C<partnum> on C<device>."
13935 #: ../fish/guestfish-actions.pod:3786 ../src/guestfs-actions.pod:5918
13937 "Note that in the case of MBR partitioning, deleting an extended partition "
13938 "also deletes any logical partitions it contains."
13942 #: ../fish/guestfish-actions.pod:3790
13947 #: ../fish/guestfish-actions.pod:3792
13950 " part-disk device parttype\n"
13955 #: ../fish/guestfish-actions.pod:3794
13957 "This command is simply a combination of L</part-init> followed by "
13958 "L</part-add> to create a single primary partition covering the whole disk."
13962 #: ../fish/guestfish-actions.pod:3798
13964 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
13965 "possible values are described in L</part-init>."
13969 #: ../fish/guestfish-actions.pod:3801
13970 msgid "part-get-bootable"
13974 #: ../fish/guestfish-actions.pod:3803
13977 " part-get-bootable device partnum\n"
13982 #: ../fish/guestfish-actions.pod:3805 ../src/guestfs-actions.pod:5951
13984 "This command returns true if the partition C<partnum> on C<device> has the "
13985 "bootable flag set."
13989 #: ../fish/guestfish-actions.pod:3808
13990 msgid "See also L</part-set-bootable>."
13994 #: ../fish/guestfish-actions.pod:3810
13995 msgid "part-get-mbr-id"
13999 #: ../fish/guestfish-actions.pod:3812
14002 " part-get-mbr-id device partnum\n"
14007 #: ../fish/guestfish-actions.pod:3814 ../src/guestfs-actions.pod:5967
14009 "Returns the MBR type byte (also known as the ID byte) from the numbered "
14010 "partition C<partnum>."
14014 #: ../fish/guestfish-actions.pod:3817 ../fish/guestfish-actions.pod:3961
14016 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
14017 "undefined results for other partition table types (see "
14018 "L</part-get-parttype>)."
14022 #: ../fish/guestfish-actions.pod:3821
14023 msgid "part-get-parttype"
14027 #: ../fish/guestfish-actions.pod:3823
14030 " part-get-parttype device\n"
14035 #: ../fish/guestfish-actions.pod:3825 ../src/guestfs-actions.pod:5984
14037 "This command examines the partition table on C<device> and returns the "
14038 "partition table type (format) being used."
14042 #: ../fish/guestfish-actions.pod:3828
14044 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
14045 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
14046 "possible, although unusual. See L</part-init> for a full list."
14050 #: ../fish/guestfish-actions.pod:3833
14055 #: ../fish/guestfish-actions.pod:3835
14058 " part-init device parttype\n"
14063 #: ../fish/guestfish-actions.pod:3837 ../src/guestfs-actions.pod:6004
14065 "This creates an empty partition table on C<device> of one of the partition "
14066 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
14067 "(for large disks)."
14071 #: ../fish/guestfish-actions.pod:3841
14073 "Initially there are no partitions. Following this, you should call "
14074 "L</part-add> for each partition required."
14078 #: ../fish/guestfish-actions.pod:3844 ../src/guestfs-actions.pod:6011
14079 msgid "Possible values for C<parttype> are:"
14083 #: ../fish/guestfish-actions.pod:3848 ../src/guestfs-actions.pod:6015
14088 #: ../fish/guestfish-actions.pod:3850 ../src/guestfs-actions.pod:6017
14093 #: ../fish/guestfish-actions.pod:3852 ../src/guestfs-actions.pod:6019
14094 msgid "Intel EFI / GPT partition table."
14098 #: ../fish/guestfish-actions.pod:3854 ../src/guestfs-actions.pod:6021
14100 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
14101 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
14102 "the C<mbr> format."
14106 #: ../fish/guestfish-actions.pod:3858 ../src/guestfs-actions.pod:6025
14111 #: ../fish/guestfish-actions.pod:3860 ../src/guestfs-actions.pod:6027
14116 #: ../fish/guestfish-actions.pod:3862 ../src/guestfs-actions.pod:6029
14118 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
14119 "Windows. This partition type will B<only> work for device sizes up to 2 "
14120 "TB. For large disks we recommend using C<gpt>."
14124 #: ../fish/guestfish-actions.pod:3869 ../src/guestfs-actions.pod:6036
14125 msgid "Other partition table types that may work but are not supported include:"
14129 #: ../fish/guestfish-actions.pod:3874 ../src/guestfs-actions.pod:6041
14134 #: ../fish/guestfish-actions.pod:3876 ../src/guestfs-actions.pod:6043
14135 msgid "AIX disk labels."
14139 #: ../fish/guestfish-actions.pod:3878 ../src/guestfs-actions.pod:6045
14144 #: ../fish/guestfish-actions.pod:3880 ../src/guestfs-actions.pod:6047
14149 #: ../fish/guestfish-actions.pod:3882 ../src/guestfs-actions.pod:6049
14150 msgid "Amiga \"Rigid Disk Block\" format."
14154 #: ../fish/guestfish-actions.pod:3884 ../src/guestfs-actions.pod:6051
14159 #: ../fish/guestfish-actions.pod:3886 ../src/guestfs-actions.pod:6053
14160 msgid "BSD disk labels."
14164 #: ../fish/guestfish-actions.pod:3888 ../src/guestfs-actions.pod:6055
14169 #: ../fish/guestfish-actions.pod:3890 ../src/guestfs-actions.pod:6057
14170 msgid "DASD, used on IBM mainframes."
14174 #: ../fish/guestfish-actions.pod:3892 ../src/guestfs-actions.pod:6059
14179 #: ../fish/guestfish-actions.pod:3894 ../src/guestfs-actions.pod:6061
14180 msgid "MIPS/SGI volumes."
14184 #: ../fish/guestfish-actions.pod:3896 ../src/guestfs-actions.pod:6063
14189 #: ../fish/guestfish-actions.pod:3898 ../src/guestfs-actions.pod:6065
14190 msgid "Old Mac partition format. Modern Macs use C<gpt>."
14194 #: ../fish/guestfish-actions.pod:3900 ../src/guestfs-actions.pod:6067
14199 #: ../fish/guestfish-actions.pod:3902 ../src/guestfs-actions.pod:6069
14200 msgid "NEC PC-98 format, common in Japan apparently."
14204 #: ../fish/guestfish-actions.pod:3904 ../src/guestfs-actions.pod:6071
14209 #: ../fish/guestfish-actions.pod:3906 ../src/guestfs-actions.pod:6073
14210 msgid "Sun disk labels."
14214 #: ../fish/guestfish-actions.pod:3910
14219 #: ../fish/guestfish-actions.pod:3912
14222 " part-list device\n"
14227 #: ../fish/guestfish-actions.pod:3914 ../src/guestfs-actions.pod:6087
14229 "This command parses the partition table on C<device> and returns the list of "
14230 "partitions found."
14234 #: ../fish/guestfish-actions.pod:3917 ../src/guestfs-actions.pod:6090
14235 msgid "The fields in the returned structure are:"
14239 #: ../fish/guestfish-actions.pod:3921 ../src/guestfs-actions.pod:6094
14240 msgid "B<part_num>"
14244 #: ../fish/guestfish-actions.pod:3923 ../src/guestfs-actions.pod:6096
14245 msgid "Partition number, counting from 1."
14249 #: ../fish/guestfish-actions.pod:3925 ../src/guestfs-actions.pod:6098
14250 msgid "B<part_start>"
14254 #: ../fish/guestfish-actions.pod:3927
14256 "Start of the partition I<in bytes>. To get sectors you have to divide by "
14257 "the device's sector size, see L</blockdev-getss>."
14261 #: ../fish/guestfish-actions.pod:3930 ../src/guestfs-actions.pod:6103
14262 msgid "B<part_end>"
14266 #: ../fish/guestfish-actions.pod:3932 ../src/guestfs-actions.pod:6105
14267 msgid "End of the partition in bytes."
14271 #: ../fish/guestfish-actions.pod:3934 ../src/guestfs-actions.pod:6107
14272 msgid "B<part_size>"
14276 #: ../fish/guestfish-actions.pod:3936 ../src/guestfs-actions.pod:6109
14277 msgid "Size of the partition in bytes."
14281 #: ../fish/guestfish-actions.pod:3940
14282 msgid "part-set-bootable"
14286 #: ../fish/guestfish-actions.pod:3942
14289 " part-set-bootable device partnum true|false\n"
14294 #: ../fish/guestfish-actions.pod:3944 ../src/guestfs-actions.pod:6127
14296 "This sets the bootable flag on partition numbered C<partnum> on device "
14297 "C<device>. Note that partitions are numbered from 1."
14301 #: ../fish/guestfish-actions.pod:3947 ../src/guestfs-actions.pod:6130
14303 "The bootable flag is used by some operating systems (notably Windows) to "
14304 "determine which partition to boot from. It is by no means universally "
14309 #: ../fish/guestfish-actions.pod:3951
14310 msgid "part-set-mbr-id"
14314 #: ../fish/guestfish-actions.pod:3953
14317 " part-set-mbr-id device partnum idbyte\n"
14322 #: ../fish/guestfish-actions.pod:3955 ../src/guestfs-actions.pod:6146
14324 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
14325 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
14326 "documentation are in fact hexadecimal numbers, but usually documented "
14327 "without any leading \"0x\" which might be confusing."
14331 #: ../fish/guestfish-actions.pod:3965
14332 msgid "part-set-name"
14336 #: ../fish/guestfish-actions.pod:3967
14339 " part-set-name device partnum name\n"
14344 #: ../fish/guestfish-actions.pod:3969 ../src/guestfs-actions.pod:6168
14346 "This sets the partition name on partition numbered C<partnum> on device "
14347 "C<device>. Note that partitions are numbered from 1."
14351 #: ../fish/guestfish-actions.pod:3972 ../src/guestfs-actions.pod:6171
14353 "The partition name can only be set on certain types of partition table. "
14354 "This works on C<gpt> but not on C<mbr> partitions."
14358 #: ../fish/guestfish-actions.pod:3975
14359 msgid "part-to-dev"
14363 #: ../fish/guestfish-actions.pod:3977
14366 " part-to-dev partition\n"
14371 #: ../fish/guestfish-actions.pod:3979 ../src/guestfs-actions.pod:6184
14373 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
14374 "partition number, returning the device name (eg. \"/dev/sdb\")."
14378 #: ../fish/guestfish-actions.pod:3983 ../fish/guestfish-actions.pod:3995
14380 "The named partition must exist, for example as a string returned from "
14381 "L</list-partitions>."
14385 #: ../fish/guestfish-actions.pod:3986
14386 msgid "See also L</part-to-partnum>."
14390 #: ../fish/guestfish-actions.pod:3988
14391 msgid "part-to-partnum"
14395 #: ../fish/guestfish-actions.pod:3990
14398 " part-to-partnum partition\n"
14403 #: ../fish/guestfish-actions.pod:3992 ../src/guestfs-actions.pod:6204
14405 "This function takes a partition name (eg. \"/dev/sdb1\") and returns the "
14406 "partition number (eg. C<1>)."
14410 #: ../fish/guestfish-actions.pod:3998
14411 msgid "See also L</part-to-dev>."
14415 #: ../fish/guestfish-actions.pod:4000
14416 msgid "ping-daemon"
14420 #: ../fish/guestfish-actions.pod:4002
14428 #: ../fish/guestfish-actions.pod:4004 ../src/guestfs-actions.pod:6221
14430 "This is a test probe into the guestfs daemon running inside the qemu "
14431 "subprocess. Calling this function checks that the daemon responds to the "
14432 "ping message, without affecting the daemon or attached block device(s) in "
14437 #: ../fish/guestfish-actions.pod:4009
14442 #: ../fish/guestfish-actions.pod:4011
14445 " pread path count offset\n"
14450 #: ../fish/guestfish-actions.pod:4013 ../src/guestfs-actions.pod:6239
14452 "This command lets you read part of a file. It reads C<count> bytes of the "
14453 "file, starting at C<offset>, from file C<path>."
14457 #: ../fish/guestfish-actions.pod:4016 ../fish/guestfish-actions.pod:4031 ../src/guestfs-actions.pod:6242 ../src/guestfs-actions.pod:6268
14459 "This may read fewer bytes than requested. For further details see the "
14460 "L<pread(2)> system call."
14464 #: ../fish/guestfish-actions.pod:4019
14465 msgid "See also L</pwrite>, L</pread-device>."
14469 #: ../fish/guestfish-actions.pod:4024
14470 msgid "pread-device"
14474 #: ../fish/guestfish-actions.pod:4026
14477 " pread-device device count offset\n"
14482 #: ../fish/guestfish-actions.pod:4028 ../src/guestfs-actions.pod:6265
14484 "This command lets you read part of a file. It reads C<count> bytes of "
14485 "C<device>, starting at C<offset>."
14489 #: ../fish/guestfish-actions.pod:4034
14490 msgid "See also L</pread>."
14494 #: ../fish/guestfish-actions.pod:4039
14499 #: ../fish/guestfish-actions.pod:4041
14502 " pvcreate device\n"
14507 #: ../fish/guestfish-actions.pod:4043 ../src/guestfs-actions.pod:6288
14509 "This creates an LVM physical volume on the named C<device>, where C<device> "
14510 "should usually be a partition name such as C</dev/sda1>."
14514 #: ../fish/guestfish-actions.pod:4047
14519 #: ../fish/guestfish-actions.pod:4049
14522 " pvremove device\n"
14527 #: ../fish/guestfish-actions.pod:4051 ../src/guestfs-actions.pod:6302
14529 "This wipes a physical volume C<device> so that LVM will no longer recognise "
14534 #: ../fish/guestfish-actions.pod:4054 ../src/guestfs-actions.pod:6305
14536 "The implementation uses the C<pvremove> command which refuses to wipe "
14537 "physical volumes that contain any volume groups, so you have to remove those "
14542 #: ../fish/guestfish-actions.pod:4058
14547 #: ../fish/guestfish-actions.pod:4060
14550 " pvresize device\n"
14555 #: ../fish/guestfish-actions.pod:4062 ../src/guestfs-actions.pod:6319
14557 "This resizes (expands or shrinks) an existing LVM physical volume to match "
14558 "the new size of the underlying device."
14562 #: ../fish/guestfish-actions.pod:4065
14563 msgid "pvresize-size"
14567 #: ../fish/guestfish-actions.pod:4067
14570 " pvresize-size device size\n"
14575 #: ../fish/guestfish-actions.pod:4069
14577 "This command is the same as L</pvresize> except that it allows you to "
14578 "specify the new size (in bytes) explicitly."
14582 #: ../fish/guestfish-actions.pod:4072
14587 #: ../fish/guestfish-actions.pod:4074
14595 #: ../fish/guestfish-actions.pod:4076 ../src/guestfs-actions.pod:6345
14597 "List all the physical volumes detected. This is the equivalent of the "
14598 "L<pvs(8)> command."
14602 #: ../fish/guestfish-actions.pod:4079 ../src/guestfs-actions.pod:6348
14604 "This returns a list of just the device names that contain PVs "
14605 "(eg. C</dev/sda2>)."
14609 #: ../fish/guestfish-actions.pod:4082
14610 msgid "See also L</pvs-full>."
14614 #: ../fish/guestfish-actions.pod:4084
14619 #: ../fish/guestfish-actions.pod:4086
14627 #: ../fish/guestfish-actions.pod:4088 ../src/guestfs-actions.pod:6364
14629 "List all the physical volumes detected. This is the equivalent of the "
14630 "L<pvs(8)> command. The \"full\" version includes all fields."
14634 #: ../fish/guestfish-actions.pod:4091
14639 #: ../fish/guestfish-actions.pod:4093
14647 #: ../fish/guestfish-actions.pod:4095 ../src/guestfs-actions.pod:6379
14648 msgid "This command returns the UUID of the LVM PV C<device>."
14652 #: ../fish/guestfish-actions.pod:4097
14657 #: ../fish/guestfish-actions.pod:4099
14660 " pwrite path content offset\n"
14665 #: ../fish/guestfish-actions.pod:4101 ../src/guestfs-actions.pod:6395
14667 "This command writes to part of a file. It writes the data buffer C<content> "
14668 "to the file C<path> starting at offset C<offset>."
14672 #: ../fish/guestfish-actions.pod:4104 ../src/guestfs-actions.pod:6398
14674 "This command implements the L<pwrite(2)> system call, and like that system "
14675 "call it may not write the full data requested. The return value is the "
14676 "number of bytes that were actually written to the file. This could even be "
14677 "0, although short writes are unlikely for regular files in ordinary "
14682 #: ../fish/guestfish-actions.pod:4110
14683 msgid "See also L</pread>, L</pwrite-device>."
14687 #: ../fish/guestfish-actions.pod:4115
14688 msgid "pwrite-device"
14692 #: ../fish/guestfish-actions.pod:4117
14695 " pwrite-device device content offset\n"
14700 #: ../fish/guestfish-actions.pod:4119 ../src/guestfs-actions.pod:6422
14702 "This command writes to part of a device. It writes the data buffer "
14703 "C<content> to C<device> starting at offset C<offset>."
14707 #: ../fish/guestfish-actions.pod:4122 ../src/guestfs-actions.pod:6425
14709 "This command implements the L<pwrite(2)> system call, and like that system "
14710 "call it may not write the full data requested (although short writes to disk "
14711 "devices and partitions are probably impossible with standard Linux kernels)."
14715 #: ../fish/guestfish-actions.pod:4127
14716 msgid "See also L</pwrite>."
14720 #: ../fish/guestfish-actions.pod:4132
14725 #: ../fish/guestfish-actions.pod:4134
14728 " read-file path\n"
14733 #: ../fish/guestfish-actions.pod:4136 ../src/guestfs-actions.pod:6446
14734 msgid "This calls returns the contents of the file C<path> as a buffer."
14738 #: ../fish/guestfish-actions.pod:4139
14740 "Unlike L</cat>, this function can correctly handle files that contain "
14741 "embedded ASCII NUL characters. However unlike L</download>, this function "
14742 "is limited in the total size of file that can be handled."
14746 #: ../fish/guestfish-actions.pod:4147
14751 #: ../fish/guestfish-actions.pod:4149
14754 " read-lines path\n"
14759 #: ../fish/guestfish-actions.pod:4153 ../src/guestfs-actions.pod:6471
14761 "The file contents are returned as a list of lines. Trailing C<LF> and "
14762 "C<CRLF> character sequences are I<not> returned."
14766 #: ../fish/guestfish-actions.pod:4156
14768 "Note that this function cannot correctly handle binary files (specifically, "
14769 "files containing C<\\0> character which is treated as end of line). For "
14770 "those you need to use the L</read-file> function which has a more complex "
14775 #: ../fish/guestfish-actions.pod:4161
14780 #: ../fish/guestfish-actions.pod:4163
14788 #: ../fish/guestfish-actions.pod:4165 ../src/guestfs-actions.pod:6491
14789 msgid "This returns the list of directory entries in directory C<dir>."
14793 #: ../fish/guestfish-actions.pod:4167 ../src/guestfs-actions.pod:6493
14795 "All entries in the directory are returned, including C<.> and C<..>. The "
14796 "entries are I<not> sorted, but returned in the same order as the underlying "
14801 #: ../fish/guestfish-actions.pod:4171 ../src/guestfs-actions.pod:6497
14803 "Also this call returns basic file type information about each file. The "
14804 "C<ftyp> field will contain one of the following characters:"
14808 #: ../fish/guestfish-actions.pod:4176 ../src/guestfs-actions.pod:6502
14813 #: ../fish/guestfish-actions.pod:4178 ../src/guestfs-actions.pod:6504
14814 msgid "Block special"
14818 #: ../fish/guestfish-actions.pod:4180 ../src/guestfs-actions.pod:6506
14823 #: ../fish/guestfish-actions.pod:4182 ../src/guestfs-actions.pod:6508
14824 msgid "Char special"
14828 #: ../fish/guestfish-actions.pod:4184 ../src/guestfs-actions.pod:6510
14833 #: ../fish/guestfish-actions.pod:4186 ../src/guestfs-actions.pod:6512
14838 #: ../fish/guestfish-actions.pod:4188 ../src/guestfs-actions.pod:6514
14843 #: ../fish/guestfish-actions.pod:4190 ../src/guestfs-actions.pod:6516
14844 msgid "FIFO (named pipe)"
14848 #: ../fish/guestfish-actions.pod:4192 ../src/guestfs-actions.pod:6518
14853 #: ../fish/guestfish-actions.pod:4194 ../src/guestfs-actions.pod:6520
14854 msgid "Symbolic link"
14858 #: ../fish/guestfish-actions.pod:4196 ../src/guestfs-actions.pod:6522
14863 #: ../fish/guestfish-actions.pod:4198 ../src/guestfs-actions.pod:6524
14864 msgid "Regular file"
14868 #: ../fish/guestfish-actions.pod:4200 ../src/guestfs-actions.pod:6526
14873 #: ../fish/guestfish-actions.pod:4202 ../src/guestfs-actions.pod:6528
14878 #: ../fish/guestfish-actions.pod:4204 ../src/guestfs-actions.pod:6530
14883 #: ../fish/guestfish-actions.pod:4206 ../src/guestfs-actions.pod:6532
14884 msgid "Unknown file type"
14888 #: ../fish/guestfish-actions.pod:4208 ../src/guestfs-actions.pod:6534
14893 #: ../fish/guestfish-actions.pod:4210 ../src/guestfs-actions.pod:6536
14894 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
14898 #: ../fish/guestfish-actions.pod:4215
14900 "This function is primarily intended for use by programs. To get a simple "
14901 "list of names, use L</ls>. To get a printable directory for human "
14902 "consumption, use L</ll>."
14906 #: ../fish/guestfish-actions.pod:4219
14911 #: ../fish/guestfish-actions.pod:4221
14919 #: ../fish/guestfish-actions.pod:4223 ../src/guestfs-actions.pod:6557
14920 msgid "This command reads the target of a symbolic link."
14924 #: ../fish/guestfish-actions.pod:4225
14925 msgid "readlinklist"
14929 #: ../fish/guestfish-actions.pod:4227
14932 " readlinklist path 'names ...'\n"
14937 #: ../fish/guestfish-actions.pod:4229 ../src/guestfs-actions.pod:6571
14939 "This call allows you to do a C<readlink> operation on multiple files, where "
14940 "all files are in the directory C<path>. C<names> is the list of files from "
14945 #: ../fish/guestfish-actions.pod:4233 ../src/guestfs-actions.pod:6575
14947 "On return you get a list of strings, with a one-to-one correspondence to the "
14948 "C<names> list. Each string is the value of the symbolic link."
14952 #: ../fish/guestfish-actions.pod:4237 ../src/guestfs-actions.pod:6579
14954 "If the C<readlink(2)> operation fails on any name, then the corresponding "
14955 "result string is the empty string C<\"\">. However the whole operation is "
14956 "completed even if there were C<readlink(2)> errors, and so you can call this "
14957 "function with names where you don't know if they are symbolic links already "
14958 "(albeit slightly less efficient)."
14962 #: ../fish/guestfish-actions.pod:4244 ../src/guestfs-actions.pod:6586
14964 "This call is intended for programs that want to efficiently list a directory "
14965 "contents without making many round-trips. Very long directory listings "
14966 "might cause the protocol message size to be exceeded, causing this call to "
14967 "fail. The caller must split up such requests into smaller groups of names."
14971 #: ../fish/guestfish-actions.pod:4251
14976 #: ../fish/guestfish-actions.pod:4253
14984 #: ../fish/guestfish-actions.pod:4255 ../src/guestfs-actions.pod:6605
14986 "Return the canonicalized absolute pathname of C<path>. The returned path "
14987 "has no C<.>, C<..> or symbolic link path elements."
14991 #: ../fish/guestfish-actions.pod:4258
14992 msgid "removexattr"
14996 #: ../fish/guestfish-actions.pod:4260
14999 " removexattr xattr path\n"
15004 #: ../fish/guestfish-actions.pod:4262 ../src/guestfs-actions.pod:6620
15005 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
15009 #: ../fish/guestfish-actions.pod:4265
15010 msgid "See also: L</lremovexattr>, L<attr(5)>."
15014 #: ../fish/guestfish-actions.pod:4267
15019 #: ../fish/guestfish-actions.pod:4269
15022 " resize2fs device\n"
15027 #: ../fish/guestfish-actions.pod:4271 ../src/guestfs-actions.pod:6635
15029 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
15030 "underlying device."
15034 #: ../fish/guestfish-actions.pod:4274
15036 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
15037 "before calling this command. For unknown reasons C<resize2fs> sometimes "
15038 "gives an error about this and sometimes not. In any case, it is always safe "
15039 "to call L</e2fsck-f> before calling this function."
15043 #: ../fish/guestfish-actions.pod:4280
15044 msgid "resize2fs-M"
15048 #: ../fish/guestfish-actions.pod:4282
15051 " resize2fs-M device\n"
15056 #: ../fish/guestfish-actions.pod:4284
15058 "This command is the same as L</resize2fs>, but the filesystem is resized to "
15059 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
15064 #: ../fish/guestfish-actions.pod:4288
15066 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
15067 "and read the C<Block size> and C<Block count> values. These two numbers, "
15068 "multiplied together, give the resulting size of the minimal filesystem in "
15073 #: ../fish/guestfish-actions.pod:4293
15074 msgid "resize2fs-size"
15078 #: ../fish/guestfish-actions.pod:4295
15081 " resize2fs-size device size\n"
15086 #: ../fish/guestfish-actions.pod:4297
15088 "This command is the same as L</resize2fs> except that it allows you to "
15089 "specify the new size (in bytes) explicitly."
15093 #: ../fish/guestfish-actions.pod:4300
15098 #: ../fish/guestfish-actions.pod:4302
15106 #: ../fish/guestfish-actions.pod:4304 ../src/guestfs-actions.pod:6687
15107 msgid "Remove the single file C<path>."
15111 #: ../fish/guestfish-actions.pod:4306
15116 #: ../fish/guestfish-actions.pod:4308
15124 #: ../fish/guestfish-actions.pod:4310 ../src/guestfs-actions.pod:6699
15126 "Remove the file or directory C<path>, recursively removing the contents if "
15127 "its a directory. This is like the C<rm -rf> shell command."
15131 #: ../fish/guestfish-actions.pod:4314
15136 #: ../fish/guestfish-actions.pod:4316
15144 #: ../fish/guestfish-actions.pod:4318 ../src/guestfs-actions.pod:6713
15145 msgid "Remove the single directory C<path>."
15149 #: ../fish/guestfish-actions.pod:4320
15150 msgid "rmmountpoint"
15154 #: ../fish/guestfish-actions.pod:4322
15157 " rmmountpoint exemptpath\n"
15162 #: ../fish/guestfish-actions.pod:4324
15164 "This calls removes a mountpoint that was previously created with "
15165 "L</mkmountpoint>. See L</mkmountpoint> for full details."
15169 #: ../fish/guestfish-actions.pod:4328
15170 msgid "scrub-device"
15174 #: ../fish/guestfish-actions.pod:4330
15177 " scrub-device device\n"
15182 #: ../fish/guestfish-actions.pod:4332 ../src/guestfs-actions.pod:6739
15184 "This command writes patterns over C<device> to make data retrieval more "
15189 #: ../fish/guestfish-actions.pod:4335 ../fish/guestfish-actions.pod:4347 ../fish/guestfish-actions.pod:4360 ../src/guestfs-actions.pod:6742 ../src/guestfs-actions.pod:6760 ../src/guestfs-actions.pod:6779
15191 "It is an interface to the L<scrub(1)> program. See that manual page for "
15196 #: ../fish/guestfish-actions.pod:4338
15201 #: ../fish/guestfish-actions.pod:4340
15204 " scrub-file file\n"
15209 #: ../fish/guestfish-actions.pod:4342 ../src/guestfs-actions.pod:6755
15211 "This command writes patterns over a file to make data retrieval more "
15216 #: ../fish/guestfish-actions.pod:4345 ../src/guestfs-actions.pod:6758
15217 msgid "The file is I<removed> after scrubbing."
15221 #: ../fish/guestfish-actions.pod:4350
15222 msgid "scrub-freespace"
15226 #: ../fish/guestfish-actions.pod:4352
15229 " scrub-freespace dir\n"
15234 #: ../fish/guestfish-actions.pod:4354
15236 "This command creates the directory C<dir> and then fills it with files until "
15237 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
15238 "deletes them. The intention is to scrub any free space on the partition "
15239 "containing C<dir>."
15243 #: ../fish/guestfish-actions.pod:4363
15248 #: ../fish/guestfish-actions.pod:4365
15253 #: ../fish/guestfish-actions.pod:4367
15256 " set-append append\n"
15261 #: ../fish/guestfish-actions.pod:4369 ../src/guestfs-actions.pod:6792
15263 "This function is used to add additional options to the guest kernel command "
15268 #: ../fish/guestfish-actions.pod:4372 ../src/guestfs-actions.pod:6795
15270 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
15271 "environment variable."
15275 #: ../fish/guestfish-actions.pod:4375 ../src/guestfs-actions.pod:6798
15277 "Setting C<append> to C<NULL> means I<no> additional options are passed "
15278 "(libguestfs always adds a few of its own)."
15282 #: ../fish/guestfish-actions.pod:4378
15283 msgid "set-attach-method"
15287 #: ../fish/guestfish-actions.pod:4380
15288 msgid "attach-method"
15292 #: ../fish/guestfish-actions.pod:4382
15295 " set-attach-method attachmethod\n"
15300 #: ../fish/guestfish-actions.pod:4384 ../src/guestfs-actions.pod:6811
15302 "Set the method that libguestfs uses to connect to the back end guestfsd "
15303 "daemon. Possible methods are:"
15307 #: ../fish/guestfish-actions.pod:4389 ../src/guestfs-actions.pod:6816 ../src/guestfs.pod:2916
15308 msgid "C<appliance>"
15312 #: ../fish/guestfish-actions.pod:4391 ../src/guestfs-actions.pod:6818
15314 "Launch an appliance and connect to it. This is the ordinary method and the "
15319 #: ../fish/guestfish-actions.pod:4394 ../src/guestfs-actions.pod:6821
15320 msgid "C<unix:I<path>>"
15324 #: ../fish/guestfish-actions.pod:4396 ../src/guestfs-actions.pod:6823
15325 msgid "Connect to the Unix domain socket I<path>."
15329 #: ../fish/guestfish-actions.pod:4398 ../src/guestfs-actions.pod:6825
15331 "This method lets you connect to an existing daemon or (using virtio-serial) "
15332 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
15333 "RUNNING DAEMONS>."
15337 #: ../fish/guestfish-actions.pod:4404
15338 msgid "set-autosync"
15342 #: ../fish/guestfish-actions.pod:4406
15347 #: ../fish/guestfish-actions.pod:4408
15350 " set-autosync true|false\n"
15355 #: ../fish/guestfish-actions.pod:4410 ../src/guestfs-actions.pod:6841
15357 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
15358 "effort attempt to make filesystems consistent and synchronized when the "
15359 "handle is closed (also if the program exits without closing handles)."
15363 #: ../fish/guestfish-actions.pod:4415 ../src/guestfs-actions.pod:6846
15365 "This is enabled by default (since libguestfs 1.5.24, previously it was "
15366 "disabled by default)."
15370 #: ../fish/guestfish-actions.pod:4418
15375 #: ../fish/guestfish-actions.pod:4420
15380 #: ../fish/guestfish-actions.pod:4422
15383 " set-direct true|false\n"
15388 #: ../fish/guestfish-actions.pod:4424 ../src/guestfs-actions.pod:6859
15390 "If the direct appliance mode flag is enabled, then stdin and stdout are "
15391 "passed directly through to the appliance once it is launched."
15395 #: ../fish/guestfish-actions.pod:4428
15397 "One consequence of this is that log messages aren't caught by the library "
15398 "and handled by L</set-log-message-callback>, but go straight to stdout."
15402 #: ../fish/guestfish-actions.pod:4432 ../src/guestfs-actions.pod:6867
15403 msgid "You probably don't want to use this unless you know what you are doing."
15407 #: ../fish/guestfish-actions.pod:4435 ../src/guestfs-actions.pod:6870
15408 msgid "The default is disabled."
15412 #: ../fish/guestfish-actions.pod:4437
15413 msgid "set-e2label"
15417 #: ../fish/guestfish-actions.pod:4439
15420 " set-e2label device label\n"
15425 #: ../fish/guestfish-actions.pod:4441 ../src/guestfs-actions.pod:6883
15427 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
15428 "C<label>. Filesystem labels are limited to 16 characters."
15432 #: ../fish/guestfish-actions.pod:4445
15434 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
15435 "label on a filesystem."
15439 #: ../fish/guestfish-actions.pod:4448
15444 #: ../fish/guestfish-actions.pod:4450
15447 " set-e2uuid device uuid\n"
15452 #: ../fish/guestfish-actions.pod:4452 ../src/guestfs-actions.pod:6901
15454 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
15455 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
15456 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
15460 #: ../fish/guestfish-actions.pod:4457
15462 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
15463 "UUID of a filesystem."
15467 #: ../fish/guestfish-actions.pod:4460
15468 msgid "set-memsize"
15472 #: ../fish/guestfish-actions.pod:4462
15477 #: ../fish/guestfish-actions.pod:4464
15480 " set-memsize memsize\n"
15485 #: ../fish/guestfish-actions.pod:4466
15487 "This sets the memory size in megabytes allocated to the qemu subprocess. "
15488 "This only has any effect if called before L</launch>."
15492 #: ../fish/guestfish-actions.pod:4470 ../src/guestfs-actions.pod:6923
15494 "You can also change this by setting the environment variable "
15495 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
15499 #: ../fish/guestfish-actions.pod:4477
15500 msgid "set-network"
15504 #: ../fish/guestfish-actions.pod:4479
15509 #: ../fish/guestfish-actions.pod:4481
15512 " set-network true|false\n"
15517 #: ../fish/guestfish-actions.pod:4483 ../src/guestfs-actions.pod:6940
15519 "If C<network> is true, then the network is enabled in the libguestfs "
15520 "appliance. The default is false."
15524 #: ../fish/guestfish-actions.pod:4486 ../src/guestfs-actions.pod:6943
15526 "This affects whether commands are able to access the network (see "
15527 "L<guestfs(3)/RUNNING COMMANDS>)."
15531 #: ../fish/guestfish-actions.pod:4489
15532 msgid "You must call this before calling L</launch>, otherwise it has no effect."
15536 #: ../fish/guestfish-actions.pod:4492
15541 #: ../fish/guestfish-actions.pod:4496
15544 " set-path searchpath\n"
15549 #: ../fish/guestfish-actions.pod:4498 ../src/guestfs-actions.pod:6959
15550 msgid "Set the path that libguestfs searches for kernel and initrd.img."
15554 #: ../fish/guestfish-actions.pod:4500 ../src/guestfs-actions.pod:6961
15556 "The default is C<$libdir/guestfs> unless overridden by setting "
15557 "C<LIBGUESTFS_PATH> environment variable."
15561 #: ../fish/guestfish-actions.pod:4503 ../src/guestfs-actions.pod:6964
15562 msgid "Setting C<path> to C<NULL> restores the default path."
15566 #: ../fish/guestfish-actions.pod:4505
15571 #: ../fish/guestfish-actions.pod:4507
15576 #: ../fish/guestfish-actions.pod:4509
15579 " set-pgroup true|false\n"
15584 #: ../fish/guestfish-actions.pod:4511 ../src/guestfs-actions.pod:6976
15586 "If C<pgroup> is true, child processes are placed into their own process "
15591 #: ../fish/guestfish-actions.pod:4514 ../src/guestfs-actions.pod:6979
15593 "The practical upshot of this is that signals like C<SIGINT> (from users "
15594 "pressing C<^C>) won't be received by the child process."
15598 #: ../fish/guestfish-actions.pod:4517 ../src/guestfs-actions.pod:6982
15600 "The default for this flag is false, because usually you want C<^C> to kill "
15605 #: ../fish/guestfish-actions.pod:4520
15610 #: ../fish/guestfish-actions.pod:4522
15615 #: ../fish/guestfish-actions.pod:4524
15623 #: ../fish/guestfish-actions.pod:4526 ../src/guestfs-actions.pod:6995
15624 msgid "Set the qemu binary that we will use."
15628 #: ../fish/guestfish-actions.pod:4528 ../src/guestfs-actions.pod:6997
15629 msgid "The default is chosen when the library was compiled by the configure script."
15633 #: ../fish/guestfish-actions.pod:4531 ../src/guestfs-actions.pod:7000
15635 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
15640 #: ../fish/guestfish-actions.pod:4534 ../src/guestfs-actions.pod:7003
15641 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
15645 #: ../fish/guestfish-actions.pod:4536 ../src/guestfs-actions.pod:7005
15647 "Note that you should call this function as early as possible after creating "
15648 "the handle. This is because some pre-launch operations depend on testing "
15649 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
15650 "don't retest features, and so you might see inconsistent results. Using the "
15651 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
15652 "the qemu binary at the same time as the handle is created."
15656 #: ../fish/guestfish-actions.pod:4544
15657 msgid "set-recovery-proc"
15661 #: ../fish/guestfish-actions.pod:4546
15662 msgid "recovery-proc"
15666 #: ../fish/guestfish-actions.pod:4548
15669 " set-recovery-proc true|false\n"
15674 #: ../fish/guestfish-actions.pod:4550
15676 "If this is called with the parameter C<false> then L</launch> does not "
15677 "create a recovery process. The purpose of the recovery process is to stop "
15678 "runaway qemu processes in the case where the main program aborts abruptly."
15682 #: ../fish/guestfish-actions.pod:4555
15684 "This only has any effect if called before L</launch>, and the default is "
15689 #: ../fish/guestfish-actions.pod:4558 ../src/guestfs-actions.pod:7031
15691 "About the only time when you would want to disable this is if the main "
15692 "process will fork itself into the background (\"daemonize\" itself). In "
15693 "this case the recovery process thinks that the main program has disappeared "
15694 "and so kills qemu, which is not very helpful."
15698 #: ../fish/guestfish-actions.pod:4564
15699 msgid "set-selinux"
15703 #: ../fish/guestfish-actions.pod:4566
15708 #: ../fish/guestfish-actions.pod:4568
15711 " set-selinux true|false\n"
15716 #: ../fish/guestfish-actions.pod:4570 ../src/guestfs-actions.pod:7047
15718 "This sets the selinux flag that is passed to the appliance at boot time. "
15719 "The default is C<selinux=0> (disabled)."
15723 #: ../fish/guestfish-actions.pod:4573 ../src/guestfs-actions.pod:7050
15725 "Note that if SELinux is enabled, it is always in Permissive mode "
15726 "(C<enforcing=0>)."
15730 #: ../fish/guestfish-actions.pod:4579
15735 #: ../fish/guestfish-actions.pod:4581
15740 #: ../fish/guestfish-actions.pod:4583
15748 #: ../fish/guestfish-actions.pod:4585 ../src/guestfs-actions.pod:7066
15750 "Change the number of virtual CPUs assigned to the appliance. The default is "
15751 "C<1>. Increasing this may improve performance, though often it has no "
15756 #: ../fish/guestfish-actions.pod:4589
15757 msgid "This function must be called before L</launch>."
15761 #: ../fish/guestfish-actions.pod:4591
15766 #: ../fish/guestfish-actions.pod:4593
15771 #: ../fish/guestfish-actions.pod:4595
15774 " set-trace true|false\n"
15779 #: ../fish/guestfish-actions.pod:4597 ../src/guestfs-actions.pod:7082
15781 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
15782 "return values are traced."
15786 #: ../fish/guestfish-actions.pod:4600 ../src/guestfs-actions.pod:7085
15788 "If you want to trace C API calls into libguestfs (and other libraries) then "
15789 "possibly a better way is to use the external ltrace(1) command."
15793 #: ../fish/guestfish-actions.pod:4604 ../src/guestfs-actions.pod:7089
15795 "Command traces are disabled unless the environment variable "
15796 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
15800 #: ../fish/guestfish-actions.pod:4607
15802 "Trace messages are normally sent to C<stderr>, unless you register a "
15803 "callback to send them somewhere else (see L</set-event-callback>)."
15807 #: ../fish/guestfish-actions.pod:4611
15808 msgid "set-verbose"
15812 #: ../fish/guestfish-actions.pod:4613
15817 #: ../fish/guestfish-actions.pod:4615
15820 " set-verbose true|false\n"
15825 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:7106
15826 msgid "If C<verbose> is true, this turns on verbose messages."
15830 #: ../fish/guestfish-actions.pod:4619 ../src/guestfs-actions.pod:7108
15832 "Verbose messages are disabled unless the environment variable "
15833 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
15837 #: ../fish/guestfish-actions.pod:4622
15839 "Verbose messages are normally sent to C<stderr>, unless you register a "
15840 "callback to send them somewhere else (see L</set-event-callback>)."
15844 #: ../fish/guestfish-actions.pod:4626
15849 #: ../fish/guestfish-actions.pod:4628
15852 " setcon context\n"
15857 #: ../fish/guestfish-actions.pod:4630 ../src/guestfs-actions.pod:7125
15859 "This sets the SELinux security context of the daemon to the string "
15864 #: ../fish/guestfish-actions.pod:4633 ../src/guestfs-actions.pod:7128
15865 msgid "See the documentation about SELINUX in L<guestfs(3)>."
15869 #: ../fish/guestfish-actions.pod:4635
15874 #: ../fish/guestfish-actions.pod:4637
15877 " setxattr xattr val vallen path\n"
15882 #: ../fish/guestfish-actions.pod:4639 ../src/guestfs-actions.pod:7143
15884 "This call sets the extended attribute named C<xattr> of the file C<path> to "
15885 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
15889 #: ../fish/guestfish-actions.pod:4643
15890 msgid "See also: L</lsetxattr>, L<attr(5)>."
15894 #: ../fish/guestfish-actions.pod:4645
15899 #: ../fish/guestfish-actions.pod:4647
15902 " sfdisk device cyls heads sectors 'lines ...'\n"
15907 #: ../fish/guestfish-actions.pod:4649 ../src/guestfs-actions.pod:7170
15909 "This is a direct interface to the L<sfdisk(8)> program for creating "
15910 "partitions on block devices."
15914 #: ../fish/guestfish-actions.pod:4652 ../src/guestfs-actions.pod:7173
15915 msgid "C<device> should be a block device, for example C</dev/sda>."
15919 #: ../fish/guestfish-actions.pod:4654 ../src/guestfs-actions.pod:7175
15921 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
15922 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
15923 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
15924 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
15925 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
15926 "the kernel) cannot work out the right geometry and you will need to tell it."
15930 #: ../fish/guestfish-actions.pod:4662 ../src/guestfs-actions.pod:7183
15932 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
15933 "refer to the L<sfdisk(8)> manpage."
15937 #: ../fish/guestfish-actions.pod:4665 ../src/guestfs-actions.pod:7186
15939 "To create a single partition occupying the whole disk, you would pass "
15940 "C<lines> as a single element list, when the single element being the string "
15945 #: ../fish/guestfish-actions.pod:4669
15946 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
15950 #: ../fish/guestfish-actions.pod:4672 ../fish/guestfish-actions.pod:4692 ../fish/guestfish-actions.pod:4711
15952 "I<This function is deprecated.> In new code, use the L</part_add> call "
15957 #: ../fish/guestfish-actions.pod:4679
15962 #: ../fish/guestfish-actions.pod:4681
15965 " sfdiskM device 'lines ...'\n"
15970 #: ../fish/guestfish-actions.pod:4683
15972 "This is a simplified interface to the L</sfdisk> command, where partition "
15973 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
15974 "you don't need to specify the cyls, heads and sectors parameters which were "
15975 "rarely if ever used anyway."
15979 #: ../fish/guestfish-actions.pod:4689
15980 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
15984 #: ../fish/guestfish-actions.pod:4699
15989 #: ../fish/guestfish-actions.pod:4701
15992 " sfdisk-N device partnum cyls heads sectors line\n"
15997 #: ../fish/guestfish-actions.pod:4703 ../src/guestfs-actions.pod:7242
15999 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
16000 "(note: C<n> counts from 1)."
16004 #: ../fish/guestfish-actions.pod:4706
16006 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
16007 "cyls/heads/sectors parameters."
16011 #: ../fish/guestfish-actions.pod:4709
16012 msgid "See also: L</part-add>"
16016 #: ../fish/guestfish-actions.pod:4718
16017 msgid "sfdisk-disk-geometry"
16021 #: ../fish/guestfish-actions.pod:4720
16024 " sfdisk-disk-geometry device\n"
16029 #: ../fish/guestfish-actions.pod:4722
16031 "This displays the disk geometry of C<device> read from the partition table. "
16032 "Especially in the case where the underlying block device has been resized, "
16033 "this can be different from the kernel's idea of the geometry (see "
16034 "L</sfdisk-kernel-geometry>)."
16038 #: ../fish/guestfish-actions.pod:4727 ../fish/guestfish-actions.pod:4736 ../src/guestfs-actions.pod:7265 ../src/guestfs-actions.pod:7281
16039 msgid "The result is in human-readable format, and not designed to be parsed."
16043 #: ../fish/guestfish-actions.pod:4730
16044 msgid "sfdisk-kernel-geometry"
16048 #: ../fish/guestfish-actions.pod:4732
16051 " sfdisk-kernel-geometry device\n"
16056 #: ../fish/guestfish-actions.pod:4734 ../src/guestfs-actions.pod:7279
16057 msgid "This displays the kernel's idea of the geometry of C<device>."
16061 #: ../fish/guestfish-actions.pod:4739
16066 #: ../fish/guestfish-actions.pod:4741
16069 " sfdisk-l device\n"
16074 #: ../fish/guestfish-actions.pod:4743 ../src/guestfs-actions.pod:7302
16076 "This displays the partition table on C<device>, in the human-readable output "
16077 "of the L<sfdisk(8)> command. It is not intended to be parsed."
16081 #: ../fish/guestfish-actions.pod:4747
16082 msgid "See also: L</part-list>"
16086 #: ../fish/guestfish-actions.pod:4749
16088 "I<This function is deprecated.> In new code, use the L</part_list> call "
16093 #: ../fish/guestfish-actions.pod:4756
16098 #: ../fish/guestfish-actions.pod:4758
16106 #: ../fish/guestfish-actions.pod:4760 ../src/guestfs-actions.pod:7319
16108 "This call runs a command from the guest filesystem via the guest's "
16113 #: ../fish/guestfish-actions.pod:4763
16114 msgid "This is like L</command>, but passes the command to:"
16118 #: ../fish/guestfish-actions.pod:4765 ../src/guestfs-actions.pod:7324
16121 " /bin/sh -c \"command\"\n"
16126 #: ../fish/guestfish-actions.pod:4767 ../src/guestfs-actions.pod:7326
16128 "Depending on the guest's shell, this usually results in wildcards being "
16129 "expanded, shell expressions being interpolated and so on."
16133 #: ../fish/guestfish-actions.pod:4771
16134 msgid "All the provisos about L</command> apply to this call."
16138 #: ../fish/guestfish-actions.pod:4773
16143 #: ../fish/guestfish-actions.pod:4775
16146 " sh-lines command\n"
16151 #: ../fish/guestfish-actions.pod:4777
16152 msgid "This is the same as L</sh>, but splits the result into a list of lines."
16156 #: ../fish/guestfish-actions.pod:4780
16157 msgid "See also: L</command-lines>"
16161 #: ../fish/guestfish-actions.pod:4782
16166 #: ../fish/guestfish-actions.pod:4784
16174 #: ../fish/guestfish-actions.pod:4786 ../src/guestfs-actions.pod:7360
16175 msgid "Sleep for C<secs> seconds."
16179 #: ../fish/guestfish-actions.pod:4788
16184 #: ../fish/guestfish-actions.pod:4790
16192 #: ../fish/guestfish-actions.pod:4794 ../src/guestfs-actions.pod:7374
16193 msgid "This is the same as the C<stat(2)> system call."
16197 #: ../fish/guestfish-actions.pod:4796
16202 #: ../fish/guestfish-actions.pod:4798
16210 #: ../fish/guestfish-actions.pod:4800 ../src/guestfs-actions.pod:7388
16212 "Returns file system statistics for any mounted file system. C<path> should "
16213 "be a file or directory in the mounted file system (typically it is the mount "
16214 "point itself, but it doesn't need to be)."
16218 #: ../fish/guestfish-actions.pod:4804 ../src/guestfs-actions.pod:7392
16219 msgid "This is the same as the C<statvfs(2)> system call."
16223 #: ../fish/guestfish-actions.pod:4806
16228 #: ../fish/guestfish-actions.pod:4808
16236 #: ../fish/guestfish-actions.pod:4810 ../src/guestfs-actions.pod:7406
16238 "This runs the L<strings(1)> command on a file and returns the list of "
16239 "printable strings found."
16243 #: ../fish/guestfish-actions.pod:4816
16248 #: ../fish/guestfish-actions.pod:4818
16251 " strings-e encoding path\n"
16256 #: ../fish/guestfish-actions.pod:4820
16258 "This is like the L</strings> command, but allows you to specify the encoding "
16259 "of strings that are looked for in the source file C<path>."
16263 #: ../fish/guestfish-actions.pod:4824 ../src/guestfs-actions.pod:7429
16264 msgid "Allowed encodings are:"
16268 #: ../fish/guestfish-actions.pod:4828 ../src/guestfs-actions.pod:7433
16273 #: ../fish/guestfish-actions.pod:4830
16275 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
16276 "ISO-8859-X (this is what L</strings> uses)."
16280 #: ../fish/guestfish-actions.pod:4833 ../src/guestfs-actions.pod:7438
16285 #: ../fish/guestfish-actions.pod:4835 ../src/guestfs-actions.pod:7440
16286 msgid "Single 8-bit-byte characters."
16290 #: ../fish/guestfish-actions.pod:4837 ../src/guestfs-actions.pod:7442
16295 #: ../fish/guestfish-actions.pod:4839 ../src/guestfs-actions.pod:7444
16296 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
16300 #: ../fish/guestfish-actions.pod:4842 ../src/guestfs-actions.pod:7447
16301 msgid "l (lower case letter L)"
16305 #: ../fish/guestfish-actions.pod:4844 ../src/guestfs-actions.pod:7449
16307 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
16308 "examining binaries in Windows guests."
16312 #: ../fish/guestfish-actions.pod:4847 ../src/guestfs-actions.pod:7452
16317 #: ../fish/guestfish-actions.pod:4849 ../src/guestfs-actions.pod:7454
16318 msgid "32-bit big endian such as UCS-4BE."
16322 #: ../fish/guestfish-actions.pod:4851 ../src/guestfs-actions.pod:7456
16327 #: ../fish/guestfish-actions.pod:4853 ../src/guestfs-actions.pod:7458
16328 msgid "32-bit little endian such as UCS-4LE."
16332 #: ../fish/guestfish-actions.pod:4857 ../src/guestfs-actions.pod:7462
16333 msgid "The returned strings are transcoded to UTF-8."
16337 #: ../fish/guestfish-actions.pod:4862
16338 msgid "swapoff-device"
16342 #: ../fish/guestfish-actions.pod:4864
16345 " swapoff-device device\n"
16350 #: ../fish/guestfish-actions.pod:4866
16352 "This command disables the libguestfs appliance swap device or partition "
16353 "named C<device>. See L</swapon-device>."
16357 #: ../fish/guestfish-actions.pod:4870
16358 msgid "swapoff-file"
16362 #: ../fish/guestfish-actions.pod:4872
16365 " swapoff-file file\n"
16370 #: ../fish/guestfish-actions.pod:4874 ../src/guestfs-actions.pod:7493
16371 msgid "This command disables the libguestfs appliance swap on file."
16375 #: ../fish/guestfish-actions.pod:4876
16376 msgid "swapoff-label"
16380 #: ../fish/guestfish-actions.pod:4878
16383 " swapoff-label label\n"
16388 #: ../fish/guestfish-actions.pod:4880 ../src/guestfs-actions.pod:7505
16390 "This command disables the libguestfs appliance swap on labeled swap "
16395 #: ../fish/guestfish-actions.pod:4883
16396 msgid "swapoff-uuid"
16400 #: ../fish/guestfish-actions.pod:4885
16403 " swapoff-uuid uuid\n"
16408 #: ../fish/guestfish-actions.pod:4887 ../src/guestfs-actions.pod:7518
16410 "This command disables the libguestfs appliance swap partition with the given "
16415 #: ../fish/guestfish-actions.pod:4890
16416 msgid "swapon-device"
16420 #: ../fish/guestfish-actions.pod:4892
16423 " swapon-device device\n"
16428 #: ../fish/guestfish-actions.pod:4894
16430 "This command enables the libguestfs appliance to use the swap device or "
16431 "partition named C<device>. The increased memory is made available for all "
16432 "commands, for example those run using L</command> or L</sh>."
16436 #: ../fish/guestfish-actions.pod:4899 ../src/guestfs-actions.pod:7536
16438 "Note that you should not swap to existing guest swap partitions unless you "
16439 "know what you are doing. They may contain hibernation information, or other "
16440 "information that the guest doesn't want you to trash. You also risk leaking "
16441 "information about the host to the guest this way. Instead, attach a new "
16442 "host device to the guest and swap on that."
16446 #: ../fish/guestfish-actions.pod:4906
16447 msgid "swapon-file"
16451 #: ../fish/guestfish-actions.pod:4908
16454 " swapon-file file\n"
16459 #: ../fish/guestfish-actions.pod:4910
16460 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
16464 #: ../fish/guestfish-actions.pod:4913
16465 msgid "swapon-label"
16469 #: ../fish/guestfish-actions.pod:4915
16472 " swapon-label label\n"
16477 #: ../fish/guestfish-actions.pod:4917
16479 "This command enables swap to a labeled swap partition. See "
16480 "L</swapon-device> for other notes."
16484 #: ../fish/guestfish-actions.pod:4920
16485 msgid "swapon-uuid"
16489 #: ../fish/guestfish-actions.pod:4922
16492 " swapon-uuid uuid\n"
16497 #: ../fish/guestfish-actions.pod:4924
16499 "This command enables swap to a swap partition with the given UUID. See "
16500 "L</swapon-device> for other notes."
16504 #: ../fish/guestfish-actions.pod:4927
16509 #: ../fish/guestfish-actions.pod:4929
16517 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7591
16519 "This syncs the disk, so that any writes are flushed through to the "
16520 "underlying disk image."
16524 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7594
16526 "You should always call this if you have modified a disk image, before "
16527 "closing the handle."
16531 #: ../fish/guestfish-actions.pod:4937
16536 #: ../fish/guestfish-actions.pod:4939
16544 #: ../fish/guestfish-actions.pod:4941 ../src/guestfs-actions.pod:7607
16545 msgid "This command returns up to the last 10 lines of a file as a list of strings."
16549 #: ../fish/guestfish-actions.pod:4947
16554 #: ../fish/guestfish-actions.pod:4949
16557 " tail-n nrlines path\n"
16562 #: ../fish/guestfish-actions.pod:4951 ../src/guestfs-actions.pod:7626
16564 "If the parameter C<nrlines> is a positive number, this returns the last "
16565 "C<nrlines> lines of the file C<path>."
16569 #: ../fish/guestfish-actions.pod:4954 ../src/guestfs-actions.pod:7629
16571 "If the parameter C<nrlines> is a negative number, this returns lines from "
16572 "the file C<path>, starting with the C<-nrlines>th line."
16576 #: ../fish/guestfish-actions.pod:4962
16581 #: ../fish/guestfish-actions.pod:4964
16584 " tar-in (tarfile|-) directory\n"
16589 #: ../fish/guestfish-actions.pod:4966 ../src/guestfs-actions.pod:7650
16591 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
16592 "tar file) into C<directory>."
16596 #: ../fish/guestfish-actions.pod:4969
16597 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
16601 #: ../fish/guestfish-actions.pod:4974
16606 #: ../fish/guestfish-actions.pod:4976
16609 " tar-out directory (tarfile|-)\n"
16614 #: ../fish/guestfish-actions.pod:4978 ../src/guestfs-actions.pod:7667
16616 "This command packs the contents of C<directory> and downloads it to local "
16621 #: ../fish/guestfish-actions.pod:4981
16622 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
16626 #: ../fish/guestfish-actions.pod:4986
16631 #: ../fish/guestfish-actions.pod:4988
16634 " tgz-in (tarball|-) directory\n"
16639 #: ../fish/guestfish-actions.pod:4990 ../src/guestfs-actions.pod:7684
16641 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
16642 "tar file) into C<directory>."
16646 #: ../fish/guestfish-actions.pod:4993
16647 msgid "To upload an uncompressed tarball, use L</tar-in>."
16651 #: ../fish/guestfish-actions.pod:4997
16656 #: ../fish/guestfish-actions.pod:4999
16659 " tgz-out directory (tarball|-)\n"
16664 #: ../fish/guestfish-actions.pod:5001 ../src/guestfs-actions.pod:7700
16666 "This command packs the contents of C<directory> and downloads it to local "
16671 #: ../fish/guestfish-actions.pod:5004
16672 msgid "To download an uncompressed tarball, use L</tar-out>."
16676 #: ../fish/guestfish-actions.pod:5008
16681 #: ../fish/guestfish-actions.pod:5010
16689 #: ../fish/guestfish-actions.pod:5012 ../src/guestfs-actions.pod:7715
16691 "Touch acts like the L<touch(1)> command. It can be used to update the "
16692 "timestamps on a file, or, if the file does not exist, to create a new "
16693 "zero-length file."
16697 #: ../fish/guestfish-actions.pod:5016 ../src/guestfs-actions.pod:7719
16699 "This command only works on regular files, and will fail on other file types "
16700 "such as directories, symbolic links, block special etc."
16704 #: ../fish/guestfish-actions.pod:5019
16709 #: ../fish/guestfish-actions.pod:5021
16717 #: ../fish/guestfish-actions.pod:5023 ../src/guestfs-actions.pod:7732
16719 "This command truncates C<path> to a zero-length file. The file must exist "
16724 #: ../fish/guestfish-actions.pod:5026
16725 msgid "truncate-size"
16729 #: ../fish/guestfish-actions.pod:5028
16732 " truncate-size path size\n"
16737 #: ../fish/guestfish-actions.pod:5030 ../src/guestfs-actions.pod:7746
16739 "This command truncates C<path> to size C<size> bytes. The file must exist "
16744 #: ../fish/guestfish-actions.pod:5033
16746 "If the current file size is less than C<size> then the file is extended to "
16747 "the required size with zero bytes. This creates a sparse file (ie. disk "
16748 "blocks are not allocated for the file until you write to it). To create a "
16749 "non-sparse file of zeroes, use L</fallocate64> instead."
16753 #: ../fish/guestfish-actions.pod:5039
16758 #: ../fish/guestfish-actions.pod:5041
16761 " tune2fs device [force:true|false] [maxmountcount:N] [mountcount:N] "
16762 "[errorbehavior:..] [group:N] [intervalbetweenchecks:N] "
16763 "[reservedblockspercentage:N] [lastmounteddirectory:..] "
16764 "[reservedblockscount:N] [user:N]\n"
16769 #: ../fish/guestfish-actions.pod:5043 ../src/guestfs-actions.pod:7782
16771 "This call allows you to adjust various filesystem parameters of an "
16772 "ext2/ext3/ext4 filesystem called C<device>."
16776 #: ../fish/guestfish-actions.pod:5052 ../src/guestfs-actions.pod:7791
16778 "Force tune2fs to complete the operation even in the face of errors. This is "
16779 "the same as the tune2fs C<-f> option."
16783 #: ../fish/guestfish-actions.pod:5055 ../src/guestfs-actions.pod:7794
16784 msgid "C<maxmountcount>"
16788 #: ../fish/guestfish-actions.pod:5057 ../src/guestfs-actions.pod:7796
16790 "Set the number of mounts after which the filesystem is checked by "
16791 "L<e2fsck(8)>. If this is C<0> then the number of mounts is disregarded. "
16792 "This is the same as the tune2fs C<-c> option."
16796 #: ../fish/guestfish-actions.pod:5061 ../src/guestfs-actions.pod:7800
16797 msgid "C<mountcount>"
16801 #: ../fish/guestfish-actions.pod:5063 ../src/guestfs-actions.pod:7802
16803 "Set the number of times the filesystem has been mounted. This is the same "
16804 "as the tune2fs C<-C> option."
16808 #: ../fish/guestfish-actions.pod:5066 ../src/guestfs-actions.pod:7805
16809 msgid "C<errorbehavior>"
16813 #: ../fish/guestfish-actions.pod:5068 ../src/guestfs-actions.pod:7807
16815 "Change the behavior of the kernel code when errors are detected. Possible "
16816 "values currently are: C<continue>, C<remount-ro>, C<panic>. In practice "
16817 "these options don't really make any difference, particularly for write "
16822 #: ../fish/guestfish-actions.pod:5073 ../src/guestfs-actions.pod:7812
16823 msgid "This is the same as the tune2fs C<-e> option."
16827 #: ../fish/guestfish-actions.pod:5075 ../src/guestfs-actions.pod:7814
16832 #: ../fish/guestfish-actions.pod:5077 ../src/guestfs-actions.pod:7816
16834 "Set the group which can use reserved filesystem blocks. This is the same as "
16835 "the tune2fs C<-g> option except that it can only be specified as a number."
16839 #: ../fish/guestfish-actions.pod:5081 ../src/guestfs-actions.pod:7820
16840 msgid "C<intervalbetweenchecks>"
16844 #: ../fish/guestfish-actions.pod:5083 ../src/guestfs-actions.pod:7822
16846 "Adjust the maximal time between two filesystem checks (in seconds). If the "
16847 "option is passed as C<0> then time-dependent checking is disabled."
16851 #: ../fish/guestfish-actions.pod:5087 ../src/guestfs-actions.pod:7826
16852 msgid "This is the same as the tune2fs C<-i> option."
16856 #: ../fish/guestfish-actions.pod:5089 ../src/guestfs-actions.pod:7828
16857 msgid "C<reservedblockspercentage>"
16861 #: ../fish/guestfish-actions.pod:5091 ../src/guestfs-actions.pod:7830
16863 "Set the percentage of the filesystem which may only be allocated by "
16864 "privileged processes. This is the same as the tune2fs C<-m> option."
16868 #: ../fish/guestfish-actions.pod:5095 ../src/guestfs-actions.pod:7834
16869 msgid "C<lastmounteddirectory>"
16873 #: ../fish/guestfish-actions.pod:5097 ../src/guestfs-actions.pod:7836
16875 "Set the last mounted directory. This is the same as the tune2fs C<-M> "
16880 #: ../fish/guestfish-actions.pod:5100 ../src/guestfs-actions.pod:7839
16882 "C<reservedblockscount> Set the number of reserved filesystem blocks. This "
16883 "is the same as the tune2fs C<-r> option."
16887 #: ../fish/guestfish-actions.pod:5104 ../src/guestfs-actions.pod:7843
16892 #: ../fish/guestfish-actions.pod:5106 ../src/guestfs-actions.pod:7845
16894 "Set the user who can use the reserved filesystem blocks. This is the same "
16895 "as the tune2fs C<-u> option except that it can only be specified as a "
16900 #: ../fish/guestfish-actions.pod:5112
16902 "To get the current values of filesystem parameters, see L</tune2fs-l>. For "
16903 "precise details of how tune2fs works, see the L<tune2fs(8)> man page."
16907 #: ../fish/guestfish-actions.pod:5118
16912 #: ../fish/guestfish-actions.pod:5120
16915 " tune2fs-l device\n"
16920 #: ../fish/guestfish-actions.pod:5122 ../src/guestfs-actions.pod:7887
16922 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
16927 #: ../fish/guestfish-actions.pod:5125 ../src/guestfs-actions.pod:7890
16929 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
16930 "for more details. The list of fields returned isn't clearly defined, and "
16931 "depends on both the version of C<tune2fs> that libguestfs was built against, "
16932 "and the filesystem itself."
16936 #: ../fish/guestfish-actions.pod:5130
16941 #: ../fish/guestfish-actions.pod:5132
16944 " txz-in (tarball|-) directory\n"
16949 #: ../fish/guestfish-actions.pod:5134 ../src/guestfs-actions.pod:7910
16951 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
16952 "tar file) into C<directory>."
16956 #: ../fish/guestfish-actions.pod:5139
16961 #: ../fish/guestfish-actions.pod:5141
16964 " txz-out directory (tarball|-)\n"
16969 #: ../fish/guestfish-actions.pod:5143 ../src/guestfs-actions.pod:7924
16971 "This command packs the contents of C<directory> and downloads it to local "
16972 "file C<tarball> (as an xz compressed tar archive)."
16976 #: ../fish/guestfish-actions.pod:5148
16981 #: ../fish/guestfish-actions.pod:5150
16989 #: ../fish/guestfish-actions.pod:5152 ../src/guestfs-actions.pod:7937
16991 "This function sets the mask used for creating new files and device nodes to "
16996 #: ../fish/guestfish-actions.pod:5155 ../src/guestfs-actions.pod:7940
16998 "Typical umask values would be C<022> which creates new files with "
16999 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
17000 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
17004 #: ../fish/guestfish-actions.pod:5160 ../src/guestfs-actions.pod:7945
17006 "The default umask is C<022>. This is important because it means that "
17007 "directories and device nodes will be created with C<0644> or C<0755> mode "
17008 "even if you specify C<0777>."
17012 #: ../fish/guestfish-actions.pod:5164
17013 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
17017 #: ../fish/guestfish-actions.pod:5167 ../src/guestfs-actions.pod:7952
17018 msgid "This call returns the previous umask."
17022 #: ../fish/guestfish-actions.pod:5169
17027 #: ../fish/guestfish-actions.pod:5171
17032 #: ../fish/guestfish-actions.pod:5173
17035 " umount pathordevice\n"
17040 #: ../fish/guestfish-actions.pod:5175 ../src/guestfs-actions.pod:7964
17042 "This unmounts the given filesystem. The filesystem may be specified either "
17043 "by its mountpoint (path) or the device which contains the filesystem."
17047 #: ../fish/guestfish-actions.pod:5179
17052 #: ../fish/guestfish-actions.pod:5181
17053 msgid "unmount-all"
17057 #: ../fish/guestfish-actions.pod:5183
17065 #: ../fish/guestfish-actions.pod:5185 ../src/guestfs-actions.pod:7977
17066 msgid "This unmounts all mounted filesystems."
17070 #: ../fish/guestfish-actions.pod:5187 ../src/guestfs-actions.pod:7979
17071 msgid "Some internal mounts are not unmounted by this call."
17075 #: ../fish/guestfish-actions.pod:5189
17080 #: ../fish/guestfish-actions.pod:5191
17083 " upload (filename|-) remotefilename\n"
17088 #: ../fish/guestfish-actions.pod:5193 ../fish/guestfish-actions.pod:5206 ../src/guestfs-actions.pod:7992 ../src/guestfs-actions.pod:8016
17089 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
17093 #: ../fish/guestfish-actions.pod:5198
17094 msgid "See also L</download>."
17098 #: ../fish/guestfish-actions.pod:5202
17099 msgid "upload-offset"
17103 #: ../fish/guestfish-actions.pod:5204
17106 " upload-offset (filename|-) remotefilename offset\n"
17111 #: ../fish/guestfish-actions.pod:5209 ../src/guestfs-actions.pod:8019
17113 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
17114 "The intention is to overwrite parts of existing files or devices, although "
17115 "if a non-existant file is specified then it is created with a \"hole\" "
17116 "before C<offset>. The size of the data written is implicit in the size of "
17117 "the source C<filename>."
17121 #: ../fish/guestfish-actions.pod:5216
17123 "Note that there is no limit on the amount of data that can be uploaded with "
17124 "this call, unlike with L</pwrite>, and this call always writes the full "
17125 "amount unless an error occurs."
17129 #: ../fish/guestfish-actions.pod:5221
17130 msgid "See also L</upload>, L</pwrite>."
17134 #: ../fish/guestfish-actions.pod:5225
17139 #: ../fish/guestfish-actions.pod:5227
17142 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
17147 #: ../fish/guestfish-actions.pod:5229 ../src/guestfs-actions.pod:8052
17148 msgid "This command sets the timestamps of a file with nanosecond precision."
17152 #: ../fish/guestfish-actions.pod:5232 ../src/guestfs-actions.pod:8055
17154 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
17159 #: ../fish/guestfish-actions.pod:5235 ../src/guestfs-actions.pod:8058
17161 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
17162 "nanoseconds from the epoch."
17166 #: ../fish/guestfish-actions.pod:5238 ../src/guestfs-actions.pod:8061
17168 "If the C<*nsecs> field contains the special value C<-1> then the "
17169 "corresponding timestamp is set to the current time. (The C<*secs> field is "
17170 "ignored in this case)."
17174 #: ../fish/guestfish-actions.pod:5242 ../src/guestfs-actions.pod:8065
17176 "If the C<*nsecs> field contains the special value C<-2> then the "
17177 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
17182 #: ../fish/guestfish-actions.pod:5246
17187 #: ../fish/guestfish-actions.pod:5248
17195 #: ../fish/guestfish-actions.pod:5250 ../src/guestfs-actions.pod:8078
17196 msgid "Return the libguestfs version number that the program is linked against."
17200 #: ../fish/guestfish-actions.pod:5253 ../src/guestfs-actions.pod:8081
17202 "Note that because of dynamic linking this is not necessarily the version of "
17203 "libguestfs that you compiled against. You can compile the program, and then "
17204 "at runtime dynamically link against a completely different C<libguestfs.so> "
17209 #: ../fish/guestfish-actions.pod:5258 ../src/guestfs-actions.pod:8086
17211 "This call was added in version C<1.0.58>. In previous versions of "
17212 "libguestfs there was no way to get the version number. From C code you can "
17213 "use dynamic linker functions to find out if this symbol exists (if it "
17214 "doesn't, then it's an earlier version)."
17218 #: ../fish/guestfish-actions.pod:5264 ../src/guestfs-actions.pod:8092
17220 "The call returns a structure with four elements. The first three (C<major>, "
17221 "C<minor> and C<release>) are numbers and correspond to the usual version "
17222 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
17223 "but may be used for distro-specific information."
17227 #: ../fish/guestfish-actions.pod:5270 ../src/guestfs-actions.pod:8098
17228 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
17232 #: ../fish/guestfish-actions.pod:5273 ../src/guestfs-actions.pod:8101
17233 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
17237 #: ../fish/guestfish-actions.pod:5275
17239 "I<Note:> Don't use this call to test for availability of features. In "
17240 "enterprise distributions we backport features from later versions into "
17241 "earlier versions, making this an unreliable way to test for features. Use "
17242 "L</available> instead."
17246 #: ../fish/guestfish-actions.pod:5281
17251 #: ../fish/guestfish-actions.pod:5283
17254 " vfs-label device\n"
17259 #: ../fish/guestfish-actions.pod:5285 ../src/guestfs-actions.pod:8121
17260 msgid "This returns the filesystem label of the filesystem on C<device>."
17264 #: ../fish/guestfish-actions.pod:5288 ../src/guestfs-actions.pod:8124
17265 msgid "If the filesystem is unlabeled, this returns the empty string."
17269 #: ../fish/guestfish-actions.pod:5290
17270 msgid "To find a filesystem from the label, use L</findfs-label>."
17274 #: ../fish/guestfish-actions.pod:5292
17279 #: ../fish/guestfish-actions.pod:5294
17282 " vfs-type device\n"
17287 #: ../fish/guestfish-actions.pod:5296 ../src/guestfs-actions.pod:8139
17289 "This command gets the filesystem type corresponding to the filesystem on "
17294 #: ../fish/guestfish-actions.pod:5299 ../src/guestfs-actions.pod:8142
17296 "For most filesystems, the result is the name of the Linux VFS module which "
17297 "would be used to mount this filesystem if you mounted it without specifying "
17298 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
17302 #: ../fish/guestfish-actions.pod:5304
17307 #: ../fish/guestfish-actions.pod:5306
17310 " vfs-uuid device\n"
17315 #: ../fish/guestfish-actions.pod:5308 ../src/guestfs-actions.pod:8158
17316 msgid "This returns the filesystem UUID of the filesystem on C<device>."
17320 #: ../fish/guestfish-actions.pod:5311 ../src/guestfs-actions.pod:8161
17321 msgid "If the filesystem does not have a UUID, this returns the empty string."
17325 #: ../fish/guestfish-actions.pod:5313
17326 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
17330 #: ../fish/guestfish-actions.pod:5315
17331 msgid "vg-activate"
17335 #: ../fish/guestfish-actions.pod:5317
17338 " vg-activate true|false 'volgroups ...'\n"
17343 #: ../fish/guestfish-actions.pod:5319 ../src/guestfs-actions.pod:8177
17345 "This command activates or (if C<activate> is false) deactivates all logical "
17346 "volumes in the listed volume groups C<volgroups>."
17350 #: ../fish/guestfish-actions.pod:5322 ../src/guestfs-actions.pod:8180
17351 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
17355 #: ../fish/guestfish-actions.pod:5324 ../src/guestfs-actions.pod:8182
17357 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
17358 "activated or deactivated."
17362 #: ../fish/guestfish-actions.pod:5327
17363 msgid "vg-activate-all"
17367 #: ../fish/guestfish-actions.pod:5329
17370 " vg-activate-all true|false\n"
17375 #: ../fish/guestfish-actions.pod:5331 ../src/guestfs-actions.pod:8195
17377 "This command activates or (if C<activate> is false) deactivates all logical "
17378 "volumes in all volume groups."
17382 #: ../fish/guestfish-actions.pod:5334 ../src/guestfs-actions.pod:8198
17383 msgid "This command is the same as running C<vgchange -a y|n>"
17387 #: ../fish/guestfish-actions.pod:5336
17392 #: ../fish/guestfish-actions.pod:5338
17395 " vgcreate volgroup 'physvols ...'\n"
17400 #: ../fish/guestfish-actions.pod:5340 ../src/guestfs-actions.pod:8211
17402 "This creates an LVM volume group called C<volgroup> from the non-empty list "
17403 "of physical volumes C<physvols>."
17407 #: ../fish/guestfish-actions.pod:5343
17412 #: ../fish/guestfish-actions.pod:5345
17415 " vglvuuids vgname\n"
17420 #: ../fish/guestfish-actions.pod:5347 ../src/guestfs-actions.pod:8224
17422 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
17423 "volumes created in this volume group."
17427 #: ../fish/guestfish-actions.pod:5350
17429 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
17430 "logical volumes and volume groups."
17434 #: ../fish/guestfish-actions.pod:5353
17435 msgid "See also L</vgpvuuids>."
17439 #: ../fish/guestfish-actions.pod:5355
17444 #: ../fish/guestfish-actions.pod:5357
17447 " vgpvuuids vgname\n"
17452 #: ../fish/guestfish-actions.pod:5359 ../src/guestfs-actions.pod:8244
17454 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
17455 "volumes that this volume group resides on."
17459 #: ../fish/guestfish-actions.pod:5362
17461 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
17462 "physical volumes and volume groups."
17466 #: ../fish/guestfish-actions.pod:5365
17467 msgid "See also L</vglvuuids>."
17471 #: ../fish/guestfish-actions.pod:5367
17476 #: ../fish/guestfish-actions.pod:5369
17479 " vgremove vgname\n"
17484 #: ../fish/guestfish-actions.pod:5371 ../src/guestfs-actions.pod:8264
17485 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
17489 #: ../fish/guestfish-actions.pod:5373 ../src/guestfs-actions.pod:8266
17490 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
17494 #: ../fish/guestfish-actions.pod:5376
17499 #: ../fish/guestfish-actions.pod:5378
17502 " vgrename volgroup newvolgroup\n"
17507 #: ../fish/guestfish-actions.pod:5380 ../src/guestfs-actions.pod:8280
17508 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
17512 #: ../fish/guestfish-actions.pod:5382
17517 #: ../fish/guestfish-actions.pod:5384
17525 #: ../fish/guestfish-actions.pod:5386 ../src/guestfs-actions.pod:8291
17527 "List all the volumes groups detected. This is the equivalent of the "
17528 "L<vgs(8)> command."
17532 #: ../fish/guestfish-actions.pod:5389 ../src/guestfs-actions.pod:8294
17534 "This returns a list of just the volume group names that were detected "
17535 "(eg. C<VolGroup00>)."
17539 #: ../fish/guestfish-actions.pod:5392
17540 msgid "See also L</vgs-full>."
17544 #: ../fish/guestfish-actions.pod:5394
17549 #: ../fish/guestfish-actions.pod:5396
17557 #: ../fish/guestfish-actions.pod:5398 ../src/guestfs-actions.pod:8310
17559 "List all the volumes groups detected. This is the equivalent of the "
17560 "L<vgs(8)> command. The \"full\" version includes all fields."
17564 #: ../fish/guestfish-actions.pod:5401
17569 #: ../fish/guestfish-actions.pod:5403
17577 #: ../fish/guestfish-actions.pod:5405 ../src/guestfs-actions.pod:8324
17579 "This rescans all block devices and rebuilds the list of LVM physical "
17580 "volumes, volume groups and logical volumes."
17584 #: ../fish/guestfish-actions.pod:5408
17589 #: ../fish/guestfish-actions.pod:5410
17597 #: ../fish/guestfish-actions.pod:5412 ../src/guestfs-actions.pod:8337
17598 msgid "This command returns the UUID of the LVM VG named C<vgname>."
17602 #: ../fish/guestfish-actions.pod:5414
17607 #: ../fish/guestfish-actions.pod:5416
17615 #: ../fish/guestfish-actions.pod:5418 ../src/guestfs-actions.pod:8377
17617 "This command counts the characters in a file, using the C<wc -c> external "
17622 #: ../fish/guestfish-actions.pod:5421
17627 #: ../fish/guestfish-actions.pod:5423
17635 #: ../fish/guestfish-actions.pod:5425 ../src/guestfs-actions.pod:8390
17637 "This command counts the lines in a file, using the C<wc -l> external "
17642 #: ../fish/guestfish-actions.pod:5428
17647 #: ../fish/guestfish-actions.pod:5430
17655 #: ../fish/guestfish-actions.pod:5432 ../src/guestfs-actions.pod:8403
17657 "This command counts the words in a file, using the C<wc -w> external "
17662 #: ../fish/guestfish-actions.pod:5435
17667 #: ../fish/guestfish-actions.pod:5437
17670 " write path content\n"
17675 #: ../fish/guestfish-actions.pod:5439 ../src/guestfs-actions.pod:8418
17677 "This call creates a file called C<path>. The content of the file is the "
17678 "string C<content> (which can contain any 8 bit data)."
17682 #: ../fish/guestfish-actions.pod:5442
17683 msgid "See also L</write-append>."
17687 #: ../fish/guestfish-actions.pod:5447
17688 msgid "write-append"
17692 #: ../fish/guestfish-actions.pod:5449
17695 " write-append path content\n"
17700 #: ../fish/guestfish-actions.pod:5451 ../src/guestfs-actions.pod:8438
17702 "This call appends C<content> to the end of file C<path>. If C<path> does "
17703 "not exist, then a new file is created."
17707 #: ../fish/guestfish-actions.pod:5454
17708 msgid "See also L</write>."
17712 #: ../fish/guestfish-actions.pod:5459
17717 #: ../fish/guestfish-actions.pod:5461
17720 " write-file path content size\n"
17725 #: ../fish/guestfish-actions.pod:5463 ../src/guestfs-actions.pod:8465
17727 "This call creates a file called C<path>. The contents of the file is the "
17728 "string C<content> (which can contain any 8 bit data), with length C<size>."
17732 #: ../fish/guestfish-actions.pod:5467 ../src/guestfs-actions.pod:8469
17734 "As a special case, if C<size> is C<0> then the length is calculated using "
17735 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
17739 #: ../fish/guestfish-actions.pod:5471 ../src/guestfs-actions.pod:8473
17741 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
17742 "I<not> work, even if the length is specified."
17746 #: ../fish/guestfish-actions.pod:5477
17747 msgid "I<This function is deprecated.> In new code, use the L</write> call instead."
17751 #: ../fish/guestfish-actions.pod:5484
17756 #: ../fish/guestfish-actions.pod:5486
17759 " zegrep regex path\n"
17764 #: ../fish/guestfish-actions.pod:5488 ../src/guestfs-actions.pod:8490
17765 msgid "This calls the external C<zegrep> program and returns the matching lines."
17769 #: ../fish/guestfish-actions.pod:5494
17774 #: ../fish/guestfish-actions.pod:5496
17777 " zegrepi regex path\n"
17782 #: ../fish/guestfish-actions.pod:5498 ../src/guestfs-actions.pod:8509
17783 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
17787 #: ../fish/guestfish-actions.pod:5504
17792 #: ../fish/guestfish-actions.pod:5506
17800 #: ../fish/guestfish-actions.pod:5508 ../src/guestfs-actions.pod:8527
17801 msgid "This command writes zeroes over the first few blocks of C<device>."
17805 #: ../fish/guestfish-actions.pod:5510 ../src/guestfs-actions.pod:8529
17807 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
17808 "securely wipe the device). It should be sufficient to remove any partition "
17809 "tables, filesystem superblocks and so on."
17813 #: ../fish/guestfish-actions.pod:5514 ../fish/guestfish-actions.pod:5529 ../src/guestfs-actions.pod:8533 ../src/guestfs-actions.pod:8559
17815 "If blocks are already zero, then this command avoids writing zeroes. This "
17816 "prevents the underlying device from becoming non-sparse or growing "
17821 #: ../fish/guestfish-actions.pod:5518
17822 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
17826 #: ../fish/guestfish-actions.pod:5521
17827 msgid "zero-device"
17831 #: ../fish/guestfish-actions.pod:5523
17834 " zero-device device\n"
17839 #: ../fish/guestfish-actions.pod:5525
17841 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
17842 "which just zeroes the first few blocks of a device."
17846 #: ../fish/guestfish-actions.pod:5533
17851 #: ../fish/guestfish-actions.pod:5535
17854 " zerofree device\n"
17859 #: ../fish/guestfish-actions.pod:5537 ../src/guestfs-actions.pod:8578
17861 "This runs the I<zerofree> program on C<device>. This program claims to zero "
17862 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
17863 "possible to compress the filesystem more effectively."
17867 #: ../fish/guestfish-actions.pod:5542 ../src/guestfs-actions.pod:8583
17868 msgid "You should B<not> run this program if the filesystem is mounted."
17872 #: ../fish/guestfish-actions.pod:5545 ../src/guestfs-actions.pod:8586
17874 "It is possible that using this program can damage the filesystem or data on "
17879 #: ../fish/guestfish-actions.pod:5548
17884 #: ../fish/guestfish-actions.pod:5550
17887 " zfgrep pattern path\n"
17892 #: ../fish/guestfish-actions.pod:5552 ../src/guestfs-actions.pod:8600
17893 msgid "This calls the external C<zfgrep> program and returns the matching lines."
17897 #: ../fish/guestfish-actions.pod:5558
17902 #: ../fish/guestfish-actions.pod:5560
17905 " zfgrepi pattern path\n"
17910 #: ../fish/guestfish-actions.pod:5562 ../src/guestfs-actions.pod:8619
17911 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
17915 #: ../fish/guestfish-actions.pod:5568
17920 #: ../fish/guestfish-actions.pod:5570
17923 " zfile meth path\n"
17928 #: ../fish/guestfish-actions.pod:5572 ../src/guestfs-actions.pod:8645
17929 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
17933 #: ../fish/guestfish-actions.pod:5575 ../src/guestfs-actions.pod:8648
17934 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
17938 #: ../fish/guestfish-actions.pod:5577
17939 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
17943 #: ../fish/guestfish-actions.pod:5580
17944 msgid "I<This function is deprecated.> In new code, use the L</file> call instead."
17948 #: ../fish/guestfish-actions.pod:5587
17953 #: ../fish/guestfish-actions.pod:5589
17956 " zgrep regex path\n"
17961 #: ../fish/guestfish-actions.pod:5591 ../src/guestfs-actions.pod:8665
17962 msgid "This calls the external C<zgrep> program and returns the matching lines."
17966 #: ../fish/guestfish-actions.pod:5597
17971 #: ../fish/guestfish-actions.pod:5599
17974 " zgrepi regex path\n"
17979 #: ../fish/guestfish-actions.pod:5601 ../src/guestfs-actions.pod:8684
17980 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
17984 #: ../fish/guestfish-commands.pod:1
17989 #: ../fish/guestfish-commands.pod:3
17994 #: ../fish/guestfish-commands.pod:5
17997 " alloc filename size\n"
18002 #: ../fish/guestfish-commands.pod:7
18004 "This creates an empty (zeroed) file of the given size, and then adds so it "
18005 "can be further examined."
18009 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
18010 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
18014 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
18015 msgid "Size can be specified using standard suffixes, eg. C<1M>."
18019 #: ../fish/guestfish-commands.pod:14
18021 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
18022 "image, see L</PREPARED DISK IMAGES>."
18026 #: ../fish/guestfish-commands.pod:17
18031 #: ../fish/guestfish-commands.pod:19
18034 " copy-in local [local ...] /remotedir\n"
18039 #: ../fish/guestfish-commands.pod:21
18041 "C<copy-in> copies local files or directories recursively into the disk "
18042 "image, placing them in the directory called C</remotedir> (which must "
18043 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
18044 "other commands as necessary."
18048 #: ../fish/guestfish-commands.pod:26
18050 "Multiple local files and directories can be specified, but the last "
18051 "parameter must always be a remote directory. Wildcards cannot be used."
18055 #: ../fish/guestfish-commands.pod:30
18060 #: ../fish/guestfish-commands.pod:32
18063 " copy-out remote [remote ...] localdir\n"
18068 #: ../fish/guestfish-commands.pod:34
18070 "C<copy-out> copies remote files or directories recursively out of the disk "
18071 "image, placing them on the host disk in a local directory called C<localdir> "
18072 "(which must exist). This guestfish meta-command turns into a sequence of "
18073 "L</download>, L</tar-out> and other commands as necessary."
18077 #: ../fish/guestfish-commands.pod:40
18079 "Multiple remote files and directories can be specified, but the last "
18080 "parameter must always be a local directory. To download to the current "
18081 "directory, use C<.> as in:"
18085 #: ../fish/guestfish-commands.pod:44
18088 " copy-out /home .\n"
18093 #: ../fish/guestfish-commands.pod:46
18095 "Wildcards cannot be used in the ordinary command, but you can use them with "
18096 "the help of L</glob> like this:"
18100 #: ../fish/guestfish-commands.pod:49
18103 " glob copy-out /home/* .\n"
18108 #: ../fish/guestfish-commands.pod:51
18113 #: ../fish/guestfish-commands.pod:53
18116 " display filename\n"
18121 #: ../fish/guestfish-commands.pod:55
18123 "Use C<display> (a graphical display program) to display an image file. It "
18124 "downloads the file, and runs C<display> on it."
18128 #: ../fish/guestfish-commands.pod:58
18130 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
18131 "environment variable. For example to use the GNOME display program:"
18135 #: ../fish/guestfish-commands.pod:61
18138 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
18143 #: ../fish/guestfish-commands.pod:63
18144 msgid "See also L<display(1)>."
18148 #: ../fish/guestfish-commands.pod:65
18153 #: ../fish/guestfish-commands.pod:67
18156 " echo [params ...]\n"
18161 #: ../fish/guestfish-commands.pod:69
18162 msgid "This echos the parameters to the terminal."
18166 #: ../fish/guestfish-commands.pod:71
18171 #: ../fish/guestfish-commands.pod:73
18176 #: ../fish/guestfish-commands.pod:75
18181 #: ../fish/guestfish-commands.pod:77
18189 #: ../fish/guestfish-commands.pod:79
18191 "This is used to edit a file. It downloads the file, edits it locally using "
18192 "your editor, then uploads the result."
18196 #: ../fish/guestfish-commands.pod:82
18198 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
18199 "or C<emacs> you will get those corresponding editors."
18203 #: ../fish/guestfish-commands.pod:86
18208 #: ../fish/guestfish-commands.pod:88
18211 " glob command args...\n"
18216 #: ../fish/guestfish-commands.pod:90
18218 "Expand wildcards in any paths in the args list, and run C<command> "
18219 "repeatedly on each matching path."
18223 #: ../fish/guestfish-commands.pod:93
18224 msgid "See L</WILDCARDS AND GLOBBING>."
18228 #: ../fish/guestfish-commands.pod:95
18233 #: ../fish/guestfish-commands.pod:97
18236 " hexedit <filename|device>\n"
18237 " hexedit <filename|device> <max>\n"
18238 " hexedit <filename|device> <start> <max>\n"
18243 #: ../fish/guestfish-commands.pod:101
18245 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
18250 #: ../fish/guestfish-commands.pod:104
18252 "This command works by downloading potentially the whole file or device, "
18253 "editing it locally, then uploading it. If the file or device is large, you "
18254 "have to specify which part you wish to edit by using C<max> and/or C<start> "
18255 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
18256 "usual modifiers allowed such as C<1M> (1 megabyte)."
18260 #: ../fish/guestfish-commands.pod:111
18261 msgid "For example to edit the first few sectors of a disk you might do:"
18265 #: ../fish/guestfish-commands.pod:114
18268 " hexedit /dev/sda 1M\n"
18273 #: ../fish/guestfish-commands.pod:116
18275 "which would allow you to edit anywhere within the first megabyte of the "
18280 #: ../fish/guestfish-commands.pod:119
18281 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
18285 #: ../fish/guestfish-commands.pod:121
18288 " hexedit /dev/sda1 0x400 0x400\n"
18293 #: ../fish/guestfish-commands.pod:123
18294 msgid "(assuming the superblock is in the standard location)."
18298 #: ../fish/guestfish-commands.pod:125
18300 "This command requires the external L<hexedit(1)> program. You can specify "
18301 "another program to use by setting the C<HEXEDITOR> environment variable."
18305 #: ../fish/guestfish-commands.pod:129
18306 msgid "See also L</hexdump>."
18310 #: ../fish/guestfish-commands.pod:131
18315 #: ../fish/guestfish-commands.pod:133
18323 #: ../fish/guestfish-commands.pod:135
18324 msgid "Change the local directory, ie. the current directory of guestfish itself."
18328 #: ../fish/guestfish-commands.pod:138
18329 msgid "Note that C<!cd> won't do what you might expect."
18333 #: ../fish/guestfish-commands.pod:140
18338 #: ../fish/guestfish-commands.pod:142
18343 #: ../fish/guestfish-commands.pod:144
18351 #: ../fish/guestfish-commands.pod:146
18352 msgid "Opens the manual page for guestfish."
18356 #: ../fish/guestfish-commands.pod:148
18361 #: ../fish/guestfish-commands.pod:150
18366 #: ../fish/guestfish-commands.pod:152
18374 #: ../fish/guestfish-commands.pod:154
18382 #: ../fish/guestfish-commands.pod:156
18383 msgid "This is used to view a file."
18387 #: ../fish/guestfish-commands.pod:158
18389 "The default viewer is C<$PAGER>. However if you use the alternate command "
18390 "C<less> you will get the C<less> command specifically."
18394 #: ../fish/guestfish-commands.pod:161
18399 #: ../fish/guestfish-commands.pod:163
18407 #: ../fish/guestfish-commands.pod:165
18409 "Close and reopen the libguestfs handle. It is not necessary to use this "
18410 "normally, because the handle is closed properly when guestfish exits. "
18411 "However this is occasionally useful for testing."
18415 #: ../fish/guestfish-commands.pod:169
18420 #: ../fish/guestfish-commands.pod:171
18423 " setenv VAR value\n"
18428 #: ../fish/guestfish-commands.pod:173
18429 msgid "Set the environment variable C<VAR> to the string C<value>."
18433 #: ../fish/guestfish-commands.pod:175
18434 msgid "To print the value of an environment variable use a shell command such as:"
18438 #: ../fish/guestfish-commands.pod:178
18446 #: ../fish/guestfish-commands.pod:180
18451 #: ../fish/guestfish-commands.pod:182
18454 " sparse filename size\n"
18459 #: ../fish/guestfish-commands.pod:184
18461 "This creates an empty sparse file of the given size, and then adds so it can "
18462 "be further examined."
18466 #: ../fish/guestfish-commands.pod:187
18468 "In all respects it works the same as the L</alloc> command, except that the "
18469 "image file is allocated sparsely, which means that disk blocks are not "
18470 "assigned to the file until they are needed. Sparse disk files only use "
18471 "space when written to, but they are slower and there is a danger you could "
18472 "run out of real disk space during a write operation."
18476 #: ../fish/guestfish-commands.pod:197
18481 #: ../fish/guestfish-commands.pod:199
18489 #: ../fish/guestfish-commands.pod:201
18491 "This command returns a list of the optional groups known to the daemon, and "
18492 "indicates which ones are supported by this build of the libguestfs "
18497 #: ../fish/guestfish-commands.pod:205
18498 msgid "See also L<guestfs(3)/AVAILABILITY>."
18502 #: ../fish/guestfish-commands.pod:207
18507 #: ../fish/guestfish-commands.pod:209
18510 " time command args...\n"
18515 #: ../fish/guestfish-commands.pod:211
18517 "Run the command as usual, but print the elapsed time afterwards. This can "
18518 "be useful for benchmarking operations."
18522 #: ../fish/guestfish-commands.pod:214
18527 #: ../fish/guestfish-commands.pod:216
18535 #: ../fish/guestfish-commands.pod:218
18536 msgid "Remove C<VAR> from the environment."
18540 #: ../fish/guestfish.pod:5
18541 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
18545 #: ../fish/guestfish.pod:9
18548 " guestfish [--options] [commands]\n"
18553 #: ../fish/guestfish.pod:11
18561 #: ../fish/guestfish.pod:13
18564 " guestfish [--ro|--rw] -a disk.img\n"
18569 #: ../fish/guestfish.pod:15
18572 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
18577 #: ../fish/guestfish.pod:17
18580 " guestfish -d libvirt-domain\n"
18585 #: ../fish/guestfish.pod:19
18588 " guestfish [--ro|--rw] -a disk.img -i\n"
18593 #: ../fish/guestfish.pod:21
18596 " guestfish -d libvirt-domain -i\n"
18601 #: ../fish/guestfish.pod:25
18603 "Using guestfish in read/write mode on live virtual machines can be "
18604 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
18605 "option to use guestfish safely if the disk image or virtual machine might be "
18610 #: ../fish/guestfish.pod:32
18612 "Guestfish is a shell and command-line tool for examining and modifying "
18613 "virtual machine filesystems. It uses libguestfs and exposes all of the "
18614 "functionality of the guestfs API, see L<guestfs(3)>."
18618 #: ../fish/guestfish.pod:36
18620 "Guestfish gives you structured access to the libguestfs API, from shell "
18621 "scripts or the command line or interactively. If you want to rescue a "
18622 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
18627 #: ../fish/guestfish.pod:43
18628 msgid "As an interactive shell"
18632 #: ../fish/guestfish.pod:45
18640 #: ../fish/guestfish.pod:47
18643 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
18644 " editing virtual machine filesystems.\n"
18649 #: ../fish/guestfish.pod:50
18652 " Type: 'help' for a list of commands\n"
18653 " 'man' to read the manual\n"
18654 " 'quit' to quit the shell\n"
18659 #: ../fish/guestfish.pod:54
18662 " ><fs> add-ro disk.img\n"
18664 " ><fs> list-filesystems\n"
18665 " /dev/sda1: ext4\n"
18666 " /dev/vg_guest/lv_root: ext4\n"
18667 " /dev/vg_guest/lv_swap: swap\n"
18668 " ><fs> mount /dev/vg_guest/lv_root /\n"
18669 " ><fs> cat /etc/fstab\n"
18671 " # Created by anaconda\n"
18678 #: ../fish/guestfish.pod:67
18679 msgid "From shell scripts"
18683 #: ../fish/guestfish.pod:69
18684 msgid "Create a new C</etc/motd> file in a guest or disk image:"
18688 #: ../fish/guestfish.pod:71
18691 " guestfish <<_EOF_\n"
18694 " mount /dev/vg_guest/lv_root /\n"
18695 " write /etc/motd \"Welcome, new users\"\n"
18701 #: ../fish/guestfish.pod:78
18702 msgid "List the LVM logical volumes in a disk image:"
18706 #: ../fish/guestfish.pod:80
18709 " guestfish -a disk.img --ro <<_EOF_\n"
18717 #: ../fish/guestfish.pod:85
18718 msgid "List all the filesystems in a disk image:"
18722 #: ../fish/guestfish.pod:87
18725 " guestfish -a disk.img --ro <<_EOF_\n"
18727 " list-filesystems\n"
18733 #: ../fish/guestfish.pod:92
18734 msgid "On one command line"
18738 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
18739 msgid "Update C</etc/resolv.conf> in a guest:"
18743 #: ../fish/guestfish.pod:96
18747 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
18748 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
18753 #: ../fish/guestfish.pod:100
18754 msgid "Edit C</boot/grub/grub.conf> interactively:"
18758 #: ../fish/guestfish.pod:102
18761 " guestfish --rw --add disk.img \\\n"
18762 " --mount /dev/vg_guest/lv_root \\\n"
18763 " --mount /dev/sda1:/boot \\\n"
18764 " edit /boot/grub/grub.conf\n"
18769 #: ../fish/guestfish.pod:107
18770 msgid "Mount disks automatically"
18774 #: ../fish/guestfish.pod:109
18776 "Use the I<-i> option to automatically mount the disks from a virtual "
18781 #: ../fish/guestfish.pod:112
18784 " guestfish --ro -a disk.img -i cat /etc/group\n"
18789 #: ../fish/guestfish.pod:114
18792 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
18797 #: ../fish/guestfish.pod:116
18798 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
18802 #: ../fish/guestfish.pod:118
18805 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
18810 #: ../fish/guestfish.pod:120
18811 msgid "As a script interpreter"
18815 #: ../fish/guestfish.pod:122
18816 msgid "Create a 100MB disk containing an ext2-formatted partition:"
18820 #: ../fish/guestfish.pod:124
18823 " #!/usr/bin/guestfish -f\n"
18824 " sparse test1.img 100M\n"
18826 " part-disk /dev/sda mbr\n"
18827 " mkfs ext2 /dev/sda1\n"
18832 #: ../fish/guestfish.pod:130
18833 msgid "Start with a prepared disk"
18837 #: ../fish/guestfish.pod:132
18839 "An alternate way to create a 100MB disk called C<test1.img> containing a "
18840 "single ext2-formatted partition:"
18844 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2243
18847 " guestfish -N fs\n"
18852 #: ../fish/guestfish.pod:137
18853 msgid "To list what is available do:"
18857 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
18860 " guestfish -N help | less\n"
18865 #: ../fish/guestfish.pod:141
18866 msgid "Remote control"
18870 #: ../fish/guestfish.pod:143
18873 " eval \"`guestfish --listen`\"\n"
18874 " guestfish --remote add-ro disk.img\n"
18875 " guestfish --remote run\n"
18876 " guestfish --remote lvs\n"
18881 #: ../fish/guestfish.pod:154
18882 msgid "Displays general help on options."
18886 #: ../fish/guestfish.pod:158
18887 msgid "B<--cmd-help>"
18891 #: ../fish/guestfish.pod:160
18892 msgid "Lists all available guestfish commands."
18896 #: ../fish/guestfish.pod:162
18901 #: ../fish/guestfish.pod:164
18902 msgid "B<--cmd-help cmd>"
18906 #: ../fish/guestfish.pod:166
18907 msgid "Displays detailed help on a single command C<cmd>."
18911 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
18912 msgid "B<-a image>"
18916 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
18917 msgid "B<--add image>"
18921 #: ../fish/guestfish.pod:172
18922 msgid "Add a block device or virtual machine image to the shell."
18926 #: ../fish/guestfish.pod:177
18928 "Using this flag is mostly equivalent to using the C<add> command, with "
18929 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
18930 "the I<--format=...> flag was given."
18934 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
18936 "When used in conjunction with the I<-d> option, this specifies the libvirt "
18937 "URI to use. The default is to use the default libvirt connection."
18941 #: ../fish/guestfish.pod:189
18946 #: ../fish/guestfish.pod:191
18948 "If using the I<--listen> option and a csh-like shell, use this option. See "
18949 "section L</REMOTE CONTROL AND CSH> below."
18953 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
18954 msgid "B<-d libvirt-domain>"
18958 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
18959 msgid "B<--domain libvirt-domain>"
18963 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
18965 "Add disks from the named libvirt domain. If the I<--ro> option is also "
18966 "used, then any libvirt domain can be used. However in write mode, only "
18967 "libvirt domains which are shut down can be named here."
18971 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
18972 msgid "Domain UUIDs can be used instead of names."
18976 #: ../fish/guestfish.pod:204
18978 "Using this flag is mostly equivalent to using the C<add-domain> command, "
18979 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
18980 "if the I<--format:...> flag was given."
18984 #: ../fish/guestfish.pod:208
18989 #: ../fish/guestfish.pod:210
18990 msgid "B<--no-dest-paths>"
18994 #: ../fish/guestfish.pod:212
18996 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
18997 "to hit the tab key to complete paths on the guest filesystem, but this "
18998 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
18999 "allow this feature to be disabled."
19003 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
19005 "When prompting for keys and passphrases, guestfish normally turns echoing "
19006 "off so you cannot see what you are typing. If you are not worried about "
19007 "Tempest attacks and there is no one else in the room you can specify this "
19008 "flag to see what you are typing."
19012 #: ../fish/guestfish.pod:224
19017 #: ../fish/guestfish.pod:226
19018 msgid "B<--file file>"
19022 #: ../fish/guestfish.pod:228
19023 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
19027 #: ../fish/guestfish.pod:231
19030 " #!/usr/bin/guestfish -f\n"
19035 #: ../fish/guestfish.pod:244
19038 " guestfish --format=raw -a disk.img\n"
19043 #: ../fish/guestfish.pod:248
19046 " guestfish --format=raw -a disk.img --format -a another.img\n"
19051 #: ../fish/guestfish.pod:253
19053 "If you have untrusted raw-format guest disk images, you should use this "
19054 "option to specify the disk format. This avoids a possible security problem "
19055 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
19059 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
19060 msgid "B<--inspector>"
19064 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
19066 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
19067 "system and mount filesystems as they would be mounted on the real virtual "
19072 #: ../fish/guestfish.pod:266
19073 msgid "Typical usage is either:"
19077 #: ../fish/guestfish.pod:268
19080 " guestfish -d myguest -i\n"
19085 #: ../fish/guestfish.pod:270
19086 msgid "(for an inactive libvirt domain called I<myguest>), or:"
19090 #: ../fish/guestfish.pod:272
19093 " guestfish --ro -d myguest -i\n"
19098 #: ../fish/guestfish.pod:274
19099 msgid "(for active domains, readonly), or specify the block device directly:"
19103 #: ../fish/guestfish.pod:276
19106 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
19111 #: ../fish/guestfish.pod:278
19113 "Note that the command line syntax changed slightly over older versions of "
19114 "guestfish. You can still use the old syntax:"
19118 #: ../fish/guestfish.pod:281
19121 " guestfish [--ro] -i disk.img\n"
19126 #: ../fish/guestfish.pod:283
19129 " guestfish [--ro] -i libvirt-domain\n"
19134 #: ../fish/guestfish.pod:285
19136 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
19137 "then using other commands to mount the filesystems that were found."
19141 #: ../fish/guestfish.pod:294
19142 msgid "B<--listen>"
19146 #: ../fish/guestfish.pod:296
19148 "Fork into the background and listen for remote commands. See section "
19149 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
19153 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
19158 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
19160 "Connect to a live virtual machine. (Experimental, see "
19161 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
19165 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
19166 msgid "B<-m dev[:mountpoint[:options]]>"
19170 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
19171 msgid "B<--mount dev[:mountpoint[:options]]>"
19175 #: ../fish/guestfish.pod:308
19176 msgid "Mount the named partition or logical volume on the given mountpoint."
19180 #: ../fish/guestfish.pod:310
19181 msgid "If the mountpoint is omitted, it defaults to C</>."
19185 #: ../fish/guestfish.pod:312
19186 msgid "You have to mount something on C</> before most commands will work."
19190 #: ../fish/guestfish.pod:314
19192 "If any I<-m> or I<--mount> options are given, the guest is automatically "
19197 #: ../fish/guestfish.pod:317
19199 "If you don't know what filesystems a disk image contains, you can either run "
19200 "guestfish without this option, then list the partitions, filesystems and LVs "
19201 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
19202 "commands), or you can use the L<virt-filesystems(1)> program."
19206 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
19208 "The third (and rarely used) part of the mount parameter is the list of mount "
19209 "options used to mount the underlying filesystem. If this is not given, then "
19210 "the mount options are either the empty string or C<ro> (the latter if the "
19211 "I<--ro> flag is used). By specifying the mount options, you override this "
19212 "default choice. Probably the only time you would use this is to enable ACLs "
19213 "and/or extended attributes if the filesystem can support them:"
19217 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
19220 " -m /dev/sda1:/:acl,user_xattr\n"
19225 #: ../fish/guestfish.pod:333
19226 msgid "Using this flag is equivalent to using the C<mount-options> command."
19230 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202 ../resize/virt-resize.pod:435
19235 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
19236 msgid "B<--no-sync>"
19240 #: ../fish/guestfish.pod:339
19242 "Disable autosync. This is enabled by default. See the discussion of "
19243 "autosync in the L<guestfs(3)> manpage."
19247 #: ../fish/guestfish.pod:342
19252 #: ../fish/guestfish.pod:344
19253 msgid "B<--new type>"
19257 #: ../fish/guestfish.pod:346
19262 #: ../fish/guestfish.pod:348
19264 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
19265 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
19266 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
19271 #: ../fish/guestfish.pod:353
19272 msgid "B<--progress-bars>"
19276 #: ../fish/guestfish.pod:355
19277 msgid "Enable progress bars, even when guestfish is used non-interactively."
19281 #: ../fish/guestfish.pod:357
19283 "Progress bars are enabled by default when guestfish is used as an "
19284 "interactive shell."
19288 #: ../fish/guestfish.pod:360
19289 msgid "B<--no-progress-bars>"
19293 #: ../fish/guestfish.pod:362
19294 msgid "Disable progress bars."
19298 #: ../fish/guestfish.pod:364
19299 msgid "B<--remote[=pid]>"
19303 #: ../fish/guestfish.pod:366
19305 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
19306 "CONTROL GUESTFISH OVER A SOCKET> below."
19310 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248 ../rescue/virt-rescue.pod:189
19315 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250 ../rescue/virt-rescue.pod:191
19320 #: ../fish/guestfish.pod:373
19322 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
19323 "mounts are done read-only."
19327 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:195
19329 "The option must always be used if the disk image or virtual machine might be "
19330 "running, and is generally recommended in cases where you don't need write "
19331 "access to the disk."
19335 #: ../fish/guestfish.pod:380
19337 "Note that prepared disk images created with I<-N> are not affected by this "
19338 "option. Also commands like C<add> are not affected - you have to specify "
19339 "the C<readonly:true> option explicitly if you need it."
19343 #: ../fish/guestfish.pod:384
19344 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
19348 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262 ../rescue/virt-rescue.pod:201
19349 msgid "B<--selinux>"
19353 #: ../fish/guestfish.pod:388
19354 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
19358 #: ../fish/guestfish.pod:394
19360 "Enable very verbose messages. This is particularly useful if you find a "
19365 #: ../fish/guestfish.pod:401
19366 msgid "Display the guestfish / libguestfs version number and exit."
19370 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278 ../rescue/virt-rescue.pod:231
19375 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280 ../rescue/virt-rescue.pod:233
19380 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
19382 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
19383 "mounts are done read-write."
19387 #: ../fish/guestfish.pod:410
19388 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
19392 #: ../fish/guestfish.pod:414
19393 msgid "Echo each command before executing it."
19397 #: ../fish/guestfish.pod:418
19398 msgid "COMMANDS ON COMMAND LINE"
19402 #: ../fish/guestfish.pod:420
19403 msgid "Any additional (non-option) arguments are treated as commands to execute."
19407 #: ../fish/guestfish.pod:423
19409 "Commands to execute should be separated by a colon (C<:>), where the colon "
19410 "is a separate parameter. Thus:"
19414 #: ../fish/guestfish.pod:426
19417 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
19422 #: ../fish/guestfish.pod:428
19424 "If there are no additional arguments, then we enter a shell, either an "
19425 "interactive shell with a prompt (if the input is a terminal) or a "
19426 "non-interactive shell."
19430 #: ../fish/guestfish.pod:432
19432 "In either command line mode or non-interactive shell, the first command that "
19433 "gives an error causes the whole shell to exit. In interactive mode (with a "
19434 "prompt) if a command fails, you can continue to enter commands."
19438 #: ../fish/guestfish.pod:437
19439 msgid "USING launch (OR run)"
19443 #: ../fish/guestfish.pod:439
19445 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
19446 "then launch it, then mount any disks you need, and finally issue "
19447 "actions/commands. So the general order of the day is:"
19451 #: ../fish/guestfish.pod:447
19452 msgid "add or -a/--add"
19456 #: ../fish/guestfish.pod:451
19457 msgid "launch (aka run)"
19461 #: ../fish/guestfish.pod:455
19462 msgid "mount or -m/--mount"
19466 #: ../fish/guestfish.pod:459
19467 msgid "any other commands"
19471 #: ../fish/guestfish.pod:463
19473 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
19474 "guest before mounting or performing any other commands."
19478 #: ../fish/guestfish.pod:466
19480 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
19481 "I<--new> options were given then C<run> is done automatically, simply "
19482 "because guestfish can't perform the action you asked for without doing this."
19486 #: ../fish/guestfish.pod:471
19487 msgid "OPENING DISKS FOR READ AND WRITE"
19491 #: ../fish/guestfish.pod:473
19493 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
19494 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
19495 "I<-i> and I<-m> open disk images read-only or for writing."
19499 #: ../fish/guestfish.pod:478
19501 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
19502 "opening disk images supplied on the command line for write. To open a disk "
19503 "image read-only you have to do I<-a image --ro>."
19507 #: ../fish/guestfish.pod:482
19509 "This matters: If you accidentally open a live VM disk image writable then "
19510 "you will cause irreversible disk corruption."
19514 #: ../fish/guestfish.pod:485
19516 "In a future libguestfs we intend to change the default the other way. Disk "
19517 "images will be opened read-only. You will have to either specify "
19518 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
19519 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
19520 "access for disk images specified by those other command line options."
19524 #: ../fish/guestfish.pod:492
19526 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
19527 "which does nothing (it is already the default). However it is highly "
19528 "recommended that you use this option to indicate that you need write access, "
19529 "and prepare your scripts for the day when this option will be required for "
19534 #: ../fish/guestfish.pod:498
19536 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
19537 "other libguestfs program apart from guestfish and guestmount."
19541 #: ../fish/guestfish.pod:501
19546 #: ../fish/guestfish.pod:503
19548 "You can quote ordinary parameters using either single or double quotes. For "
19553 #: ../fish/guestfish.pod:506
19556 " add \"file with a space.img\"\n"
19561 #: ../fish/guestfish.pod:508
19564 " rm '/file name'\n"
19569 #: ../fish/guestfish.pod:510
19577 #: ../fish/guestfish.pod:512
19579 "A few commands require a list of strings to be passed. For these, use a "
19580 "whitespace-separated list, enclosed in quotes. Strings containing "
19581 "whitespace to be passed through must be enclosed in single quotes. A "
19582 "literal single quote must be escaped with a backslash."
19586 #: ../fish/guestfish.pod:517
19589 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
19590 " command \"/bin/echo 'foo bar'\"\n"
19591 " command \"/bin/echo \\'foo\\'\"\n"
19596 #: ../fish/guestfish.pod:521
19597 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
19601 #: ../fish/guestfish.pod:523
19603 "In double-quoted arguments (only) use backslash to insert special "
19608 #: ../fish/guestfish.pod:528
19613 #: ../fish/guestfish.pod:530
19614 msgid "Alert (bell) character."
19618 #: ../fish/guestfish.pod:532
19623 #: ../fish/guestfish.pod:534
19624 msgid "Backspace character."
19628 #: ../fish/guestfish.pod:536
19633 #: ../fish/guestfish.pod:538
19634 msgid "Form feed character."
19638 #: ../fish/guestfish.pod:540
19643 #: ../fish/guestfish.pod:542
19644 msgid "Newline character."
19648 #: ../fish/guestfish.pod:544
19653 #: ../fish/guestfish.pod:546
19654 msgid "Carriage return character."
19658 #: ../fish/guestfish.pod:548
19663 #: ../fish/guestfish.pod:550
19664 msgid "Horizontal tab character."
19668 #: ../fish/guestfish.pod:552
19673 #: ../fish/guestfish.pod:554
19674 msgid "Vertical tab character."
19678 #: ../fish/guestfish.pod:556
19683 #: ../fish/guestfish.pod:558
19684 msgid "A literal double quote character."
19688 #: ../fish/guestfish.pod:560
19693 #: ../fish/guestfish.pod:562
19695 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
19700 #: ../fish/guestfish.pod:565
19705 #: ../fish/guestfish.pod:567
19706 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
19710 #: ../fish/guestfish.pod:570
19712 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
19717 #: ../fish/guestfish.pod:573
19722 #: ../fish/guestfish.pod:575
19723 msgid "A literal backslash character."
19727 #: ../fish/guestfish.pod:579
19728 msgid "OPTIONAL ARGUMENTS"
19732 #: ../fish/guestfish.pod:581
19734 "Some commands take optional arguments. These arguments appear in this "
19735 "documentation as C<[argname:..]>. You can use them as in these examples:"
19739 #: ../fish/guestfish.pod:585
19742 " add-drive-opts filename\n"
19747 #: ../fish/guestfish.pod:587
19750 " add-drive-opts filename readonly:true\n"
19755 #: ../fish/guestfish.pod:589
19758 " add-drive-opts filename format:qcow2 readonly:false\n"
19763 #: ../fish/guestfish.pod:591
19765 "Each optional argument can appear at most once. All optional arguments must "
19766 "appear after the required ones."
19770 #: ../fish/guestfish.pod:594
19775 #: ../fish/guestfish.pod:596
19776 msgid "This section applies to all commands which can take integers as parameters."
19780 #: ../fish/guestfish.pod:599
19781 msgid "SIZE SUFFIX"
19785 #: ../fish/guestfish.pod:601
19787 "When the command takes a parameter measured in bytes, you can use one of the "
19788 "following suffixes to specify kilobytes, megabytes and larger sizes:"
19792 #: ../fish/guestfish.pod:607
19793 msgid "B<k> or B<K> or B<KiB>"
19797 #: ../fish/guestfish.pod:609
19798 msgid "The size in kilobytes (multiplied by 1024)."
19802 #: ../fish/guestfish.pod:611
19807 #: ../fish/guestfish.pod:613
19808 msgid "The size in SI 1000 byte units."
19812 #: ../fish/guestfish.pod:615
19813 msgid "B<M> or B<MiB>"
19817 #: ../fish/guestfish.pod:617
19818 msgid "The size in megabytes (multiplied by 1048576)."
19822 #: ../fish/guestfish.pod:619
19827 #: ../fish/guestfish.pod:621
19828 msgid "The size in SI 1000000 byte units."
19832 #: ../fish/guestfish.pod:623
19833 msgid "B<G> or B<GiB>"
19837 #: ../fish/guestfish.pod:625
19838 msgid "The size in gigabytes (multiplied by 2**30)."
19842 #: ../fish/guestfish.pod:627
19847 #: ../fish/guestfish.pod:629
19848 msgid "The size in SI 10**9 byte units."
19852 #: ../fish/guestfish.pod:631
19853 msgid "B<T> or B<TiB>"
19857 #: ../fish/guestfish.pod:633
19858 msgid "The size in terabytes (multiplied by 2**40)."
19862 #: ../fish/guestfish.pod:635
19867 #: ../fish/guestfish.pod:637
19868 msgid "The size in SI 10**12 byte units."
19872 #: ../fish/guestfish.pod:639
19873 msgid "B<P> or B<PiB>"
19877 #: ../fish/guestfish.pod:641
19878 msgid "The size in petabytes (multiplied by 2**50)."
19882 #: ../fish/guestfish.pod:643
19887 #: ../fish/guestfish.pod:645
19888 msgid "The size in SI 10**15 byte units."
19892 #: ../fish/guestfish.pod:647
19893 msgid "B<E> or B<EiB>"
19897 #: ../fish/guestfish.pod:649
19898 msgid "The size in exabytes (multiplied by 2**60)."
19902 #: ../fish/guestfish.pod:651
19907 #: ../fish/guestfish.pod:653
19908 msgid "The size in SI 10**18 byte units."
19912 #: ../fish/guestfish.pod:655
19913 msgid "B<Z> or B<ZiB>"
19917 #: ../fish/guestfish.pod:657
19918 msgid "The size in zettabytes (multiplied by 2**70)."
19922 #: ../fish/guestfish.pod:659
19927 #: ../fish/guestfish.pod:661
19928 msgid "The size in SI 10**21 byte units."
19932 #: ../fish/guestfish.pod:663
19933 msgid "B<Y> or B<YiB>"
19937 #: ../fish/guestfish.pod:665
19938 msgid "The size in yottabytes (multiplied by 2**80)."
19942 #: ../fish/guestfish.pod:667
19947 #: ../fish/guestfish.pod:669
19948 msgid "The size in SI 10**24 byte units."
19952 #: ../fish/guestfish.pod:675
19955 " truncate-size /file 1G\n"
19960 #: ../fish/guestfish.pod:677
19961 msgid "would truncate the file to 1 gigabyte."
19965 #: ../fish/guestfish.pod:679
19967 "Be careful because a few commands take sizes in kilobytes or megabytes "
19968 "(eg. the parameter to L</memsize> is specified in megabytes already). "
19969 "Adding a suffix will probably not do what you expect."
19973 #: ../fish/guestfish.pod:683
19974 msgid "OCTAL AND HEXADECIMAL NUMBERS"
19978 #: ../fish/guestfish.pod:685
19980 "For specifying the radix (base) use the C convention: C<0> to prefix an "
19981 "octal number or C<0x> to prefix a hexadecimal number. For example:"
19985 #: ../fish/guestfish.pod:688
19988 " 1234 decimal number 1234\n"
19989 " 02322 octal number, equivalent to decimal 1234\n"
19990 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
19995 #: ../fish/guestfish.pod:692
19997 "When using the C<chmod> command, you almost always want to specify an octal "
19998 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
19999 "L<chmod(1)> program):"
20003 #: ../fish/guestfish.pod:696
20006 " chmod 0777 /public # OK\n"
20007 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
20012 #: ../fish/guestfish.pod:699
20014 "Commands that return numbers usually print them in decimal, but some "
20015 "commands print numbers in other radices (eg. C<umask> prints the mode in "
20016 "octal, preceeded by C<0>)."
20020 #: ../fish/guestfish.pod:703
20021 msgid "WILDCARDS AND GLOBBING"
20025 #: ../fish/guestfish.pod:705
20027 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
20028 "(globbing) by default. So for example the following will not do what you "
20033 #: ../fish/guestfish.pod:709
20041 #: ../fish/guestfish.pod:711
20043 "Assuming you don't have a directory called literally C</home/*> then the "
20044 "above command will return an error."
20048 #: ../fish/guestfish.pod:714
20049 msgid "To perform wildcard expansion, use the C<glob> command."
20053 #: ../fish/guestfish.pod:716
20056 " glob rm-rf /home/*\n"
20061 #: ../fish/guestfish.pod:718
20063 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
20064 "many times), equivalent to:"
20068 #: ../fish/guestfish.pod:721
20071 " rm-rf /home/jim\n"
20072 " rm-rf /home/joe\n"
20073 " rm-rf /home/mary\n"
20078 #: ../fish/guestfish.pod:725
20079 msgid "C<glob> only works on simple guest paths and not on device names."
20083 #: ../fish/guestfish.pod:727
20085 "If you have several parameters, each containing a wildcard, then glob will "
20086 "perform a Cartesian product."
20090 #: ../fish/guestfish.pod:730
20095 #: ../fish/guestfish.pod:732
20097 "Any line which starts with a I<#> character is treated as a comment and "
20098 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
20099 "a command. For example:"
20103 #: ../fish/guestfish.pod:736
20106 " # this is a comment\n"
20107 " # this is a comment\n"
20108 " foo # NOT a comment\n"
20113 #: ../fish/guestfish.pod:740
20114 msgid "Blank lines are also ignored."
20118 #: ../fish/guestfish.pod:742
20119 msgid "RUNNING COMMANDS LOCALLY"
20123 #: ../fish/guestfish.pod:744
20125 "Any line which starts with a I<!> character is treated as a command sent to "
20126 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
20130 #: ../fish/guestfish.pod:748
20134 " tgz-out /remote local/remote-data.tar.gz\n"
20139 #: ../fish/guestfish.pod:751
20141 "will create a directory C<local> on the host, and then export the contents "
20142 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
20143 "(See C<tgz-out>)."
20147 #: ../fish/guestfish.pod:755
20149 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
20150 "effect, due to the way that subprocesses work in Unix."
20154 #: ../fish/guestfish.pod:758
20155 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
20159 #: ../fish/guestfish.pod:760
20161 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
20162 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
20163 "and executed as guestfish commands."
20167 #: ../fish/guestfish.pod:764
20169 "Thus you can use shell script to construct arbitrary guestfish commands "
20170 "which are then parsed by guestfish."
20174 #: ../fish/guestfish.pod:767
20176 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
20177 "through C</foo.100>) using guestfish commands alone. However this is simple "
20178 "if we use a shell script to create the guestfish commands for us:"
20182 #: ../fish/guestfish.pod:772
20185 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
20190 #: ../fish/guestfish.pod:774
20191 msgid "or with names like C</foo.001>:"
20195 #: ../fish/guestfish.pod:776
20198 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
20203 #: ../fish/guestfish.pod:778
20205 "When using guestfish interactively it can be helpful to just run the shell "
20206 "script first (ie. remove the initial C<E<lt>> character so it is just an "
20207 "ordinary I<!> local command), see what guestfish commands it would run, and "
20208 "when you are happy with those prepend the C<E<lt>> character to run the "
20209 "guestfish commands for real."
20213 #: ../fish/guestfish.pod:784
20218 #: ../fish/guestfish.pod:786
20220 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
20221 "command (a guestfish command) to the second command (any host command). For "
20226 #: ../fish/guestfish.pod:790
20229 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
20234 #: ../fish/guestfish.pod:792
20236 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
20237 "program). The above command would list all accounts in the guest filesystem "
20238 "which have UID 0, ie. root accounts including backdoors. Other examples:"
20242 #: ../fish/guestfish.pod:797
20245 " hexdump /bin/ls | head\n"
20246 " list-devices | tail -1\n"
20247 " tgz-out / - | tar ztf -\n"
20252 #: ../fish/guestfish.pod:801
20254 "The space before the pipe symbol is required, any space after the pipe "
20255 "symbol is optional. Everything after the pipe symbol is just passed "
20256 "straight to the host shell, so it can contain redirections, globs and "
20257 "anything else that makes sense on the host side."
20261 #: ../fish/guestfish.pod:806
20263 "To use a literal argument which begins with a pipe symbol, you have to quote "
20268 #: ../fish/guestfish.pod:809
20276 #: ../fish/guestfish.pod:811
20277 msgid "HOME DIRECTORIES"
20281 #: ../fish/guestfish.pod:813
20283 "If a parameter starts with the character C<~> then the tilde may be expanded "
20284 "as a home directory path (either C<~> for the current user's home directory, "
20285 "or C<~user> for another user)."
20289 #: ../fish/guestfish.pod:817
20291 "Note that home directory expansion happens for users known I<on the host>, "
20292 "not in the guest filesystem."
20296 #: ../fish/guestfish.pod:820
20298 "To use a literal argument which begins with a tilde, you have to quote it, "
20303 #: ../fish/guestfish.pod:823
20311 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:534
20312 msgid "ENCRYPTED DISKS"
20316 #: ../fish/guestfish.pod:827
20318 "Libguestfs has some support for Linux guests encrypted according to the "
20319 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
20320 "disk encryption systems used by modern Linux guests. Currently only "
20321 "LVM-on-LUKS is supported."
20325 #: ../fish/guestfish.pod:832
20326 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
20330 #: ../fish/guestfish.pod:834
20333 " ><fs> vfs-type /dev/sda2\n"
20339 #: ../fish/guestfish.pod:837
20341 "Then open those devices using L</luks-open>. This creates a device-mapper "
20342 "device called C</dev/mapper/luksdev>."
20346 #: ../fish/guestfish.pod:840
20349 " ><fs> luks-open /dev/sda2 luksdev\n"
20350 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
20355 #: ../fish/guestfish.pod:843
20357 "Finally you have to tell LVM to scan for volume groups on the newly created "
20362 #: ../fish/guestfish.pod:846
20366 " vg-activate-all true\n"
20371 #: ../fish/guestfish.pod:849
20372 msgid "The logical volume(s) can now be mounted in the usual way."
20376 #: ../fish/guestfish.pod:851
20378 "Before closing a LUKS device you must unmount any logical volumes on it and "
20379 "deactivate the volume groups by calling C<vg-activate false VG> on each "
20380 "one. Then you can close the mapper device:"
20384 #: ../fish/guestfish.pod:855
20387 " vg-activate false /dev/VG\n"
20388 " luks-close /dev/mapper/luksdev\n"
20393 #: ../fish/guestfish.pod:860
20395 "If a path is prefixed with C<win:> then you can use Windows-style drive "
20396 "letters and paths (with some limitations). The following commands are "
20401 #: ../fish/guestfish.pod:864
20404 " file /WINDOWS/system32/config/system.LOG\n"
20409 #: ../fish/guestfish.pod:866
20412 " file win:\\windows\\system32\\config\\system.log\n"
20417 #: ../fish/guestfish.pod:868
20420 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
20425 #: ../fish/guestfish.pod:870
20427 "The parameter is rewritten \"behind the scenes\" by looking up the position "
20428 "where the drive is mounted, prepending that to the path, changing all "
20429 "backslash characters to forward slash, then resolving the result using "
20430 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
20431 "then the parameter might be rewritten like this:"
20435 #: ../fish/guestfish.pod:876
20438 " win:e:\\foo\\bar => /e/FOO/bar\n"
20443 #: ../fish/guestfish.pod:878
20444 msgid "This only works in argument positions that expect a path."
20448 #: ../fish/guestfish.pod:880
20449 msgid "UPLOADING AND DOWNLOADING FILES"
20453 #: ../fish/guestfish.pod:882
20455 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
20456 "others which upload from or download to a local file, you can use the "
20457 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
20461 #: ../fish/guestfish.pod:886
20469 #: ../fish/guestfish.pod:888
20470 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
20474 #: ../fish/guestfish.pod:891
20477 " tar-out /etc - | tar tf -\n"
20482 #: ../fish/guestfish.pod:893
20484 "writes the tarball to stdout and then pipes that into the external \"tar\" "
20485 "command (see L</PIPES>)."
20489 #: ../fish/guestfish.pod:896
20491 "When using C<-> to read from stdin, the input is read up to the end of "
20492 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
20493 "some arbitrary end marker:"
20497 #: ../fish/guestfish.pod:900
20500 " upload -<<END /foo\n"
20509 #: ../fish/guestfish.pod:906
20511 "Any string of characters can be used instead of C<END>. The end marker must "
20512 "appear on a line of its own, without any preceeding or following characters "
20513 "(not even spaces)."
20517 #: ../fish/guestfish.pod:910
20519 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
20520 "upload local files (so-called \"FileIn\" parameters in the generator)."
20524 #: ../fish/guestfish.pod:913
20525 msgid "EXIT ON ERROR BEHAVIOUR"
20529 #: ../fish/guestfish.pod:915
20531 "By default, guestfish will ignore any errors when in interactive mode "
20532 "(ie. taking commands from a human over a tty), and will exit on the first "
20533 "error in non-interactive mode (scripts, commands given on the command line)."
20537 #: ../fish/guestfish.pod:920
20539 "If you prefix a command with a I<-> character, then that command will not "
20540 "cause guestfish to exit, even if that (one) command returns an error."
20544 #: ../fish/guestfish.pod:924
20545 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
20549 #: ../fish/guestfish.pod:926
20551 "Guestfish can be remote-controlled over a socket. This is useful "
20552 "particularly in shell scripts where you want to make several different "
20553 "changes to a filesystem, but you don't want the overhead of starting up a "
20554 "guestfish process each time."
20558 #: ../fish/guestfish.pod:931
20559 msgid "Start a guestfish server process using:"
20563 #: ../fish/guestfish.pod:933
20566 " eval \"`guestfish --listen`\"\n"
20571 #: ../fish/guestfish.pod:935
20572 msgid "and then send it commands by doing:"
20576 #: ../fish/guestfish.pod:937
20579 " guestfish --remote cmd [...]\n"
20584 #: ../fish/guestfish.pod:939
20585 msgid "To cause the server to exit, send it the exit command:"
20589 #: ../fish/guestfish.pod:943
20591 "Note that the server will normally exit if there is an error in a command. "
20592 "You can change this in the usual way. See section L</EXIT ON ERROR "
20597 #: ../fish/guestfish.pod:947
20598 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
20602 #: ../fish/guestfish.pod:949
20604 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
20605 "is how the I<--remote> option knows where to send the commands. You can "
20606 "have several guestfish listener processes running using:"
20610 #: ../fish/guestfish.pod:953
20613 " eval \"`guestfish --listen`\"\n"
20614 " pid1=$GUESTFISH_PID\n"
20615 " eval \"`guestfish --listen`\"\n"
20616 " pid2=$GUESTFISH_PID\n"
20618 " guestfish --remote=$pid1 cmd\n"
20619 " guestfish --remote=$pid2 cmd\n"
20624 #: ../fish/guestfish.pod:961
20625 msgid "REMOTE CONTROL AND CSH"
20629 #: ../fish/guestfish.pod:963
20631 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
20636 #: ../fish/guestfish.pod:966
20639 " eval \"`guestfish --listen --csh`\"\n"
20644 #: ../fish/guestfish.pod:968
20645 msgid "REMOTE CONTROL DETAILS"
20649 #: ../fish/guestfish.pod:970
20651 "Remote control happens over a Unix domain socket called "
20652 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
20653 "of the process, and C<$PID> is the process ID of the server."
20657 #: ../fish/guestfish.pod:974
20658 msgid "Guestfish client and server versions must match exactly."
20662 #: ../fish/guestfish.pod:976
20663 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
20667 #: ../fish/guestfish.pod:978
20669 "From Bash, you can use the following code which creates a guestfish "
20670 "instance, correctly quotes the command line, handles failure to start, and "
20671 "cleans up guestfish when the script exits:"
20675 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:980
20683 #: ../fish/guestfish.pod:986
20686 " guestfish[0]=\"guestfish\"\n"
20687 " guestfish[1]=\"--listen\"\n"
20688 " guestfish[2]=\"--ro\"\n"
20689 " guestfish[3]=\"-a\"\n"
20690 " guestfish[4]=\"disk.img\"\n"
20695 #: ../fish/guestfish.pod:992
20698 " GUESTFISH_PID=\n"
20699 " eval $(\"${guestfish[@]}\")\n"
20700 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
20701 " echo \"error: guestfish didn't start up, see error messages above\"\n"
20708 #: ../fish/guestfish.pod:999
20711 " cleanup_guestfish ()\n"
20713 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
20715 " trap cleanup_guestfish EXIT ERR\n"
20720 #: ../fish/guestfish.pod:1005
20723 " guestfish --remote -- run\n"
20728 #: ../fish/guestfish.pod:1007
20736 #: ../fish/guestfish.pod:1009
20737 msgid "REMOTE CONTROL RUN COMMAND HANGING"
20741 #: ../fish/guestfish.pod:1011
20743 "Using the C<run> (or C<launch>) command remotely in a command substitution "
20744 "context hangs, ie. don't do (note the backquotes):"
20748 #: ../fish/guestfish.pod:1014
20751 " a=`guestfish --remote run`\n"
20756 #: ../fish/guestfish.pod:1016
20758 "Since the C<run> command produces no output on stdout, this is not useful "
20759 "anyway. For further information see "
20760 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
20764 #: ../fish/guestfish.pod:1020
20765 msgid "PREPARED DISK IMAGES"
20769 #: ../fish/guestfish.pod:1022
20771 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
20772 "preformatted disk images that guestfish can make for you to save typing. "
20773 "This is particularly useful for testing purposes. This option is used "
20774 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
20775 "can be mixed with I<-a>)."
20779 #: ../fish/guestfish.pod:1028
20781 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
20782 "the second and so on. Existing files in the current directory are "
20787 #: ../fish/guestfish.pod:1032
20789 "The type briefly describes how the disk should be sized, partitioned, how "
20790 "filesystem(s) should be created, and how content should be added. "
20791 "Optionally the type can be followed by extra parameters, separated by C<:> "
20792 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
20793 "sparsely-allocated disk, containing a single partition, with the partition "
20794 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
20795 "on a 1GB disk instead."
20799 #: ../fish/guestfish.pod:1040
20800 msgid "To list the available types and any extra parameters they take, run:"
20804 #: ../fish/guestfish.pod:1044
20806 "Note that the prepared filesystem is not mounted. You would usually have to "
20807 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
20811 #: ../fish/guestfish.pod:1048
20813 "If any I<-N> or I<--new> options are given, the guest is automatically "
20818 #: ../fish/guestfish.pod:1053
20819 msgid "Create a 100MB disk with an ext4-formatted partition:"
20823 #: ../fish/guestfish.pod:1055
20826 " guestfish -N fs:ext4\n"
20831 #: ../fish/guestfish.pod:1057
20832 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
20836 #: ../fish/guestfish.pod:1059
20839 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
20844 #: ../fish/guestfish.pod:1061
20845 msgid "Create a blank 200MB disk:"
20849 #: ../fish/guestfish.pod:1063
20852 " guestfish -N disk:200M\n"
20857 #: ../fish/guestfish.pod:1065
20858 msgid "PROGRESS BARS"
20862 #: ../fish/guestfish.pod:1067
20864 "Some (not all) long-running commands send progress notification messages as "
20865 "they are running. Guestfish turns these messages into progress bars."
20869 #: ../fish/guestfish.pod:1071
20871 "When a command that supports progress bars takes longer than two seconds to "
20872 "run, and if progress bars are enabled, then you will see one appearing below "
20877 #: ../fish/guestfish.pod:1075
20880 " ><fs> copy-size /large-file /another-file 2048M\n"
20881 " / 10% [#####-----------------------------------------] 00:30\n"
20886 #: ../fish/guestfish.pod:1078
20888 "The spinner on the left hand side moves round once for every progress "
20889 "notification received from the backend. This is a (reasonably) golden "
20890 "assurance that the command is \"doing something\" even if the progress bar "
20891 "is not moving, because the command is able to send the progress "
20892 "notifications. When the bar reaches 100% and the command finishes, the "
20893 "spinner disappears."
20897 #: ../fish/guestfish.pod:1085
20899 "Progress bars are enabled by default when guestfish is used interactively. "
20900 "You can enable them even for non-interactive modes using I<--progress-bars>, "
20901 "and you can disable them completely using I<--no-progress-bars>."
20905 #: ../fish/guestfish.pod:1090
20906 msgid "GUESTFISH COMMANDS"
20910 #: ../fish/guestfish.pod:1092
20912 "The commands in this section are guestfish convenience commands, in other "
20913 "words, they are not part of the L<guestfs(3)> API."
20917 #: ../fish/guestfish.pod:1095
20922 #: ../fish/guestfish.pod:1097
20931 #: ../fish/guestfish.pod:1100
20932 msgid "Without any parameter, this provides general help."
20936 #: ../fish/guestfish.pod:1102
20937 msgid "With a C<cmd> parameter, this displays detailed help for that command."
20941 #: ../fish/guestfish.pod:1104
20942 msgid "quit | exit"
20946 #: ../fish/guestfish.pod:1106
20947 msgid "This exits guestfish. You can also use C<^D> key."
20951 #: ../fish/guestfish.pod:1108
20952 msgid "@FISH_COMMANDS@"
20956 #: ../fish/guestfish.pod:1110
20961 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1520
20966 #: ../fish/guestfish.pod:1116
20968 "guestfish returns 0 if the commands completed without error, or 1 if there "
20973 #: ../fish/guestfish.pod:1123
20978 #: ../fish/guestfish.pod:1125
20980 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
20985 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3218
20986 msgid "FEBOOTSTRAP_KERNEL"
20990 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3220
20991 msgid "FEBOOTSTRAP_MODULES"
20995 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3222
20997 "These two environment variables allow the kernel that libguestfs uses in the "
20998 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
20999 "most recent host kernel is chosen. For more information about kernel "
21000 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
21001 "available in febootstrap E<ge> 3.8."
21005 #: ../fish/guestfish.pod:1138
21006 msgid "GUESTFISH_DISPLAY_IMAGE"
21010 #: ../fish/guestfish.pod:1140
21012 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
21013 "If not set, it uses L<display(1)>."
21017 #: ../fish/guestfish.pod:1143
21018 msgid "GUESTFISH_PID"
21022 #: ../fish/guestfish.pod:1145
21024 "Used with the I<--remote> option to specify the remote guestfish process to "
21025 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
21029 #: ../fish/guestfish.pod:1149
21034 #: ../fish/guestfish.pod:1151
21036 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
21037 "not specified, the external L<hexedit(1)> program is used."
21041 #: ../fish/guestfish.pod:1155
21046 #: ../fish/guestfish.pod:1157
21048 "If compiled with GNU readline support, various files in the home directory "
21049 "can be used. See L</FILES>."
21053 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3228
21054 msgid "LIBGUESTFS_APPEND"
21058 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3230
21059 msgid "Pass additional options to the guest kernel."
21063 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3232
21064 msgid "LIBGUESTFS_DEBUG"
21068 #: ../fish/guestfish.pod:1166
21070 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
21071 "effect as using the B<-v> option."
21075 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3237
21076 msgid "LIBGUESTFS_MEMSIZE"
21080 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3239
21081 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
21085 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3242
21088 " LIBGUESTFS_MEMSIZE=700\n"
21093 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3244
21094 msgid "LIBGUESTFS_PATH"
21098 #: ../fish/guestfish.pod:1178
21100 "Set the path that guestfish uses to search for kernel and initrd.img. See "
21101 "the discussion of paths in L<guestfs(3)>."
21105 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3249
21106 msgid "LIBGUESTFS_QEMU"
21110 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3251
21112 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
21113 "which was found at compile time by the configure script is used."
21117 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3257
21118 msgid "LIBGUESTFS_TRACE"
21122 #: ../fish/guestfish.pod:1189
21123 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
21127 #: ../fish/guestfish.pod:1191
21132 #: ../fish/guestfish.pod:1193
21134 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
21139 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:254 ../src/guestfs.pod:3262
21144 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3264
21146 "Location of temporary directory, defaults to C</tmp> except for the cached "
21147 "supermin appliance which defaults to C</var/tmp>."
21151 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3267
21153 "If libguestfs was compiled to use the supermin appliance then the real "
21154 "appliance is cached in this directory, shared between all handles belonging "
21155 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
21156 "use in case C</var/tmp> is not large enough."
21160 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297 ../rescue/virt-rescue.pod:310
21165 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301 ../rescue/virt-rescue.pod:314
21166 msgid "$HOME/.libguestfs-tools.rc"
21170 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303 ../rescue/virt-rescue.pod:316
21171 msgid "/etc/libguestfs-tools.conf"
21175 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305 ../rescue/virt-rescue.pod:318
21177 "This configuration file controls the default read-only or read-write mode "
21178 "(I<--ro> or I<--rw>)."
21182 #: ../fish/guestfish.pod:1220
21183 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
21187 #: ../fish/guestfish.pod:1222
21188 msgid "$HOME/.guestfish"
21192 #: ../fish/guestfish.pod:1224
21194 "If compiled with GNU readline support, then the command history is saved in "
21199 #: ../fish/guestfish.pod:1227
21200 msgid "$HOME/.inputrc"
21204 #: ../fish/guestfish.pod:1229
21205 msgid "/etc/inputrc"
21209 #: ../fish/guestfish.pod:1231
21211 "If compiled with GNU readline support, then these files can be used to "
21212 "configure readline. For further information, please see "
21213 "L<readline(3)/INITIALIZATION FILE>."
21217 #: ../fish/guestfish.pod:1235
21218 msgid "To write rules which only apply to guestfish, use:"
21222 #: ../fish/guestfish.pod:1237
21232 #: ../fish/guestfish.pod:1241
21234 "Variables that you can set in inputrc that change the behaviour of guestfish "
21235 "in useful ways include:"
21239 #: ../fish/guestfish.pod:1246
21240 msgid "completion-ignore-case (default: on)"
21244 #: ../fish/guestfish.pod:1248
21246 "By default, guestfish will ignore case when tab-completing paths on the "
21251 #: ../fish/guestfish.pod:1251
21254 " set completion-ignore-case off\n"
21259 #: ../fish/guestfish.pod:1253
21260 msgid "to make guestfish case sensitive."
21264 #: ../fish/guestfish.pod:1257
21269 #: ../fish/guestfish.pod:1259
21270 msgid "test2.img (etc)"
21274 #: ../fish/guestfish.pod:1261
21276 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
21277 "will be created in the file C<test1.img> in the current directory. The "
21278 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
21279 "the same name will be overwritten."
21283 #: ../fish/guestfish.pod:1270
21285 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, "
21286 "L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, "
21287 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, "
21288 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
21289 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
21290 "L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
21291 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
21292 "L<febootstrap-supermin-helper(8)>."
21296 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3360 ../test-tool/libguestfs-test-tool.pod:112
21297 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
21301 #: ../fish/virt-copy-in.pod:5
21302 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
21306 #: ../fish/virt-copy-in.pod:9
21309 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
21314 #: ../fish/virt-copy-in.pod:11
21317 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
21322 #: ../fish/virt-copy-in.pod:15
21324 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
21325 "causing disk corruption. The virtual machine must be shut down before you "
21326 "use this command."
21330 #: ../fish/virt-copy-in.pod:21
21332 "C<virt-copy-in> copies files and directories from the local disk into a "
21333 "virtual machine disk image or named libvirt domain."
21337 #: ../fish/virt-copy-in.pod:24
21339 "You can give one of more filenames and directories on the command line. "
21340 "Directories are copied in recursively. The final parameter must be the "
21341 "destination directory in the disk image which must be an absolute path "
21342 "starting with a C</> character."
21346 #: ../fish/virt-copy-in.pod:33
21349 " virt-copy-in -d MyGuest resolv.conf /etc\n"
21354 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
21355 msgid "Upload a home directory to a guest:"
21359 #: ../fish/virt-copy-in.pod:37
21362 " virt-copy-in -d MyGuest skel /home\n"
21367 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
21368 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
21372 #: ../fish/virt-copy-in.pod:41
21374 "This command is just a simple shell script wrapper around the "
21375 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
21376 "trivial copy, you are probably better off using guestfish directly."
21380 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
21382 "Since the shell script just passes options straight to guestfish, read "
21383 "L<guestfish(1)> to see the full list of options."
21387 #: ../fish/virt-copy-in.pod:52
21389 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
21390 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
21394 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
21395 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
21399 #: ../fish/virt-copy-out.pod:5
21401 "virt-copy-out - Copy files and directories out of a virtual machine disk "
21406 #: ../fish/virt-copy-out.pod:9
21409 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
21414 #: ../fish/virt-copy-out.pod:11
21417 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
21422 #: ../fish/virt-copy-out.pod:15
21424 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
21425 "image or named libvirt domain."
21429 #: ../fish/virt-copy-out.pod:18
21431 "You can give one of more filenames and directories on the command line. "
21432 "Directories are copied out recursively."
21436 #: ../fish/virt-copy-out.pod:23
21437 msgid "Download the home directories from a virtual machine:"
21441 #: ../fish/virt-copy-out.pod:25
21445 " virt-copy-out -d MyGuest /home homes\n"
21450 #: ../fish/virt-copy-out.pod:30
21452 "This command is just a simple shell script wrapper around the "
21453 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
21454 "trivial copy, you are probably better off using guestfish directly."
21458 #: ../fish/virt-copy-out.pod:41
21460 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
21461 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
21465 #: ../fish/virt-tar-in.pod:5
21466 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
21470 #: ../fish/virt-tar-in.pod:9
21473 " virt-tar-in -a disk.img data.tar /destination\n"
21478 #: ../fish/virt-tar-in.pod:11
21481 " virt-tar-in -d domain data.tar /destination\n"
21486 #: ../fish/virt-tar-in.pod:13
21489 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
21494 #: ../fish/virt-tar-in.pod:17
21496 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
21497 "causing disk corruption. The virtual machine must be shut down before you "
21498 "use this command."
21502 #: ../fish/virt-tar-in.pod:23
21504 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
21505 "image or named libvirt domain."
21509 #: ../fish/virt-tar-in.pod:26
21511 "The first parameter is the tar file. Use C<-> to read the tar file from "
21512 "standard input. The second parameter is the absolute target directory to "
21517 #: ../fish/virt-tar-in.pod:34
21520 " virt-tar-in -d MyGuest homes.tar /home\n"
21525 #: ../fish/virt-tar-in.pod:38
21527 "This command is just a simple shell script wrapper around the "
21528 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
21529 "copy, you are probably better off using guestfish directly."
21533 #: ../fish/virt-tar-in.pod:49
21535 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
21536 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
21537 "L<http://libguestfs.org/>."
21541 #: ../fish/virt-tar-out.pod:5
21542 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
21546 #: ../fish/virt-tar-out.pod:9
21549 " virt-tar-out -a disk.img /dir files.tar\n"
21554 #: ../fish/virt-tar-out.pod:11
21557 " virt-tar-out -d domain /dir files.tar\n"
21562 #: ../fish/virt-tar-out.pod:13
21565 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
21570 #: ../fish/virt-tar-out.pod:17
21571 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
21575 #: ../fish/virt-tar-out.pod:20
21577 "The first parameter is the absolute path of the virtual machine directory. "
21578 "The second parameter is the tar file to write. Use C<-> to write to "
21583 #: ../fish/virt-tar-out.pod:26
21584 msgid "Download the home directories from a guest:"
21588 #: ../fish/virt-tar-out.pod:28
21591 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
21596 #: ../fish/virt-tar-out.pod:32
21598 "This command is just a simple shell script wrapper around the "
21599 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
21600 "trivial copy, you are probably better off using guestfish directly."
21604 #: ../fish/virt-tar-out.pod:43
21606 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
21607 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
21611 #: ../fuse/guestmount.pod:5
21612 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
21616 #: ../fuse/guestmount.pod:9
21619 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
21624 #: ../fuse/guestmount.pod:11
21627 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
21632 #: ../fuse/guestmount.pod:13
21635 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
21640 #: ../fuse/guestmount.pod:17
21642 "You must I<not> use C<guestmount> in read-write mode on live virtual "
21643 "machines. If you do this, you risk disk corruption in the VM."
21647 #: ../fuse/guestmount.pod:22
21649 "The guestmount program can be used to mount virtual machine filesystems and "
21650 "other disk images on the host. It uses libguestfs for access to the guest "
21651 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
21652 "a mountable device."
21656 #: ../fuse/guestmount.pod:27
21658 "Along with other options, you have to give at least one device (I<-a> "
21659 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
21660 "option) or use the I<-i> inspection option or the I<--live> option. How "
21661 "this works is better explained in the L<guestfish(1)> manual page, or by "
21662 "looking at the examples below."
21666 #: ../fuse/guestmount.pod:33
21668 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
21669 "by you, and the filesystem will not be visible to any other users unless you "
21670 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
21671 "the filesystem, use the C<fusermount -u> command."
21675 #: ../fuse/guestmount.pod:41
21677 "For a typical Windows guest which has its main filesystem on the first "
21682 #: ../fuse/guestmount.pod:44
21685 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
21690 #: ../fuse/guestmount.pod:46
21692 "For a typical Linux guest which has a /boot filesystem on the first "
21693 "partition, and the root filesystem on a logical volume:"
21697 #: ../fuse/guestmount.pod:49
21700 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
21705 #: ../fuse/guestmount.pod:51
21706 msgid "To get libguestfs to detect guest mountpoints for you:"
21710 #: ../fuse/guestmount.pod:53
21713 " guestmount -a guest.img -i --ro /mnt\n"
21718 #: ../fuse/guestmount.pod:55
21719 msgid "For a libvirt guest called \"Guest\" you could do:"
21723 #: ../fuse/guestmount.pod:57
21726 " guestmount -d Guest -i --ro /mnt\n"
21731 #: ../fuse/guestmount.pod:59
21733 "If you don't know what filesystems are contained in a guest or disk image, "
21734 "use L<virt-filesystems(1)> first:"
21738 #: ../fuse/guestmount.pod:62
21741 " virt-filesystems MyGuest\n"
21746 #: ../fuse/guestmount.pod:64
21748 "If you want to trace the libguestfs calls but without excessive debugging "
21749 "information, we recommend:"
21753 #: ../fuse/guestmount.pod:67
21756 " guestmount [...] --trace /mnt\n"
21761 #: ../fuse/guestmount.pod:69
21762 msgid "If you want to debug the program, we recommend:"
21766 #: ../fuse/guestmount.pod:71
21769 " guestmount [...] --trace --verbose /mnt\n"
21774 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:96 ../resize/virt-resize.pod:621
21779 #: ../fuse/guestmount.pod:75
21780 msgid "Other users cannot see the filesystem by default"
21784 #: ../fuse/guestmount.pod:77
21786 "If you mount a filesystem as one user (eg. root), then other users will not "
21787 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
21788 "option when mounting:"
21792 #: ../fuse/guestmount.pod:81
21795 " sudo guestmount [...] -o allow_other /mnt\n"
21800 #: ../fuse/guestmount.pod:83
21801 msgid "Enabling FUSE"
21805 #: ../fuse/guestmount.pod:85
21807 "On some distros, you may need to add yourself to a special group "
21808 "(eg. C<fuse>) before you can use any FUSE filesystem. This is necessary on "
21809 "Debian and derivatives."
21813 #: ../fuse/guestmount.pod:89
21815 "On other distros, no special group is required. It is not necessary on "
21816 "Fedora or Red Hat Enterprise Linux."
21820 #: ../fuse/guestmount.pod:100
21821 msgid "Add a block device or virtual machine image."
21825 #: ../fuse/guestmount.pod:123
21826 msgid "B<--dir-cache-timeout N>"
21830 #: ../fuse/guestmount.pod:125
21832 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
21833 "seconds. The readdir cache [actually, there are several semi-independent "
21834 "caches] is populated after a readdir(2) call with the stat and extended "
21835 "attributes of the files in the directory, in anticipation that they will be "
21836 "requested soon after."
21840 #: ../fuse/guestmount.pod:131
21842 "There is also a different attribute cache implemented by FUSE (see the FUSE "
21843 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
21844 "requests, only cache existing ones."
21848 #: ../fuse/guestmount.pod:151
21850 "If you have untrusted raw-format guest disk images, you should use this "
21851 "option to specify the disk format. This avoids a possible security problem "
21852 "with malicious guests (CVE-2010-3851). See also "
21853 "L<guestfs(3)/guestfs_add_drive_opts>."
21857 #: ../fuse/guestmount.pod:156
21858 msgid "B<--fuse-help>"
21862 #: ../fuse/guestmount.pod:158
21863 msgid "Display help on special FUSE options (see I<-o> below)."
21867 #: ../fuse/guestmount.pod:162
21868 msgid "Display brief help and exit."
21872 #: ../fuse/guestmount.pod:186
21874 "Mount the named partition or logical volume on the given mountpoint B<in the "
21875 "guest> (this has nothing to do with mountpoints in the host)."
21879 #: ../fuse/guestmount.pod:189
21881 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
21882 "something on C</>."
21886 #: ../fuse/guestmount.pod:206
21888 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
21889 "unmounted. If you specify this option, then we don't attempt to sync the "
21890 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
21894 #: ../fuse/guestmount.pod:211
21895 msgid "B<-o option>"
21899 #: ../fuse/guestmount.pod:213
21900 msgid "B<--option option>"
21904 #: ../fuse/guestmount.pod:215
21905 msgid "Pass extra options to FUSE."
21909 #: ../fuse/guestmount.pod:217
21911 "To get a list of all the extra options supported by FUSE, use the command "
21912 "below. Note that only the FUSE I<-o> options can be passed, and only some "
21913 "of them are a good idea."
21917 #: ../fuse/guestmount.pod:221
21920 " guestmount --fuse-help\n"
21925 #: ../fuse/guestmount.pod:223
21926 msgid "Some potentially useful FUSE options:"
21930 #: ../fuse/guestmount.pod:227
21931 msgid "B<-o allow_other>"
21935 #: ../fuse/guestmount.pod:229
21936 msgid "Allow other users to see the filesystem."
21940 #: ../fuse/guestmount.pod:231
21941 msgid "B<-o attr_timeout=N>"
21945 #: ../fuse/guestmount.pod:233
21946 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
21950 #: ../fuse/guestmount.pod:235
21951 msgid "B<-o kernel_cache>"
21955 #: ../fuse/guestmount.pod:237
21957 "Allow the kernel to cache files (reduces the number of reads that have to go "
21958 "through the L<guestfs(3)> API). This is generally a good idea if you can "
21959 "afford the extra memory usage."
21963 #: ../fuse/guestmount.pod:241
21964 msgid "B<-o uid=N> B<-o gid=N>"
21968 #: ../fuse/guestmount.pod:243
21970 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
21971 "the chosen values."
21975 #: ../fuse/guestmount.pod:252
21977 "Add devices and mount everything read-only. Also disallow writes and make "
21978 "the disk appear read-only to FUSE."
21982 #: ../fuse/guestmount.pod:255
21984 "This is highly recommended if you are not going to edit the guest disk. If "
21985 "the guest is running and this option is I<not> supplied, then there is a "
21986 "strong risk of disk corruption in the guest. We try to prevent this from "
21987 "happening, but it is not always possible."
21991 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:199
21992 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
21996 #: ../fuse/guestmount.pod:264
21997 msgid "Enable SELinux support for the guest."
22001 #: ../fuse/guestmount.pod:270
22002 msgid "Enable verbose messages from underlying libguestfs."
22006 #: ../fuse/guestmount.pod:276
22007 msgid "Display the program version and exit."
22011 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308 ../rescue/virt-rescue.pod:238 ../rescue/virt-rescue.pod:321
22012 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
22016 #: ../fuse/guestmount.pod:289
22021 #: ../fuse/guestmount.pod:291
22022 msgid "Trace libguestfs calls and entry into each FUSE function."
22026 #: ../fuse/guestmount.pod:293
22027 msgid "This also stops the daemon from forking into the background."
22031 #: ../fuse/guestmount.pod:319
22033 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
22034 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
22035 "L<http://fuse.sf.net/>."
22039 #: ../fuse/guestmount.pod:334
22040 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
22044 #: ../inspector/virt-inspector.pod:5
22046 "virt-inspector - Display operating system version and other information "
22047 "about a virtual machine"
22051 #: ../inspector/virt-inspector.pod:9
22054 " virt-inspector [--options] -d domname\n"
22059 #: ../inspector/virt-inspector.pod:11
22062 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
22067 #: ../inspector/virt-inspector.pod:15
22070 " virt-inspector domname\n"
22075 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:148
22078 " virt-inspector disk.img [disk.img ...]\n"
22083 #: ../inspector/virt-inspector.pod:21
22085 "B<virt-inspector> examines a virtual machine or disk image and tries to "
22086 "determine the version of the operating system and other information about "
22087 "the virtual machine."
22091 #: ../inspector/virt-inspector.pod:25
22092 msgid "Virt-inspector produces XML output for feeding into other programs."
22096 #: ../inspector/virt-inspector.pod:27
22098 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
22099 "the libvirt domain (see: C<virsh list --all>)."
22103 #: ../inspector/virt-inspector.pod:30
22105 "You can also run virt-inspector directly on disk images from a single "
22106 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
22107 "has several block devices, in which case you should list several I<-a> "
22108 "options one after another, with the first corresponding to the guest's "
22109 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
22113 #: ../inspector/virt-inspector.pod:37
22115 "You can also run virt-inspector on install disks, live CDs, bootable USB "
22116 "keys and similar."
22120 #: ../inspector/virt-inspector.pod:40
22122 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
22123 "inspect several virtual machines, you have to run virt-inspector several "
22124 "times (for example, from a shell script for-loop)."
22128 #: ../inspector/virt-inspector.pod:45
22130 "Because virt-inspector needs direct access to guest images, it won't "
22131 "normally work over remote libvirt connections."
22135 #: ../inspector/virt-inspector.pod:48
22137 "All of the information available from virt-inspector is also available "
22138 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
22139 "The same information can also be fetched using guestfish or via libguestfs "
22140 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
22141 "WITH OTHER PROGRAMMING LANGUAGES>)."
22145 #: ../inspector/virt-inspector.pod:81
22147 "Libvirt is only used if you specify a C<domname> on the command line. If "
22148 "you specify guest block devices directly (I<-a>), then libvirt is not used "
22153 #: ../inspector/virt-inspector.pod:94
22155 "When prompting for keys and passphrases, virt-inspector normally turns "
22156 "echoing off so you cannot see what you are typing. If you are not worried "
22157 "about Tempest attacks and there is no one else in the room you can specify "
22158 "this flag to see what you are typing."
22162 #: ../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
22164 "Specify the format of disk images given on the command line. If this is "
22165 "omitted then the format is autodetected from the content of the disk image."
22169 #: ../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
22171 "If disk images are requested from libvirt, then this program asks libvirt "
22172 "for this information. In this case, the value of the format parameter is "
22177 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:391 ../resize/virt-resize.pod:483 ../sparsify/virt-sparsify.pod:138 ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102 ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
22179 "If working with untrusted raw-format guest disk images, you should ensure "
22180 "the format is always specified."
22184 #: ../inspector/virt-inspector.pod:135
22185 msgid "B<--xpath> query"
22189 #: ../inspector/virt-inspector.pod:137
22191 "Perform an XPath query on the XML on stdin, and print the result on stdout. "
22192 "In this mode virt-inspector simply runs an XPath query; all other inspection "
22193 "functions are disabled. See L</XPATH QUERIES> below for some examples."
22197 #: ../inspector/virt-inspector.pod:146
22198 msgid "Previous versions of virt-inspector allowed you to write either:"
22202 #: ../inspector/virt-inspector.pod:152
22205 " virt-inspector guestname\n"
22210 #: ../inspector/virt-inspector.pod:160
22215 #: ../inspector/virt-inspector.pod:162
22217 "The virt-inspector XML is described precisely in a RELAX NG schema file "
22218 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
22219 "just an overview."
22223 #: ../inspector/virt-inspector.pod:166
22225 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
22226 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
22227 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
22228 "which is vanishingly rare in real world VMs."
22232 #: ../inspector/virt-inspector.pod:171
22233 msgid "E<lt>operatingsystemE<gt>"
22237 #: ../inspector/virt-inspector.pod:173
22239 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
22240 "describe the operating system, its architecture, the descriptive \"product "
22241 "name\" string, the type of OS and so on, as in this example:"
22245 #: ../inspector/virt-inspector.pod:177
22248 " <operatingsystems>\n"
22249 " <operatingsystem>\n"
22250 " <root>/dev/sda2</root>\n"
22251 " <name>windows</name>\n"
22252 " <arch>i386</arch>\n"
22253 " <distro>windows</distro>\n"
22254 " <product_name>Windows 7 Enterprise</product_name>\n"
22255 " <product_variant>Client</product_variant>\n"
22256 " <major_version>6</major_version>\n"
22257 " <minor_version>1</minor_version>\n"
22258 " <windows_systemroot>/Windows</windows_systemroot>\n"
22259 " <format>installed</format>\n"
22264 #: ../inspector/virt-inspector.pod:190
22266 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
22267 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
22268 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
22269 "architecture. The other fields are fairly self-explanatory, but because "
22270 "these fields are taken directly from the libguestfs inspection API you can "
22271 "find precise information from L<guestfs(3)/INSPECTION>."
22275 #: ../inspector/virt-inspector.pod:198
22277 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
22278 "of view of libguestfs (block devices may have completely different names "
22279 "inside the VM itself)."
22283 #: ../inspector/virt-inspector.pod:202
22284 msgid "E<lt>mountpointsE<gt>"
22288 #: ../inspector/virt-inspector.pod:204
22290 "Un*x-like guests typically have multiple filesystems which are mounted at "
22291 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
22292 "element which looks like this:"
22296 #: ../inspector/virt-inspector.pod:208
22299 " <operatingsystems>\n"
22300 " <operatingsystem>\n"
22303 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
22304 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
22305 " </mountpoints>\n"
22310 #: ../inspector/virt-inspector.pod:216
22312 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
22313 "and may have completely different names inside the guest. Only mountable "
22314 "filesystems appear in this list, not things like swap devices."
22318 #: ../inspector/virt-inspector.pod:221
22319 msgid "E<lt>filesystemsE<gt>"
22323 #: ../inspector/virt-inspector.pod:223
22325 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
22326 "filesystems belonging to the guest, including swap and empty partitions. "
22327 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
22328 "this OS or shared with this OS and other OSes)."
22332 #: ../inspector/virt-inspector.pod:229
22333 msgid "You might see something like this:"
22337 #: ../inspector/virt-inspector.pod:231
22340 " <operatingsystems>\n"
22341 " <operatingsystem>\n"
22344 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
22345 " <type>ext4</type>\n"
22346 " <label>Fedora-13-x86_64</label>\n"
22347 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
22353 #: ../inspector/virt-inspector.pod:241
22355 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
22356 "the label, and the UUID."
22360 #: ../inspector/virt-inspector.pod:244
22361 msgid "E<lt>applicationsE<gt>"
22365 #: ../inspector/virt-inspector.pod:246
22367 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
22368 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
22373 #: ../inspector/virt-inspector.pod:250
22375 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
22376 "Typical values would be C<rpm> and C<deb>."
22380 #: ../inspector/virt-inspector.pod:253
22382 "E<lt>package_managementE<gt>, if present, describes the package manager. "
22383 "Typical values include C<yum>, C<up2date> and C<apt>"
22387 #: ../inspector/virt-inspector.pod:256
22388 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
22392 #: ../inspector/virt-inspector.pod:259
22395 " <operatingsystems>\n"
22396 " <operatingsystem>\n"
22398 " <applications>\n"
22400 " <name>coreutils</name>\n"
22401 " <version>8.5</version>\n"
22402 " <release>1</release>\n"
22403 " </application>\n"
22408 #: ../inspector/virt-inspector.pod:269
22410 "The version and release fields may not be available for some types guests. "
22411 "Other fields are possible, see "
22412 "L<guestfs(3)/guestfs_inspect_list_applications>."
22416 #: ../inspector/virt-inspector.pod:273
22417 msgid "E<lt>drive_mappingsE<gt>"
22421 #: ../inspector/virt-inspector.pod:275
22423 "For operating systems like Windows which use drive letters, virt-inspector "
22424 "is able to find out how drive letters map to filesystems."
22428 #: ../inspector/virt-inspector.pod:279
22431 " <operatingsystems>\n"
22432 " <operatingsystem>\n"
22434 " <drive_mappings>\n"
22435 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
22436 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
22437 " </drive_mappings>\n"
22442 #: ../inspector/virt-inspector.pod:287
22444 "In the example above, drive C maps to the filesystem on the second partition "
22445 "on the first disk, and drive E maps to the filesystem on the first partition "
22446 "on the second disk."
22450 #: ../inspector/virt-inspector.pod:291
22452 "Note that this only covers permanent local filesystem mappings, not things "
22453 "like network shares. Furthermore NTFS volume mount points may not be listed "
22458 #: ../inspector/virt-inspector.pod:295
22459 msgid "E<lt>iconE<gt>"
22463 #: ../inspector/virt-inspector.pod:297
22465 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
22466 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
22467 "very large and high quality."
22471 #: ../inspector/virt-inspector.pod:301
22474 " <operatingsystems>\n"
22475 " <operatingsystem>\n"
22478 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
22479 " [... many lines of base64 data ...]\n"
22485 #: ../inspector/virt-inspector.pod:309
22487 "To display the icon, you have to extract it and convert the base64 data back "
22488 "to a binary file. Use an XPath query or simply an editor to extract the "
22489 "data, then use the coreutils L<base64(1)> program to do the conversion back "
22494 #: ../inspector/virt-inspector.pod:314
22497 " base64 -i -d < icon.data > icon.png\n"
22502 #: ../inspector/virt-inspector.pod:316
22503 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
22507 #: ../inspector/virt-inspector.pod:318
22509 "Virt-inspector can detect some operating system installers on install disks, "
22510 "live CDs, bootable USB keys and more."
22514 #: ../inspector/virt-inspector.pod:321
22516 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
22517 "fields may be present to indicate a live CD, network installer, or one part "
22518 "of a multipart CD. For example:"
22522 #: ../inspector/virt-inspector.pod:325
22525 " <operatingsystems>\n"
22526 " <operatingsystem>\n"
22527 " <root>/dev/sda</root>\n"
22528 " <name>linux</name>\n"
22529 " <arch>i386</arch>\n"
22530 " <distro>ubuntu</distro>\n"
22531 " <product_name>Ubuntu 10.10 "Maverick "
22532 "Meerkat"</product_name>\n"
22533 " <major_version>10</major_version>\n"
22534 " <minor_version>10</minor_version>\n"
22535 " <format>installer</format>\n"
22541 #: ../inspector/virt-inspector.pod:337
22542 msgid "XPATH QUERIES"
22546 #: ../inspector/virt-inspector.pod:339
22548 "Virt-inspector includes built in support for running XPath queries. The "
22549 "reason for including XPath support directly in virt-inspector is simply that "
22550 "there are no good and widely available command line programs that can do "
22551 "XPath queries. The only good one is L<xmlstarlet(1)> and that is not "
22552 "available on Red Hat Enterprise Linux."
22556 #: ../inspector/virt-inspector.pod:346
22558 "To perform an XPath query, use the I<--xpath> option. Note that in this "
22559 "mode, virt-inspector simply reads XML from stdin and outputs the query "
22560 "result on stdout. All other inspection features are disabled in this mode."
22564 #: ../inspector/virt-inspector.pod:353
22567 " $ virt-inspector -d Guest | virt-inspector --xpath '//filesystems'\n"
22569 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
22570 " <type>ext4</type>\n"
22576 #: ../inspector/virt-inspector.pod:359
22579 " $ virt-inspector -d Guest | \\\n"
22580 " virt-inspector --xpath "
22581 "\"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
22587 #: ../inspector/virt-inspector.pod:363
22590 " $ virt-inspector -d Guest | \\\n"
22591 " virt-inspector --xpath 'string(//icon)' | base64 -i -d | display -\n"
22592 " [displays the guest icon, if there is one]\n"
22597 #: ../inspector/virt-inspector.pod:374
22598 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
22602 #: ../inspector/virt-inspector.pod:376
22604 "Early versions of libguestfs shipped with a different virt-inspector program "
22605 "written in Perl (the current version is written in C). The XML output of "
22606 "the Perl virt-inspector was different and it could also output in other "
22607 "formats like text."
22611 #: ../inspector/virt-inspector.pod:381
22612 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
22616 #: ../inspector/virt-inspector.pod:384
22618 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
22619 "versions of virt-inspector with different names:"
22623 #: ../inspector/virt-inspector.pod:387
22626 " virt-inspector Old Perl version.\n"
22627 " virt-inspector2 New C version.\n"
22632 #: ../inspector/virt-inspector.pod:397
22634 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
22635 "L<base64(1)>, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
22639 #: ../inspector/virt-inspector.pod:414
22640 msgid "Matthew Booth L<mbooth@redhat.com>"
22644 #: ../java/examples/guestfs-java.pod:5
22645 msgid "guestfs-java - How to use libguestfs from Java"
22649 #: ../java/examples/guestfs-java.pod:9
22652 " import com.redhat.et.libguestfs.*;\n"
22657 #: ../java/examples/guestfs-java.pod:11
22660 " GuestFS g = new GuestFS ();\n"
22661 " g.add_drive_opts (\"disk.img\", null);\n"
22667 #: ../java/examples/guestfs-java.pod:17
22669 "This manual page documents how to call libguestfs from the Java programming "
22670 "language. This page just documents the differences from the C API and gives "
22671 "some examples. If you are not familiar with using libguestfs, you also need "
22672 "to read L<guestfs(3)>."
22676 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
22677 msgid "CLOSING THE HANDLE"
22681 #: ../java/examples/guestfs-java.pod:24
22683 "The handle is closed when it is reaped by the garbage collector. Because "
22684 "libguestfs handles include a lot of state, it is also possible to close (and "
22685 "hence free) them explicitly by calling the C<close> method."
22689 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
22694 #: ../java/examples/guestfs-java.pod:31
22696 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
22697 "exception. This has a single parameter which is the error message (a "
22702 #: ../java/examples/guestfs-java.pod:35
22703 msgid "Calling any method on a closed handle raises the same exception."
22707 #: ../java/examples/guestfs-java.pod:47
22709 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
22710 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
22711 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
22712 "L<http://caml.inria.fr/>."
22716 #: ../ocaml/examples/guestfs-ocaml.pod:5
22717 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
22721 #: ../ocaml/examples/guestfs-ocaml.pod:9
22722 msgid "Module style:"
22726 #: ../ocaml/examples/guestfs-ocaml.pod:11
22729 " let g = Guestfs.create () in\n"
22730 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
22731 " Guestfs.launch g;\n"
22736 #: ../ocaml/examples/guestfs-ocaml.pod:15
22737 msgid "Object-oriented style:"
22741 #: ../ocaml/examples/guestfs-ocaml.pod:17
22744 " let g = new Guestfs.guestfs () in\n"
22745 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
22751 #: ../ocaml/examples/guestfs-ocaml.pod:21
22754 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
22756 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
22761 #: ../ocaml/examples/guestfs-ocaml.pod:27
22763 "This manual page documents how to call libguestfs from the OCaml programming "
22764 "language. This page just documents the differences from the C API and gives "
22765 "some examples. If you are not familiar with using libguestfs, you also need "
22766 "to read L<guestfs(3)>."
22770 #: ../ocaml/examples/guestfs-ocaml.pod:32
22771 msgid "PROGRAMMING STYLES"
22775 #: ../ocaml/examples/guestfs-ocaml.pod:34
22777 "There are two different programming styles supported by the OCaml bindings. "
22778 "You can use a module style, with each C function mapped to an OCaml "
22783 #: ../ocaml/examples/guestfs-ocaml.pod:38
22786 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
22791 #: ../ocaml/examples/guestfs-ocaml.pod:40
22796 #: ../ocaml/examples/guestfs-ocaml.pod:42
22799 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
22804 #: ../ocaml/examples/guestfs-ocaml.pod:44
22806 "Alternately you can use an object-oriented style, calling methods on the "
22807 "class C<Guestfs.guestfs>:"
22811 #: ../ocaml/examples/guestfs-ocaml.pod:47
22814 " method set_verbose : bool -> unit\n"
22819 #: ../ocaml/examples/guestfs-ocaml.pod:49
22821 "The object-oriented style is usually briefer, and the minor performance "
22822 "penalty isn't noticable in the general overhead of performing libguestfs "
22827 #: ../ocaml/examples/guestfs-ocaml.pod:55
22829 "The handle is closed when it is reaped by the garbage collector. Because "
22830 "libguestfs handles include a lot of state, it is also possible to close (and "
22831 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
22836 #: ../ocaml/examples/guestfs-ocaml.pod:62
22838 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
22839 "exception. This has a single parameter which is the error message (a "
22844 #: ../ocaml/examples/guestfs-ocaml.pod:66
22846 "Calling any function/method on a closed handle raises "
22847 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
22852 #: ../ocaml/examples/guestfs-ocaml.pod:80
22854 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
22855 "L<guestfs-java(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
22856 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
22857 "L<http://caml.inria.fr/>."
22861 #: ../perl/examples/guestfs-perl.pod:5
22862 msgid "guestfs-perl - How to use libguestfs from Perl"
22866 #: ../perl/examples/guestfs-perl.pod:9
22869 " use Sys::Guestfs;\n"
22874 #: ../perl/examples/guestfs-perl.pod:11
22877 " my $h = Sys::Guestfs->new ();\n"
22878 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
22879 " $h->launch ();\n"
22880 " $h->mount_options ('', '/dev/sda1', '/');\n"
22881 " $h->touch ('/hello');\n"
22887 #: ../perl/examples/guestfs-perl.pod:20
22889 "This manual page documents how to call libguestfs from the Perl programming "
22890 "language. This page just documents the differences from the C API and gives "
22891 "some examples. If you are not familiar with using libguestfs, you also need "
22892 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
22896 #: ../perl/examples/guestfs-perl.pod:26
22901 #: ../perl/examples/guestfs-perl.pod:28
22903 "Errors from libguestfs functions turn into calls to C<croak> (see "
22908 #: ../perl/examples/guestfs-perl.pod:41
22910 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
22911 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
22912 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
22913 "L<http://libguestfs.org/>."
22917 #: ../python/examples/guestfs-python.pod:5
22918 msgid "guestfs-python - How to use libguestfs from Python"
22922 #: ../python/examples/guestfs-python.pod:9
22925 " import guestfs\n"
22926 " g = guestfs.GuestFS ()\n"
22927 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
22933 #: ../python/examples/guestfs-python.pod:16
22935 "This manual page documents how to call libguestfs from the Python "
22936 "programming language. This page just documents the differences from the C "
22937 "API and gives some examples. If you are not familiar with using libguestfs, "
22938 "you also need to read L<guestfs(3)>."
22942 #: ../python/examples/guestfs-python.pod:23
22944 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
22945 "single string argument which is the error message."
22949 #: ../python/examples/guestfs-python.pod:26
22950 msgid "MORE DOCUMENTATION"
22954 #: ../python/examples/guestfs-python.pod:28
22959 #: ../python/examples/guestfs-python.pod:30
22963 " >>> import guestfs\n"
22964 " >>> help (guestfs)\n"
22969 #: ../python/examples/guestfs-python.pod:44
22971 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
22972 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
22973 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
22977 #: ../rescue/virt-rescue.pod:5
22978 msgid "virt-rescue - Run a rescue shell on a virtual machine"
22982 #: ../rescue/virt-rescue.pod:9
22985 " virt-rescue [--options] -d domname\n"
22990 #: ../rescue/virt-rescue.pod:11
22993 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
22998 #: ../rescue/virt-rescue.pod:13
23001 " virt-rescue --suggest (-d domname | -a disk.img ...)\n"
23006 #: ../rescue/virt-rescue.pod:17
23009 " virt-rescue [--options] domname\n"
23014 #: ../rescue/virt-rescue.pod:19
23017 " virt-rescue [--options] disk.img [disk.img ...]\n"
23022 #: ../rescue/virt-rescue.pod:23
23024 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
23025 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
23026 "you from doing this, but doesn't catch all cases."
23030 #: ../rescue/virt-rescue.pod:27
23032 "However if you use the I<--ro> (read only) option, then you can attach a "
23033 "shell to a live virtual machine. The results might be strange or "
23034 "inconsistent at times but you won't get disk corruption."
23038 #: ../rescue/virt-rescue.pod:33
23040 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
23041 "need for a CD. virt-rescue gives you a rescue shell and some simple "
23042 "recovery tools which you can use to examine or rescue a virtual machine or "
23047 #: ../rescue/virt-rescue.pod:38
23049 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
23050 "on disk image(s):"
23054 #: ../rescue/virt-rescue.pod:41
23057 " virt-rescue -d GuestName\n"
23062 #: ../rescue/virt-rescue.pod:43
23065 " virt-rescue --ro -a /path/to/disk.img\n"
23070 #: ../rescue/virt-rescue.pod:45
23073 " virt-rescue -a /dev/sdc\n"
23078 #: ../rescue/virt-rescue.pod:47
23079 msgid "For live VMs you I<must> use the --ro option."
23083 #: ../rescue/virt-rescue.pod:49
23085 "When you run virt-rescue on a virtual machine or disk image, you are placed "
23086 "in an interactive bash shell where you can use many ordinary Linux "
23087 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
23088 "appliance. You must mount the virtual machine's filesystems by hand. There "
23089 "is an empty directory called C</sysroot> where you can mount filesystems."
23093 #: ../rescue/virt-rescue.pod:56
23095 "You can get virt-rescue to suggest mount commands for you by using the "
23096 "I<--suggest> option (in another terminal):"
23100 #: ../rescue/virt-rescue.pod:59
23103 " $ virt-rescue --suggest -d Fedora15\n"
23104 " Inspecting the virtual machine or disk image ...\n"
23109 #: ../rescue/virt-rescue.pod:62
23112 " This disk contains one or more operating systems. You can use these\n"
23113 " mount commands in virt-rescue (at the ><rescue> prompt) to mount the\n"
23119 #: ../rescue/virt-rescue.pod:66
23122 " # /dev/vg_f15x32/lv_root is the root of a linux operating system\n"
23123 " # type: linux, distro: fedora, version: 15.0\n"
23124 " # Fedora release 15 (Lovelock)\n"
23129 #: ../rescue/virt-rescue.pod:70
23132 " mount /dev/vg_f15x32/lv_root /sysroot/\n"
23133 " mount /dev/vda1 /sysroot/boot\n"
23134 " mount --bind /dev /sysroot/dev\n"
23135 " mount --bind /dev/pts /sysroot/dev/pts\n"
23136 " mount --bind /proc /sysroot/proc\n"
23137 " mount --bind /sys /sysroot/sys\n"
23142 #: ../rescue/virt-rescue.pod:77
23144 "Another way is to list the logical volumes (with L<lvs(8)>) and partitions "
23145 "(with L<parted(8)>) and mount them by hand:"
23149 #: ../rescue/virt-rescue.pod:80
23153 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
23154 " lv_root vg_f15x32 -wi-a- 8.83G\n"
23155 " lv_swap vg_f15x32 -wi-a- 992.00M\n"
23156 " ><rescue> mount /dev/vg_f15x32/lv_root /sysroot\n"
23157 " ><rescue> mount /dev/vda1 /sysroot/boot\n"
23158 " ><rescue> ls /sysroot\n"
23163 #: ../rescue/virt-rescue.pod:88
23164 msgid "Another command to list available filesystems is L<virt-filesystems(1)>."
23168 #: ../rescue/virt-rescue.pod:91
23170 "To run commands in a Linux guest (for example, grub), you should chroot into "
23171 "the /sysroot directory first:"
23175 #: ../rescue/virt-rescue.pod:94
23178 " ><rescue> chroot /sysroot\n"
23183 #: ../rescue/virt-rescue.pod:98
23185 "Virt-rescue can be used on I<any> disk image file or device, not just a "
23186 "virtual machine. For example you can use it on a blank file if you want to "
23187 "partition that file (although we would recommend using L<guestfish(1)> "
23188 "instead as it is more suitable for this purpose). You can even use "
23189 "virt-rescue on things like SD cards."
23193 #: ../rescue/virt-rescue.pod:104
23195 "Virt-rescue does not require root. You only need to run it as root if you "
23196 "need root to open the disk image."
23200 #: ../rescue/virt-rescue.pod:107
23202 "This tool is just designed for quick interactive hacking on a virtual "
23203 "machine. For more structured access to a virtual machine disk image, you "
23204 "should use L<guestfs(3)>. To get a structured shell that you can use to "
23205 "make scripted changes to guests, use L<guestfish(1)>."
23209 #: ../rescue/virt-rescue.pod:131
23210 msgid "B<--append kernelopts>"
23214 #: ../rescue/virt-rescue.pod:133
23215 msgid "Pass additional options to the rescue kernel."
23219 #: ../rescue/virt-rescue.pod:163
23222 " virt-rescue --format=raw -a disk.img\n"
23227 #: ../rescue/virt-rescue.pod:167
23230 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
23235 #: ../rescue/virt-rescue.pod:176
23240 #: ../rescue/virt-rescue.pod:178
23241 msgid "B<--memsize MB>"
23245 #: ../rescue/virt-rescue.pod:180
23247 "Change the amount of memory allocated to the rescue system. The default is "
23248 "set by libguestfs and is small but adequate for running system tools. The "
23249 "occasional program might need more memory. The parameter is specified in "
23254 #: ../rescue/virt-rescue.pod:185
23255 msgid "B<--network>"
23259 #: ../rescue/virt-rescue.pod:187
23260 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
23264 #: ../rescue/virt-rescue.pod:193
23265 msgid "Open the image read-only."
23269 #: ../rescue/virt-rescue.pod:203
23271 "Enable SELinux in the rescue appliance. You should read "
23272 "L<guestfs(3)/SELINUX> before using this option."
23276 #: ../rescue/virt-rescue.pod:206
23281 #: ../rescue/virt-rescue.pod:208
23282 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
23286 #: ../rescue/virt-rescue.pod:210
23287 msgid "B<--suggest>"
23291 #: ../rescue/virt-rescue.pod:212
23293 "Inspect the disk image and suggest what mount commands should be used to "
23294 "mount the disks. You should use the I<--suggest> option in a second "
23295 "terminal, then paste the commands into another virt-rescue."
23299 #: ../rescue/virt-rescue.pod:216
23301 "This option implies I<--ro> and is safe to use even if the guest is up or if "
23302 "another virt-rescue is running."
23306 #: ../rescue/virt-rescue.pod:235
23308 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
23309 "are done read-write."
23313 #: ../rescue/virt-rescue.pod:248
23314 msgid "Previous versions of virt-rescue allowed you to write either:"
23318 #: ../rescue/virt-rescue.pod:250
23321 " virt-rescue disk.img [disk.img ...]\n"
23326 #: ../rescue/virt-rescue.pod:254
23329 " virt-rescue guestname\n"
23334 #: ../rescue/virt-rescue.pod:262
23339 #: ../rescue/virt-rescue.pod:264
23341 "Adding the I<--network> option enables QEMU user networking in the rescue "
23342 "appliance. There are some differences between user networking and ordinary "
23347 #: ../rescue/virt-rescue.pod:270
23348 msgid "ping does not work"
23352 #: ../rescue/virt-rescue.pod:272
23354 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
23355 "send the ping packets, and because virt-rescue must be able to run as "
23356 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
23357 "command. The ping command will appear to resolve addresses but will not be "
23358 "able to send or receive any packets. This does not mean that the network is "
23363 #: ../rescue/virt-rescue.pod:279
23364 msgid "cannot receive connections"
23368 #: ../rescue/virt-rescue.pod:281
23369 msgid "QEMU user networking cannot receive incoming connections."
23373 #: ../rescue/virt-rescue.pod:283
23374 msgid "making TCP connections"
23378 #: ../rescue/virt-rescue.pod:285
23380 "The virt-rescue appliance needs to be small and so does not include many "
23381 "network tools. In particular there is no L<telnet(1)> command. You can "
23382 "make TCP connections from the shell using the magical "
23383 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
23387 #: ../rescue/virt-rescue.pod:290
23390 " exec 3<>/dev/tcp/redhat.com/80\n"
23391 " echo \"GET /\" >&3\n"
23397 #: ../rescue/virt-rescue.pod:294
23398 msgid "See L<bash(1)> for more details."
23402 #: ../rescue/virt-rescue.pod:300
23404 "Several environment variables affect virt-rescue. See "
23405 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
23409 #: ../rescue/virt-rescue.pod:327
23411 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
23412 "L<virt-filesystems(1)>, L<http://libguestfs.org/>."
23416 #: ../resize/virt-resize.pod:5
23417 msgid "virt-resize - Resize a virtual machine disk"
23421 #: ../resize/virt-resize.pod:9
23424 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
23425 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
23426 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
23431 #: ../resize/virt-resize.pod:15
23433 "Virt-resize is a tool which can resize a virtual machine disk, making it "
23434 "larger or smaller overall, and resizing or deleting any partitions contained "
23439 #: ../resize/virt-resize.pod:19
23441 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
23442 "not> be used on live virtual machines - for consistent results, shut the "
23443 "virtual machine down before resizing it."
23447 #: ../resize/virt-resize.pod:23
23449 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
23450 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
23454 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:597 ../sparsify/virt-sparsify.pod:221 ../src/guestfs.pod:484 ../src/guestfs.pod:1302 ../src/guestfs.pod:1441 ../src/guestfs.pod:2690
23459 #: ../resize/virt-resize.pod:33
23461 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
23462 "fill the extra 5GB of space."
23466 #: ../resize/virt-resize.pod:36
23469 " virt-filesystems --long -h --all -a olddisk\n"
23474 #: ../resize/virt-resize.pod:38
23477 " truncate -r olddisk newdisk\n"
23478 " truncate -s +5G newdisk\n"
23483 #: ../resize/virt-resize.pod:41
23486 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
23487 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
23492 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:604 ../sparsify/virt-sparsify.pod:228 ../src/guestfs.pod:490 ../src/guestfs.pod:1306 ../src/guestfs.pod:1445 ../src/guestfs.pod:2715
23497 #: ../resize/virt-resize.pod:46
23499 "As above, but make the /boot partition 200MB bigger, while giving the "
23500 "remaining space to /dev/sda2:"
23504 #: ../resize/virt-resize.pod:49
23507 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
23508 " olddisk newdisk\n"
23513 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:610 ../sparsify/virt-sparsify.pod:234 ../src/guestfs.pod:501 ../src/guestfs.pod:1451
23518 #: ../resize/virt-resize.pod:54
23520 "As in the first example, but expand a logical volume as the final step. "
23521 "This is what you would typically use for Linux guests that use LVM:"
23525 #: ../resize/virt-resize.pod:58
23528 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
23529 " olddisk newdisk\n"
23534 #: ../resize/virt-resize.pod:61
23539 #: ../resize/virt-resize.pod:63
23541 "As in the first example, but the output format will be qcow2 instead of a "
23546 #: ../resize/virt-resize.pod:66
23549 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
23550 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
23555 #: ../resize/virt-resize.pod:71
23556 msgid "DETAILED USAGE"
23560 #: ../resize/virt-resize.pod:73
23561 msgid "EXPANDING A VIRTUAL MACHINE DISK"
23565 #: ../resize/virt-resize.pod:77
23566 msgid "1. Shut down the virtual machine"
23570 #: ../resize/virt-resize.pod:79
23571 msgid "2. Locate input disk image"
23575 #: ../resize/virt-resize.pod:81
23577 "Locate the input disk image (ie. the file or device on the host containing "
23578 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
23579 "dumpxml> like this to find the disk image name:"
23583 #: ../resize/virt-resize.pod:85
23586 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
23587 " Found 1 nodes:\n"
23589 " <source dev=\"/dev/vg/lv_guest\" />\n"
23594 #: ../resize/virt-resize.pod:90
23595 msgid "3. Look at current sizing"
23599 #: ../resize/virt-resize.pod:92
23600 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
23604 #: ../resize/virt-resize.pod:95
23607 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
23608 " Name Type Size Parent\n"
23609 " /dev/sda1 partition 101M /dev/sda\n"
23610 " /dev/sda2 partition 7.9G /dev/sda\n"
23611 " /dev/sda device 8.0G -\n"
23616 #: ../resize/virt-resize.pod:101
23618 "(This example is a virtual machine with an 8 GB disk which we would like to "
23619 "expand up to 10 GB)."
23623 #: ../resize/virt-resize.pod:104
23624 msgid "4. Create output disk"
23628 #: ../resize/virt-resize.pod:106
23630 "Virt-resize cannot do in-place disk modifications. You have to have space "
23631 "to store the resized output disk."
23635 #: ../resize/virt-resize.pod:109
23636 msgid "To store the resized disk image in a file, create a file of a suitable size:"
23640 #: ../resize/virt-resize.pod:112
23643 " # rm -f outdisk\n"
23644 " # truncate -s 10G outdisk\n"
23649 #: ../resize/virt-resize.pod:115
23650 msgid "Or use L<lvcreate(1)> to create a logical volume:"
23654 #: ../resize/virt-resize.pod:117
23657 " # lvcreate -L 10G -n lv_name vg_name\n"
23662 #: ../resize/virt-resize.pod:119
23663 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
23667 #: ../resize/virt-resize.pod:121
23670 " # virsh pool-list\n"
23671 " # virsh vol-create-as poolname newvol 10G\n"
23676 #: ../resize/virt-resize.pod:124
23681 #: ../resize/virt-resize.pod:126
23683 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
23684 "file) and the output disk. The output disk is the one created in the "
23689 #: ../resize/virt-resize.pod:130
23692 " # virt-resize indisk outdisk\n"
23697 #: ../resize/virt-resize.pod:132
23699 "This command just copies disk image C<indisk> to disk image C<outdisk> "
23700 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
23701 "larger, then an extra, empty partition is created at the end of the disk "
23702 "covering the extra space. If C<outdisk> is smaller, then it will give an "
23707 #: ../resize/virt-resize.pod:138
23709 "More realistically you'd want to expand existing partitions in the disk "
23710 "image by passing extra options (for the full list see the L</OPTIONS> "
23715 #: ../resize/virt-resize.pod:142
23717 "L</--expand> is the most useful option. It expands the named partition "
23718 "within the disk to fill any extra space:"
23722 #: ../resize/virt-resize.pod:145
23725 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
23730 #: ../resize/virt-resize.pod:147
23732 "(In this case, an extra partition is I<not> created at the end of the disk, "
23733 "because there will be no unused space)."
23737 #: ../resize/virt-resize.pod:150
23739 "L</--resize> is the other commonly used option. The following would "
23740 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
23741 "rest of the available space:"
23745 #: ../resize/virt-resize.pod:154
23748 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
23749 " indisk outdisk\n"
23754 #: ../resize/virt-resize.pod:157
23756 "If the expanded partition in the image contains a filesystem or LVM PV, then "
23757 "if virt-resize knows how, it will resize the contents, the equivalent of "
23758 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
23759 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
23760 "filesystems, so you would have to online resize them after booting the "
23765 #: ../resize/virt-resize.pod:164
23766 msgid "Other options are covered below."
23770 #: ../resize/virt-resize.pod:166
23775 #: ../resize/virt-resize.pod:168
23776 msgid "Thoroughly test the new disk image I<before> discarding the old one."
23780 #: ../resize/virt-resize.pod:170
23781 msgid "If you are using libvirt, edit the XML to point at the new disk:"
23785 #: ../resize/virt-resize.pod:172
23788 " # virsh edit guestname\n"
23793 #: ../resize/virt-resize.pod:174
23795 "Change E<lt>source ...E<gt>, see "
23796 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
23800 #: ../resize/virt-resize.pod:177
23801 msgid "Then start up the domain with the new, resized disk:"
23805 #: ../resize/virt-resize.pod:179
23808 " # virsh start guestname\n"
23813 #: ../resize/virt-resize.pod:181
23815 "and check that it still works. See also the L</NOTES> section below for "
23816 "additional information."
23820 #: ../resize/virt-resize.pod:184
23821 msgid "7. Resize LVs etc inside the guest"
23825 #: ../resize/virt-resize.pod:186
23826 msgid "(This can also be done offline using L<guestfish(1)>)"
23830 #: ../resize/virt-resize.pod:188
23832 "Once the guest has booted you should see the new space available, at least "
23833 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
23834 "may need to resize LVs inside PVs, and also resize filesystem types that "
23835 "virt-resize does not know how to expand."
23839 #: ../resize/virt-resize.pod:195
23840 msgid "SHRINKING A VIRTUAL MACHINE DISK"
23844 #: ../resize/virt-resize.pod:197
23846 "Shrinking is somewhat more complex than expanding, and only an overview is "
23851 #: ../resize/virt-resize.pod:200
23853 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
23854 "filesystems). The user has to shrink content before passing the disk image "
23855 "to virt-resize, and virt-resize will check that the content has been shrunk "
23860 #: ../resize/virt-resize.pod:205
23861 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
23865 #: ../resize/virt-resize.pod:207
23867 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
23868 "steps 3 and 4 above to allocate a new disk image."
23872 #: ../resize/virt-resize.pod:210
23873 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
23877 #: ../resize/virt-resize.pod:213
23878 msgid "IGNORING OR DELETING PARTITIONS"
23882 #: ../resize/virt-resize.pod:215
23884 "virt-resize also gives a convenient way to ignore or delete partitions when "
23885 "copying from the input disk to the output disk. Ignoring a partition speeds "
23886 "up the copy where you don't care about the existing contents of a "
23887 "partition. Deleting a partition removes it completely, but note that it "
23888 "also renumbers any partitions after the one which is deleted, which can "
23889 "leave some guests unbootable."
23893 #: ../resize/virt-resize.pod:222
23894 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
23898 #: ../resize/virt-resize.pod:224
23900 "If the input disk is in qcow2 format, then you may prefer that the output is "
23901 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
23902 "the fly. The output format is simply determined by the format of the empty "
23903 "output container that you provide. Thus to create qcow2 output, use:"
23907 #: ../resize/virt-resize.pod:230
23910 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
23915 #: ../resize/virt-resize.pod:232
23916 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
23920 #: ../resize/virt-resize.pod:234
23921 msgid "Similarly, to get non-sparse raw output use:"
23925 #: ../resize/virt-resize.pod:236
23928 " fallocate -l size outdisk\n"
23933 #: ../resize/virt-resize.pod:238
23935 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
23936 "if=/dev/zero of=outdisk bs=1M count=..>)"
23940 #: ../resize/virt-resize.pod:241
23941 msgid "LOGICAL PARTITIONS"
23945 #: ../resize/virt-resize.pod:243
23947 "Logical partitions (a.k.a. C</dev/sda5+> on disks using DOS partition "
23948 "tables) cannot be resized."
23952 #: ../resize/virt-resize.pod:246
23954 "To understand what is going on, firstly one of the four partitions "
23955 "C</dev/sda1-4> will have MBR partition type C<05> or C<0f>. This is called "
23956 "the B<extended partition>. Use L<virt-filesystems(1)> to see the MBR "
23961 #: ../resize/virt-resize.pod:251
23962 msgid "Logical partitions live inside the extended partition."
23966 #: ../resize/virt-resize.pod:253
23968 "The extended partition can be expanded, but not shrunk (unless you force it, "
23969 "which is not advisable). When the extended partition is copied across, all "
23970 "the logical partitions contained inside are copied over implicitly. "
23971 "Virt-resize does not look inside the extended partition, so it copies the "
23972 "logical partitions blindly."
23976 #: ../resize/virt-resize.pod:259
23978 "You cannot specify a logical partition (C</dev/sda5+>) at all on the command "
23979 "line. Doing so will give an error."
23983 #: ../resize/virt-resize.pod:268 ../sparsify/virt-sparsify.pod:105
23984 msgid "Display help."
23988 #: ../resize/virt-resize.pod:270
23989 msgid "B<--align-first auto>"
23993 #: ../resize/virt-resize.pod:272
23994 msgid "B<--align-first never>"
23998 #: ../resize/virt-resize.pod:274
23999 msgid "B<--align-first always>"
24003 #: ../resize/virt-resize.pod:276
24005 "Align the first partition for improved performance (see also the "
24006 "I<--alignment> option)."
24010 #: ../resize/virt-resize.pod:279
24012 "The default is I<--align-first auto> which only aligns the first partition "
24013 "if it is safe to do so. That is, only when we know how to fix the "
24014 "bootloader automatically, and at the moment that can only be done for "
24019 #: ../resize/virt-resize.pod:284
24021 "I<--align-first never> means we never move the first partition. This is the "
24022 "safest option. Try this if the guest does not boot after resizing."
24026 #: ../resize/virt-resize.pod:288
24028 "I<--align-first always> means we always align the first partition (if it "
24029 "needs to be aligned). For some guests this will break the bootloader, "
24030 "making the guest unbootable."
24034 #: ../resize/virt-resize.pod:292
24035 msgid "B<--alignment N>"
24039 #: ../resize/virt-resize.pod:294
24041 "Set the alignment of partitions to C<N> sectors. The default in virt-resize "
24042 "E<lt> 1.13.19 was 64 sectors, and after that is 128 sectors."
24046 #: ../resize/virt-resize.pod:298
24048 "Assuming 512 byte sector size inside the guest, here are some suitable "
24053 #: ../resize/virt-resize.pod:303
24054 msgid "I<--alignment 1> (512 bytes)"
24058 #: ../resize/virt-resize.pod:305
24060 "The partitions would be packed together as closely as possible, but would be "
24061 "completely unaligned. In some cases this can cause very poor performance. "
24062 "See L<virt-alignment-scan(1)> for further details."
24066 #: ../resize/virt-resize.pod:309
24067 msgid "I<--alignment 8> (4K)"
24071 #: ../resize/virt-resize.pod:311
24073 "This would be the minimum acceptable alignment for reasonable performance on "
24078 #: ../resize/virt-resize.pod:314
24079 msgid "I<--alignment 128> (64K)"
24083 #: ../resize/virt-resize.pod:316
24085 "This alignment provides good performance when the host is using high end "
24090 #: ../resize/virt-resize.pod:319
24091 msgid "I<--alignment 2048> (1M)"
24095 #: ../resize/virt-resize.pod:321
24097 "This is the standard alignment used by all newly installed guests since "
24102 #: ../resize/virt-resize.pod:326
24107 #: ../resize/virt-resize.pod:328 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
24112 #: ../resize/virt-resize.pod:330 ../tools/virt-win-reg.pl:122
24113 msgid "Enable debugging messages."
24117 #: ../resize/virt-resize.pod:332
24118 msgid "B<--delete part>"
24122 #: ../resize/virt-resize.pod:334
24124 "Delete the named partition. It would be more accurate to describe this as "
24125 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
24126 "the original disk image is left intact."
24130 #: ../resize/virt-resize.pod:338
24132 "Note that when you delete a partition, then anything contained in the "
24133 "partition is also deleted. Furthermore, this causes any partitions that "
24134 "come after to be I<renumbered>, which can easily make your guest unbootable."
24138 #: ../resize/virt-resize.pod:343 ../resize/virt-resize.pod:404 ../resize/virt-resize.pod:531 ../sparsify/virt-sparsify.pod:151
24139 msgid "You can give this option multiple times."
24143 #: ../resize/virt-resize.pod:345
24144 msgid "B<--expand part>"
24148 #: ../resize/virt-resize.pod:347
24150 "Expand the named partition so it uses up all extra space (space left over "
24151 "after any other resize changes that you request have been done)."
24155 #: ../resize/virt-resize.pod:350
24157 "If virt-resize knows how, it will expand the direct content of the "
24158 "partition. For example, if the partition is an LVM PV, it will expand the "
24159 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
24160 "content it doesn't know about alone."
24164 #: ../resize/virt-resize.pod:355
24165 msgid "Currently virt-resize can resize:"
24169 #: ../resize/virt-resize.pod:361
24170 msgid "ext2, ext3 and ext4 filesystems."
24174 #: ../resize/virt-resize.pod:365
24175 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
24179 #: ../resize/virt-resize.pod:367
24181 "The filesystem must have been shut down consistently last time it was used. "
24182 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
24183 "consistency check, so at the first boot after resizing Windows will check "
24188 #: ../resize/virt-resize.pod:374
24190 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
24191 "inside the PV, but see the I<--LV-expand> option. The user could also "
24192 "resize LVs as desired after boot."
24196 #: ../resize/virt-resize.pod:380
24197 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
24201 #: ../resize/virt-resize.pod:384 ../resize/virt-resize.pod:559
24202 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
24206 #: ../resize/virt-resize.pod:386 ../sparsify/virt-sparsify.pod:131 ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92 ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
24207 msgid "B<--format> raw"
24211 #: ../resize/virt-resize.pod:388 ../sparsify/virt-sparsify.pod:135
24213 "Specify the format of the input disk image. If this flag is not given then "
24214 "it is auto-detected from the image itself."
24218 #: ../resize/virt-resize.pod:394
24220 "Note that this option I<does not> affect the output format. See L</QCOW2 "
24221 "AND NON-SPARSE RAW FORMATS>."
24225 #: ../resize/virt-resize.pod:397
24226 msgid "B<--ignore part>"
24230 #: ../resize/virt-resize.pod:399
24232 "Ignore the named partition. Effectively this means the partition is "
24233 "allocated on the destination disk, but the content is not copied across from "
24234 "the source disk. The content of the partition will be blank (all zero "
24239 #: ../resize/virt-resize.pod:406
24240 msgid "B<--LV-expand logvol>"
24244 #: ../resize/virt-resize.pod:408
24246 "This takes the logical volume and, as a final step, expands it to fill all "
24247 "the space available in its volume group. A typical usage, assuming a Linux "
24248 "guest with a single PV C</dev/sda2> and a root device called "
24249 "C</dev/vg_guest/lv_root> would be:"
24253 #: ../resize/virt-resize.pod:413
24256 " virt-resize indisk outdisk \\\n"
24257 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
24262 #: ../resize/virt-resize.pod:416
24264 "This would first expand the partition (and PV), and then expand the root "
24265 "device to fill the extra space in the PV."
24269 #: ../resize/virt-resize.pod:419
24271 "The contents of the LV are also resized if virt-resize knows how to do "
24272 "that. You can stop virt-resize from trying to expand the content by using "
24273 "the option I<--no-expand-content>."
24277 #: ../resize/virt-resize.pod:423
24278 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
24282 #: ../resize/virt-resize.pod:425
24284 "You can give this option multiple times, I<but> it doesn't make sense to do "
24285 "this unless the logical volumes you specify are all in different volume "
24290 #: ../resize/virt-resize.pod:429 ../sparsify/virt-sparsify.pod:153
24291 msgid "B<--machine-readable>"
24295 #: ../resize/virt-resize.pod:431 ../sparsify/virt-sparsify.pod:155
24297 "This option is used to make the output more machine friendly when being "
24298 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
24302 #: ../resize/virt-resize.pod:437
24303 msgid "B<--dryrun>"
24307 #: ../resize/virt-resize.pod:439
24308 msgid "Print a summary of what would be done, but don't do anything."
24312 #: ../resize/virt-resize.pod:441
24313 msgid "B<--no-copy-boot-loader>"
24317 #: ../resize/virt-resize.pod:443
24319 "By default, virt-resize copies over some sectors at the start of the disk "
24320 "(up to the beginning of the first partition). Commonly these sectors "
24321 "contain the Master Boot Record (MBR) and the boot loader, and are required "
24322 "in order for the guest to boot correctly."
24326 #: ../resize/virt-resize.pod:448
24328 "If you specify this flag, then this initial copy is not done. You may need "
24329 "to reinstall the boot loader in this case."
24333 #: ../resize/virt-resize.pod:451
24334 msgid "B<--no-extra-partition>"
24338 #: ../resize/virt-resize.pod:453
24340 "By default, virt-resize creates an extra partition if there is any extra, "
24341 "unused space after all resizing has happened. Use this option to prevent "
24342 "the extra partition from being created. If you do this then the extra space "
24343 "will be inaccessible until you run fdisk, parted, or some other partitioning "
24344 "tool in the guest."
24348 #: ../resize/virt-resize.pod:459
24350 "Note that if the surplus space is smaller than 10 MB, no extra partition "
24355 #: ../resize/virt-resize.pod:462
24356 msgid "B<--no-expand-content>"
24360 #: ../resize/virt-resize.pod:464
24362 "By default, virt-resize will try to expand the direct contents of "
24363 "partitions, if it knows how (see I<--expand> option above)."
24367 #: ../resize/virt-resize.pod:467
24369 "If you give the I<--no-expand-content> option then virt-resize will not "
24374 #: ../resize/virt-resize.pod:470
24375 msgid "B<--ntfsresize-force>"
24379 #: ../resize/virt-resize.pod:472
24381 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
24382 "the NTFS disk is marked as needing a consistency check. You have to use "
24383 "this option if you want to resize a Windows guest multiple times without "
24384 "booting into Windows between each resize."
24388 #: ../resize/virt-resize.pod:478
24389 msgid "B<--output-format> raw"
24393 #: ../resize/virt-resize.pod:480
24395 "Specify the format of the output disk image. If this flag is not given then "
24396 "it is auto-detected from the image itself."
24400 #: ../resize/virt-resize.pod:486
24402 "Note that this option I<does not create> the output format. This option "
24403 "just tells libguestfs what it is so it doesn't try to guess it. You still "
24404 "need to create the output disk with the right format. See L</QCOW2 AND "
24405 "NON-SPARSE RAW FORMATS>."
24409 #: ../resize/virt-resize.pod:495
24410 msgid "Don't print the summary."
24414 #: ../resize/virt-resize.pod:497
24415 msgid "B<--resize part=size>"
24419 #: ../resize/virt-resize.pod:499
24421 "Resize the named partition (expanding or shrinking it) so that it has the "
24426 #: ../resize/virt-resize.pod:502
24428 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
24429 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
24430 "size; or as a relative number or percentage. For example:"
24434 #: ../resize/virt-resize.pod:508
24437 " --resize /dev/sda2=10G\n"
24442 #: ../resize/virt-resize.pod:510
24445 " --resize /dev/sda4=90%\n"
24450 #: ../resize/virt-resize.pod:512
24453 " --resize /dev/sda2=+1G\n"
24458 #: ../resize/virt-resize.pod:514
24461 " --resize /dev/sda2=-200M\n"
24466 #: ../resize/virt-resize.pod:516
24469 " --resize /dev/sda1=+128K\n"
24474 #: ../resize/virt-resize.pod:518
24477 " --resize /dev/sda1=+10%\n"
24482 #: ../resize/virt-resize.pod:520
24485 " --resize /dev/sda1=-10%\n"
24490 #: ../resize/virt-resize.pod:522
24492 "You can increase the size of any partition. Virt-resize will expand the "
24493 "direct content of the partition if it knows how (see I<--expand> below)."
24497 #: ../resize/virt-resize.pod:526
24499 "You can only I<decrease> the size of partitions that contain filesystems or "
24500 "PVs which have already been shrunk. Virt-resize will check this has been "
24501 "done before proceeding, or else will print an error (see also "
24502 "I<--resize-force>)."
24506 #: ../resize/virt-resize.pod:533
24507 msgid "B<--resize-force part=size>"
24511 #: ../resize/virt-resize.pod:535
24513 "This is the same as I<--resize> except that it will let you decrease the "
24514 "size of any partition. Generally this means you will lose any data which "
24515 "was at the end of the partition you shrink, but you may not care about that "
24516 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
24517 "as a swap partition)."
24521 #: ../resize/virt-resize.pod:541
24522 msgid "See also the I<--ignore> option."
24526 #: ../resize/virt-resize.pod:543
24527 msgid "B<--shrink part>"
24531 #: ../resize/virt-resize.pod:545
24533 "Shrink the named partition until the overall disk image fits in the "
24534 "destination. The named partition B<must> contain a filesystem or PV which "
24535 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
24536 "online tools). Virt-resize will check this and give an error if it has not "
24541 #: ../resize/virt-resize.pod:551
24543 "The amount by which the overall disk must be shrunk (after carrying out all "
24544 "other operations requested by the user) is called the \"deficit\". For "
24545 "example, a straight copy (assume no other operations) from a 5GB disk image "
24546 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
24547 "would give an error unless the user specified a partition to shrink and that "
24548 "partition had more than a gigabyte of free space."
24552 #: ../resize/virt-resize.pod:569 ../sparsify/virt-sparsify.pod:195
24553 msgid "MACHINE READABLE OUTPUT"
24557 #: ../resize/virt-resize.pod:571
24559 "The I<--machine-readable> option can be used to make the output more machine "
24560 "friendly, which is useful when calling virt-resize from other programs, GUIs "
24565 #: ../resize/virt-resize.pod:575 ../sparsify/virt-sparsify.pod:201
24566 msgid "There are two ways to use this option."
24570 #: ../resize/virt-resize.pod:577
24572 "Firstly use the option on its own to query the capabilities of the "
24573 "virt-resize binary. Typical output looks like this:"
24577 #: ../resize/virt-resize.pod:580
24580 " $ virt-resize --machine-readable\n"
24582 " ntfsresize-force\n"
24590 #: ../resize/virt-resize.pod:587 ../sparsify/virt-sparsify.pod:211
24592 "A list of features is printed, one per line, and the program exits with "
24597 #: ../resize/virt-resize.pod:590 ../sparsify/virt-sparsify.pod:214
24599 "Secondly use the option in conjunction with other options to make the "
24600 "regular program output more machine friendly."
24604 #: ../resize/virt-resize.pod:593 ../sparsify/virt-sparsify.pod:217
24605 msgid "At the moment this means:"
24609 #: ../resize/virt-resize.pod:599 ../sparsify/virt-sparsify.pod:223
24611 "Progress bar messages can be parsed from stdout by looking for this regular "
24616 #: ../resize/virt-resize.pod:602 ../sparsify/virt-sparsify.pod:226
24619 " ^[0-9]+/[0-9]+$\n"
24624 #: ../resize/virt-resize.pod:606 ../sparsify/virt-sparsify.pod:230
24626 "The calling program should treat messages sent to stdout (except for "
24627 "progress bar messages) as status messages. They can be logged and/or "
24628 "displayed to the user."
24632 #: ../resize/virt-resize.pod:612
24634 "The calling program should treat messages sent to stderr as error messages. "
24635 "In addition, virt-resize exits with a non-zero status code if there was a "
24640 #: ../resize/virt-resize.pod:618
24642 "Versions of the program prior to 1.13.9 did not support the "
24643 "I<--machine-readable> option and will return an error."
24647 #: ../resize/virt-resize.pod:623
24648 msgid "\"Partition 1 does not end on cylinder boundary.\""
24652 #: ../resize/virt-resize.pod:625
24654 "Virt-resize aligns partitions to multiples of 128 sectors (see the "
24655 "I<--alignment> parameter). Usually this means the partitions will not be "
24656 "aligned to the ancient CHS geometry. However CHS geometry is meaningless "
24657 "for disks manufactured since the early 1990s, and doubly so for virtual hard "
24658 "drives. Alignment of partitions to cylinders is not required by any modern "
24659 "operating system."
24663 #: ../resize/virt-resize.pod:632
24664 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
24668 #: ../resize/virt-resize.pod:634
24670 "In Windows Vista and later versions, Microsoft switched to using a separate "
24671 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
24672 "and C</dev/sda2> is the main (C:) drive. Resizing the first (boot) "
24673 "partition causes the bootloader to fail with C<0xC0000225> error. Resizing "
24674 "the second partition (ie. C: drive) should work."
24678 #: ../resize/virt-resize.pod:641
24680 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
24681 "NTFS partitions have been expanded. This is just a safety check and (unless "
24682 "it find errors) is nothing to worry about."
24686 #: ../resize/virt-resize.pod:645
24687 msgid "GUEST BOOT STUCK AT \"GRUB\""
24691 #: ../resize/virt-resize.pod:647
24693 "If a Linux guest does not boot after resizing, and the boot is stuck after "
24694 "printing C<GRUB> on the console, try reinstalling grub."
24698 #: ../resize/virt-resize.pod:650
24701 " guestfish -i -a newdisk\n"
24702 " ><fs> cat /boot/grub/device.map\n"
24703 " # check the contents of this file are sensible or\n"
24704 " # edit the file if necessary\n"
24705 " ><fs> grub-install / /dev/vda\n"
24711 #: ../resize/virt-resize.pod:657
24713 "For more flexible guest reconfiguration, including if you need to specify "
24714 "other parameters to grub-install, use L<virt-rescue(1)>."
24718 #: ../resize/virt-resize.pod:660
24719 msgid "ALTERNATIVE TOOLS"
24723 #: ../resize/virt-resize.pod:662
24725 "There are several proprietary tools for resizing partitions. We won't "
24726 "mention any here."
24730 #: ../resize/virt-resize.pod:665
24732 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
24733 "operations on disk images. They can resize and move partitions, but I don't "
24734 "think they can do anything with the contents, and they certainly don't "
24739 #: ../resize/virt-resize.pod:670
24741 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
24742 "but at a much lower level. You will probably end up hand-calculating sector "
24743 "offsets, which is something that virt-resize was designed to avoid. If you "
24744 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
24749 #: ../resize/virt-resize.pod:690
24751 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
24752 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
24753 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
24754 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
24755 "L<virt-sparsify(1)>, L<virt-alignment-scan(1)>, L<http://libguestfs.org/>."
24759 #: ../ruby/examples/guestfs-ruby.pod:5
24760 msgid "guestfs-ruby - How to use libguestfs from Ruby"
24764 #: ../ruby/examples/guestfs-ruby.pod:9
24767 " require 'guestfs'\n"
24768 " g = Guestfs::Guestfs.new()\n"
24769 " g.add_drive_opts(\"disk.img\",\n"
24770 " :readonly => 1, :format => \"raw\")\n"
24776 #: ../ruby/examples/guestfs-ruby.pod:17
24778 "This manual page documents how to call libguestfs from the Ruby programming "
24779 "language. This page just documents the differences from the C API and gives "
24780 "some examples. If you are not familiar with using libguestfs, you also need "
24781 "to read L<guestfs(3)>."
24785 #: ../ruby/examples/guestfs-ruby.pod:24
24787 "Errors from libguestfs functions are mapped into the C<Error> exception. "
24788 "This has a single parameter which is the error message (a string)."
24792 #: ../ruby/examples/guestfs-ruby.pod:38
24794 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
24795 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
24796 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
24800 #: ../sparsify/virt-sparsify.pod:5
24801 msgid "virt-sparsify - Make a virtual machine disk sparse"
24805 #: ../sparsify/virt-sparsify.pod:9
24808 " virt-sparsify [--options] indisk outdisk\n"
24813 #: ../sparsify/virt-sparsify.pod:13
24815 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
24816 "image) sparse a.k.a. thin-provisioned. This means that free space within "
24817 "the disk image can be converted back to free space on the host."
24821 #: ../sparsify/virt-sparsify.pod:18
24823 "Virt-sparsify can locate and sparsify free space in most filesystems "
24824 "(eg. ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
24828 #: ../sparsify/virt-sparsify.pod:21
24830 "Virt-sparsify can also convert between some disk formats, for example "
24831 "converting a raw disk image to a thin-provisioned qcow2 image."
24835 #: ../sparsify/virt-sparsify.pod:24
24837 "Virt-sparsify can operate on any disk image, not just ones from virtual "
24838 "machines. If a virtual machine has more than one attached disk, you must "
24839 "sparsify each one separately."
24843 #: ../sparsify/virt-sparsify.pod:28
24844 msgid "IMPORTANT LIMITATIONS"
24848 #: ../sparsify/virt-sparsify.pod:34
24850 "Virt-sparsify does not do in-place modifications. It copies from a source "
24851 "image to a destination image, leaving the source unchanged. I<Check that "
24852 "the sparsification was successful before deleting the source image>."
24856 #: ../sparsify/virt-sparsify.pod:41
24857 msgid "The virtual machine I<must be shut down> before using this tool."
24861 #: ../sparsify/virt-sparsify.pod:45
24863 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
24864 "(1 temporary copy + 1 destination image). This is in the worst case and "
24865 "usually much less space is required."
24869 #: ../sparsify/virt-sparsify.pod:51
24870 msgid "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
24874 #: ../sparsify/virt-sparsify.pod:56
24875 msgid "Virt-sparsify cannot handle encrypted disks."
24879 #: ../sparsify/virt-sparsify.pod:60
24881 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
24882 "this space is often used for critical items like bootloaders so it's not "
24887 #: ../sparsify/virt-sparsify.pod:66
24889 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
24890 "to do this unless we can be sure there is no hibernation data, so at the "
24891 "moment swap partitions are ignored."
24895 #: ../sparsify/virt-sparsify.pod:72
24897 "You may also want to read the manual pages for the associated tools "
24898 "L<virt-filesystems(1)> and L<virt-df(1)> before starting."
24902 #: ../sparsify/virt-sparsify.pod:77
24903 msgid "Typical usage is:"
24907 #: ../sparsify/virt-sparsify.pod:79
24910 " virt-sparsify indisk outdisk\n"
24915 #: ../sparsify/virt-sparsify.pod:81
24917 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
24918 "is created, or overwritten if it already exists. The format of the input "
24919 "disk is detected (eg. qcow2) and the same format is used for the output "
24924 #: ../sparsify/virt-sparsify.pod:86
24925 msgid "To convert between formats, use the I<--convert> option:"
24929 #: ../sparsify/virt-sparsify.pod:88
24932 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
24937 #: ../sparsify/virt-sparsify.pod:90
24939 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
24940 "can find within the source disk image. You can get it to ignore (don't zero "
24941 "free space on) certain filesystems by doing:"
24945 #: ../sparsify/virt-sparsify.pod:94
24948 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
24953 #: ../sparsify/virt-sparsify.pod:96
24954 msgid "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
24958 #: ../sparsify/virt-sparsify.pod:107
24959 msgid "B<--compress>"
24963 #: ../sparsify/virt-sparsify.pod:109
24965 "Compress the output file. This I<only> works if the output format is "
24970 #: ../sparsify/virt-sparsify.pod:112
24971 msgid "B<--convert> raw"
24975 #: ../sparsify/virt-sparsify.pod:114
24976 msgid "B<--convert> qcow2"
24980 #: ../sparsify/virt-sparsify.pod:116
24981 msgid "B<--convert> [other formats]"
24985 #: ../sparsify/virt-sparsify.pod:118
24987 "Use C<output-format> as the format for the destination image. If this is "
24988 "not specified, then the input format is used."
24992 #: ../sparsify/virt-sparsify.pod:121
24993 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>, C<vdi>."
24997 #: ../sparsify/virt-sparsify.pod:123
24999 "You can also use any format supported by the L<qemu-img(1)> program, "
25000 "eg. C<vmdk>, but support for other formats is reliant on qemu."
25004 #: ../sparsify/virt-sparsify.pod:126
25006 "Specifying the I<--convert> option is usually a good idea, because then "
25007 "virt-sparsify doesn't need to try to guess the input format."
25011 #: ../sparsify/virt-sparsify.pod:129
25012 msgid "For fine-tuning the output format, see: I<--compress>, I<-o>."
25016 #: ../sparsify/virt-sparsify.pod:133
25017 msgid "B<--format> qcow2"
25021 #: ../sparsify/virt-sparsify.pod:141
25022 msgid "B<--ignore> filesystem"
25026 #: ../sparsify/virt-sparsify.pod:143
25027 msgid "B<--ignore> volgroup"
25031 #: ../sparsify/virt-sparsify.pod:145
25033 "Ignore the named filesystem. Free space on the filesystem will not be "
25034 "zeroed, but existing blocks of zeroes will still be sparsified."
25038 #: ../sparsify/virt-sparsify.pod:148
25040 "In the second form, this ignores the named volume group. Use the volume "
25041 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
25045 #: ../sparsify/virt-sparsify.pod:159
25046 msgid "B<-o> option[,option,...]"
25050 #: ../sparsify/virt-sparsify.pod:161
25052 "Pass I<-o> option(s) to the L<qemu-img(1)> command to fine-tune the output "
25053 "format. Options available depend on the output format (see I<--convert>) "
25054 "and the installed version of the qemu-img program."
25058 #: ../sparsify/virt-sparsify.pod:165
25060 "You should use I<-o> at most once. To pass multiple options, separate them "
25065 #: ../sparsify/virt-sparsify.pod:168
25068 " virt-sparsify --convert qcow2 \\\n"
25069 " -o cluster_size=512,preallocation=metadata ...\n"
25074 #: ../sparsify/virt-sparsify.pod:175
25075 msgid "This disables progress bars and other unnecessary output."
25079 #: ../sparsify/virt-sparsify.pod:197
25081 "The I<--machine-readable> option can be used to make the output more machine "
25082 "friendly, which is useful when calling virt-sparsify from other programs, "
25087 #: ../sparsify/virt-sparsify.pod:203
25089 "Firstly use the option on its own to query the capabilities of the "
25090 "virt-sparsify binary. Typical output looks like this:"
25094 #: ../sparsify/virt-sparsify.pod:206
25097 " $ virt-sparsify --machine-readable\n"
25105 #: ../sparsify/virt-sparsify.pod:236
25107 "The calling program should treat messages sent to stderr as error messages. "
25108 "In addition, virt-sparsify exits with a non-zero status code if there was a "
25113 #: ../sparsify/virt-sparsify.pod:242
25115 "All versions of virt-sparsify have supported the I<--machine-readable> "
25120 #: ../sparsify/virt-sparsify.pod:256
25122 "Location of the temporary directory used for the potentially large temporary "
25127 #: ../sparsify/virt-sparsify.pod:259
25129 "You should ensure there is enough free space in the worst case for a full "
25130 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
25131 "to another directory that has enough space."
25135 #: ../sparsify/virt-sparsify.pod:263
25136 msgid "This defaults to C</tmp>."
25140 #: ../sparsify/virt-sparsify.pod:267
25141 msgid "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
25145 #: ../sparsify/virt-sparsify.pod:271
25147 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
25148 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, "
25149 "L<qemu-img(1)>, L<http://libguestfs.org/>."
25153 #: ../src/guestfs-actions.pod:1
25154 msgid "guestfs_add_cdrom"
25158 #: ../src/guestfs-actions.pod:3
25162 " guestfs_add_cdrom (guestfs_h *g,\n"
25163 " const char *filename);\n"
25168 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:302 ../src/guestfs-actions.pod:323
25170 "I<This function is deprecated.> In new code, use the "
25171 "L</guestfs_add_drive_opts> call instead."
25175 #: ../src/guestfs-actions.pod:24
25177 "This call checks for the existence of C<filename>. This stops you from "
25178 "specifying other types of drive which are supported by qemu such as C<nbd:> "
25179 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
25184 #: ../src/guestfs-actions.pod:31
25186 "If you just want to add an ISO file (often you use this as an efficient way "
25187 "to transfer large files into the guest), then you should probably use "
25188 "C<guestfs_add_drive_ro> instead."
25192 #: ../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:4330 ../src/guestfs-actions.pod:4344 ../src/guestfs-actions.pod:4357 ../src/guestfs-actions.pod:4371 ../src/guestfs-actions.pod:4386 ../src/guestfs-actions.pod:4422 ../src/guestfs-actions.pod:4494 ../src/guestfs-actions.pod:4514 ../src/guestfs-actions.pod:4531 ../src/guestfs-actions.pod:4551 ../src/guestfs-actions.pod:4571 ../src/guestfs-actions.pod:4606 ../src/guestfs-actions.pod:4625 ../src/guestfs-actions.pod:4644 ../src/guestfs-actions.pod:4679 ../src/guestfs-actions.pod:4691 ../src/guestfs-actions.pod:4724 ../src/guestfs-actions.pod:4740 ../src/guestfs-actions.pod:4753 ../src/guestfs-actions.pod:4768 ../src/guestfs-actions.pod:4785 ../src/guestfs-actions.pod:4943 ../src/guestfs-actions.pod:5027 ../src/guestfs-actions.pod:5037 ../src/guestfs-actions.pod:5057 ../src/guestfs-actions.pod:5070 ../src/guestfs-actions.pod:5121 ../src/guestfs-actions.pod:5139 ../src/guestfs-actions.pod:5157 ../src/guestfs-actions.pod:5173 ../src/guestfs-actions.pod:5187 ../src/guestfs-actions.pod:5201 ../src/guestfs-actions.pod:5218 ../src/guestfs-actions.pod:5233 ../src/guestfs-actions.pod:5260 ../src/guestfs-actions.pod:5323 ../src/guestfs-actions.pod:5396 ../src/guestfs-actions.pod:5427 ../src/guestfs-actions.pod:5446 ../src/guestfs-actions.pod:5465 ../src/guestfs-actions.pod:5477 ../src/guestfs-actions.pod:5494 ../src/guestfs-actions.pod:5507 ../src/guestfs-actions.pod:5522 ../src/guestfs-actions.pod:5537 ../src/guestfs-actions.pod:5569 ../src/guestfs-actions.pod:5595 ../src/guestfs-actions.pod:5634 ../src/guestfs-actions.pod:5654 ../src/guestfs-actions.pod:5668 ../src/guestfs-actions.pod:5685 ../src/guestfs-actions.pod:5734 ../src/guestfs-actions.pod:5787 ../src/guestfs-actions.pod:5834 ../src/guestfs-actions.pod:5877 ../src/guestfs-actions.pod:5905 ../src/guestfs-actions.pod:5922 ../src/guestfs-actions.pod:5940 ../src/guestfs-actions.pod:6077 ../src/guestfs-actions.pod:6134 ../src/guestfs-actions.pod:6156 ../src/guestfs-actions.pod:6174 ../src/guestfs-actions.pod:6226 ../src/guestfs-actions.pod:6292 ../src/guestfs-actions.pod:6309 ../src/guestfs-actions.pod:6322 ../src/guestfs-actions.pod:6336 ../src/guestfs-actions.pod:6625 ../src/guestfs-actions.pod:6644 ../src/guestfs-actions.pod:6663 ../src/guestfs-actions.pod:6677 ../src/guestfs-actions.pod:6689 ../src/guestfs-actions.pod:6703 ../src/guestfs-actions.pod:6715 ../src/guestfs-actions.pod:6729 ../src/guestfs-actions.pod:6745 ../src/guestfs-actions.pod:6763 ../src/guestfs-actions.pod:6782 ../src/guestfs-actions.pod:6801 ../src/guestfs-actions.pod:6831 ../src/guestfs-actions.pod:6849 ../src/guestfs-actions.pod:6872 ../src/guestfs-actions.pod:6890 ../src/guestfs-actions.pod:6909 ../src/guestfs-actions.pod:6930 ../src/guestfs-actions.pod:6949 ../src/guestfs-actions.pod:6966 ../src/guestfs-actions.pod:6985 ../src/guestfs-actions.pod:7013 ../src/guestfs-actions.pod:7037 ../src/guestfs-actions.pod:7056 ../src/guestfs-actions.pod:7072 ../src/guestfs-actions.pod:7096 ../src/guestfs-actions.pod:7115 ../src/guestfs-actions.pod:7130 ../src/guestfs-actions.pod:7149 ../src/guestfs-actions.pod:7193 ../src/guestfs-actions.pod:7220 ../src/guestfs-actions.pod:7250 ../src/guestfs-actions.pod:7362 ../src/guestfs-actions.pod:7483 ../src/guestfs-actions.pod:7495 ../src/guestfs-actions.pod:7508 ../src/guestfs-actions.pod:7521 ../src/guestfs-actions.pod:7543 ../src/guestfs-actions.pod:7556 ../src/guestfs-actions.pod:7569 ../src/guestfs-actions.pod:7582 ../src/guestfs-actions.pod:7597 ../src/guestfs-actions.pod:7656 ../src/guestfs-actions.pod:7673 ../src/guestfs-actions.pod:7689 ../src/guestfs-actions.pod:7705 ../src/guestfs-actions.pod:7722 ../src/guestfs-actions.pod:7735 ../src/guestfs-actions.pod:7755 ../src/guestfs-actions.pod:7855 ../src/guestfs-actions.pod:7913 ../src/guestfs-actions.pod:7927 ../src/guestfs-actions.pod:7968 ../src/guestfs-actions.pod:7981 ../src/guestfs-actions.pod:7999 ../src/guestfs-actions.pod:8033 ../src/guestfs-actions.pod:8069 ../src/guestfs-actions.pod:8185 ../src/guestfs-actions.pod:8200 ../src/guestfs-actions.pod:8214 ../src/guestfs-actions.pod:8269 ../src/guestfs-actions.pod:8282 ../src/guestfs-actions.pod:8327 ../src/guestfs-actions.pod:8367 ../src/guestfs-actions.pod:8423 ../src/guestfs-actions.pod:8443 ../src/guestfs-actions.pod:8476 ../src/guestfs-actions.pod:8540 ../src/guestfs-actions.pod:8563 ../src/guestfs-actions.pod:8589
25193 msgid "This function returns 0 on success or -1 on error."
25197 #: ../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:5571 ../src/guestfs-actions.pod:6851 ../src/guestfs-actions.pod:6968 ../src/guestfs-actions.pod:7117 ../src/guestfs-actions.pod:7599 ../src/guestfs-actions.pod:7724 ../src/guestfs-actions.pod:8369
25198 msgid "(Added in 0.3)"
25202 #: ../src/guestfs-actions.pod:41
25203 msgid "guestfs_add_domain"
25207 #: ../src/guestfs-actions.pod:43
25211 " guestfs_add_domain (guestfs_h *g,\n"
25212 " const char *dom,\n"
25218 #: ../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:4878 ../src/guestfs-actions.pod:5272 ../src/guestfs-actions.pod:5581 ../src/guestfs-actions.pod:5798 ../src/guestfs-actions.pod:7766
25220 "You may supply a list of optional arguments to this call. Use zero or more "
25221 "of the following pairs of parameters, and terminate the list with C<-1> on "
25222 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
25226 #: ../src/guestfs-actions.pod:53
25229 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
25230 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
25231 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
25232 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
25233 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
25234 " GUESTFS_ADD_DOMAIN_READONLYDISK, const char *readonlydisk,\n"
25239 #: ../src/guestfs-actions.pod:60
25241 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
25242 "It works by connecting to libvirt, requesting the domain and domain XML from "
25243 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
25248 #: ../src/guestfs-actions.pod:141
25250 "The other optional parameters are passed directly through to "
25251 "C<guestfs_add_drive_opts>."
25255 #: ../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:5757 ../src/guestfs-actions.pod:5974 ../src/guestfs-actions.pod:6212 ../src/guestfs-actions.pod:6406 ../src/guestfs-actions.pod:6432 ../src/guestfs-actions.pod:7954 ../src/guestfs-actions.pod:8380 ../src/guestfs-actions.pod:8393 ../src/guestfs-actions.pod:8406
25256 msgid "On error this function returns -1."
25260 #: ../src/guestfs-actions.pod:146
25261 msgid "(Added in 1.7.4)"
25265 #: ../src/guestfs-actions.pod:148
25266 msgid "guestfs_add_domain_va"
25270 #: ../src/guestfs-actions.pod:150
25274 " guestfs_add_domain_va (guestfs_h *g,\n"
25275 " const char *dom,\n"
25276 " va_list args);\n"
25281 #: ../src/guestfs-actions.pod:155
25282 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
25286 #: ../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:4955 ../src/guestfs-actions.pod:4967 ../src/guestfs-actions.pod:5337 ../src/guestfs-actions.pod:5349 ../src/guestfs-actions.pod:5609 ../src/guestfs-actions.pod:5621 ../src/guestfs-actions.pod:5847 ../src/guestfs-actions.pod:5858 ../src/guestfs-actions.pod:7868 ../src/guestfs-actions.pod:7879
25287 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
25291 #: ../src/guestfs-actions.pod:159
25292 msgid "guestfs_add_domain_argv"
25296 #: ../src/guestfs-actions.pod:161
25300 " guestfs_add_domain_argv (guestfs_h *g,\n"
25301 " const char *dom,\n"
25302 " const struct guestfs_add_domain_argv *optargs);\n"
25307 #: ../src/guestfs-actions.pod:166
25308 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
25312 #: ../src/guestfs-actions.pod:170
25313 msgid "guestfs_add_drive"
25317 #: ../src/guestfs-actions.pod:172
25321 " guestfs_add_drive (guestfs_h *g,\n"
25322 " const char *filename);\n"
25327 #: ../src/guestfs-actions.pod:176
25329 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
25330 "optional parameters, so the disk is added writable, with the format being "
25331 "detected automatically."
25335 #: ../src/guestfs-actions.pod:180
25337 "Automatic detection of the format opens you up to a potential security hole "
25338 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
25339 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
25340 "you should think about replacing calls to this function with calls to "
25341 "C<guestfs_add_drive_opts>, and specifying the format."
25345 #: ../src/guestfs-actions.pod:191
25346 msgid "guestfs_add_drive_opts"
25350 #: ../src/guestfs-actions.pod:193
25354 " guestfs_add_drive_opts (guestfs_h *g,\n"
25355 " const char *filename,\n"
25361 #: ../src/guestfs-actions.pod:203
25364 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
25365 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
25366 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
25367 " GUESTFS_ADD_DRIVE_OPTS_NAME, const char *name,\n"
25372 #: ../src/guestfs-actions.pod:233
25374 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
25375 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
25376 "Possible formats include C<raw> and C<qcow2>."
25380 #: ../src/guestfs-actions.pod:244
25382 "This rarely-used option lets you emulate the behaviour of the deprecated "
25383 "C<guestfs_add_drive_with_if> call (q.v.)"
25387 #: ../src/guestfs-actions.pod:256
25388 msgid "(Added in 1.5.23)"
25392 #: ../src/guestfs-actions.pod:258
25393 msgid "guestfs_add_drive_opts_va"
25397 #: ../src/guestfs-actions.pod:260
25401 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
25402 " const char *filename,\n"
25403 " va_list args);\n"
25408 #: ../src/guestfs-actions.pod:265
25409 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
25413 #: ../src/guestfs-actions.pod:269
25414 msgid "guestfs_add_drive_opts_argv"
25418 #: ../src/guestfs-actions.pod:271
25422 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
25423 " const char *filename,\n"
25424 " const struct guestfs_add_drive_opts_argv "
25430 #: ../src/guestfs-actions.pod:276
25431 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
25435 #: ../src/guestfs-actions.pod:280
25436 msgid "guestfs_add_drive_ro"
25440 #: ../src/guestfs-actions.pod:282
25444 " guestfs_add_drive_ro (guestfs_h *g,\n"
25445 " const char *filename);\n"
25450 #: ../src/guestfs-actions.pod:286
25452 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
25453 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
25454 "disk is added read-only, with the format being detected automatically."
25458 #: ../src/guestfs-actions.pod:293
25459 msgid "(Added in 1.0.38)"
25463 #: ../src/guestfs-actions.pod:295
25464 msgid "guestfs_add_drive_ro_with_if"
25468 #: ../src/guestfs-actions.pod:297
25472 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
25473 " const char *filename,\n"
25474 " const char *iface);\n"
25479 #: ../src/guestfs-actions.pod:309
25481 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
25482 "QEMU interface emulation to use at run time."
25486 #: ../src/guestfs-actions.pod:314 ../src/guestfs-actions.pod:335 ../src/guestfs-actions.pod:2881
25487 msgid "(Added in 1.0.84)"
25491 #: ../src/guestfs-actions.pod:316
25492 msgid "guestfs_add_drive_with_if"
25496 #: ../src/guestfs-actions.pod:318
25500 " guestfs_add_drive_with_if (guestfs_h *g,\n"
25501 " const char *filename,\n"
25502 " const char *iface);\n"
25507 #: ../src/guestfs-actions.pod:330
25509 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
25510 "QEMU interface emulation to use at run time."
25514 #: ../src/guestfs-actions.pod:337
25515 msgid "guestfs_aug_clear"
25519 #: ../src/guestfs-actions.pod:339
25523 " guestfs_aug_clear (guestfs_h *g,\n"
25524 " const char *augpath);\n"
25529 #: ../src/guestfs-actions.pod:348 ../src/guestfs-actions.pod:2609
25530 msgid "(Added in 1.3.4)"
25534 #: ../src/guestfs-actions.pod:350
25535 msgid "guestfs_aug_close"
25539 #: ../src/guestfs-actions.pod:352
25543 " guestfs_aug_close (guestfs_h *g);\n"
25548 #: ../src/guestfs-actions.pod:355
25550 "Close the current Augeas handle and free up any resources used by it. After "
25551 "calling this, you have to call C<guestfs_aug_init> again before you can use "
25552 "any other Augeas functions."
25556 #: ../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:6483
25557 msgid "(Added in 0.7)"
25561 #: ../src/guestfs-actions.pod:364
25562 msgid "guestfs_aug_defnode"
25566 #: ../src/guestfs-actions.pod:366
25569 " struct guestfs_int_bool *\n"
25570 " guestfs_aug_defnode (guestfs_h *g,\n"
25571 " const char *name,\n"
25572 " const char *expr,\n"
25573 " const char *val);\n"
25578 #: ../src/guestfs-actions.pod:375
25580 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
25581 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
25582 "containing that single node."
25586 #: ../src/guestfs-actions.pod:383
25588 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
25589 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
25593 #: ../src/guestfs-actions.pod:389
25594 msgid "guestfs_aug_defvar"
25598 #: ../src/guestfs-actions.pod:391
25602 " guestfs_aug_defvar (guestfs_h *g,\n"
25603 " const char *name,\n"
25604 " const char *expr);\n"
25609 #: ../src/guestfs-actions.pod:407
25610 msgid "guestfs_aug_get"
25614 #: ../src/guestfs-actions.pod:409
25618 " guestfs_aug_get (guestfs_h *g,\n"
25619 " const char *augpath);\n"
25624 #: ../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:4316 ../src/guestfs-actions.pod:4663 ../src/guestfs-actions.pod:4830 ../src/guestfs-actions.pod:5099 ../src/guestfs-actions.pod:5992 ../src/guestfs-actions.pod:6193 ../src/guestfs-actions.pod:6381 ../src/guestfs-actions.pod:6559 ../src/guestfs-actions.pod:6608 ../src/guestfs-actions.pod:7268 ../src/guestfs-actions.pod:7284 ../src/guestfs-actions.pod:7308 ../src/guestfs-actions.pod:7332 ../src/guestfs-actions.pod:8128 ../src/guestfs-actions.pod:8147 ../src/guestfs-actions.pod:8165 ../src/guestfs-actions.pod:8339 ../src/guestfs-actions.pod:8653
25626 "This function returns a string, or NULL on error. I<The caller must free "
25627 "the returned string after use>."
25631 #: ../src/guestfs-actions.pod:421
25632 msgid "guestfs_aug_init"
25636 #: ../src/guestfs-actions.pod:423
25640 " guestfs_aug_init (guestfs_h *g,\n"
25641 " const char *root,\n"
25647 #: ../src/guestfs-actions.pod:432
25648 msgid "You must call this before using any other C<guestfs_aug_*> commands."
25652 #: ../src/guestfs-actions.pod:457
25654 "This option is only useful when debugging Augeas lenses. Use of this option "
25655 "may require additional memory for the libguestfs appliance. You may need to "
25656 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
25657 "C<guestfs_set_memsize>."
25661 #: ../src/guestfs-actions.pod:472
25662 msgid "Do not load the tree in C<guestfs_aug_init>."
25666 #: ../src/guestfs-actions.pod:476
25667 msgid "To close the handle, you can call C<guestfs_aug_close>."
25671 #: ../src/guestfs-actions.pod:484
25672 msgid "guestfs_aug_insert"
25676 #: ../src/guestfs-actions.pod:486
25680 " guestfs_aug_insert (guestfs_h *g,\n"
25681 " const char *augpath,\n"
25682 " const char *label,\n"
25688 #: ../src/guestfs-actions.pod:504
25689 msgid "guestfs_aug_load"
25693 #: ../src/guestfs-actions.pod:506
25697 " guestfs_aug_load (guestfs_h *g);\n"
25702 #: ../src/guestfs-actions.pod:518
25703 msgid "guestfs_aug_ls"
25707 #: ../src/guestfs-actions.pod:520
25711 " guestfs_aug_ls (guestfs_h *g,\n"
25712 " const char *augpath);\n"
25717 #: ../src/guestfs-actions.pod:524
25719 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
25720 "sorting the resulting nodes into alphabetical order."
25724 #: ../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:4278 ../src/guestfs-actions.pod:4298 ../src/guestfs-actions.pod:4403 ../src/guestfs-actions.pod:4802 ../src/guestfs-actions.pod:5718 ../src/guestfs-actions.pod:6353 ../src/guestfs-actions.pod:6479 ../src/guestfs-actions.pod:6593 ../src/guestfs-actions.pod:7348 ../src/guestfs-actions.pod:7409 ../src/guestfs-actions.pod:7464 ../src/guestfs-actions.pod:7610 ../src/guestfs-actions.pod:7634 ../src/guestfs-actions.pod:8232 ../src/guestfs-actions.pod:8252 ../src/guestfs-actions.pod:8299 ../src/guestfs-actions.pod:8493 ../src/guestfs-actions.pod:8512 ../src/guestfs-actions.pod:8603 ../src/guestfs-actions.pod:8622 ../src/guestfs-actions.pod:8668 ../src/guestfs-actions.pod:8687
25726 "This function returns a NULL-terminated array of strings (like "
25727 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
25728 "strings and the array after use>."
25732 #: ../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:4646 ../src/guestfs-actions.pod:4693 ../src/guestfs-actions.pod:5039 ../src/guestfs-actions.pod:5072 ../src/guestfs-actions.pod:5235 ../src/guestfs-actions.pod:5722 ../src/guestfs-actions.pod:6294 ../src/guestfs-actions.pod:6691 ../src/guestfs-actions.pod:6705 ../src/guestfs-actions.pod:6717 ../src/guestfs-actions.pod:7195 ../src/guestfs-actions.pod:7970 ../src/guestfs-actions.pod:7983 ../src/guestfs-actions.pod:8216 ../src/guestfs-actions.pod:8481
25733 msgid "(Added in 0.8)"
25737 #: ../src/guestfs-actions.pod:533
25738 msgid "guestfs_aug_match"
25742 #: ../src/guestfs-actions.pod:535
25746 " guestfs_aug_match (guestfs_h *g,\n"
25747 " const char *augpath);\n"
25752 #: ../src/guestfs-actions.pod:549
25753 msgid "guestfs_aug_mv"
25757 #: ../src/guestfs-actions.pod:551
25761 " guestfs_aug_mv (guestfs_h *g,\n"
25762 " const char *src,\n"
25763 " const char *dest);\n"
25768 #: ../src/guestfs-actions.pod:563
25769 msgid "guestfs_aug_rm"
25773 #: ../src/guestfs-actions.pod:565
25777 " guestfs_aug_rm (guestfs_h *g,\n"
25778 " const char *augpath);\n"
25783 #: ../src/guestfs-actions.pod:577
25784 msgid "guestfs_aug_save"
25788 #: ../src/guestfs-actions.pod:579
25792 " guestfs_aug_save (guestfs_h *g);\n"
25797 #: ../src/guestfs-actions.pod:584
25799 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
25804 #: ../src/guestfs-actions.pod:591
25805 msgid "guestfs_aug_set"
25809 #: ../src/guestfs-actions.pod:593
25813 " guestfs_aug_set (guestfs_h *g,\n"
25814 " const char *augpath,\n"
25815 " const char *val);\n"
25820 #: ../src/guestfs-actions.pod:600
25822 "In the Augeas API, it is possible to clear a node by setting the value to "
25823 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
25824 "this call. Instead you must use the C<guestfs_aug_clear> call."
25828 #: ../src/guestfs-actions.pod:609
25829 msgid "guestfs_available"
25833 #: ../src/guestfs-actions.pod:611
25837 " guestfs_available (guestfs_h *g,\n"
25838 " char *const *groups);\n"
25843 #: ../src/guestfs-actions.pod:619
25845 "The libguestfs groups, and the functions that those groups correspond to, "
25846 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
25847 "runtime by calling C<guestfs_available_all_groups>."
25851 #: ../src/guestfs-actions.pod:643
25852 msgid "You must call C<guestfs_launch> before calling this function."
25856 #: ../src/guestfs-actions.pod:665
25858 "This call was added in version C<1.0.80>. In previous versions of "
25859 "libguestfs all you could do would be to speculatively execute a command to "
25860 "find out if the daemon implemented it. See also C<guestfs_version>."
25864 #: ../src/guestfs-actions.pod:674 ../src/guestfs-actions.pod:1653
25865 msgid "(Added in 1.0.80)"
25869 #: ../src/guestfs-actions.pod:676
25870 msgid "guestfs_available_all_groups"
25874 #: ../src/guestfs-actions.pod:678
25878 " guestfs_available_all_groups (guestfs_h *g);\n"
25883 #: ../src/guestfs-actions.pod:681
25885 "This command returns a list of all optional groups that this daemon knows "
25886 "about. Note this returns both supported and unsupported groups. To find "
25887 "out which ones the daemon can actually support you have to call "
25888 "C<guestfs_available> on each member of the returned list."
25892 #: ../src/guestfs-actions.pod:687
25893 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
25897 #: ../src/guestfs-actions.pod:693
25898 msgid "(Added in 1.3.15)"
25902 #: ../src/guestfs-actions.pod:695
25903 msgid "guestfs_base64_in"
25907 #: ../src/guestfs-actions.pod:697
25911 " guestfs_base64_in (guestfs_h *g,\n"
25912 " const char *base64file,\n"
25913 " const char *filename);\n"
25918 #: ../src/guestfs-actions.pod:707 ../src/guestfs-actions.pod:721
25919 msgid "(Added in 1.3.5)"
25923 #: ../src/guestfs-actions.pod:709
25924 msgid "guestfs_base64_out"
25928 #: ../src/guestfs-actions.pod:711
25932 " guestfs_base64_out (guestfs_h *g,\n"
25933 " const char *filename,\n"
25934 " const char *base64file);\n"
25939 #: ../src/guestfs-actions.pod:723
25940 msgid "guestfs_blockdev_flushbufs"
25944 #: ../src/guestfs-actions.pod:725
25948 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
25949 " const char *device);\n"
25954 #: ../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
25955 msgid "(Added in 0.9.3)"
25959 #: ../src/guestfs-actions.pod:738
25960 msgid "guestfs_blockdev_getbsz"
25964 #: ../src/guestfs-actions.pod:740
25968 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
25969 " const char *device);\n"
25974 #: ../src/guestfs-actions.pod:755
25975 msgid "guestfs_blockdev_getro"
25979 #: ../src/guestfs-actions.pod:757
25983 " guestfs_blockdev_getro (guestfs_h *g,\n"
25984 " const char *device);\n"
25989 #: ../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:5956
25990 msgid "This function returns a C truth value on success or -1 on error."
25994 #: ../src/guestfs-actions.pod:770
25995 msgid "guestfs_blockdev_getsize64"
25999 #: ../src/guestfs-actions.pod:772
26003 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
26004 " const char *device);\n"
26009 #: ../src/guestfs-actions.pod:778
26010 msgid "See also C<guestfs_blockdev_getsz>."
26014 #: ../src/guestfs-actions.pod:786
26015 msgid "guestfs_blockdev_getss"
26019 #: ../src/guestfs-actions.pod:788
26023 " guestfs_blockdev_getss (guestfs_h *g,\n"
26024 " const char *device);\n"
26029 #: ../src/guestfs-actions.pod:795
26031 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
26036 #: ../src/guestfs-actions.pod:804
26037 msgid "guestfs_blockdev_getsz"
26041 #: ../src/guestfs-actions.pod:806
26045 " guestfs_blockdev_getsz (guestfs_h *g,\n"
26046 " const char *device);\n"
26051 #: ../src/guestfs-actions.pod:813
26053 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
26054 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
26058 #: ../src/guestfs-actions.pod:823
26059 msgid "guestfs_blockdev_rereadpt"
26063 #: ../src/guestfs-actions.pod:825
26067 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
26068 " const char *device);\n"
26073 #: ../src/guestfs-actions.pod:837
26074 msgid "guestfs_blockdev_setbsz"
26078 #: ../src/guestfs-actions.pod:839
26082 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
26083 " const char *device,\n"
26084 " int blocksize);\n"
26089 #: ../src/guestfs-actions.pod:855
26090 msgid "guestfs_blockdev_setro"
26094 #: ../src/guestfs-actions.pod:857
26098 " guestfs_blockdev_setro (guestfs_h *g,\n"
26099 " const char *device);\n"
26104 #: ../src/guestfs-actions.pod:869
26105 msgid "guestfs_blockdev_setrw"
26109 #: ../src/guestfs-actions.pod:871
26113 " guestfs_blockdev_setrw (guestfs_h *g,\n"
26114 " const char *device);\n"
26119 #: ../src/guestfs-actions.pod:883
26120 msgid "guestfs_btrfs_filesystem_resize"
26124 #: ../src/guestfs-actions.pod:885
26128 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
26129 " const char *mountpoint,\n"
26135 #: ../src/guestfs-actions.pod:895
26138 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
26143 #: ../src/guestfs-actions.pod:918
26144 msgid "(Added in 1.11.17)"
26148 #: ../src/guestfs-actions.pod:920
26149 msgid "guestfs_btrfs_filesystem_resize_va"
26153 #: ../src/guestfs-actions.pod:922
26157 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
26158 " const char *mountpoint,\n"
26159 " va_list args);\n"
26164 #: ../src/guestfs-actions.pod:927
26165 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
26169 #: ../src/guestfs-actions.pod:931
26170 msgid "guestfs_btrfs_filesystem_resize_argv"
26174 #: ../src/guestfs-actions.pod:933
26178 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
26179 " const char *mountpoint,\n"
26181 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
26186 #: ../src/guestfs-actions.pod:938
26187 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
26191 #: ../src/guestfs-actions.pod:942
26192 msgid "guestfs_case_sensitive_path"
26196 #: ../src/guestfs-actions.pod:944
26200 " guestfs_case_sensitive_path (guestfs_h *g,\n"
26201 " const char *path);\n"
26206 #: ../src/guestfs-actions.pod:970
26208 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
26209 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
26210 "how the directories were originally created under Windows)."
26214 #: ../src/guestfs-actions.pod:978
26215 msgid "See also C<guestfs_realpath>."
26219 #: ../src/guestfs-actions.pod:983 ../src/guestfs-actions.pod:8150
26220 msgid "(Added in 1.0.75)"
26224 #: ../src/guestfs-actions.pod:985
26225 msgid "guestfs_cat"
26229 #: ../src/guestfs-actions.pod:987
26233 " guestfs_cat (guestfs_h *g,\n"
26234 " const char *path);\n"
26239 #: ../src/guestfs-actions.pod:993
26241 "Note that this function cannot correctly handle binary files (specifically, "
26242 "files containing C<\\0> character which is treated as end of string). For "
26243 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
26244 "functions which have a more complex interface."
26248 #: ../src/guestfs-actions.pod:1004 ../src/guestfs-actions.pod:4207 ../src/guestfs-actions.pod:4302 ../src/guestfs-actions.pod:4319 ../src/guestfs-actions.pod:4407 ../src/guestfs-actions.pod:4806 ../src/guestfs-actions.pod:4820 ../src/guestfs-actions.pod:6357 ../src/guestfs-actions.pod:6371 ../src/guestfs-actions.pod:8303 ../src/guestfs-actions.pod:8317
26249 msgid "(Added in 0.4)"
26253 #: ../src/guestfs-actions.pod:1006
26254 msgid "guestfs_checksum"
26258 #: ../src/guestfs-actions.pod:1008
26262 " guestfs_checksum (guestfs_h *g,\n"
26263 " const char *csumtype,\n"
26264 " const char *path);\n"
26269 #: ../src/guestfs-actions.pod:1054
26270 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
26274 #: ../src/guestfs-actions.pod:1056
26275 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
26279 #: ../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:8006
26280 msgid "(Added in 1.0.2)"
26284 #: ../src/guestfs-actions.pod:1063
26285 msgid "guestfs_checksum_device"
26289 #: ../src/guestfs-actions.pod:1065
26293 " guestfs_checksum_device (guestfs_h *g,\n"
26294 " const char *csumtype,\n"
26295 " const char *device);\n"
26300 #: ../src/guestfs-actions.pod:1070
26302 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
26303 "device named C<device>. For the types of checksums supported see the "
26304 "C<guestfs_checksum> command."
26308 #: ../src/guestfs-actions.pod:1077 ../src/guestfs-actions.pod:5789 ../src/guestfs-actions.pod:5924 ../src/guestfs-actions.pod:5958 ../src/guestfs-actions.pod:5976 ../src/guestfs-actions.pod:6158 ../src/guestfs-actions.pod:7915 ../src/guestfs-actions.pod:7929 ../src/guestfs-actions.pod:8329
26309 msgid "(Added in 1.3.2)"
26313 #: ../src/guestfs-actions.pod:1079
26314 msgid "guestfs_checksums_out"
26318 #: ../src/guestfs-actions.pod:1081
26322 " guestfs_checksums_out (guestfs_h *g,\n"
26323 " const char *csumtype,\n"
26324 " const char *directory,\n"
26325 " const char *sumsfile);\n"
26330 #: ../src/guestfs-actions.pod:1101
26331 msgid "(Added in 1.3.7)"
26335 #: ../src/guestfs-actions.pod:1103
26336 msgid "guestfs_chmod"
26340 #: ../src/guestfs-actions.pod:1105
26344 " guestfs_chmod (guestfs_h *g,\n"
26346 " const char *path);\n"
26351 #: ../src/guestfs-actions.pod:1123
26352 msgid "guestfs_chown"
26356 #: ../src/guestfs-actions.pod:1125
26360 " guestfs_chown (guestfs_h *g,\n"
26363 " const char *path);\n"
26368 #: ../src/guestfs-actions.pod:1141
26369 msgid "guestfs_command"
26373 #: ../src/guestfs-actions.pod:1143
26377 " guestfs_command (guestfs_h *g,\n"
26378 " char *const *arguments);\n"
26383 #: ../src/guestfs-actions.pod:1152
26385 "The single parameter is an argv-style list of arguments. The first element "
26386 "is the name of the program to run. Subsequent elements are parameters. The "
26387 "list must be non-empty (ie. must contain a program name). Note that the "
26388 "command runs directly, and is I<not> invoked via the shell (see "
26393 #: ../src/guestfs-actions.pod:1183 ../src/guestfs-actions.pod:1203 ../src/guestfs-actions.pod:2027
26394 msgid "(Added in 0.9.1)"
26398 #: ../src/guestfs-actions.pod:1185
26399 msgid "guestfs_command_lines"
26403 #: ../src/guestfs-actions.pod:1187
26407 " guestfs_command_lines (guestfs_h *g,\n"
26408 " char *const *arguments);\n"
26413 #: ../src/guestfs-actions.pod:1191
26415 "This is the same as C<guestfs_command>, but splits the result into a list of "
26420 #: ../src/guestfs-actions.pod:1194
26421 msgid "See also: C<guestfs_sh_lines>"
26425 #: ../src/guestfs-actions.pod:1205
26426 msgid "guestfs_compress_device_out"
26430 #: ../src/guestfs-actions.pod:1207
26434 " guestfs_compress_device_out (guestfs_h *g,\n"
26435 " const char *ctype,\n"
26436 " const char *device,\n"
26437 " const char *zdevice,\n"
26443 #: ../src/guestfs-actions.pod:1219
26446 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
26451 #: ../src/guestfs-actions.pod:1224
26453 "The C<ctype> and optional C<level> parameters have the same meaning as in "
26454 "C<guestfs_compress_out>."
26458 #: ../src/guestfs-actions.pod:1229 ../src/guestfs-actions.pod:1288 ../src/guestfs-actions.pod:2572 ../src/guestfs-actions.pod:7074
26459 msgid "(Added in 1.13.15)"
26463 #: ../src/guestfs-actions.pod:1231
26464 msgid "guestfs_compress_device_out_va"
26468 #: ../src/guestfs-actions.pod:1233
26472 " guestfs_compress_device_out_va (guestfs_h *g,\n"
26473 " const char *ctype,\n"
26474 " const char *device,\n"
26475 " const char *zdevice,\n"
26476 " va_list args);\n"
26481 #: ../src/guestfs-actions.pod:1240
26482 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
26486 #: ../src/guestfs-actions.pod:1244
26487 msgid "guestfs_compress_device_out_argv"
26491 #: ../src/guestfs-actions.pod:1246
26495 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
26496 " const char *ctype,\n"
26497 " const char *device,\n"
26498 " const char *zdevice,\n"
26500 "guestfs_compress_device_out_argv *optargs);\n"
26505 #: ../src/guestfs-actions.pod:1253
26506 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
26510 #: ../src/guestfs-actions.pod:1257
26511 msgid "guestfs_compress_out"
26515 #: ../src/guestfs-actions.pod:1259
26519 " guestfs_compress_out (guestfs_h *g,\n"
26520 " const char *ctype,\n"
26521 " const char *file,\n"
26522 " const char *zfile,\n"
26528 #: ../src/guestfs-actions.pod:1271
26531 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
26536 #: ../src/guestfs-actions.pod:1290
26537 msgid "guestfs_compress_out_va"
26541 #: ../src/guestfs-actions.pod:1292
26545 " guestfs_compress_out_va (guestfs_h *g,\n"
26546 " const char *ctype,\n"
26547 " const char *file,\n"
26548 " const char *zfile,\n"
26549 " va_list args);\n"
26554 #: ../src/guestfs-actions.pod:1299
26555 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
26559 #: ../src/guestfs-actions.pod:1303
26560 msgid "guestfs_compress_out_argv"
26564 #: ../src/guestfs-actions.pod:1305
26568 " guestfs_compress_out_argv (guestfs_h *g,\n"
26569 " const char *ctype,\n"
26570 " const char *file,\n"
26571 " const char *zfile,\n"
26572 " const struct guestfs_compress_out_argv "
26578 #: ../src/guestfs-actions.pod:1312
26579 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
26583 #: ../src/guestfs-actions.pod:1316
26584 msgid "guestfs_config"
26588 #: ../src/guestfs-actions.pod:1318
26592 " guestfs_config (guestfs_h *g,\n"
26593 " const char *qemuparam,\n"
26594 " const char *qemuvalue);\n"
26599 #: ../src/guestfs-actions.pod:1336
26600 msgid "guestfs_copy_device_to_device"
26604 #: ../src/guestfs-actions.pod:1338
26608 " guestfs_copy_device_to_device (guestfs_h *g,\n"
26609 " const char *src,\n"
26610 " const char *dest,\n"
26616 #: ../src/guestfs-actions.pod:1349
26619 " GUESTFS_COPY_DEVICE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
26620 " GUESTFS_COPY_DEVICE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
26621 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, int64_t size,\n"
26626 #: ../src/guestfs-actions.pod:1353
26628 "The four calls C<guestfs_copy_device_to_device>, "
26629 "C<guestfs_copy_device_to_file>, C<guestfs_copy_file_to_device>, and "
26630 "C<guestfs_copy_file_to_file> let you copy from a source (device|file) to a "
26631 "destination (device|file)."
26635 #: ../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:8001 ../src/guestfs-actions.pod:8035 ../src/guestfs-actions.pod:8542 ../src/guestfs-actions.pod:8565
26637 "This long-running command can generate progress notification messages so "
26638 "that the caller can display a progress bar or indicator. To receive these "
26639 "messages, the caller must register a progress event callback. See "
26640 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
26644 #: ../src/guestfs-actions.pod:1379 ../src/guestfs-actions.pod:1432 ../src/guestfs-actions.pod:1485 ../src/guestfs-actions.pod:1543 ../src/guestfs-actions.pod:6214
26645 msgid "(Added in 1.13.25)"
26649 #: ../src/guestfs-actions.pod:1381
26650 msgid "guestfs_copy_device_to_device_va"
26654 #: ../src/guestfs-actions.pod:1383
26658 " guestfs_copy_device_to_device_va (guestfs_h *g,\n"
26659 " const char *src,\n"
26660 " const char *dest,\n"
26661 " va_list args);\n"
26666 #: ../src/guestfs-actions.pod:1389
26667 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_device>."
26671 #: ../src/guestfs-actions.pod:1393
26672 msgid "guestfs_copy_device_to_device_argv"
26676 #: ../src/guestfs-actions.pod:1395
26680 " guestfs_copy_device_to_device_argv (guestfs_h *g,\n"
26681 " const char *src,\n"
26682 " const char *dest,\n"
26684 "guestfs_copy_device_to_device_argv *optargs);\n"
26689 #: ../src/guestfs-actions.pod:1401
26690 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_device>."
26694 #: ../src/guestfs-actions.pod:1405
26695 msgid "guestfs_copy_device_to_file"
26699 #: ../src/guestfs-actions.pod:1407
26703 " guestfs_copy_device_to_file (guestfs_h *g,\n"
26704 " const char *src,\n"
26705 " const char *dest,\n"
26711 #: ../src/guestfs-actions.pod:1418
26714 " GUESTFS_COPY_DEVICE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
26715 " GUESTFS_COPY_DEVICE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
26716 " GUESTFS_COPY_DEVICE_TO_FILE_SIZE, int64_t size,\n"
26721 #: ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:1475 ../src/guestfs-actions.pod:1528
26722 msgid "See C<guestfs_copy_device_to_device> for a general overview of this call."
26726 #: ../src/guestfs-actions.pod:1434
26727 msgid "guestfs_copy_device_to_file_va"
26731 #: ../src/guestfs-actions.pod:1436
26735 " guestfs_copy_device_to_file_va (guestfs_h *g,\n"
26736 " const char *src,\n"
26737 " const char *dest,\n"
26738 " va_list args);\n"
26743 #: ../src/guestfs-actions.pod:1442
26744 msgid "This is the \"va_list variant\" of L</guestfs_copy_device_to_file>."
26748 #: ../src/guestfs-actions.pod:1446
26749 msgid "guestfs_copy_device_to_file_argv"
26753 #: ../src/guestfs-actions.pod:1448
26757 " guestfs_copy_device_to_file_argv (guestfs_h *g,\n"
26758 " const char *src,\n"
26759 " const char *dest,\n"
26761 "guestfs_copy_device_to_file_argv *optargs);\n"
26766 #: ../src/guestfs-actions.pod:1454
26767 msgid "This is the \"argv variant\" of L</guestfs_copy_device_to_file>."
26771 #: ../src/guestfs-actions.pod:1458
26772 msgid "guestfs_copy_file_to_device"
26776 #: ../src/guestfs-actions.pod:1460
26780 " guestfs_copy_file_to_device (guestfs_h *g,\n"
26781 " const char *src,\n"
26782 " const char *dest,\n"
26788 #: ../src/guestfs-actions.pod:1471
26791 " GUESTFS_COPY_FILE_TO_DEVICE_SRCOFFSET, int64_t srcoffset,\n"
26792 " GUESTFS_COPY_FILE_TO_DEVICE_DESTOFFSET, int64_t destoffset,\n"
26793 " GUESTFS_COPY_FILE_TO_DEVICE_SIZE, int64_t size,\n"
26798 #: ../src/guestfs-actions.pod:1487
26799 msgid "guestfs_copy_file_to_device_va"
26803 #: ../src/guestfs-actions.pod:1489
26807 " guestfs_copy_file_to_device_va (guestfs_h *g,\n"
26808 " const char *src,\n"
26809 " const char *dest,\n"
26810 " va_list args);\n"
26815 #: ../src/guestfs-actions.pod:1495
26816 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_device>."
26820 #: ../src/guestfs-actions.pod:1499
26821 msgid "guestfs_copy_file_to_device_argv"
26825 #: ../src/guestfs-actions.pod:1501
26829 " guestfs_copy_file_to_device_argv (guestfs_h *g,\n"
26830 " const char *src,\n"
26831 " const char *dest,\n"
26833 "guestfs_copy_file_to_device_argv *optargs);\n"
26838 #: ../src/guestfs-actions.pod:1507
26839 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_device>."
26843 #: ../src/guestfs-actions.pod:1511
26844 msgid "guestfs_copy_file_to_file"
26848 #: ../src/guestfs-actions.pod:1513
26852 " guestfs_copy_file_to_file (guestfs_h *g,\n"
26853 " const char *src,\n"
26854 " const char *dest,\n"
26860 #: ../src/guestfs-actions.pod:1524
26863 " GUESTFS_COPY_FILE_TO_FILE_SRCOFFSET, int64_t srcoffset,\n"
26864 " GUESTFS_COPY_FILE_TO_FILE_DESTOFFSET, int64_t destoffset,\n"
26865 " GUESTFS_COPY_FILE_TO_FILE_SIZE, int64_t size,\n"
26870 #: ../src/guestfs-actions.pod:1531
26872 "This is B<not> the function you want for copying files. This is for copying "
26873 "blocks within existing files. See C<guestfs_cp>, C<guestfs_cp_a> and "
26874 "C<guestfs_mv> for general file copying and moving functions."
26878 #: ../src/guestfs-actions.pod:1545
26879 msgid "guestfs_copy_file_to_file_va"
26883 #: ../src/guestfs-actions.pod:1547
26887 " guestfs_copy_file_to_file_va (guestfs_h *g,\n"
26888 " const char *src,\n"
26889 " const char *dest,\n"
26890 " va_list args);\n"
26895 #: ../src/guestfs-actions.pod:1553
26896 msgid "This is the \"va_list variant\" of L</guestfs_copy_file_to_file>."
26900 #: ../src/guestfs-actions.pod:1557
26901 msgid "guestfs_copy_file_to_file_argv"
26905 #: ../src/guestfs-actions.pod:1559
26909 " guestfs_copy_file_to_file_argv (guestfs_h *g,\n"
26910 " const char *src,\n"
26911 " const char *dest,\n"
26912 " const struct guestfs_copy_file_to_file_argv "
26918 #: ../src/guestfs-actions.pod:1565
26919 msgid "This is the \"argv variant\" of L</guestfs_copy_file_to_file>."
26923 #: ../src/guestfs-actions.pod:1569
26924 msgid "guestfs_copy_size"
26928 #: ../src/guestfs-actions.pod:1571
26932 " guestfs_copy_size (guestfs_h *g,\n"
26933 " const char *src,\n"
26934 " const char *dest,\n"
26935 " int64_t size);\n"
26940 #: ../src/guestfs-actions.pod:1577 ../src/guestfs-actions.pod:1634
26942 "I<This function is deprecated.> In new code, use the "
26943 "L</guestfs_copy_device_to_device> call instead."
26947 #: ../src/guestfs-actions.pod:1597 ../src/guestfs-actions.pod:4833 ../src/guestfs-actions.pod:6384 ../src/guestfs-actions.pod:8236 ../src/guestfs-actions.pod:8256 ../src/guestfs-actions.pod:8342
26948 msgid "(Added in 1.0.87)"
26952 #: ../src/guestfs-actions.pod:1599
26957 #: ../src/guestfs-actions.pod:1601
26961 " guestfs_cp (guestfs_h *g,\n"
26962 " const char *src,\n"
26963 " const char *dest);\n"
26968 #: ../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:5736 ../src/guestfs-actions.pod:6228
26969 msgid "(Added in 1.0.18)"
26973 #: ../src/guestfs-actions.pod:1613
26974 msgid "guestfs_cp_a"
26978 #: ../src/guestfs-actions.pod:1615
26982 " guestfs_cp_a (guestfs_h *g,\n"
26983 " const char *src,\n"
26984 " const char *dest);\n"
26989 #: ../src/guestfs-actions.pod:1627
26994 #: ../src/guestfs-actions.pod:1629
26998 " guestfs_dd (guestfs_h *g,\n"
26999 " const char *src,\n"
27000 " const char *dest);\n"
27005 #: ../src/guestfs-actions.pod:1646
27007 "If the destination is a device, it must be as large or larger than the "
27008 "source file or device, otherwise the copy will fail. This command cannot do "
27009 "partial copies (see C<guestfs_copy_device_to_device>)."
27013 #: ../src/guestfs-actions.pod:1655
27018 #: ../src/guestfs-actions.pod:1657
27022 " guestfs_df (guestfs_h *g);\n"
27027 #: ../src/guestfs-actions.pod:1662 ../src/guestfs-actions.pod:1679
27029 "This command is mostly useful for interactive sessions. It is I<not> "
27030 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
27035 #: ../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:5102 ../src/guestfs-actions.pod:5636 ../src/guestfs-actions.pod:7617 ../src/guestfs-actions.pod:7641 ../src/guestfs-actions.pod:8382 ../src/guestfs-actions.pod:8395 ../src/guestfs-actions.pod:8408
27036 msgid "(Added in 1.0.54)"
27040 #: ../src/guestfs-actions.pod:1671
27041 msgid "guestfs_df_h"
27045 #: ../src/guestfs-actions.pod:1673
27049 " guestfs_df_h (guestfs_h *g);\n"
27054 #: ../src/guestfs-actions.pod:1688
27055 msgid "guestfs_dmesg"
27059 #: ../src/guestfs-actions.pod:1690
27063 " guestfs_dmesg (guestfs_h *g);\n"
27068 #: ../src/guestfs-actions.pod:1697
27070 "Another way to get the same information is to enable verbose messages with "
27071 "C<guestfs_set_verbose> or by setting the environment variable "
27072 "C<LIBGUESTFS_DEBUG=1> before running the program."
27076 #: ../src/guestfs-actions.pod:1707
27077 msgid "guestfs_download"
27081 #: ../src/guestfs-actions.pod:1709
27085 " guestfs_download (guestfs_h *g,\n"
27086 " const char *remotefilename,\n"
27087 " const char *filename);\n"
27092 #: ../src/guestfs-actions.pod:1719
27093 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
27097 #: ../src/guestfs-actions.pod:1730
27098 msgid "guestfs_download_offset"
27102 #: ../src/guestfs-actions.pod:1732
27106 " guestfs_download_offset (guestfs_h *g,\n"
27107 " const char *remotefilename,\n"
27108 " const char *filename,\n"
27109 " int64_t offset,\n"
27110 " int64_t size);\n"
27115 #: ../src/guestfs-actions.pod:1745
27117 "Note that there is no limit on the amount of data that can be downloaded "
27118 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
27119 "full amount unless an error occurs."
27123 #: ../src/guestfs-actions.pod:1750
27124 msgid "See also C<guestfs_download>, C<guestfs_pread>."
27128 #: ../src/guestfs-actions.pod:1759 ../src/guestfs-actions.pod:8040
27129 msgid "(Added in 1.5.17)"
27133 #: ../src/guestfs-actions.pod:1761
27134 msgid "guestfs_drop_caches"
27138 #: ../src/guestfs-actions.pod:1763
27142 " guestfs_drop_caches (guestfs_h *g,\n"
27143 " int whattodrop);\n"
27148 #: ../src/guestfs-actions.pod:1781
27153 #: ../src/guestfs-actions.pod:1783
27157 " guestfs_du (guestfs_h *g,\n"
27158 " const char *path);\n"
27163 #: ../src/guestfs-actions.pod:1806
27164 msgid "guestfs_e2fsck_f"
27168 #: ../src/guestfs-actions.pod:1808
27172 " guestfs_e2fsck_f (guestfs_h *g,\n"
27173 " const char *device);\n"
27178 #: ../src/guestfs-actions.pod:1816
27180 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
27181 "Normally you should use C<guestfs_fsck>."
27185 #: ../src/guestfs-actions.pod:1821
27186 msgid "(Added in 1.0.29)"
27190 #: ../src/guestfs-actions.pod:1823
27191 msgid "guestfs_echo_daemon"
27195 #: ../src/guestfs-actions.pod:1825
27199 " guestfs_echo_daemon (guestfs_h *g,\n"
27200 " char *const *words);\n"
27205 #: ../src/guestfs-actions.pod:1834
27206 msgid "See also C<guestfs_ping_daemon>."
27210 #: ../src/guestfs-actions.pod:1839 ../src/guestfs-actions.pod:2597 ../src/guestfs-actions.pod:7098
27211 msgid "(Added in 1.0.69)"
27215 #: ../src/guestfs-actions.pod:1841
27216 msgid "guestfs_egrep"
27220 #: ../src/guestfs-actions.pod:1843
27224 " guestfs_egrep (guestfs_h *g,\n"
27225 " const char *regex,\n"
27226 " const char *path);\n"
27231 #: ../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:4332 ../src/guestfs-actions.pod:4346 ../src/guestfs-actions.pod:4359 ../src/guestfs-actions.pod:4373 ../src/guestfs-actions.pod:5524 ../src/guestfs-actions.pod:6562 ../src/guestfs-actions.pod:6611 ../src/guestfs-actions.pod:7485 ../src/guestfs-actions.pod:7497 ../src/guestfs-actions.pod:7510 ../src/guestfs-actions.pod:7523 ../src/guestfs-actions.pod:7545 ../src/guestfs-actions.pod:7558 ../src/guestfs-actions.pod:7571 ../src/guestfs-actions.pod:7584 ../src/guestfs-actions.pod:8500 ../src/guestfs-actions.pod:8519 ../src/guestfs-actions.pod:8610 ../src/guestfs-actions.pod:8629 ../src/guestfs-actions.pod:8675 ../src/guestfs-actions.pod:8694
27232 msgid "(Added in 1.0.66)"
27236 #: ../src/guestfs-actions.pod:1860
27237 msgid "guestfs_egrepi"
27241 #: ../src/guestfs-actions.pod:1862
27245 " guestfs_egrepi (guestfs_h *g,\n"
27246 " const char *regex,\n"
27247 " const char *path);\n"
27252 #: ../src/guestfs-actions.pod:1879
27253 msgid "guestfs_equal"
27257 #: ../src/guestfs-actions.pod:1881
27261 " guestfs_equal (guestfs_h *g,\n"
27262 " const char *file1,\n"
27263 " const char *file2);\n"
27268 #: ../src/guestfs-actions.pod:1895
27269 msgid "guestfs_exists"
27273 #: ../src/guestfs-actions.pod:1897
27277 " guestfs_exists (guestfs_h *g,\n"
27278 " const char *path);\n"
27283 #: ../src/guestfs-actions.pod:1904
27284 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
27288 #: ../src/guestfs-actions.pod:1910
27289 msgid "guestfs_fallocate"
27293 #: ../src/guestfs-actions.pod:1912
27297 " guestfs_fallocate (guestfs_h *g,\n"
27298 " const char *path,\n"
27304 #: ../src/guestfs-actions.pod:1917
27306 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
27311 #: ../src/guestfs-actions.pod:1936
27312 msgid "guestfs_fallocate64"
27316 #: ../src/guestfs-actions.pod:1938
27320 " guestfs_fallocate64 (guestfs_h *g,\n"
27321 " const char *path,\n"
27327 #: ../src/guestfs-actions.pod:1947
27329 "Note that this call allocates disk blocks for the file. To create a sparse "
27330 "file use C<guestfs_truncate_size> instead."
27334 #: ../src/guestfs-actions.pod:1950
27336 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
27337 "oversight it only allowed 30 bit lengths to be specified, effectively "
27338 "limiting the maximum size of files created through that call to 1GB."
27342 #: ../src/guestfs-actions.pod:1961
27343 msgid "(Added in 1.3.17)"
27347 #: ../src/guestfs-actions.pod:1963
27348 msgid "guestfs_fgrep"
27352 #: ../src/guestfs-actions.pod:1965
27356 " guestfs_fgrep (guestfs_h *g,\n"
27357 " const char *pattern,\n"
27358 " const char *path);\n"
27363 #: ../src/guestfs-actions.pod:1982
27364 msgid "guestfs_fgrepi"
27368 #: ../src/guestfs-actions.pod:1984
27372 " guestfs_fgrepi (guestfs_h *g,\n"
27373 " const char *pattern,\n"
27374 " const char *path);\n"
27379 #: ../src/guestfs-actions.pod:2001
27380 msgid "guestfs_file"
27384 #: ../src/guestfs-actions.pod:2003
27388 " guestfs_file (guestfs_h *g,\n"
27389 " const char *path);\n"
27394 #: ../src/guestfs-actions.pod:2021
27396 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
27397 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
27401 #: ../src/guestfs-actions.pod:2029
27402 msgid "guestfs_file_architecture"
27406 #: ../src/guestfs-actions.pod:2031
27410 " guestfs_file_architecture (guestfs_h *g,\n"
27411 " const char *filename);\n"
27416 #: ../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
27417 msgid "(Added in 1.5.3)"
27421 #: ../src/guestfs-actions.pod:2141
27422 msgid "guestfs_filesize"
27426 #: ../src/guestfs-actions.pod:2143
27430 " guestfs_filesize (guestfs_h *g,\n"
27431 " const char *file);\n"
27436 #: ../src/guestfs-actions.pod:2149
27438 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
27439 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
27440 "devices, use C<guestfs_blockdev_getsize64>."
27444 #: ../src/guestfs-actions.pod:2155
27445 msgid "(Added in 1.0.82)"
27449 #: ../src/guestfs-actions.pod:2157
27450 msgid "guestfs_fill"
27454 #: ../src/guestfs-actions.pod:2159
27458 " guestfs_fill (guestfs_h *g,\n"
27461 " const char *path);\n"
27466 #: ../src/guestfs-actions.pod:2169
27468 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
27469 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
27470 "bytes use C<guestfs_fill_pattern>."
27474 #: ../src/guestfs-actions.pod:2181
27475 msgid "(Added in 1.0.79)"
27479 #: ../src/guestfs-actions.pod:2183
27480 msgid "guestfs_fill_pattern"
27484 #: ../src/guestfs-actions.pod:2185
27488 " guestfs_fill_pattern (guestfs_h *g,\n"
27489 " const char *pattern,\n"
27491 " const char *path);\n"
27496 #: ../src/guestfs-actions.pod:2191
27498 "This function is like C<guestfs_fill> except that it creates a new file of "
27499 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
27500 "pattern is truncated if necessary to ensure the length of the file is "
27501 "exactly C<len> bytes."
27505 #: ../src/guestfs-actions.pod:2203
27506 msgid "(Added in 1.3.12)"
27510 #: ../src/guestfs-actions.pod:2205
27511 msgid "guestfs_find"
27515 #: ../src/guestfs-actions.pod:2207
27519 " guestfs_find (guestfs_h *g,\n"
27520 " const char *directory);\n"
27525 #: ../src/guestfs-actions.pod:2223
27526 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
27530 #: ../src/guestfs-actions.pod:2236
27531 msgid "See also C<guestfs_find0>."
27535 #: ../src/guestfs-actions.pod:2245 ../src/guestfs-actions.pod:4770 ../src/guestfs-actions.pod:6646
27536 msgid "(Added in 1.0.27)"
27540 #: ../src/guestfs-actions.pod:2247
27541 msgid "guestfs_find0"
27545 #: ../src/guestfs-actions.pod:2249
27549 " guestfs_find0 (guestfs_h *g,\n"
27550 " const char *directory,\n"
27551 " const char *files);\n"
27556 #: ../src/guestfs-actions.pod:2258
27558 "This command works the same way as C<guestfs_find> with the following "
27563 #: ../src/guestfs-actions.pod:2285
27564 msgid "(Added in 1.0.74)"
27568 #: ../src/guestfs-actions.pod:2287
27569 msgid "guestfs_findfs_label"
27573 #: ../src/guestfs-actions.pod:2289
27577 " guestfs_findfs_label (guestfs_h *g,\n"
27578 " const char *label);\n"
27583 #: ../src/guestfs-actions.pod:2297
27584 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
27588 #: ../src/guestfs-actions.pod:2304
27589 msgid "guestfs_findfs_uuid"
27593 #: ../src/guestfs-actions.pod:2306
27597 " guestfs_findfs_uuid (guestfs_h *g,\n"
27598 " const char *uuid);\n"
27603 #: ../src/guestfs-actions.pod:2314
27604 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
27608 #: ../src/guestfs-actions.pod:2321
27609 msgid "guestfs_fsck"
27613 #: ../src/guestfs-actions.pod:2323
27617 " guestfs_fsck (guestfs_h *g,\n"
27618 " const char *fstype,\n"
27619 " const char *device);\n"
27624 #: ../src/guestfs-actions.pod:2358 ../src/guestfs-actions.pod:8547
27625 msgid "(Added in 1.0.16)"
27629 #: ../src/guestfs-actions.pod:2360
27630 msgid "guestfs_get_append"
27634 #: ../src/guestfs-actions.pod:2362
27638 " guestfs_get_append (guestfs_h *g);\n"
27643 #: ../src/guestfs-actions.pod:2370
27645 "This function returns a string which may be NULL. There is no way to return "
27646 "an error from this function. The string is owned by the guest handle and "
27647 "must I<not> be freed."
27651 #: ../src/guestfs-actions.pod:2374 ../src/guestfs-actions.pod:6324 ../src/guestfs-actions.pod:6803 ../src/guestfs-actions.pod:7252 ../src/guestfs-actions.pod:7271 ../src/guestfs-actions.pod:7287 ../src/guestfs-actions.pod:7311 ../src/guestfs-actions.pod:8187 ../src/guestfs-actions.pod:8202 ../src/guestfs-actions.pod:8591
27652 msgid "(Added in 1.0.26)"
27656 #: ../src/guestfs-actions.pod:2376
27657 msgid "guestfs_get_attach_method"
27661 #: ../src/guestfs-actions.pod:2378
27665 " guestfs_get_attach_method (guestfs_h *g);\n"
27670 #: ../src/guestfs-actions.pod:2381
27671 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
27675 #: ../src/guestfs-actions.pod:2386 ../src/guestfs-actions.pod:6833
27676 msgid "(Added in 1.9.8)"
27680 #: ../src/guestfs-actions.pod:2388
27681 msgid "guestfs_get_autosync"
27685 #: ../src/guestfs-actions.pod:2390
27689 " guestfs_get_autosync (guestfs_h *g);\n"
27694 #: ../src/guestfs-actions.pod:2399
27695 msgid "guestfs_get_direct"
27699 #: ../src/guestfs-actions.pod:2401
27703 " guestfs_get_direct (guestfs_h *g);\n"
27708 #: ../src/guestfs-actions.pod:2408 ../src/guestfs-actions.pod:6874
27709 msgid "(Added in 1.0.72)"
27713 #: ../src/guestfs-actions.pod:2410
27714 msgid "guestfs_get_e2label"
27718 #: ../src/guestfs-actions.pod:2412
27722 " guestfs_get_e2label (guestfs_h *g,\n"
27723 " const char *device);\n"
27728 #: ../src/guestfs-actions.pod:2416
27730 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
27735 #: ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:2450 ../src/guestfs-actions.pod:6892 ../src/guestfs-actions.pod:6911
27736 msgid "(Added in 1.0.15)"
27740 #: ../src/guestfs-actions.pod:2431
27741 msgid "guestfs_get_e2uuid"
27745 #: ../src/guestfs-actions.pod:2433
27749 " guestfs_get_e2uuid (guestfs_h *g,\n"
27750 " const char *device);\n"
27755 #: ../src/guestfs-actions.pod:2437
27757 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
27762 #: ../src/guestfs-actions.pod:2452
27763 msgid "guestfs_get_memsize"
27767 #: ../src/guestfs-actions.pod:2454
27771 " guestfs_get_memsize (guestfs_h *g);\n"
27776 #: ../src/guestfs-actions.pod:2460
27778 "If C<guestfs_set_memsize> was not called on this handle, and if "
27779 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
27780 "value for memsize."
27784 #: ../src/guestfs-actions.pod:2469 ../src/guestfs-actions.pod:5220 ../src/guestfs-actions.pod:5429 ../src/guestfs-actions.pod:5448 ../src/guestfs-actions.pod:5467 ../src/guestfs-actions.pod:5479 ../src/guestfs-actions.pod:5496 ../src/guestfs-actions.pod:5509 ../src/guestfs-actions.pod:6549 ../src/guestfs-actions.pod:6932 ../src/guestfs-actions.pod:7222 ../src/guestfs-actions.pod:7956
27785 msgid "(Added in 1.0.55)"
27789 #: ../src/guestfs-actions.pod:2471
27790 msgid "guestfs_get_network"
27794 #: ../src/guestfs-actions.pod:2473
27798 " guestfs_get_network (guestfs_h *g);\n"
27803 #: ../src/guestfs-actions.pod:2480 ../src/guestfs-actions.pod:6951
27804 msgid "(Added in 1.5.4)"
27808 #: ../src/guestfs-actions.pod:2482
27809 msgid "guestfs_get_path"
27813 #: ../src/guestfs-actions.pod:2484
27817 " guestfs_get_path (guestfs_h *g);\n"
27822 #: ../src/guestfs-actions.pod:2492 ../src/guestfs-actions.pod:2532
27824 "This function returns a string, or NULL on error. The string is owned by "
27825 "the guest handle and must I<not> be freed."
27829 #: ../src/guestfs-actions.pod:2497
27830 msgid "guestfs_get_pgroup"
27834 #: ../src/guestfs-actions.pod:2499
27838 " guestfs_get_pgroup (guestfs_h *g);\n"
27843 #: ../src/guestfs-actions.pod:2506 ../src/guestfs-actions.pod:6987 ../src/guestfs-actions.pod:8448
27844 msgid "(Added in 1.11.18)"
27848 #: ../src/guestfs-actions.pod:2508
27849 msgid "guestfs_get_pid"
27853 #: ../src/guestfs-actions.pod:2510
27857 " guestfs_get_pid (guestfs_h *g);\n"
27862 #: ../src/guestfs-actions.pod:2520
27863 msgid "(Added in 1.0.56)"
27867 #: ../src/guestfs-actions.pod:2522
27868 msgid "guestfs_get_qemu"
27872 #: ../src/guestfs-actions.pod:2524
27876 " guestfs_get_qemu (guestfs_h *g);\n"
27881 #: ../src/guestfs-actions.pod:2535 ../src/guestfs-actions.pod:7015
27882 msgid "(Added in 1.0.6)"
27886 #: ../src/guestfs-actions.pod:2537
27887 msgid "guestfs_get_recovery_proc"
27891 #: ../src/guestfs-actions.pod:2539
27895 " guestfs_get_recovery_proc (guestfs_h *g);\n"
27900 #: ../src/guestfs-actions.pod:2546 ../src/guestfs-actions.pod:4130 ../src/guestfs-actions.pod:4474 ../src/guestfs-actions.pod:4868 ../src/guestfs-actions.pod:5059 ../src/guestfs-actions.pod:6254 ../src/guestfs-actions.pod:6597 ../src/guestfs-actions.pod:7039 ../src/guestfs-actions.pod:7737 ../src/guestfs-actions.pod:7757 ../src/guestfs-actions.pod:8071
27901 msgid "(Added in 1.0.77)"
27905 #: ../src/guestfs-actions.pod:2548
27906 msgid "guestfs_get_selinux"
27910 #: ../src/guestfs-actions.pod:2550
27914 " guestfs_get_selinux (guestfs_h *g);\n"
27919 #: ../src/guestfs-actions.pod:2553
27921 "This returns the current setting of the selinux flag which is passed to the "
27922 "appliance at boot time. See C<guestfs_set_selinux>."
27926 #: ../src/guestfs-actions.pod:2561 ../src/guestfs-actions.pod:2635 ../src/guestfs-actions.pod:7058 ../src/guestfs-actions.pod:7132
27927 msgid "(Added in 1.0.67)"
27931 #: ../src/guestfs-actions.pod:2563
27932 msgid "guestfs_get_smp"
27936 #: ../src/guestfs-actions.pod:2565
27940 " guestfs_get_smp (guestfs_h *g);\n"
27945 #: ../src/guestfs-actions.pod:2574
27946 msgid "guestfs_get_state"
27950 #: ../src/guestfs-actions.pod:2576
27954 " guestfs_get_state (guestfs_h *g);\n"
27959 #: ../src/guestfs-actions.pod:2588
27960 msgid "guestfs_get_trace"
27964 #: ../src/guestfs-actions.pod:2590
27968 " guestfs_get_trace (guestfs_h *g);\n"
27973 #: ../src/guestfs-actions.pod:2599
27974 msgid "guestfs_get_umask"
27978 #: ../src/guestfs-actions.pod:2601
27982 " guestfs_get_umask (guestfs_h *g);\n"
27987 #: ../src/guestfs-actions.pod:2604
27989 "Return the current umask. By default the umask is C<022> unless it has been "
27990 "set by calling C<guestfs_umask>."
27994 #: ../src/guestfs-actions.pod:2611
27995 msgid "guestfs_get_verbose"
27999 #: ../src/guestfs-actions.pod:2613
28003 " guestfs_get_verbose (guestfs_h *g);\n"
28008 #: ../src/guestfs-actions.pod:2622
28009 msgid "guestfs_getcon"
28013 #: ../src/guestfs-actions.pod:2624
28017 " guestfs_getcon (guestfs_h *g);\n"
28022 #: ../src/guestfs-actions.pod:2629
28023 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
28027 #: ../src/guestfs-actions.pod:2637
28028 msgid "guestfs_getxattr"
28032 #: ../src/guestfs-actions.pod:2639
28036 " guestfs_getxattr (guestfs_h *g,\n"
28037 " const char *path,\n"
28038 " const char *name,\n"
28039 " size_t *size_r);\n"
28044 #: ../src/guestfs-actions.pod:2645
28046 "Get a single extended attribute from file C<path> named C<name>. This call "
28047 "follows symlinks. If you want to lookup an extended attribute for the "
28048 "symlink itself, use C<guestfs_lgetxattr>."
28052 #: ../src/guestfs-actions.pod:2649 ../src/guestfs-actions.pod:4144
28054 "Normally it is better to get all extended attributes from a file in one go "
28055 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
28056 "implementations are buggy and do not provide a way to list out attributes. "
28057 "For these filesystems (notably ntfs-3g) you have to know the names of the "
28058 "extended attributes you want in advance and call this function."
28062 #: ../src/guestfs-actions.pod:2659
28063 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
28067 #: ../src/guestfs-actions.pod:2661 ../src/guestfs-actions.pod:2874 ../src/guestfs-actions.pod:3356 ../src/guestfs-actions.pod:4156 ../src/guestfs-actions.pod:6247 ../src/guestfs-actions.pod:6273 ../src/guestfs-actions.pod:6454
28069 "This function returns a buffer, or NULL on error. The size of the returned "
28070 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
28075 #: ../src/guestfs-actions.pod:2665 ../src/guestfs-actions.pod:4160
28076 msgid "(Added in 1.7.24)"
28080 #: ../src/guestfs-actions.pod:2667
28081 msgid "guestfs_getxattrs"
28085 #: ../src/guestfs-actions.pod:2669
28088 " struct guestfs_xattr_list *\n"
28089 " guestfs_getxattrs (guestfs_h *g,\n"
28090 " const char *path);\n"
28095 #: ../src/guestfs-actions.pod:2679
28096 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
28100 #: ../src/guestfs-actions.pod:2681 ../src/guestfs-actions.pod:4172 ../src/guestfs-actions.pod:4864
28102 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
28103 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
28107 #: ../src/guestfs-actions.pod:2685 ../src/guestfs-actions.pod:4176 ../src/guestfs-actions.pod:4388 ../src/guestfs-actions.pod:4424 ../src/guestfs-actions.pod:6627 ../src/guestfs-actions.pod:7151 ../src/guestfs-actions.pod:8656
28108 msgid "(Added in 1.0.59)"
28112 #: ../src/guestfs-actions.pod:2687
28113 msgid "guestfs_glob_expand"
28117 #: ../src/guestfs-actions.pod:2689
28121 " guestfs_glob_expand (guestfs_h *g,\n"
28122 " const char *pattern);\n"
28127 #: ../src/guestfs-actions.pod:2708 ../src/guestfs-actions.pod:7335 ../src/guestfs-actions.pod:7352
28128 msgid "(Added in 1.0.50)"
28132 #: ../src/guestfs-actions.pod:2710
28133 msgid "guestfs_grep"
28137 #: ../src/guestfs-actions.pod:2712
28141 " guestfs_grep (guestfs_h *g,\n"
28142 " const char *regex,\n"
28143 " const char *path);\n"
28148 #: ../src/guestfs-actions.pod:2729
28149 msgid "guestfs_grepi"
28153 #: ../src/guestfs-actions.pod:2731
28157 " guestfs_grepi (guestfs_h *g,\n"
28158 " const char *regex,\n"
28159 " const char *path);\n"
28164 #: ../src/guestfs-actions.pod:2748
28165 msgid "guestfs_grub_install"
28169 #: ../src/guestfs-actions.pod:2750
28173 " guestfs_grub_install (guestfs_h *g,\n"
28174 " const char *root,\n"
28175 " const char *device);\n"
28180 #: ../src/guestfs-actions.pod:2793
28181 msgid "(Added in 1.0.17)"
28185 #: ../src/guestfs-actions.pod:2795
28186 msgid "guestfs_head"
28190 #: ../src/guestfs-actions.pod:2797
28194 " guestfs_head (guestfs_h *g,\n"
28195 " const char *path);\n"
28200 #: ../src/guestfs-actions.pod:2813
28201 msgid "guestfs_head_n"
28205 #: ../src/guestfs-actions.pod:2815
28209 " guestfs_head_n (guestfs_h *g,\n"
28211 " const char *path);\n"
28216 #: ../src/guestfs-actions.pod:2837
28217 msgid "guestfs_hexdump"
28221 #: ../src/guestfs-actions.pod:2839
28225 " guestfs_hexdump (guestfs_h *g,\n"
28226 " const char *path);\n"
28231 #: ../src/guestfs-actions.pod:2852 ../src/guestfs-actions.pod:7416 ../src/guestfs-actions.pod:7471
28232 msgid "(Added in 1.0.22)"
28236 #: ../src/guestfs-actions.pod:2854
28237 msgid "guestfs_initrd_cat"
28241 #: ../src/guestfs-actions.pod:2856
28245 " guestfs_initrd_cat (guestfs_h *g,\n"
28246 " const char *initrdpath,\n"
28247 " const char *filename,\n"
28248 " size_t *size_r);\n"
28253 #: ../src/guestfs-actions.pod:2872
28254 msgid "See also C<guestfs_initrd_list>."
28258 #: ../src/guestfs-actions.pod:2883
28259 msgid "guestfs_initrd_list"
28263 #: ../src/guestfs-actions.pod:2885
28267 " guestfs_initrd_list (guestfs_h *g,\n"
28268 " const char *path);\n"
28273 #: ../src/guestfs-actions.pod:2905
28274 msgid "guestfs_inotify_add_watch"
28278 #: ../src/guestfs-actions.pod:2907
28282 " guestfs_inotify_add_watch (guestfs_h *g,\n"
28283 " const char *path,\n"
28289 #: ../src/guestfs-actions.pod:2926
28290 msgid "guestfs_inotify_close"
28294 #: ../src/guestfs-actions.pod:2928
28298 " guestfs_inotify_close (guestfs_h *g);\n"
28303 #: ../src/guestfs-actions.pod:2939
28304 msgid "guestfs_inotify_files"
28308 #: ../src/guestfs-actions.pod:2941
28312 " guestfs_inotify_files (guestfs_h *g);\n"
28317 #: ../src/guestfs-actions.pod:2944
28319 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
28320 "returns a list of pathnames of objects that were touched. The returned "
28321 "pathnames are sorted and deduplicated."
28325 #: ../src/guestfs-actions.pod:2954
28326 msgid "guestfs_inotify_init"
28330 #: ../src/guestfs-actions.pod:2956
28334 " guestfs_inotify_init (guestfs_h *g,\n"
28335 " int maxevents);\n"
28340 #: ../src/guestfs-actions.pod:2964
28342 "C<maxevents> is the maximum number of events which will be queued up between "
28343 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
28344 "passed as C<0>, then the kernel (or previously set) default is used. For "
28345 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
28346 "throws away events, but records the fact that it threw them away by setting "
28347 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
28348 "C<guestfs_inotify_read>)."
28352 #: ../src/guestfs-actions.pod:2974
28354 "Before any events are generated, you have to add some watches to the "
28355 "internal watch list. See: C<guestfs_inotify_add_watch>, "
28356 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
28360 #: ../src/guestfs-actions.pod:2980
28362 "Queued up events should be read periodically by calling "
28363 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
28364 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
28365 "often enough then you risk the internal queue overflowing."
28369 #: ../src/guestfs-actions.pod:2987
28371 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
28372 "This also removes any watches automatically."
28376 #: ../src/guestfs-actions.pod:3000
28377 msgid "guestfs_inotify_read"
28381 #: ../src/guestfs-actions.pod:3002
28384 " struct guestfs_inotify_event_list *\n"
28385 " guestfs_inotify_read (guestfs_h *g);\n"
28390 #: ../src/guestfs-actions.pod:3016
28392 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
28393 "there was an error. I<The caller must call "
28394 "C<guestfs_free_inotify_event_list> after use>."
28398 #: ../src/guestfs-actions.pod:3022
28399 msgid "guestfs_inotify_rm_watch"
28403 #: ../src/guestfs-actions.pod:3024
28407 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
28413 #: ../src/guestfs-actions.pod:3028
28415 "Remove a previously defined inotify watch. See "
28416 "C<guestfs_inotify_add_watch>."
28420 #: ../src/guestfs-actions.pod:3035
28421 msgid "guestfs_inspect_get_arch"
28425 #: ../src/guestfs-actions.pod:3037
28429 " guestfs_inspect_get_arch (guestfs_h *g,\n"
28430 " const char *root);\n"
28435 #: ../src/guestfs-actions.pod:3041
28437 "This returns the architecture of the inspected operating system. The "
28438 "possible return values are listed under C<guestfs_file_architecture>."
28442 #: ../src/guestfs-actions.pod:3055
28443 msgid "guestfs_inspect_get_distro"
28447 #: ../src/guestfs-actions.pod:3057
28451 " guestfs_inspect_get_distro (guestfs_h *g,\n"
28452 " const char *root);\n"
28457 #: ../src/guestfs-actions.pod:3157
28458 msgid "guestfs_inspect_get_drive_mappings"
28462 #: ../src/guestfs-actions.pod:3159
28466 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
28467 " const char *root);\n"
28472 #: ../src/guestfs-actions.pod:3188
28474 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28475 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
28479 #: ../src/guestfs-actions.pod:3192 ../src/guestfs-actions.pod:3460 ../src/guestfs-actions.pod:4263 ../src/guestfs-actions.pod:5002 ../src/guestfs-actions.pod:5698 ../src/guestfs-actions.pod:7895
28481 "This function returns a NULL-terminated array of strings, or NULL if there "
28482 "was an error. The array of strings will always have length C<2n+1>, where "
28483 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
28484 "caller must free the strings and the array after use>."
28488 #: ../src/guestfs-actions.pod:3198 ../src/guestfs-actions.pod:3659
28489 msgid "(Added in 1.9.17)"
28493 #: ../src/guestfs-actions.pod:3200
28494 msgid "guestfs_inspect_get_filesystems"
28498 #: ../src/guestfs-actions.pod:3202
28502 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
28503 " const char *root);\n"
28508 #: ../src/guestfs-actions.pod:3214
28510 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28511 "C<guestfs_inspect_get_mountpoints>."
28515 #: ../src/guestfs-actions.pod:3223
28516 msgid "guestfs_inspect_get_format"
28520 #: ../src/guestfs-actions.pod:3225
28524 " guestfs_inspect_get_format (guestfs_h *g,\n"
28525 " const char *root);\n"
28530 #: ../src/guestfs-actions.pod:3259 ../src/guestfs-actions.pod:3695 ../src/guestfs-actions.pod:3711 ../src/guestfs-actions.pod:3729 ../src/guestfs-actions.pod:6665
28531 msgid "(Added in 1.9.4)"
28535 #: ../src/guestfs-actions.pod:3261
28536 msgid "guestfs_inspect_get_hostname"
28540 #: ../src/guestfs-actions.pod:3263
28544 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
28545 " const char *root);\n"
28550 #: ../src/guestfs-actions.pod:3278
28551 msgid "(Added in 1.7.9)"
28555 #: ../src/guestfs-actions.pod:3280
28556 msgid "guestfs_inspect_get_icon"
28560 #: ../src/guestfs-actions.pod:3282
28564 " guestfs_inspect_get_icon (guestfs_h *g,\n"
28565 " const char *root,\n"
28566 " size_t *size_r,\n"
28572 #: ../src/guestfs-actions.pod:3293
28575 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
28576 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
28581 #: ../src/guestfs-actions.pod:3360 ../src/guestfs-actions.pod:4190 ../src/guestfs-actions.pod:5597
28582 msgid "(Added in 1.11.12)"
28586 #: ../src/guestfs-actions.pod:3362
28587 msgid "guestfs_inspect_get_icon_va"
28591 #: ../src/guestfs-actions.pod:3364
28595 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
28596 " const char *root,\n"
28597 " size_t *size_r,\n"
28598 " va_list args);\n"
28603 #: ../src/guestfs-actions.pod:3370
28604 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
28608 #: ../src/guestfs-actions.pod:3374
28609 msgid "guestfs_inspect_get_icon_argv"
28613 #: ../src/guestfs-actions.pod:3376
28617 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
28618 " const char *root,\n"
28619 " size_t *size_r,\n"
28620 " const struct guestfs_inspect_get_icon_argv "
28626 #: ../src/guestfs-actions.pod:3382
28627 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
28631 #: ../src/guestfs-actions.pod:3386
28632 msgid "guestfs_inspect_get_major_version"
28636 #: ../src/guestfs-actions.pod:3388
28640 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
28641 " const char *root);\n"
28646 #: ../src/guestfs-actions.pod:3410
28647 msgid "guestfs_inspect_get_minor_version"
28651 #: ../src/guestfs-actions.pod:3412
28655 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
28656 " const char *root);\n"
28661 #: ../src/guestfs-actions.pod:3421
28663 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28664 "C<guestfs_inspect_get_major_version>."
28668 #: ../src/guestfs-actions.pod:3428
28669 msgid "guestfs_inspect_get_mountpoints"
28673 #: ../src/guestfs-actions.pod:3430
28677 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
28678 " const char *root);\n"
28683 #: ../src/guestfs-actions.pod:3451
28685 "For operating systems like Windows which still use drive letters, this call "
28686 "will only return an entry for the first drive \"mounted on\" C</>. For "
28687 "information about the mapping of drive letters to partitions, see "
28688 "C<guestfs_inspect_get_drive_mappings>."
28692 #: ../src/guestfs-actions.pod:3457
28694 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28695 "C<guestfs_inspect_get_filesystems>."
28699 #: ../src/guestfs-actions.pod:3468
28700 msgid "guestfs_inspect_get_package_format"
28704 #: ../src/guestfs-actions.pod:3470
28708 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
28709 " const char *root);\n"
28714 #: ../src/guestfs-actions.pod:3474
28716 "This function and C<guestfs_inspect_get_package_management> return the "
28717 "package format and package management tool used by the inspected operating "
28718 "system. For example for Fedora these functions would return C<rpm> (package "
28719 "format) and C<yum> (package management)."
28723 #: ../src/guestfs-actions.pod:3493 ../src/guestfs-actions.pod:3521
28724 msgid "(Added in 1.7.5)"
28728 #: ../src/guestfs-actions.pod:3495
28729 msgid "guestfs_inspect_get_package_management"
28733 #: ../src/guestfs-actions.pod:3497
28737 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
28738 " const char *root);\n"
28743 #: ../src/guestfs-actions.pod:3501
28745 "C<guestfs_inspect_get_package_format> and this function return the package "
28746 "format and package management tool used by the inspected operating system. "
28747 "For example for Fedora these functions would return C<rpm> (package format) "
28748 "and C<yum> (package management)."
28752 #: ../src/guestfs-actions.pod:3523
28753 msgid "guestfs_inspect_get_product_name"
28757 #: ../src/guestfs-actions.pod:3525
28761 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
28762 " const char *root);\n"
28767 #: ../src/guestfs-actions.pod:3544
28768 msgid "guestfs_inspect_get_product_variant"
28772 #: ../src/guestfs-actions.pod:3546
28776 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
28777 " const char *root);\n"
28782 #: ../src/guestfs-actions.pod:3569
28784 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
28785 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
28789 #: ../src/guestfs-actions.pod:3576
28790 msgid "(Added in 1.9.13)"
28794 #: ../src/guestfs-actions.pod:3578
28795 msgid "guestfs_inspect_get_roots"
28799 #: ../src/guestfs-actions.pod:3580
28803 " guestfs_inspect_get_roots (guestfs_h *g);\n"
28808 #: ../src/guestfs-actions.pod:3583
28810 "This function is a convenient way to get the list of root devices, as "
28811 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
28812 "the whole inspection process."
28816 #: ../src/guestfs-actions.pod:3587
28818 "This returns an empty list if either no root devices were found or the "
28819 "caller has not called C<guestfs_inspect_os>."
28823 #: ../src/guestfs-actions.pod:3596
28824 msgid "(Added in 1.7.3)"
28828 #: ../src/guestfs-actions.pod:3598
28829 msgid "guestfs_inspect_get_type"
28833 #: ../src/guestfs-actions.pod:3600
28837 " guestfs_inspect_get_type (guestfs_h *g,\n"
28838 " const char *root);\n"
28843 #: ../src/guestfs-actions.pod:3641
28844 msgid "guestfs_inspect_get_windows_current_control_set"
28848 #: ../src/guestfs-actions.pod:3643
28852 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
28853 " const char *root);\n"
28858 #: ../src/guestfs-actions.pod:3661
28859 msgid "guestfs_inspect_get_windows_systemroot"
28863 #: ../src/guestfs-actions.pod:3663
28867 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
28868 " const char *root);\n"
28873 #: ../src/guestfs-actions.pod:3679
28874 msgid "(Added in 1.5.25)"
28878 #: ../src/guestfs-actions.pod:3681
28879 msgid "guestfs_inspect_is_live"
28883 #: ../src/guestfs-actions.pod:3683
28887 " guestfs_inspect_is_live (guestfs_h *g,\n"
28888 " const char *root);\n"
28893 #: ../src/guestfs-actions.pod:3687
28895 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
28896 "disk), then this returns true if a live image was detected on the disk."
28900 #: ../src/guestfs-actions.pod:3697
28901 msgid "guestfs_inspect_is_multipart"
28905 #: ../src/guestfs-actions.pod:3699
28909 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
28910 " const char *root);\n"
28915 #: ../src/guestfs-actions.pod:3703
28917 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
28918 "disk), then this returns true if the disk is part of a set."
28922 #: ../src/guestfs-actions.pod:3713
28923 msgid "guestfs_inspect_is_netinst"
28927 #: ../src/guestfs-actions.pod:3715
28931 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
28932 " const char *root);\n"
28937 #: ../src/guestfs-actions.pod:3719
28939 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
28940 "disk), then this returns true if the disk is a network installer, ie. not a "
28941 "self-contained install CD but one which is likely to require network access "
28942 "to complete the install."
28946 #: ../src/guestfs-actions.pod:3731
28947 msgid "guestfs_inspect_list_applications"
28951 #: ../src/guestfs-actions.pod:3733
28954 " struct guestfs_application_list *\n"
28955 " guestfs_inspect_list_applications (guestfs_h *g,\n"
28956 " const char *root);\n"
28961 #: ../src/guestfs-actions.pod:3739
28963 "I<Note:> This call works differently from other parts of the inspection "
28964 "API. You have to call C<guestfs_inspect_os>, then "
28965 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
28966 "this. Listing applications is a significantly more difficult operation "
28967 "which requires access to the full filesystem. Also note that unlike the "
28968 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
28969 "the libguestfs handle, this call actually reads parts of the mounted "
28970 "filesystems during the call."
28974 #: ../src/guestfs-actions.pod:3829
28976 "This function returns a C<struct guestfs_application_list *>, or NULL if "
28977 "there was an error. I<The caller must call C<guestfs_free_application_list> "
28982 #: ../src/guestfs-actions.pod:3833
28983 msgid "(Added in 1.7.8)"
28987 #: ../src/guestfs-actions.pod:3835
28988 msgid "guestfs_inspect_os"
28992 #: ../src/guestfs-actions.pod:3837
28996 " guestfs_inspect_os (guestfs_h *g);\n"
29001 #: ../src/guestfs-actions.pod:3853
29003 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
29004 "functions in order to query further information about each operating system, "
29005 "such as the name and version."
29009 #: ../src/guestfs-actions.pod:3858
29011 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
29012 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
29013 "the contents. This should be called with no disks currently mounted. The "
29014 "function may also use Augeas, so any existing Augeas handle will be closed."
29018 #: ../src/guestfs-actions.pod:3870 ../src/guestfs-actions.pod:4201 ../src/guestfs-actions.pod:4296
29019 msgid "See also C<guestfs_list_filesystems>."
29023 #: ../src/guestfs-actions.pod:3878
29024 msgid "guestfs_is_blockdev"
29028 #: ../src/guestfs-actions.pod:3880
29032 " guestfs_is_blockdev (guestfs_h *g,\n"
29033 " const char *path);\n"
29038 #: ../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
29039 msgid "See also C<guestfs_stat>."
29043 #: ../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
29044 msgid "(Added in 1.5.10)"
29048 #: ../src/guestfs-actions.pod:3893
29049 msgid "guestfs_is_busy"
29053 #: ../src/guestfs-actions.pod:3895
29057 " guestfs_is_busy (guestfs_h *g);\n"
29062 #: ../src/guestfs-actions.pod:3907
29063 msgid "guestfs_is_chardev"
29067 #: ../src/guestfs-actions.pod:3909
29071 " guestfs_is_chardev (guestfs_h *g,\n"
29072 " const char *path);\n"
29077 #: ../src/guestfs-actions.pod:3922
29078 msgid "guestfs_is_config"
29082 #: ../src/guestfs-actions.pod:3924
29086 " guestfs_is_config (guestfs_h *g);\n"
29091 #: ../src/guestfs-actions.pod:3936
29092 msgid "guestfs_is_dir"
29096 #: ../src/guestfs-actions.pod:3938
29100 " guestfs_is_dir (guestfs_h *g,\n"
29101 " const char *path);\n"
29106 #: ../src/guestfs-actions.pod:3952
29107 msgid "guestfs_is_fifo"
29111 #: ../src/guestfs-actions.pod:3954
29115 " guestfs_is_fifo (guestfs_h *g,\n"
29116 " const char *path);\n"
29121 #: ../src/guestfs-actions.pod:3967
29122 msgid "guestfs_is_file"
29126 #: ../src/guestfs-actions.pod:3969
29130 " guestfs_is_file (guestfs_h *g,\n"
29131 " const char *path);\n"
29136 #: ../src/guestfs-actions.pod:3983
29137 msgid "guestfs_is_launching"
29141 #: ../src/guestfs-actions.pod:3985
29145 " guestfs_is_launching (guestfs_h *g);\n"
29150 #: ../src/guestfs-actions.pod:3997
29151 msgid "guestfs_is_lv"
29155 #: ../src/guestfs-actions.pod:3999
29159 " guestfs_is_lv (guestfs_h *g,\n"
29160 " const char *device);\n"
29165 #: ../src/guestfs-actions.pod:4010
29166 msgid "guestfs_is_ready"
29170 #: ../src/guestfs-actions.pod:4012
29174 " guestfs_is_ready (guestfs_h *g);\n"
29179 #: ../src/guestfs-actions.pod:4024
29180 msgid "guestfs_is_socket"
29184 #: ../src/guestfs-actions.pod:4026
29188 " guestfs_is_socket (guestfs_h *g,\n"
29189 " const char *path);\n"
29194 #: ../src/guestfs-actions.pod:4039
29195 msgid "guestfs_is_symlink"
29199 #: ../src/guestfs-actions.pod:4041
29203 " guestfs_is_symlink (guestfs_h *g,\n"
29204 " const char *path);\n"
29209 #: ../src/guestfs-actions.pod:4054
29210 msgid "guestfs_is_zero"
29214 #: ../src/guestfs-actions.pod:4056
29218 " guestfs_is_zero (guestfs_h *g,\n"
29219 " const char *path);\n"
29224 #: ../src/guestfs-actions.pod:4065 ../src/guestfs-actions.pod:4079
29225 msgid "(Added in 1.11.8)"
29229 #: ../src/guestfs-actions.pod:4067
29230 msgid "guestfs_is_zero_device"
29234 #: ../src/guestfs-actions.pod:4069
29238 " guestfs_is_zero_device (guestfs_h *g,\n"
29239 " const char *device);\n"
29244 #: ../src/guestfs-actions.pod:4081
29245 msgid "guestfs_kill_subprocess"
29249 #: ../src/guestfs-actions.pod:4083
29253 " guestfs_kill_subprocess (guestfs_h *g);\n"
29258 #: ../src/guestfs-actions.pod:4092
29259 msgid "guestfs_launch"
29263 #: ../src/guestfs-actions.pod:4094
29267 " guestfs_launch (guestfs_h *g);\n"
29272 #: ../src/guestfs-actions.pod:4112
29273 msgid "guestfs_lchown"
29277 #: ../src/guestfs-actions.pod:4114
29281 " guestfs_lchown (guestfs_h *g,\n"
29284 " const char *path);\n"
29289 #: ../src/guestfs-actions.pod:4120
29291 "Change the file owner to C<owner> and group to C<group>. This is like "
29292 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
29293 "changed, not the target."
29297 #: ../src/guestfs-actions.pod:4132
29298 msgid "guestfs_lgetxattr"
29302 #: ../src/guestfs-actions.pod:4134
29306 " guestfs_lgetxattr (guestfs_h *g,\n"
29307 " const char *path,\n"
29308 " const char *name,\n"
29309 " size_t *size_r);\n"
29314 #: ../src/guestfs-actions.pod:4154
29315 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
29319 #: ../src/guestfs-actions.pod:4162
29320 msgid "guestfs_lgetxattrs"
29324 #: ../src/guestfs-actions.pod:4164
29327 " struct guestfs_xattr_list *\n"
29328 " guestfs_lgetxattrs (guestfs_h *g,\n"
29329 " const char *path);\n"
29334 #: ../src/guestfs-actions.pod:4168
29336 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
29337 "then it returns the extended attributes of the link itself."
29341 #: ../src/guestfs-actions.pod:4178
29342 msgid "guestfs_list_9p"
29346 #: ../src/guestfs-actions.pod:4180
29350 " guestfs_list_9p (guestfs_h *g);\n"
29355 #: ../src/guestfs-actions.pod:4192
29356 msgid "guestfs_list_devices"
29360 #: ../src/guestfs-actions.pod:4194
29364 " guestfs_list_devices (guestfs_h *g);\n"
29369 #: ../src/guestfs-actions.pod:4209
29370 msgid "guestfs_list_dm_devices"
29374 #: ../src/guestfs-actions.pod:4211
29378 " guestfs_list_dm_devices (guestfs_h *g);\n"
29383 #: ../src/guestfs-actions.pod:4216
29385 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
29386 "previous call to C<guestfs_luks_open>."
29390 #: ../src/guestfs-actions.pod:4219
29392 "Device mapper devices which correspond to logical volumes are I<not> "
29393 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
29398 #: ../src/guestfs-actions.pod:4227 ../src/guestfs-actions.pod:5836
29399 msgid "(Added in 1.11.15)"
29403 #: ../src/guestfs-actions.pod:4229
29404 msgid "guestfs_list_filesystems"
29408 #: ../src/guestfs-actions.pod:4231
29412 " guestfs_list_filesystems (guestfs_h *g);\n"
29417 #: ../src/guestfs-actions.pod:4251
29419 "This command runs other libguestfs commands, which might include "
29420 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
29421 "soon after launch and only when nothing is mounted."
29425 #: ../src/guestfs-actions.pod:4255
29427 "Not all of the filesystems returned will be mountable. In particular, swap "
29428 "partitions are returned in the list. Also this command does not check that "
29429 "each filesystem found is valid and mountable, and some filesystems might be "
29430 "mountable but require special options. Filesystems may not all belong to a "
29431 "single logical operating system (use C<guestfs_inspect_os> to look for "
29436 #: ../src/guestfs-actions.pod:4269 ../src/guestfs-actions.pod:6196
29437 msgid "(Added in 1.5.15)"
29441 #: ../src/guestfs-actions.pod:4271
29442 msgid "guestfs_list_md_devices"
29446 #: ../src/guestfs-actions.pod:4273
29450 " guestfs_list_md_devices (guestfs_h *g);\n"
29455 #: ../src/guestfs-actions.pod:4282 ../src/guestfs-actions.pod:7857
29456 msgid "(Added in 1.15.4)"
29460 #: ../src/guestfs-actions.pod:4284
29461 msgid "guestfs_list_partitions"
29465 #: ../src/guestfs-actions.pod:4286
29469 " guestfs_list_partitions (guestfs_h *g);\n"
29474 #: ../src/guestfs-actions.pod:4293
29476 "This does not return logical volumes. For that you will need to call "
29481 #: ../src/guestfs-actions.pod:4304
29486 #: ../src/guestfs-actions.pod:4306
29490 " guestfs_ll (guestfs_h *g,\n"
29491 " const char *directory);\n"
29496 #: ../src/guestfs-actions.pod:4321
29501 #: ../src/guestfs-actions.pod:4323
29505 " guestfs_ln (guestfs_h *g,\n"
29506 " const char *target,\n"
29507 " const char *linkname);\n"
29512 #: ../src/guestfs-actions.pod:4334
29513 msgid "guestfs_ln_f"
29517 #: ../src/guestfs-actions.pod:4336
29521 " guestfs_ln_f (guestfs_h *g,\n"
29522 " const char *target,\n"
29523 " const char *linkname);\n"
29528 #: ../src/guestfs-actions.pod:4348
29529 msgid "guestfs_ln_s"
29533 #: ../src/guestfs-actions.pod:4350
29537 " guestfs_ln_s (guestfs_h *g,\n"
29538 " const char *target,\n"
29539 " const char *linkname);\n"
29544 #: ../src/guestfs-actions.pod:4361
29545 msgid "guestfs_ln_sf"
29549 #: ../src/guestfs-actions.pod:4363
29553 " guestfs_ln_sf (guestfs_h *g,\n"
29554 " const char *target,\n"
29555 " const char *linkname);\n"
29560 #: ../src/guestfs-actions.pod:4375
29561 msgid "guestfs_lremovexattr"
29565 #: ../src/guestfs-actions.pod:4377
29569 " guestfs_lremovexattr (guestfs_h *g,\n"
29570 " const char *xattr,\n"
29571 " const char *path);\n"
29576 #: ../src/guestfs-actions.pod:4382
29578 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
29579 "link, then it removes an extended attribute of the link itself."
29583 #: ../src/guestfs-actions.pod:4390
29588 #: ../src/guestfs-actions.pod:4392
29592 " guestfs_ls (guestfs_h *g,\n"
29593 " const char *directory);\n"
29598 #: ../src/guestfs-actions.pod:4400
29600 "This command is mostly useful for interactive sessions. Programs should "
29601 "probably use C<guestfs_readdir> instead."
29605 #: ../src/guestfs-actions.pod:4409
29606 msgid "guestfs_lsetxattr"
29610 #: ../src/guestfs-actions.pod:4411
29614 " guestfs_lsetxattr (guestfs_h *g,\n"
29615 " const char *xattr,\n"
29616 " const char *val,\n"
29618 " const char *path);\n"
29623 #: ../src/guestfs-actions.pod:4418
29625 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
29626 "then it sets an extended attribute of the link itself."
29630 #: ../src/guestfs-actions.pod:4426
29631 msgid "guestfs_lstat"
29635 #: ../src/guestfs-actions.pod:4428
29638 " struct guestfs_stat *\n"
29639 " guestfs_lstat (guestfs_h *g,\n"
29640 " const char *path);\n"
29645 #: ../src/guestfs-actions.pod:4434
29647 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
29648 "link, then the link is stat-ed, not the file it refers to."
29652 #: ../src/guestfs-actions.pod:4440 ../src/guestfs-actions.pod:7376
29654 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
29655 "error. I<The caller must call C<guestfs_free_stat> after use>."
29659 #: ../src/guestfs-actions.pod:4444 ../src/guestfs-actions.pod:7380 ../src/guestfs-actions.pod:7398 ../src/guestfs-actions.pod:7901
29660 msgid "(Added in 0.9.2)"
29664 #: ../src/guestfs-actions.pod:4446
29665 msgid "guestfs_lstatlist"
29669 #: ../src/guestfs-actions.pod:4448
29672 " struct guestfs_stat_list *\n"
29673 " guestfs_lstatlist (guestfs_h *g,\n"
29674 " const char *path,\n"
29675 " char *const *names);\n"
29680 #: ../src/guestfs-actions.pod:4453
29682 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
29683 "files, where all files are in the directory C<path>. C<names> is the list "
29684 "of files from this directory."
29688 #: ../src/guestfs-actions.pod:4462
29690 "This call is intended for programs that want to efficiently list a directory "
29691 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
29692 "for a similarly efficient call for getting extended attributes. Very long "
29693 "directory listings might cause the protocol message size to be exceeded, "
29694 "causing this call to fail. The caller must split up such requests into "
29695 "smaller groups of names."
29699 #: ../src/guestfs-actions.pod:4470
29701 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
29702 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
29706 #: ../src/guestfs-actions.pod:4476
29707 msgid "guestfs_luks_add_key"
29711 #: ../src/guestfs-actions.pod:4478
29715 " guestfs_luks_add_key (guestfs_h *g,\n"
29716 " const char *device,\n"
29717 " const char *key,\n"
29718 " const char *newkey,\n"
29724 #: ../src/guestfs-actions.pod:4490
29726 "Note that if C<keyslot> already contains a key, then this command will "
29727 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
29731 #: ../src/guestfs-actions.pod:4496 ../src/guestfs-actions.pod:4533 ../src/guestfs-actions.pod:4553 ../src/guestfs-actions.pod:4573 ../src/guestfs-actions.pod:4608 ../src/guestfs-actions.pod:4627
29733 "This function takes a key or passphrase parameter which could contain "
29734 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
29739 #: ../src/guestfs-actions.pod:4500 ../src/guestfs-actions.pod:4537 ../src/guestfs-actions.pod:4557 ../src/guestfs-actions.pod:4577
29740 msgid "(Added in 1.5.2)"
29744 #: ../src/guestfs-actions.pod:4502
29745 msgid "guestfs_luks_close"
29749 #: ../src/guestfs-actions.pod:4504
29753 " guestfs_luks_close (guestfs_h *g,\n"
29754 " const char *device);\n"
29759 #: ../src/guestfs-actions.pod:4508
29761 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
29762 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
29763 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
29764 "underlying block device."
29768 #: ../src/guestfs-actions.pod:4516 ../src/guestfs-actions.pod:4612 ../src/guestfs-actions.pod:4631 ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:4726
29769 msgid "(Added in 1.5.1)"
29773 #: ../src/guestfs-actions.pod:4518
29774 msgid "guestfs_luks_format"
29778 #: ../src/guestfs-actions.pod:4520
29782 " guestfs_luks_format (guestfs_h *g,\n"
29783 " const char *device,\n"
29784 " const char *key,\n"
29790 #: ../src/guestfs-actions.pod:4539
29791 msgid "guestfs_luks_format_cipher"
29795 #: ../src/guestfs-actions.pod:4541
29799 " guestfs_luks_format_cipher (guestfs_h *g,\n"
29800 " const char *device,\n"
29801 " const char *key,\n"
29803 " const char *cipher);\n"
29808 #: ../src/guestfs-actions.pod:4548
29810 "This command is the same as C<guestfs_luks_format> but it also allows you to "
29811 "set the C<cipher> used."
29815 #: ../src/guestfs-actions.pod:4559
29816 msgid "guestfs_luks_kill_slot"
29820 #: ../src/guestfs-actions.pod:4561
29824 " guestfs_luks_kill_slot (guestfs_h *g,\n"
29825 " const char *device,\n"
29826 " const char *key,\n"
29832 #: ../src/guestfs-actions.pod:4579
29833 msgid "guestfs_luks_open"
29837 #: ../src/guestfs-actions.pod:4581
29841 " guestfs_luks_open (guestfs_h *g,\n"
29842 " const char *device,\n"
29843 " const char *key,\n"
29844 " const char *mapname);\n"
29849 #: ../src/guestfs-actions.pod:4599
29851 "If this block device contains LVM volume groups, then calling "
29852 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
29857 #: ../src/guestfs-actions.pod:4603
29858 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
29862 #: ../src/guestfs-actions.pod:4614
29863 msgid "guestfs_luks_open_ro"
29867 #: ../src/guestfs-actions.pod:4616
29871 " guestfs_luks_open_ro (guestfs_h *g,\n"
29872 " const char *device,\n"
29873 " const char *key,\n"
29874 " const char *mapname);\n"
29879 #: ../src/guestfs-actions.pod:4622
29881 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
29886 #: ../src/guestfs-actions.pod:4633
29887 msgid "guestfs_lvcreate"
29891 #: ../src/guestfs-actions.pod:4635
29895 " guestfs_lvcreate (guestfs_h *g,\n"
29896 " const char *logvol,\n"
29897 " const char *volgroup,\n"
29903 #: ../src/guestfs-actions.pod:4648
29904 msgid "guestfs_lvm_canonical_lv_name"
29908 #: ../src/guestfs-actions.pod:4650
29912 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
29913 " const char *lvname);\n"
29918 #: ../src/guestfs-actions.pod:4661
29919 msgid "See also C<guestfs_is_lv>."
29923 #: ../src/guestfs-actions.pod:4666
29924 msgid "(Added in 1.5.24)"
29928 #: ../src/guestfs-actions.pod:4668
29929 msgid "guestfs_lvm_clear_filter"
29933 #: ../src/guestfs-actions.pod:4670
29937 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
29942 #: ../src/guestfs-actions.pod:4673
29944 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
29945 "see every block device."
29949 #: ../src/guestfs-actions.pod:4683
29950 msgid "guestfs_lvm_remove_all"
29954 #: ../src/guestfs-actions.pod:4685
29958 " guestfs_lvm_remove_all (guestfs_h *g);\n"
29963 #: ../src/guestfs-actions.pod:4695
29964 msgid "guestfs_lvm_set_filter"
29968 #: ../src/guestfs-actions.pod:4697
29972 " guestfs_lvm_set_filter (guestfs_h *g,\n"
29973 " char *const *devices);\n"
29978 #: ../src/guestfs-actions.pod:4728
29979 msgid "guestfs_lvremove"
29983 #: ../src/guestfs-actions.pod:4730
29987 " guestfs_lvremove (guestfs_h *g,\n"
29988 " const char *device);\n"
29993 #: ../src/guestfs-actions.pod:4742 ../src/guestfs-actions.pod:6311 ../src/guestfs-actions.pod:8271
29994 msgid "(Added in 1.0.13)"
29998 #: ../src/guestfs-actions.pod:4744
29999 msgid "guestfs_lvrename"
30003 #: ../src/guestfs-actions.pod:4746
30007 " guestfs_lvrename (guestfs_h *g,\n"
30008 " const char *logvol,\n"
30009 " const char *newlogvol);\n"
30014 #: ../src/guestfs-actions.pod:4755 ../src/guestfs-actions.pod:8284
30015 msgid "(Added in 1.0.83)"
30019 #: ../src/guestfs-actions.pod:4757
30020 msgid "guestfs_lvresize"
30024 #: ../src/guestfs-actions.pod:4759
30028 " guestfs_lvresize (guestfs_h *g,\n"
30029 " const char *device,\n"
30035 #: ../src/guestfs-actions.pod:4772
30036 msgid "guestfs_lvresize_free"
30040 #: ../src/guestfs-actions.pod:4774
30044 " guestfs_lvresize_free (guestfs_h *g,\n"
30045 " const char *lv,\n"
30051 #: ../src/guestfs-actions.pod:4787
30052 msgid "(Added in 1.3.3)"
30056 #: ../src/guestfs-actions.pod:4789
30057 msgid "guestfs_lvs"
30061 #: ../src/guestfs-actions.pod:4791
30065 " guestfs_lvs (guestfs_h *g);\n"
30070 #: ../src/guestfs-actions.pod:4800
30071 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
30075 #: ../src/guestfs-actions.pod:4808
30076 msgid "guestfs_lvs_full"
30080 #: ../src/guestfs-actions.pod:4810
30083 " struct guestfs_lvm_lv_list *\n"
30084 " guestfs_lvs_full (guestfs_h *g);\n"
30089 #: ../src/guestfs-actions.pod:4816
30091 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
30092 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
30097 #: ../src/guestfs-actions.pod:4822
30098 msgid "guestfs_lvuuid"
30102 #: ../src/guestfs-actions.pod:4824
30106 " guestfs_lvuuid (guestfs_h *g,\n"
30107 " const char *device);\n"
30112 #: ../src/guestfs-actions.pod:4835
30113 msgid "guestfs_lxattrlist"
30117 #: ../src/guestfs-actions.pod:4837
30120 " struct guestfs_xattr_list *\n"
30121 " guestfs_lxattrlist (guestfs_h *g,\n"
30122 " const char *path,\n"
30123 " char *const *names);\n"
30128 #: ../src/guestfs-actions.pod:4856
30130 "This call is intended for programs that want to efficiently list a directory "
30131 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
30132 "a similarly efficient call for getting standard stats. Very long directory "
30133 "listings might cause the protocol message size to be exceeded, causing this "
30134 "call to fail. The caller must split up such requests into smaller groups of "
30139 #: ../src/guestfs-actions.pod:4870
30140 msgid "guestfs_md_create"
30144 #: ../src/guestfs-actions.pod:4872
30148 " guestfs_md_create (guestfs_h *g,\n"
30149 " const char *name,\n"
30150 " char *const *devices,\n"
30156 #: ../src/guestfs-actions.pod:4883
30159 " GUESTFS_MD_CREATE_MISSINGBITMAP, int64_t missingbitmap,\n"
30160 " GUESTFS_MD_CREATE_NRDEVICES, int nrdevices,\n"
30161 " GUESTFS_MD_CREATE_SPARE, int spare,\n"
30162 " GUESTFS_MD_CREATE_CHUNK, int64_t chunk,\n"
30163 " GUESTFS_MD_CREATE_LEVEL, const char *level,\n"
30168 #: ../src/guestfs-actions.pod:4945
30169 msgid "guestfs_md_create_va"
30173 #: ../src/guestfs-actions.pod:4947
30177 " guestfs_md_create_va (guestfs_h *g,\n"
30178 " const char *name,\n"
30179 " char *const *devices,\n"
30180 " va_list args);\n"
30185 #: ../src/guestfs-actions.pod:4953
30186 msgid "This is the \"va_list variant\" of L</guestfs_md_create>."
30190 #: ../src/guestfs-actions.pod:4957
30191 msgid "guestfs_md_create_argv"
30195 #: ../src/guestfs-actions.pod:4959
30199 " guestfs_md_create_argv (guestfs_h *g,\n"
30200 " const char *name,\n"
30201 " char *const *devices,\n"
30202 " const struct guestfs_md_create_argv *optargs);\n"
30207 #: ../src/guestfs-actions.pod:4965
30208 msgid "This is the \"argv variant\" of L</guestfs_md_create>."
30212 #: ../src/guestfs-actions.pod:4969
30213 msgid "guestfs_md_detail"
30217 #: ../src/guestfs-actions.pod:4971
30221 " guestfs_md_detail (guestfs_h *g,\n"
30222 " const char *md);\n"
30227 #: ../src/guestfs-actions.pod:5008
30228 msgid "guestfs_md_stop"
30232 #: ../src/guestfs-actions.pod:5010
30236 " guestfs_md_stop (guestfs_h *g,\n"
30237 " const char *md);\n"
30242 #: ../src/guestfs-actions.pod:5029
30243 msgid "guestfs_mkdir"
30247 #: ../src/guestfs-actions.pod:5031
30251 " guestfs_mkdir (guestfs_h *g,\n"
30252 " const char *path);\n"
30257 #: ../src/guestfs-actions.pod:5041
30258 msgid "guestfs_mkdir_mode"
30262 #: ../src/guestfs-actions.pod:5043
30266 " guestfs_mkdir_mode (guestfs_h *g,\n"
30267 " const char *path,\n"
30273 #: ../src/guestfs-actions.pod:5055
30274 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
30278 #: ../src/guestfs-actions.pod:5061
30279 msgid "guestfs_mkdir_p"
30283 #: ../src/guestfs-actions.pod:5063
30287 " guestfs_mkdir_p (guestfs_h *g,\n"
30288 " const char *path);\n"
30293 #: ../src/guestfs-actions.pod:5074
30294 msgid "guestfs_mkdtemp"
30298 #: ../src/guestfs-actions.pod:5076
30302 " guestfs_mkdtemp (guestfs_h *g,\n"
30303 " const char *template);\n"
30308 #: ../src/guestfs-actions.pod:5104
30309 msgid "guestfs_mke2fs_J"
30313 #: ../src/guestfs-actions.pod:5106
30317 " guestfs_mke2fs_J (guestfs_h *g,\n"
30318 " const char *fstype,\n"
30319 " int blocksize,\n"
30320 " const char *device,\n"
30321 " const char *journal);\n"
30326 #: ../src/guestfs-actions.pod:5119
30327 msgid "See also C<guestfs_mke2journal>."
30331 #: ../src/guestfs-actions.pod:5123 ../src/guestfs-actions.pod:5141 ../src/guestfs-actions.pod:5159 ../src/guestfs-actions.pod:5175 ../src/guestfs-actions.pod:5189 ../src/guestfs-actions.pod:5203 ../src/guestfs-actions.pod:5262 ../src/guestfs-actions.pod:5539
30332 msgid "(Added in 1.0.68)"
30336 #: ../src/guestfs-actions.pod:5125
30337 msgid "guestfs_mke2fs_JL"
30341 #: ../src/guestfs-actions.pod:5127
30345 " guestfs_mke2fs_JL (guestfs_h *g,\n"
30346 " const char *fstype,\n"
30347 " int blocksize,\n"
30348 " const char *device,\n"
30349 " const char *label);\n"
30354 #: ../src/guestfs-actions.pod:5137
30355 msgid "See also C<guestfs_mke2journal_L>."
30359 #: ../src/guestfs-actions.pod:5143
30360 msgid "guestfs_mke2fs_JU"
30364 #: ../src/guestfs-actions.pod:5145
30368 " guestfs_mke2fs_JU (guestfs_h *g,\n"
30369 " const char *fstype,\n"
30370 " int blocksize,\n"
30371 " const char *device,\n"
30372 " const char *uuid);\n"
30377 #: ../src/guestfs-actions.pod:5155
30378 msgid "See also C<guestfs_mke2journal_U>."
30382 #: ../src/guestfs-actions.pod:5161
30383 msgid "guestfs_mke2journal"
30387 #: ../src/guestfs-actions.pod:5163
30391 " guestfs_mke2journal (guestfs_h *g,\n"
30392 " int blocksize,\n"
30393 " const char *device);\n"
30398 #: ../src/guestfs-actions.pod:5177
30399 msgid "guestfs_mke2journal_L"
30403 #: ../src/guestfs-actions.pod:5179
30407 " guestfs_mke2journal_L (guestfs_h *g,\n"
30408 " int blocksize,\n"
30409 " const char *label,\n"
30410 " const char *device);\n"
30415 #: ../src/guestfs-actions.pod:5191
30416 msgid "guestfs_mke2journal_U"
30420 #: ../src/guestfs-actions.pod:5193
30424 " guestfs_mke2journal_U (guestfs_h *g,\n"
30425 " int blocksize,\n"
30426 " const char *uuid,\n"
30427 " const char *device);\n"
30432 #: ../src/guestfs-actions.pod:5205
30433 msgid "guestfs_mkfifo"
30437 #: ../src/guestfs-actions.pod:5207
30441 " guestfs_mkfifo (guestfs_h *g,\n"
30443 " const char *path);\n"
30448 #: ../src/guestfs-actions.pod:5212
30450 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
30451 "is just a convenient wrapper around C<guestfs_mknod>."
30455 #: ../src/guestfs-actions.pod:5222
30456 msgid "guestfs_mkfs"
30460 #: ../src/guestfs-actions.pod:5224
30464 " guestfs_mkfs (guestfs_h *g,\n"
30465 " const char *fstype,\n"
30466 " const char *device);\n"
30471 #: ../src/guestfs-actions.pod:5237
30472 msgid "guestfs_mkfs_b"
30476 #: ../src/guestfs-actions.pod:5239
30480 " guestfs_mkfs_b (guestfs_h *g,\n"
30481 " const char *fstype,\n"
30482 " int blocksize,\n"
30483 " const char *device);\n"
30488 #: ../src/guestfs-actions.pod:5245
30490 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
30495 #: ../src/guestfs-actions.pod:5252
30497 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
30498 "block size of the resulting filesystem. Supported block sizes depend on the "
30499 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
30503 #: ../src/guestfs-actions.pod:5264
30504 msgid "guestfs_mkfs_opts"
30508 #: ../src/guestfs-actions.pod:5266
30512 " guestfs_mkfs_opts (guestfs_h *g,\n"
30513 " const char *fstype,\n"
30514 " const char *device,\n"
30520 #: ../src/guestfs-actions.pod:5277
30523 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
30524 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
30525 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
30526 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
30531 #: ../src/guestfs-actions.pod:5325
30532 msgid "(Added in 1.7.19)"
30536 #: ../src/guestfs-actions.pod:5327
30537 msgid "guestfs_mkfs_opts_va"
30541 #: ../src/guestfs-actions.pod:5329
30545 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
30546 " const char *fstype,\n"
30547 " const char *device,\n"
30548 " va_list args);\n"
30553 #: ../src/guestfs-actions.pod:5335
30554 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
30558 #: ../src/guestfs-actions.pod:5339
30559 msgid "guestfs_mkfs_opts_argv"
30563 #: ../src/guestfs-actions.pod:5341
30567 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
30568 " const char *fstype,\n"
30569 " const char *device,\n"
30570 " const struct guestfs_mkfs_opts_argv *optargs);\n"
30575 #: ../src/guestfs-actions.pod:5347
30576 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
30580 #: ../src/guestfs-actions.pod:5351
30581 msgid "guestfs_mkmountpoint"
30585 #: ../src/guestfs-actions.pod:5353
30589 " guestfs_mkmountpoint (guestfs_h *g,\n"
30590 " const char *exemptpath);\n"
30595 #: ../src/guestfs-actions.pod:5357
30597 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
30598 "that can be used to create extra mountpoints before mounting the first "
30603 #: ../src/guestfs-actions.pod:5381
30605 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
30606 "may get unexpected errors if you try to mix these calls. It is safest to "
30607 "manually unmount filesystems and remove mountpoints after use."
30611 #: ../src/guestfs-actions.pod:5385
30613 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
30614 "first, so for this to work for manual mountpoints, you must ensure that the "
30615 "innermost mountpoints have the longest pathnames, as in the example code "
30620 #: ../src/guestfs-actions.pod:5392
30622 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
30623 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
30624 "can also trigger these issues."
30628 #: ../src/guestfs-actions.pod:5398 ../src/guestfs-actions.pod:5704 ../src/guestfs-actions.pod:6731
30629 msgid "(Added in 1.0.62)"
30633 #: ../src/guestfs-actions.pod:5400
30634 msgid "guestfs_mknod"
30638 #: ../src/guestfs-actions.pod:5402
30642 " guestfs_mknod (guestfs_h *g,\n"
30646 " const char *path);\n"
30651 #: ../src/guestfs-actions.pod:5417
30653 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
30654 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
30655 "regular file). These constants are available in the standard Linux header "
30656 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
30657 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
30658 "the appropriate constant for you."
30662 #: ../src/guestfs-actions.pod:5431
30663 msgid "guestfs_mknod_b"
30667 #: ../src/guestfs-actions.pod:5433
30671 " guestfs_mknod_b (guestfs_h *g,\n"
30675 " const char *path);\n"
30680 #: ../src/guestfs-actions.pod:5440
30682 "This call creates a block device node called C<path> with mode C<mode> and "
30683 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
30684 "wrapper around C<guestfs_mknod>."
30688 #: ../src/guestfs-actions.pod:5450
30689 msgid "guestfs_mknod_c"
30693 #: ../src/guestfs-actions.pod:5452
30697 " guestfs_mknod_c (guestfs_h *g,\n"
30701 " const char *path);\n"
30706 #: ../src/guestfs-actions.pod:5459
30708 "This call creates a char device node called C<path> with mode C<mode> and "
30709 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
30710 "wrapper around C<guestfs_mknod>."
30714 #: ../src/guestfs-actions.pod:5469
30715 msgid "guestfs_mkswap"
30719 #: ../src/guestfs-actions.pod:5471
30723 " guestfs_mkswap (guestfs_h *g,\n"
30724 " const char *device);\n"
30729 #: ../src/guestfs-actions.pod:5481
30730 msgid "guestfs_mkswap_L"
30734 #: ../src/guestfs-actions.pod:5483
30738 " guestfs_mkswap_L (guestfs_h *g,\n"
30739 " const char *label,\n"
30740 " const char *device);\n"
30745 #: ../src/guestfs-actions.pod:5498
30746 msgid "guestfs_mkswap_U"
30750 #: ../src/guestfs-actions.pod:5500
30754 " guestfs_mkswap_U (guestfs_h *g,\n"
30755 " const char *uuid,\n"
30756 " const char *device);\n"
30761 #: ../src/guestfs-actions.pod:5511
30762 msgid "guestfs_mkswap_file"
30766 #: ../src/guestfs-actions.pod:5513
30770 " guestfs_mkswap_file (guestfs_h *g,\n"
30771 " const char *path);\n"
30776 #: ../src/guestfs-actions.pod:5519
30778 "This command just writes a swap file signature to an existing file. To "
30779 "create the file itself, use something like C<guestfs_fallocate>."
30783 #: ../src/guestfs-actions.pod:5526
30784 msgid "guestfs_modprobe"
30788 #: ../src/guestfs-actions.pod:5528
30792 " guestfs_modprobe (guestfs_h *g,\n"
30793 " const char *modulename);\n"
30798 #: ../src/guestfs-actions.pod:5541
30799 msgid "guestfs_mount"
30803 #: ../src/guestfs-actions.pod:5543
30807 " guestfs_mount (guestfs_h *g,\n"
30808 " const char *device,\n"
30809 " const char *mountpoint);\n"
30814 #: ../src/guestfs-actions.pod:5562
30816 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
30817 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
30818 "problems for users. If your program might need to work with older versions "
30819 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
30820 "for the first parameter if you don't want any options)."
30824 #: ../src/guestfs-actions.pod:5573
30825 msgid "guestfs_mount_9p"
30829 #: ../src/guestfs-actions.pod:5575
30833 " guestfs_mount_9p (guestfs_h *g,\n"
30834 " const char *mounttag,\n"
30835 " const char *mountpoint,\n"
30841 #: ../src/guestfs-actions.pod:5586
30844 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
30849 #: ../src/guestfs-actions.pod:5599
30850 msgid "guestfs_mount_9p_va"
30854 #: ../src/guestfs-actions.pod:5601
30858 " guestfs_mount_9p_va (guestfs_h *g,\n"
30859 " const char *mounttag,\n"
30860 " const char *mountpoint,\n"
30861 " va_list args);\n"
30866 #: ../src/guestfs-actions.pod:5607
30867 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
30871 #: ../src/guestfs-actions.pod:5611
30872 msgid "guestfs_mount_9p_argv"
30876 #: ../src/guestfs-actions.pod:5613
30880 " guestfs_mount_9p_argv (guestfs_h *g,\n"
30881 " const char *mounttag,\n"
30882 " const char *mountpoint,\n"
30883 " const struct guestfs_mount_9p_argv *optargs);\n"
30888 #: ../src/guestfs-actions.pod:5619
30889 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
30893 #: ../src/guestfs-actions.pod:5623
30894 msgid "guestfs_mount_loop"
30898 #: ../src/guestfs-actions.pod:5625
30902 " guestfs_mount_loop (guestfs_h *g,\n"
30903 " const char *file,\n"
30904 " const char *mountpoint);\n"
30909 #: ../src/guestfs-actions.pod:5638
30910 msgid "guestfs_mount_options"
30914 #: ../src/guestfs-actions.pod:5640
30918 " guestfs_mount_options (guestfs_h *g,\n"
30919 " const char *options,\n"
30920 " const char *device,\n"
30921 " const char *mountpoint);\n"
30926 #: ../src/guestfs-actions.pod:5646
30928 "This is the same as the C<guestfs_mount> command, but it allows you to set "
30929 "the mount options as for the L<mount(8)> I<-o> flag."
30933 #: ../src/guestfs-actions.pod:5656 ../src/guestfs-actions.pod:5670 ../src/guestfs-actions.pod:5687
30934 msgid "(Added in 1.0.10)"
30938 #: ../src/guestfs-actions.pod:5658
30939 msgid "guestfs_mount_ro"
30943 #: ../src/guestfs-actions.pod:5660
30947 " guestfs_mount_ro (guestfs_h *g,\n"
30948 " const char *device,\n"
30949 " const char *mountpoint);\n"
30954 #: ../src/guestfs-actions.pod:5665
30956 "This is the same as the C<guestfs_mount> command, but it mounts the "
30957 "filesystem with the read-only (I<-o ro>) flag."
30961 #: ../src/guestfs-actions.pod:5672
30962 msgid "guestfs_mount_vfs"
30966 #: ../src/guestfs-actions.pod:5674
30970 " guestfs_mount_vfs (guestfs_h *g,\n"
30971 " const char *options,\n"
30972 " const char *vfstype,\n"
30973 " const char *device,\n"
30974 " const char *mountpoint);\n"
30979 #: ../src/guestfs-actions.pod:5681
30981 "This is the same as the C<guestfs_mount> command, but it allows you to set "
30982 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
30987 #: ../src/guestfs-actions.pod:5689
30988 msgid "guestfs_mountpoints"
30992 #: ../src/guestfs-actions.pod:5691
30996 " guestfs_mountpoints (guestfs_h *g);\n"
31001 #: ../src/guestfs-actions.pod:5694
31003 "This call is similar to C<guestfs_mounts>. That call returns a list of "
31004 "devices. This one returns a hash table (map) of device name to directory "
31005 "where the device is mounted."
31009 #: ../src/guestfs-actions.pod:5706
31010 msgid "guestfs_mounts"
31014 #: ../src/guestfs-actions.pod:5708
31018 " guestfs_mounts (guestfs_h *g);\n"
31023 #: ../src/guestfs-actions.pod:5716
31024 msgid "See also: C<guestfs_mountpoints>"
31028 #: ../src/guestfs-actions.pod:5724
31033 #: ../src/guestfs-actions.pod:5726
31037 " guestfs_mv (guestfs_h *g,\n"
31038 " const char *src,\n"
31039 " const char *dest);\n"
31044 #: ../src/guestfs-actions.pod:5738
31045 msgid "guestfs_ntfs_3g_probe"
31049 #: ../src/guestfs-actions.pod:5740
31053 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
31055 " const char *device);\n"
31060 #: ../src/guestfs-actions.pod:5759
31061 msgid "(Added in 1.0.43)"
31065 #: ../src/guestfs-actions.pod:5761
31066 msgid "guestfs_ntfsresize"
31070 #: ../src/guestfs-actions.pod:5763
31074 " guestfs_ntfsresize (guestfs_h *g,\n"
31075 " const char *device);\n"
31080 #: ../src/guestfs-actions.pod:5767 ../src/guestfs-actions.pod:5867
31082 "I<This function is deprecated.> In new code, use the "
31083 "L</guestfs_ntfsresize_opts> call instead."
31087 #: ../src/guestfs-actions.pod:5791
31088 msgid "guestfs_ntfsresize_opts"
31092 #: ../src/guestfs-actions.pod:5793
31096 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
31097 " const char *device,\n"
31103 #: ../src/guestfs-actions.pod:5803
31106 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
31107 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
31112 #: ../src/guestfs-actions.pod:5823
31114 "After the resize operation, the filesystem is always marked as requiring a "
31115 "consistency check (for safety). You have to boot into Windows to perform "
31116 "this check and clear this condition. If you I<don't> set the C<force> "
31117 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
31118 "times on a single filesystem without booting into Windows between each "
31123 #: ../src/guestfs-actions.pod:5838
31124 msgid "guestfs_ntfsresize_opts_va"
31128 #: ../src/guestfs-actions.pod:5840
31132 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
31133 " const char *device,\n"
31134 " va_list args);\n"
31139 #: ../src/guestfs-actions.pod:5845
31140 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
31144 #: ../src/guestfs-actions.pod:5849
31145 msgid "guestfs_ntfsresize_opts_argv"
31149 #: ../src/guestfs-actions.pod:5851
31153 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
31154 " const char *device,\n"
31155 " const struct guestfs_ntfsresize_opts_argv "
31161 #: ../src/guestfs-actions.pod:5856
31162 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
31166 #: ../src/guestfs-actions.pod:5860
31167 msgid "guestfs_ntfsresize_size"
31171 #: ../src/guestfs-actions.pod:5862
31175 " guestfs_ntfsresize_size (guestfs_h *g,\n"
31176 " const char *device,\n"
31177 " int64_t size);\n"
31182 #: ../src/guestfs-actions.pod:5874
31184 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
31185 "to specify the new size (in bytes) explicitly."
31189 #: ../src/guestfs-actions.pod:5879 ../src/guestfs-actions.pod:6338 ../src/guestfs-actions.pod:6411 ../src/guestfs-actions.pod:6679 ../src/guestfs-actions.pod:8428
31190 msgid "(Added in 1.3.14)"
31194 #: ../src/guestfs-actions.pod:5881
31195 msgid "guestfs_part_add"
31199 #: ../src/guestfs-actions.pod:5883
31203 " guestfs_part_add (guestfs_h *g,\n"
31204 " const char *device,\n"
31205 " const char *prlogex,\n"
31206 " int64_t startsect,\n"
31207 " int64_t endsect);\n"
31212 #: ../src/guestfs-actions.pod:5890
31214 "This command adds a partition to C<device>. If there is no partition table "
31215 "on the device, call C<guestfs_part_init> first."
31219 #: ../src/guestfs-actions.pod:5902
31221 "Creating a partition which covers the whole disk is not so easy. Use "
31222 "C<guestfs_part_disk> to do that."
31226 #: ../src/guestfs-actions.pod:5907 ../src/guestfs-actions.pod:5942 ../src/guestfs-actions.pod:5995 ../src/guestfs-actions.pod:6079 ../src/guestfs-actions.pod:6117 ../src/guestfs-actions.pod:6136 ../src/guestfs-actions.pod:6176
31227 msgid "(Added in 1.0.78)"
31231 #: ../src/guestfs-actions.pod:5909
31232 msgid "guestfs_part_del"
31236 #: ../src/guestfs-actions.pod:5911
31240 " guestfs_part_del (guestfs_h *g,\n"
31241 " const char *device,\n"
31247 #: ../src/guestfs-actions.pod:5926
31248 msgid "guestfs_part_disk"
31252 #: ../src/guestfs-actions.pod:5928
31256 " guestfs_part_disk (guestfs_h *g,\n"
31257 " const char *device,\n"
31258 " const char *parttype);\n"
31263 #: ../src/guestfs-actions.pod:5933
31265 "This command is simply a combination of C<guestfs_part_init> followed by "
31266 "C<guestfs_part_add> to create a single primary partition covering the whole "
31271 #: ../src/guestfs-actions.pod:5937
31273 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
31274 "possible values are described in C<guestfs_part_init>."
31278 #: ../src/guestfs-actions.pod:5944
31279 msgid "guestfs_part_get_bootable"
31283 #: ../src/guestfs-actions.pod:5946
31287 " guestfs_part_get_bootable (guestfs_h *g,\n"
31288 " const char *device,\n"
31294 #: ../src/guestfs-actions.pod:5954
31295 msgid "See also C<guestfs_part_set_bootable>."
31299 #: ../src/guestfs-actions.pod:5960
31300 msgid "guestfs_part_get_mbr_id"
31304 #: ../src/guestfs-actions.pod:5962
31308 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
31309 " const char *device,\n"
31315 #: ../src/guestfs-actions.pod:5970 ../src/guestfs-actions.pod:6152
31317 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
31318 "undefined results for other partition table types (see "
31319 "C<guestfs_part_get_parttype>)."
31323 #: ../src/guestfs-actions.pod:5978
31324 msgid "guestfs_part_get_parttype"
31328 #: ../src/guestfs-actions.pod:5980
31332 " guestfs_part_get_parttype (guestfs_h *g,\n"
31333 " const char *device);\n"
31338 #: ../src/guestfs-actions.pod:5987
31340 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
31341 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
31342 "possible, although unusual. See C<guestfs_part_init> for a full list."
31346 #: ../src/guestfs-actions.pod:5997
31347 msgid "guestfs_part_init"
31351 #: ../src/guestfs-actions.pod:5999
31355 " guestfs_part_init (guestfs_h *g,\n"
31356 " const char *device,\n"
31357 " const char *parttype);\n"
31362 #: ../src/guestfs-actions.pod:6008
31364 "Initially there are no partitions. Following this, you should call "
31365 "C<guestfs_part_add> for each partition required."
31369 #: ../src/guestfs-actions.pod:6081
31370 msgid "guestfs_part_list"
31374 #: ../src/guestfs-actions.pod:6083
31377 " struct guestfs_partition_list *\n"
31378 " guestfs_part_list (guestfs_h *g,\n"
31379 " const char *device);\n"
31384 #: ../src/guestfs-actions.pod:6100
31386 "Start of the partition I<in bytes>. To get sectors you have to divide by "
31387 "the device's sector size, see C<guestfs_blockdev_getss>."
31391 #: ../src/guestfs-actions.pod:6113
31393 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
31394 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
31399 #: ../src/guestfs-actions.pod:6119
31400 msgid "guestfs_part_set_bootable"
31404 #: ../src/guestfs-actions.pod:6121
31408 " guestfs_part_set_bootable (guestfs_h *g,\n"
31409 " const char *device,\n"
31411 " int bootable);\n"
31416 #: ../src/guestfs-actions.pod:6138
31417 msgid "guestfs_part_set_mbr_id"
31421 #: ../src/guestfs-actions.pod:6140
31425 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
31426 " const char *device,\n"
31433 #: ../src/guestfs-actions.pod:6160
31434 msgid "guestfs_part_set_name"
31438 #: ../src/guestfs-actions.pod:6162
31442 " guestfs_part_set_name (guestfs_h *g,\n"
31443 " const char *device,\n"
31445 " const char *name);\n"
31450 #: ../src/guestfs-actions.pod:6178
31451 msgid "guestfs_part_to_dev"
31455 #: ../src/guestfs-actions.pod:6180
31459 " guestfs_part_to_dev (guestfs_h *g,\n"
31460 " const char *partition);\n"
31465 #: ../src/guestfs-actions.pod:6188 ../src/guestfs-actions.pod:6207
31467 "The named partition must exist, for example as a string returned from "
31468 "C<guestfs_list_partitions>."
31472 #: ../src/guestfs-actions.pod:6191
31473 msgid "See also C<guestfs_part_to_partnum>."
31477 #: ../src/guestfs-actions.pod:6198
31478 msgid "guestfs_part_to_partnum"
31482 #: ../src/guestfs-actions.pod:6200
31486 " guestfs_part_to_partnum (guestfs_h *g,\n"
31487 " const char *partition);\n"
31492 #: ../src/guestfs-actions.pod:6210
31493 msgid "See also C<guestfs_part_to_dev>."
31497 #: ../src/guestfs-actions.pod:6216
31498 msgid "guestfs_ping_daemon"
31502 #: ../src/guestfs-actions.pod:6218
31506 " guestfs_ping_daemon (guestfs_h *g);\n"
31511 #: ../src/guestfs-actions.pod:6230
31512 msgid "guestfs_pread"
31516 #: ../src/guestfs-actions.pod:6232
31520 " guestfs_pread (guestfs_h *g,\n"
31521 " const char *path,\n"
31523 " int64_t offset,\n"
31524 " size_t *size_r);\n"
31529 #: ../src/guestfs-actions.pod:6245
31530 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
31534 #: ../src/guestfs-actions.pod:6256
31535 msgid "guestfs_pread_device"
31539 #: ../src/guestfs-actions.pod:6258
31543 " guestfs_pread_device (guestfs_h *g,\n"
31544 " const char *device,\n"
31546 " int64_t offset,\n"
31547 " size_t *size_r);\n"
31552 #: ../src/guestfs-actions.pod:6271
31553 msgid "See also C<guestfs_pread>."
31557 #: ../src/guestfs-actions.pod:6280
31558 msgid "(Added in 1.5.21)"
31562 #: ../src/guestfs-actions.pod:6282
31563 msgid "guestfs_pvcreate"
31567 #: ../src/guestfs-actions.pod:6284
31571 " guestfs_pvcreate (guestfs_h *g,\n"
31572 " const char *device);\n"
31577 #: ../src/guestfs-actions.pod:6296
31578 msgid "guestfs_pvremove"
31582 #: ../src/guestfs-actions.pod:6298
31586 " guestfs_pvremove (guestfs_h *g,\n"
31587 " const char *device);\n"
31592 #: ../src/guestfs-actions.pod:6313
31593 msgid "guestfs_pvresize"
31597 #: ../src/guestfs-actions.pod:6315
31601 " guestfs_pvresize (guestfs_h *g,\n"
31602 " const char *device);\n"
31607 #: ../src/guestfs-actions.pod:6326
31608 msgid "guestfs_pvresize_size"
31612 #: ../src/guestfs-actions.pod:6328
31616 " guestfs_pvresize_size (guestfs_h *g,\n"
31617 " const char *device,\n"
31618 " int64_t size);\n"
31623 #: ../src/guestfs-actions.pod:6333
31625 "This command is the same as C<guestfs_pvresize> except that it allows you to "
31626 "specify the new size (in bytes) explicitly."
31630 #: ../src/guestfs-actions.pod:6340
31631 msgid "guestfs_pvs"
31635 #: ../src/guestfs-actions.pod:6342
31639 " guestfs_pvs (guestfs_h *g);\n"
31644 #: ../src/guestfs-actions.pod:6351
31645 msgid "See also C<guestfs_pvs_full>."
31649 #: ../src/guestfs-actions.pod:6359
31650 msgid "guestfs_pvs_full"
31654 #: ../src/guestfs-actions.pod:6361
31657 " struct guestfs_lvm_pv_list *\n"
31658 " guestfs_pvs_full (guestfs_h *g);\n"
31663 #: ../src/guestfs-actions.pod:6367
31665 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
31666 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
31671 #: ../src/guestfs-actions.pod:6373
31672 msgid "guestfs_pvuuid"
31676 #: ../src/guestfs-actions.pod:6375
31680 " guestfs_pvuuid (guestfs_h *g,\n"
31681 " const char *device);\n"
31686 #: ../src/guestfs-actions.pod:6386
31687 msgid "guestfs_pwrite"
31691 #: ../src/guestfs-actions.pod:6388
31695 " guestfs_pwrite (guestfs_h *g,\n"
31696 " const char *path,\n"
31697 " const char *content,\n"
31698 " size_t content_size,\n"
31699 " int64_t offset);\n"
31704 #: ../src/guestfs-actions.pod:6404
31705 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
31709 #: ../src/guestfs-actions.pod:6413
31710 msgid "guestfs_pwrite_device"
31714 #: ../src/guestfs-actions.pod:6415
31718 " guestfs_pwrite_device (guestfs_h *g,\n"
31719 " const char *device,\n"
31720 " const char *content,\n"
31721 " size_t content_size,\n"
31722 " int64_t offset);\n"
31727 #: ../src/guestfs-actions.pod:6430
31728 msgid "See also C<guestfs_pwrite>."
31732 #: ../src/guestfs-actions.pod:6437
31733 msgid "(Added in 1.5.20)"
31737 #: ../src/guestfs-actions.pod:6439
31738 msgid "guestfs_read_file"
31742 #: ../src/guestfs-actions.pod:6441
31746 " guestfs_read_file (guestfs_h *g,\n"
31747 " const char *path,\n"
31748 " size_t *size_r);\n"
31753 #: ../src/guestfs-actions.pod:6449
31755 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
31756 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
31757 "function is limited in the total size of file that can be handled."
31761 #: ../src/guestfs-actions.pod:6461
31762 msgid "(Added in 1.0.63)"
31766 #: ../src/guestfs-actions.pod:6463
31767 msgid "guestfs_read_lines"
31771 #: ../src/guestfs-actions.pod:6465
31775 " guestfs_read_lines (guestfs_h *g,\n"
31776 " const char *path);\n"
31781 #: ../src/guestfs-actions.pod:6474
31783 "Note that this function cannot correctly handle binary files (specifically, "
31784 "files containing C<\\0> character which is treated as end of line). For "
31785 "those you need to use the C<guestfs_read_file> function which has a more "
31786 "complex interface."
31790 #: ../src/guestfs-actions.pod:6485
31791 msgid "guestfs_readdir"
31795 #: ../src/guestfs-actions.pod:6487
31798 " struct guestfs_dirent_list *\n"
31799 " guestfs_readdir (guestfs_h *g,\n"
31800 " const char *dir);\n"
31805 #: ../src/guestfs-actions.pod:6541
31807 "This function is primarily intended for use by programs. To get a simple "
31808 "list of names, use C<guestfs_ls>. To get a printable directory for human "
31809 "consumption, use C<guestfs_ll>."
31813 #: ../src/guestfs-actions.pod:6545
31815 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
31816 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
31821 #: ../src/guestfs-actions.pod:6551
31822 msgid "guestfs_readlink"
31826 #: ../src/guestfs-actions.pod:6553
31830 " guestfs_readlink (guestfs_h *g,\n"
31831 " const char *path);\n"
31836 #: ../src/guestfs-actions.pod:6564
31837 msgid "guestfs_readlinklist"
31841 #: ../src/guestfs-actions.pod:6566
31845 " guestfs_readlinklist (guestfs_h *g,\n"
31846 " const char *path,\n"
31847 " char *const *names);\n"
31852 #: ../src/guestfs-actions.pod:6599
31853 msgid "guestfs_realpath"
31857 #: ../src/guestfs-actions.pod:6601
31861 " guestfs_realpath (guestfs_h *g,\n"
31862 " const char *path);\n"
31867 #: ../src/guestfs-actions.pod:6613
31868 msgid "guestfs_removexattr"
31872 #: ../src/guestfs-actions.pod:6615
31876 " guestfs_removexattr (guestfs_h *g,\n"
31877 " const char *xattr,\n"
31878 " const char *path);\n"
31883 #: ../src/guestfs-actions.pod:6623
31884 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
31888 #: ../src/guestfs-actions.pod:6629
31889 msgid "guestfs_resize2fs"
31893 #: ../src/guestfs-actions.pod:6631
31897 " guestfs_resize2fs (guestfs_h *g,\n"
31898 " const char *device);\n"
31903 #: ../src/guestfs-actions.pod:6638
31905 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
31906 "C<device> before calling this command. For unknown reasons C<resize2fs> "
31907 "sometimes gives an error about this and sometimes not. In any case, it is "
31908 "always safe to call C<guestfs_e2fsck_f> before calling this function."
31912 #: ../src/guestfs-actions.pod:6648
31913 msgid "guestfs_resize2fs_M"
31917 #: ../src/guestfs-actions.pod:6650
31921 " guestfs_resize2fs_M (guestfs_h *g,\n"
31922 " const char *device);\n"
31927 #: ../src/guestfs-actions.pod:6654
31929 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
31930 "resized to its minimum size. This works like the I<-M> option to the "
31931 "C<resize2fs> command."
31935 #: ../src/guestfs-actions.pod:6658
31937 "To get the resulting size of the filesystem you should call "
31938 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
31939 "These two numbers, multiplied together, give the resulting size of the "
31940 "minimal filesystem in bytes."
31944 #: ../src/guestfs-actions.pod:6667
31945 msgid "guestfs_resize2fs_size"
31949 #: ../src/guestfs-actions.pod:6669
31953 " guestfs_resize2fs_size (guestfs_h *g,\n"
31954 " const char *device,\n"
31955 " int64_t size);\n"
31960 #: ../src/guestfs-actions.pod:6674
31962 "This command is the same as C<guestfs_resize2fs> except that it allows you "
31963 "to specify the new size (in bytes) explicitly."
31967 #: ../src/guestfs-actions.pod:6681
31972 #: ../src/guestfs-actions.pod:6683
31976 " guestfs_rm (guestfs_h *g,\n"
31977 " const char *path);\n"
31982 #: ../src/guestfs-actions.pod:6693
31983 msgid "guestfs_rm_rf"
31987 #: ../src/guestfs-actions.pod:6695
31991 " guestfs_rm_rf (guestfs_h *g,\n"
31992 " const char *path);\n"
31997 #: ../src/guestfs-actions.pod:6707
31998 msgid "guestfs_rmdir"
32002 #: ../src/guestfs-actions.pod:6709
32006 " guestfs_rmdir (guestfs_h *g,\n"
32007 " const char *path);\n"
32012 #: ../src/guestfs-actions.pod:6719
32013 msgid "guestfs_rmmountpoint"
32017 #: ../src/guestfs-actions.pod:6721
32021 " guestfs_rmmountpoint (guestfs_h *g,\n"
32022 " const char *exemptpath);\n"
32027 #: ../src/guestfs-actions.pod:6725
32029 "This calls removes a mountpoint that was previously created with "
32030 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
32034 #: ../src/guestfs-actions.pod:6733
32035 msgid "guestfs_scrub_device"
32039 #: ../src/guestfs-actions.pod:6735
32043 " guestfs_scrub_device (guestfs_h *g,\n"
32044 " const char *device);\n"
32049 #: ../src/guestfs-actions.pod:6747 ../src/guestfs-actions.pod:6765 ../src/guestfs-actions.pod:6784
32050 msgid "(Added in 1.0.52)"
32054 #: ../src/guestfs-actions.pod:6749
32055 msgid "guestfs_scrub_file"
32059 #: ../src/guestfs-actions.pod:6751
32063 " guestfs_scrub_file (guestfs_h *g,\n"
32064 " const char *file);\n"
32069 #: ../src/guestfs-actions.pod:6767
32070 msgid "guestfs_scrub_freespace"
32074 #: ../src/guestfs-actions.pod:6769
32078 " guestfs_scrub_freespace (guestfs_h *g,\n"
32079 " const char *dir);\n"
32084 #: ../src/guestfs-actions.pod:6773
32086 "This command creates the directory C<dir> and then fills it with files until "
32087 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
32088 "and deletes them. The intention is to scrub any free space on the partition "
32089 "containing C<dir>."
32093 #: ../src/guestfs-actions.pod:6786
32094 msgid "guestfs_set_append"
32098 #: ../src/guestfs-actions.pod:6788
32102 " guestfs_set_append (guestfs_h *g,\n"
32103 " const char *append);\n"
32108 #: ../src/guestfs-actions.pod:6805
32109 msgid "guestfs_set_attach_method"
32113 #: ../src/guestfs-actions.pod:6807
32117 " guestfs_set_attach_method (guestfs_h *g,\n"
32118 " const char *attachmethod);\n"
32123 #: ../src/guestfs-actions.pod:6835
32124 msgid "guestfs_set_autosync"
32128 #: ../src/guestfs-actions.pod:6837
32132 " guestfs_set_autosync (guestfs_h *g,\n"
32133 " int autosync);\n"
32138 #: ../src/guestfs-actions.pod:6853
32139 msgid "guestfs_set_direct"
32143 #: ../src/guestfs-actions.pod:6855
32147 " guestfs_set_direct (guestfs_h *g,\n"
32153 #: ../src/guestfs-actions.pod:6863
32155 "One consequence of this is that log messages aren't caught by the library "
32156 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
32161 #: ../src/guestfs-actions.pod:6876
32162 msgid "guestfs_set_e2label"
32166 #: ../src/guestfs-actions.pod:6878
32170 " guestfs_set_e2label (guestfs_h *g,\n"
32171 " const char *device,\n"
32172 " const char *label);\n"
32177 #: ../src/guestfs-actions.pod:6887
32179 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
32180 "the existing label on a filesystem."
32184 #: ../src/guestfs-actions.pod:6894
32185 msgid "guestfs_set_e2uuid"
32189 #: ../src/guestfs-actions.pod:6896
32193 " guestfs_set_e2uuid (guestfs_h *g,\n"
32194 " const char *device,\n"
32195 " const char *uuid);\n"
32200 #: ../src/guestfs-actions.pod:6906
32202 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
32203 "the existing UUID of a filesystem."
32207 #: ../src/guestfs-actions.pod:6913
32208 msgid "guestfs_set_memsize"
32212 #: ../src/guestfs-actions.pod:6915
32216 " guestfs_set_memsize (guestfs_h *g,\n"
32222 #: ../src/guestfs-actions.pod:6919
32224 "This sets the memory size in megabytes allocated to the qemu subprocess. "
32225 "This only has any effect if called before C<guestfs_launch>."
32229 #: ../src/guestfs-actions.pod:6934
32230 msgid "guestfs_set_network"
32234 #: ../src/guestfs-actions.pod:6936
32238 " guestfs_set_network (guestfs_h *g,\n"
32244 #: ../src/guestfs-actions.pod:6946
32246 "You must call this before calling C<guestfs_launch>, otherwise it has no "
32251 #: ../src/guestfs-actions.pod:6953
32252 msgid "guestfs_set_path"
32256 #: ../src/guestfs-actions.pod:6955
32260 " guestfs_set_path (guestfs_h *g,\n"
32261 " const char *searchpath);\n"
32266 #: ../src/guestfs-actions.pod:6970
32267 msgid "guestfs_set_pgroup"
32271 #: ../src/guestfs-actions.pod:6972
32275 " guestfs_set_pgroup (guestfs_h *g,\n"
32281 #: ../src/guestfs-actions.pod:6989
32282 msgid "guestfs_set_qemu"
32286 #: ../src/guestfs-actions.pod:6991
32290 " guestfs_set_qemu (guestfs_h *g,\n"
32291 " const char *qemu);\n"
32296 #: ../src/guestfs-actions.pod:7017
32297 msgid "guestfs_set_recovery_proc"
32301 #: ../src/guestfs-actions.pod:7019
32305 " guestfs_set_recovery_proc (guestfs_h *g,\n"
32306 " int recoveryproc);\n"
32311 #: ../src/guestfs-actions.pod:7023
32313 "If this is called with the parameter C<false> then C<guestfs_launch> does "
32314 "not create a recovery process. The purpose of the recovery process is to "
32315 "stop runaway qemu processes in the case where the main program aborts "
32320 #: ../src/guestfs-actions.pod:7028
32322 "This only has any effect if called before C<guestfs_launch>, and the default "
32327 #: ../src/guestfs-actions.pod:7041
32328 msgid "guestfs_set_selinux"
32332 #: ../src/guestfs-actions.pod:7043
32336 " guestfs_set_selinux (guestfs_h *g,\n"
32342 #: ../src/guestfs-actions.pod:7060
32343 msgid "guestfs_set_smp"
32347 #: ../src/guestfs-actions.pod:7062
32351 " guestfs_set_smp (guestfs_h *g,\n"
32357 #: ../src/guestfs-actions.pod:7070
32358 msgid "This function must be called before C<guestfs_launch>."
32362 #: ../src/guestfs-actions.pod:7076
32363 msgid "guestfs_set_trace"
32367 #: ../src/guestfs-actions.pod:7078
32371 " guestfs_set_trace (guestfs_h *g,\n"
32377 #: ../src/guestfs-actions.pod:7092
32379 "Trace messages are normally sent to C<stderr>, unless you register a "
32380 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
32384 #: ../src/guestfs-actions.pod:7100
32385 msgid "guestfs_set_verbose"
32389 #: ../src/guestfs-actions.pod:7102
32393 " guestfs_set_verbose (guestfs_h *g,\n"
32399 #: ../src/guestfs-actions.pod:7111
32401 "Verbose messages are normally sent to C<stderr>, unless you register a "
32402 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
32406 #: ../src/guestfs-actions.pod:7119
32407 msgid "guestfs_setcon"
32411 #: ../src/guestfs-actions.pod:7121
32415 " guestfs_setcon (guestfs_h *g,\n"
32416 " const char *context);\n"
32421 #: ../src/guestfs-actions.pod:7134
32422 msgid "guestfs_setxattr"
32426 #: ../src/guestfs-actions.pod:7136
32430 " guestfs_setxattr (guestfs_h *g,\n"
32431 " const char *xattr,\n"
32432 " const char *val,\n"
32434 " const char *path);\n"
32439 #: ../src/guestfs-actions.pod:7147
32440 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
32444 #: ../src/guestfs-actions.pod:7153
32445 msgid "guestfs_sfdisk"
32449 #: ../src/guestfs-actions.pod:7155
32453 " guestfs_sfdisk (guestfs_h *g,\n"
32454 " const char *device,\n"
32458 " char *const *lines);\n"
32463 #: ../src/guestfs-actions.pod:7163 ../src/guestfs-actions.pod:7204 ../src/guestfs-actions.pod:7235
32465 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
32470 #: ../src/guestfs-actions.pod:7190
32471 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
32475 #: ../src/guestfs-actions.pod:7197
32476 msgid "guestfs_sfdiskM"
32480 #: ../src/guestfs-actions.pod:7199
32484 " guestfs_sfdiskM (guestfs_h *g,\n"
32485 " const char *device,\n"
32486 " char *const *lines);\n"
32491 #: ../src/guestfs-actions.pod:7211
32493 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
32494 "partition sizes are specified in megabytes only (rounded to the nearest "
32495 "cylinder) and you don't need to specify the cyls, heads and sectors "
32496 "parameters which were rarely if ever used anyway."
32500 #: ../src/guestfs-actions.pod:7217
32502 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
32503 "C<guestfs_part_disk>"
32507 #: ../src/guestfs-actions.pod:7224
32508 msgid "guestfs_sfdisk_N"
32512 #: ../src/guestfs-actions.pod:7226
32516 " guestfs_sfdisk_N (guestfs_h *g,\n"
32517 " const char *device,\n"
32522 " const char *line);\n"
32527 #: ../src/guestfs-actions.pod:7245
32529 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
32530 "for the cyls/heads/sectors parameters."
32534 #: ../src/guestfs-actions.pod:7248
32535 msgid "See also: C<guestfs_part_add>"
32539 #: ../src/guestfs-actions.pod:7254
32540 msgid "guestfs_sfdisk_disk_geometry"
32544 #: ../src/guestfs-actions.pod:7256
32548 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
32549 " const char *device);\n"
32554 #: ../src/guestfs-actions.pod:7260
32556 "This displays the disk geometry of C<device> read from the partition table. "
32557 "Especially in the case where the underlying block device has been resized, "
32558 "this can be different from the kernel's idea of the geometry (see "
32559 "C<guestfs_sfdisk_kernel_geometry>)."
32563 #: ../src/guestfs-actions.pod:7273
32564 msgid "guestfs_sfdisk_kernel_geometry"
32568 #: ../src/guestfs-actions.pod:7275
32572 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
32573 " const char *device);\n"
32578 #: ../src/guestfs-actions.pod:7289
32579 msgid "guestfs_sfdisk_l"
32583 #: ../src/guestfs-actions.pod:7291
32587 " guestfs_sfdisk_l (guestfs_h *g,\n"
32588 " const char *device);\n"
32593 #: ../src/guestfs-actions.pod:7295
32595 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
32600 #: ../src/guestfs-actions.pod:7306
32601 msgid "See also: C<guestfs_part_list>"
32605 #: ../src/guestfs-actions.pod:7313
32610 #: ../src/guestfs-actions.pod:7315
32614 " guestfs_sh (guestfs_h *g,\n"
32615 " const char *command);\n"
32620 #: ../src/guestfs-actions.pod:7322
32621 msgid "This is like C<guestfs_command>, but passes the command to:"
32625 #: ../src/guestfs-actions.pod:7330
32626 msgid "All the provisos about C<guestfs_command> apply to this call."
32630 #: ../src/guestfs-actions.pod:7337
32631 msgid "guestfs_sh_lines"
32635 #: ../src/guestfs-actions.pod:7339
32639 " guestfs_sh_lines (guestfs_h *g,\n"
32640 " const char *command);\n"
32645 #: ../src/guestfs-actions.pod:7343
32647 "This is the same as C<guestfs_sh>, but splits the result into a list of "
32652 #: ../src/guestfs-actions.pod:7346
32653 msgid "See also: C<guestfs_command_lines>"
32657 #: ../src/guestfs-actions.pod:7354
32658 msgid "guestfs_sleep"
32662 #: ../src/guestfs-actions.pod:7356
32666 " guestfs_sleep (guestfs_h *g,\n"
32672 #: ../src/guestfs-actions.pod:7364
32673 msgid "(Added in 1.0.41)"
32677 #: ../src/guestfs-actions.pod:7366 ../src/guestfs-structs.pod:109
32678 msgid "guestfs_stat"
32682 #: ../src/guestfs-actions.pod:7368
32685 " struct guestfs_stat *\n"
32686 " guestfs_stat (guestfs_h *g,\n"
32687 " const char *path);\n"
32692 #: ../src/guestfs-actions.pod:7382 ../src/guestfs-structs.pod:135
32693 msgid "guestfs_statvfs"
32697 #: ../src/guestfs-actions.pod:7384
32700 " struct guestfs_statvfs *\n"
32701 " guestfs_statvfs (guestfs_h *g,\n"
32702 " const char *path);\n"
32707 #: ../src/guestfs-actions.pod:7394
32709 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
32710 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
32714 #: ../src/guestfs-actions.pod:7400
32715 msgid "guestfs_strings"
32719 #: ../src/guestfs-actions.pod:7402
32723 " guestfs_strings (guestfs_h *g,\n"
32724 " const char *path);\n"
32729 #: ../src/guestfs-actions.pod:7418
32730 msgid "guestfs_strings_e"
32734 #: ../src/guestfs-actions.pod:7420
32738 " guestfs_strings_e (guestfs_h *g,\n"
32739 " const char *encoding,\n"
32740 " const char *path);\n"
32745 #: ../src/guestfs-actions.pod:7425
32747 "This is like the C<guestfs_strings> command, but allows you to specify the "
32748 "encoding of strings that are looked for in the source file C<path>."
32752 #: ../src/guestfs-actions.pod:7435
32754 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
32755 "ISO-8859-X (this is what C<guestfs_strings> uses)."
32759 #: ../src/guestfs-actions.pod:7473
32760 msgid "guestfs_swapoff_device"
32764 #: ../src/guestfs-actions.pod:7475
32768 " guestfs_swapoff_device (guestfs_h *g,\n"
32769 " const char *device);\n"
32774 #: ../src/guestfs-actions.pod:7479
32776 "This command disables the libguestfs appliance swap device or partition "
32777 "named C<device>. See C<guestfs_swapon_device>."
32781 #: ../src/guestfs-actions.pod:7487
32782 msgid "guestfs_swapoff_file"
32786 #: ../src/guestfs-actions.pod:7489
32790 " guestfs_swapoff_file (guestfs_h *g,\n"
32791 " const char *file);\n"
32796 #: ../src/guestfs-actions.pod:7499
32797 msgid "guestfs_swapoff_label"
32801 #: ../src/guestfs-actions.pod:7501
32805 " guestfs_swapoff_label (guestfs_h *g,\n"
32806 " const char *label);\n"
32811 #: ../src/guestfs-actions.pod:7512
32812 msgid "guestfs_swapoff_uuid"
32816 #: ../src/guestfs-actions.pod:7514
32820 " guestfs_swapoff_uuid (guestfs_h *g,\n"
32821 " const char *uuid);\n"
32826 #: ../src/guestfs-actions.pod:7525
32827 msgid "guestfs_swapon_device"
32831 #: ../src/guestfs-actions.pod:7527
32835 " guestfs_swapon_device (guestfs_h *g,\n"
32836 " const char *device);\n"
32841 #: ../src/guestfs-actions.pod:7531
32843 "This command enables the libguestfs appliance to use the swap device or "
32844 "partition named C<device>. The increased memory is made available for all "
32845 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
32849 #: ../src/guestfs-actions.pod:7547
32850 msgid "guestfs_swapon_file"
32854 #: ../src/guestfs-actions.pod:7549
32858 " guestfs_swapon_file (guestfs_h *g,\n"
32859 " const char *file);\n"
32864 #: ../src/guestfs-actions.pod:7553
32866 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
32871 #: ../src/guestfs-actions.pod:7560
32872 msgid "guestfs_swapon_label"
32876 #: ../src/guestfs-actions.pod:7562
32880 " guestfs_swapon_label (guestfs_h *g,\n"
32881 " const char *label);\n"
32886 #: ../src/guestfs-actions.pod:7566
32888 "This command enables swap to a labeled swap partition. See "
32889 "C<guestfs_swapon_device> for other notes."
32893 #: ../src/guestfs-actions.pod:7573
32894 msgid "guestfs_swapon_uuid"
32898 #: ../src/guestfs-actions.pod:7575
32902 " guestfs_swapon_uuid (guestfs_h *g,\n"
32903 " const char *uuid);\n"
32908 #: ../src/guestfs-actions.pod:7579
32910 "This command enables swap to a swap partition with the given UUID. See "
32911 "C<guestfs_swapon_device> for other notes."
32915 #: ../src/guestfs-actions.pod:7586
32916 msgid "guestfs_sync"
32920 #: ../src/guestfs-actions.pod:7588
32924 " guestfs_sync (guestfs_h *g);\n"
32929 #: ../src/guestfs-actions.pod:7601
32930 msgid "guestfs_tail"
32934 #: ../src/guestfs-actions.pod:7603
32938 " guestfs_tail (guestfs_h *g,\n"
32939 " const char *path);\n"
32944 #: ../src/guestfs-actions.pod:7619
32945 msgid "guestfs_tail_n"
32949 #: ../src/guestfs-actions.pod:7621
32953 " guestfs_tail_n (guestfs_h *g,\n"
32955 " const char *path);\n"
32960 #: ../src/guestfs-actions.pod:7643
32961 msgid "guestfs_tar_in"
32965 #: ../src/guestfs-actions.pod:7645
32969 " guestfs_tar_in (guestfs_h *g,\n"
32970 " const char *tarfile,\n"
32971 " const char *directory);\n"
32976 #: ../src/guestfs-actions.pod:7653
32977 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
32981 #: ../src/guestfs-actions.pod:7658 ../src/guestfs-actions.pod:7675 ../src/guestfs-actions.pod:7691 ../src/guestfs-actions.pod:7707
32982 msgid "(Added in 1.0.3)"
32986 #: ../src/guestfs-actions.pod:7660
32987 msgid "guestfs_tar_out"
32991 #: ../src/guestfs-actions.pod:7662
32995 " guestfs_tar_out (guestfs_h *g,\n"
32996 " const char *directory,\n"
32997 " const char *tarfile);\n"
33002 #: ../src/guestfs-actions.pod:7670
33004 "To download a compressed tarball, use C<guestfs_tgz_out> or "
33005 "C<guestfs_txz_out>."
33009 #: ../src/guestfs-actions.pod:7677
33010 msgid "guestfs_tgz_in"
33014 #: ../src/guestfs-actions.pod:7679
33018 " guestfs_tgz_in (guestfs_h *g,\n"
33019 " const char *tarball,\n"
33020 " const char *directory);\n"
33025 #: ../src/guestfs-actions.pod:7687
33026 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
33030 #: ../src/guestfs-actions.pod:7693
33031 msgid "guestfs_tgz_out"
33035 #: ../src/guestfs-actions.pod:7695
33039 " guestfs_tgz_out (guestfs_h *g,\n"
33040 " const char *directory,\n"
33041 " const char *tarball);\n"
33046 #: ../src/guestfs-actions.pod:7703
33047 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
33051 #: ../src/guestfs-actions.pod:7709
33052 msgid "guestfs_touch"
33056 #: ../src/guestfs-actions.pod:7711
33060 " guestfs_touch (guestfs_h *g,\n"
33061 " const char *path);\n"
33066 #: ../src/guestfs-actions.pod:7726
33067 msgid "guestfs_truncate"
33071 #: ../src/guestfs-actions.pod:7728
33075 " guestfs_truncate (guestfs_h *g,\n"
33076 " const char *path);\n"
33081 #: ../src/guestfs-actions.pod:7739
33082 msgid "guestfs_truncate_size"
33086 #: ../src/guestfs-actions.pod:7741
33090 " guestfs_truncate_size (guestfs_h *g,\n"
33091 " const char *path,\n"
33092 " int64_t size);\n"
33097 #: ../src/guestfs-actions.pod:7749
33099 "If the current file size is less than C<size> then the file is extended to "
33100 "the required size with zero bytes. This creates a sparse file (ie. disk "
33101 "blocks are not allocated for the file until you write to it). To create a "
33102 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
33106 #: ../src/guestfs-actions.pod:7759
33107 msgid "guestfs_tune2fs"
33111 #: ../src/guestfs-actions.pod:7761
33115 " guestfs_tune2fs (guestfs_h *g,\n"
33116 " const char *device,\n"
33122 #: ../src/guestfs-actions.pod:7771
33125 " GUESTFS_TUNE2FS_FORCE, int force,\n"
33126 " GUESTFS_TUNE2FS_MAXMOUNTCOUNT, int maxmountcount,\n"
33127 " GUESTFS_TUNE2FS_MOUNTCOUNT, int mountcount,\n"
33128 " GUESTFS_TUNE2FS_ERRORBEHAVIOR, const char *errorbehavior,\n"
33129 " GUESTFS_TUNE2FS_GROUP, int64_t group,\n"
33130 " GUESTFS_TUNE2FS_INTERVALBETWEENCHECKS, int intervalbetweenchecks,\n"
33131 " GUESTFS_TUNE2FS_RESERVEDBLOCKSPERCENTAGE, int reservedblockspercentage,\n"
33132 " GUESTFS_TUNE2FS_LASTMOUNTEDDIRECTORY, const char *lastmounteddirectory,\n"
33133 " GUESTFS_TUNE2FS_RESERVEDBLOCKSCOUNT, int64_t reservedblockscount,\n"
33134 " GUESTFS_TUNE2FS_USER, int64_t user,\n"
33139 #: ../src/guestfs-actions.pod:7851
33141 "To get the current values of filesystem parameters, see "
33142 "C<guestfs_tune2fs_l>. For precise details of how tune2fs works, see the "
33143 "L<tune2fs(8)> man page."
33147 #: ../src/guestfs-actions.pod:7859
33148 msgid "guestfs_tune2fs_va"
33152 #: ../src/guestfs-actions.pod:7861
33156 " guestfs_tune2fs_va (guestfs_h *g,\n"
33157 " const char *device,\n"
33158 " va_list args);\n"
33163 #: ../src/guestfs-actions.pod:7866
33164 msgid "This is the \"va_list variant\" of L</guestfs_tune2fs>."
33168 #: ../src/guestfs-actions.pod:7870
33169 msgid "guestfs_tune2fs_argv"
33173 #: ../src/guestfs-actions.pod:7872
33177 " guestfs_tune2fs_argv (guestfs_h *g,\n"
33178 " const char *device,\n"
33179 " const struct guestfs_tune2fs_argv *optargs);\n"
33184 #: ../src/guestfs-actions.pod:7877
33185 msgid "This is the \"argv variant\" of L</guestfs_tune2fs>."
33189 #: ../src/guestfs-actions.pod:7881
33190 msgid "guestfs_tune2fs_l"
33194 #: ../src/guestfs-actions.pod:7883
33198 " guestfs_tune2fs_l (guestfs_h *g,\n"
33199 " const char *device);\n"
33204 #: ../src/guestfs-actions.pod:7903
33205 msgid "guestfs_txz_in"
33209 #: ../src/guestfs-actions.pod:7905
33213 " guestfs_txz_in (guestfs_h *g,\n"
33214 " const char *tarball,\n"
33215 " const char *directory);\n"
33220 #: ../src/guestfs-actions.pod:7917
33221 msgid "guestfs_txz_out"
33225 #: ../src/guestfs-actions.pod:7919
33229 " guestfs_txz_out (guestfs_h *g,\n"
33230 " const char *directory,\n"
33231 " const char *tarball);\n"
33236 #: ../src/guestfs-actions.pod:7931
33237 msgid "guestfs_umask"
33241 #: ../src/guestfs-actions.pod:7933
33245 " guestfs_umask (guestfs_h *g,\n"
33251 #: ../src/guestfs-actions.pod:7949
33253 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
33254 "C<guestfs_mkdir>."
33258 #: ../src/guestfs-actions.pod:7958
33259 msgid "guestfs_umount"
33263 #: ../src/guestfs-actions.pod:7960
33267 " guestfs_umount (guestfs_h *g,\n"
33268 " const char *pathordevice);\n"
33273 #: ../src/guestfs-actions.pod:7972
33274 msgid "guestfs_umount_all"
33278 #: ../src/guestfs-actions.pod:7974
33282 " guestfs_umount_all (guestfs_h *g);\n"
33287 #: ../src/guestfs-actions.pod:7985
33288 msgid "guestfs_upload"
33292 #: ../src/guestfs-actions.pod:7987
33296 " guestfs_upload (guestfs_h *g,\n"
33297 " const char *filename,\n"
33298 " const char *remotefilename);\n"
33303 #: ../src/guestfs-actions.pod:7997
33304 msgid "See also C<guestfs_download>."
33308 #: ../src/guestfs-actions.pod:8008
33309 msgid "guestfs_upload_offset"
33313 #: ../src/guestfs-actions.pod:8010
33317 " guestfs_upload_offset (guestfs_h *g,\n"
33318 " const char *filename,\n"
33319 " const char *remotefilename,\n"
33320 " int64_t offset);\n"
33325 #: ../src/guestfs-actions.pod:8026
33327 "Note that there is no limit on the amount of data that can be uploaded with "
33328 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
33329 "full amount unless an error occurs."
33333 #: ../src/guestfs-actions.pod:8031
33334 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
33338 #: ../src/guestfs-actions.pod:8042
33339 msgid "guestfs_utimens"
33343 #: ../src/guestfs-actions.pod:8044
33347 " guestfs_utimens (guestfs_h *g,\n"
33348 " const char *path,\n"
33349 " int64_t atsecs,\n"
33350 " int64_t atnsecs,\n"
33351 " int64_t mtsecs,\n"
33352 " int64_t mtnsecs);\n"
33357 #: ../src/guestfs-actions.pod:8073 ../src/guestfs-structs.pod:175
33358 msgid "guestfs_version"
33362 #: ../src/guestfs-actions.pod:8075
33365 " struct guestfs_version *\n"
33366 " guestfs_version (guestfs_h *g);\n"
33371 #: ../src/guestfs-actions.pod:8103
33373 "I<Note:> Don't use this call to test for availability of features. In "
33374 "enterprise distributions we backport features from later versions into "
33375 "earlier versions, making this an unreliable way to test for features. Use "
33376 "C<guestfs_available> instead."
33380 #: ../src/guestfs-actions.pod:8109
33382 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
33383 "error. I<The caller must call C<guestfs_free_version> after use>."
33387 #: ../src/guestfs-actions.pod:8113
33388 msgid "(Added in 1.0.58)"
33392 #: ../src/guestfs-actions.pod:8115
33393 msgid "guestfs_vfs_label"
33397 #: ../src/guestfs-actions.pod:8117
33401 " guestfs_vfs_label (guestfs_h *g,\n"
33402 " const char *device);\n"
33407 #: ../src/guestfs-actions.pod:8126
33408 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
33412 #: ../src/guestfs-actions.pod:8131 ../src/guestfs-actions.pod:8168
33413 msgid "(Added in 1.3.18)"
33417 #: ../src/guestfs-actions.pod:8133
33418 msgid "guestfs_vfs_type"
33422 #: ../src/guestfs-actions.pod:8135
33426 " guestfs_vfs_type (guestfs_h *g,\n"
33427 " const char *device);\n"
33432 #: ../src/guestfs-actions.pod:8152
33433 msgid "guestfs_vfs_uuid"
33437 #: ../src/guestfs-actions.pod:8154
33441 " guestfs_vfs_uuid (guestfs_h *g,\n"
33442 " const char *device);\n"
33447 #: ../src/guestfs-actions.pod:8163
33448 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
33452 #: ../src/guestfs-actions.pod:8170
33453 msgid "guestfs_vg_activate"
33457 #: ../src/guestfs-actions.pod:8172
33461 " guestfs_vg_activate (guestfs_h *g,\n"
33463 " char *const *volgroups);\n"
33468 #: ../src/guestfs-actions.pod:8189
33469 msgid "guestfs_vg_activate_all"
33473 #: ../src/guestfs-actions.pod:8191
33477 " guestfs_vg_activate_all (guestfs_h *g,\n"
33478 " int activate);\n"
33483 #: ../src/guestfs-actions.pod:8204
33484 msgid "guestfs_vgcreate"
33488 #: ../src/guestfs-actions.pod:8206
33492 " guestfs_vgcreate (guestfs_h *g,\n"
33493 " const char *volgroup,\n"
33494 " char *const *physvols);\n"
33499 #: ../src/guestfs-actions.pod:8218
33500 msgid "guestfs_vglvuuids"
33504 #: ../src/guestfs-actions.pod:8220
33508 " guestfs_vglvuuids (guestfs_h *g,\n"
33509 " const char *vgname);\n"
33514 #: ../src/guestfs-actions.pod:8227
33516 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
33517 "associate logical volumes and volume groups."
33521 #: ../src/guestfs-actions.pod:8230
33522 msgid "See also C<guestfs_vgpvuuids>."
33526 #: ../src/guestfs-actions.pod:8238
33527 msgid "guestfs_vgpvuuids"
33531 #: ../src/guestfs-actions.pod:8240
33535 " guestfs_vgpvuuids (guestfs_h *g,\n"
33536 " const char *vgname);\n"
33541 #: ../src/guestfs-actions.pod:8247
33543 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
33544 "associate physical volumes and volume groups."
33548 #: ../src/guestfs-actions.pod:8250
33549 msgid "See also C<guestfs_vglvuuids>."
33553 #: ../src/guestfs-actions.pod:8258
33554 msgid "guestfs_vgremove"
33558 #: ../src/guestfs-actions.pod:8260
33562 " guestfs_vgremove (guestfs_h *g,\n"
33563 " const char *vgname);\n"
33568 #: ../src/guestfs-actions.pod:8273
33569 msgid "guestfs_vgrename"
33573 #: ../src/guestfs-actions.pod:8275
33577 " guestfs_vgrename (guestfs_h *g,\n"
33578 " const char *volgroup,\n"
33579 " const char *newvolgroup);\n"
33584 #: ../src/guestfs-actions.pod:8286
33585 msgid "guestfs_vgs"
33589 #: ../src/guestfs-actions.pod:8288
33593 " guestfs_vgs (guestfs_h *g);\n"
33598 #: ../src/guestfs-actions.pod:8297
33599 msgid "See also C<guestfs_vgs_full>."
33603 #: ../src/guestfs-actions.pod:8305
33604 msgid "guestfs_vgs_full"
33608 #: ../src/guestfs-actions.pod:8307
33611 " struct guestfs_lvm_vg_list *\n"
33612 " guestfs_vgs_full (guestfs_h *g);\n"
33617 #: ../src/guestfs-actions.pod:8313
33619 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
33620 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
33625 #: ../src/guestfs-actions.pod:8319
33626 msgid "guestfs_vgscan"
33630 #: ../src/guestfs-actions.pod:8321
33634 " guestfs_vgscan (guestfs_h *g);\n"
33639 #: ../src/guestfs-actions.pod:8331
33640 msgid "guestfs_vguuid"
33644 #: ../src/guestfs-actions.pod:8333
33648 " guestfs_vguuid (guestfs_h *g,\n"
33649 " const char *vgname);\n"
33654 #: ../src/guestfs-actions.pod:8344
33655 msgid "guestfs_wait_ready"
33659 #: ../src/guestfs-actions.pod:8346
33663 " guestfs_wait_ready (guestfs_h *g);\n"
33668 #: ../src/guestfs-actions.pod:8349
33670 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
33675 #: ../src/guestfs-actions.pod:8356
33676 msgid "This function is a no op."
33680 #: ../src/guestfs-actions.pod:8358
33682 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
33683 "calling C<guestfs_launch> to wait for the launch to complete. However this "
33684 "is no longer necessary because C<guestfs_launch> now does the waiting."
33688 #: ../src/guestfs-actions.pod:8363
33690 "If you see any calls to this function in code then you can just remove them, "
33691 "unless you want to retain compatibility with older versions of the API."
33695 #: ../src/guestfs-actions.pod:8371
33696 msgid "guestfs_wc_c"
33700 #: ../src/guestfs-actions.pod:8373
33704 " guestfs_wc_c (guestfs_h *g,\n"
33705 " const char *path);\n"
33710 #: ../src/guestfs-actions.pod:8384
33711 msgid "guestfs_wc_l"
33715 #: ../src/guestfs-actions.pod:8386
33719 " guestfs_wc_l (guestfs_h *g,\n"
33720 " const char *path);\n"
33725 #: ../src/guestfs-actions.pod:8397
33726 msgid "guestfs_wc_w"
33730 #: ../src/guestfs-actions.pod:8399
33734 " guestfs_wc_w (guestfs_h *g,\n"
33735 " const char *path);\n"
33740 #: ../src/guestfs-actions.pod:8410
33741 msgid "guestfs_write"
33745 #: ../src/guestfs-actions.pod:8412
33749 " guestfs_write (guestfs_h *g,\n"
33750 " const char *path,\n"
33751 " const char *content,\n"
33752 " size_t content_size);\n"
33757 #: ../src/guestfs-actions.pod:8421
33758 msgid "See also C<guestfs_write_append>."
33762 #: ../src/guestfs-actions.pod:8430
33763 msgid "guestfs_write_append"
33767 #: ../src/guestfs-actions.pod:8432
33771 " guestfs_write_append (guestfs_h *g,\n"
33772 " const char *path,\n"
33773 " const char *content,\n"
33774 " size_t content_size);\n"
33779 #: ../src/guestfs-actions.pod:8441
33780 msgid "See also C<guestfs_write>."
33784 #: ../src/guestfs-actions.pod:8450
33785 msgid "guestfs_write_file"
33789 #: ../src/guestfs-actions.pod:8452
33793 " guestfs_write_file (guestfs_h *g,\n"
33794 " const char *path,\n"
33795 " const char *content,\n"
33801 #: ../src/guestfs-actions.pod:8458
33803 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
33808 #: ../src/guestfs-actions.pod:8483
33809 msgid "guestfs_zegrep"
33813 #: ../src/guestfs-actions.pod:8485
33817 " guestfs_zegrep (guestfs_h *g,\n"
33818 " const char *regex,\n"
33819 " const char *path);\n"
33824 #: ../src/guestfs-actions.pod:8502
33825 msgid "guestfs_zegrepi"
33829 #: ../src/guestfs-actions.pod:8504
33833 " guestfs_zegrepi (guestfs_h *g,\n"
33834 " const char *regex,\n"
33835 " const char *path);\n"
33840 #: ../src/guestfs-actions.pod:8521
33841 msgid "guestfs_zero"
33845 #: ../src/guestfs-actions.pod:8523
33849 " guestfs_zero (guestfs_h *g,\n"
33850 " const char *device);\n"
33855 #: ../src/guestfs-actions.pod:8537
33857 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
33858 "C<guestfs_is_zero_device>"
33862 #: ../src/guestfs-actions.pod:8549
33863 msgid "guestfs_zero_device"
33867 #: ../src/guestfs-actions.pod:8551
33871 " guestfs_zero_device (guestfs_h *g,\n"
33872 " const char *device);\n"
33877 #: ../src/guestfs-actions.pod:8555
33879 "This command writes zeroes over the entire C<device>. Compare with "
33880 "C<guestfs_zero> which just zeroes the first few blocks of a device."
33884 #: ../src/guestfs-actions.pod:8570
33885 msgid "(Added in 1.3.1)"
33889 #: ../src/guestfs-actions.pod:8572
33890 msgid "guestfs_zerofree"
33894 #: ../src/guestfs-actions.pod:8574
33898 " guestfs_zerofree (guestfs_h *g,\n"
33899 " const char *device);\n"
33904 #: ../src/guestfs-actions.pod:8593
33905 msgid "guestfs_zfgrep"
33909 #: ../src/guestfs-actions.pod:8595
33913 " guestfs_zfgrep (guestfs_h *g,\n"
33914 " const char *pattern,\n"
33915 " const char *path);\n"
33920 #: ../src/guestfs-actions.pod:8612
33921 msgid "guestfs_zfgrepi"
33925 #: ../src/guestfs-actions.pod:8614
33929 " guestfs_zfgrepi (guestfs_h *g,\n"
33930 " const char *pattern,\n"
33931 " const char *path);\n"
33936 #: ../src/guestfs-actions.pod:8631
33937 msgid "guestfs_zfile"
33941 #: ../src/guestfs-actions.pod:8633
33945 " guestfs_zfile (guestfs_h *g,\n"
33946 " const char *meth,\n"
33947 " const char *path);\n"
33952 #: ../src/guestfs-actions.pod:8638
33954 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
33959 #: ../src/guestfs-actions.pod:8650
33961 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
33966 #: ../src/guestfs-actions.pod:8658
33967 msgid "guestfs_zgrep"
33971 #: ../src/guestfs-actions.pod:8660
33975 " guestfs_zgrep (guestfs_h *g,\n"
33976 " const char *regex,\n"
33977 " const char *path);\n"
33982 #: ../src/guestfs-actions.pod:8677
33983 msgid "guestfs_zgrepi"
33987 #: ../src/guestfs-actions.pod:8679
33991 " guestfs_zgrepi (guestfs_h *g,\n"
33992 " const char *regex,\n"
33993 " const char *path);\n"
33998 #: ../src/guestfs-availability.pod:3
34003 #: ../src/guestfs-availability.pod:5
34005 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
34006 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
34007 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
34008 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
34009 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
34013 #: ../src/guestfs-availability.pod:21
34018 #: ../src/guestfs-availability.pod:23
34019 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
34023 #: ../src/guestfs-availability.pod:26
34028 #: ../src/guestfs-availability.pod:28
34029 msgid "The following functions: L</guestfs_grub_install>"
34033 #: ../src/guestfs-availability.pod:31
34038 #: ../src/guestfs-availability.pod:33
34040 "The following functions: L</guestfs_inotify_add_watch> "
34041 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
34042 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
34046 #: ../src/guestfs-availability.pod:41
34047 msgid "B<linuxfsuuid>"
34051 #: ../src/guestfs-availability.pod:43
34053 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
34054 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
34058 #: ../src/guestfs-availability.pod:50
34059 msgid "B<linuxmodules>"
34063 #: ../src/guestfs-availability.pod:52
34064 msgid "The following functions: L</guestfs_modprobe>"
34068 #: ../src/guestfs-availability.pod:55
34069 msgid "B<linuxxattrs>"
34073 #: ../src/guestfs-availability.pod:57
34075 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
34076 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
34077 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
34078 "L</guestfs_setxattr>"
34082 #: ../src/guestfs-availability.pod:68
34087 #: ../src/guestfs-availability.pod:70
34089 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
34090 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
34091 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
34095 #: ../src/guestfs-availability.pod:79
34100 #: ../src/guestfs-availability.pod:81
34102 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
34103 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
34104 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
34105 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
34106 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
34107 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
34108 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
34109 "L</guestfs_vgs_full>"
34113 #: ../src/guestfs-availability.pod:104
34118 #: ../src/guestfs-availability.pod:106
34120 "The following functions: L</guestfs_md_create> L</guestfs_md_detail> "
34121 "L</guestfs_md_stop>"
34125 #: ../src/guestfs-availability.pod:111
34130 #: ../src/guestfs-availability.pod:113
34132 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
34133 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
34137 #: ../src/guestfs-availability.pod:119
34142 #: ../src/guestfs-availability.pod:121
34143 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
34147 #: ../src/guestfs-availability.pod:124
34148 msgid "B<ntfsprogs>"
34152 #: ../src/guestfs-availability.pod:126
34154 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
34155 "L</guestfs_ntfsresize_size>"
34159 #: ../src/guestfs-availability.pod:131
34160 msgid "B<realpath>"
34164 #: ../src/guestfs-availability.pod:133
34165 msgid "The following functions: L</guestfs_realpath>"
34169 #: ../src/guestfs-availability.pod:136
34174 #: ../src/guestfs-availability.pod:138
34176 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
34177 "L</guestfs_scrub_freespace>"
34181 #: ../src/guestfs-availability.pod:143
34186 #: ../src/guestfs-availability.pod:145
34187 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
34191 #: ../src/guestfs-availability.pod:149
34196 #: ../src/guestfs-availability.pod:151
34197 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
34201 #: ../src/guestfs-availability.pod:155
34202 msgid "B<zerofree>"
34206 #: ../src/guestfs-availability.pod:157
34207 msgid "The following functions: L</guestfs_zerofree>"
34211 #: ../src/guestfs-structs.pod:1
34212 msgid "guestfs_int_bool"
34216 #: ../src/guestfs-structs.pod:3
34219 " struct guestfs_int_bool {\n"
34227 #: ../src/guestfs-structs.pod:8
34230 " struct guestfs_int_bool_list {\n"
34231 " uint32_t len; /* Number of elements in list. */\n"
34232 " struct guestfs_int_bool *val; /* Elements. */\n"
34238 #: ../src/guestfs-structs.pod:13
34241 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
34242 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
34247 #: ../src/guestfs-structs.pod:16
34248 msgid "guestfs_lvm_pv"
34252 #: ../src/guestfs-structs.pod:18
34255 " struct guestfs_lvm_pv {\n"
34256 " char *pv_name;\n"
34257 " /* The next field is NOT nul-terminated, be careful when printing it: "
34259 " char pv_uuid[32];\n"
34261 " uint64_t pv_size;\n"
34262 " uint64_t dev_size;\n"
34263 " uint64_t pv_free;\n"
34264 " uint64_t pv_used;\n"
34265 " char *pv_attr;\n"
34266 " int64_t pv_pe_count;\n"
34267 " int64_t pv_pe_alloc_count;\n"
34268 " char *pv_tags;\n"
34269 " uint64_t pe_start;\n"
34270 " int64_t pv_mda_count;\n"
34271 " uint64_t pv_mda_free;\n"
34277 #: ../src/guestfs-structs.pod:36
34280 " struct guestfs_lvm_pv_list {\n"
34281 " uint32_t len; /* Number of elements in list. */\n"
34282 " struct guestfs_lvm_pv *val; /* Elements. */\n"
34288 #: ../src/guestfs-structs.pod:41
34291 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
34292 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
34297 #: ../src/guestfs-structs.pod:44
34298 msgid "guestfs_lvm_vg"
34302 #: ../src/guestfs-structs.pod:46
34305 " struct guestfs_lvm_vg {\n"
34306 " char *vg_name;\n"
34307 " /* The next field is NOT nul-terminated, be careful when printing it: "
34309 " char vg_uuid[32];\n"
34311 " char *vg_attr;\n"
34312 " uint64_t vg_size;\n"
34313 " uint64_t vg_free;\n"
34314 " char *vg_sysid;\n"
34315 " uint64_t vg_extent_size;\n"
34316 " int64_t vg_extent_count;\n"
34317 " int64_t vg_free_count;\n"
34318 " int64_t max_lv;\n"
34319 " int64_t max_pv;\n"
34320 " int64_t pv_count;\n"
34321 " int64_t lv_count;\n"
34322 " int64_t snap_count;\n"
34323 " int64_t vg_seqno;\n"
34324 " char *vg_tags;\n"
34325 " int64_t vg_mda_count;\n"
34326 " uint64_t vg_mda_free;\n"
34332 #: ../src/guestfs-structs.pod:69
34335 " struct guestfs_lvm_vg_list {\n"
34336 " uint32_t len; /* Number of elements in list. */\n"
34337 " struct guestfs_lvm_vg *val; /* Elements. */\n"
34343 #: ../src/guestfs-structs.pod:74
34346 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
34347 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
34352 #: ../src/guestfs-structs.pod:77
34353 msgid "guestfs_lvm_lv"
34357 #: ../src/guestfs-structs.pod:79
34360 " struct guestfs_lvm_lv {\n"
34361 " char *lv_name;\n"
34362 " /* The next field is NOT nul-terminated, be careful when printing it: "
34364 " char lv_uuid[32];\n"
34365 " char *lv_attr;\n"
34366 " int64_t lv_major;\n"
34367 " int64_t lv_minor;\n"
34368 " int64_t lv_kernel_major;\n"
34369 " int64_t lv_kernel_minor;\n"
34370 " uint64_t lv_size;\n"
34371 " int64_t seg_count;\n"
34373 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
34374 " float snap_percent;\n"
34375 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
34376 " float copy_percent;\n"
34377 " char *move_pv;\n"
34378 " char *lv_tags;\n"
34379 " char *mirror_log;\n"
34380 " char *modules;\n"
34386 #: ../src/guestfs-structs.pod:101
34389 " struct guestfs_lvm_lv_list {\n"
34390 " uint32_t len; /* Number of elements in list. */\n"
34391 " struct guestfs_lvm_lv *val; /* Elements. */\n"
34397 #: ../src/guestfs-structs.pod:106
34400 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
34401 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
34406 #: ../src/guestfs-structs.pod:111
34409 " struct guestfs_stat {\n"
34413 " int64_t nlink;\n"
34418 " int64_t blksize;\n"
34419 " int64_t blocks;\n"
34420 " int64_t atime;\n"
34421 " int64_t mtime;\n"
34422 " int64_t ctime;\n"
34428 #: ../src/guestfs-structs.pod:127
34431 " struct guestfs_stat_list {\n"
34432 " uint32_t len; /* Number of elements in list. */\n"
34433 " struct guestfs_stat *val; /* Elements. */\n"
34439 #: ../src/guestfs-structs.pod:132
34442 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
34443 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
34448 #: ../src/guestfs-structs.pod:137
34451 " struct guestfs_statvfs {\n"
34452 " int64_t bsize;\n"
34453 " int64_t frsize;\n"
34454 " int64_t blocks;\n"
34455 " int64_t bfree;\n"
34456 " int64_t bavail;\n"
34457 " int64_t files;\n"
34458 " int64_t ffree;\n"
34459 " int64_t favail;\n"
34462 " int64_t namemax;\n"
34468 #: ../src/guestfs-structs.pod:151
34471 " struct guestfs_statvfs_list {\n"
34472 " uint32_t len; /* Number of elements in list. */\n"
34473 " struct guestfs_statvfs *val; /* Elements. */\n"
34479 #: ../src/guestfs-structs.pod:156
34482 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
34483 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
34488 #: ../src/guestfs-structs.pod:159
34489 msgid "guestfs_dirent"
34493 #: ../src/guestfs-structs.pod:161
34496 " struct guestfs_dirent {\n"
34505 #: ../src/guestfs-structs.pod:167
34508 " struct guestfs_dirent_list {\n"
34509 " uint32_t len; /* Number of elements in list. */\n"
34510 " struct guestfs_dirent *val; /* Elements. */\n"
34516 #: ../src/guestfs-structs.pod:172
34519 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
34520 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
34525 #: ../src/guestfs-structs.pod:177
34528 " struct guestfs_version {\n"
34529 " int64_t major;\n"
34530 " int64_t minor;\n"
34531 " int64_t release;\n"
34538 #: ../src/guestfs-structs.pod:184
34541 " struct guestfs_version_list {\n"
34542 " uint32_t len; /* Number of elements in list. */\n"
34543 " struct guestfs_version *val; /* Elements. */\n"
34549 #: ../src/guestfs-structs.pod:189
34552 " void guestfs_free_version (struct guestfs_free_version *);\n"
34553 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
34558 #: ../src/guestfs-structs.pod:192
34559 msgid "guestfs_xattr"
34563 #: ../src/guestfs-structs.pod:194
34566 " struct guestfs_xattr {\n"
34567 " char *attrname;\n"
34568 " /* The next two fields describe a byte array. */\n"
34569 " uint32_t attrval_len;\n"
34570 " char *attrval;\n"
34576 #: ../src/guestfs-structs.pod:201
34579 " struct guestfs_xattr_list {\n"
34580 " uint32_t len; /* Number of elements in list. */\n"
34581 " struct guestfs_xattr *val; /* Elements. */\n"
34587 #: ../src/guestfs-structs.pod:206
34590 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
34591 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
34596 #: ../src/guestfs-structs.pod:209
34597 msgid "guestfs_inotify_event"
34601 #: ../src/guestfs-structs.pod:211
34604 " struct guestfs_inotify_event {\n"
34605 " int64_t in_wd;\n"
34606 " uint32_t in_mask;\n"
34607 " uint32_t in_cookie;\n"
34608 " char *in_name;\n"
34614 #: ../src/guestfs-structs.pod:218
34617 " struct guestfs_inotify_event_list {\n"
34618 " uint32_t len; /* Number of elements in list. */\n"
34619 " struct guestfs_inotify_event *val; /* Elements. */\n"
34625 #: ../src/guestfs-structs.pod:223
34628 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
34629 " void guestfs_free_inotify_event_list (struct "
34630 "guestfs_free_inotify_event_list *);\n"
34635 #: ../src/guestfs-structs.pod:226
34636 msgid "guestfs_partition"
34640 #: ../src/guestfs-structs.pod:228
34643 " struct guestfs_partition {\n"
34644 " int32_t part_num;\n"
34645 " uint64_t part_start;\n"
34646 " uint64_t part_end;\n"
34647 " uint64_t part_size;\n"
34653 #: ../src/guestfs-structs.pod:235
34656 " struct guestfs_partition_list {\n"
34657 " uint32_t len; /* Number of elements in list. */\n"
34658 " struct guestfs_partition *val; /* Elements. */\n"
34664 #: ../src/guestfs-structs.pod:240
34667 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
34668 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
34673 #: ../src/guestfs-structs.pod:243
34674 msgid "guestfs_application"
34678 #: ../src/guestfs-structs.pod:245
34681 " struct guestfs_application {\n"
34682 " char *app_name;\n"
34683 " char *app_display_name;\n"
34684 " int32_t app_epoch;\n"
34685 " char *app_version;\n"
34686 " char *app_release;\n"
34687 " char *app_install_path;\n"
34688 " char *app_trans_path;\n"
34689 " char *app_publisher;\n"
34690 " char *app_url;\n"
34691 " char *app_source_package;\n"
34692 " char *app_summary;\n"
34693 " char *app_description;\n"
34699 #: ../src/guestfs-structs.pod:260
34702 " struct guestfs_application_list {\n"
34703 " uint32_t len; /* Number of elements in list. */\n"
34704 " struct guestfs_application *val; /* Elements. */\n"
34710 #: ../src/guestfs-structs.pod:265
34713 " void guestfs_free_application (struct guestfs_free_application *);\n"
34714 " void guestfs_free_application_list (struct guestfs_free_application_list "
34720 #: ../src/guestfs.pod:5
34721 msgid "guestfs - Library for accessing and modifying virtual machine images"
34725 #: ../src/guestfs.pod:11
34728 " guestfs_h *g = guestfs_create ();\n"
34729 " guestfs_add_drive (g, \"guest.img\");\n"
34730 " guestfs_launch (g);\n"
34731 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
34732 " guestfs_touch (g, \"/hello\");\n"
34733 " guestfs_umount (g, \"/\");\n"
34734 " guestfs_close (g);\n"
34739 #: ../src/guestfs.pod:25
34741 "Libguestfs is a library for accessing and modifying guest disk images. "
34742 "Amongst the things this is good for: making batch configuration changes to "
34743 "guests, getting disk used/free statistics (see also: virt-df), migrating "
34744 "between virtualization systems (see also: virt-p2v), performing partial "
34745 "backups, performing partial guest clones, cloning guests and changing "
34746 "registry/UUID/hostname info, and much else besides."
34750 #: ../src/guestfs.pod:33
34752 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
34753 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
34754 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
34759 #: ../src/guestfs.pod:38
34761 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
34762 "what filesystem is in each LV, etc.). It can also run commands in the "
34763 "context of the guest. Also you can access filesystems over FUSE."
34767 #: ../src/guestfs.pod:43
34769 "Libguestfs is a library that can be linked with C and C++ management "
34770 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
34771 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
34776 #: ../src/guestfs.pod:48
34778 "You don't need to be root to use libguestfs, although obviously you do need "
34779 "enough permissions to access the disk images."
34783 #: ../src/guestfs.pod:51
34785 "Libguestfs is a large API because it can do many things. For a gentle "
34786 "introduction, please read the L</API OVERVIEW> section next."
34790 #: ../src/guestfs.pod:54
34792 "There are also some example programs in the L<guestfs-examples(3)> manual "
34797 #: ../src/guestfs.pod:57
34798 msgid "API OVERVIEW"
34802 #: ../src/guestfs.pod:59
34804 "This section provides a gentler overview of the libguestfs API. We also try "
34805 "to group API calls together, where that may not be obvious from reading "
34806 "about the individual calls in the main section of this manual."
34810 #: ../src/guestfs.pod:64
34815 #: ../src/guestfs.pod:66
34817 "Before you can use libguestfs calls, you have to create a handle. Then you "
34818 "must add at least one disk image to the handle, followed by launching the "
34819 "handle, then performing whatever operations you want, and finally closing "
34820 "the handle. By convention we use the single letter C<g> for the name of the "
34821 "handle variable, although of course you can use any name you want."
34825 #: ../src/guestfs.pod:73
34826 msgid "The general structure of all libguestfs-using programs looks like this:"
34830 #: ../src/guestfs.pod:76
34833 " guestfs_h *g = guestfs_create ();\n"
34838 #: ../src/guestfs.pod:78
34841 " /* Call guestfs_add_drive additional times if there are\n"
34842 " * multiple disk images.\n"
34844 " guestfs_add_drive (g, \"guest.img\");\n"
34849 #: ../src/guestfs.pod:83
34852 " /* Most manipulation calls won't work until you've launched\n"
34853 " * the handle 'g'. You have to do this _after_ adding drives\n"
34854 " * and _before_ other commands.\n"
34856 " guestfs_launch (g);\n"
34861 #: ../src/guestfs.pod:89
34864 " /* Now you can examine what partitions, LVs etc are available.\n"
34866 " char **partitions = guestfs_list_partitions (g);\n"
34867 " char **logvols = guestfs_lvs (g);\n"
34872 #: ../src/guestfs.pod:94
34875 " /* To access a filesystem in the image, you must mount it.\n"
34877 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
34882 #: ../src/guestfs.pod:98
34885 " /* Now you can perform filesystem actions on the guest\n"
34888 " guestfs_touch (g, \"/hello\");\n"
34893 #: ../src/guestfs.pod:103
34896 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
34897 " * it is done automatically when you close the handle. See\n"
34898 " * discussion of autosync in this page.\n"
34900 " guestfs_sync (g);\n"
34905 #: ../src/guestfs.pod:109
34908 " /* Close the handle 'g'. */\n"
34909 " guestfs_close (g);\n"
34914 #: ../src/guestfs.pod:112
34916 "The code above doesn't include any error checking. In real code you should "
34917 "check return values carefully for errors. In general all functions that "
34918 "return integers return C<-1> on error, and all functions that return "
34919 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
34920 "how to handle errors, and consult the documentation for each function call "
34921 "below to see precisely how they return error indications. See "
34922 "L<guestfs-examples(3)> for fully worked examples."
34926 #: ../src/guestfs.pod:121
34927 msgid "DISK IMAGES"
34931 #: ../src/guestfs.pod:123
34933 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
34934 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
34935 "actual block device, or simply an empty file of zeroes that you have created "
34936 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
34941 #: ../src/guestfs.pod:129
34943 "The call you should use in modern code for adding drives is "
34944 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
34945 "specifying that the format is raw, do:"
34949 #: ../src/guestfs.pod:133
34952 " guestfs_add_drive_opts (g, filename,\n"
34953 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
34959 #: ../src/guestfs.pod:137
34960 msgid "You can add a disk read-only using:"
34964 #: ../src/guestfs.pod:139
34967 " guestfs_add_drive_opts (g, filename,\n"
34968 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
34969 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
34975 #: ../src/guestfs.pod:144
34977 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
34978 "libguestfs won't modify the file."
34982 #: ../src/guestfs.pod:147
34984 "Be extremely cautious if the disk image is in use, eg. if it is being used "
34985 "by a virtual machine. Adding it read-write will almost certainly cause disk "
34986 "corruption, but adding it read-only is safe."
34990 #: ../src/guestfs.pod:151
34992 "You must add at least one disk image, and you may add multiple disk images. "
34993 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
34994 "first one you added), C</dev/sdb> (for the second one you added), etc."
34998 #: ../src/guestfs.pod:156
35000 "Once L</guestfs_launch> has been called you cannot add any more images. You "
35001 "can call L</guestfs_list_devices> to get a list of the device names, in the "
35002 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
35006 #: ../src/guestfs.pod:161
35011 #: ../src/guestfs.pod:163
35013 "Before you can read or write files, create directories and so on in a disk "
35014 "image that contains filesystems, you have to mount those filesystems using "
35015 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
35016 "a disk image contains (for example) one partition with a filesystem on that "
35017 "partition, then you can mount it directly:"
35021 #: ../src/guestfs.pod:170
35024 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
35029 #: ../src/guestfs.pod:172
35031 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
35032 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
35033 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
35034 "that these are libguestfs virtual devices, and are nothing to do with host "
35039 #: ../src/guestfs.pod:178
35041 "If you are given a disk image and you don't know what it contains then you "
35042 "have to find out. Libguestfs can do that too: use "
35043 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
35044 "and LVs, and either try mounting each to see what is mountable, or else "
35045 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
35046 "filesystems, use L</guestfs_list_filesystems>."
35050 #: ../src/guestfs.pod:186
35052 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
35053 "L</INSPECTION> below). But you might find it easier to look at higher level "
35054 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
35058 #: ../src/guestfs.pod:191
35060 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
35061 "several other variations of the C<guestfs_mount_*> call."
35065 #: ../src/guestfs.pod:194
35066 msgid "FILESYSTEM ACCESS AND MODIFICATION"
35070 #: ../src/guestfs.pod:196
35072 "The majority of the libguestfs API consists of fairly low-level calls for "
35073 "accessing and modifying the files, directories, symlinks etc on mounted "
35074 "filesystems. There are over a hundred such calls which you can find listed "
35075 "in detail below in this man page, and we don't even pretend to cover them "
35076 "all in this overview."
35080 #: ../src/guestfs.pod:202
35082 "Specify filenames as full paths, starting with C<\"/\"> and including the "
35087 #: ../src/guestfs.pod:205
35089 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
35090 "the file called C<\"etc/passwd\"> then you could do:"
35094 #: ../src/guestfs.pod:208
35097 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
35102 #: ../src/guestfs.pod:210
35104 "This would return C<data> as a newly allocated buffer containing the full "
35105 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
35106 "or C<NULL> if there was an error."
35110 #: ../src/guestfs.pod:214
35112 "As another example, to create a top-level directory on that filesystem "
35113 "called C<\"var\"> you would do:"
35117 #: ../src/guestfs.pod:217
35120 " guestfs_mkdir (g, \"/var\");\n"
35125 #: ../src/guestfs.pod:219
35126 msgid "To create a symlink you could do:"
35130 #: ../src/guestfs.pod:221
35133 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
35134 " \"/etc/rc3.d/S30portmap\");\n"
35139 #: ../src/guestfs.pod:224
35141 "Libguestfs will reject attempts to use relative paths and there is no "
35142 "concept of a current working directory."
35146 #: ../src/guestfs.pod:227
35148 "Libguestfs can return errors in many situations: for example if the "
35149 "filesystem isn't writable, or if a file or directory that you requested "
35150 "doesn't exist. If you are using the C API (documented here) you have to "
35151 "check for those error conditions after each call. (Other language bindings "
35152 "turn these errors into exceptions)."
35156 #: ../src/guestfs.pod:233
35158 "File writes are affected by the per-handle umask, set by calling "
35159 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
35163 #: ../src/guestfs.pod:236
35164 msgid "PARTITIONING"
35168 #: ../src/guestfs.pod:238
35170 "Libguestfs contains API calls to read, create and modify partition tables on "
35175 #: ../src/guestfs.pod:241
35177 "In the common case where you want to create a single partition covering the "
35178 "whole disk, you should use the L</guestfs_part_disk> call:"
35182 #: ../src/guestfs.pod:245
35185 " const char *parttype = \"mbr\";\n"
35186 " if (disk_is_larger_than_2TB)\n"
35187 " parttype = \"gpt\";\n"
35188 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
35193 #: ../src/guestfs.pod:250
35195 "Obviously this effectively wipes anything that was on that disk image "
35200 #: ../src/guestfs.pod:253
35205 #: ../src/guestfs.pod:255
35207 "Libguestfs provides access to a large part of the LVM2 API, such as "
35208 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
35209 "unless you familiarize yourself with the concepts of physical volumes, "
35210 "volume groups and logical volumes."
35214 #: ../src/guestfs.pod:260
35216 "This author strongly recommends reading the LVM HOWTO, online at "
35217 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
35221 #: ../src/guestfs.pod:263
35222 msgid "DOWNLOADING"
35226 #: ../src/guestfs.pod:265
35228 "Use L</guestfs_cat> to download small, text only files. This call is "
35229 "limited to files which are less than 2 MB and which cannot contain any ASCII "
35230 "NUL (C<\\0>) characters. However the API is very simple to use."
35234 #: ../src/guestfs.pod:269
35236 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
35237 "bit data, since it returns a (pointer, size) pair. However it is still "
35238 "limited to \"small\" files, less than 2 MB."
35242 #: ../src/guestfs.pod:273
35244 "L</guestfs_download> can be used to download any file, with no limits on "
35245 "content or size (even files larger than 4 GB)."
35249 #: ../src/guestfs.pod:276
35250 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
35254 #: ../src/guestfs.pod:279
35259 #: ../src/guestfs.pod:281
35261 "It's often the case that you want to write a file or files to the disk "
35266 #: ../src/guestfs.pod:284
35268 "To write a small file with fixed content, use L</guestfs_write>. To create "
35269 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
35270 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
35271 "variety of other functions for creating test files, for example "
35272 "L</guestfs_fill> and L</guestfs_fill_pattern>."
35276 #: ../src/guestfs.pod:290
35278 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
35279 "file content or size (even files larger than 4 GB)."
35283 #: ../src/guestfs.pod:293
35284 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
35288 #: ../src/guestfs.pod:295
35290 "However the fastest way to upload I<large numbers of arbitrary files> is to "
35291 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
35292 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
35293 "the drive in a predictable way (eg. adding it last after all other drives) "
35294 "then you can get the device name from L</guestfs_list_devices> and mount it "
35295 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
35296 "sometimes non-portable between kernel versions, and they don't support "
35297 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
35298 "using a label or UUID, use an ISO image instead."
35302 #: ../src/guestfs.pod:306
35307 #: ../src/guestfs.pod:308
35309 "There are various different commands for copying between files and devices "
35310 "and in and out of the guest filesystem. These are summarised in the table "
35315 #: ../src/guestfs.pod:314
35316 msgid "B<file> to B<file>"
35320 #: ../src/guestfs.pod:316
35322 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
35323 "directories recursively."
35327 #: ../src/guestfs.pod:319
35328 msgid "To copy part of a file (offset and size) use L</guestfs_copy_file_to_file>."
35332 #: ../src/guestfs.pod:322
35333 msgid "B<file> to B<device>"
35337 #: ../src/guestfs.pod:324
35338 msgid "B<device> to B<file>"
35342 #: ../src/guestfs.pod:326
35343 msgid "B<device> to B<device>"
35347 #: ../src/guestfs.pod:328
35349 "Use L</guestfs_copy_file_to_device>, L</guestfs_copy_device_to_file>, or "
35350 "L</guestfs_copy_device_to_device>."
35354 #: ../src/guestfs.pod:331
35355 msgid "Example: duplicate the contents of an LV:"
35359 #: ../src/guestfs.pod:333
35362 " guestfs_copy_device_to_device (g,\n"
35363 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
35364 " /* -1 marks the end of the list of optional parameters */\n"
35370 #: ../src/guestfs.pod:338
35372 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
35373 "(C</dev/VG/Original>). To copy less than the whole source device, use the "
35374 "optional C<size> parameter:"
35378 #: ../src/guestfs.pod:342
35381 " guestfs_copy_device_to_device (g,\n"
35382 " \"/dev/VG/Original\", \"/dev/VG/Copy\",\n"
35383 " GUESTFS_COPY_DEVICE_TO_DEVICE_SIZE, 10000,\n"
35389 #: ../src/guestfs.pod:347
35390 msgid "B<file on the host> to B<file or device>"
35394 #: ../src/guestfs.pod:349
35395 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
35399 #: ../src/guestfs.pod:351
35400 msgid "B<file or device> to B<file on the host>"
35404 #: ../src/guestfs.pod:353
35405 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
35409 #: ../src/guestfs.pod:357
35410 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
35414 #: ../src/guestfs.pod:359
35416 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
35417 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
35418 "appears you can only upload and download to files. However many Un*x-like "
35419 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
35420 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
35421 "stderr, and arbitrary file descriptor N."
35425 #: ../src/guestfs.pod:367
35426 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
35430 #: ../src/guestfs.pod:370
35433 " guestfs_download (g, filename, \"/dev/stdout\");\n"
35438 #: ../src/guestfs.pod:372
35439 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
35443 #: ../src/guestfs.pod:374
35446 " char devfd[64];\n"
35447 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
35448 " guestfs_tar_out (g, \"/\", devfd);\n"
35453 #: ../src/guestfs.pod:378
35454 msgid "LISTING FILES"
35458 #: ../src/guestfs.pod:380
35460 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
35461 "L<guestfish(1)>-equivalent command C<ll>)."
35465 #: ../src/guestfs.pod:383
35467 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
35468 "programs, as a flat list of strings."
35472 #: ../src/guestfs.pod:386
35474 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
35475 "directory, plus additional information about each one. It is more "
35476 "equivalent to using the L<readdir(3)> call on a local filesystem."
35480 #: ../src/guestfs.pod:390
35482 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
35487 #: ../src/guestfs.pod:393
35488 msgid "RUNNING COMMANDS"
35492 #: ../src/guestfs.pod:395
35494 "Although libguestfs is primarily an API for manipulating files inside guest "
35495 "images, we also provide some limited facilities for running commands inside "
35500 #: ../src/guestfs.pod:399
35501 msgid "There are many limitations to this:"
35505 #: ../src/guestfs.pod:405
35507 "The kernel version that the command runs under will be different from what "
35512 #: ../src/guestfs.pod:410
35514 "If the command needs to communicate with daemons, then most likely they "
35515 "won't be running."
35519 #: ../src/guestfs.pod:415
35520 msgid "The command will be running in limited memory."
35524 #: ../src/guestfs.pod:419
35526 "The network may not be available unless you enable it (see "
35527 "L</guestfs_set_network>)."
35531 #: ../src/guestfs.pod:424
35532 msgid "Only supports Linux guests (not Windows, BSD, etc)."
35536 #: ../src/guestfs.pod:428
35537 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
35541 #: ../src/guestfs.pod:433
35543 "For SELinux guests, you may need to enable SELinux and load policy first. "
35544 "See L</SELINUX> in this manpage."
35548 #: ../src/guestfs.pod:438
35550 "I<Security:> It is not safe to run commands from untrusted, possibly "
35551 "malicious guests. These commands may attempt to exploit your program by "
35552 "sending unexpected output. They could also try to exploit the Linux kernel "
35553 "or qemu provided by the libguestfs appliance. They could use the network "
35554 "provided by the libguestfs appliance to bypass ordinary network partitions "
35555 "and firewalls. They could use the elevated privileges or different SELinux "
35556 "context of your program to their advantage."
35560 #: ../src/guestfs.pod:447
35562 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
35563 "(a script which runs when the guest next boots normally), and to have this "
35564 "script run the commands you want in the normal context of the running guest, "
35565 "network security and so on. For information about other security issues, "
35566 "see L</SECURITY>."
35570 #: ../src/guestfs.pod:455
35572 "The two main API calls to run commands are L</guestfs_command> and "
35573 "L</guestfs_sh> (there are also variations)."
35577 #: ../src/guestfs.pod:458
35579 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
35580 "shell globs, redirections, etc will work."
35584 #: ../src/guestfs.pod:461
35585 msgid "CONFIGURATION FILES"
35589 #: ../src/guestfs.pod:463
35591 "To read and write configuration files in Linux guest filesystems, we "
35592 "strongly recommend using Augeas. For example, Augeas understands how to "
35593 "read and write, say, a Linux shadow password file or X.org configuration "
35594 "file, and so avoids you having to write that code."
35598 #: ../src/guestfs.pod:468
35600 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
35601 "document Augeas itself here because there is excellent documentation on the "
35602 "L<http://augeas.net/> website."
35606 #: ../src/guestfs.pod:472
35608 "If you don't want to use Augeas (you fool!) then try calling "
35609 "L</guestfs_read_lines> to get the file as a list of lines which you can "
35614 #: ../src/guestfs.pod:476
35619 #: ../src/guestfs.pod:478
35621 "We support SELinux guests. To ensure that labeling happens correctly in "
35622 "SELinux guests, you need to enable SELinux and load the guest's policy:"
35626 #: ../src/guestfs.pod:486
35627 msgid "Before launching, do:"
35631 #: ../src/guestfs.pod:488
35634 " guestfs_set_selinux (g, 1);\n"
35639 #: ../src/guestfs.pod:492
35641 "After mounting the guest's filesystem(s), load the policy. This is best "
35642 "done by running the L<load_policy(8)> command in the guest itself:"
35646 #: ../src/guestfs.pod:496
35649 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
35654 #: ../src/guestfs.pod:498
35656 "(Older versions of C<load_policy> require you to specify the name of the "
35661 #: ../src/guestfs.pod:503
35663 "Optionally, set the security context for the API. The correct security "
35664 "context to use can only be known by inspecting the guest. As an example:"
35668 #: ../src/guestfs.pod:507
35671 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
35676 #: ../src/guestfs.pod:511
35677 msgid "This will work for running commands and editing existing files."
35681 #: ../src/guestfs.pod:513
35683 "When new files are created, you may need to label them explicitly, for "
35684 "example by running the external command C<restorecon pathname>."
35688 #: ../src/guestfs.pod:517
35693 #: ../src/guestfs.pod:519
35695 "Certain calls are affected by the current file mode creation mask (the "
35696 "\"umask\"). In particular ones which create files or directories, such as "
35697 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
35698 "either the default mode that the file is created with or modifies the mode "
35703 #: ../src/guestfs.pod:525
35705 "The default umask is C<022>, so files are created with modes such as C<0644> "
35706 "and directories with C<0755>."
35710 #: ../src/guestfs.pod:528
35712 "There are two ways to avoid being affected by umask. Either set umask to 0 "
35713 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
35714 "L</guestfs_chmod> after creating each file or directory."
35718 #: ../src/guestfs.pod:532
35719 msgid "For more information about umask, see L<umask(2)>."
35723 #: ../src/guestfs.pod:536
35725 "Libguestfs allows you to access Linux guests which have been encrypted using "
35726 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
35727 "standard. This includes nearly all whole disk encryption systems used by "
35728 "modern Linux guests."
35732 #: ../src/guestfs.pod:542
35734 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
35735 "returns the string C<crypto_LUKS>)."
35739 #: ../src/guestfs.pod:545
35741 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
35742 "will require the passphrase!"
35746 #: ../src/guestfs.pod:548
35748 "Opening a LUKS device creates a new device mapper device called "
35749 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
35750 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
35751 "decrypted from and encrypted to the underlying block device respectively."
35755 #: ../src/guestfs.pod:554
35757 "LVM volume groups on the device can be made visible by calling "
35758 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
35759 "volume(s) can now be mounted in the usual way."
35763 #: ../src/guestfs.pod:558
35765 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
35766 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
35767 "[\"/dev/VG\"])>. Then close the mapper device by calling "
35768 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
35769 "underlying encrypted block device)."
35773 #: ../src/guestfs.pod:565
35778 #: ../src/guestfs.pod:567
35780 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
35781 "contains operating systems, an install CD or a live CD. (These APIs used to "
35782 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
35783 "version 1.5.3 the most frequently used part of this library has been "
35784 "rewritten in C and moved into the core code)."
35788 #: ../src/guestfs.pod:574
35790 "Add all disks belonging to the unknown virtual machine and call "
35791 "L</guestfs_launch> in the usual way."
35795 #: ../src/guestfs.pod:577
35797 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
35798 "and certain heuristics, and returns a list of operating systems that were "
35799 "found. An empty list means none were found. A single element is the root "
35800 "filesystem of the operating system. For dual- or multi-boot guests, "
35801 "multiple roots can be returned, each one corresponding to a separate "
35802 "operating system. (Multi-boot virtual machines are extremely rare in the "
35803 "world of virtualization, but since this scenario can happen, we have built "
35804 "libguestfs to deal with it.)"
35808 #: ../src/guestfs.pod:586
35810 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
35811 "to get additional details about that operating system. For example, call "
35812 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
35813 "Windows and Linux-based operating systems respectively."
35817 #: ../src/guestfs.pod:592
35819 "Un*x-like and Linux-based operating systems usually consist of several "
35820 "filesystems which are mounted at boot time (for example, a separate boot "
35821 "partition mounted on C</boot>). The inspection rules are able to detect how "
35822 "filesystems correspond to mount points. Call "
35823 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
35824 "hash table like this example:"
35828 #: ../src/guestfs.pod:599
35831 " /boot => /dev/sda1\n"
35832 " / => /dev/vg_guest/lv_root\n"
35833 " /usr => /dev/vg_guest/lv_usr\n"
35838 #: ../src/guestfs.pod:603
35840 "The caller can then make calls to L</guestfs_mount_options> to mount the "
35841 "filesystems as suggested."
35845 #: ../src/guestfs.pod:606
35847 "Be careful to mount filesystems in the right order (eg. C</> before "
35848 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
35853 #: ../src/guestfs.pod:610
35855 "Inspection currently only works for some common operating systems. "
35856 "Contributors are welcome to send patches for other operating systems that we "
35857 "currently cannot detect."
35861 #: ../src/guestfs.pod:614
35863 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
35864 "for more details. The L</guestfs_inspect_os> function just ignores any "
35865 "encrypted devices."
35869 #: ../src/guestfs.pod:618
35871 "A note on the implementation: The call L</guestfs_inspect_os> performs "
35872 "inspection and caches the results in the guest handle. Subsequent calls to "
35873 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
35874 "re-read the disks. If you change the content of the guest disks, you can "
35875 "redo inspection by calling L</guestfs_inspect_os> again. "
35876 "(L</guestfs_inspect_list_applications> works a little differently from the "
35877 "other calls and does read the disks. See documentation for that function "
35882 #: ../src/guestfs.pod:627
35883 msgid "INSPECTING INSTALL DISKS"
35887 #: ../src/guestfs.pod:629
35889 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
35894 #: ../src/guestfs.pod:632
35896 "Call L</guestfs_inspect_get_format> to return the format of the operating "
35897 "system, which currently can be C<installed> (a regular operating system) or "
35898 "C<installer> (some sort of install disk)."
35902 #: ../src/guestfs.pod:636
35904 "Further information is available about the operating system that can be "
35905 "installed using the regular inspection APIs like "
35906 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
35911 #: ../src/guestfs.pod:641
35913 "Some additional information specific to installer disks is also available "
35914 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
35915 "L</guestfs_inspect_is_multipart> calls."
35919 #: ../src/guestfs.pod:646
35920 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
35924 #: ../src/guestfs.pod:648
35926 "Libguestfs can mount NTFS partitions. It does this using the "
35927 "L<http://www.ntfs-3g.org/> driver."
35931 #: ../src/guestfs.pod:651
35932 msgid "DRIVE LETTERS AND PATHS"
35936 #: ../src/guestfs.pod:653
35938 "DOS and Windows still use drive letters, and the filesystems are always "
35939 "treated as case insensitive by Windows itself, and therefore you might find "
35940 "a Windows configuration file referring to a path like "
35941 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
35942 "that directory might be referred to as C</WINDOWS/System32>."
35946 #: ../src/guestfs.pod:659
35948 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
35949 "L</guestfs_inspect_get_drive_mappings>)"
35953 #: ../src/guestfs.pod:662
35955 "Dealing with separator characters (backslash vs forward slash) is outside "
35956 "the scope of libguestfs, but usually a simple character replacement will "
35961 #: ../src/guestfs.pod:666
35963 "To resolve the case insensitivity of paths, call "
35964 "L</guestfs_case_sensitive_path>."
35968 #: ../src/guestfs.pod:669
35969 msgid "ACCESSING THE WINDOWS REGISTRY"
35973 #: ../src/guestfs.pod:671
35975 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
35976 "files, through the library C<hivex> which is part of the libguestfs project "
35977 "although ships as a separate tarball. You have to locate and download the "
35978 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
35979 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
35980 "L<virt-win-reg(1)> for more help on this issue."
35984 #: ../src/guestfs.pod:679
35985 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
35989 #: ../src/guestfs.pod:681
35991 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
35992 "provide something which looks like a Linux symlink. The way it tries to do "
35993 "the rewriting is described here:"
35997 #: ../src/guestfs.pod:685
35998 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
36002 #: ../src/guestfs.pod:687
36004 "The essential problem is that ntfs-3g simply does not have enough "
36005 "information to do a correct job. NTFS links can contain drive letters and "
36006 "references to external device GUIDs that ntfs-3g has no way of resolving. "
36007 "It is almost certainly the case that libguestfs callers should ignore what "
36008 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
36012 #: ../src/guestfs.pod:694
36014 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
36015 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
36016 "attribute, and read the raw reparse data from that (you can find the format "
36017 "documented in various places around the web)."
36021 #: ../src/guestfs.pod:699
36022 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
36026 #: ../src/guestfs.pod:701
36028 "There are other useful extended attributes that can be read from ntfs-3g "
36029 "filesystems (using L</guestfs_getxattr>). See:"
36033 #: ../src/guestfs.pod:704
36034 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
36038 #: ../src/guestfs.pod:706
36039 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
36043 #: ../src/guestfs.pod:708
36045 "Although we don't want to discourage you from using the C API, we will "
36046 "mention here that the same API is also available in other languages."
36050 #: ../src/guestfs.pod:711
36052 "The API is broadly identical in all supported languages. This means that "
36053 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
36054 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
36055 "OCaml. In other words, a straightforward, predictable isomorphism between "
36060 #: ../src/guestfs.pod:717
36062 "Error messages are automatically transformed into exceptions if the language "
36067 #: ../src/guestfs.pod:720
36069 "We don't try to \"object orientify\" parts of the API in OO languages, "
36070 "although contributors are welcome to write higher level APIs above what we "
36071 "provide in their favourite languages if they wish."
36075 #: ../src/guestfs.pod:726
36080 #: ../src/guestfs.pod:728
36082 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
36083 "identical to the C API. C++ classes and exceptions are not used."
36087 #: ../src/guestfs.pod:732
36092 #: ../src/guestfs.pod:734
36094 "The C# bindings are highly experimental. Please read the warnings at the "
36095 "top of C<csharp/Libguestfs.cs>."
36099 #: ../src/guestfs.pod:737
36104 #: ../src/guestfs.pod:739
36105 msgid "See L<guestfs-erlang(3)>."
36109 #: ../src/guestfs.pod:741
36114 #: ../src/guestfs.pod:743
36116 "This is the only language binding that is working but incomplete. Only "
36117 "calls which return simple integers have been bound in Haskell, and we are "
36118 "looking for help to complete this binding."
36122 #: ../src/guestfs.pod:747
36127 #: ../src/guestfs.pod:749
36129 "Full documentation is contained in the Javadoc which is distributed with "
36130 "libguestfs. For examples, see L<guestfs-java(3)>."
36134 #: ../src/guestfs.pod:752
36139 #: ../src/guestfs.pod:754
36140 msgid "See L<guestfs-ocaml(3)>."
36144 #: ../src/guestfs.pod:756
36149 #: ../src/guestfs.pod:758
36150 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
36154 #: ../src/guestfs.pod:760
36159 #: ../src/guestfs.pod:762
36161 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
36162 "the php-libguestfs package for your distribution."
36166 #: ../src/guestfs.pod:765
36167 msgid "The PHP binding only works correctly on 64 bit machines."
36171 #: ../src/guestfs.pod:767
36176 #: ../src/guestfs.pod:769
36177 msgid "See L<guestfs-python(3)>."
36181 #: ../src/guestfs.pod:771
36186 #: ../src/guestfs.pod:773
36187 msgid "See L<guestfs-ruby(3)>."
36191 #: ../src/guestfs.pod:775
36192 msgid "B<shell scripts>"
36196 #: ../src/guestfs.pod:777
36197 msgid "See L<guestfish(1)>."
36201 #: ../src/guestfs.pod:781
36202 msgid "LIBGUESTFS GOTCHAS"
36206 #: ../src/guestfs.pod:783
36208 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
36209 "system [...] that works in the way it is documented but is counterintuitive "
36210 "and almost invites mistakes.\""
36214 #: ../src/guestfs.pod:787
36216 "Since we developed libguestfs and the associated tools, there are several "
36217 "things we would have designed differently, but are now stuck with for "
36218 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
36219 "release, you can expect these to change. Beware of them."
36223 #: ../src/guestfs.pod:795
36224 msgid "Autosync / forgetting to sync."
36228 #: ../src/guestfs.pod:797
36230 "I<Update:> Autosync is enabled by default for all API users starting from "
36231 "libguestfs 1.5.24. This section only applies to older versions."
36235 #: ../src/guestfs.pod:800
36237 "When modifying a filesystem from C or another language, you B<must> unmount "
36238 "all filesystems and call L</guestfs_sync> explicitly before you close the "
36239 "libguestfs handle. You can also call:"
36243 #: ../src/guestfs.pod:804
36246 " guestfs_set_autosync (g, 1);\n"
36251 #: ../src/guestfs.pod:806
36253 "to have the unmount/sync done automatically for you when the handle 'g' is "
36254 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
36259 #: ../src/guestfs.pod:810
36261 "If you forget to do this, then it is entirely possible that your changes "
36262 "won't be written out, or will be partially written, or (very rarely) that "
36263 "you'll get disk corruption."
36267 #: ../src/guestfs.pod:814
36269 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
36270 "guestfish scripts that forget to sync will work just fine, which can make "
36271 "this very puzzling if you are trying to debug a problem."
36275 #: ../src/guestfs.pod:818
36276 msgid "Mount option C<-o sync> should not be the default."
36280 #: ../src/guestfs.pod:820
36282 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
36283 "libguestfs 1.13.16. This section only applies to older versions."
36287 #: ../src/guestfs.pod:823
36289 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
36290 "However C<-o sync> does not add any reliability benefit, but does have a "
36291 "very large performance impact."
36295 #: ../src/guestfs.pod:827
36297 "The work around is to use L</guestfs_mount_options> and set the mount "
36298 "options that you actually want to use."
36302 #: ../src/guestfs.pod:830
36303 msgid "Read-only should be the default."
36307 #: ../src/guestfs.pod:832
36309 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
36310 "specify I<--rw> if you want to make changes to the image."
36314 #: ../src/guestfs.pod:835
36315 msgid "This would reduce the potential to corrupt live VM images."
36319 #: ../src/guestfs.pod:837
36321 "Note that many filesystems change the disk when you just mount and unmount, "
36322 "even if you didn't perform any writes. You need to use "
36323 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
36327 #: ../src/guestfs.pod:841
36328 msgid "guestfish command line is hard to use."
36332 #: ../src/guestfs.pod:843
36334 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
36335 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
36336 "exist, so it fails. In earlier versions of guestfish the error message was "
36337 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
36338 "we should have used C<guestfish -c command> to run commands."
36342 #: ../src/guestfs.pod:850
36343 msgid "guestfish megabyte modifiers don't work right on all commands"
36347 #: ../src/guestfs.pod:852
36349 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
36350 "other modifiers). What guestfish actually does is to multiply the number "
36351 "part by the modifier part and pass the result to the C API. However this "
36352 "doesn't work for a few APIs which aren't expecting bytes, but are already "
36353 "expecting some other unit (eg. megabytes)."
36357 #: ../src/guestfs.pod:859
36358 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
36362 #: ../src/guestfs.pod:861
36365 " lvcreate LV VG 100M\n"
36370 #: ../src/guestfs.pod:863
36372 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
36373 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
36374 "megabytes * megabytes) logical volume. The error message you get from this "
36375 "is also a little obscure."
36379 #: ../src/guestfs.pod:868
36381 "This could be fixed in the generator by specially marking parameters and "
36382 "return values which take bytes or other units."
36386 #: ../src/guestfs.pod:871
36387 msgid "Ambiguity between devices and paths"
36391 #: ../src/guestfs.pod:873
36393 "There is a subtle ambiguity in the API between a device name "
36394 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
36395 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
36399 #: ../src/guestfs.pod:878
36401 "In the current API we usually resolve this ambiguity by having two separate "
36402 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
36403 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
36404 "detecting if the path supplied begins with C</dev/>."
36408 #: ../src/guestfs.pod:884
36410 "To avoid both the ambiguity and the need to duplicate some calls, we could "
36411 "make paths/devices into structured names. One way to do this would be to "
36412 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
36413 "aspect of grub. Another way would be to use a structured type, equivalent "
36414 "to this OCaml type:"
36418 #: ../src/guestfs.pod:890
36421 " type path = Path of string | Device of int | Partition of int * int\n"
36426 #: ../src/guestfs.pod:892
36427 msgid "which would allow you to pass arguments like:"
36431 #: ../src/guestfs.pod:894
36434 " Path \"/foo/bar\"\n"
36435 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
36436 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
36437 " Path \"/dev/sdb2\" (* not a device *)\n"
36442 #: ../src/guestfs.pod:899
36444 "As you can see there are still problems to resolve even with this "
36445 "representation. Also consider how it might work in guestfish."
36449 #: ../src/guestfs.pod:904
36450 msgid "KEYS AND PASSPHRASES"
36454 #: ../src/guestfs.pod:906
36456 "Certain libguestfs calls take a parameter that contains sensitive key "
36457 "material, passed in as a C string."
36461 #: ../src/guestfs.pod:909
36463 "In the future we would hope to change the libguestfs implementation so that "
36464 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
36465 "swap. However this is I<not> done at the moment, because of the complexity "
36466 "of such an implementation."
36470 #: ../src/guestfs.pod:914
36472 "Therefore you should be aware that any key parameter you pass to libguestfs "
36473 "might end up being written out to the swap partition. If this is a concern, "
36474 "scrub the swap partition or don't use libguestfs on encrypted devices."
36478 #: ../src/guestfs.pod:919
36479 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
36483 #: ../src/guestfs.pod:921
36485 "All high-level libguestfs actions are synchronous. If you want to use "
36486 "libguestfs asynchronously then you must create a thread."
36490 #: ../src/guestfs.pod:924
36492 "Only use the handle from a single thread. Either use the handle exclusively "
36493 "from one thread, or provide your own mutex so that two threads cannot issue "
36494 "calls on the same handle at the same time."
36498 #: ../src/guestfs.pod:928
36500 "See the graphical program guestfs-browser for one possible architecture for "
36501 "multithreaded programs using libvirt and libguestfs."
36505 #: ../src/guestfs.pod:931
36510 #: ../src/guestfs.pod:933
36512 "Libguestfs needs a supermin appliance, which it finds by looking along an "
36517 #: ../src/guestfs.pod:936
36519 "By default it looks for these in the directory C<$libdir/guestfs> "
36520 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
36524 #: ../src/guestfs.pod:939
36526 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
36527 "to change the directories that libguestfs will search in. The value is a "
36528 "colon-separated list of paths. The current directory is I<not> searched "
36529 "unless the path contains an empty element or C<.>. For example "
36530 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
36531 "then C</usr/lib/guestfs>."
36535 #: ../src/guestfs.pod:946
36536 msgid "QEMU WRAPPERS"
36540 #: ../src/guestfs.pod:948
36542 "If you want to compile your own qemu, run qemu from a non-standard location, "
36543 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
36548 #: ../src/guestfs.pod:952
36550 "There is one important rule to remember: you I<must C<exec qemu>> as the "
36551 "last command in the shell script (so that qemu replaces the shell and "
36552 "becomes the direct child of the libguestfs-using program). If you don't do "
36553 "this, then the qemu process won't be cleaned up correctly."
36557 #: ../src/guestfs.pod:957
36559 "Here is an example of a wrapper, where I have built my own copy of qemu from "
36564 #: ../src/guestfs.pod:960
36568 " qemudir=/home/rjones/d/qemu\n"
36569 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
36575 #: ../src/guestfs.pod:964
36577 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
36578 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
36583 #: ../src/guestfs.pod:968
36586 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
36591 #: ../src/guestfs.pod:970
36593 "Note that libguestfs also calls qemu with the -help and -version options in "
36594 "order to determine features."
36598 #: ../src/guestfs.pod:973
36600 "Wrappers can also be used to edit the options passed to qemu. In the "
36601 "following example, the C<-machine ...> option (C<-machine> and the following "
36602 "argument) are removed from the command line and replaced with C<-machine "
36603 "pc,accel=tcg>. The while loop iterates over the options until it finds the "
36604 "right one to remove, putting the remaining options into the C<args> array."
36608 #: ../src/guestfs.pod:982
36612 " while [ $# -gt 0 ]; do\n"
36613 " case \"$1\" in\n"
36617 " args[i]=\"$1\"\n"
36626 #: ../src/guestfs.pod:994
36629 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
36634 #: ../src/guestfs.pod:996
36635 msgid "ATTACHING TO RUNNING DAEMONS"
36639 #: ../src/guestfs.pod:998
36641 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
36642 "babies. Use with caution."
36646 #: ../src/guestfs.pod:1001
36648 "I<Note (2):> This section explains how to attach to a running daemon from a "
36649 "low level perspective. For most users, simply using virt tools such as "
36650 "L<guestfish(1)> with the I<--live> option will \"just work\"."
36654 #: ../src/guestfs.pod:1005
36655 msgid "Using guestfs_set_attach_method"
36659 #: ../src/guestfs.pod:1007
36661 "By calling L</guestfs_set_attach_method> you can change how the library "
36662 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
36663 "L</ARCHITECTURE> for some background)."
36667 #: ../src/guestfs.pod:1011
36669 "The normal attach method is C<appliance>, where a small appliance is created "
36670 "containing the daemon, and then the library connects to this."
36674 #: ../src/guestfs.pod:1014
36676 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
36677 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
36678 "daemon over the Unix domain socket."
36682 #: ../src/guestfs.pod:1018
36684 "The normal use for this is to connect to a running virtual machine that "
36685 "contains a C<guestfsd> daemon, and send commands so you can read and write "
36686 "files inside the live virtual machine."
36690 #: ../src/guestfs.pod:1022
36691 msgid "Using guestfs_add_domain with live flag"
36695 #: ../src/guestfs.pod:1024
36697 "L</guestfs_add_domain> provides some help for getting the correct attach "
36698 "method. If you pass the C<live> option to this function, then (if the "
36699 "virtual machine is running) it will examine the libvirt XML looking for a "
36700 "virtio-serial channel to connect to:"
36704 #: ../src/guestfs.pod:1030
36711 " <channel type='unix'>\n"
36712 " <source mode='bind' path='/path/to/socket'/>\n"
36713 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
36722 #: ../src/guestfs.pod:1042
36724 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
36725 "method to C<unix:/path/to/socket>."
36729 #: ../src/guestfs.pod:1045
36731 "Some of the libguestfs tools (including guestfish) support a I<--live> "
36732 "option which is passed through to L</guestfs_add_domain> thus allowing you "
36733 "to attach to and modify live virtual machines."
36737 #: ../src/guestfs.pod:1049
36739 "The virtual machine needs to have been set up beforehand so that it has the "
36740 "virtio-serial channel and so that guestfsd is running inside it."
36744 #: ../src/guestfs.pod:1053
36745 msgid "ABI GUARANTEE"
36749 #: ../src/guestfs.pod:1055
36751 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
36752 "actions as outlined in this section. Although we will deprecate some "
36753 "actions, for example if they get replaced by newer calls, we will keep the "
36754 "old actions forever. This allows you the developer to program in confidence "
36755 "against the libguestfs API."
36759 #: ../src/guestfs.pod:1061
36760 msgid "BLOCK DEVICE NAMING"
36764 #: ../src/guestfs.pod:1063
36766 "In the kernel there is now quite a profusion of schemata for naming block "
36767 "devices (in this context, by I<block device> I mean a physical or virtual "
36768 "hard drive). The original Linux IDE driver used names starting with "
36769 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
36770 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
36771 "replacement for the old IDE driver (particularly for SATA devices) those "
36772 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
36773 "machines with paravirtualized drivers. This has created several different "
36774 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
36779 #: ../src/guestfs.pod:1075
36781 "As discussed above, libguestfs uses a qemu appliance running an embedded "
36782 "Linux kernel to access block devices. We can run a variety of appliances "
36783 "based on a variety of Linux kernels."
36787 #: ../src/guestfs.pod:1079
36789 "This causes a problem for libguestfs because many API calls use device or "
36790 "partition names. Working scripts and the recipe (example) scripts that we "
36791 "make available over the internet could fail if the naming scheme changes."
36795 #: ../src/guestfs.pod:1084
36797 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
36798 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
36799 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
36800 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
36804 #: ../src/guestfs.pod:1090
36806 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
36807 "L</guestfs_list_partitions> and similar calls return the true names of the "
36808 "devices and partitions as known to the appliance."
36812 #: ../src/guestfs.pod:1095
36813 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
36817 #: ../src/guestfs.pod:1097
36819 "Usually this translation is transparent. However in some (very rare) cases "
36820 "you may need to know the exact algorithm. Such cases include where you use "
36821 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
36822 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
36827 #: ../src/guestfs.pod:1103
36829 "The algorithm is applied only to I<parameters> which are known to be either "
36830 "device or partition names. Return values from functions such as "
36831 "L</guestfs_list_devices> are never changed."
36835 #: ../src/guestfs.pod:1111
36836 msgid "Is the string a parameter which is a device or partition name?"
36840 #: ../src/guestfs.pod:1115
36841 msgid "Does the string begin with C</dev/sd>?"
36845 #: ../src/guestfs.pod:1119
36847 "Does the named device exist? If so, we use that device. However if I<not> "
36848 "then we continue with this algorithm."
36852 #: ../src/guestfs.pod:1124
36853 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
36857 #: ../src/guestfs.pod:1126
36858 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
36862 #: ../src/guestfs.pod:1128
36863 msgid "If that named device exists, use it. If not, continue."
36867 #: ../src/guestfs.pod:1132
36868 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
36872 #: ../src/guestfs.pod:1134
36873 msgid "If that named device exists, use it. If not, return an error."
36877 #: ../src/guestfs.pod:1138
36878 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
36882 #: ../src/guestfs.pod:1140
36884 "Although the standard naming scheme and automatic translation is useful for "
36885 "simple programs and guestfish scripts, for larger programs it is best not to "
36886 "rely on this mechanism."
36890 #: ../src/guestfs.pod:1144
36892 "Where possible for maximum future portability programs using libguestfs "
36893 "should use these future-proof techniques:"
36897 #: ../src/guestfs.pod:1151
36899 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
36900 "device names, and then use those names directly."
36904 #: ../src/guestfs.pod:1154
36905 msgid "Since those device names exist by definition, they will never be translated."
36909 #: ../src/guestfs.pod:1159
36911 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
36912 "filesystem labels."
36916 #: ../src/guestfs.pod:1166
36918 "This section discusses security implications of using libguestfs, "
36919 "particularly with untrusted or malicious guests or disk images."
36923 #: ../src/guestfs.pod:1169
36924 msgid "GENERAL SECURITY CONSIDERATIONS"
36928 #: ../src/guestfs.pod:1171
36930 "Be careful with any files or data that you download from a guest (by "
36931 "\"download\" we mean not just the L</guestfs_download> command but any "
36932 "command that reads files, filenames, directories or anything else from a "
36933 "disk image). An attacker could manipulate the data to fool your program "
36934 "into doing the wrong thing. Consider cases such as:"
36938 #: ../src/guestfs.pod:1181
36939 msgid "the data (file etc) not being present"
36943 #: ../src/guestfs.pod:1185
36944 msgid "being present but empty"
36948 #: ../src/guestfs.pod:1189
36949 msgid "being much larger than normal"
36953 #: ../src/guestfs.pod:1193
36954 msgid "containing arbitrary 8 bit data"
36958 #: ../src/guestfs.pod:1197
36959 msgid "being in an unexpected character encoding"
36963 #: ../src/guestfs.pod:1201
36964 msgid "containing homoglyphs."
36968 #: ../src/guestfs.pod:1205
36969 msgid "SECURITY OF MOUNTING FILESYSTEMS"
36973 #: ../src/guestfs.pod:1207
36975 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
36976 "(VFS) module can sometimes be escalated into exploits by deliberately "
36977 "creating a malicious, malformed filesystem. These exploits are very severe "
36978 "for two reasons. Firstly there are very many filesystem drivers in the "
36979 "kernel, and many of them are infrequently used and not much developer "
36980 "attention has been paid to the code. Linux userspace helps potential "
36981 "crackers by detecting the filesystem type and automatically choosing the "
36982 "right VFS driver, even if that filesystem type is obscure or unexpected for "
36983 "the administrator. Secondly, a kernel-level exploit is like a local root "
36984 "exploit (worse in some ways), giving immediate and total access to the "
36985 "system right down to the hardware level."
36989 #: ../src/guestfs.pod:1220
36991 "That explains why you should never mount a filesystem from an untrusted "
36992 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
36993 "inside a qemu virtual machine, usually running as a non-root user. The "
36994 "attacker would need to write a filesystem which first exploited the kernel, "
36995 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
36996 "the libguestfs protocol, and finally to be as serious as the host kernel "
36997 "exploit it would need to escalate its privileges to root. This multi-step "
36998 "escalation, performed by a static piece of data, is thought to be extremely "
36999 "hard to do, although we never say 'never' about security issues."
37003 #: ../src/guestfs.pod:1231
37005 "In any case callers can reduce the attack surface by forcing the filesystem "
37006 "type when mounting (use L</guestfs_mount_vfs>)."
37010 #: ../src/guestfs.pod:1234
37011 msgid "PROTOCOL SECURITY"
37015 #: ../src/guestfs.pod:1236
37017 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
37018 "defined upper message size. However a program that uses libguestfs must "
37019 "also take care - for example you can write a program that downloads a binary "
37020 "from a disk image and executes it locally, and no amount of protocol "
37021 "security will save you from the consequences."
37025 #: ../src/guestfs.pod:1242
37026 msgid "INSPECTION SECURITY"
37030 #: ../src/guestfs.pod:1244
37032 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
37033 "directly from the guest, and these could contain any 8 bit data. Callers "
37034 "should be careful to escape these before printing them to a structured file "
37035 "(for example, use HTML escaping if creating a web page)."
37039 #: ../src/guestfs.pod:1250
37041 "Guest configuration may be altered in unusual ways by the administrator of "
37042 "the virtual machine, and may not reflect reality (particularly for untrusted "
37043 "or actively malicious guests). For example we parse the hostname from "
37044 "configuration files like C</etc/sysconfig/network> that we find in the "
37045 "guest, but the guest administrator can easily manipulate these files to "
37046 "provide the wrong hostname."
37050 #: ../src/guestfs.pod:1258
37052 "The inspection API parses guest configuration using two external libraries: "
37053 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
37054 "designed to be robust in the face of malicious data, although denial of "
37055 "service attacks are still possible, for example with oversized configuration "
37060 #: ../src/guestfs.pod:1264
37061 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
37065 #: ../src/guestfs.pod:1266
37067 "Be very cautious about running commands from the guest. By running a "
37068 "command in the guest, you are giving CPU time to a binary that you do not "
37069 "control, under the same user account as the library, albeit wrapped in qemu "
37070 "virtualization. More information and alternatives can be found in the "
37071 "section L</RUNNING COMMANDS>."
37075 #: ../src/guestfs.pod:1272
37076 msgid "CVE-2010-3851"
37080 #: ../src/guestfs.pod:1274
37081 msgid "https://bugzilla.redhat.com/642934"
37085 #: ../src/guestfs.pod:1276
37087 "This security bug concerns the automatic disk format detection that qemu "
37088 "does on disk images."
37092 #: ../src/guestfs.pod:1279
37094 "A raw disk image is just the raw bytes, there is no header. Other disk "
37095 "images like qcow2 contain a special header. Qemu deals with this by looking "
37096 "for one of the known headers, and if none is found then assuming the disk "
37097 "image must be raw."
37101 #: ../src/guestfs.pod:1284
37103 "This allows a guest which has been given a raw disk image to write some "
37104 "other header. At next boot (or when the disk image is accessed by "
37105 "libguestfs) qemu would do autodetection and think the disk image format was, "
37106 "say, qcow2 based on the header written by the guest."
37110 #: ../src/guestfs.pod:1289
37112 "This in itself would not be a problem, but qcow2 offers many features, one "
37113 "of which is to allow a disk image to refer to another image (called the "
37114 "\"backing disk\"). It does this by placing the path to the backing disk "
37115 "into the qcow2 header. This path is not validated and could point to any "
37116 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
37117 "\"holes\" in the qcow2 disk image, which of course is completely under the "
37118 "control of the attacker."
37122 #: ../src/guestfs.pod:1297
37123 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
37127 #: ../src/guestfs.pod:1304
37128 msgid "You have enabled the network or have opened the disk in write mode."
37132 #: ../src/guestfs.pod:1308
37134 "You are also running untrusted code from the guest (see L</RUNNING "
37139 #: ../src/guestfs.pod:1313
37141 "The way to avoid this is to specify the expected disk format when adding "
37142 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
37143 "should always do this if the disk is raw format, and it's a good idea for "
37148 #: ../src/guestfs.pod:1318
37150 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
37151 "format is fetched from libvirt and passed through."
37155 #: ../src/guestfs.pod:1321
37157 "For libguestfs tools, use the I<--format> command line parameter as "
37162 #: ../src/guestfs.pod:1324
37163 msgid "CONNECTION MANAGEMENT"
37167 #: ../src/guestfs.pod:1326
37168 msgid "guestfs_h *"
37172 #: ../src/guestfs.pod:1328
37174 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
37175 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
37176 "handle and release all resources used."
37180 #: ../src/guestfs.pod:1332
37182 "For information on using multiple handles and threads, see the section "
37183 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
37187 #: ../src/guestfs.pod:1335
37188 msgid "guestfs_create"
37192 #: ../src/guestfs.pod:1337
37195 " guestfs_h *guestfs_create (void);\n"
37200 #: ../src/guestfs.pod:1339
37201 msgid "Create a connection handle."
37205 #: ../src/guestfs.pod:1341
37207 "On success this returns a non-NULL pointer to a handle. On error it returns "
37212 #: ../src/guestfs.pod:1344
37214 "You have to \"configure\" the handle after creating it. This includes "
37215 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
37216 "handle at least once."
37220 #: ../src/guestfs.pod:1348
37221 msgid "After configuring the handle, you have to call L</guestfs_launch>."
37225 #: ../src/guestfs.pod:1350
37227 "You may also want to configure error handling for the handle. See the "
37228 "L</ERROR HANDLING> section below."
37232 #: ../src/guestfs.pod:1353
37233 msgid "guestfs_close"
37237 #: ../src/guestfs.pod:1355
37240 " void guestfs_close (guestfs_h *g);\n"
37245 #: ../src/guestfs.pod:1357
37246 msgid "This closes the connection handle and frees up all resources used."
37250 #: ../src/guestfs.pod:1359
37252 "If autosync was set on the handle and the handle was launched, then this "
37253 "implicitly calls various functions to unmount filesystems and sync the "
37254 "disk. See L</guestfs_set_autosync> for more details."
37258 #: ../src/guestfs.pod:1363
37259 msgid "If a close callback was set on the handle, then it is called."
37263 #: ../src/guestfs.pod:1365
37264 msgid "ERROR HANDLING"
37268 #: ../src/guestfs.pod:1367
37270 "API functions can return errors. For example, almost all functions that "
37271 "return C<int> will return C<-1> to indicate an error."
37275 #: ../src/guestfs.pod:1370
37277 "Additional information is available for errors: an error message string and "
37278 "optionally an error number (errno) if the thing that failed was a system "
37283 #: ../src/guestfs.pod:1374
37285 "You can get at the additional information about the last error on the handle "
37286 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
37287 "up an error handler with L</guestfs_set_error_handler>."
37291 #: ../src/guestfs.pod:1379
37293 "When the handle is created, a default error handler is installed which "
37294 "prints the error message string to C<stderr>. For small short-running "
37295 "command line programs it is sufficient to do:"
37299 #: ../src/guestfs.pod:1383
37302 " if (guestfs_launch (g) == -1)\n"
37303 " exit (EXIT_FAILURE);\n"
37308 #: ../src/guestfs.pod:1386
37310 "since the default error handler will ensure that an error message has been "
37311 "printed to C<stderr> before the program exits."
37315 #: ../src/guestfs.pod:1389
37317 "For other programs the caller will almost certainly want to install an "
37318 "alternate error handler or do error handling in-line like this:"
37322 #: ../src/guestfs.pod:1392
37325 " /* This disables the default behaviour of printing errors\n"
37327 " guestfs_set_error_handler (g, NULL, NULL);\n"
37332 #: ../src/guestfs.pod:1396
37335 " if (guestfs_launch (g) == -1) {\n"
37336 " /* Examine the error message and print it etc. */\n"
37337 " char *msg = guestfs_last_error (g);\n"
37338 " int errnum = guestfs_last_errno (g);\n"
37339 " fprintf (stderr, \"%s\", msg);\n"
37340 " if (errnum != 0)\n"
37341 " fprintf (stderr, \": %s\", strerror (errnum));\n"
37342 " fprintf (stderr, \"\\n\");\n"
37349 #: ../src/guestfs.pod:1407
37351 "Out of memory errors are handled differently. The default action is to call "
37352 "L<abort(3)>. If this is undesirable, then you can set a handler using "
37353 "L</guestfs_set_out_of_memory_handler>."
37357 #: ../src/guestfs.pod:1411
37359 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
37360 "because there is no handle if this happens there is no way to get additional "
37361 "error information. However L</guestfs_create> is supposed to be a "
37362 "lightweight operation which can only fail because of insufficient memory (it "
37363 "returns NULL in this case)."
37367 #: ../src/guestfs.pod:1417
37368 msgid "guestfs_last_error"
37372 #: ../src/guestfs.pod:1419
37375 " const char *guestfs_last_error (guestfs_h *g);\n"
37380 #: ../src/guestfs.pod:1421
37382 "This returns the last error message that happened on C<g>. If there has not "
37383 "been an error since the handle was created, then this returns C<NULL>."
37387 #: ../src/guestfs.pod:1425
37389 "The lifetime of the returned string is until the next error occurs, or "
37390 "L</guestfs_close> is called."
37394 #: ../src/guestfs.pod:1428
37395 msgid "guestfs_last_errno"
37399 #: ../src/guestfs.pod:1430
37402 " int guestfs_last_errno (guestfs_h *g);\n"
37407 #: ../src/guestfs.pod:1432
37408 msgid "This returns the last error number (errno) that happened on C<g>."
37412 #: ../src/guestfs.pod:1434
37413 msgid "If successful, an errno integer not equal to zero is returned."
37417 #: ../src/guestfs.pod:1436
37418 msgid "If no error, this returns 0. This call can return 0 in three situations:"
37422 #: ../src/guestfs.pod:1443
37423 msgid "There has not been any error on the handle."
37427 #: ../src/guestfs.pod:1447
37429 "There has been an error but the errno was meaningless. This corresponds to "
37430 "the case where the error did not come from a failed system call, but for "
37431 "some other reason."
37435 #: ../src/guestfs.pod:1453
37437 "There was an error from a failed system call, but for some reason the errno "
37438 "was not captured and returned. This usually indicates a bug in libguestfs."
37442 #: ../src/guestfs.pod:1459
37444 "Libguestfs tries to convert the errno from inside the applicance into a "
37445 "corresponding errno for the caller (not entirely trivial: the appliance "
37446 "might be running a completely different operating system from the library "
37447 "and error numbers are not standardized across Un*xen). If this could not be "
37448 "done, then the error is translated to C<EINVAL>. In practice this should "
37449 "only happen in very rare circumstances."
37453 #: ../src/guestfs.pod:1467
37454 msgid "guestfs_set_error_handler"
37458 #: ../src/guestfs.pod:1469
37461 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
37463 " const char *msg);\n"
37464 " void guestfs_set_error_handler (guestfs_h *g,\n"
37465 " guestfs_error_handler_cb cb,\n"
37466 " void *opaque);\n"
37471 #: ../src/guestfs.pod:1476
37473 "The callback C<cb> will be called if there is an error. The parameters "
37474 "passed to the callback are an opaque data pointer and the error message "
37479 #: ../src/guestfs.pod:1480
37481 "C<errno> is not passed to the callback. To get that the callback must call "
37482 "L</guestfs_last_errno>."
37486 #: ../src/guestfs.pod:1483
37488 "Note that the message string C<msg> is freed as soon as the callback "
37489 "function returns, so if you want to stash it somewhere you must make your "
37494 #: ../src/guestfs.pod:1487
37495 msgid "The default handler prints messages on C<stderr>."
37499 #: ../src/guestfs.pod:1489
37500 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
37504 #: ../src/guestfs.pod:1491
37505 msgid "guestfs_get_error_handler"
37509 #: ../src/guestfs.pod:1493
37512 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
37513 " void **opaque_rtn);\n"
37518 #: ../src/guestfs.pod:1496
37519 msgid "Returns the current error handler callback."
37523 #: ../src/guestfs.pod:1498
37524 msgid "guestfs_set_out_of_memory_handler"
37528 #: ../src/guestfs.pod:1500
37531 " typedef void (*guestfs_abort_cb) (void);\n"
37532 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
37533 " guestfs_abort_cb);\n"
37538 #: ../src/guestfs.pod:1504
37540 "The callback C<cb> will be called if there is an out of memory situation. "
37541 "I<Note this callback must not return>."
37545 #: ../src/guestfs.pod:1507
37546 msgid "The default is to call L<abort(3)>."
37550 #: ../src/guestfs.pod:1509
37551 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
37555 #: ../src/guestfs.pod:1512
37556 msgid "guestfs_get_out_of_memory_handler"
37560 #: ../src/guestfs.pod:1514
37563 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
37568 #: ../src/guestfs.pod:1516
37569 msgid "This returns the current out of memory handler."
37573 #: ../src/guestfs.pod:1518
37578 #: ../src/guestfs.pod:1522
37583 #: ../src/guestfs.pod:1524
37588 #: ../src/guestfs.pod:1526
37589 msgid "AVAILABILITY"
37593 #: ../src/guestfs.pod:1528
37594 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
37598 #: ../src/guestfs.pod:1530
37600 "Using L</guestfs_available> you can test availability of the following "
37601 "groups of functions. This test queries the appliance to see if the "
37602 "appliance you are currently using supports the functionality."
37606 #: ../src/guestfs.pod:1535
37607 msgid "@AVAILABILITY@"
37611 #: ../src/guestfs.pod:1537
37612 msgid "GUESTFISH supported COMMAND"
37616 #: ../src/guestfs.pod:1539
37618 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
37619 "prints out the available groups and whether they are supported by this build "
37620 "of libguestfs. Note however that you have to do C<run> first."
37624 #: ../src/guestfs.pod:1544
37625 msgid "SINGLE CALLS AT COMPILE TIME"
37629 #: ../src/guestfs.pod:1546
37631 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
37632 "function, such as:"
37636 #: ../src/guestfs.pod:1549
37639 " #define LIBGUESTFS_HAVE_DD 1\n"
37644 #: ../src/guestfs.pod:1551
37645 msgid "if L</guestfs_dd> is available."
37649 #: ../src/guestfs.pod:1553
37651 "Before version 1.5.8, if you needed to test whether a single libguestfs "
37652 "function is available at compile time, we recommended using build tools such "
37653 "as autoconf or cmake. For example in autotools you could use:"
37657 #: ../src/guestfs.pod:1558
37660 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
37661 " AC_CHECK_FUNCS([guestfs_dd])\n"
37666 #: ../src/guestfs.pod:1561
37668 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
37673 #: ../src/guestfs.pod:1564
37674 msgid "SINGLE CALLS AT RUN TIME"
37678 #: ../src/guestfs.pod:1566
37680 "Testing at compile time doesn't guarantee that a function really exists in "
37681 "the library. The reason is that you might be dynamically linked against a "
37682 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
37683 "This situation unfortunately results in a segmentation fault, which is a "
37684 "shortcoming of the C dynamic linking system itself."
37688 #: ../src/guestfs.pod:1573
37690 "You can use L<dlopen(3)> to test if a function is available at run time, as "
37691 "in this example program (note that you still need the compile time check as "
37696 #: ../src/guestfs.pod:1577
37699 " #include <stdio.h>\n"
37700 " #include <stdlib.h>\n"
37701 " #include <unistd.h>\n"
37702 " #include <dlfcn.h>\n"
37703 " #include <guestfs.h>\n"
37708 #: ../src/guestfs.pod:1583
37713 " #ifdef LIBGUESTFS_HAVE_DD\n"
37715 " int has_function;\n"
37720 #: ../src/guestfs.pod:1589
37723 " /* Test if the function guestfs_dd is really available. */\n"
37724 " dl = dlopen (NULL, RTLD_LAZY);\n"
37726 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
37727 " exit (EXIT_FAILURE);\n"
37729 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
37735 #: ../src/guestfs.pod:1598
37738 " if (!has_function)\n"
37739 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
37741 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
37742 " /* Now it's safe to call\n"
37743 " guestfs_dd (g, \"foo\", \"bar\");\n"
37747 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
37754 #: ../src/guestfs.pod:1611
37756 "You may think the above is an awful lot of hassle, and it is. There are "
37757 "other ways outside of the C linking system to ensure that this kind of "
37758 "incompatibility never arises, such as using package versioning:"
37762 #: ../src/guestfs.pod:1616
37765 " Requires: libguestfs >= 1.0.80\n"
37770 #: ../src/guestfs.pod:1618
37771 msgid "CALLS WITH OPTIONAL ARGUMENTS"
37775 #: ../src/guestfs.pod:1620
37777 "A recent feature of the API is the introduction of calls which take optional "
37778 "arguments. In C these are declared 3 ways. The main way is as a call which "
37779 "takes variable arguments (ie. C<...>), as in this example:"
37783 #: ../src/guestfs.pod:1625
37786 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
37791 #: ../src/guestfs.pod:1627
37793 "Call this with a list of optional arguments, terminated by C<-1>. So to "
37794 "call with no optional arguments specified:"
37798 #: ../src/guestfs.pod:1630
37801 " guestfs_add_drive_opts (g, filename, -1);\n"
37806 #: ../src/guestfs.pod:1632
37807 msgid "With a single optional argument:"
37811 #: ../src/guestfs.pod:1634
37814 " guestfs_add_drive_opts (g, filename,\n"
37815 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
37821 #: ../src/guestfs.pod:1638
37826 #: ../src/guestfs.pod:1640
37829 " guestfs_add_drive_opts (g, filename,\n"
37830 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
37831 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
37837 #: ../src/guestfs.pod:1645
37839 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
37844 #: ../src/guestfs.pod:1648
37845 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
37849 #: ../src/guestfs.pod:1650
37851 "The second variant has the same name with the suffix C<_va>, which works the "
37852 "same way but takes a C<va_list>. See the C manual for details. For the "
37853 "example function, this is declared:"
37857 #: ../src/guestfs.pod:1654
37860 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
37861 " va_list args);\n"
37866 #: ../src/guestfs.pod:1657
37867 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
37871 #: ../src/guestfs.pod:1659
37873 "The third variant is useful where you need to construct these calls. You "
37874 "pass in a structure where you fill in the optional fields. The structure "
37875 "has a bitmask as the first element which you must set to indicate which "
37876 "fields you have filled in. For our example function the structure and call "
37881 #: ../src/guestfs.pod:1665
37884 " struct guestfs_add_drive_opts_argv {\n"
37885 " uint64_t bitmask;\n"
37887 " const char *format;\n"
37890 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
37891 " const struct guestfs_add_drive_opts_argv *optargs);\n"
37896 #: ../src/guestfs.pod:1674
37897 msgid "You could call it like this:"
37901 #: ../src/guestfs.pod:1676
37904 " struct guestfs_add_drive_opts_argv optargs = {\n"
37905 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
37906 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
37907 " .readonly = 1,\n"
37908 " .format = \"qcow2\"\n"
37914 #: ../src/guestfs.pod:1683
37917 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
37922 #: ../src/guestfs.pod:1691
37923 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
37927 #: ../src/guestfs.pod:1696
37928 msgid "You do not need to fill in all fields of the structure."
37932 #: ../src/guestfs.pod:1700
37934 "There must be a one-to-one correspondence between fields of the structure "
37935 "that are filled in, and bits set in the bitmask."
37939 #: ../src/guestfs.pod:1705
37940 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
37944 #: ../src/guestfs.pod:1707
37946 "In other languages, optional arguments are expressed in the way that is "
37947 "natural for that language. We refer you to the language-specific "
37948 "documentation for more details on that."
37952 #: ../src/guestfs.pod:1711
37953 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
37957 #: ../src/guestfs.pod:1713
37958 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
37962 #: ../src/guestfs.pod:1715
37964 "B<Note:> This section documents the generic event mechanism introduced in "
37965 "libguestfs 1.10, which you should use in new code if possible. The old "
37966 "functions C<guestfs_set_log_message_callback>, "
37967 "C<guestfs_set_subprocess_quit_callback>, "
37968 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
37969 "C<guestfs_set_progress_callback> are no longer documented in this manual "
37970 "page. Because of the ABI guarantee, the old functions continue to work."
37974 #: ../src/guestfs.pod:1724
37976 "Handles generate events when certain things happen, such as log messages "
37977 "being generated, progress messages during long-running operations, or the "
37978 "handle being closed. The API calls described below let you register a "
37979 "callback to be called when events happen. You can register multiple "
37980 "callbacks (for the same, different or overlapping sets of events), and "
37981 "individually remove callbacks. If callbacks are not removed, then they "
37982 "remain in force until the handle is closed."
37986 #: ../src/guestfs.pod:1732
37988 "In the current implementation, events are only generated synchronously: that "
37989 "means that events (and hence callbacks) can only happen while you are in the "
37990 "middle of making another libguestfs call. The callback is called in the "
37995 #: ../src/guestfs.pod:1737
37997 "Events may contain a payload, usually nothing (void), an array of 64 bit "
37998 "unsigned integers, or a message buffer. Payloads are discussed later on."
38002 #: ../src/guestfs.pod:1741
38003 msgid "CLASSES OF EVENTS"
38007 #: ../src/guestfs.pod:1745
38008 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
38012 #: ../src/guestfs.pod:1748
38014 "The callback function will be called while the handle is being closed "
38015 "(synchronously from L</guestfs_close>)."
38019 #: ../src/guestfs.pod:1751
38021 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
38022 "handles that are open when the program exits. This means that this callback "
38023 "might be called indirectly from L<exit(3)>, which can cause unexpected "
38024 "problems in higher-level languages (eg. if your HLL interpreter has already "
38025 "been cleaned up by the time this is called, and if your callback then jumps "
38026 "into some HLL function)."
38030 #: ../src/guestfs.pod:1758
38032 "If no callback is registered: the handle is closed without any callback "
38037 #: ../src/guestfs.pod:1761
38038 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
38042 #: ../src/guestfs.pod:1764
38044 "The callback function will be called when the child process quits, either "
38045 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
38046 "corresponds to a transition from any state to the CONFIG state)."
38050 #: ../src/guestfs.pod:1768 ../src/guestfs.pod:1777 ../src/guestfs.pod:1894
38051 msgid "If no callback is registered: the event is ignored."
38055 #: ../src/guestfs.pod:1770
38056 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
38060 #: ../src/guestfs.pod:1773
38062 "The callback function will be called when the child process becomes ready "
38063 "first time after it has been launched. (This corresponds to a transition "
38064 "from LAUNCHING to the READY state)."
38068 #: ../src/guestfs.pod:1779
38069 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
38073 #: ../src/guestfs.pod:1782
38075 "Some long-running operations can generate progress messages. If this "
38076 "callback is registered, then it will be called each time a progress message "
38077 "is generated (usually two seconds after the operation started, and three "
38078 "times per second thereafter until it completes, although the frequency may "
38079 "change in future versions)."
38083 #: ../src/guestfs.pod:1788
38085 "The callback receives in the payload four unsigned 64 bit numbers which are "
38086 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
38090 #: ../src/guestfs.pod:1791
38092 "The units of C<total> are not defined, although for some operations C<total> "
38093 "may relate in some way to the amount of data to be transferred (eg. in bytes "
38094 "or megabytes), and C<position> may be the portion which has been "
38099 #: ../src/guestfs.pod:1796
38100 msgid "The only defined and stable parts of the API are:"
38104 #: ../src/guestfs.pod:1802
38106 "The callback can display to the user some type of progress bar or indicator "
38107 "which shows the ratio of C<position>:C<total>."
38111 #: ../src/guestfs.pod:1807
38112 msgid "0 E<lt>= C<position> E<lt>= C<total>"
38116 #: ../src/guestfs.pod:1811
38118 "If any progress notification is sent during a call, then a final progress "
38119 "notification is always sent when C<position> = C<total> (I<unless> the call "
38120 "fails with an error)."
38124 #: ../src/guestfs.pod:1815
38126 "This is to simplify caller code, so callers can easily set the progress "
38127 "indicator to \"100%\" at the end of the operation, without requiring special "
38128 "code to detect this case."
38132 #: ../src/guestfs.pod:1821
38134 "For some calls we are unable to estimate the progress of the call, but we "
38135 "can still generate progress messages to indicate activity. This is known as "
38136 "\"pulse mode\", and is directly supported by certain progress bar "
38137 "implementations (eg. GtkProgressBar)."
38141 #: ../src/guestfs.pod:1826
38143 "For these calls, zero or more progress messages are generated with "
38144 "C<position = 0> and C<total = 1>, followed by a final message with "
38145 "C<position = total = 1>."
38149 #: ../src/guestfs.pod:1830
38151 "As noted above, if the call fails with an error then the final message may "
38152 "not be generated."
38156 #: ../src/guestfs.pod:1835
38158 "The callback also receives the procedure number (C<proc_nr>) and serial "
38159 "number (C<serial>) of the call. These are only useful for debugging "
38160 "protocol issues, and the callback can normally ignore them. The callback "
38161 "may want to print these numbers in error messages or debugging messages."
38165 #: ../src/guestfs.pod:1841
38166 msgid "If no callback is registered: progress messages are discarded."
38170 #: ../src/guestfs.pod:1843
38171 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
38175 #: ../src/guestfs.pod:1846
38177 "The callback function is called whenever a log message is generated by qemu, "
38178 "the appliance kernel, guestfsd (daemon), or utility programs."
38182 #: ../src/guestfs.pod:1849
38184 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
38185 "(L</guestfs_launch>) then additional debug messages are generated."
38189 #: ../src/guestfs.pod:1852 ../src/guestfs.pod:1866
38191 "If no callback is registered: the messages are discarded unless the verbose "
38192 "flag is set in which case they are sent to stderr. You can override the "
38193 "printing of verbose messages to stderr by setting up a callback."
38197 #: ../src/guestfs.pod:1857
38198 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
38202 #: ../src/guestfs.pod:1860
38204 "The callback function is called whenever a log message is generated by the "
38205 "library part of libguestfs."
38209 #: ../src/guestfs.pod:1863
38211 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
38212 "messages are generated."
38216 #: ../src/guestfs.pod:1871
38217 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
38221 #: ../src/guestfs.pod:1874
38223 "The callback function is called whenever a trace message is generated. This "
38224 "only applies if the trace flag (L</guestfs_set_trace>) is set."
38228 #: ../src/guestfs.pod:1877
38230 "If no callback is registered: the messages are sent to stderr. You can "
38231 "override the printing of trace messages to stderr by setting up a callback."
38235 #: ../src/guestfs.pod:1881
38236 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
38240 #: ../src/guestfs.pod:1884
38241 msgid "The callback function is called whenever a libguestfs function is entered."
38245 #: ../src/guestfs.pod:1887
38247 "The payload is a string which contains the name of the function that we are "
38248 "entering (not including C<guestfs_> prefix)."
38252 #: ../src/guestfs.pod:1890
38254 "Note that libguestfs functions can call themselves, so you may see many "
38255 "events from a single call. A few libguestfs functions do not generate this "
38260 #: ../src/guestfs.pod:1898
38261 msgid "guestfs_set_event_callback"
38265 #: ../src/guestfs.pod:1900
38268 " int guestfs_set_event_callback (guestfs_h *g,\n"
38269 " guestfs_event_callback cb,\n"
38270 " uint64_t event_bitmask,\n"
38272 " void *opaque);\n"
38277 #: ../src/guestfs.pod:1906
38279 "This function registers a callback (C<cb>) for all event classes in the "
38280 "C<event_bitmask>."
38284 #: ../src/guestfs.pod:1909
38286 "For example, to register for all log message events, you could call this "
38287 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
38288 "To register a single callback for all possible classes of events, use "
38289 "C<GUESTFS_EVENT_ALL>."
38293 #: ../src/guestfs.pod:1915
38294 msgid "C<flags> should always be passed as 0."
38298 #: ../src/guestfs.pod:1917
38300 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
38301 "it for any purpose."
38305 #: ../src/guestfs.pod:1920
38307 "The return value is the event handle (an integer) which you can use to "
38308 "delete the callback (see below)."
38312 #: ../src/guestfs.pod:1923
38314 "If there is an error, this function returns C<-1>, and sets the error in the "
38315 "handle in the usual way (see L</guestfs_last_error> etc.)"
38319 #: ../src/guestfs.pod:1926
38321 "Callbacks remain in effect until they are deleted, or until the handle is "
38326 #: ../src/guestfs.pod:1929
38328 "In the case where multiple callbacks are registered for a particular event "
38329 "class, all of the callbacks are called. The order in which multiple "
38330 "callbacks are called is not defined."
38334 #: ../src/guestfs.pod:1933
38335 msgid "guestfs_delete_event_callback"
38339 #: ../src/guestfs.pod:1935
38342 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
38347 #: ../src/guestfs.pod:1937
38349 "Delete a callback that was previously registered. C<event_handle> should be "
38350 "the integer that was returned by a previous call to "
38351 "C<guestfs_set_event_callback> on the same handle."
38355 #: ../src/guestfs.pod:1941
38356 msgid "guestfs_event_callback"
38360 #: ../src/guestfs.pod:1943
38363 " typedef void (*guestfs_event_callback) (\n"
38366 " uint64_t event,\n"
38367 " int event_handle,\n"
38369 " const char *buf, size_t buf_len,\n"
38370 " const uint64_t *array, size_t array_len);\n"
38375 #: ../src/guestfs.pod:1952
38376 msgid "This is the type of the event callback function that you have to provide."
38380 #: ../src/guestfs.pod:1955
38382 "The basic parameters are: the handle (C<g>), the opaque user pointer "
38383 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
38384 "handle, and C<flags> which in the current API you should ignore."
38388 #: ../src/guestfs.pod:1959
38390 "The remaining parameters contain the event payload (if any). Each event may "
38391 "contain a payload, which usually relates to the event class, but for future "
38392 "proofing your code should be written to handle any payload for any event "
38397 #: ../src/guestfs.pod:1964
38399 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
38400 "there is no message buffer). Note that this message buffer can contain "
38401 "arbitrary 8 bit data, including NUL bytes."
38405 #: ../src/guestfs.pod:1968
38407 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
38408 "moment this is only used for progress messages."
38412 #: ../src/guestfs.pod:1971
38413 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
38417 #: ../src/guestfs.pod:1973
38419 "One motivation for the generic event API was to allow GUI programs to "
38420 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
38421 "unconditionally to C<stderr>."
38425 #: ../src/guestfs.pod:1977
38427 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
38428 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
38429 "messages are not events; you must capture error messages separately)."
38433 #: ../src/guestfs.pod:1982
38435 "Programs have to set up a callback to capture the classes of events of "
38440 #: ../src/guestfs.pod:1985
38444 " guestfs_set_event_callback\n"
38445 " (g, message_callback,\n"
38446 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
38447 " GUESTFS_EVENT_TRACE,\n"
38448 " 0, NULL) == -1)\n"
38449 " if (eh == -1) {\n"
38450 " // handle error in the usual way\n"
38456 #: ../src/guestfs.pod:1995
38458 "The callback can then direct messages to the appropriate place. In this "
38459 "example, messages are directed to syslog:"
38463 #: ../src/guestfs.pod:1998
38467 " message_callback (\n"
38470 " uint64_t event,\n"
38471 " int event_handle,\n"
38473 " const char *buf, size_t buf_len,\n"
38474 " const uint64_t *array, size_t array_len)\n"
38476 " const int priority = LOG_USER|LOG_INFO;\n"
38477 " if (buf_len > 0)\n"
38478 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
38484 #: ../src/guestfs.pod:2013
38485 msgid "CANCELLING LONG TRANSFERS"
38489 #: ../src/guestfs.pod:2015
38491 "Some operations can be cancelled by the caller while they are in progress. "
38492 "Currently only operations that involve uploading or downloading data can be "
38493 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
38494 "parameters in the generator)."
38498 #: ../src/guestfs.pod:2020
38499 msgid "guestfs_user_cancel"
38503 #: ../src/guestfs.pod:2022
38506 " void guestfs_user_cancel (guestfs_h *g);\n"
38511 #: ../src/guestfs.pod:2024
38512 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
38516 #: ../src/guestfs.pod:2027
38518 "Unlike most other libguestfs calls, this function is signal safe and thread "
38519 "safe. You can call it from a signal handler or from another thread, without "
38520 "needing to do any locking."
38524 #: ../src/guestfs.pod:2031
38526 "The transfer that was in progress (if there is one) will stop shortly "
38527 "afterwards, and will return an error. The errno (see "
38528 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
38529 "out if the operation was cancelled or failed because of another error."
38533 #: ../src/guestfs.pod:2037
38535 "No cleanup is performed: for example, if a file was being uploaded then "
38536 "after cancellation there may be a partially uploaded file. It is the "
38537 "caller's responsibility to clean up if necessary."
38541 #: ../src/guestfs.pod:2041
38542 msgid "There are two common places that you might call C<guestfs_user_cancel>."
38546 #: ../src/guestfs.pod:2043
38548 "In an interactive text-based program, you might call it from a C<SIGINT> "
38549 "signal handler so that pressing C<^C> cancels the current operation. (You "
38550 "also need to call L</guestfs_set_pgroup> so that child processes don't "
38551 "receive the C<^C> signal)."
38555 #: ../src/guestfs.pod:2048
38557 "In a graphical program, when the main thread is displaying a progress bar "
38558 "with a cancel button, wire up the cancel button to call this function."
38562 #: ../src/guestfs.pod:2052
38563 msgid "PRIVATE DATA AREA"
38567 #: ../src/guestfs.pod:2054
38569 "You can attach named pieces of private data to the libguestfs handle, fetch "
38570 "them by name, and walk over them, for the lifetime of the handle. This is "
38571 "called the private data area and is only available from the C API."
38575 #: ../src/guestfs.pod:2059
38576 msgid "To attach a named piece of data, use the following call:"
38580 #: ../src/guestfs.pod:2061
38583 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
38588 #: ../src/guestfs.pod:2063
38590 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
38591 "pointer (which can be C<NULL>). Any previous item with the same key is "
38596 #: ../src/guestfs.pod:2067
38598 "You can use any C<key> you want, but your key should I<not> start with an "
38599 "underscore character. Keys beginning with an underscore character are "
38600 "reserved for internal libguestfs purposes (eg. for implementing language "
38601 "bindings). It is recommended that you prefix the key with some unique "
38602 "string to avoid collisions with other users."
38606 #: ../src/guestfs.pod:2073
38607 msgid "To retrieve the pointer, use:"
38611 #: ../src/guestfs.pod:2075
38614 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
38619 #: ../src/guestfs.pod:2077
38621 "This function returns C<NULL> if either no data is found associated with "
38622 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
38627 #: ../src/guestfs.pod:2081
38629 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
38630 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
38631 "all. In particular, libguestfs does I<not> try to free the data when the "
38632 "handle is closed. If the data must be freed, then the caller must either "
38633 "free it before calling L</guestfs_close> or must set up a close callback to "
38634 "do it (see L</GUESTFS_EVENT_CLOSE>)."
38638 #: ../src/guestfs.pod:2088
38639 msgid "To walk over all entries, use these two functions:"
38643 #: ../src/guestfs.pod:2090
38646 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
38651 #: ../src/guestfs.pod:2092
38654 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
38659 #: ../src/guestfs.pod:2094
38661 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
38662 "not have any particular meaning -- keys are not returned in any defined "
38663 "order). A pointer to the key is returned in C<*key_rtn> and the "
38664 "corresponding data pointer is returned from the function. C<NULL> is "
38665 "returned if there are no keys stored in the handle."
38669 #: ../src/guestfs.pod:2100
38671 "C<guestfs_next_private> returns the next key, pointer pair. The return "
38672 "value of this function is also C<NULL> is there are no further entries to "
38677 #: ../src/guestfs.pod:2104
38678 msgid "Notes about walking over entries:"
38682 #: ../src/guestfs.pod:2110
38683 msgid "You must not call C<guestfs_set_private> while walking over the entries."
38687 #: ../src/guestfs.pod:2115
38689 "The handle maintains an internal iterator which is reset when you call "
38690 "C<guestfs_first_private>. This internal iterator is invalidated when you "
38691 "call C<guestfs_set_private>."
38695 #: ../src/guestfs.pod:2121
38696 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
38700 #: ../src/guestfs.pod:2123
38703 " guestfs_set_private (g, key, NULL);\n"
38708 #: ../src/guestfs.pod:2125
38709 msgid "then that C<key> is not returned when walking."
38713 #: ../src/guestfs.pod:2129
38715 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
38716 "C<guestfs_next_private> or C<guestfs_set_private>."
38720 #: ../src/guestfs.pod:2135
38722 "The following example code shows how to print all keys and data pointers "
38723 "that are associated with the handle C<g>:"
38727 #: ../src/guestfs.pod:2138
38730 " const char *key;\n"
38731 " void *data = guestfs_first_private (g, &key);\n"
38732 " while (data != NULL)\n"
38734 " printf (\"key = %s, data = %p\\n\", key, data);\n"
38735 " data = guestfs_next_private (g, &key);\n"
38741 #: ../src/guestfs.pod:2146
38743 "More commonly you are only interested in keys that begin with an "
38744 "application-specific prefix C<foo_>. Modify the loop like so:"
38748 #: ../src/guestfs.pod:2149
38751 " const char *key;\n"
38752 " void *data = guestfs_first_private (g, &key);\n"
38753 " while (data != NULL)\n"
38755 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
38756 " printf (\"key = %s, data = %p\\n\", key, data);\n"
38757 " data = guestfs_next_private (g, &key);\n"
38763 #: ../src/guestfs.pod:2158
38765 "If you need to modify keys while walking, then you have to jump back to the "
38766 "beginning of the loop. For example, to delete all keys prefixed with "
38771 #: ../src/guestfs.pod:2162
38774 " const char *key;\n"
38777 " data = guestfs_first_private (g, &key);\n"
38778 " while (data != NULL)\n"
38780 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
38782 " guestfs_set_private (g, key, NULL);\n"
38783 " /* note that 'key' pointer is now invalid, and so is\n"
38784 " the internal iterator */\n"
38787 " data = guestfs_next_private (g, &key);\n"
38793 #: ../src/guestfs.pod:2178
38795 "Note that the above loop is guaranteed to terminate because the keys are "
38796 "being deleted, but other manipulations of keys within the loop might not "
38797 "terminate unless you also maintain an indication of which keys have been "
38802 #: ../src/guestfs.pod:2183
38807 #: ../src/guestfs.pod:2185
38809 "The libguestfs C library can be probed using systemtap or DTrace. This is "
38810 "true of any library, not just libguestfs. However libguestfs also contains "
38811 "static markers to help in probing internal operations."
38815 #: ../src/guestfs.pod:2189
38816 msgid "You can list all the static markers by doing:"
38820 #: ../src/guestfs.pod:2191
38823 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
38824 " .provider(\"guestfs\").mark(\"*\")'\n"
38829 #: ../src/guestfs.pod:2194
38831 "B<Note:> These static markers are I<not> part of the stable API and may "
38832 "change in future versions."
38836 #: ../src/guestfs.pod:2197
38837 msgid "SYSTEMTAP SCRIPT EXAMPLE"
38841 #: ../src/guestfs.pod:2199
38843 "This script contains examples of displaying both the static markers and some "
38844 "ordinary C entry points:"
38848 #: ../src/guestfs.pod:2202
38856 #: ../src/guestfs.pod:2204
38859 " function display_time () {\n"
38860 " now = gettimeofday_us ();\n"
38863 " delta = now - last;\n"
38869 #: ../src/guestfs.pod:2211
38872 " printf (\"%d (+%d):\", now, delta);\n"
38878 #: ../src/guestfs.pod:2214
38883 " printf (\"ready\\n\");\n"
38889 #: ../src/guestfs.pod:2219
38892 " /* Display all calls to static markers. */\n"
38893 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
38894 " .provider(\"guestfs\").mark(\"*\") ? {\n"
38895 " display_time();\n"
38896 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
38902 #: ../src/guestfs.pod:2226
38905 " /* Display all calls to guestfs_mkfs* functions. */\n"
38906 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
38907 " .function(\"guestfs_mkfs*\") ? {\n"
38908 " display_time();\n"
38909 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
38915 #: ../src/guestfs.pod:2233
38917 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
38918 "program. Note that you either have to be root, or you have to add yourself "
38919 "to several special stap groups. Consult the systemtap documentation for "
38920 "more information."
38924 #: ../src/guestfs.pod:2238
38927 " # stap /tmp/test.stap\n"
38933 #: ../src/guestfs.pod:2241
38934 msgid "In another terminal, run a guestfish command such as this:"
38938 #: ../src/guestfs.pod:2245
38939 msgid "In the first terminal, stap trace output similar to this is shown:"
38943 #: ../src/guestfs.pod:2247
38946 " 1318248056692655 (+0):\tlaunch_start\n"
38947 " 1318248056692850 (+195): launch_build_appliance_start\n"
38948 " 1318248056818285 (+125435): launch_build_appliance_end\n"
38949 " 1318248056838059 (+19774): launch_run_qemu\n"
38950 " 1318248061071167 (+4233108): launch_end\n"
38951 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f "
38952 "device=0x1024e60\n"
38957 #: ../src/guestfs.pod:2254 ../src/guestfs.pod:2259
38962 #: ../src/guestfs.pod:2256
38964 "<!-- old anchor for the next section --> <a "
38965 "name=\"state_machine_and_low_level_event_api\"/>"
38969 #: ../src/guestfs.pod:2261
38970 msgid "ARCHITECTURE"
38974 #: ../src/guestfs.pod:2263
38976 "Internally, libguestfs is implemented by running an appliance (a special "
38977 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
38978 "process of the main program."
38982 #: ../src/guestfs.pod:2267
38985 " ___________________\n"
38987 " | main program |\n"
38989 " | | child process / appliance\n"
38990 " | | __________________________\n"
38992 " +-------------------+ RPC | +-----------------+ |\n"
38993 " | libguestfs <--------------------> guestfsd | |\n"
38994 " | | | +-----------------+ |\n"
38995 " \\___________________/ | | Linux kernel | |\n"
38996 " | +--^--------------+ |\n"
38997 " \\_________|________________/\n"
38999 " _______v______\n"
39002 " | disk image |\n"
39003 " \\______________/\n"
39008 #: ../src/guestfs.pod:2287
39010 "The library, linked to the main program, creates the child process and hence "
39011 "the appliance in the L</guestfs_launch> function."
39015 #: ../src/guestfs.pod:2290
39017 "Inside the appliance is a Linux kernel and a complete stack of userspace "
39018 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
39019 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
39020 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
39021 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
39022 "attached to the qemu process which translates device access by the "
39023 "appliance's Linux kernel into accesses to the image."
39027 #: ../src/guestfs.pod:2299
39029 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
39030 "Although the disk image you are attached to might also be used by some "
39031 "virtual machine, libguestfs doesn't know or care about this. (But you will "
39032 "care if both libguestfs's qemu process and your virtual machine are trying "
39033 "to update the disk image at the same time, since these usually results in "
39034 "massive disk corruption)."
39038 #: ../src/guestfs.pod:2306
39039 msgid "STATE MACHINE"
39043 #: ../src/guestfs.pod:2308
39044 msgid "libguestfs uses a state machine to model the child process:"
39048 #: ../src/guestfs.pod:2310
39052 " guestfs_create\n"
39060 " / | \\ \\ guestfs_launch\n"
39061 " / | _\\__V______\n"
39063 " / | | LAUNCHING |\n"
39064 " / | \\___________/\n"
39066 " / | guestfs_launch\n"
39068 " ______ / __|____V\n"
39069 " / \\ ------> / \\\n"
39070 " | BUSY | | READY |\n"
39071 " \\______/ <------ \\________/\n"
39076 #: ../src/guestfs.pod:2332
39078 "The normal transitions are (1) CONFIG (when the handle is created, but there "
39079 "is no child process), (2) LAUNCHING (when the child process is booting up), "
39080 "(3) alternating between READY and BUSY as commands are issued to, and "
39081 "carried out by, the child process."
39085 #: ../src/guestfs.pod:2337
39087 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
39088 "asynchronously at any time (eg. due to some internal error), and that causes "
39089 "the state to transition back to CONFIG."
39093 #: ../src/guestfs.pod:2341
39095 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
39096 "issued when in the CONFIG state."
39100 #: ../src/guestfs.pod:2344
39102 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
39103 "L</guestfs_launch> blocks until the child process is READY to accept "
39104 "commands (or until some failure or timeout). L</guestfs_launch> internally "
39105 "moves the state from CONFIG to LAUNCHING while it is running."
39109 #: ../src/guestfs.pod:2350
39111 "API actions such as L</guestfs_mount> can only be issued when in the READY "
39112 "state. These API calls block waiting for the command to be carried out "
39113 "(ie. the state to transition to BUSY and then back to READY). There are no "
39114 "non-blocking versions, and no way to issue more than one command per handle "
39115 "at the same time."
39119 #: ../src/guestfs.pod:2356
39121 "Finally, the child process sends asynchronous messages back to the main "
39122 "program, such as kernel log messages. You can register a callback to "
39123 "receive these messages."
39127 #: ../src/guestfs.pod:2360
39132 #: ../src/guestfs.pod:2362
39133 msgid "APPLIANCE BOOT PROCESS"
39137 #: ../src/guestfs.pod:2364
39139 "This process has evolved and continues to evolve. The description here "
39140 "corresponds only to the current version of libguestfs and is provided for "
39141 "information only."
39145 #: ../src/guestfs.pod:2368
39147 "In order to follow the stages involved below, enable libguestfs debugging "
39148 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
39152 #: ../src/guestfs.pod:2373
39153 msgid "Create the appliance"
39157 #: ../src/guestfs.pod:2375
39159 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
39160 "initrd and the appliance."
39164 #: ../src/guestfs.pod:2378
39166 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
39167 "directory if C<TMPDIR> is set)."
39171 #: ../src/guestfs.pod:2381
39173 "For a complete description of how the appliance is created and cached, read "
39174 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
39178 #: ../src/guestfs.pod:2385
39179 msgid "Start qemu and boot the kernel"
39183 #: ../src/guestfs.pod:2387
39184 msgid "qemu is invoked to boot the kernel."
39188 #: ../src/guestfs.pod:2389
39189 msgid "Run the initrd"
39193 #: ../src/guestfs.pod:2391
39195 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
39196 "appliance. The purpose of the initrd is to load enough kernel modules in "
39197 "order that the appliance itself can be mounted and started."
39201 #: ../src/guestfs.pod:2395
39203 "The initrd is a cpio archive called "
39204 "C</var/tmp/.guestfs-E<lt>UIDE<gt>/initrd>."
39208 #: ../src/guestfs.pod:2398
39210 "When the initrd has started you will see messages showing that kernel "
39211 "modules are being loaded, similar to this:"
39215 #: ../src/guestfs.pod:2401
39218 " febootstrap: ext2 mini initrd starting up\n"
39219 " febootstrap: mounting /sys\n"
39220 " febootstrap: internal insmod libcrc32c.ko\n"
39221 " febootstrap: internal insmod crc32c-intel.ko\n"
39226 #: ../src/guestfs.pod:2406
39227 msgid "Find and mount the appliance device"
39231 #: ../src/guestfs.pod:2408
39233 "The appliance is a sparse file containing an ext2 filesystem which contains "
39234 "a familiar (although reduced in size) Linux operating system. It would "
39235 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
39239 #: ../src/guestfs.pod:2412
39241 "The regular disks being inspected by libguestfs are the first devices "
39242 "exposed by qemu (eg. as C</dev/vda>)."
39246 #: ../src/guestfs.pod:2415
39248 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
39249 "there was only one regular disk)."
39253 #: ../src/guestfs.pod:2418
39255 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
39256 "and switch root into the appliance, and run C</init> from the appliance."
39260 #: ../src/guestfs.pod:2422
39261 msgid "If this works successfully you will see messages such as:"
39265 #: ../src/guestfs.pod:2424
39268 " febootstrap: picked /sys/block/vdb/dev as root device\n"
39269 " febootstrap: creating /dev/root as block special 252:16\n"
39270 " febootstrap: mounting new root on /root\n"
39271 " febootstrap: chroot\n"
39272 " Starting /init script ...\n"
39277 #: ../src/guestfs.pod:2430
39279 "Note that C<Starting /init script ...> indicates that the appliance's init "
39280 "script is now running."
39284 #: ../src/guestfs.pod:2433
39285 msgid "Initialize the appliance"
39289 #: ../src/guestfs.pod:2435
39291 "The appliance itself now initializes itself. This involves starting certain "
39292 "processes like C<udev>, possibly printing some debug information, and "
39293 "finally running the daemon (C<guestfsd>)."
39297 #: ../src/guestfs.pod:2439
39302 #: ../src/guestfs.pod:2441
39304 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
39309 #: ../src/guestfs.pod:2444
39312 " verbose daemon enabled\n"
39317 #: ../src/guestfs.pod:2446
39319 "The daemon expects to see a named virtio-serial port exposed by qemu and "
39320 "connected on the other end to the library."
39324 #: ../src/guestfs.pod:2449
39326 "The daemon connects to this port (and hence to the library) and sends a four "
39327 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
39328 "protocol (see below)."
39332 #: ../src/guestfs.pod:2455
39333 msgid "COMMUNICATION PROTOCOL"
39337 #: ../src/guestfs.pod:2457
39339 "Don't rely on using this protocol directly. This section documents how it "
39340 "currently works, but it may change at any time."
39344 #: ../src/guestfs.pod:2460
39346 "The protocol used to talk between the library and the daemon running inside "
39347 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
39348 "1014, RFC 1832, RFC 4506)."
39352 #: ../src/guestfs.pod:2464
39354 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
39355 "this file is automatically generated)."
39359 #: ../src/guestfs.pod:2467
39361 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
39362 "and C<FileOut> parameters, which are handled with very simple request/reply "
39363 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
39364 "parameters, which use the same request and reply messages, but they may also "
39365 "be followed by files sent using a chunked encoding."
39369 #: ../src/guestfs.pod:2474
39370 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
39374 #: ../src/guestfs.pod:2476
39375 msgid "For ordinary functions, the request message is:"
39379 #: ../src/guestfs.pod:2478
39382 " total length (header + arguments,\n"
39383 " but not including the length word itself)\n"
39384 " struct guestfs_message_header (encoded as XDR)\n"
39385 " struct guestfs_<foo>_args (encoded as XDR)\n"
39390 #: ../src/guestfs.pod:2483
39392 "The total length field allows the daemon to allocate a fixed size buffer "
39393 "into which it slurps the rest of the message. As a result, the total length "
39394 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
39395 "effective size of any request is limited to somewhere under this size."
39399 #: ../src/guestfs.pod:2489
39401 "Note also that many functions don't take any arguments, in which case the "
39402 "C<guestfs_I<foo>_args> is completely omitted."
39406 #: ../src/guestfs.pod:2492
39408 "The header contains the procedure number (C<guestfs_proc>) which is how the "
39409 "receiver knows what type of args structure to expect, or none at all."
39413 #: ../src/guestfs.pod:2496
39415 "For functions that take optional arguments, the optional arguments are "
39416 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
39417 "arguments. A bitmask in the header indicates which optional arguments are "
39418 "meaningful. The bitmask is also checked to see if it contains bits set "
39419 "which the daemon does not know about (eg. if more optional arguments were "
39420 "added in a later version of the library), and this causes the call to be "
39425 #: ../src/guestfs.pod:2504
39426 msgid "The reply message for ordinary functions is:"
39430 #: ../src/guestfs.pod:2506
39433 " total length (header + ret,\n"
39434 " but not including the length word itself)\n"
39435 " struct guestfs_message_header (encoded as XDR)\n"
39436 " struct guestfs_<foo>_ret (encoded as XDR)\n"
39441 #: ../src/guestfs.pod:2511
39443 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
39444 "functions that return no formal return values."
39448 #: ../src/guestfs.pod:2514
39449 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
39453 #: ../src/guestfs.pod:2517
39455 "In the case of an error, a flag is set in the header, and the reply message "
39456 "is slightly changed:"
39460 #: ../src/guestfs.pod:2520
39463 " total length (header + error,\n"
39464 " but not including the length word itself)\n"
39465 " struct guestfs_message_header (encoded as XDR)\n"
39466 " struct guestfs_message_error (encoded as XDR)\n"
39471 #: ../src/guestfs.pod:2525
39473 "The C<guestfs_message_error> structure contains the error message as a "
39478 #: ../src/guestfs.pod:2528
39479 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
39483 #: ../src/guestfs.pod:2530
39485 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
39486 "The normal request message is sent (see above). However this is followed by "
39487 "a sequence of file chunks."
39491 #: ../src/guestfs.pod:2534
39494 " total length (header + arguments,\n"
39495 " but not including the length word itself,\n"
39496 " and not including the chunks)\n"
39497 " struct guestfs_message_header (encoded as XDR)\n"
39498 " struct guestfs_<foo>_args (encoded as XDR)\n"
39499 " sequence of chunks for FileIn param #0\n"
39500 " sequence of chunks for FileIn param #1 etc.\n"
39505 #: ../src/guestfs.pod:2542
39506 msgid "The \"sequence of chunks\" is:"
39510 #: ../src/guestfs.pod:2544
39513 " length of chunk (not including length word itself)\n"
39514 " struct guestfs_chunk (encoded as XDR)\n"
39515 " length of chunk\n"
39516 " struct guestfs_chunk (encoded as XDR)\n"
39518 " length of chunk\n"
39519 " struct guestfs_chunk (with data.data_len == 0)\n"
39524 #: ../src/guestfs.pod:2552
39526 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
39527 "is set in the final chunk to indicate either successful completion or early "
39532 #: ../src/guestfs.pod:2556
39534 "At time of writing there are no functions that have more than one FileIn "
39535 "parameter. However this is (theoretically) supported, by sending the "
39536 "sequence of chunks for each FileIn parameter one after another (from left to "
39541 #: ../src/guestfs.pod:2561
39543 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
39544 "transfer. The library does this by sending a chunk with a special flag set "
39545 "to indicate cancellation. When the daemon sees this, it cancels the whole "
39546 "RPC, does I<not> send any reply, and goes back to reading the next request."
39550 #: ../src/guestfs.pod:2567
39552 "The daemon may also cancel. It does this by writing a special word "
39553 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
39554 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
39555 "cancel chunk). The special word is chosen so that even if cancellation "
39556 "happens right at the end of the transfer (after the library has finished "
39557 "writing and has started listening for the reply), the \"spurious\" cancel "
39558 "flag will not be confused with the reply message."
39562 #: ../src/guestfs.pod:2576
39564 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
39565 "limit), and also files where the size is not known in advance (eg. from "
39566 "pipes or sockets). However the chunks are rather small "
39567 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
39568 "to keep much in memory."
39572 #: ../src/guestfs.pod:2582
39573 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
39577 #: ../src/guestfs.pod:2584
39579 "The protocol for FileOut parameters is exactly the same as for FileIn "
39580 "parameters, but with the roles of daemon and library reversed."
39584 #: ../src/guestfs.pod:2587
39587 " total length (header + ret,\n"
39588 " but not including the length word itself,\n"
39589 " and not including the chunks)\n"
39590 " struct guestfs_message_header (encoded as XDR)\n"
39591 " struct guestfs_<foo>_ret (encoded as XDR)\n"
39592 " sequence of chunks for FileOut param #0\n"
39593 " sequence of chunks for FileOut param #1 etc.\n"
39598 #: ../src/guestfs.pod:2595
39599 msgid "INITIAL MESSAGE"
39603 #: ../src/guestfs.pod:2597
39605 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
39606 "which indicates that the guest and daemon is alive. This is what "
39607 "L</guestfs_launch> waits for."
39611 #: ../src/guestfs.pod:2601
39612 msgid "PROGRESS NOTIFICATION MESSAGES"
39616 #: ../src/guestfs.pod:2603
39618 "The daemon may send progress notification messages at any time. These are "
39619 "distinguished by the normal length word being replaced by "
39620 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
39624 #: ../src/guestfs.pod:2607
39626 "The library turns them into progress callbacks (see "
39627 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
39632 #: ../src/guestfs.pod:2611
39634 "The daemon self-limits the frequency of progress messages it sends (see "
39635 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
39640 #: ../src/guestfs.pod:2615
39641 msgid "LIBGUESTFS VERSION NUMBERS"
39645 #: ../src/guestfs.pod:2617
39647 "Since April 2010, libguestfs has started to make separate development and "
39648 "stable releases, along with corresponding branches in our git repository. "
39649 "These separate releases can be identified by version number:"
39653 #: ../src/guestfs.pod:2622
39656 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
39657 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
39663 " | `-------- sub-version\n"
39665 " `------ always '1' because we don't change the ABI\n"
39670 #: ../src/guestfs.pod:2633
39671 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
39675 #: ../src/guestfs.pod:2635
39677 "As time passes we cherry pick fixes from the development branch and backport "
39678 "those into the stable branch, the effect being that the stable branch should "
39679 "get more stable and less buggy over time. So the stable releases are ideal "
39680 "for people who don't need new features but would just like the software to "
39685 #: ../src/guestfs.pod:2641
39686 msgid "Our criteria for backporting changes are:"
39690 #: ../src/guestfs.pod:2647
39692 "Documentation changes which don't affect any code are backported unless the "
39693 "documentation refers to a future feature which is not in stable."
39697 #: ../src/guestfs.pod:2653
39699 "Bug fixes which are not controversial, fix obvious problems, and have been "
39700 "well tested are backported."
39704 #: ../src/guestfs.pod:2658
39706 "Simple rearrangements of code which shouldn't affect how it works get "
39707 "backported. This is so that the code in the two branches doesn't get too "
39708 "far out of step, allowing us to backport future fixes more easily."
39712 #: ../src/guestfs.pod:2664
39714 "We I<don't> backport new features, new APIs, new tools etc, except in one "
39715 "exceptional case: the new feature is required in order to implement an "
39716 "important bug fix."
39720 #: ../src/guestfs.pod:2670
39722 "A new stable branch starts when we think the new features in development are "
39723 "substantial and compelling enough over the current stable branch to warrant "
39724 "it. When that happens we create new stable and development versions 1.N.0 "
39725 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
39726 "stable at this point, but by backporting fixes from development, that branch "
39727 "will stabilize over time."
39731 #: ../src/guestfs.pod:2678
39732 msgid "EXTENDING LIBGUESTFS"
39736 #: ../src/guestfs.pod:2680
39737 msgid "ADDING A NEW API ACTION"
39741 #: ../src/guestfs.pod:2682
39743 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
39744 "documentation) are generated, and this makes it easy to extend the "
39749 #: ../src/guestfs.pod:2686
39750 msgid "To add a new API action there are two changes:"
39754 #: ../src/guestfs.pod:2692
39756 "You need to add a description of the call (name, parameters, return type, "
39757 "tests, documentation) to C<generator/generator_actions.ml>."
39761 #: ../src/guestfs.pod:2695
39763 "There are two sorts of API action, depending on whether the call goes "
39764 "through to the daemon in the appliance, or is serviced entirely by the "
39765 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
39766 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
39767 "an example of the latter, since a trace flag is maintained in the handle and "
39768 "all tracing is done on the library side."
39772 #: ../src/guestfs.pod:2703
39774 "Most new actions are of the first type, and get added to the "
39775 "C<daemon_functions> list. Each function has a unique procedure number used "
39776 "in the RPC protocol which is assigned to that action when we publish "
39777 "libguestfs and cannot be reused. Take the latest procedure number and "
39782 #: ../src/guestfs.pod:2709
39784 "For library-only actions of the second type, add to the "
39785 "C<non_daemon_functions> list. Since these functions are serviced by the "
39786 "library and do not travel over the RPC mechanism to the daemon, these "
39787 "functions do not need a procedure number, and so the procedure number is set "
39792 #: ../src/guestfs.pod:2717
39793 msgid "Implement the action (in C):"
39797 #: ../src/guestfs.pod:2719
39799 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
39800 "C<daemon/> directory."
39804 #: ../src/guestfs.pod:2722
39806 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
39807 "(note: double underscore) in the C<src/> directory."
39811 #: ../src/guestfs.pod:2725
39812 msgid "In either case, use another function as an example of what to do."
39816 #: ../src/guestfs.pod:2729
39817 msgid "After making these changes, use C<make> to compile."
39821 #: ../src/guestfs.pod:2731
39823 "Note that you don't need to implement the RPC, language bindings, manual "
39824 "pages or anything else. It's all automatically generated from the OCaml "
39829 #: ../src/guestfs.pod:2735
39830 msgid "ADDING TESTS FOR AN API ACTION"
39834 #: ../src/guestfs.pod:2737
39836 "You can supply zero or as many tests as you want per API call. The tests "
39837 "can either be added as part of the API description "
39838 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
39839 "drop a script into C<regressions/>. Note that adding a script to "
39840 "C<regressions/> is slower, so if possible use the first method."
39844 #: ../src/guestfs.pod:2743
39846 "The following describes the test environment used when you add an API test "
39847 "in C<generator_actions.ml>."
39851 #: ../src/guestfs.pod:2746
39852 msgid "The test environment has 4 block devices:"
39856 #: ../src/guestfs.pod:2750
39857 msgid "C</dev/sda> 500MB"
39861 #: ../src/guestfs.pod:2752
39862 msgid "General block device for testing."
39866 #: ../src/guestfs.pod:2754
39867 msgid "C</dev/sdb> 50MB"
39871 #: ../src/guestfs.pod:2756
39873 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
39878 #: ../src/guestfs.pod:2759
39879 msgid "C</dev/sdc> 10MB"
39883 #: ../src/guestfs.pod:2761
39884 msgid "Used in a few tests where two block devices are needed."
39888 #: ../src/guestfs.pod:2763
39889 msgid "C</dev/sdd>"
39893 #: ../src/guestfs.pod:2765
39894 msgid "ISO with fixed content (see C<images/test.iso>)."
39898 #: ../src/guestfs.pod:2769
39900 "To be able to run the tests in a reasonable amount of time, the libguestfs "
39901 "appliance and block devices are reused between tests. So don't try testing "
39902 "L</guestfs_kill_subprocess> :-x"
39906 #: ../src/guestfs.pod:2773
39908 "Each test starts with an initial scenario, selected using one of the "
39909 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
39910 "initialize the disks mentioned above in a particular way as documented in "
39911 "C<generator_types.ml>. You should not assume anything about the previous "
39912 "contents of other disks that are not initialized."
39916 #: ../src/guestfs.pod:2779
39918 "You can add a prerequisite clause to any individual test. This is a "
39919 "run-time check, which, if it fails, causes the test to be skipped. Useful "
39920 "if testing a command which might not work on all variations of libguestfs "
39921 "builds. A test that has prerequisite of C<Always> means to run "
39926 #: ../src/guestfs.pod:2785
39928 "In addition, packagers can skip individual tests by setting environment "
39929 "variables before running C<make check>."
39933 #: ../src/guestfs.pod:2788
39936 " SKIP_TEST_<CMD>_<NUM>=1\n"
39941 #: ../src/guestfs.pod:2790
39942 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
39946 #: ../src/guestfs.pod:2794
39949 " SKIP_TEST_<CMD>=1\n"
39954 #: ../src/guestfs.pod:2796
39955 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
39959 #: ../src/guestfs.pod:2798
39960 msgid "Packagers can run only certain tests by setting for example:"
39964 #: ../src/guestfs.pod:2800
39967 " TEST_ONLY=\"vfs_type zerofree\"\n"
39972 #: ../src/guestfs.pod:2802
39974 "See C<capitests/tests.c> for more details of how these environment variables "
39979 #: ../src/guestfs.pod:2805
39980 msgid "DEBUGGING NEW API ACTIONS"
39984 #: ../src/guestfs.pod:2807
39985 msgid "Test new actions work before submitting them."
39989 #: ../src/guestfs.pod:2809
39990 msgid "You can use guestfish to try out new commands."
39994 #: ../src/guestfs.pod:2811
39996 "Debugging the daemon is a problem because it runs inside a minimal "
39997 "environment. However you can fprintf messages in the daemon to stderr, and "
39998 "they will show up if you use C<guestfish -v>."
40002 #: ../src/guestfs.pod:2815
40003 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
40007 #: ../src/guestfs.pod:2817
40009 "Our C source code generally adheres to some basic code-formatting "
40010 "conventions. The existing code base is not totally consistent on this "
40011 "front, but we do prefer that contributed code be formatted similarly. In "
40012 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
40013 "indentation level, and other than that, follow the K&R style."
40017 #: ../src/guestfs.pod:2823
40019 "If you use Emacs, add the following to one of one of your start-up files "
40020 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
40024 #: ../src/guestfs.pod:2826
40027 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
40028 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
40029 " (add-hook 'find-file-hook\n"
40030 " '(lambda () (if (and buffer-file-name\n"
40031 " (string-match \"/libguestfs\\\\>\"\n"
40032 " (buffer-file-name))\n"
40033 " (not (string-equal mode-name \"Change Log\"))\n"
40034 " (not (string-equal mode-name \"Makefile\")))\n"
40035 " (setq indent-tabs-mode nil))))\n"
40040 #: ../src/guestfs.pod:2836
40043 " ;;; When editing C sources in libguestfs, use this style.\n"
40044 " (defun libguestfs-c-mode ()\n"
40045 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
40047 " (c-set-style \"K&R\")\n"
40048 " (setq c-indent-level 2)\n"
40049 " (setq c-basic-offset 2))\n"
40050 " (add-hook 'c-mode-hook\n"
40051 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
40052 " (buffer-file-name))\n"
40053 " (libguestfs-c-mode))))\n"
40058 #: ../src/guestfs.pod:2848
40059 msgid "Enable warnings when compiling (and fix any problems this finds):"
40063 #: ../src/guestfs.pod:2851
40066 " ./configure --enable-gcc-warnings\n"
40071 #: ../src/guestfs.pod:2853
40072 msgid "Useful targets are:"
40076 #: ../src/guestfs.pod:2855
40079 " make syntax-check # checks the syntax of the C code\n"
40080 " make check # runs the test suite\n"
40085 #: ../src/guestfs.pod:2858
40086 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
40090 #: ../src/guestfs.pod:2860
40092 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
40093 "which are used to do shell quoting."
40097 #: ../src/guestfs.pod:2865
40102 #: ../src/guestfs.pod:2867
40104 "Simple shell quoted string. Any spaces or other shell characters are "
40109 #: ../src/guestfs.pod:2870
40114 #: ../src/guestfs.pod:2872
40116 "Same as C<%Q> except the string is treated as a path which is prefixed by "
40121 #: ../src/guestfs.pod:2879
40124 " asprintf (&cmd, \"cat %R\", path);\n"
40129 #: ../src/guestfs.pod:2881
40130 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
40134 #: ../src/guestfs.pod:2883
40136 "I<Note:> Do I<not> use these when you are passing parameters to the "
40137 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
40138 "because they are not passed via the shell (instead, straight to exec). You "
40139 "probably want to use the C<sysroot_path()> function however."
40143 #: ../src/guestfs.pod:2889
40144 msgid "SUBMITTING YOUR NEW API ACTIONS"
40148 #: ../src/guestfs.pod:2891
40150 "Submit patches to the mailing list: "
40151 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
40152 "L<rjones@redhat.com>."
40156 #: ../src/guestfs.pod:2895
40157 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
40161 #: ../src/guestfs.pod:2897
40162 msgid "We support i18n (gettext anyhow) in the library."
40166 #: ../src/guestfs.pod:2899
40168 "However many messages come from the daemon, and we don't translate those at "
40169 "the moment. One reason is that the appliance generally has all locale files "
40170 "removed from it, because they take up a lot of space. So we'd have to readd "
40171 "some of those, as well as copying our PO files into the appliance."
40175 #: ../src/guestfs.pod:2905
40177 "Debugging messages are never translated, since they are intended for the "
40182 #: ../src/guestfs.pod:2908
40183 msgid "SOURCE CODE SUBDIRECTORIES"
40187 #: ../src/guestfs.pod:2912
40192 #: ../src/guestfs.pod:2914
40193 msgid "L<virt-alignment-scan(1)> command and documentation."
40197 #: ../src/guestfs.pod:2918
40198 msgid "The libguestfs appliance, build scripts and so on."
40202 #: ../src/guestfs.pod:2920
40203 msgid "C<capitests>"
40207 #: ../src/guestfs.pod:2922
40208 msgid "Automated tests of the C API."
40212 #: ../src/guestfs.pod:2924
40217 #: ../src/guestfs.pod:2926
40219 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
40224 #: ../src/guestfs.pod:2929
40229 #: ../src/guestfs.pod:2931
40231 "Safety and liveness tests of components that libguestfs depends upon (not of "
40232 "libguestfs itself). Mainly this is for qemu and the kernel."
40236 #: ../src/guestfs.pod:2934
40241 #: ../src/guestfs.pod:2936
40243 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
40244 "command and documentation."
40248 #: ../src/guestfs.pod:2939
40253 #: ../src/guestfs.pod:2941
40254 msgid "Outside contributions, experimental parts."
40258 #: ../src/guestfs.pod:2943
40263 #: ../src/guestfs.pod:2945
40265 "The daemon that runs inside the libguestfs appliance and carries out "
40270 #: ../src/guestfs.pod:2948
40275 #: ../src/guestfs.pod:2950
40276 msgid "L<virt-df(1)> command and documentation."
40280 #: ../src/guestfs.pod:2952
40285 #: ../src/guestfs.pod:2954
40286 msgid "L<virt-edit(1)> command and documentation."
40290 #: ../src/guestfs.pod:2956
40291 msgid "C<examples>"
40295 #: ../src/guestfs.pod:2958
40296 msgid "C API example code."
40300 #: ../src/guestfs.pod:2960
40301 msgid "C<extratests>"
40305 #: ../src/guestfs.pod:2962
40307 "Extra tests. These are not run by default because they require special "
40308 "tools or configuration."
40312 #: ../src/guestfs.pod:2965
40317 #: ../src/guestfs.pod:2967
40319 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
40320 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
40321 "L<virt-tar-out(1)>."
40325 #: ../src/guestfs.pod:2971
40330 #: ../src/guestfs.pod:2973
40331 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
40335 #: ../src/guestfs.pod:2975
40336 msgid "C<generator>"
40340 #: ../src/guestfs.pod:2977
40342 "The crucially important generator, used to automatically generate large "
40343 "amounts of boilerplate C code for things like RPC and bindings."
40347 #: ../src/guestfs.pod:2980
40352 #: ../src/guestfs.pod:2982
40353 msgid "Files used by the test suite."
40357 #: ../src/guestfs.pod:2984
40358 msgid "Some \"phony\" guest images which we test against."
40362 #: ../src/guestfs.pod:2986
40363 msgid "C<inspector>"
40367 #: ../src/guestfs.pod:2988
40368 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
40372 #: ../src/guestfs.pod:2990
40377 #: ../src/guestfs.pod:2992
40378 msgid "Logo used on the website. The fish is called Arthur by the way."
40382 #: ../src/guestfs.pod:2994
40387 #: ../src/guestfs.pod:2996
40388 msgid "M4 macros used by autoconf."
40392 #: ../src/guestfs.pod:2998
40397 #: ../src/guestfs.pod:3000
40398 msgid "Translations of simple gettext strings."
40402 #: ../src/guestfs.pod:3002
40407 #: ../src/guestfs.pod:3004
40409 "The build infrastructure and PO files for translations of manpages and POD "
40410 "files. Eventually this will be combined with the C<po> directory, but that "
40411 "is rather complicated."
40415 #: ../src/guestfs.pod:3008
40416 msgid "C<regressions>"
40420 #: ../src/guestfs.pod:3010
40421 msgid "Regression tests."
40425 #: ../src/guestfs.pod:3012
40430 #: ../src/guestfs.pod:3014
40431 msgid "L<virt-rescue(1)> command and documentation."
40435 #: ../src/guestfs.pod:3016
40440 #: ../src/guestfs.pod:3018
40441 msgid "L<virt-resize(1)> command and documentation."
40445 #: ../src/guestfs.pod:3020
40446 msgid "C<sparsify>"
40450 #: ../src/guestfs.pod:3022
40451 msgid "L<virt-sparsify(1)> command and documentation."
40455 #: ../src/guestfs.pod:3024
40460 #: ../src/guestfs.pod:3026
40461 msgid "Source code to the C library."
40465 #: ../src/guestfs.pod:3028
40470 #: ../src/guestfs.pod:3030
40471 msgid "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
40475 #: ../src/guestfs.pod:3032
40476 msgid "C<test-tool>"
40480 #: ../src/guestfs.pod:3034
40482 "Test tool for end users to test if their qemu/kernel combination will work "
40487 #: ../src/guestfs.pod:3037
40492 #: ../src/guestfs.pod:3039
40497 #: ../src/guestfs.pod:3041
40502 #: ../src/guestfs.pod:3043
40507 #: ../src/guestfs.pod:3045
40512 #: ../src/guestfs.pod:3047
40517 #: ../src/guestfs.pod:3049
40522 #: ../src/guestfs.pod:3051
40527 #: ../src/guestfs.pod:3053
40532 #: ../src/guestfs.pod:3055
40533 msgid "Language bindings."
40537 #: ../src/guestfs.pod:3059
40538 msgid "MAKING A STABLE RELEASE"
40542 #: ../src/guestfs.pod:3061
40544 "When we make a stable release, there are several steps documented here. See "
40545 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
40550 #: ../src/guestfs.pod:3069
40551 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
40555 #: ../src/guestfs.pod:3074
40556 msgid "Finalize RELEASE-NOTES."
40560 #: ../src/guestfs.pod:3078
40561 msgid "Update ROADMAP."
40565 #: ../src/guestfs.pod:3082
40566 msgid "Run C<src/api-support/update-from-tarballs.sh>."
40570 #: ../src/guestfs.pod:3086
40571 msgid "Push and pull from Transifex."
40575 #: ../src/guestfs.pod:3090
40583 #: ../src/guestfs.pod:3092
40584 msgid "to push the latest POT files to Transifex. Then run:"
40588 #: ../src/guestfs.pod:3094
40596 #: ../src/guestfs.pod:3096
40597 msgid "which is a wrapper to pull the latest translated C<*.po> files."
40601 #: ../src/guestfs.pod:3100
40603 "Create new stable and development directories under "
40604 "L<http://libguestfs.org/download>."
40608 #: ../src/guestfs.pod:3105
40609 msgid "Create the branch in git:"
40613 #: ../src/guestfs.pod:3107
40616 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
40617 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
40618 " git branch stable-1.XX\n"
40619 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
40624 #: ../src/guestfs.pod:3114
40629 #: ../src/guestfs.pod:3116
40630 msgid "PROTOCOL LIMITS"
40634 #: ../src/guestfs.pod:3118
40636 "Internally libguestfs uses a message-based protocol to pass API calls and "
40637 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
40638 "plenty more detail about this). The maximum message size used by the "
40639 "protocol is slightly less than 4 MB. For some API calls you may need to be "
40640 "aware of this limit. The API calls which may be affected are individually "
40641 "documented, with a link back to this section of the documentation."
40645 #: ../src/guestfs.pod:3126
40647 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
40648 "a simple string. Because this string is at some point internally encoded as "
40649 "a message, the maximum size that it can return is slightly under 4 MB. If "
40650 "the requested file is larger than this then you will get an error."
40654 #: ../src/guestfs.pod:3132
40656 "In order to transfer large files into and out of the guest filesystem, you "
40657 "need to use particular calls that support this. The sections L</UPLOADING> "
40658 "and L</DOWNLOADING> document how to do this."
40662 #: ../src/guestfs.pod:3136
40664 "You might also consider mounting the disk image using our FUSE filesystem "
40665 "support (L<guestmount(1)>)."
40669 #: ../src/guestfs.pod:3139
40670 msgid "MAXIMUM NUMBER OF DISKS"
40674 #: ../src/guestfs.pod:3141
40675 msgid "When using virtio disks (the default) the current limit is B<25> disks."
40679 #: ../src/guestfs.pod:3144
40681 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
40682 "slots. However febootstrap only understands disks with names C</dev/vda> "
40683 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
40688 #: ../src/guestfs.pod:3149
40690 "We are working to substantially raise this limit in future versions but it "
40691 "requires complex changes to qemu."
40695 #: ../src/guestfs.pod:3152
40697 "In future versions of libguestfs it should also be possible to \"hot plug\" "
40698 "disks (add and remove disks after calling L</guestfs_launch>). This also "
40699 "requires changes to qemu."
40703 #: ../src/guestfs.pod:3156
40704 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
40708 #: ../src/guestfs.pod:3158
40709 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
40713 #: ../src/guestfs.pod:3160
40715 "This is because it reserves 4 bits for the minor device number (thus "
40716 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
40720 #: ../src/guestfs.pod:3163
40722 "If you attach a disk with more than 15 partitions, the extra partitions are "
40723 "ignored by libguestfs."
40727 #: ../src/guestfs.pod:3166
40728 msgid "MAXIMUM SIZE OF A DISK"
40732 #: ../src/guestfs.pod:3168
40733 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
40737 #: ../src/guestfs.pod:3170
40739 "We have tested block devices up to 1 exabyte (2**60 or "
40740 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
40745 #: ../src/guestfs.pod:3174
40747 "Although libguestfs probably does not impose any limit, the underlying host "
40748 "storage will. If you store disk images on a host ext4 filesystem, then the "
40749 "maximum size will be limited by the maximum ext4 file size (currently 16 "
40750 "TB). If you store disk images as host logical volumes then you are limited "
40751 "by the maximum size of an LV."
40755 #: ../src/guestfs.pod:3180
40757 "For the hugest disk image files, we recommend using XFS on the host for "
40762 #: ../src/guestfs.pod:3183
40763 msgid "MAXIMUM SIZE OF A PARTITION"
40767 #: ../src/guestfs.pod:3185
40769 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
40770 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
40771 "address a partition located beyond 2 TB on the disk."
40775 #: ../src/guestfs.pod:3189
40777 "It is recommended that you use GPT partitions on disks which are larger than "
40778 "this size. GPT uses 64 bit sector numbers and so can address partitions "
40779 "which are theoretically larger than the largest disk we could support."
40783 #: ../src/guestfs.pod:3194
40784 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
40788 #: ../src/guestfs.pod:3196
40790 "This depends on the filesystem type. libguestfs itself does not impose any "
40791 "known limit. Consult Wikipedia or the filesystem documentation to find out "
40792 "what these limits are."
40796 #: ../src/guestfs.pod:3200
40797 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
40801 #: ../src/guestfs.pod:3202
40803 "The API functions L</guestfs_upload>, L</guestfs_download>, "
40804 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
40805 "uploads and downloads."
40809 #: ../src/guestfs.pod:3206
40810 msgid "INSPECTION LIMITS"
40814 #: ../src/guestfs.pod:3208
40816 "The inspection code has several arbitrary limits on things like the size of "
40817 "Windows Registry hive it will read, and the length of product name. These "
40818 "are intended to stop a malicious guest from consuming arbitrary amounts of "
40819 "memory and disk space on the host, and should not be reached in practice. "
40820 "See the source code for more information."
40824 #: ../src/guestfs.pod:3234
40826 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
40827 "effect as calling C<guestfs_set_verbose (g, 1)>."
40831 #: ../src/guestfs.pod:3246
40833 "Set the path that libguestfs uses to search for a supermin appliance. See "
40834 "the discussion of paths in section L</PATH> above."
40838 #: ../src/guestfs.pod:3255
40839 msgid "See also L</QEMU WRAPPERS> above."
40843 #: ../src/guestfs.pod:3259
40845 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
40846 "effect as calling C<guestfs_set_trace (g, 1)>."
40850 #: ../src/guestfs.pod:3277
40852 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
40853 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
40854 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, "
40855 "L<virt-alignment-scan(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
40856 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
40857 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
40858 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
40859 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, "
40860 "L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
40861 "L<virt-win-reg(1)>, L<guestfs-testing(1)>, L<qemu(1)>, L<febootstrap(1)>, "
40862 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)>, "
40863 "L<http://libguestfs.org/>."
40867 #: ../src/guestfs.pod:3314
40869 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
40870 "L<lvm(8)>, L<disktype(1)>."
40874 #: ../src/guestfs.pod:3321 ../tools/virt-make-fs.pl:571 ../tools/virt-win-reg.pl:772
40879 #: ../src/guestfs.pod:3323
40880 msgid "To get a list of bugs against libguestfs use this link:"
40884 #: ../src/guestfs.pod:3325
40885 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
40889 #: ../src/guestfs.pod:3327
40890 msgid "To report a new bug against libguestfs use this link:"
40894 #: ../src/guestfs.pod:3329
40895 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
40899 #: ../src/guestfs.pod:3331
40900 msgid "When reporting a bug, please check:"
40904 #: ../src/guestfs.pod:3337
40905 msgid "That the bug hasn't been reported already."
40909 #: ../src/guestfs.pod:3341
40910 msgid "That you are testing a recent version."
40914 #: ../src/guestfs.pod:3345
40915 msgid "Describe the bug accurately, and give a way to reproduce it."
40919 #: ../src/guestfs.pod:3349
40921 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
40926 #: ../test-tool/libguestfs-test-tool.pod:5
40927 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
40931 #: ../test-tool/libguestfs-test-tool.pod:9
40934 " libguestfs-test-tool [--options]\n"
40939 #: ../test-tool/libguestfs-test-tool.pod:13
40941 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
40942 "to check basic libguestfs functionality is working. This is needed because "
40943 "libguestfs occasionally breaks for reasons beyond our control: usually "
40944 "because of changes in the underlying qemu or kernel packages, or the host "
40949 #: ../test-tool/libguestfs-test-tool.pod:19
40950 msgid "If you suspect a problem in libguestfs, then just run:"
40954 #: ../test-tool/libguestfs-test-tool.pod:21
40957 " libguestfs-test-tool\n"
40962 #: ../test-tool/libguestfs-test-tool.pod:23
40963 msgid "It will print lots of diagnostic messages."
40967 #: ../test-tool/libguestfs-test-tool.pod:25
40968 msgid "If it runs to completion successfully, you will see this near the end:"
40972 #: ../test-tool/libguestfs-test-tool.pod:27
40975 " ===== TEST FINISHED OK =====\n"
40980 #: ../test-tool/libguestfs-test-tool.pod:29
40981 msgid "and the test tool will exit with code 0."
40985 #: ../test-tool/libguestfs-test-tool.pod:31
40987 "If it fails (and/or exits with non-zero error code), please paste the "
40988 "I<complete, unedited> output of the test tool into a bug report. More "
40989 "information about reporting bugs can be found on the "
40990 "L<http://libguestfs.org/> website."
40994 #: ../test-tool/libguestfs-test-tool.pod:42
40995 msgid "Display short usage information and exit."
40999 #: ../test-tool/libguestfs-test-tool.pod:44
41000 msgid "B<--qemu qemu_binary>"
41004 #: ../test-tool/libguestfs-test-tool.pod:46
41006 "If you have downloaded another qemu binary, point this option at the full "
41007 "path of the binary to try it."
41011 #: ../test-tool/libguestfs-test-tool.pod:49
41012 msgid "B<--qemudir qemu_source_dir>"
41016 #: ../test-tool/libguestfs-test-tool.pod:51
41018 "If you have compiled qemu from source, point this option at the source "
41019 "directory to try it."
41023 #: ../test-tool/libguestfs-test-tool.pod:54
41028 #: ../test-tool/libguestfs-test-tool.pod:56
41029 msgid "B<--timeout N>"
41033 #: ../test-tool/libguestfs-test-tool.pod:58
41035 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
41036 "minutes) which does not usually need to be adjusted."
41040 #: ../test-tool/libguestfs-test-tool.pod:63
41041 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
41045 #: ../test-tool/libguestfs-test-tool.pod:65
41047 "If you have compiled another version of qemu from source and would like to "
41048 "try that, then you can use the I<--qemudir> option to point to the qemu "
41049 "source directory."
41053 #: ../test-tool/libguestfs-test-tool.pod:69
41055 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
41056 "option to point to the binary."
41060 #: ../test-tool/libguestfs-test-tool.pod:72
41062 "Note when using these options, you can ignore the business of qemu wrapper "
41063 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
41064 "wrapper script for you if one is needed."
41068 #: ../test-tool/libguestfs-test-tool.pod:76
41069 msgid "TRYING OUT A DIFFERENT KERNEL"
41073 #: ../test-tool/libguestfs-test-tool.pod:78
41075 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
41076 "libguestfs tries. You do this by setting the environment variables "
41077 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
41081 #: ../test-tool/libguestfs-test-tool.pod:82
41083 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
41088 #: ../test-tool/libguestfs-test-tool.pod:85
41089 msgid "SELF-DIAGNOSIS"
41093 #: ../test-tool/libguestfs-test-tool.pod:87
41095 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
41096 "produced by libguestfs-test-tool and/or possible errors."
41100 #: ../test-tool/libguestfs-test-tool.pod:92
41102 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
41103 "I<1> if there was an error."
41107 #: ../test-tool/libguestfs-test-tool.pod:97
41109 "For the full list of environment variables which may affect libguestfs, "
41110 "please see the L<guestfs(3)> manual page."
41114 #: ../test-tool/libguestfs-test-tool.pod:102
41115 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
41119 #: ../tools/virt-list-filesystems.pl:32
41120 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
41124 #: ../tools/virt-list-filesystems.pl:36
41127 " virt-list-filesystems [--options] domname\n"
41132 #: ../tools/virt-list-filesystems.pl:38
41135 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
41140 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
41142 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
41147 #: ../tools/virt-list-filesystems.pl:45
41149 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
41150 "are contained in a virtual machine or disk image."
41154 #: ../tools/virt-list-filesystems.pl:49
41156 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
41157 "functionality. For more complex cases you should look at the "
41158 "L<guestfish(1)> tool."
41162 #: ../tools/virt-list-filesystems.pl:112
41164 "With this option, C<virt-list-filesystems> displays the type of each "
41165 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
41169 #: ../tools/virt-list-filesystems.pl:119
41174 #: ../tools/virt-list-filesystems.pl:123
41176 "Normally we only show mountable filesystems. If this option is given then "
41177 "swap devices are shown too."
41181 #: ../tools/virt-list-filesystems.pl:197
41183 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
41184 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
41185 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
41189 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
41190 msgid "Copyright (C) 2009 Red Hat Inc."
41194 #: ../tools/virt-list-partitions.pl:32
41195 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
41199 #: ../tools/virt-list-partitions.pl:36
41202 " virt-list-partitions [--options] domname\n"
41207 #: ../tools/virt-list-partitions.pl:38
41210 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
41215 #: ../tools/virt-list-partitions.pl:45
41217 "C<virt-list-partitions> is a command line tool to list the partitions that "
41218 "are contained in a virtual machine or disk image. It is mainly useful as a "
41219 "first step to using L<virt-resize(1)>."
41223 #: ../tools/virt-list-partitions.pl:50
41225 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
41226 "functionality. For more complex cases you should look at the "
41227 "L<guestfish(1)> tool."
41231 #: ../tools/virt-list-partitions.pl:113
41232 msgid "Show sizes in human-readable form (eg. \"1G\")."
41236 #: ../tools/virt-list-partitions.pl:123
41238 "With this option, C<virt-list-partitions> displays the type and size of each "
41239 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
41243 #: ../tools/virt-list-partitions.pl:130
41248 #: ../tools/virt-list-partitions.pl:132
41253 #: ../tools/virt-list-partitions.pl:134
41254 msgid "Display the total size of each block device (as a separate row or rows)."
41258 #: ../tools/virt-list-partitions.pl:267
41260 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
41261 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
41262 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
41266 #: ../tools/virt-list-partitions.pl:283
41267 msgid "Copyright (C) 2009-2010 Red Hat Inc."
41271 #: ../tools/virt-make-fs.pl:37
41272 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
41276 #: ../tools/virt-make-fs.pl:41
41279 " virt-make-fs [--options] input.tar output.img\n"
41284 #: ../tools/virt-make-fs.pl:43
41287 " virt-make-fs [--options] input.tar.gz output.img\n"
41292 #: ../tools/virt-make-fs.pl:45
41295 " virt-make-fs [--options] directory output.img\n"
41300 #: ../tools/virt-make-fs.pl:49
41302 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
41303 "archive or some files in a directory. It is similar to tools like "
41304 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
41305 "it can create common filesystem types like ext2/3 or NTFS, which can be "
41306 "useful if you want to attach these filesystems to existing virtual machines "
41307 "(eg. to import large amounts of read-only data to a VM)."
41311 #: ../tools/virt-make-fs.pl:57
41312 msgid "Basic usage is:"
41316 #: ../tools/virt-make-fs.pl:59
41319 " virt-make-fs input output.img\n"
41324 #: ../tools/virt-make-fs.pl:61
41326 "where C<input> is either a directory containing files that you want to add, "
41327 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
41328 "C<output.img> is a disk image. The input type is detected automatically. "
41329 "The output disk image defaults to a raw ext2 sparse image unless you specify "
41330 "extra flags (see L</OPTIONS> below)."
41334 #: ../tools/virt-make-fs.pl:67
41335 msgid "FILESYSTEM TYPE"
41339 #: ../tools/virt-make-fs.pl:69
41341 "The default filesystem type is C<ext2>. Just about any filesystem type that "
41342 "libguestfs supports can be used (but I<not> read-only formats like "
41343 "ISO9660). Here are some of the more common choices:"
41347 #: ../tools/virt-make-fs.pl:75
41352 #: ../tools/virt-make-fs.pl:77
41354 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
41355 "you are not going to use the filesystem in a way that requires the journal, "
41356 "then this is just wasted overhead."
41360 #: ../tools/virt-make-fs.pl:81
41361 msgid "I<ntfs> or I<vfat>"
41365 #: ../tools/virt-make-fs.pl:83
41366 msgid "Useful if exporting data to a Windows guest."
41370 #: ../tools/virt-make-fs.pl:85
41372 "I<Note for vfat>: The tar archive or local directory must only contain files "
41373 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
41374 "program running within libguestfs is unable to change the ownership of "
41375 "non-root files, since vfat itself does not support this."
41379 #: ../tools/virt-make-fs.pl:90
41384 #: ../tools/virt-make-fs.pl:92
41386 "Lower overhead than C<ext2>, but certain limitations on filename length and "
41387 "total filesystem size."
41391 #: ../tools/virt-make-fs.pl:97 ../tools/virt-make-fs.pl:116 ../tools/virt-make-fs.pl:149
41396 #: ../tools/virt-make-fs.pl:99
41399 " virt-make-fs --type=minix input minixfs.img\n"
41404 #: ../tools/virt-make-fs.pl:101
41405 msgid "TO PARTITION OR NOT TO PARTITION"
41409 #: ../tools/virt-make-fs.pl:103
41410 msgid "Optionally virt-make-fs can add a partition table to the output disk."
41414 #: ../tools/virt-make-fs.pl:105
41416 "Adding a partition can make the disk image more compatible with certain "
41417 "virtualized operating systems which don't expect to see a filesystem "
41418 "directly located on a block device (Linux doesn't care and will happily "
41419 "handle both types)."
41423 #: ../tools/virt-make-fs.pl:110
41425 "On the other hand, if you have a partition table then the output image is no "
41426 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
41427 "directly on a partitioned disk image. (However libguestfs tools such as "
41428 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
41432 #: ../tools/virt-make-fs.pl:118
41433 msgid "Add an MBR partition:"
41437 #: ../tools/virt-make-fs.pl:120
41440 " virt-make-fs --partition -- input disk.img\n"
41445 #: ../tools/virt-make-fs.pl:122
41447 "If the output disk image could be terabyte-sized or larger, it's better to "
41448 "use an EFI/GPT-compatible partition table:"
41452 #: ../tools/virt-make-fs.pl:125
41455 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
41460 #: ../tools/virt-make-fs.pl:127
41461 msgid "EXTRA SPACE"
41465 #: ../tools/virt-make-fs.pl:129
41467 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
41468 "the files that it contains, but might have extra space. Depending on how "
41469 "you are going to use the output, you might think this extra space is wasted "
41470 "and want to minimize it, or you might want to leave space so that more files "
41471 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
41472 "but you can use the I<--size> flag to leave space in the filesystem if you "
41477 #: ../tools/virt-make-fs.pl:137
41479 "An alternative way to leave extra space but not make the output image any "
41480 "bigger is to use an alternative disk image format (instead of the default "
41481 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
41482 "image format (check your hypervisor supports this before using it). This "
41483 "allows you to choose a large I<--size> but the extra space won't actually be "
41484 "allocated in the image until you try to store something in it."
41488 #: ../tools/virt-make-fs.pl:145
41490 "Don't forget that you can also use local commands including L<resize2fs(8)> "
41491 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
41492 "to build another image from scratch."
41496 #: ../tools/virt-make-fs.pl:151
41499 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
41504 #: ../tools/virt-make-fs.pl:179
41505 msgid "Enable debugging information."
41509 #: ../tools/virt-make-fs.pl:185
41510 msgid "B<--size=E<lt>NE<gt>>"
41514 #: ../tools/virt-make-fs.pl:187
41515 msgid "B<--size=+E<lt>NE<gt>>"
41519 #: ../tools/virt-make-fs.pl:189
41520 msgid "B<-s E<lt>NE<gt>>"
41524 #: ../tools/virt-make-fs.pl:191
41525 msgid "B<-s +E<lt>NE<gt>>"
41529 #: ../tools/virt-make-fs.pl:193
41530 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
41534 #: ../tools/virt-make-fs.pl:196
41536 "If this option is I<not> given, then the output image will be just large "
41537 "enough to contain all the files, with not much wasted space."
41541 #: ../tools/virt-make-fs.pl:199
41543 "To choose a fixed size output disk, specify an absolute number followed by "
41544 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
41545 "Petabytes or Exabytes. This must be large enough to contain all the input "
41546 "files, else you will get an error."
41550 #: ../tools/virt-make-fs.pl:204
41552 "To leave extra space, specify C<+> (plus sign) and a number followed by "
41553 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
41554 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
41555 "the input files, and (approximately) an extra 200 MB free space."
41559 #: ../tools/virt-make-fs.pl:210
41561 "Note that virt-make-fs estimates free space, and therefore will not produce "
41562 "filesystems containing precisely the free space requested. (It is much more "
41563 "expensive and time-consuming to produce a filesystem which has precisely the "
41564 "desired free space)."
41568 #: ../tools/virt-make-fs.pl:219
41569 msgid "B<--format=E<lt>fmtE<gt>>"
41573 #: ../tools/virt-make-fs.pl:221
41574 msgid "B<-F E<lt>fmtE<gt>>"
41578 #: ../tools/virt-make-fs.pl:223
41579 msgid "Choose the output disk image format."
41583 #: ../tools/virt-make-fs.pl:225
41584 msgid "The default is C<raw> (raw sparse disk image)."
41588 #: ../tools/virt-make-fs.pl:227
41590 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
41591 "that would really make sense here is C<qcow2>."
41595 #: ../tools/virt-make-fs.pl:234
41596 msgid "B<--type=E<lt>fsE<gt>>"
41600 #: ../tools/virt-make-fs.pl:236
41601 msgid "B<-t E<lt>fsE<gt>>"
41605 #: ../tools/virt-make-fs.pl:238
41606 msgid "Choose the output filesystem type."
41610 #: ../tools/virt-make-fs.pl:240
41611 msgid "The default is C<ext2>."
41615 #: ../tools/virt-make-fs.pl:242
41616 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
41620 #: ../tools/virt-make-fs.pl:249
41621 msgid "B<--partition>"
41625 #: ../tools/virt-make-fs.pl:251
41626 msgid "B<--partition=E<lt>parttypeE<gt>>"
41630 #: ../tools/virt-make-fs.pl:253
41632 "If specified, this flag adds an MBR partition table to the output disk "
41637 #: ../tools/virt-make-fs.pl:256
41639 "You can change the partition table type, eg. I<--partition=gpt> for large "
41644 #: ../tools/virt-make-fs.pl:259
41646 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
41647 "might consider the next parameter to be the partition type. For example:"
41651 #: ../tools/virt-make-fs.pl:263
41654 " virt-make-fs --partition input.tar output.img\n"
41659 #: ../tools/virt-make-fs.pl:265
41661 "would cause virt-make-fs to think you wanted to use a partition type of "
41662 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
41663 "dash) between options and the input and output arguments:"
41667 #: ../tools/virt-make-fs.pl:269
41670 " virt-make-fs --partition -- input.tar output.img\n"
41675 #: ../tools/virt-make-fs.pl:271
41676 msgid "For MBR, virt-make-fs sets the partition type byte automatically."
41680 #: ../tools/virt-make-fs.pl:559
41682 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
41683 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
41684 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
41688 #: ../tools/virt-make-fs.pl:573 ../tools/virt-win-reg.pl:774
41690 "When reporting bugs, please enable debugging and capture the I<complete> "
41695 #: ../tools/virt-make-fs.pl:576
41698 " export LIBGUESTFS_DEBUG=1\n"
41699 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
41704 #: ../tools/virt-make-fs.pl:579
41706 "Attach /tmp/virt-make-fs.log to a new bug report at "
41707 "L<https://bugzilla.redhat.com/>"
41711 #: ../tools/virt-tar.pl:33
41712 msgid "virt-tar - Extract or upload files to a virtual machine"
41716 #: ../tools/virt-tar.pl:37
41719 " virt-tar [--options] -x domname directory tarball\n"
41724 #: ../tools/virt-tar.pl:39
41727 " virt-tar [--options] -u domname tarball directory\n"
41732 #: ../tools/virt-tar.pl:41
41735 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
41740 #: ../tools/virt-tar.pl:43
41743 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
41748 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
41753 #: ../tools/virt-tar.pl:47
41755 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
41756 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
41760 #: ../tools/virt-tar.pl:52
41761 msgid "Download C</home> from the VM into a local tarball:"
41765 #: ../tools/virt-tar.pl:54
41768 " virt-tar -x domname /home home.tar\n"
41773 #: ../tools/virt-tar.pl:56
41776 " virt-tar -zx domname /home home.tar.gz\n"
41781 #: ../tools/virt-tar.pl:58
41782 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
41786 #: ../tools/virt-tar.pl:60
41789 " virt-tar -u domname uploadstuff.tar /tmp\n"
41794 #: ../tools/virt-tar.pl:62
41797 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
41802 #: ../tools/virt-tar.pl:66
41804 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
41805 "virtual machines. If you do this, you risk disk corruption in the VM. "
41806 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
41810 #: ../tools/virt-tar.pl:71
41812 "You can use I<-x> (extract) on live virtual machines, but you might get "
41813 "inconsistent results or errors if there is filesystem activity inside the "
41814 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
41815 "work, but the only way to guarantee consistent results is if the virtual "
41816 "machine is shut down."
41820 #: ../tools/virt-tar.pl:79
41822 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
41823 "parts of a guest filesystem. There are many possibilities: making backups, "
41824 "uploading data files, snooping on guest activity, fixing or customizing "
41829 #: ../tools/virt-tar.pl:84
41831 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
41832 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
41833 "should look at the L<guestfish(1)> tool."
41837 #: ../tools/virt-tar.pl:88
41839 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
41840 "its contents (recursively) from the virtual machine into a local tarball. "
41841 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
41842 "virtual machine. You cannot use these two options together."
41846 #: ../tools/virt-tar.pl:94
41848 "In addition, you may need to use the I<-z> (gZip) option to enable "
41849 "compression. When uploading, you have to specify I<-z> if the upload file "
41850 "is compressed because virt-tar won't detect this on its own."
41854 #: ../tools/virt-tar.pl:98
41856 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
41857 "example it cannot do PKZip files or bzip2 compression. If you want that "
41858 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
41859 "the L<libguestfs(3)> API)."
41863 #: ../tools/virt-tar.pl:160
41864 msgid "B<--extract>"
41868 #: ../tools/virt-tar.pl:162
41869 msgid "B<--download>"
41873 #: ../tools/virt-tar.pl:164
41878 #: ../tools/virt-tar.pl:166
41879 msgid "B<--upload>"
41883 #: ../tools/virt-tar.pl:168
41885 "Use I<-x> to extract (download) a directory from a virtual machine to a "
41890 #: ../tools/virt-tar.pl:171
41892 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
41893 "Please read the L</WARNING> section above before using this option."
41897 #: ../tools/virt-tar.pl:175
41898 msgid "You must specify exactly one of these options."
41902 #: ../tools/virt-tar.pl:181
41907 #: ../tools/virt-tar.pl:183
41912 #: ../tools/virt-tar.pl:185
41913 msgid "Specify that the input or output tarball is gzip-compressed."
41917 #: ../tools/virt-tar.pl:298
41919 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
41920 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
41921 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
41922 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
41926 #: ../tools/virt-win-reg.pl:37
41928 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
41933 #: ../tools/virt-win-reg.pl:41
41936 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
41941 #: ../tools/virt-win-reg.pl:43
41944 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
41949 #: ../tools/virt-win-reg.pl:45
41952 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
41957 #: ../tools/virt-win-reg.pl:47
41960 " virt-win-reg --merge domname [input.reg ...]\n"
41965 #: ../tools/virt-win-reg.pl:49
41968 " virt-win-reg [--options] disk.img ... # instead of domname\n"
41973 #: ../tools/virt-win-reg.pl:53
41975 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
41976 "virtual machines. If you do this, you I<will> get irreversible disk "
41977 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
41978 "but doesn't catch all cases."
41982 #: ../tools/virt-win-reg.pl:58
41984 "Modifying the Windows Registry is an inherently risky operation. The format "
41985 "is deliberately obscure and undocumented, and Registry changes can leave the "
41986 "system unbootable. Therefore when using the I<--merge> option, make sure "
41987 "you have a reliable backup first."
41991 #: ../tools/virt-win-reg.pl:65
41993 "This program can export and merge Windows Registry entries from a Windows "
41998 #: ../tools/virt-win-reg.pl:68
42000 "The first parameter is the libvirt guest name or the raw disk image of a "
42005 #: ../tools/virt-win-reg.pl:71
42007 "If I<--merge> is I<not> specified, then the chosen registry key is "
42008 "displayed/exported (recursively). For example:"
42012 #: ../tools/virt-win-reg.pl:74
42015 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
42020 #: ../tools/virt-win-reg.pl:76
42021 msgid "You can also display single values from within registry keys, for example:"
42025 #: ../tools/virt-win-reg.pl:79
42028 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
42029 " $ virt-win-reg Windows7 $cvkey ProductName\n"
42030 " Windows 7 Enterprise\n"
42035 #: ../tools/virt-win-reg.pl:83
42037 "With I<--merge>, you can merge a textual regedit file into the Windows "
42042 #: ../tools/virt-win-reg.pl:86
42045 " $ virt-win-reg --merge Windows7 changes.reg\n"
42050 #: ../tools/virt-win-reg.pl:90
42052 "This program is only meant for simple access to the registry. If you want "
42053 "to do complicated things with the registry, we suggest you download the "
42054 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
42055 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
42056 "L<hivexregedit(1)>."
42060 #: ../tools/virt-win-reg.pl:159
42065 #: ../tools/virt-win-reg.pl:161
42067 "In merge mode, this merges a textual regedit file into the Windows Registry "
42068 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
42069 "displays or exports Registry entries instead."
42073 #: ../tools/virt-win-reg.pl:165
42075 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
42076 "result in disk corruption. However exporting (without this flag) is always "
42081 #: ../tools/virt-win-reg.pl:173
42082 msgid "B<--encoding> UTF-16LE|ASCII"
42086 #: ../tools/virt-win-reg.pl:175
42088 "When merging (only), you may need to specify the encoding for strings to be "
42089 "used in the hive file. This is explained in detail in "
42090 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
42094 #: ../tools/virt-win-reg.pl:179
42096 "The default is to use UTF-16LE, which should work with recent versions of "
42101 #: ../tools/virt-win-reg.pl:186
42102 msgid "B<--unsafe-printable-strings>"
42106 #: ../tools/virt-win-reg.pl:188
42108 "When exporting (only), assume strings are UTF-16LE and print them as strings "
42109 "instead of hex sequences. Remove the final zero codepoint from strings if "
42114 #: ../tools/virt-win-reg.pl:192
42116 "This is unsafe and does not preserve the fidelity of strings in the original "
42117 "Registry for various reasons:"
42121 #: ../tools/virt-win-reg.pl:199
42123 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
42124 "other encodings will be corrupted by this transformation."
42128 #: ../tools/virt-win-reg.pl:204
42130 "Assumes that everything which has type 1 or 2 is really a string and that "
42131 "everything else is not a string, but the type field in real Registries is "
42136 #: ../tools/virt-win-reg.pl:210
42138 "Loses information about whether a zero codepoint followed the string in the "
42143 #: ../tools/virt-win-reg.pl:215
42145 "This all happens because the Registry itself contains no information about "
42146 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
42150 #: ../tools/virt-win-reg.pl:219
42152 "You should only use this option for quick hacking and debugging of the "
42153 "Registry contents, and I<never> use it if the output is going to be passed "
42154 "into another program or stored in another Registry."
42158 #: ../tools/virt-win-reg.pl:556
42159 msgid "SUPPORTED SYSTEMS"
42163 #: ../tools/virt-win-reg.pl:558
42165 "The program currently supports Windows NT-derived guests starting with "
42166 "Windows XP through to at least Windows 7."
42170 #: ../tools/virt-win-reg.pl:561
42171 msgid "The following Registry keys are supported:"
42175 #: ../tools/virt-win-reg.pl:565
42176 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
42180 #: ../tools/virt-win-reg.pl:567
42181 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
42185 #: ../tools/virt-win-reg.pl:569
42186 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
42190 #: ../tools/virt-win-reg.pl:571
42191 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
42195 #: ../tools/virt-win-reg.pl:573
42196 msgid "C<HKEY_USERS\\.DEFAULT>"
42200 #: ../tools/virt-win-reg.pl:575
42201 msgid "C<HKEY_USERS\\I<SID>>"
42205 #: ../tools/virt-win-reg.pl:577
42206 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
42210 #: ../tools/virt-win-reg.pl:579
42211 msgid "C<HKEY_USERS\\I<username>>"
42215 #: ../tools/virt-win-reg.pl:581
42216 msgid "where I<username> is a local user name (this is a libguestfs extension)."
42220 #: ../tools/virt-win-reg.pl:585
42222 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
42227 #: ../tools/virt-win-reg.pl:588
42229 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
42230 "supported (there is no \"current user\")."
42234 #: ../tools/virt-win-reg.pl:591
42239 #: ../tools/virt-win-reg.pl:593
42241 "C<virt-win-reg> expects that regedit files have already been reencoded in "
42242 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
42243 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
42244 "with Windows-style line endings, you may need to reencode the whole file "
42245 "before or after processing."
42249 #: ../tools/virt-win-reg.pl:599
42251 "To reencode a file from Windows format to Linux (before processing it with "
42252 "the I<--merge> option), you would do something like this:"
42256 #: ../tools/virt-win-reg.pl:602
42259 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
42264 #: ../tools/virt-win-reg.pl:604
42266 "To go in the opposite direction, after exporting and before sending the file "
42267 "to a Windows user, do something like this:"
42271 #: ../tools/virt-win-reg.pl:607
42274 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
42279 #: ../tools/virt-win-reg.pl:609
42280 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
42284 #: ../tools/virt-win-reg.pl:611
42286 "If you are unsure about the current encoding, use the L<file(1)> command. "
42287 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
42288 "Windows-style (CRLF) line endings, like this:"
42292 #: ../tools/virt-win-reg.pl:615
42295 " $ file software.reg\n"
42296 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
42297 " with CRLF line terminators\n"
42302 #: ../tools/virt-win-reg.pl:619
42303 msgid "This file would need conversion before you could I<--merge> it."
42307 #: ../tools/virt-win-reg.pl:621
42308 msgid "CurrentControlSet etc."
42312 #: ../tools/virt-win-reg.pl:623
42314 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
42315 "Registry at the level of the hive file, and therefore you cannot modify "
42320 #: ../tools/virt-win-reg.pl:627
42322 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
42323 "circumstances it might refer to another control set. The way to find out is "
42324 "to look at the C<HKLM\\SYSTEM\\Select> key:"
42328 #: ../tools/virt-win-reg.pl:631
42331 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
42332 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
42333 " \"Current\"=dword:00000001\n"
42334 " \"Default\"=dword:00000001\n"
42335 " \"Failed\"=dword:00000000\n"
42336 " \"LastKnownGood\"=dword:00000002\n"
42341 #: ../tools/virt-win-reg.pl:638
42342 msgid "\"Current\" is the one which Windows will choose when it boots."
42346 #: ../tools/virt-win-reg.pl:640
42347 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
42351 #: ../tools/virt-win-reg.pl:643
42352 msgid "DELETING REGISTRY KEYS AND VALUES"
42356 #: ../tools/virt-win-reg.pl:645
42357 msgid "To delete a whole registry key, use the syntax:"
42361 #: ../tools/virt-win-reg.pl:647
42364 " [-HKEY_LOCAL_MACHINE\\Foo]\n"
42369 #: ../tools/virt-win-reg.pl:649
42370 msgid "To delete a single value within a key, use the syntax:"
42374 #: ../tools/virt-win-reg.pl:651
42377 " [HKEY_LOCAL_MACHINE\\Foo]\n"
42383 #: ../tools/virt-win-reg.pl:654
42384 msgid "WINDOWS TIPS"
42388 #: ../tools/virt-win-reg.pl:656
42390 "Note that some of these tips modify the guest disk image. The guest I<must> "
42391 "be shut off, else you will get disk corruption."
42395 #: ../tools/virt-win-reg.pl:659
42396 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
42400 #: ../tools/virt-win-reg.pl:661
42402 "Prepare a DOS batch script, VBScript or executable. Upload this using "
42403 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
42404 "is uploaded into C<C:\\>:"
42408 #: ../tools/virt-win-reg.pl:665
42411 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
42416 #: ../tools/virt-win-reg.pl:667
42417 msgid "Prepare a regedit file containing the registry change:"
42421 #: ../tools/virt-win-reg.pl:669
42424 " cat > test.reg <<'EOF'\n"
42425 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
42426 " \"Test\"=\"c:\\\\test.bat\"\n"
42432 #: ../tools/virt-win-reg.pl:674
42434 "In this example we use the key C<RunOnce> which means that the script will "
42435 "run precisely once when the first user logs in. If you want it to run every "
42436 "time a user logs in, replace C<RunOnce> with C<Run>."
42440 #: ../tools/virt-win-reg.pl:678
42441 msgid "Now update the registry:"
42445 #: ../tools/virt-win-reg.pl:680
42448 " virt-win-reg --merge WindowsGuest test.reg\n"
42453 #: ../tools/virt-win-reg.pl:682
42454 msgid "INSTALLING A SERVICE"
42458 #: ../tools/virt-win-reg.pl:684
42460 "This section assumes you are familiar with Windows services, and you either "
42461 "have a program which handles the Windows Service Control Protocol directly "
42462 "or you want to run any program using a service wrapper like SrvAny or the "
42467 #: ../tools/virt-win-reg.pl:689
42469 "First upload the program and optionally the service wrapper. In this case "
42470 "the test program is called C<test.exe> and we are using the RHSrvAny "
42475 #: ../tools/virt-win-reg.pl:693
42478 " guestfish -i -d WindowsGuest <<EOF\n"
42479 " upload rhsrvany.exe /rhsrvany.exe\n"
42480 " upload test.exe /test.exe\n"
42486 #: ../tools/virt-win-reg.pl:698
42488 "Prepare a regedit file containing the registry changes. In this example, "
42489 "the first registry change is needed for the service itself or the service "
42490 "wrapper (if used). The second registry change is only needed because I am "
42491 "using the RHSrvAny service wrapper."
42495 #: ../tools/virt-win-reg.pl:703
42498 " cat > service.reg <<'EOF'\n"
42499 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
42500 " \"Type\"=dword:00000010\n"
42501 " \"Start\"=dword:00000002\n"
42502 " \"ErrorControl\"=dword:00000001\n"
42503 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
42504 " \"DisplayName\"=\"RHSrvAny\"\n"
42505 " \"ObjectName\"=\"NetworkService\"\n"
42510 #: ../tools/virt-win-reg.pl:712
42513 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
42514 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
42515 " \"PWD\"=\"c:\\\\Temp\"\n"
42521 #: ../tools/virt-win-reg.pl:723
42523 "For use of C<ControlSet001> see the section above in this manual page. You "
42524 "may need to adjust this according to the control set that is in use by the "
42529 #: ../tools/virt-win-reg.pl:729
42531 "C<\"ObjectName\"> controls the privileges that the service will have. An "
42532 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
42533 "privileged account."
42537 #: ../tools/virt-win-reg.pl:735
42539 "For the meaning of the magic numbers, see this Microsoft KB article: "
42540 "L<http://support.microsoft.com/kb/103000>."
42544 #: ../tools/virt-win-reg.pl:740
42545 msgid "Update the registry:"
42549 #: ../tools/virt-win-reg.pl:742
42552 " virt-win-reg --merge WindowsGuest service.reg\n"
42557 #: ../tools/virt-win-reg.pl:746
42559 "Be careful when passing parameters containing C<\\> (backslash) in the "
42560 "shell. Usually you will have to use 'single quotes' or double backslashes "
42561 "(but not both) to protect them from the shell."
42565 #: ../tools/virt-win-reg.pl:750
42566 msgid "Paths and value names are case-insensitive."
42570 #: ../tools/virt-win-reg.pl:759
42572 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
42573 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
42574 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
42575 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
42579 #: ../tools/virt-win-reg.pl:777
42582 " export LIBGUESTFS_DEBUG=1\n"
42583 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
42588 #: ../tools/virt-win-reg.pl:780
42590 "Attach /tmp/virt-win-reg.log to a new bug report at "
42591 "L<https://bugzilla.redhat.com/>"