1 # SOME DESCRIPTIVE TITLE
2 # Copyright (C) YEAR Red Hat Inc.
3 # This file is distributed under the same license as the libguestfs package.
4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
9 "Project-Id-Version: libguestfs 1.13.23\n"
10 "Report-Msgid-Bugs-To: libguestfs@redhat.com\n"
11 "POT-Creation-Date: 2011-10-20 22:17+0200\n"
12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14 "Language-Team: LANGUAGE <LL@li.org>\n"
17 "Content-Type: text/plain; charset=UTF-8\n"
18 "Content-Transfer-Encoding: 8bit\n"
21 #: ../align/virt-alignment-scan.pod:3 ../cat/virt-cat.pod:3 ../cat/virt-filesystems.pod:3 ../cat/virt-ls.pod:3 ../clone/virt-sysprep.pod:3 ../df/virt-df.pod:3 ../edit/virt-edit.pod:3 ../erlang/examples/guestfs-erlang.pod:3 ../examples/guestfs-examples.pod:3 ../examples/guestfs-recipes.pod:14 ../fish/guestfish.pod:3 ../fish/virt-copy-in.pod:3 ../fish/virt-copy-out.pod:3 ../fish/virt-tar-in.pod:3 ../fish/virt-tar-out.pod:3 ../fuse/guestmount.pod:3 ../inspector/virt-inspector.pod:3 ../java/examples/guestfs-java.pod:3 ../ocaml/examples/guestfs-ocaml.pod:3 ../perl/examples/guestfs-perl.pod:3 ../python/examples/guestfs-python.pod:3 ../rescue/virt-rescue.pod:3 ../resize/virt-resize.pod:3 ../ruby/examples/guestfs-ruby.pod:3 ../sparsify/virt-sparsify.pod:3 ../src/guestfs.pod:3 ../test-tool/libguestfs-test-tool.pod:3 ../tools/virt-list-filesystems.pl:30 ../tools/virt-list-partitions.pl:30 ../tools/virt-make-fs.pl:35 ../tools/virt-tar.pl:31 ../tools/virt-win-reg.pl:35
26 #: ../align/virt-alignment-scan.pod:5
27 msgid "virt-alignment-scan - Check alignment of virtual machine partitions"
31 #: ../align/virt-alignment-scan.pod:7 ../cat/virt-cat.pod:7 ../cat/virt-filesystems.pod:7 ../cat/virt-ls.pod:7 ../clone/virt-sysprep.pod:7 ../df/virt-df.pod:7 ../edit/virt-edit.pod:7 ../erlang/examples/guestfs-erlang.pod:7 ../examples/guestfs-examples.pod:7 ../fish/guestfish.pod:7 ../fish/virt-copy-in.pod:7 ../fish/virt-copy-out.pod:7 ../fish/virt-tar-in.pod:7 ../fish/virt-tar-out.pod:7 ../fuse/guestmount.pod:7 ../inspector/virt-inspector.pod:7 ../java/examples/guestfs-java.pod:7 ../ocaml/examples/guestfs-ocaml.pod:7 ../perl/examples/guestfs-perl.pod:7 ../python/examples/guestfs-python.pod:7 ../rescue/virt-rescue.pod:7 ../resize/virt-resize.pod:7 ../ruby/examples/guestfs-ruby.pod:7 ../sparsify/virt-sparsify.pod:7 ../src/guestfs.pod:7 ../test-tool/libguestfs-test-tool.pod:7 ../tools/virt-list-filesystems.pl:34 ../tools/virt-list-partitions.pl:34 ../tools/virt-make-fs.pl:39 ../tools/virt-tar.pl:35 ../tools/virt-win-reg.pl:39
36 #: ../align/virt-alignment-scan.pod:9
39 " virt-alignment-scan [--options] -d domname\n"
44 #: ../align/virt-alignment-scan.pod:11
47 " virt-alignment-scan [--options] -a disk.img [-a disk.img ...]\n"
52 #: ../align/virt-alignment-scan.pod:13 ../cat/virt-cat.pod:19 ../cat/virt-filesystems.pod:13 ../cat/virt-ls.pod:19 ../clone/virt-sysprep.pod:13 ../df/virt-df.pod:21 ../edit/virt-edit.pod:27 ../erlang/examples/guestfs-erlang.pod:16 ../examples/guestfs-examples.pod:19 ../examples/guestfs-recipes.pod:18 ../fish/guestfish.pod:30 ../fish/virt-copy-in.pod:19 ../fish/virt-copy-out.pod:13 ../fish/virt-tar-in.pod:21 ../fish/virt-tar-out.pod:15 ../fuse/guestmount.pod:20 ../inspector/virt-inspector.pod:19 ../java/examples/guestfs-java.pod:15 ../ocaml/examples/guestfs-ocaml.pod:25 ../perl/examples/guestfs-perl.pod:18 ../python/examples/guestfs-python.pod:14 ../rescue/virt-rescue.pod:29 ../resize/virt-resize.pod:13 ../ruby/examples/guestfs-ruby.pod:15 ../sparsify/virt-sparsify.pod:11 ../src/guestfs.pod:23 ../test-tool/libguestfs-test-tool.pod:11 ../tools/virt-list-filesystems.pl:40 ../tools/virt-list-partitions.pl:40 ../tools/virt-make-fs.pl:47 ../tools/virt-tar.pl:77 ../tools/virt-win-reg.pl:63
57 #: ../align/virt-alignment-scan.pod:15
59 "When older operating systems install themselves, the partitioning tools "
60 "place partitions at a sector misaligned with the underlying storage "
61 "(commonly the first partition starts on sector C<63>). Misaligned "
62 "partitions can result in an operating system issuing more I/O than should be "
67 #: ../align/virt-alignment-scan.pod:21
69 "The virt-alignment-scan tool checks the alignment of partitions in virtual "
70 "machines and disk images and warns you if there are alignment problems."
74 #: ../align/virt-alignment-scan.pod:25
76 "Currently there is no virt tool for fixing alignment problems. You can only "
77 "reinstall the guest operating system. The following NetApp document "
78 "summarises the problem and possible solutions: "
79 "L<http://media.netapp.com/documents/tr-3747.pdf>"
83 #: ../align/virt-alignment-scan.pod:30
88 #: ../align/virt-alignment-scan.pod:32
89 msgid "To run this tool on a disk image directly, use the I<-a> option:"
93 #: ../align/virt-alignment-scan.pod:34
96 " $ virt-alignment-scan -a winxp.img\n"
97 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
102 #: ../align/virt-alignment-scan.pod:37
105 " $ virt-alignment-scan -a fedora16.img\n"
106 " /dev/sda1 1048576 1024K ok\n"
107 " /dev/sda2 2097152 2048K ok\n"
108 " /dev/sda3 526385152 2048K ok\n"
113 #: ../align/virt-alignment-scan.pod:42
115 "To run the tool on a guest known to libvirt, use the I<-d> option and "
116 "possibly the I<-c> option:"
120 #: ../align/virt-alignment-scan.pod:45
123 " # virt-alignment-scan -d RHEL5\n"
124 " /dev/sda1 32256 512 bad (alignment < 4K)\n"
125 " /dev/sda2 106928640 512 bad (alignment < 4K)\n"
130 #: ../align/virt-alignment-scan.pod:49
133 " $ virt-alignment-scan -c qemu:///system -d Win7TwoDisks\n"
134 " /dev/sda1 1048576 1024K ok\n"
135 " /dev/sda2 105906176 1024K ok\n"
136 " /dev/sdb1 65536 64K ok\n"
141 #: ../align/virt-alignment-scan.pod:54
143 "The output consists of 4 or more whitespace-separated columns. Only the "
144 "first 4 columns are signficant if you want to parse this from a program. "
149 #: ../align/virt-alignment-scan.pod:60
154 #: ../align/virt-alignment-scan.pod:62
156 "the device and partition name (eg. C</dev/sda1> meaning the first partition "
157 "on the first block device)"
161 #: ../align/virt-alignment-scan.pod:65
166 #: ../align/virt-alignment-scan.pod:67
167 msgid "the start of the partition in bytes"
171 #: ../align/virt-alignment-scan.pod:69
176 #: ../align/virt-alignment-scan.pod:71
177 msgid "the alignment in bytes or Kbytes (eg. C<512> or C<4K>)"
181 #: ../align/virt-alignment-scan.pod:73
186 #: ../align/virt-alignment-scan.pod:75
188 "C<ok> if the alignment is best for performance, or C<bad> if the alignment "
189 "can cause performance problems"
193 #: ../align/virt-alignment-scan.pod:78
198 #: ../align/virt-alignment-scan.pod:80
199 msgid "optional free-text explanation."
203 #: ../align/virt-alignment-scan.pod:84
205 "The exit code from the program changes depending on whether poorly aligned "
206 "partitions were found. See L</EXIT STATUS> below."
210 #: ../align/virt-alignment-scan.pod:87
211 msgid "If you just want the exit code with no output, use the I<-q> option."
215 #: ../align/virt-alignment-scan.pod:89 ../cat/virt-cat.pod:62 ../cat/virt-filesystems.pod:91 ../cat/virt-ls.pod:261 ../clone/virt-sysprep.pod:42 ../df/virt-df.pod:59 ../edit/virt-edit.pod:62 ../fish/guestfish.pod:148 ../fish/virt-copy-in.pod:45 ../fish/virt-copy-out.pod:34 ../fish/virt-tar-in.pod:42 ../fish/virt-tar-out.pod:36 ../fuse/guestmount.pod:92 ../inspector/virt-inspector.pod:55 ../rescue/virt-rescue.pod:84 ../resize/virt-resize.pod:241 ../sparsify/virt-sparsify.pod:99 ../test-tool/libguestfs-test-tool.pod:36 ../tools/virt-list-filesystems.pl:53 ../tools/virt-list-partitions.pl:54 ../tools/virt-make-fs.pl:153 ../tools/virt-tar.pl:103 ../tools/virt-win-reg.pl:96
220 #: ../align/virt-alignment-scan.pod:93 ../cat/virt-cat.pod:66 ../cat/virt-filesystems.pod:95 ../cat/virt-ls.pod:265 ../clone/virt-sysprep.pod:46 ../df/virt-df.pod:63 ../edit/virt-edit.pod:66 ../fish/guestfish.pod:152 ../fuse/guestmount.pod:160 ../inspector/virt-inspector.pod:59 ../rescue/virt-rescue.pod:88 ../resize/virt-resize.pod:245 ../sparsify/virt-sparsify.pod:103 ../test-tool/libguestfs-test-tool.pod:40 ../tools/virt-list-filesystems.pl:61 ../tools/virt-list-partitions.pl:62 ../tools/virt-make-fs.pl:161 ../tools/virt-tar.pl:111 ../tools/virt-win-reg.pl:104
225 #: ../align/virt-alignment-scan.pod:95 ../cat/virt-cat.pod:68 ../cat/virt-filesystems.pod:97 ../cat/virt-ls.pod:267 ../clone/virt-sysprep.pod:48 ../df/virt-df.pod:65 ../edit/virt-edit.pod:68 ../inspector/virt-inspector.pod:61 ../rescue/virt-rescue.pod:90 ../tools/virt-list-filesystems.pl:63 ../tools/virt-list-partitions.pl:64 ../tools/virt-make-fs.pl:163 ../tools/virt-tar.pl:113 ../tools/virt-win-reg.pl:106
226 msgid "Display brief help."
230 #: ../align/virt-alignment-scan.pod:97 ../cat/virt-cat.pod:70 ../cat/virt-filesystems.pod:99 ../cat/virt-ls.pod:269 ../clone/virt-sysprep.pod:50 ../df/virt-df.pod:67 ../edit/virt-edit.pod:70 ../inspector/virt-inspector.pod:63 ../rescue/virt-rescue.pod:92
235 #: ../align/virt-alignment-scan.pod:99 ../cat/virt-cat.pod:72 ../cat/virt-filesystems.pod:101 ../cat/virt-ls.pod:271 ../clone/virt-sysprep.pod:52 ../df/virt-df.pod:69 ../edit/virt-edit.pod:72 ../inspector/virt-inspector.pod:65 ../rescue/virt-rescue.pod:94
236 msgid "B<--add> file"
240 #: ../align/virt-alignment-scan.pod:101 ../clone/virt-sysprep.pod:54
241 msgid "Add I<file> which should be a disk image from a virtual machine."
245 #: ../align/virt-alignment-scan.pod:103 ../cat/virt-cat.pod:78 ../cat/virt-filesystems.pod:107 ../cat/virt-ls.pod:277 ../clone/virt-sysprep.pod:56 ../df/virt-df.pod:75 ../edit/virt-edit.pod:78 ../fish/guestfish.pod:174 ../fuse/guestmount.pod:102 ../inspector/virt-inspector.pod:71 ../rescue/virt-rescue.pod:100
247 "The format of the disk image is auto-detected. To override this and force a "
248 "particular format use the I<--format=..> option."
252 #: ../align/virt-alignment-scan.pod:106 ../cat/virt-cat.pod:81 ../cat/virt-filesystems.pod:125 ../cat/virt-ls.pod:291 ../clone/virt-sysprep.pod:59 ../df/virt-df.pod:78 ../rescue/virt-rescue.pod:107
257 #: ../align/virt-alignment-scan.pod:108 ../cat/virt-cat.pod:83 ../cat/virt-filesystems.pod:127 ../cat/virt-ls.pod:293 ../clone/virt-sysprep.pod:61 ../df/virt-df.pod:80 ../rescue/virt-rescue.pod:109
258 msgid "B<--connect> URI"
262 #: ../align/virt-alignment-scan.pod:110 ../cat/virt-cat.pod:85 ../cat/virt-filesystems.pod:129 ../cat/virt-ls.pod:295 ../clone/virt-sysprep.pod:63 ../df/virt-df.pod:82 ../edit/virt-edit.pod:99 ../inspector/virt-inspector.pod:78 ../rescue/virt-rescue.pod:111 ../tools/virt-list-filesystems.pl:81 ../tools/virt-list-partitions.pl:82 ../tools/virt-tar.pl:131 ../tools/virt-win-reg.pl:132
264 "If using libvirt, connect to the given I<URI>. If omitted, then we connect "
265 "to the default libvirt hypervisor."
269 #: ../align/virt-alignment-scan.pod:113 ../cat/virt-cat.pod:88 ../cat/virt-filesystems.pod:132 ../cat/virt-ls.pod:298 ../clone/virt-sysprep.pod:66 ../df/virt-df.pod:85 ../rescue/virt-rescue.pod:114
271 "If you specify guest block devices directly (I<-a>), then libvirt is not "
276 #: ../align/virt-alignment-scan.pod:116 ../cat/virt-cat.pod:91 ../cat/virt-filesystems.pod:141 ../cat/virt-ls.pod:307 ../clone/virt-sysprep.pod:69 ../df/virt-df.pod:94 ../edit/virt-edit.pod:105 ../inspector/virt-inspector.pod:85 ../rescue/virt-rescue.pod:117
281 #: ../align/virt-alignment-scan.pod:118 ../cat/virt-cat.pod:93 ../cat/virt-filesystems.pod:143 ../cat/virt-ls.pod:309 ../clone/virt-sysprep.pod:71 ../df/virt-df.pod:96 ../edit/virt-edit.pod:107 ../inspector/virt-inspector.pod:87 ../rescue/virt-rescue.pod:119
282 msgid "B<--domain> guest"
286 #: ../align/virt-alignment-scan.pod:120 ../cat/virt-cat.pod:95 ../cat/virt-filesystems.pod:145 ../cat/virt-ls.pod:311 ../clone/virt-sysprep.pod:73 ../df/virt-df.pod:98 ../edit/virt-edit.pod:109 ../inspector/virt-inspector.pod:89 ../rescue/virt-rescue.pod:121
288 "Add all the disks from the named libvirt guest. Domain UUIDs can be used "
293 #: ../align/virt-alignment-scan.pod:123 ../cat/virt-cat.pod:105 ../cat/virt-filesystems.pod:170 ../cat/virt-ls.pod:328 ../clone/virt-sysprep.pod:95 ../df/virt-df.pod:101 ../fish/guestfish.pod:233 ../fuse/guestmount.pod:142 ../inspector/virt-inspector.pod:99 ../rescue/virt-rescue.pod:124
294 msgid "B<--format=raw|qcow2|..>"
298 #: ../align/virt-alignment-scan.pod:125 ../cat/virt-cat.pod:107 ../cat/virt-filesystems.pod:172 ../cat/virt-ls.pod:330 ../clone/virt-sysprep.pod:97 ../df/virt-df.pod:103 ../edit/virt-edit.pod:134 ../fish/guestfish.pod:235 ../fuse/guestmount.pod:144 ../inspector/virt-inspector.pod:101 ../rescue/virt-rescue.pod:126
303 #: ../align/virt-alignment-scan.pod:127 ../cat/virt-cat.pod:109 ../cat/virt-filesystems.pod:174 ../cat/virt-ls.pod:332 ../clone/virt-sysprep.pod:99 ../df/virt-df.pod:105 ../edit/virt-edit.pod:136 ../fish/guestfish.pod:237 ../fuse/guestmount.pod:146 ../rescue/virt-rescue.pod:128
305 "The default for the I<-a> option is to auto-detect the format of the disk "
306 "image. Using this forces the disk format for I<-a> options which follow on "
307 "the command line. Using I<--format> with no argument switches back to "
308 "auto-detection for subsequent I<-a> options."
312 #: ../align/virt-alignment-scan.pod:132 ../cat/virt-cat.pod:114 ../cat/virt-filesystems.pod:179 ../cat/virt-ls.pod:337 ../clone/virt-sysprep.pod:104 ../df/virt-df.pod:110 ../edit/virt-edit.pod:141 ../fish/guestfish.pod:242 ../fish/guestfish.pod:673 ../inspector/virt-inspector.pod:336 ../rescue/virt-rescue.pod:133 ../src/guestfs.pod:2862
317 #: ../align/virt-alignment-scan.pod:134
320 " virt-alignment-scan --format=raw -a disk.img\n"
325 #: ../align/virt-alignment-scan.pod:136 ../cat/virt-cat.pod:118 ../cat/virt-filesystems.pod:183 ../cat/virt-ls.pod:341 ../clone/virt-sysprep.pod:108 ../df/virt-df.pod:114 ../edit/virt-edit.pod:145 ../fish/guestfish.pod:246 ../rescue/virt-rescue.pod:137
326 msgid "forces raw format (no auto-detection) for C<disk.img>."
330 #: ../align/virt-alignment-scan.pod:138
333 " virt-alignment-scan --format=raw -a disk.img --format -a another.img\n"
338 #: ../align/virt-alignment-scan.pod:140 ../cat/virt-cat.pod:122 ../cat/virt-filesystems.pod:187 ../cat/virt-ls.pod:345 ../clone/virt-sysprep.pod:112 ../df/virt-df.pod:118 ../edit/virt-edit.pod:149 ../fish/guestfish.pod:250 ../rescue/virt-rescue.pod:141
340 "forces raw format (no auto-detection) for C<disk.img> and reverts to "
341 "auto-detection for C<another.img>."
345 #: ../align/virt-alignment-scan.pod:143 ../cat/virt-cat.pod:125 ../cat/virt-filesystems.pod:190 ../cat/virt-ls.pod:348 ../clone/virt-sysprep.pod:115 ../df/virt-df.pod:121 ../edit/virt-edit.pod:152 ../rescue/virt-rescue.pod:144
347 "If you have untrusted raw-format guest disk images, you should use this "
348 "option to specify the disk format. This avoids a possible security problem "
349 "with malicious guests (CVE-2010-3851)."
353 #: ../align/virt-alignment-scan.pod:147 ../resize/virt-resize.pod:470 ../sparsify/virt-sparsify.pod:153
358 #: ../align/virt-alignment-scan.pod:149 ../resize/virt-resize.pod:472 ../sparsify/virt-sparsify.pod:155
363 #: ../align/virt-alignment-scan.pod:151
365 "Don't produce any output. Just set the exit code (see L</EXIT STATUS> "
370 #: ../align/virt-alignment-scan.pod:154 ../cat/virt-cat.pod:134 ../cat/virt-filesystems.pod:261 ../cat/virt-ls.pod:425 ../clone/virt-sysprep.pod:138 ../df/virt-df.pod:173 ../edit/virt-edit.pod:161 ../fish/guestfish.pod:390 ../fuse/guestmount.pod:266 ../inspector/virt-inspector.pod:119 ../rescue/virt-rescue.pod:182 ../sparsify/virt-sparsify.pod:159
375 #: ../align/virt-alignment-scan.pod:156 ../cat/virt-cat.pod:136 ../cat/virt-filesystems.pod:263 ../cat/virt-ls.pod:427 ../clone/virt-sysprep.pod:140 ../df/virt-df.pod:175 ../edit/virt-edit.pod:163 ../fish/guestfish.pod:392 ../fuse/guestmount.pod:268 ../inspector/virt-inspector.pod:121 ../rescue/virt-rescue.pod:184 ../sparsify/virt-sparsify.pod:161
380 #: ../align/virt-alignment-scan.pod:158 ../cat/virt-cat.pod:138 ../cat/virt-filesystems.pod:265 ../cat/virt-ls.pod:429 ../clone/virt-sysprep.pod:142 ../df/virt-df.pod:177 ../edit/virt-edit.pod:165 ../inspector/virt-inspector.pod:123 ../rescue/virt-rescue.pod:186 ../sparsify/virt-sparsify.pod:163
381 msgid "Enable verbose messages for debugging."
385 #: ../align/virt-alignment-scan.pod:160 ../cat/virt-cat.pod:140 ../cat/virt-filesystems.pod:267 ../cat/virt-ls.pod:431 ../clone/virt-sysprep.pod:144 ../df/virt-df.pod:179 ../edit/virt-edit.pod:167 ../fish/guestfish.pod:397 ../fuse/guestmount.pod:272 ../inspector/virt-inspector.pod:125 ../rescue/virt-rescue.pod:188 ../resize/virt-resize.pod:540 ../sparsify/virt-sparsify.pod:165
390 #: ../align/virt-alignment-scan.pod:162 ../cat/virt-cat.pod:142 ../cat/virt-filesystems.pod:269 ../cat/virt-ls.pod:433 ../clone/virt-sysprep.pod:146 ../df/virt-df.pod:181 ../edit/virt-edit.pod:169 ../fish/guestfish.pod:399 ../fuse/guestmount.pod:274 ../inspector/virt-inspector.pod:127 ../rescue/virt-rescue.pod:190 ../resize/virt-resize.pod:542 ../sparsify/virt-sparsify.pod:167 ../tools/virt-list-filesystems.pl:69 ../tools/virt-list-partitions.pl:70 ../tools/virt-make-fs.pl:169 ../tools/virt-tar.pl:119 ../tools/virt-win-reg.pl:112
395 #: ../align/virt-alignment-scan.pod:164 ../cat/virt-cat.pod:144 ../cat/virt-filesystems.pod:271 ../cat/virt-ls.pod:435 ../clone/virt-sysprep.pod:148 ../df/virt-df.pod:183 ../edit/virt-edit.pod:171 ../inspector/virt-inspector.pod:129 ../rescue/virt-rescue.pod:192 ../resize/virt-resize.pod:544 ../sparsify/virt-sparsify.pod:169 ../tools/virt-list-filesystems.pl:71 ../tools/virt-list-partitions.pl:72 ../tools/virt-make-fs.pl:171 ../tools/virt-tar.pl:121 ../tools/virt-win-reg.pl:114
396 msgid "Display version number and exit."
400 #: ../align/virt-alignment-scan.pod:166 ../cat/virt-cat.pod:146 ../cat/virt-filesystems.pod:281 ../cat/virt-ls.pod:437 ../clone/virt-sysprep.pod:150 ../df/virt-df.pod:185 ../edit/virt-edit.pod:173 ../fish/guestfish.pod:412 ../fuse/guestmount.pod:287 ../inspector/virt-inspector.pod:131 ../rescue/virt-rescue.pod:203 ../sparsify/virt-sparsify.pod:171 ../tools/virt-tar.pl:158
405 #: ../align/virt-alignment-scan.pod:168 ../cat/virt-cat.pod:148 ../cat/virt-filesystems.pod:283 ../cat/virt-ls.pod:439 ../clone/virt-sysprep.pod:152 ../df/virt-df.pod:187 ../edit/virt-edit.pod:175 ../inspector/virt-inspector.pod:133 ../rescue/virt-rescue.pod:205 ../sparsify/virt-sparsify.pod:173
406 msgid "Enable tracing of libguestfs API calls."
410 #: ../align/virt-alignment-scan.pod:172
411 msgid "RECOMMENDED ALIGNMENT"
415 #: ../align/virt-alignment-scan.pod:174
417 "Operating systems older than Windows 2008 and Linux before ca.2010 place the "
418 "first sector of the first partition at sector 63, with a 512 byte sector "
419 "size. This happens because of a historical accident. Drives have to report "
420 "a cylinder / head / sector (CHS) geometry to the BIOS. The geometry is "
421 "completely meaningless on modern drives, but it happens that the geometry "
422 "reported always has 63 sectors per track. The operating system therefore "
423 "places the first partition at the start of the second \"track\", at sector "
428 #: ../align/virt-alignment-scan.pod:183
430 "When the guest OS is virtualized, the host operating system and hypervisor "
431 "may prefer accesses aligned to one of:"
435 #: ../align/virt-alignment-scan.pod:188
440 #: ../align/virt-alignment-scan.pod:190
442 "if the host OS uses local storage directly on hard drive partitions, and the "
443 "hard drive has 512 byte physical sectors."
447 #: ../align/virt-alignment-scan.pod:193
452 #: ../align/virt-alignment-scan.pod:195
454 "for local storage on new hard drives with 4Kbyte physical sectors; for "
455 "file-backed storage on filesystems with 4Kbyte block size; or for some types "
456 "of network-attached storage."
460 #: ../align/virt-alignment-scan.pod:199
465 #: ../align/virt-alignment-scan.pod:201
467 "for high-end network-attached storage. This is the optimal block size for "
468 "some NetApp hardware."
472 #: ../align/virt-alignment-scan.pod:204
477 #: ../align/virt-alignment-scan.pod:206
478 msgid "see L</1 MB PARTITION ALIGNMENT> below."
482 #: ../align/virt-alignment-scan.pod:210
484 "Partitions which are not aligned correctly to the underlying storage cause "
485 "extra I/O. For example:"
489 #: ../align/virt-alignment-scan.pod:213
493 " +--------------------------+------\n"
495 " | filesystem block |\n"
496 " ---+------------------+------+-------------------+-----+---\n"
497 " | host block | host block |\n"
499 " ---+-------------------------+-------------------------+---\n"
504 #: ../align/virt-alignment-scan.pod:222
506 "In this example, each time a 4K guest block is read, two blocks on the host "
507 "must be accessed (so twice as much I/O is done). When a 4K guest block is "
508 "written, two host blocks must first be read, the old and new data combined, "
509 "and the two blocks written back (4x I/O)."
513 #: ../align/virt-alignment-scan.pod:227
514 msgid "LINUX HOST BLOCK AND I/O SIZE"
518 #: ../align/virt-alignment-scan.pod:229
520 "New versions of the Linux kernel expose the physical and logical block size, "
521 "and minimum and recommended I/O size."
525 #: ../align/virt-alignment-scan.pod:232
526 msgid "For a typical hard drive with 512 byte sectors:"
530 #: ../align/virt-alignment-scan.pod:234
533 " $ cat /sys/block/sda/queue/physical_block_size\n"
535 " $ cat /sys/block/sda/queue/logical_block_size\n"
537 " $ cat /sys/block/sda/queue/minimum_io_size\n"
539 " $ cat /sys/block/sda/queue/optimal_io_size\n"
545 #: ../align/virt-alignment-scan.pod:243
546 msgid "For a NetApp LUN:"
550 #: ../align/virt-alignment-scan.pod:245
553 " $ cat /sys/block/sdc/queue/logical_block_size\n"
555 " $ cat /sys/block/sdc/queue/physical_block_size\n"
557 " $ cat /sys/block/sdc/queue/minimum_io_size\n"
559 " $ cat /sys/block/sdc/queue/optimal_io_size\n"
565 #: ../align/virt-alignment-scan.pod:254
567 "The NetApp allows 512 byte accesses (but they will be very inefficient), "
568 "prefers a minimum 4K I/O size, but the optimal I/O size is 64K."
572 #: ../align/virt-alignment-scan.pod:258
574 "For detailed information about what these numbers mean, see "
575 "L<http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Storage_Administration_Guide/newstorage-iolimits.html>"
579 #: ../align/virt-alignment-scan.pod:261
581 "[Thanks to Mike Snitzer for providing NetApp data and additional "
586 #: ../align/virt-alignment-scan.pod:264
587 msgid "1 MB PARTITION ALIGNMENT"
591 #: ../align/virt-alignment-scan.pod:266
593 "Microsoft picked 1 MB as the default alignment for all partitions starting "
594 "with Windows 2008 Server, and Linux has followed this."
598 #: ../align/virt-alignment-scan.pod:269
600 "Assuming 512 byte sectors in the guest, you will now see the first partition "
601 "starting at sector 2048, and subsequent partitions (if any) will start at a "
602 "multiple of 2048 sectors."
606 #: ../align/virt-alignment-scan.pod:273
608 "1 MB alignment is compatible with all current alignment requirements (4K, "
609 "64K) and provides room for future growth in physical block sizes."
613 #: ../align/virt-alignment-scan.pod:276
614 msgid "SETTING ALIGNMENT"
618 #: ../align/virt-alignment-scan.pod:278
620 "L<virt-resize(1)> can change the alignment of the partitions of some "
621 "guests. Currently it can fully align all the partitions of all Windows "
622 "guests, and it will fix the bootloader where necessary. For Linux guests, "
623 "it can align the second and subsequent partitions, so the majority of OS "
624 "accesses except at boot will be aligned."
628 #: ../align/virt-alignment-scan.pod:284
630 "Another way to correct partition alignment problems is to reinstall your "
631 "guest operating systems. If you install operating systems from templates, "
632 "ensure these have correct partition alignment too."
636 #: ../align/virt-alignment-scan.pod:288
638 "For older versions of Windows, the following NetApp document contains useful "
639 "information: L<http://media.netapp.com/documents/tr-3747.pdf>"
643 #: ../align/virt-alignment-scan.pod:291
645 "For Red Hat Enterprise Linux E<le> 5, use a Kickstart script that contains "
646 "an explicit C<%pre> section that creates aligned partitions using "
647 "L<parted(8)>. Do not use the Kickstart C<part> command. The NetApp "
648 "document above contains an example."
652 #: ../align/virt-alignment-scan.pod:296 ../cat/virt-cat.pod:191 ../cat/virt-filesystems.pod:365 ../cat/virt-ls.pod:483 ../clone/virt-sysprep.pod:475 ../df/virt-df.pod:215 ../edit/virt-edit.pod:342 ../inspector/virt-inspector.pod:352 ../rescue/virt-rescue.pod:266 ../resize/virt-resize.pod:655 ../tools/virt-list-filesystems.pl:188 ../tools/virt-list-partitions.pl:258 ../tools/virt-make-fs.pl:532 ../tools/virt-tar.pl:289 ../tools/virt-win-reg.pl:733
653 msgid "SHELL QUOTING"
657 #: ../align/virt-alignment-scan.pod:298 ../cat/virt-cat.pod:193 ../cat/virt-filesystems.pod:367 ../cat/virt-ls.pod:485 ../clone/virt-sysprep.pod:477 ../df/virt-df.pod:217 ../edit/virt-edit.pod:344 ../inspector/virt-inspector.pod:354 ../rescue/virt-rescue.pod:268 ../resize/virt-resize.pod:657 ../tools/virt-list-filesystems.pl:190 ../tools/virt-list-partitions.pl:260 ../tools/virt-make-fs.pl:534 ../tools/virt-tar.pl:291 ../tools/virt-win-reg.pl:741
659 "Libvirt guest names can contain arbitrary characters, some of which have "
660 "meaning to the shell such as C<#> and space. You may need to quote or "
661 "escape these characters on the command line. See the shell manual page "
662 "L<sh(1)> for details."
666 #: ../align/virt-alignment-scan.pod:303 ../cat/virt-cat.pod:198 ../cat/virt-filesystems.pod:372 ../cat/virt-ls.pod:490 ../clone/virt-sysprep.pod:482 ../df/virt-df.pod:222 ../edit/virt-edit.pod:349 ../fish/guestfish.pod:1114 ../fuse/guestmount.pod:312 ../inspector/virt-inspector.pod:375 ../resize/virt-resize.pod:662 ../sparsify/virt-sparsify.pod:227 ../test-tool/libguestfs-test-tool.pod:90
671 #: ../align/virt-alignment-scan.pod:305
672 msgid "This program returns:"
676 #: ../align/virt-alignment-scan.pod:309 ../align/virt-alignment-scan.pod:315 ../align/virt-alignment-scan.pod:321 ../align/virt-alignment-scan.pod:328 ../clone/virt-sysprep.pod:283 ../clone/virt-sysprep.pod:287 ../clone/virt-sysprep.pod:291 ../clone/virt-sysprep.pod:295 ../clone/virt-sysprep.pod:310 ../clone/virt-sysprep.pod:314 ../clone/virt-sysprep.pod:318 ../clone/virt-sysprep.pod:322 ../clone/virt-sysprep.pod:326 ../clone/virt-sysprep.pod:362 ../clone/virt-sysprep.pod:384 ../clone/virt-sysprep.pod:388 ../df/virt-df.pod:148 ../df/virt-df.pod:154 ../edit/virt-edit.pod:266 ../edit/virt-edit.pod:271 ../edit/virt-edit.pod:276 ../edit/virt-edit.pod:287 ../edit/virt-edit.pod:291 ../examples/guestfs-recipes.pod:98 ../examples/guestfs-recipes.pod:102 ../examples/guestfs-recipes.pod:106 ../examples/guestfs-recipes.pod:132 ../examples/guestfs-recipes.pod:137 ../examples/guestfs-recipes.pod:227 ../examples/guestfs-recipes.pod:231 ../examples/guestfs-recipes.pod:235 ../examples/guestfs-recipes.pod:239 ../examples/guestfs-recipes.pod:243 ../fish/guestfish-actions.pod:13 ../fish/guestfish-actions.pod:20 ../fish/guestfish-actions.pod:395 ../fish/guestfish-actions.pod:403 ../fish/guestfish-actions.pod:410 ../fish/guestfish-actions.pod:417 ../fish/guestfish-actions.pod:1144 ../fish/guestfish-actions.pod:1148 ../fish/guestfish-actions.pod:1152 ../fish/guestfish-actions.pod:1156 ../fish/guestfish-actions.pod:1164 ../fish/guestfish-actions.pod:1168 ../fish/guestfish-actions.pod:1172 ../fish/guestfish-actions.pod:1182 ../fish/guestfish-actions.pod:1186 ../fish/guestfish-actions.pod:1190 ../fish/guestfish-actions.pod:1280 ../fish/guestfish-actions.pod:1284 ../fish/guestfish-actions.pod:1289 ../fish/guestfish-actions.pod:1294 ../fish/guestfish-actions.pod:1336 ../fish/guestfish-actions.pod:1340 ../fish/guestfish-actions.pod:1345 ../fish/guestfish-actions.pod:1601 ../fish/guestfish-actions.pod:1608 ../fish/guestfish-actions.pod:1615 ../fish/guestfish-actions.pod:2018 ../fish/guestfish-actions.pod:2024 ../fish/guestfish-actions.pod:2032 ../fish/guestfish-actions.pod:2039 ../fish/guestfish-actions.pod:2046 ../fish/guestfish.pod:445 ../fish/guestfish.pod:449 ../fish/guestfish.pod:453 ../fish/guestfish.pod:457 ../inspector/virt-inspector.pod:393 ../inspector/virt-inspector.pod:397 ../resize/virt-resize.pod:338 ../resize/virt-resize.pod:342 ../resize/virt-resize.pod:351 ../resize/virt-resize.pod:357 ../sparsify/virt-sparsify.pod:32 ../sparsify/virt-sparsify.pod:39 ../sparsify/virt-sparsify.pod:43 ../sparsify/virt-sparsify.pod:49 ../sparsify/virt-sparsify.pod:54 ../sparsify/virt-sparsify.pod:58 ../sparsify/virt-sparsify.pod:64 ../src/guestfs-actions.pod:22 ../src/guestfs-actions.pod:29 ../src/guestfs-actions.pod:594 ../src/guestfs-actions.pod:602 ../src/guestfs-actions.pod:609 ../src/guestfs-actions.pod:616 ../src/guestfs-actions.pod:1784 ../src/guestfs-actions.pod:1788 ../src/guestfs-actions.pod:1792 ../src/guestfs-actions.pod:1796 ../src/guestfs-actions.pod:1804 ../src/guestfs-actions.pod:1808 ../src/guestfs-actions.pod:1812 ../src/guestfs-actions.pod:1822 ../src/guestfs-actions.pod:1826 ../src/guestfs-actions.pod:1830 ../src/guestfs-actions.pod:1968 ../src/guestfs-actions.pod:1972 ../src/guestfs-actions.pod:1977 ../src/guestfs-actions.pod:1982 ../src/guestfs-actions.pod:2043 ../src/guestfs-actions.pod:2047 ../src/guestfs-actions.pod:2052 ../src/guestfs-actions.pod:2467 ../src/guestfs-actions.pod:2474 ../src/guestfs-actions.pod:2481 ../src/guestfs-actions.pod:3026 ../src/guestfs-actions.pod:3032 ../src/guestfs-actions.pod:3040 ../src/guestfs-actions.pod:3047 ../src/guestfs-actions.pod:3054 ../src/guestfs.pod:388 ../src/guestfs.pod:393 ../src/guestfs.pod:398 ../src/guestfs.pod:402 ../src/guestfs.pod:407 ../src/guestfs.pod:411 ../src/guestfs.pod:416 ../src/guestfs.pod:421 ../src/guestfs.pod:1094 ../src/guestfs.pod:1098 ../src/guestfs.pod:1102 ../src/guestfs.pod:1107 ../src/guestfs.pod:1115 ../src/guestfs.pod:1134 ../src/guestfs.pod:1142 ../src/guestfs.pod:1164 ../src/guestfs.pod:1168 ../src/guestfs.pod:1172 ../src/guestfs.pod:1176 ../src/guestfs.pod:1180 ../src/guestfs.pod:1184 ../src/guestfs.pod:1674 ../src/guestfs.pod:1679 ../src/guestfs.pod:1683 ../src/guestfs.pod:1785 ../src/guestfs.pod:1790 ../src/guestfs.pod:1794 ../src/guestfs.pod:1804 ../src/guestfs.pod:2093 ../src/guestfs.pod:2098 ../src/guestfs.pod:2104 ../src/guestfs.pod:2112 ../src/guestfs.pod:2630 ../src/guestfs.pod:2636 ../src/guestfs.pod:2641 ../src/guestfs.pod:2647 ../src/guestfs.pod:3047 ../src/guestfs.pod:3052 ../src/guestfs.pod:3056 ../src/guestfs.pod:3060 ../src/guestfs.pod:3064 ../src/guestfs.pod:3078 ../src/guestfs.pod:3083 ../src/guestfs.pod:3314 ../src/guestfs.pod:3318 ../src/guestfs.pod:3322 ../src/guestfs.pod:3326 ../tools/virt-win-reg.pl:197 ../tools/virt-win-reg.pl:202 ../tools/virt-win-reg.pl:208 ../tools/virt-win-reg.pl:710 ../tools/virt-win-reg.pl:716 ../tools/virt-win-reg.pl:722
681 #: ../align/virt-alignment-scan.pod:311
686 #: ../align/virt-alignment-scan.pod:313
687 msgid "successful exit, all partitions are aligned E<ge> 64K for best performance"
691 #: ../align/virt-alignment-scan.pod:317
696 #: ../align/virt-alignment-scan.pod:319
697 msgid "an error scanning the disk image or guest"
701 #: ../align/virt-alignment-scan.pod:323
706 #: ../align/virt-alignment-scan.pod:325
708 "successful exit, some partitions have alignment E<lt> 64K which can result "
709 "in poor performance on high end network storage"
713 #: ../align/virt-alignment-scan.pod:330
718 #: ../align/virt-alignment-scan.pod:332
720 "successful exit, some partitions have alignment E<lt> 4K which can result in "
721 "poor performance on most hypervisors"
725 #: ../align/virt-alignment-scan.pod:337 ../cat/virt-cat.pod:203 ../cat/virt-filesystems.pod:377 ../cat/virt-ls.pod:495 ../clone/virt-sysprep.pod:486 ../df/virt-df.pod:227 ../edit/virt-edit.pod:354 ../erlang/examples/guestfs-erlang.pod:97 ../examples/guestfs-examples.pod:33 ../examples/guestfs-recipes.pod:384 ../fish/guestfish.pod:1268 ../fish/virt-copy-in.pod:50 ../fish/virt-copy-out.pod:39 ../fish/virt-tar-in.pod:47 ../fish/virt-tar-out.pod:41 ../fuse/guestmount.pod:317 ../inspector/virt-inspector.pod:380 ../java/examples/guestfs-java.pod:45 ../ocaml/examples/guestfs-ocaml.pod:78 ../perl/examples/guestfs-perl.pod:39 ../python/examples/guestfs-python.pod:42 ../rescue/virt-rescue.pod:288 ../resize/virt-resize.pod:667 ../ruby/examples/guestfs-ruby.pod:36 ../sparsify/virt-sparsify.pod:251 ../src/guestfs.pod:3255 ../test-tool/libguestfs-test-tool.pod:100 ../tools/virt-list-filesystems.pl:195 ../tools/virt-list-partitions.pl:265 ../tools/virt-make-fs.pl:539 ../tools/virt-tar.pl:296 ../tools/virt-win-reg.pl:746
730 #: ../align/virt-alignment-scan.pod:339
732 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, L<virt-rescue(1)>, "
733 "L<virt-resize(1)>, L<http://libguestfs.org/>."
737 #: ../align/virt-alignment-scan.pod:346 ../cat/virt-cat.pod:212 ../cat/virt-filesystems.pod:388 ../cat/virt-ls.pod:507 ../clone/virt-sysprep.pod:501 ../df/virt-df.pod:235 ../edit/virt-edit.pod:368 ../rescue/virt-rescue.pod:296 ../resize/virt-resize.pod:690 ../sparsify/virt-sparsify.pod:264 ../tools/virt-list-filesystems.pl:208 ../tools/virt-list-partitions.pl:277 ../tools/virt-make-fs.pl:564 ../tools/virt-tar.pl:311 ../tools/virt-win-reg.pl:772
742 #: ../align/virt-alignment-scan.pod:348 ../cat/virt-cat.pod:214 ../cat/virt-filesystems.pod:390 ../cat/virt-ls.pod:509 ../clone/virt-sysprep.pod:503 ../df/virt-df.pod:237 ../edit/virt-edit.pod:370 ../inspector/virt-inspector.pod:395 ../rescue/virt-rescue.pod:298 ../resize/virt-resize.pod:692 ../sparsify/virt-sparsify.pod:266 ../tools/virt-list-filesystems.pl:210 ../tools/virt-list-partitions.pl:279 ../tools/virt-make-fs.pl:566 ../tools/virt-tar.pl:313 ../tools/virt-win-reg.pl:774
743 msgid "Richard W.M. Jones L<http://people.redhat.com/~rjones/>"
747 #: ../align/virt-alignment-scan.pod:350 ../cat/virt-cat.pod:216 ../cat/virt-filesystems.pod:392 ../cat/virt-ls.pod:511 ../clone/virt-sysprep.pod:505 ../df/virt-df.pod:239 ../edit/virt-edit.pod:372 ../erlang/examples/guestfs-erlang.pod:114 ../examples/guestfs-examples.pod:49 ../examples/guestfs-recipes.pod:401 ../fish/guestfish.pod:1300 ../fish/virt-copy-in.pod:64 ../fish/virt-copy-out.pod:53 ../fish/virt-tar-in.pod:62 ../fish/virt-tar-out.pod:55 ../fuse/guestmount.pod:332 ../inspector/virt-inspector.pod:403 ../java/examples/guestfs-java.pod:62 ../ocaml/examples/guestfs-ocaml.pod:95 ../perl/examples/guestfs-perl.pod:56 ../python/examples/guestfs-python.pod:58 ../rescue/virt-rescue.pod:300 ../resize/virt-resize.pod:694 ../ruby/examples/guestfs-ruby.pod:52 ../sparsify/virt-sparsify.pod:268 ../src/guestfs.pod:3337 ../test-tool/libguestfs-test-tool.pod:110 ../tools/virt-list-filesystems.pl:212 ../tools/virt-list-partitions.pl:281 ../tools/virt-make-fs.pl:568 ../tools/virt-tar.pl:315 ../tools/virt-win-reg.pl:776
752 #: ../align/virt-alignment-scan.pod:352 ../clone/virt-sysprep.pod:507 ../sparsify/virt-sparsify.pod:270
753 msgid "Copyright (C) 2011 Red Hat Inc."
757 #: ../align/virt-alignment-scan.pod:354 ../cat/virt-cat.pod:220 ../cat/virt-filesystems.pod:396 ../cat/virt-ls.pod:515 ../clone/virt-sysprep.pod:509 ../df/virt-df.pod:243 ../edit/virt-edit.pod:376 ../fish/guestfish.pod:1305 ../fish/virt-copy-in.pod:69 ../fish/virt-copy-out.pod:58 ../fish/virt-tar-in.pod:67 ../fish/virt-tar-out.pod:60 ../fuse/guestmount.pod:337 ../inspector/virt-inspector.pod:407 ../rescue/virt-rescue.pod:304 ../resize/virt-resize.pod:698 ../sparsify/virt-sparsify.pod:272 ../test-tool/libguestfs-test-tool.pod:115 ../tools/virt-list-filesystems.pl:216 ../tools/virt-list-partitions.pl:285 ../tools/virt-make-fs.pl:572 ../tools/virt-tar.pl:319 ../tools/virt-win-reg.pl:780
759 "This program is free software; you can redistribute it and/or modify it "
760 "under the terms of the GNU General Public License as published by the Free "
761 "Software Foundation; either version 2 of the License, or (at your option) "
766 #: ../align/virt-alignment-scan.pod:359 ../cat/virt-cat.pod:225 ../cat/virt-filesystems.pod:401 ../cat/virt-ls.pod:520 ../clone/virt-sysprep.pod:514 ../df/virt-df.pod:248 ../edit/virt-edit.pod:381 ../fish/guestfish.pod:1310 ../fish/virt-copy-in.pod:74 ../fish/virt-copy-out.pod:63 ../fish/virt-tar-in.pod:72 ../fish/virt-tar-out.pod:65 ../fuse/guestmount.pod:342 ../inspector/virt-inspector.pod:412 ../rescue/virt-rescue.pod:309 ../resize/virt-resize.pod:703 ../sparsify/virt-sparsify.pod:277 ../test-tool/libguestfs-test-tool.pod:120 ../tools/virt-list-filesystems.pl:221 ../tools/virt-list-partitions.pl:290 ../tools/virt-make-fs.pl:577 ../tools/virt-tar.pl:324 ../tools/virt-win-reg.pl:785
768 "This program is distributed in the hope that it will be useful, but WITHOUT "
769 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
770 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for "
775 #: ../align/virt-alignment-scan.pod:364 ../cat/virt-cat.pod:230 ../cat/virt-filesystems.pod:406 ../cat/virt-ls.pod:525 ../clone/virt-sysprep.pod:519 ../df/virt-df.pod:253 ../edit/virt-edit.pod:386 ../fish/guestfish.pod:1315 ../fish/virt-copy-in.pod:79 ../fish/virt-copy-out.pod:68 ../fish/virt-tar-in.pod:77 ../fish/virt-tar-out.pod:70 ../fuse/guestmount.pod:347 ../inspector/virt-inspector.pod:417 ../rescue/virt-rescue.pod:314 ../resize/virt-resize.pod:708 ../sparsify/virt-sparsify.pod:282 ../test-tool/libguestfs-test-tool.pod:125 ../tools/virt-list-filesystems.pl:226 ../tools/virt-list-partitions.pl:295 ../tools/virt-make-fs.pl:582 ../tools/virt-tar.pl:329 ../tools/virt-win-reg.pl:790
777 "You should have received a copy of the GNU General Public License along with "
778 "this program; if not, write to the Free Software Foundation, Inc., 675 Mass "
779 "Ave, Cambridge, MA 02139, USA."
783 #: ../cat/virt-cat.pod:5
784 msgid "virt-cat - Display files in a virtual machine"
788 #: ../cat/virt-cat.pod:9
791 " virt-cat [--options] -d domname file [file ...]\n"
796 #: ../cat/virt-cat.pod:11
799 " virt-cat [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
804 #: ../cat/virt-cat.pod:13 ../edit/virt-edit.pod:15 ../inspector/virt-inspector.pod:13
809 #: ../cat/virt-cat.pod:15
812 " virt-cat domname file\n"
817 #: ../cat/virt-cat.pod:17
820 " virt-cat disk.img file\n"
825 #: ../cat/virt-cat.pod:21
827 "C<virt-cat> is a command line tool to display the contents of C<file> where "
828 "C<file> exists in the named virtual machine (or disk image)."
832 #: ../cat/virt-cat.pod:24
834 "Multiple filenames can be given, in which case they are concatenated "
835 "together. Each filename must be a full path, starting at the root directory "
836 "(starting with '/')."
840 #: ../cat/virt-cat.pod:28
842 "C<virt-cat> can be used to quickly view a file. To edit a file, use "
843 "C<virt-edit>. For more complex cases you should look at the L<guestfish(1)> "
844 "tool (see L</USING GUESTFISH> below)."
848 #: ../cat/virt-cat.pod:32 ../cat/virt-ls.pod:35 ../df/virt-df.pod:43 ../edit/virt-edit.pod:44 ../fish/guestfish.pod:41 ../fish/guestfish.pod:1051 ../fish/virt-copy-in.pod:29 ../fish/virt-copy-out.pod:21 ../fish/virt-tar-in.pod:30 ../fish/virt-tar-out.pod:24 ../fuse/guestmount.pod:39 ../resize/virt-resize.pod:27 ../sparsify/virt-sparsify.pod:75 ../tools/virt-tar.pl:50
853 #: ../cat/virt-cat.pod:34
854 msgid "Display C</etc/fstab> file from inside the libvirt VM called C<mydomain>:"
858 #: ../cat/virt-cat.pod:37
861 " virt-cat -d mydomain /etc/fstab\n"
866 #: ../cat/virt-cat.pod:39
867 msgid "List syslog messages from a VM disk image file:"
871 #: ../cat/virt-cat.pod:41
874 " virt-cat -a disk.img /var/log/messages | tail\n"
879 #: ../cat/virt-cat.pod:43
880 msgid "Find out what DHCP IP address a VM acquired:"
884 #: ../cat/virt-cat.pod:45
887 " virt-cat -d mydomain /var/log/messages | \\\n"
888 " grep 'dhclient: bound to' | tail\n"
893 #: ../cat/virt-cat.pod:48
894 msgid "Find out what packages were recently installed:"
898 #: ../cat/virt-cat.pod:50
901 " virt-cat -d mydomain /var/log/yum.log | tail\n"
906 #: ../cat/virt-cat.pod:52
907 msgid "Find out who is logged on inside a virtual machine:"
911 #: ../cat/virt-cat.pod:54
914 " virt-cat -d mydomain /var/run/utmp > /tmp/utmp\n"
920 #: ../cat/virt-cat.pod:57
921 msgid "or who was logged on:"
925 #: ../cat/virt-cat.pod:59
928 " virt-cat -d mydomain /var/log/wtmp > /tmp/wtmp\n"
929 " last -f /tmp/wtmp\n"
934 #: ../cat/virt-cat.pod:74 ../cat/virt-filesystems.pod:103 ../cat/virt-ls.pod:273 ../df/virt-df.pod:71 ../edit/virt-edit.pod:74 ../inspector/virt-inspector.pod:67 ../rescue/virt-rescue.pod:96
936 "Add I<file> which should be a disk image from a virtual machine. If the "
937 "virtual machine has multiple block devices, you must supply all of them with "
938 "separate I<-a> options."
942 #: ../cat/virt-cat.pod:98 ../cat/virt-filesystems.pod:148 ../cat/virt-ls.pod:314 ../edit/virt-edit.pod:112 ../fish/guestfish.pod:217 ../fuse/guestmount.pod:135 ../inspector/virt-inspector.pod:92
943 msgid "B<--echo-keys>"
947 #: ../cat/virt-cat.pod:100
949 "When prompting for keys and passphrases, virt-cat normally turns echoing off "
950 "so you cannot see what you are typing. If you are not worried about Tempest "
951 "attacks and there is no one else in the room you can specify this flag to "
952 "see what you are typing."
956 #: ../cat/virt-cat.pod:116
959 " virt-cat --format=raw -a disk.img file\n"
964 #: ../cat/virt-cat.pod:120
967 " virt-cat --format=raw -a disk.img --format -a another.img file\n"
972 #: ../cat/virt-cat.pod:129 ../cat/virt-filesystems.pod:200 ../cat/virt-ls.pod:361 ../edit/virt-edit.pod:156 ../fish/guestfish.pod:289 ../fuse/guestmount.pod:172 ../inspector/virt-inspector.pod:114
973 msgid "B<--keys-from-stdin>"
977 #: ../cat/virt-cat.pod:131 ../cat/virt-filesystems.pod:202 ../cat/virt-ls.pod:363 ../edit/virt-edit.pod:158 ../fish/guestfish.pod:291 ../fuse/guestmount.pod:174 ../inspector/virt-inspector.pod:116
979 "Read key or passphrase parameters from stdin. The default is to try to read "
980 "passphrases from the user by opening C</dev/tty>."
984 #: ../cat/virt-cat.pod:152 ../cat/virt-ls.pod:443 ../edit/virt-edit.pod:179 ../inspector/virt-inspector.pod:137 ../rescue/virt-rescue.pod:209
985 msgid "OLD-STYLE COMMAND LINE ARGUMENTS"
989 #: ../cat/virt-cat.pod:154
990 msgid "Previous versions of virt-cat allowed you to write either:"
994 #: ../cat/virt-cat.pod:156
997 " virt-cat disk.img [disk.img ...] file\n"
1002 #: ../cat/virt-cat.pod:158 ../cat/virt-ls.pod:449 ../edit/virt-edit.pod:185 ../inspector/virt-inspector.pod:143 ../rescue/virt-rescue.pod:215
1007 #: ../cat/virt-cat.pod:160
1010 " virt-cat guestname file\n"
1015 #: ../cat/virt-cat.pod:162 ../cat/virt-ls.pod:453 ../edit/virt-edit.pod:189 ../inspector/virt-inspector.pod:147 ../rescue/virt-rescue.pod:219
1017 "whereas in this version you should use I<-a> or I<-d> respectively to avoid "
1018 "the confusing case where a disk image might have the same name as a guest."
1022 #: ../cat/virt-cat.pod:166 ../cat/virt-ls.pod:457 ../edit/virt-edit.pod:193 ../inspector/virt-inspector.pod:151 ../rescue/virt-rescue.pod:223
1023 msgid "For compatibility the old style is still supported."
1027 #: ../cat/virt-cat.pod:168 ../edit/virt-edit.pod:297
1028 msgid "USING GUESTFISH"
1032 #: ../cat/virt-cat.pod:170
1034 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
1035 "C<virt-cat> doesn't work."
1039 #: ../cat/virt-cat.pod:173
1040 msgid "Using C<virt-cat> is approximately equivalent to doing:"
1044 #: ../cat/virt-cat.pod:175
1047 " guestfish --ro -i -d domname download file -\n"
1052 #: ../cat/virt-cat.pod:177
1054 "where C<domname> is the name of the libvirt guest, and C<file> is the full "
1055 "path to the file. Note the final C<-> (meaning \"output to stdout\")."
1059 #: ../cat/virt-cat.pod:181
1061 "The command above uses libguestfs's guest inspection feature and so does not "
1062 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
1063 "disk images that don't contain guests. To display a file from a disk image "
1068 #: ../cat/virt-cat.pod:186
1071 " guestfish --ro -a disk.img -m /dev/sda1 download file -\n"
1076 #: ../cat/virt-cat.pod:188
1078 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
1079 "the disk image, and C<file> is the full path to the file."
1083 #: ../cat/virt-cat.pod:200 ../cat/virt-filesystems.pod:374 ../cat/virt-ls.pod:492 ../df/virt-df.pod:224 ../edit/virt-edit.pod:351 ../fuse/guestmount.pod:314 ../inspector/virt-inspector.pod:377 ../resize/virt-resize.pod:664 ../sparsify/virt-sparsify.pod:229
1084 msgid "This program returns 0 if successful, or non-zero if there was an error."
1088 #: ../cat/virt-cat.pod:205
1090 "L<guestfs(3)>, L<guestfish(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
1091 "L<virt-tar-out(1)>, L<http://libguestfs.org/>."
1095 #: ../cat/virt-cat.pod:218 ../inspector/virt-inspector.pod:405 ../resize/virt-resize.pod:696
1096 msgid "Copyright (C) 2010-2011 Red Hat Inc."
1100 #: ../cat/virt-filesystems.pod:5
1102 "virt-filesystems - List filesystems, partitions, block devices, LVM in a "
1103 "virtual machine or disk image"
1107 #: ../cat/virt-filesystems.pod:9
1110 " virt-filesystems [--options] -d domname\n"
1115 #: ../cat/virt-filesystems.pod:11
1118 " virt-filesystems [--options] -a disk.img [-a disk.img ...]\n"
1123 #: ../cat/virt-filesystems.pod:15
1125 "This tool allows you to discover filesystems, partitions, logical volumes, "
1126 "and their sizes in a disk image or virtual machine. It is a replacement for "
1127 "L<virt-list-filesystems(1)> and L<virt-list-partitions(1)>."
1131 #: ../cat/virt-filesystems.pod:20
1133 "One use for this tool is from shell scripts to iterate over all filesystems "
1134 "from a disk image:"
1138 #: ../cat/virt-filesystems.pod:23
1141 " for fs in $(virt-filesystems -a disk.img); do\n"
1148 #: ../cat/virt-filesystems.pod:27
1150 "Another use is to list partitions before using another tool to modify those "
1151 "partitions (such as L<virt-resize(1)>). If you are curious about what an "
1152 "unknown disk image contains, use this tool along with L<virt-inspector(1)>."
1156 #: ../cat/virt-filesystems.pod:32
1158 "Various command line options control what this program displays. You need "
1159 "to give either I<-a> or I<-d> options to specify the disk image or libvirt "
1160 "guest respectively. If you just specify that then the program shows "
1161 "filesystems found, one per line, like this:"
1165 #: ../cat/virt-filesystems.pod:37
1168 " $ virt-filesystems -a disk.img\n"
1170 " /dev/vg_guest/lv_root\n"
1175 #: ../cat/virt-filesystems.pod:41
1176 msgid "If you add I<-l> or I<--long> then the output includes extra information:"
1180 #: ../cat/virt-filesystems.pod:44
1183 " $ virt-filesystems -a disk.img -l\n"
1184 " Name Type VFS Label Size\n"
1185 " /dev/sda1 filesystem ext4 boot 524288000\n"
1186 " /dev/vg_guest/lv_root filesystem ext4 root 10212081664\n"
1191 #: ../cat/virt-filesystems.pod:49
1193 "If you add I<--extra> then non-mountable (swap, unknown) filesystems are "
1198 #: ../cat/virt-filesystems.pod:52
1201 " $ virt-filesystems -a disk.img --extra\n"
1203 " /dev/vg_guest/lv_root\n"
1204 " /dev/vg_guest/lv_swap\n"
1205 " /dev/vg_guest/lv_data\n"
1210 #: ../cat/virt-filesystems.pod:58
1211 msgid "If you add I<--partitions> then partitions are shown instead of filesystems:"
1215 #: ../cat/virt-filesystems.pod:60
1218 " $ virt-filesystems -a disk.img --partitions\n"
1225 #: ../cat/virt-filesystems.pod:64
1227 "Similarly you can use I<--logical-volumes>, I<--volume-groups>, "
1228 "I<--physical-volumes>, I<--block-devices> to list those items."
1232 #: ../cat/virt-filesystems.pod:67
1234 "You can use these options in combination as well (if you want a combination "
1235 "including filesystems, you have to add I<--filesystems>). Notice that some "
1236 "items fall into several categories (eg. C</dev/sda1> might be both a "
1237 "partition and a filesystem). These items are listed several times. To get "
1238 "a list which includes absolutely everything that virt-filesystems knows "
1239 "about, use the I<--all> option."
1243 #: ../cat/virt-filesystems.pod:74
1245 "UUIDs (because they are quite long) are not shown by default. Add the "
1246 "I<--uuid> option to display device and filesystem UUIDs in the long output."
1250 #: ../cat/virt-filesystems.pod:78
1252 "I<--all --long --uuid> is a useful combination to display all possible "
1253 "information about everything."
1257 #: ../cat/virt-filesystems.pod:81
1260 " $ virt-filesystems -a win.img --all --long --uuid -h\n"
1261 " Name Type VFS Label Size Parent UUID\n"
1262 " /dev/sda1 filesystem ntfs System Reserved 100M - F81C92571C92112C\n"
1263 " /dev/sda2 filesystem ntfs - 20G - F2E8996AE8992E3B\n"
1264 " /dev/sda1 partition - - 100M /dev/sda -\n"
1265 " /dev/sda2 partition - - 20G /dev/sda -\n"
1266 " /dev/sda device - - 20G - -\n"
1271 #: ../cat/virt-filesystems.pod:89
1272 msgid "For machine-readable output, use I<--csv> to get Comma-Separated Values."
1276 #: ../cat/virt-filesystems.pod:110 ../tools/virt-list-filesystems.pl:121
1281 #: ../cat/virt-filesystems.pod:112
1283 "Display everything. This is currently the same as specifying these options: "
1284 "I<--filesystems>, I<--extra>, I<--partitions>, I<--block-devices>, "
1285 "I<--logical-volumes>, I<--volume-groups>, I<--physical-volumes>. (More may "
1286 "be added to this list in future)."
1290 #: ../cat/virt-filesystems.pod:117
1291 msgid "See also I<--long>."
1295 #: ../cat/virt-filesystems.pod:119
1296 msgid "B<--blkdevs>"
1300 #: ../cat/virt-filesystems.pod:121
1301 msgid "B<--block-devices>"
1305 #: ../cat/virt-filesystems.pod:123
1306 msgid "Display block devices."
1310 #: ../cat/virt-filesystems.pod:135 ../cat/virt-ls.pod:301 ../df/virt-df.pod:88
1315 #: ../cat/virt-filesystems.pod:137 ../cat/virt-ls.pod:303 ../df/virt-df.pod:90
1317 "Write out the results in CSV format (comma-separated values). This format "
1318 "can be imported easily into databases and spreadsheets, but read L</NOTE "
1319 "ABOUT CSV FORMAT> below."
1323 #: ../cat/virt-filesystems.pod:150
1325 "When prompting for keys and passphrases, virt-filesystems normally turns "
1326 "echoing off so you cannot see what you are typing. If you are not worried "
1327 "about Tempest attacks and there is no one else in the room you can specify "
1328 "this flag to see what you are typing."
1332 #: ../cat/virt-filesystems.pod:155
1337 #: ../cat/virt-filesystems.pod:157
1339 "This causes filesystems that are not ordinary, mountable filesystems to be "
1340 "displayed. This category includes swapspace, and filesystems that are empty "
1341 "or contain unknown data."
1345 #: ../cat/virt-filesystems.pod:161
1346 msgid "This option implies I<--filesystems>."
1350 #: ../cat/virt-filesystems.pod:163
1351 msgid "B<--filesystems>"
1355 #: ../cat/virt-filesystems.pod:165
1357 "Display mountable filesystems. If no display option was selected then this "
1358 "option is implied."
1362 #: ../cat/virt-filesystems.pod:168
1363 msgid "With I<--extra>, non-mountable filesystems are shown too."
1367 #: ../cat/virt-filesystems.pod:181
1370 " virt-filesystems --format=raw -a disk.img\n"
1375 #: ../cat/virt-filesystems.pod:185
1378 " virt-filesystems --format=raw -a disk.img --format -a another.img\n"
1383 #: ../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
1388 #: ../cat/virt-filesystems.pod:196 ../cat/virt-ls.pod:354 ../df/virt-df.pod:127 ../tools/virt-list-partitions.pl:111
1389 msgid "B<--human-readable>"
1393 #: ../cat/virt-filesystems.pod:198
1394 msgid "In I<--long> mode, display sizes in human-readable format."
1398 #: ../cat/virt-filesystems.pod:205 ../cat/virt-ls.pod:366 ../tools/virt-list-filesystems.pl:108 ../tools/virt-list-partitions.pl:119
1403 #: ../cat/virt-filesystems.pod:207 ../cat/virt-ls.pod:368 ../tools/virt-list-filesystems.pl:110 ../tools/virt-list-partitions.pl:121
1408 #: ../cat/virt-filesystems.pod:209
1409 msgid "Display extra columns of data (\"long format\")."
1413 #: ../cat/virt-filesystems.pod:211
1414 msgid "A title row is added unless you also specify I<--no-title>."
1418 #: ../cat/virt-filesystems.pod:213
1420 "The extra columns displayed depend on what output you select, and the "
1421 "ordering of columns may change in future versions. Use the title row, "
1422 "I<--csv> output and/or L<csvtool(1)> to match columns to data in external "
1427 #: ../cat/virt-filesystems.pod:218
1429 "Use I<-h> if you want sizes to be displayed in human-readable format. The "
1430 "default is to show raw numbers of I<bytes>."
1434 #: ../cat/virt-filesystems.pod:221
1435 msgid "Use I<--uuid> to display UUIDs too."
1439 #: ../cat/virt-filesystems.pod:223
1444 #: ../cat/virt-filesystems.pod:225
1445 msgid "B<--logvols>"
1449 #: ../cat/virt-filesystems.pod:227
1450 msgid "B<--logical-volumes>"
1454 #: ../cat/virt-filesystems.pod:229
1456 "Display LVM logical volumes. In this mode, these are displayed irrespective "
1457 "of whether the LVs contain filesystems."
1461 #: ../cat/virt-filesystems.pod:232
1462 msgid "B<--no-title>"
1466 #: ../cat/virt-filesystems.pod:234
1467 msgid "In I<--long> mode, don't add a title row."
1471 #: ../cat/virt-filesystems.pod:236
1473 "Note that the order of the columns is not fixed, and may change in future "
1474 "versions of virt-filesystems, so using this option may give you unexpected "
1479 #: ../cat/virt-filesystems.pod:240
1484 #: ../cat/virt-filesystems.pod:242
1485 msgid "B<--partitions>"
1489 #: ../cat/virt-filesystems.pod:244
1491 "Display partitions. In this mode, these are displayed irrespective of "
1492 "whether the partitions contain filesystems."
1496 #: ../cat/virt-filesystems.pod:247
1501 #: ../cat/virt-filesystems.pod:249
1502 msgid "B<--physvols>"
1506 #: ../cat/virt-filesystems.pod:251
1507 msgid "B<--physical-volumes>"
1511 #: ../cat/virt-filesystems.pod:253
1512 msgid "Display LVM physical volumes."
1516 #: ../cat/virt-filesystems.pod:255 ../df/virt-df.pod:163
1521 #: ../cat/virt-filesystems.pod:257
1526 #: ../cat/virt-filesystems.pod:259
1527 msgid "In I<--long> mode, display UUIDs as well."
1531 #: ../cat/virt-filesystems.pod:273
1536 #: ../cat/virt-filesystems.pod:275
1537 msgid "B<--volgroups>"
1541 #: ../cat/virt-filesystems.pod:277
1542 msgid "B<--volume-groups>"
1546 #: ../cat/virt-filesystems.pod:279
1547 msgid "Display LVM volume groups."
1551 #: ../cat/virt-filesystems.pod:287
1556 #: ../cat/virt-filesystems.pod:289
1558 "Note that columns in the output are subject to reordering and change in "
1559 "future versions of this tool."
1563 #: ../cat/virt-filesystems.pod:294
1568 #: ../cat/virt-filesystems.pod:296
1569 msgid "The filesystem, partition, block device or LVM name."
1573 #: ../cat/virt-filesystems.pod:298
1575 "For device and partition names these are displayed as canonical libguestfs "
1576 "names, so that for example C</dev/sda2> is the second partition on the first "
1581 #: ../cat/virt-filesystems.pod:302
1583 "If the I<--long> option is B<not> specified, then only the name column is "
1584 "shown in the output."
1588 #: ../cat/virt-filesystems.pod:305
1593 #: ../cat/virt-filesystems.pod:307
1594 msgid "The object type, for example C<filesystem>, C<lv>, C<device> etc."
1598 #: ../cat/virt-filesystems.pod:309
1603 #: ../cat/virt-filesystems.pod:311
1605 "If there is a filesystem, then this column displays the filesystem type if "
1606 "one could be detected, eg. C<ext4>."
1610 #: ../cat/virt-filesystems.pod:314
1615 #: ../cat/virt-filesystems.pod:316
1617 "If the object has a label (used for identifying and mounting filesystems) "
1618 "then this column contains the label."
1622 #: ../cat/virt-filesystems.pod:319
1627 #: ../cat/virt-filesystems.pod:321
1629 "The size of the object in bytes. If the I<--human> option is used then the "
1630 "size is displayed in a human-readable form."
1634 #: ../cat/virt-filesystems.pod:324
1639 #: ../cat/virt-filesystems.pod:326
1641 "The parent column records the parent relationship between objects. For "
1642 "example, if the object is a partition, then this column contains the name of "
1643 "the containing device. If the object is a logical volume, then this column "
1644 "is the name of the volume group."
1648 #: ../cat/virt-filesystems.pod:331
1653 #: ../cat/virt-filesystems.pod:333
1655 "If the object has a UUID (used for identifying and mounting filesystems and "
1656 "block devices) then this column contains the UUID as a string."
1660 #: ../cat/virt-filesystems.pod:337
1661 msgid "The UUID is only displayed if the I<--uuid> option is given."
1665 #: ../cat/virt-filesystems.pod:341 ../cat/virt-ls.pod:459 ../df/virt-df.pod:191
1666 msgid "NOTE ABOUT CSV FORMAT"
1670 #: ../cat/virt-filesystems.pod:343 ../cat/virt-ls.pod:461 ../df/virt-df.pod:193
1672 "Comma-separated values (CSV) is a deceptive format. It I<seems> like it "
1673 "should be easy to parse, but it is definitely not easy to parse."
1677 #: ../cat/virt-filesystems.pod:346 ../cat/virt-ls.pod:464 ../df/virt-df.pod:196
1679 "Myth: Just split fields at commas. Reality: This does I<not> work "
1680 "reliably. This example has two columns:"
1684 #: ../cat/virt-filesystems.pod:349 ../cat/virt-ls.pod:467 ../df/virt-df.pod:199
1687 " \"foo,bar\",baz\n"
1692 #: ../cat/virt-filesystems.pod:351 ../cat/virt-ls.pod:469 ../df/virt-df.pod:201
1694 "Myth: Read the file one line at a time. Reality: This does I<not> work "
1695 "reliably. This example has one row:"
1699 #: ../cat/virt-filesystems.pod:354 ../cat/virt-ls.pod:472 ../df/virt-df.pod:204
1708 #: ../cat/virt-filesystems.pod:357 ../cat/virt-ls.pod:475 ../df/virt-df.pod:207
1710 "For shell scripts, use C<csvtool> (L<http://merjis.com/developers/csv> also "
1711 "packaged in major Linux distributions)."
1715 #: ../cat/virt-filesystems.pod:360 ../cat/virt-ls.pod:478 ../df/virt-df.pod:210
1717 "For other languages, use a CSV processing library (eg. C<Text::CSV> for Perl "
1718 "or Python's built-in csv library)."
1722 #: ../cat/virt-filesystems.pod:363 ../cat/virt-ls.pod:481 ../df/virt-df.pod:213
1723 msgid "Most spreadsheets and databases can import CSV directly."
1727 #: ../cat/virt-filesystems.pod:379
1729 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-df(1)>, "
1730 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<csvtool(1)>, "
1731 "L<http://libguestfs.org/>."
1735 #: ../cat/virt-filesystems.pod:394 ../tools/virt-make-fs.pl:570 ../tools/virt-win-reg.pl:778
1736 msgid "Copyright (C) 2010 Red Hat Inc."
1740 #: ../cat/virt-ls.pod:5
1741 msgid "virt-ls - List files in a virtual machine"
1745 #: ../cat/virt-ls.pod:9
1748 " virt-ls [--options] -d domname directory [directory ...]\n"
1753 #: ../cat/virt-ls.pod:11
1756 " virt-ls [--options] -a disk.img [-a disk.img ...] directory [directory "
1762 #: ../cat/virt-ls.pod:13 ../df/virt-df.pod:15 ../rescue/virt-rescue.pod:13
1767 #: ../cat/virt-ls.pod:15
1770 " virt-ls [--options] domname directory\n"
1775 #: ../cat/virt-ls.pod:17
1778 " virt-ls [--options] disk.img [disk.img ...] directory\n"
1783 #: ../cat/virt-ls.pod:21
1785 "C<virt-ls> lists filenames, file sizes, checksums, extended attributes and "
1786 "more from a virtual machine or disk image."
1790 #: ../cat/virt-ls.pod:24
1792 "Multiple directory names can be given, in which case the output from each is "
1797 #: ../cat/virt-ls.pod:27
1799 "To list directories from a libvirt guest use the I<-d> option to specify the "
1800 "name of the guest. For a disk image, use the I<-a> option."
1804 #: ../cat/virt-ls.pod:31
1806 "C<virt-ls> can do many simple file listings. For more complicated cases you "
1807 "may need to use L<guestfish(1)>, or write a program directly to the "
1808 "L<guestfs(3)> API."
1812 #: ../cat/virt-ls.pod:37
1813 msgid "Get a list of all files and directories in a virtual machine:"
1817 #: ../cat/virt-ls.pod:39
1820 " virt-ls -R -d guest /\n"
1825 #: ../cat/virt-ls.pod:41
1826 msgid "List all setuid or setgid programs in a Linux virtual machine:"
1830 #: ../cat/virt-ls.pod:43
1833 " virt-ls -lR -d guest / | grep '^- [42]'\n"
1838 #: ../cat/virt-ls.pod:45
1839 msgid "List all public-writable directories in a Linux virtual machine:"
1843 #: ../cat/virt-ls.pod:47
1846 " virt-ls -lR -d guest / | grep '^d ...7'\n"
1851 #: ../cat/virt-ls.pod:49
1852 msgid "List all Unix domain sockets in a Linux virtual machine:"
1856 #: ../cat/virt-ls.pod:51
1859 " virt-ls -lR -d guest / | grep '^s'\n"
1864 #: ../cat/virt-ls.pod:53
1865 msgid "List all regular files with filenames ending in '.png':"
1869 #: ../cat/virt-ls.pod:55
1872 " virt-ls -lR -d guest / | grep -i '^-.*\\.png$'\n"
1877 #: ../cat/virt-ls.pod:57
1878 msgid "To display files larger than 10MB in home directories:"
1882 #: ../cat/virt-ls.pod:59
1885 " virt-ls -lR -d guest /home | awk '$3 > 10*1024*1024'\n"
1890 #: ../cat/virt-ls.pod:61
1891 msgid "Find everything modified in the last 7 days:"
1895 #: ../cat/virt-ls.pod:63
1898 " virt-ls -lR -d guest --time-days / | awk '$6 <= 7'\n"
1903 #: ../cat/virt-ls.pod:65
1904 msgid "Find regular files modified in the last 24 hours:"
1908 #: ../cat/virt-ls.pod:67
1911 " virt-ls -lR -d guest --time-days / | grep '^-' | awk '$6 < 1'\n"
1916 #: ../cat/virt-ls.pod:69
1917 msgid "DIFFERENCES IN SNAPSHOTS AND BACKING FILES"
1921 #: ../cat/virt-ls.pod:71
1923 "Find the differences between files in a guest and an earlier snapshot of the "
1928 #: ../cat/virt-ls.pod:74
1931 " virt-ls -lR -a snapshot.img / --uids --time-t > old\n"
1932 " virt-ls -lR -a current.img / --uids --time-t > new\n"
1933 " diff -u old new | less\n"
1938 #: ../cat/virt-ls.pod:78
1940 "The commands above won't find files where the content has changed but the "
1941 "metadata (eg. file size and modification date) is the same. To do that, you "
1942 "need to add the I<--checksum> parameter to both C<virt-ls> commands. "
1943 "I<--checksum> can be quite slow since it has to read and compute a checksum "
1944 "of every regular file in the virtual machine."
1948 #: ../cat/virt-ls.pod:84
1949 msgid "OUTPUT MODES"
1953 #: ../cat/virt-ls.pod:86
1955 "C<virt-ls> has four output modes, controlled by different combinations of "
1956 "the I<-l> and I<-R> options."
1960 #: ../cat/virt-ls.pod:89
1961 msgid "SIMPLE LISTING"
1965 #: ../cat/virt-ls.pod:91
1966 msgid "A simple listing is like the ordinary L<ls(1)> command:"
1970 #: ../cat/virt-ls.pod:93
1973 " $ virt-ls -d guest /\n"
1981 #: ../cat/virt-ls.pod:98
1982 msgid "LONG LISTING"
1986 #: ../cat/virt-ls.pod:100
1988 "With the I<-l> (I<--long>) option, the output is like the C<ls -l> command "
1989 "(more specifically, like the C<guestfs_ll> function)."
1993 #: ../cat/virt-ls.pod:103
1996 " $ virt-ls -l -d guest /\n"
1998 " dr-xr-xr-x. 2 root root 4096 2009-08-25 19:06 bin\n"
1999 " dr-xr-xr-x. 5 root root 3072 2009-08-25 19:06 boot\n"
2005 #: ../cat/virt-ls.pod:109
2007 "Note that while this is useful for displaying a directory, do not try "
2008 "parsing this output in another program. Use L</RECURSIVE LONG LISTING> "
2013 #: ../cat/virt-ls.pod:113
2014 msgid "RECURSIVE LISTING"
2018 #: ../cat/virt-ls.pod:115
2020 "With the I<-R> (I<--recursive>) option, C<virt-ls> lists the names of files "
2021 "and directories recursively:"
2025 #: ../cat/virt-ls.pod:118
2028 " $ virt-ls -R -d guest /tmp\n"
2036 #: ../cat/virt-ls.pod:123
2038 "To generate this output, C<virt-ls> runs the C<guestfs_find0> function and "
2039 "converts C<\\0> characters to C<\\n>."
2043 #: ../cat/virt-ls.pod:126
2044 msgid "RECURSIVE LONG LISTING"
2048 #: ../cat/virt-ls.pod:128
2050 "Using I<-lR> options together changes the output to display directories "
2051 "recursively, with file stats, and optionally other features such as "
2052 "checksums and extended attributes."
2056 #: ../cat/virt-ls.pod:132
2058 "Most of the interesting features of C<virt-ls> are only available when using "
2063 #: ../cat/virt-ls.pod:135
2065 "The fields are normally space-separated. Filenames are B<not> quoted, so "
2066 "you cannot use the output in another program (because filenames can contain "
2067 "spaces and other unsafe characters). If the guest was untrusted and someone "
2068 "knew you were using C<virt-ls> to analyze the guest, they could play tricks "
2069 "on you by creating filenames with embedded newline characters. To B<safely> "
2070 "parse the output in another program, use the I<--csv> (Comma-Separated "
2075 #: ../cat/virt-ls.pod:143
2077 "Note that this output format is completely unrelated to the C<ls -lR> "
2082 #: ../cat/virt-ls.pod:146
2085 " $ virt-ls -lR -d guest /bin\n"
2086 " d 0555 4096 /bin\n"
2087 " - 0755 123 /bin/alsaunmute\n"
2088 " - 0755 28328 /bin/arch\n"
2089 " l 0777 4 /bin/awk -> gawk\n"
2090 " - 0755 27216 /bin/basename\n"
2091 " - 0755 943360 /bin/bash\n"
2097 #: ../cat/virt-ls.pod:155
2098 msgid "These basic fields are always shown:"
2102 #: ../cat/virt-ls.pod:159
2107 #: ../cat/virt-ls.pod:161
2109 "The file type, one of: C<-> (regular file), C<d> (directory), C<c> "
2110 "(character device), C<b> (block device), C<p> (named pipe), C<l> (symbolic "
2111 "link), C<s> (socket) or C<u> (unknown)."
2115 #: ../cat/virt-ls.pod:171
2120 #: ../cat/virt-ls.pod:173
2121 msgid "The Unix permissions, displayed as a 4 digit octal number."
2125 #: ../cat/virt-ls.pod:175
2130 #: ../cat/virt-ls.pod:177
2132 "The size of the file. This is shown in bytes unless I<-h> or "
2133 "I<--human-readable> option is given, in which case this is shown as a "
2134 "human-readable number."
2138 #: ../cat/virt-ls.pod:181 ../fish/guestfish-actions.pod:4263
2143 #: ../cat/virt-ls.pod:183
2144 msgid "The full path of the file or directory."
2148 #: ../cat/virt-ls.pod:185
2153 #: ../cat/virt-ls.pod:187
2154 msgid "For symbolic links only, the link target."
2158 #: ../cat/virt-ls.pod:191
2160 "In I<-lR> mode, additional command line options enable the display of more "
2165 #: ../cat/virt-ls.pod:194
2167 "With the I<--uids> flag, these additional fields are displayed before the "
2172 #: ../cat/virt-ls.pod:199
2177 #: ../cat/virt-ls.pod:201
2182 #: ../cat/virt-ls.pod:203
2184 "The UID and GID of the owner of the file (displayed numerically). Note "
2185 "these only make sense in the context of a Unix-like guest."
2189 #: ../cat/virt-ls.pod:208
2190 msgid "With the I<--times> flag, these additional fields are displayed:"
2194 #: ../cat/virt-ls.pod:212
2199 #: ../cat/virt-ls.pod:214
2200 msgid "The time of last access."
2204 #: ../cat/virt-ls.pod:216
2209 #: ../cat/virt-ls.pod:218
2210 msgid "The time of last modification."
2214 #: ../cat/virt-ls.pod:220
2219 #: ../cat/virt-ls.pod:222
2220 msgid "The time of last status change."
2224 #: ../cat/virt-ls.pod:226
2226 "The time fields are displayed as string dates and times, unless one of the "
2227 "I<--time-t>, I<--time-relative> or I<--time-days> flags is given."
2231 #: ../cat/virt-ls.pod:229
2232 msgid "With the I<--extra-stats> flag, these additional fields are displayed:"
2236 #: ../cat/virt-ls.pod:233
2241 #: ../cat/virt-ls.pod:235
2243 "The device containing the file (displayed as major:minor). This may not "
2244 "match devices as known to the guest."
2248 #: ../cat/virt-ls.pod:238
2253 #: ../cat/virt-ls.pod:240
2254 msgid "The inode number."
2258 #: ../cat/virt-ls.pod:242
2263 #: ../cat/virt-ls.pod:244
2264 msgid "The number of hard links."
2268 #: ../cat/virt-ls.pod:246
2273 #: ../cat/virt-ls.pod:248
2274 msgid "For block and char special files, the device (displayed as major:minor)."
2278 #: ../cat/virt-ls.pod:251
2283 #: ../cat/virt-ls.pod:253
2284 msgid "The number of 512 byte blocks allocated to the file."
2288 #: ../cat/virt-ls.pod:257
2290 "With the I<--checksum> flag, the checksum of the file contents is shown "
2291 "(only for regular files). Computing file checksums can take a considerable "
2296 #: ../cat/virt-ls.pod:280
2297 msgid "B<--checksum>"
2301 #: ../cat/virt-ls.pod:282
2302 msgid "B<--checksum=crc|md5|sha1|sha224|sha256|sha384|sha512>"
2306 #: ../cat/virt-ls.pod:284
2308 "Display checksum over file contents for regular files. With no argument, "
2309 "this defaults to using I<md5>. Using an argument, you can select the "
2310 "checksum type to use."
2314 #: ../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
2316 "This option only has effect in I<-lR> output mode. See L</RECURSIVE LONG "
2321 #: ../cat/virt-ls.pod:316
2323 "When prompting for keys and passphrases, virt-ls normally turns echoing off "
2324 "so you cannot see what you are typing. If you are not worried about Tempest "
2325 "attacks and there is no one else in the room you can specify this flag to "
2326 "see what you are typing."
2330 #: ../cat/virt-ls.pod:321
2331 msgid "B<--extra-stats>"
2335 #: ../cat/virt-ls.pod:323
2336 msgid "Display extra stats."
2340 #: ../cat/virt-ls.pod:339
2343 " virt-ls --format=raw -a disk.img /dir\n"
2348 #: ../cat/virt-ls.pod:343
2351 " virt-ls --format=raw -a disk.img --format -a another.img /dir\n"
2356 #: ../cat/virt-ls.pod:356
2357 msgid "Display file sizes in human-readable format."
2361 #: ../cat/virt-ls.pod:370
2366 #: ../cat/virt-ls.pod:372
2367 msgid "B<--recursive>"
2371 #: ../cat/virt-ls.pod:374
2373 "Select the mode. With neither of these options, C<virt-ls> produces a "
2374 "simple, flat list of the files in the named directory. See L</SIMPLE "
2379 #: ../cat/virt-ls.pod:378
2381 "C<virt-ls -l> produces a \"long listing\", which shows more detail. See "
2386 #: ../cat/virt-ls.pod:381
2388 "C<virt-ls -R> produces a recursive list of files starting at the named "
2389 "directory. See L</RECURSIVE LISTING>."
2393 #: ../cat/virt-ls.pod:384
2395 "C<virt-ls -lR> produces a recursive long listing which can be more easily "
2396 "parsed. See L</RECURSIVE LONG LISTING>."
2400 #: ../cat/virt-ls.pod:387
2405 #: ../cat/virt-ls.pod:389
2406 msgid "Display time fields."
2410 #: ../cat/virt-ls.pod:394
2411 msgid "B<--time-days>"
2415 #: ../cat/virt-ls.pod:396
2416 msgid "Display time fields as days before now (negative if in the future)."
2420 #: ../cat/virt-ls.pod:398
2422 "Note that C<0> in output means \"up to 1 day before now\", or that the age "
2423 "of the file is between 0 and 86399 seconds."
2427 #: ../cat/virt-ls.pod:404
2428 msgid "B<--time-relative>"
2432 #: ../cat/virt-ls.pod:406
2433 msgid "Display time fields as seconds before now (negative if in the future)."
2437 #: ../cat/virt-ls.pod:411
2442 #: ../cat/virt-ls.pod:413
2443 msgid "Display time fields as seconds since the Unix epoch."
2447 #: ../cat/virt-ls.pod:418
2452 #: ../cat/virt-ls.pod:420
2453 msgid "Display UID and GID fields."
2457 #: ../cat/virt-ls.pod:445
2458 msgid "Previous versions of virt-ls allowed you to write either:"
2462 #: ../cat/virt-ls.pod:447
2465 " virt-ls disk.img [disk.img ...] /dir\n"
2470 #: ../cat/virt-ls.pod:451
2473 " virt-ls guestname /dir\n"
2478 #: ../cat/virt-ls.pod:497
2480 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, "
2481 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
2482 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
2486 #: ../cat/virt-ls.pod:513 ../df/virt-df.pod:241 ../edit/virt-edit.pod:374 ../rescue/virt-rescue.pod:302
2487 msgid "Copyright (C) 2009-2011 Red Hat Inc."
2491 #: ../clone/virt-sysprep.pod:5
2492 msgid "virt-sysprep - Reset or unconfigure a virtual machine so clones can be made"
2496 #: ../clone/virt-sysprep.pod:9
2499 " virt-sysprep [--options] -d domname\n"
2504 #: ../clone/virt-sysprep.pod:11
2507 " virt-sysprep [--options] -a disk.img [-a disk.img ...]\n"
2512 #: ../clone/virt-sysprep.pod:15
2514 "Virt-sysprep \"resets\" or \"unconfigures\" a virtual machine so that clones "
2515 "can be made from it. Steps in this process include removing SSH host keys, "
2516 "removing persistent network MAC configuration, and removing user accounts. "
2517 "Each step can be enabled or disabled as required."
2521 #: ../clone/virt-sysprep.pod:21
2523 "Virt-sysprep is a simple shell script, allowing easy inspection or "
2524 "customization by the system administrator."
2528 #: ../clone/virt-sysprep.pod:24
2530 "Virt-sysprep modifies the guest or disk image I<in place>. The guest must "
2531 "be shut down. If you want to preserve the existing contents of the guest, "
2532 "you I<must copy or clone the disk first>. See L</COPYING AND CLONING> "
2537 #: ../clone/virt-sysprep.pod:29
2539 "You do I<not> need to run virt-sysprep as root. In fact we'd generally "
2540 "recommend that you don't. The time you might want to run it as root is when "
2541 "you need root in order to access the disk image, but even in this case it "
2542 "would be better to change the permissions on the disk image to be writable "
2543 "as the non-root user running virt-sysprep."
2547 #: ../clone/virt-sysprep.pod:35
2549 "\"Sysprep\" stands for \"system preparation\" tool. The name comes from the "
2550 "Microsoft program C<sysprep.exe> which is used to unconfigure Windows "
2551 "machines in preparation for cloning them. Having said that, virt-sysprep "
2552 "does I<not> currently work on Microsoft Windows guests. We plan to support "
2553 "Windows sysprepping in a future version, and we already have code to do it."
2557 #: ../clone/virt-sysprep.pod:76
2558 msgid "B<--enable=...>"
2562 #: ../clone/virt-sysprep.pod:78
2564 "Choose which sysprep operations to perform. Give a comma-separated list of "
2565 "operations, for example:"
2569 #: ../clone/virt-sysprep.pod:81
2572 " --enable=ssh-hostkeys,udev-persistent-net\n"
2577 #: ../clone/virt-sysprep.pod:83
2578 msgid "would enable ONLY C<ssh-hostkeys> and C<udev-persistent-net> operations."
2582 #: ../clone/virt-sysprep.pod:85
2584 "If the I<--enable> option is not given, then we default to trying all "
2585 "possible sysprep operations. But some sysprep operations are skipped for "
2590 #: ../clone/virt-sysprep.pod:89
2592 "Use I<--list-operations> to list operations supported by a particular "
2593 "version of virt-sysprep."
2597 #: ../clone/virt-sysprep.pod:92
2598 msgid "See L</OPERATIONS> below for a list and an explanation of each operation."
2602 #: ../clone/virt-sysprep.pod:106
2605 " virt-sysprep --format=raw -a disk.img\n"
2610 #: ../clone/virt-sysprep.pod:110
2613 " virt-sysprep --format=raw -a disk.img --format -a another.img\n"
2618 #: ../clone/virt-sysprep.pod:119
2619 msgid "B<--hostname> newhostname"
2623 #: ../clone/virt-sysprep.pod:121
2625 "Change the hostname. See the L</hostname> operation below. If not given, "
2626 "defaults to C<localhost.localdomain>."
2630 #: ../clone/virt-sysprep.pod:124
2631 msgid "B<--list-operations>"
2635 #: ../clone/virt-sysprep.pod:126
2636 msgid "List the operations supported by the virt-sysprep program."
2640 #: ../clone/virt-sysprep.pod:128
2641 msgid "B<--selinux-relabel>"
2645 #: ../clone/virt-sysprep.pod:130
2646 msgid "B<--no-selinux-relabel>"
2650 #: ../clone/virt-sysprep.pod:132
2652 "I<--selinux-relabel> forces SELinux relabelling next time the guest boots. "
2653 "I<--no-selinux-relabel> disables relabelling."
2657 #: ../clone/virt-sysprep.pod:135
2659 "The default is to try to detect if SELinux relabelling is required. See "
2660 "L</SELINUX RELABELLING> below for more details."
2664 #: ../clone/virt-sysprep.pod:156
2669 #: ../clone/virt-sysprep.pod:158
2671 "If the I<--enable> option is I<not> given, then I<all sysprep operations are "
2672 "enabled>, although some are skipped depending on the type of guest."
2676 #: ../clone/virt-sysprep.pod:162
2678 "Operations can be individually enabled using the I<--enable> option. Use a "
2679 "comma-separated list, for example:"
2683 #: ../clone/virt-sysprep.pod:165
2686 " virt-sysprep --enable=ssh-hostkeys,udev-persistent-net [etc..]\n"
2691 #: ../clone/virt-sysprep.pod:167
2693 "To list the operations supported by the current version of virt-sysprep, use "
2694 "I<--list-operations>."
2698 #: ../clone/virt-sysprep.pod:170
2700 "Future versions of virt-sysprep may add more operations. If you are using "
2701 "virt-sysprep and want predictable behaviour, specify only the operations "
2702 "that you want to have enabled."
2706 #: ../clone/virt-sysprep.pod:174
2711 #: ../clone/virt-sysprep.pod:176
2712 msgid "Remove user at-jobs and cron-jobs."
2716 #: ../clone/virt-sysprep.pod:178
2717 msgid "dhcp-client-state"
2721 #: ../clone/virt-sysprep.pod:180
2722 msgid "Remove DHCP client leases."
2726 #: ../clone/virt-sysprep.pod:182
2727 msgid "dhcp-server-state"
2731 #: ../clone/virt-sysprep.pod:184
2732 msgid "Remove DHCP server leases."
2736 #: ../clone/virt-sysprep.pod:186
2741 #: ../clone/virt-sysprep.pod:188
2743 "Changes the hostname of the guest to the value given in the I<--hostname> "
2748 #: ../clone/virt-sysprep.pod:191
2750 "If the I<--hostname> parameter is not given, then the hostname is changed to "
2751 "C<localhost.localdomain>."
2755 #: ../clone/virt-sysprep.pod:194
2760 #: ../clone/virt-sysprep.pod:196
2761 msgid "Remove many log files."
2765 #: ../clone/virt-sysprep.pod:198
2770 #: ../clone/virt-sysprep.pod:200
2771 msgid "Remove email from the local mail spool directory."
2775 #: ../clone/virt-sysprep.pod:202
2780 #: ../clone/virt-sysprep.pod:204
2782 "Remove HWADDR (hard-coded MAC address) configuration. For Fedora and Red "
2783 "Hat Enterprise Linux, this is removed from C<ifcfg-*> files."
2787 #: ../clone/virt-sysprep.pod:207
2792 #: ../clone/virt-sysprep.pod:209
2794 "Write some random bytes from the host into the random seed file of the "
2799 #: ../clone/virt-sysprep.pod:212
2800 msgid "See L</RANDOM SEED> below."
2804 #: ../clone/virt-sysprep.pod:214
2805 msgid "rhn-systemid"
2809 #: ../clone/virt-sysprep.pod:216
2810 msgid "Remove the RHN system ID."
2814 #: ../clone/virt-sysprep.pod:218
2819 #: ../clone/virt-sysprep.pod:220
2820 msgid "Remove the Smolt hardware UUID."
2824 #: ../clone/virt-sysprep.pod:222
2825 msgid "ssh-hostkeys"
2829 #: ../clone/virt-sysprep.pod:224
2830 msgid "Remove the SSH host keys in the guest."
2834 #: ../clone/virt-sysprep.pod:226
2836 "The SSH host keys are regenerated (differently) next time the guest is "
2841 #: ../clone/virt-sysprep.pod:229
2843 "If, after cloning, the guest gets the same IP address, ssh will give you a "
2844 "stark warning about the host key changing:"
2848 #: ../clone/virt-sysprep.pod:232
2851 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2852 " @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @\n"
2853 " @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\n"
2854 " IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!\n"
2859 #: ../clone/virt-sysprep.pod:237
2860 msgid "udev-persistent-net"
2864 #: ../clone/virt-sysprep.pod:239
2866 "Remove udev persistent net rules which map the guest's existing MAC address "
2867 "to a fixed ethernet device (eg. eth0)."
2871 #: ../clone/virt-sysprep.pod:242
2873 "After a guest is cloned, the MAC address usually changes. Since the old MAC "
2874 "address occupies the old name (eg. eth0), this means the fresh MAC address "
2875 "is assigned to a new name (eg. eth1) and this is usually undesirable. "
2876 "Erasing the udev persistent net rules avoids this."
2880 #: ../clone/virt-sysprep.pod:247
2885 #: ../clone/virt-sysprep.pod:249
2886 msgid "Remove the utmp file."
2890 #: ../clone/virt-sysprep.pod:251
2892 "This records who is currently logged in on a machine. In modern Linux "
2893 "distros it is stored in a ramdisk and hence not part of the virtual "
2894 "machine's disk, but it was stored on disk in older distros."
2898 #: ../clone/virt-sysprep.pod:255
2903 #: ../clone/virt-sysprep.pod:257
2904 msgid "Remove the yum UUID."
2908 #: ../clone/virt-sysprep.pod:259
2910 "Yum creates a fresh UUID the next time it runs when it notices that the "
2911 "original UUID has been erased."
2915 #: ../clone/virt-sysprep.pod:262
2916 msgid "COPYING AND CLONING"
2920 #: ../clone/virt-sysprep.pod:264
2922 "Virt-sysprep can be used as part of a process of cloning guests, or to "
2923 "prepare a template from which guests can be cloned. There are many "
2924 "different ways to achieve this using the virt tools, and this section is "
2925 "just an introduction."
2929 #: ../clone/virt-sysprep.pod:269
2930 msgid "A virtual machine (when switched off) consists of two parts:"
2934 #: ../clone/virt-sysprep.pod:273
2935 msgid "I<configuration>"
2939 #: ../clone/virt-sysprep.pod:275
2941 "The configuration or description of the guest. eg. The libvirt XML (see "
2942 "C<virsh dumpxml>), the running configuration of the guest, or another "
2943 "external format like OVF."
2947 #: ../clone/virt-sysprep.pod:279
2948 msgid "Some configuration items that might need to be changed:"
2952 #: ../clone/virt-sysprep.pod:285
2957 #: ../clone/virt-sysprep.pod:289 ../clone/virt-sysprep.pod:316
2962 #: ../clone/virt-sysprep.pod:293
2963 msgid "path to block device(s)"
2967 #: ../clone/virt-sysprep.pod:297
2968 msgid "network card MAC address"
2972 #: ../clone/virt-sysprep.pod:301
2973 msgid "I<block device(s)>"
2977 #: ../clone/virt-sysprep.pod:303
2979 "One or more hard disk images, themselves containing files, directories, "
2980 "applications, kernels, configuration, etc."
2984 #: ../clone/virt-sysprep.pod:306
2985 msgid "Some things inside the block devices that might need to be changed:"
2989 #: ../clone/virt-sysprep.pod:312
2990 msgid "hostname and other net configuration"
2994 #: ../clone/virt-sysprep.pod:320
2995 msgid "SSH host keys"
2999 #: ../clone/virt-sysprep.pod:324
3000 msgid "Windows unique security ID (SID)"
3004 #: ../clone/virt-sysprep.pod:328
3005 msgid "Puppet registration"
3009 #: ../clone/virt-sysprep.pod:334
3010 msgid "COPYING THE BLOCK DEVICE"
3014 #: ../clone/virt-sysprep.pod:336
3016 "Starting with an original guest, you probably wish to copy the guest block "
3017 "device and its configuration to make a template. Then once you are happy "
3018 "with the template, you will want to make many clones from it."
3022 #: ../clone/virt-sysprep.pod:341
3028 " original guest --------> template ---------->\n"
3029 " \\------> cloned\n"
3030 " \\-----> guests\n"
3036 #: ../clone/virt-sysprep.pod:349
3038 "You can, of course, just copy the block device on the host using L<cp(1)> or "
3043 #: ../clone/virt-sysprep.pod:352
3047 " original guest --------> template ---------->\n"
3048 " \\------> cloned\n"
3049 " \\-----> guests\n"
3055 #: ../clone/virt-sysprep.pod:358
3056 msgid "There are some smarter (and faster) ways too:"
3060 #: ../clone/virt-sysprep.pod:364
3064 " template ---------->\n"
3065 " \\------> cloned\n"
3066 " \\-----> guests\n"
3072 #: ../clone/virt-sysprep.pod:370
3074 "Use the block device as a backing file and create a snapshot on top for each "
3075 "guest. The advantage is that you don't need to copy the block device (very "
3076 "fast) and only changes are stored (less storage required)."
3080 #: ../clone/virt-sysprep.pod:375
3082 "Note that writing to the backing file once you have created guests on top of "
3083 "it is not possible: you will corrupt the guests."
3087 #: ../clone/virt-sysprep.pod:378
3089 "Tools that can do this include: L<qemu-img(1)> (with the I<create -f qcow2 "
3090 "-o backing_file> option), L<lvcreate(8)> (I<--snapshot> option). Some "
3091 "filesystems (such as btrfs) and most Network Attached Storage devices can "
3092 "also create cheap snapshots from files or LUNs."
3096 #: ../clone/virt-sysprep.pod:386
3097 msgid "Get your NAS to snapshot and/or duplicate the LUN."
3101 #: ../clone/virt-sysprep.pod:390
3102 msgid "Prepare your template using L<virt-sparsify(1)>. See below."
3106 #: ../clone/virt-sysprep.pod:394
3111 #: ../clone/virt-sysprep.pod:396
3113 "A separate tool, L<virt-clone(1)>, can be used to duplicate the block device "
3114 "and/or modify the external libvirt configuration of a guest. It will reset "
3115 "the name, UUID and MAC address of the guest in the libvirt XML."
3119 #: ../clone/virt-sysprep.pod:401
3121 "L<virt-clone(1)> does not use libguestfs and cannot look inside the disk "
3122 "image. This was the original motivation to write virt-sysprep."
3126 #: ../clone/virt-sysprep.pod:404
3131 #: ../clone/virt-sysprep.pod:406
3135 " original guest --------> template\n"
3140 #: ../clone/virt-sysprep.pod:409
3142 "L<virt-sparsify(1)> can be used to make the cloning template smaller, making "
3143 "it easier to compress and/or faster to copy."
3147 #: ../clone/virt-sysprep.pod:412
3149 "Notice that since virt-sparsify also copies the image, you can use it to "
3150 "make the initial copy (instead of C<dd>)."
3154 #: ../clone/virt-sysprep.pod:415
3159 #: ../clone/virt-sysprep.pod:417
3163 " template ---------->\n"
3164 " \\------> cloned\n"
3165 " \\-----> guests\n"
3171 #: ../clone/virt-sysprep.pod:423
3173 "If you want to give people cloned guests, but let them pick the size of the "
3174 "guest themselves (eg. depending on how much they are prepared to pay for "
3175 "disk space), then instead of copying the template, you can run "
3176 "L<virt-resize(1)>. Virt-resize performs a copy and resize, and thus is "
3177 "ideal for cloning guests from a template."
3181 #: ../clone/virt-sysprep.pod:429 ../src/guestfs.pod:1149
3186 #: ../clone/virt-sysprep.pod:431
3188 "Although virt-sysprep removes some sensitive information from the guest, it "
3189 "does not pretend to remove all of it. You should examine the L</OPERATIONS> "
3190 "above, and the implementation of the operations in the shell script. You "
3191 "should also examine the guest afterwards."
3195 #: ../clone/virt-sysprep.pod:436
3197 "Sensitive files are simply removed. The data they contained may still exist "
3198 "on the disk, easily recovered with a hex editor or undelete tool. Use "
3199 "L<virt-sparsify(1)> as one way to remove this content. See also the "
3200 "L<scrub(1)> command to get rid of deleted content in directory entries and "
3205 #: ../clone/virt-sysprep.pod:442
3210 #: ../clone/virt-sysprep.pod:444
3211 msgid "I<(This section applies to Linux guests only)>"
3215 #: ../clone/virt-sysprep.pod:446
3217 "The virt-sysprep C<random-seed> operation writes a few bytes of randomness "
3218 "from the host into the guest's random seed file."
3222 #: ../clone/virt-sysprep.pod:449
3224 "If this is just done once and the guest is cloned from the same template, "
3225 "then each guest will start with the same entropy, and things like SSH host "
3226 "keys and TCP sequence numbers may be predictable."
3230 #: ../clone/virt-sysprep.pod:453
3232 "Therefore you should arrange to add more randomness I<after> cloning from a "
3233 "template too, which can be done by just enabling the C<random-seed> "
3238 #: ../clone/virt-sysprep.pod:457
3241 " cp template.img newguest.img\n"
3242 " virt-sysprep --enable=random-seed -a newguest.img\n"
3247 #: ../clone/virt-sysprep.pod:460
3248 msgid "SELINUX RELABELLING"
3252 #: ../clone/virt-sysprep.pod:462
3253 msgid "I<(This section applies to Linux guests using SELinux only)>"
3257 #: ../clone/virt-sysprep.pod:464
3259 "If any new files are created by virt-sysprep, then virt-sysprep touches "
3260 "C</.autorelabel> so that these will be correctly labelled by SELinux the "
3261 "next time the guest is booted. This process interrupts boot and can take "
3266 #: ../clone/virt-sysprep.pod:469
3268 "You can force relabelling for all guests by supplying the "
3269 "I<--selinux-relabel> option."
3273 #: ../clone/virt-sysprep.pod:472
3275 "You can disable relabelling entirely by supplying the "
3276 "I<--no-selinux-relabel> option."
3280 #: ../clone/virt-sysprep.pod:484
3281 msgid "This program returns 0 on success, or 1 if there was an error."
3285 #: ../clone/virt-sysprep.pod:488
3287 "L<guestfs(3)>, L<guestfish(1)>, L<virt-clone(1)>, L<virt-rescue(1)>, "
3288 "L<virt-resize(1)>, L<virt-sparsify(1)>, L<virsh(1)>, L<lvcreate(8)>, "
3289 "L<qemu-img(1)>, L<scrub(1)>, L<http://libguestfs.org/>, "
3290 "L<http://libvirt.org/>."
3294 #: ../df/virt-df.pod:5
3295 msgid "virt-df - Display free space on virtual filesystems"
3299 #: ../df/virt-df.pod:9
3302 " virt-df [--options]\n"
3307 #: ../df/virt-df.pod:11
3310 " virt-df [--options] -d domname\n"
3315 #: ../df/virt-df.pod:13
3318 " virt-df [--options] -a disk.img [-a disk.img ...]\n"
3323 #: ../df/virt-df.pod:17
3326 " virt-df [--options] domname\n"
3331 #: ../df/virt-df.pod:19
3334 " virt-df [--options] disk.img [disk.img ...]\n"
3339 #: ../df/virt-df.pod:23
3341 "C<virt-df> is a command line tool to display free space on virtual machine "
3342 "filesystems. Unlike other tools, it doesn't just display the size of disk "
3343 "allocated to a virtual machine, but can look inside disk images to see how "
3344 "much space is really being used."
3348 #: ../df/virt-df.pod:28
3350 "If used without any I<-a> or I<-d> arguments, C<virt-df> checks with libvirt "
3351 "to get a list of all active and inactive guests, and performs a C<df>-type "
3352 "operation on each one in turn, printing out the results."
3356 #: ../df/virt-df.pod:32
3358 "If any I<-a> or I<-d> arguments are specified, C<virt-df> performs a "
3359 "C<df>-type operation on either the single named libvirt domain, or on the "
3360 "disk image(s) listed on the command line (which must all belong to a single "
3361 "VM). In this mode (with arguments), C<virt-df> will I<only work for a "
3362 "single guest>. If you want to run on multiple guests, then you have to "
3363 "invoke C<virt-df> multiple times."
3367 #: ../df/virt-df.pod:39
3369 "Use the I<--csv> option to get a format which can be easily parsed by other "
3370 "programs. Other options are similar to the standard L<df(1)> command."
3374 #: ../df/virt-df.pod:45
3376 "Show disk usage for a single libvirt guest called C<F14x64>. Make the "
3377 "output human-readable:"
3381 #: ../df/virt-df.pod:48
3384 " # virt-df -d F14x64 -h\n"
3385 " Filesystem Size Used Available Use%\n"
3386 " F14x64:/dev/sda1 484M 66M 393M 14%\n"
3387 " F14x64:/dev/vg_f13x64/lv_root 7.4G 3.4G 4.0G 46%\n"
3392 #: ../df/virt-df.pod:53
3393 msgid "Show disk usage for a disk image file called C<test.img>:"
3397 #: ../df/virt-df.pod:55
3400 " $ virt-df -a test1.img\n"
3401 " Filesystem 1K-blocks Used Available Use%\n"
3402 " test1.img:/dev/sda1 99099 1551 92432 2%\n"
3407 #: ../df/virt-df.pod:112
3410 " virt-df --format=raw -a disk.img\n"
3415 #: ../df/virt-df.pod:116
3418 " virt-df --format=raw -a disk.img --format -a another.img\n"
3423 #: ../df/virt-df.pod:129
3424 msgid "Print sizes in human-readable format."
3428 #: ../df/virt-df.pod:131
3429 msgid "You are not allowed to use I<-h> and I<--csv> at the same time."
3433 #: ../df/virt-df.pod:133 ../fish/guestfish.pod:258 ../fuse/guestmount.pod:164
3438 #: ../df/virt-df.pod:135
3443 #: ../df/virt-df.pod:137
3444 msgid "Print inodes instead of blocks."
3448 #: ../df/virt-df.pod:139
3449 msgid "B<--one-per-guest>"
3453 #: ../df/virt-df.pod:141
3455 "Run one libguestfs appliance per guest. Normally C<virt-df> will add the "
3456 "disks from several guests to a single libguestfs appliance."
3460 #: ../df/virt-df.pod:144
3461 msgid "You might use this option in the following circumstances:"
3465 #: ../df/virt-df.pod:150
3467 "If you think an untrusted guest might actively try to exploit the libguestfs "
3468 "appliance kernel, then this prevents one guest from interfering with the "
3469 "stats printed for another guest."
3473 #: ../df/virt-df.pod:156
3475 "If the kernel has a bug which stops it from accessing a filesystem in one "
3476 "guest (see for example RHBZ#635373) then this allows libguestfs to continue "
3477 "and report stats for further guests."
3481 #: ../df/virt-df.pod:165
3483 "Print UUIDs instead of names. This is useful for following a guest even "
3484 "when the guest is migrated or renamed, or when two guests happen to have the "
3489 #: ../df/virt-df.pod:169
3491 "Note that only domains that we fetch from libvirt come with UUIDs. For disk "
3492 "images, we still print the disk image name even when this option is "
3497 #: ../df/virt-df.pod:229
3499 "L<df(1)>, L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
3500 "L<http://libguestfs.org/>."
3504 #: ../edit/virt-edit.pod:5
3505 msgid "virt-edit - Edit a file in a virtual machine"
3509 #: ../edit/virt-edit.pod:9
3512 " virt-edit [--options] -d domname file [file ...]\n"
3517 #: ../edit/virt-edit.pod:11
3520 " virt-edit [--options] -a disk.img [-a disk.img ...] file [file ...]\n"
3525 #: ../edit/virt-edit.pod:13
3528 " virt-edit [-d domname|-a disk.img] file -e 'expr'\n"
3533 #: ../edit/virt-edit.pod:17
3536 " virt-edit domname file\n"
3541 #: ../edit/virt-edit.pod:19 ../edit/virt-edit.pod:183
3544 " virt-edit disk.img [disk.img ...] file\n"
3549 #: ../edit/virt-edit.pod:21 ../fish/guestfish.pod:23 ../fish/virt-copy-in.pod:13 ../fish/virt-tar-in.pod:15 ../fuse/guestmount.pod:15 ../rescue/virt-rescue.pod:19 ../tools/virt-tar.pl:64 ../tools/virt-win-reg.pl:51
3554 #: ../edit/virt-edit.pod:23
3556 "You must I<not> use C<virt-edit> on live virtual machines. If you do this, "
3557 "you risk disk corruption in the VM. C<virt-edit> tries to stop you from "
3558 "doing this, but doesn't catch all cases."
3562 #: ../edit/virt-edit.pod:29
3564 "C<virt-edit> is a command line tool to edit C<file> where each C<file> "
3565 "exists in the named virtual machine (or disk image)."
3569 #: ../edit/virt-edit.pod:32
3571 "Multiple filenames can be given, in which case they are each edited in "
3572 "turn. Each filename must be a full path, starting at the root directory "
3573 "(starting with '/')."
3577 #: ../edit/virt-edit.pod:36
3578 msgid "If you want to just view a file, use L<virt-cat(1)>."
3582 #: ../edit/virt-edit.pod:38
3584 "For more complex cases you should look at the L<guestfish(1)> tool (see "
3585 "L</USING GUESTFISH> below)."
3589 #: ../edit/virt-edit.pod:41
3591 "C<virt-edit> cannot be used to create a new file. L<guestfish(1)> can do "
3592 "that and much more."
3596 #: ../edit/virt-edit.pod:46
3597 msgid "Edit the named files interactively:"
3601 #: ../edit/virt-edit.pod:48
3604 " virt-edit -d mydomain /boot/grub/grub.conf\n"
3609 #: ../edit/virt-edit.pod:50
3612 " virt-edit -d mydomain /etc/passwd\n"
3617 #: ../edit/virt-edit.pod:52
3618 msgid "For Windows guests, some Windows paths are understood:"
3622 #: ../edit/virt-edit.pod:54
3625 " virt-edit -d mywindomain 'c:\\autoexec.bat'\n"
3630 #: ../edit/virt-edit.pod:56
3632 "If Perl is installed, you can also edit files non-interactively (see "
3633 "L</NON-INTERACTIVE EDITING> below). To change the init default level to 5:"
3637 #: ../edit/virt-edit.pod:60
3640 " virt-edit -d mydomain /etc/inittab -e 's/^id:.*/id:5:initdefault:/'\n"
3645 #: ../edit/virt-edit.pod:81
3646 msgid "B<-b> extension"
3650 #: ../edit/virt-edit.pod:83
3651 msgid "B<--backup> extension"
3655 #: ../edit/virt-edit.pod:85
3657 "Create a backup of the original file I<in the guest disk image>. The backup "
3658 "has the original filename with C<extension> added."
3662 #: ../edit/virt-edit.pod:88
3664 "Usually the first character of C<extension> would be a dot C<.> so you would "
3669 #: ../edit/virt-edit.pod:91
3672 " virt-edit -b .orig [etc]\n"
3677 #: ../edit/virt-edit.pod:93
3678 msgid "By default, no backup file is made."
3682 #: ../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
3687 #: ../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
3688 msgid "B<--connect URI>"
3692 #: ../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
3694 "If you specify guest block devices directly, then libvirt is not used at "
3699 #: ../edit/virt-edit.pod:114
3701 "When prompting for keys and passphrases, virt-edit normally turns echoing "
3702 "off so you cannot see what you are typing. If you are not worried about "
3703 "Tempest attacks and there is no one else in the room you can specify this "
3704 "flag to see what you are typing."
3708 #: ../edit/virt-edit.pod:119
3713 #: ../edit/virt-edit.pod:121
3714 msgid "B<--expr> EXPR"
3718 #: ../edit/virt-edit.pod:123
3720 "Instead of launching the external editor, non-interactively apply the Perl "
3721 "expression C<EXPR> to each line in the file. See L</NON-INTERACTIVE "
3726 #: ../edit/virt-edit.pod:127
3728 "Be careful to properly quote the expression to prevent it from being altered "
3733 #: ../edit/virt-edit.pod:130
3734 msgid "Note that this option is only available when Perl 5 is installed."
3738 #: ../edit/virt-edit.pod:132
3739 msgid "B<--format> raw|qcow2|..."
3743 #: ../edit/virt-edit.pod:143
3746 " virt-edit --format=raw -a disk.img file\n"
3751 #: ../edit/virt-edit.pod:147
3754 " virt-edit --format=raw -a disk.img --format -a another.img file\n"
3759 #: ../edit/virt-edit.pod:181
3760 msgid "Previous versions of virt-edit allowed you to write either:"
3764 #: ../edit/virt-edit.pod:187
3767 " virt-edit guestname file\n"
3772 #: ../edit/virt-edit.pod:195
3773 msgid "NON-INTERACTIVE EDITING"
3777 #: ../edit/virt-edit.pod:197
3779 "C<virt-edit> normally calls out to C<$EDITOR> (or vi) so the system "
3780 "administrator can interactively edit the file."
3784 #: ../edit/virt-edit.pod:200
3786 "There are two ways also to use C<virt-edit> from scripts in order to make "
3787 "automated edits to files. (Note that although you I<can> use C<virt-edit> "
3788 "like this, it's less error-prone to write scripts directly using the "
3789 "libguestfs API and Augeas for configuration file editing.)"
3793 #: ../edit/virt-edit.pod:206
3795 "The first method is to temporarily set C<$EDITOR> to any script or program "
3796 "you want to run. The script is invoked as C<$EDITOR tmpfile> and it should "
3797 "update C<tmpfile> in place however it likes."
3801 #: ../edit/virt-edit.pod:210
3803 "The second method is to use the I<-e> parameter of C<virt-edit> to run a "
3804 "short Perl snippet in the style of L<sed(1)>. For example to replace all "
3805 "instances of C<foo> with C<bar> in a file:"
3809 #: ../edit/virt-edit.pod:214
3812 " virt-edit -d domname filename -e 's/foo/bar/'\n"
3817 #: ../edit/virt-edit.pod:216
3819 "The full power of Perl regular expressions can be used (see L<perlre(1)>). "
3820 "For example to delete root's password you could do:"
3824 #: ../edit/virt-edit.pod:219
3827 " virt-edit -d domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
3832 #: ../edit/virt-edit.pod:221
3834 "What really happens is that the snippet is evaluated as a Perl expression "
3835 "for each line of the file. The line, including the final C<\\n>, is passed "
3836 "in C<$_> and the expression should update C<$_> or leave it unchanged."
3840 #: ../edit/virt-edit.pod:226
3842 "To delete a line, set C<$_> to the empty string. For example, to delete the "
3843 "C<apache> user account from the password file you can do:"
3847 #: ../edit/virt-edit.pod:229
3850 " virt-edit -d mydomain /etc/passwd -e '$_ = \"\" if /^apache:/'\n"
3855 #: ../edit/virt-edit.pod:231
3857 "To insert a line, prepend or append it to C<$_>. However appending lines to "
3858 "the end of the file is rather difficult this way since there is no concept "
3859 "of \"last line of the file\" - your expression just doesn't get called "
3860 "again. You might want to use the first method (setting C<$EDITOR>) if you "
3865 #: ../edit/virt-edit.pod:237
3867 "The variable C<$lineno> contains the current line number. As is "
3868 "traditional, the first line in the file is number C<1>."
3872 #: ../edit/virt-edit.pod:240
3874 "The return value from the expression is ignored, but the expression may call "
3875 "C<die> in order to abort the whole program, leaving the original file "
3880 #: ../edit/virt-edit.pod:244
3882 "Remember when matching the end of a line that C<$_> may contain the final "
3883 "C<\\n>, or (for DOS files) C<\\r\\n>, or if the file does not end with a "
3884 "newline then neither of these. Thus to match or substitute some text at the "
3885 "end of a line, use this regular expression:"
3889 #: ../edit/virt-edit.pod:249
3892 " /some text(\\r?\\n)?$/\n"
3897 #: ../edit/virt-edit.pod:251
3899 "Alternately, use the perl C<chomp> function, being careful not to chomp "
3900 "C<$_> itself (since that would remove all newlines from the file):"
3904 #: ../edit/virt-edit.pod:255
3907 " my $m = $_; chomp $m; $m =~ /some text$/\n"
3912 #: ../edit/virt-edit.pod:257 ../fish/guestfish.pod:858
3913 msgid "WINDOWS PATHS"
3917 #: ../edit/virt-edit.pod:259
3919 "C<virt-edit> has a limited ability to understand Windows drive letters and "
3920 "paths (eg. C<E:\\foo\\bar.txt>)."
3924 #: ../edit/virt-edit.pod:262
3925 msgid "If and only if the guest is running Windows then:"
3929 #: ../edit/virt-edit.pod:268
3931 "Drive letter prefixes like C<C:> are resolved against the Windows Registry "
3932 "to the correct filesystem."
3936 #: ../edit/virt-edit.pod:273
3938 "Any backslash (C<\\>) characters in the path are replaced with forward "
3939 "slashes so that libguestfs can process it."
3943 #: ../edit/virt-edit.pod:278
3945 "The path is resolved case insensitively to locate the file that should be "
3950 #: ../edit/virt-edit.pod:283
3951 msgid "There are some known shortcomings:"
3955 #: ../edit/virt-edit.pod:289
3956 msgid "Some NTFS symbolic links may not be followed correctly."
3960 #: ../edit/virt-edit.pod:293
3961 msgid "NTFS junction points that cross filesystems are not followed."
3965 #: ../edit/virt-edit.pod:299
3967 "L<guestfish(1)> is a more powerful, lower level tool which you can use when "
3968 "C<virt-edit> doesn't work."
3972 #: ../edit/virt-edit.pod:302
3973 msgid "Using C<virt-edit> is approximately equivalent to doing:"
3977 #: ../edit/virt-edit.pod:304
3980 " guestfish --rw -i -d domname edit /file\n"
3985 #: ../edit/virt-edit.pod:306
3987 "where C<domname> is the name of the libvirt guest, and C</file> is the full "
3992 #: ../edit/virt-edit.pod:309
3994 "The command above uses libguestfs's guest inspection feature and so does not "
3995 "work on guests that libguestfs cannot inspect, or on things like arbitrary "
3996 "disk images that don't contain guests. To edit a file on a disk image "
4001 #: ../edit/virt-edit.pod:314
4004 " guestfish --rw -a disk.img -m /dev/sda1 edit /file\n"
4009 #: ../edit/virt-edit.pod:316
4011 "where C<disk.img> is the disk image, C</dev/sda1> is the filesystem within "
4012 "the disk image to edit, and C</file> is the full path to the file."
4016 #: ../edit/virt-edit.pod:320
4018 "C<virt-edit> cannot create new files. Use the guestfish commands C<touch>, "
4019 "C<write> or C<upload> instead:"
4023 #: ../edit/virt-edit.pod:323
4026 " guestfish --rw -i -d domname touch /newfile\n"
4031 #: ../edit/virt-edit.pod:325
4034 " guestfish --rw -i -d domname write /newfile \"new content\"\n"
4039 #: ../edit/virt-edit.pod:327
4042 " guestfish --rw -i -d domname upload localfile /newfile\n"
4047 #: ../edit/virt-edit.pod:329 ../fish/guestfish.pod:1119 ../rescue/virt-rescue.pod:261 ../sparsify/virt-sparsify.pod:232 ../src/guestfs.pod:3194 ../test-tool/libguestfs-test-tool.pod:95
4048 msgid "ENVIRONMENT VARIABLES"
4052 #: ../edit/virt-edit.pod:333
4057 #: ../edit/virt-edit.pod:335
4059 "If set, this string is used as the editor. It may contain arguments, "
4060 "eg. C<\"emacs -nw\">"
4064 #: ../edit/virt-edit.pod:338
4065 msgid "If not set, C<vi> is used."
4069 #: ../edit/virt-edit.pod:356
4071 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
4072 "L<virt-tar-in(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
4073 "L<Sys::Virt(3)>, L<http://libguestfs.org/>, L<perl(1)>, L<perlre(1)>."
4077 #: ../erlang/examples/guestfs-erlang.pod:5
4078 msgid "guestfs-erlang - How to use libguestfs from Erlang"
4082 #: ../erlang/examples/guestfs-erlang.pod:9
4085 " {ok, G} = guestfs:create(),\n"
4086 " ok = guestfs:add_drive_opts(G, Disk,\n"
4087 " [{format, \"raw\"}, {readonly, true}]),\n"
4088 " ok = guestfs:launch(G),\n"
4089 " [Device] = guestfs:list_devices(G),\n"
4090 " ok = guestfs:close(G).\n"
4095 #: ../erlang/examples/guestfs-erlang.pod:18
4097 "This manual page documents how to call libguestfs from the Erlang "
4098 "programming language. This page just documents the differences from the C "
4099 "API and gives some examples. If you are not familiar with using libguestfs, "
4100 "you also need to read L<guestfs(3)>."
4104 #: ../erlang/examples/guestfs-erlang.pod:23
4105 msgid "OPENING AND CLOSING THE HANDLE"
4109 #: ../erlang/examples/guestfs-erlang.pod:25
4111 "The Erlang bindings are implemented using an external program called "
4112 "C<erl-guestfs>. This program must be on the current PATH, or else you "
4113 "should specify the full path to the program:"
4117 #: ../erlang/examples/guestfs-erlang.pod:29
4120 " {ok, G} = guestfs:create().\n"
4125 #: ../erlang/examples/guestfs-erlang.pod:31
4128 " {ok, G} = guestfs:create(\"/path/to/erl-guestfs\").\n"
4133 #: ../erlang/examples/guestfs-erlang.pod:33
4134 msgid "C<G> is the libguestfs handle which you should pass to other functions."
4138 #: ../erlang/examples/guestfs-erlang.pod:36
4139 msgid "To close the handle:"
4143 #: ../erlang/examples/guestfs-erlang.pod:38
4146 " ok = guestfs:close(G).\n"
4151 #: ../erlang/examples/guestfs-erlang.pod:40
4152 msgid "FUNCTIONS WITH OPTIONAL ARGUMENTS"
4156 #: ../erlang/examples/guestfs-erlang.pod:42
4158 "For functions that take optional arguments, the first arguments are the "
4159 "non-optional ones. The last argument is a list of tuples supplying the "
4160 "remaining optional arguments."
4164 #: ../erlang/examples/guestfs-erlang.pod:46
4167 " ok = guestfs:add_drive_opts(G, Disk,\n"
4168 " [{format, \"raw\"}, {readonly, true}]).\n"
4173 #: ../erlang/examples/guestfs-erlang.pod:49
4174 msgid "If the last argument would be an empty list, you can also omit it:"
4178 #: ../erlang/examples/guestfs-erlang.pod:51
4181 " ok = guestfs:add_drive_opts(G, Disk).\n"
4186 #: ../erlang/examples/guestfs-erlang.pod:53
4187 msgid "RETURN VALUES AND ERRORS"
4191 #: ../erlang/examples/guestfs-erlang.pod:55
4193 "On success, most functions return a C<Result> term (which could be a list, "
4194 "string, tuple etc.). If there is nothing for the function to return, then "
4195 "the atom C<ok> is returned."
4199 #: ../erlang/examples/guestfs-erlang.pod:59
4200 msgid "On error, you would see one of the following tuples:"
4204 #: ../erlang/examples/guestfs-erlang.pod:63
4205 msgid "C<{error, Msg, Errno}>"
4209 #: ../erlang/examples/guestfs-erlang.pod:65
4210 msgid "This indicates an ordinary error from the function."
4214 #: ../erlang/examples/guestfs-erlang.pod:67
4216 "C<Msg> is the error message (string) and C<Errno> is the Unix error "
4221 #: ../erlang/examples/guestfs-erlang.pod:70
4222 msgid "C<Errno> can be zero. See L<guestfs(3)/guestfs_last_errno>."
4226 #: ../erlang/examples/guestfs-erlang.pod:72
4227 msgid "C<{unknown, Function}>"
4231 #: ../erlang/examples/guestfs-erlang.pod:74
4233 "This indicates that the function you called is not known. Generally this "
4234 "means you are mixing C<erl-guestfs> from another version of libguestfs, "
4235 "which you should not do."
4239 #: ../erlang/examples/guestfs-erlang.pod:78
4240 msgid "C<Function> is the name of the unknown function."
4244 #: ../erlang/examples/guestfs-erlang.pod:80
4245 msgid "C<{unknownarg, Arg}>"
4249 #: ../erlang/examples/guestfs-erlang.pod:82
4251 "This indicates that you called a function with optional arguments, with an "
4252 "unknown argument name."
4256 #: ../erlang/examples/guestfs-erlang.pod:85
4257 msgid "C<Arg> is the name of the unknown argument."
4261 #: ../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
4262 msgid "EXAMPLE 1: CREATE A DISK IMAGE"
4266 #: ../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
4271 #: ../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
4272 msgid "EXAMPLE 2: INSPECT A VIRTUAL MACHINE DISK IMAGE"
4276 #: ../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
4281 #: ../erlang/examples/guestfs-erlang.pod:99
4283 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-java(3)>, "
4284 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4285 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://www.erlang.org/>. "
4286 "L<http://libguestfs.org/>."
4290 #: ../erlang/examples/guestfs-erlang.pod:110 ../examples/guestfs-examples.pod:45 ../examples/guestfs-recipes.pod:397 ../fish/guestfish.pod:1296 ../fish/virt-copy-in.pod:60 ../fish/virt-copy-out.pod:49 ../fish/virt-tar-in.pod:58 ../fish/virt-tar-out.pod:51 ../fuse/guestmount.pod:328 ../inspector/virt-inspector.pod:389 ../java/examples/guestfs-java.pod:58 ../ocaml/examples/guestfs-ocaml.pod:91 ../perl/examples/guestfs-perl.pod:52 ../python/examples/guestfs-python.pod:54 ../ruby/examples/guestfs-ruby.pod:48 ../src/guestfs.pod:3333 ../test-tool/libguestfs-test-tool.pod:106
4295 #: ../erlang/examples/guestfs-erlang.pod:112 ../examples/guestfs-examples.pod:47 ../examples/guestfs-recipes.pod:399 ../fish/guestfish.pod:1298 ../fish/virt-copy-in.pod:62 ../fish/virt-copy-out.pod:51 ../fish/virt-tar-in.pod:60 ../fish/virt-tar-out.pod:53 ../fuse/guestmount.pod:330 ../java/examples/guestfs-java.pod:60 ../ocaml/examples/guestfs-ocaml.pod:93 ../perl/examples/guestfs-perl.pod:54 ../python/examples/guestfs-python.pod:56 ../ruby/examples/guestfs-ruby.pod:50 ../src/guestfs.pod:3335 ../test-tool/libguestfs-test-tool.pod:108
4296 msgid "Richard W.M. Jones (C<rjones at redhat dot com>)"
4300 #: ../erlang/examples/guestfs-erlang.pod:116 ../java/examples/guestfs-java.pod:64 ../perl/examples/guestfs-perl.pod:58
4301 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
4305 #: ../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
4307 "The examples in this manual page may be freely copied, modified and "
4308 "distributed without any restrictions."
4312 #: ../erlang/examples/guestfs-erlang.pod:121 ../examples/guestfs-examples.pod:56 ../examples/guestfs-recipes.pod:408 ../java/examples/guestfs-java.pod:69 ../ocaml/examples/guestfs-ocaml.pod:102 ../perl/examples/guestfs-perl.pod:63 ../python/examples/guestfs-python.pod:65 ../ruby/examples/guestfs-ruby.pod:59 ../src/guestfs.pod:3342
4314 "This library is free software; you can redistribute it and/or modify it "
4315 "under the terms of the GNU Lesser General Public License as published by the "
4316 "Free Software Foundation; either version 2 of the License, or (at your "
4317 "option) any later version."
4321 #: ../erlang/examples/guestfs-erlang.pod:126 ../examples/guestfs-examples.pod:61 ../examples/guestfs-recipes.pod:413 ../java/examples/guestfs-java.pod:74 ../ocaml/examples/guestfs-ocaml.pod:107 ../perl/examples/guestfs-perl.pod:68 ../python/examples/guestfs-python.pod:70 ../ruby/examples/guestfs-ruby.pod:64 ../src/guestfs.pod:3347
4323 "This library is distributed in the hope that it will be useful, but WITHOUT "
4324 "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or "
4325 "FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License "
4330 #: ../erlang/examples/guestfs-erlang.pod:131 ../examples/guestfs-examples.pod:66 ../examples/guestfs-recipes.pod:418 ../java/examples/guestfs-java.pod:79 ../ocaml/examples/guestfs-ocaml.pod:112 ../perl/examples/guestfs-perl.pod:73 ../python/examples/guestfs-python.pod:75 ../ruby/examples/guestfs-ruby.pod:69 ../src/guestfs.pod:3352
4332 "You should have received a copy of the GNU Lesser General Public License "
4333 "along with this library; if not, write to the Free Software Foundation, "
4334 "Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA"
4338 #: ../examples/guestfs-examples.pod:5
4339 msgid "guestfs-examples - Examples of using libguestfs from C"
4343 #: ../examples/guestfs-examples.pod:9 ../src/guestfs.pod:9
4346 " #include <guestfs.h>\n"
4351 #: ../examples/guestfs-examples.pod:11
4354 " guestfs_h *g = guestfs_create ();\n"
4355 " guestfs_add_drive_ro (g, \"disk.img\");\n"
4356 " guestfs_launch (g);\n"
4361 #: ../examples/guestfs-examples.pod:15 ../src/guestfs.pod:19
4364 " cc prog.c -o prog -lguestfs\n"
4366 " cc prog.c -o prog `pkg-config libguestfs --cflags --libs`\n"
4371 #: ../examples/guestfs-examples.pod:21
4373 "This manual page contains examples of calling libguestfs from the C "
4374 "programming language. If you are not familiar with using libguestfs, you "
4375 "also need to read L<guestfs(3)>."
4379 #: ../examples/guestfs-examples.pod:35
4381 "L<guestfs(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
4382 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
4383 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
4387 #: ../examples/guestfs-examples.pod:51 ../ocaml/examples/guestfs-ocaml.pod:97 ../python/examples/guestfs-python.pod:60 ../ruby/examples/guestfs-ruby.pod:54
4388 msgid "Copyright (C) 2010 Red Hat Inc. L<http://libguestfs.org/>"
4392 #: ../examples/guestfs-recipes.pod:3 ../examples/guestfs-recipes.pod:12
4397 #: ../examples/guestfs-recipes.pod:5
4399 "pod2man and pod2html have differing bugs which makes it hard to write URLs "
4400 "here. The only way which works for both sorts of output is to just write "
4401 "the URL directly. Do NOT use L<...> for URLs."
4405 #: ../examples/guestfs-recipes.pod:9
4407 "We break with tradition here and don't use ALL CAPS for the section "
4408 "headings, as this makes them much easier to read."
4412 #: ../examples/guestfs-recipes.pod:16
4413 msgid "guestfs-recipes - libguestfs, guestfish and virt tools recipes"
4417 #: ../examples/guestfs-recipes.pod:20
4419 "This page contains recipes for and links to things you can do using "
4420 "libguestfs, L<guestfish(1)> and the virt tools."
4424 #: ../examples/guestfs-recipes.pod:23
4425 msgid "Audit a virtual machine for setuid files"
4429 #: ../examples/guestfs-recipes.pod:25
4431 "The link below contains a small program which can be used to audit a Linux "
4432 "virtual machine to see what setuid and setgid files it contains."
4436 #: ../examples/guestfs-recipes.pod:28
4437 msgid "https://rwmj.wordpress.com/2010/12/15/tip-audit-virtual-machine-for-setuid-files/#content"
4441 #: ../examples/guestfs-recipes.pod:30
4442 msgid "Change the background image in a Windows XP VM"
4446 #: ../examples/guestfs-recipes.pod:32
4448 "The links below explain how to use L<guestfish(1)> to change the background "
4449 "image for a user of a Windows XP VM. Unfortunately the technique appears to "
4450 "be substantially different for each version of Windows."
4454 #: ../examples/guestfs-recipes.pod:37
4456 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002655.html "
4457 "https://lists.fedoraproject.org/pipermail/virt/2011-May/002658.html"
4461 #: ../examples/guestfs-recipes.pod:40
4462 msgid "Cloning a virtual machine (Linux)"
4466 #: ../examples/guestfs-recipes.pod:42
4468 "The guestfish technique described in the link below works well for most "
4469 "Linux VMs. Depending on the Linux distro you may need to change the paths "
4474 #: ../examples/guestfs-recipes.pod:46
4475 msgid "https://rwmj.wordpress.com/2010/09/24/tip-my-procedure-for-cloning-a-fedora-vm/#content"
4479 #: ../examples/guestfs-recipes.pod:48
4481 "Avoid L<virt-clone(1)>. Currently what to do about virt-clone is under "
4486 #: ../examples/guestfs-recipes.pod:51
4487 msgid "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4491 #: ../examples/guestfs-recipes.pod:53
4492 msgid "Cloning a virtual machine (Windows)"
4496 #: ../examples/guestfs-recipes.pod:55
4498 "It is possible to do a \"sysprep\" using libguestfs alone, although not "
4499 "straightforward. Currently there is code in the Aeolus Oz project which "
4500 "does this (using libguestfs). As part of our review of the virt-clone tool, "
4501 "we may add sysprepping ability."
4505 #: ../examples/guestfs-recipes.pod:60
4507 "https://github.com/clalancette/oz "
4508 "https://www.redhat.com/archives/virt-tools-list/2011-May/msg00019.html"
4512 #: ../examples/guestfs-recipes.pod:63
4513 msgid "Convert a CD-ROM / DVD / ISO to a tarball"
4517 #: ../examples/guestfs-recipes.pod:65
4518 msgid "This converts input C<cd.iso> to output C<cd.tar.gz>:"
4522 #: ../examples/guestfs-recipes.pod:67
4525 " guestfish --ro -a cd.iso -m /dev/sda tgz-out / cd.tar.gz\n"
4530 #: ../examples/guestfs-recipes.pod:69
4531 msgid "To export just a subdirectory, eg. C</files>, do:"
4535 #: ../examples/guestfs-recipes.pod:71
4538 " guestfish --ro -a cd.iso -m /dev/sda tgz-out /files cd.tar.gz\n"
4543 #: ../examples/guestfs-recipes.pod:73
4544 msgid "Create empty disk images"
4548 #: ../examples/guestfs-recipes.pod:75
4550 "You can use the L<guestfish(1)> I<-N> option to create empty disk images. "
4551 "The useful guide below explains the options available."
4555 #: ../examples/guestfs-recipes.pod:78
4556 msgid "https://rwmj.wordpress.com/2010/09/08/new-guestfish-n-options-in-1-5-9/#content"
4560 #: ../examples/guestfs-recipes.pod:80
4561 msgid "Dump raw filesystem content from inside a disk image or VM"
4565 #: ../examples/guestfs-recipes.pod:82
4567 "You can use the L<guestfish(1)> C<download> command to extract the raw "
4568 "filesystem content from any filesystem in a disk image or a VM (even one "
4569 "which is encrypted or buried inside an LV):"
4573 #: ../examples/guestfs-recipes.pod:86
4576 " guestfish --ro -a disk.img run : download /dev/sda1 sda1.img\n"
4581 #: ../examples/guestfs-recipes.pod:88
4584 " guestfish --ro -d Guest run : download /dev/vg_guest/lv_root lv.img\n"
4589 #: ../examples/guestfs-recipes.pod:90
4590 msgid "To list the filesystems in a disk image, use L<virt-filesystems(1)>."
4594 #: ../examples/guestfs-recipes.pod:92
4595 msgid "Edit grub configuration in a VM"
4599 #: ../examples/guestfs-recipes.pod:94
4600 msgid "You can use this to:"
4604 #: ../examples/guestfs-recipes.pod:100
4605 msgid "Fix a virtual machine that does not boot."
4609 #: ../examples/guestfs-recipes.pod:104
4610 msgid "Change which kernel is used to boot the VM."
4614 #: ../examples/guestfs-recipes.pod:108
4615 msgid "Change kernel command line options."
4619 #: ../examples/guestfs-recipes.pod:112
4620 msgid "Use L<virt-edit(1)> to edit the grub configuration:"
4624 #: ../examples/guestfs-recipes.pod:114
4627 " virt-edit -d BrokenGuest /boot/grub/grub.conf\n"
4632 #: ../examples/guestfs-recipes.pod:116
4634 "or for general tinkering inside an unbootable VM use L<virt-rescue(1)> like "
4639 #: ../examples/guestfs-recipes.pod:119
4642 " virt-rescue -d BrokenGuest\n"
4647 #: ../examples/guestfs-recipes.pod:121
4648 msgid "Export any directory from a VM"
4652 #: ../examples/guestfs-recipes.pod:123
4653 msgid "To export C</home> from a VM into a local directory use L<virt-copy-out(1)>:"
4657 #: ../examples/guestfs-recipes.pod:126
4660 " virt-copy-out -d Guest /home .\n"
4665 #: ../examples/guestfs-recipes.pod:128 ../fish/guestfish-actions.pod:9 ../fish/guestfish-actions.pod:1332 ../fish/guestfish-actions.pod:1597 ../fish/guestfish-actions.pod:2014 ../src/guestfs-actions.pod:18 ../src/guestfs-actions.pod:2039 ../src/guestfs-actions.pod:2463 ../src/guestfs-actions.pod:3022 ../src/guestfs.pod:1670 ../tools/virt-win-reg.pl:706
4670 #: ../examples/guestfs-recipes.pod:134
4672 "The final dot of the command is not a printing error. It means we want to "
4673 "copy out to the current directory."
4677 #: ../examples/guestfs-recipes.pod:139
4678 msgid "This creates a directory called C<home> under the current directory."
4682 #: ../examples/guestfs-recipes.pod:143
4684 "If the guest is a Windows guest then you can use drive letters and "
4685 "backslashes, but you must prefix the path with C<win:> and quote it to "
4686 "protect it from the shell, like this:"
4690 #: ../examples/guestfs-recipes.pod:147
4693 " virt-copy-out -d WinGuest 'win:c:\\windows\\system32\\config' .\n"
4698 #: ../examples/guestfs-recipes.pod:149
4699 msgid "To get the output as a compressed tarball, do:"
4703 #: ../examples/guestfs-recipes.pod:151
4706 " virt-tar-out -d Guest /home - | gzip --best > home.tar.gz\n"
4711 #: ../examples/guestfs-recipes.pod:153
4713 "Although it sounds tempting, this is usually not a reliable way to get a "
4714 "backup from a running guest. See the entry in the FAQ: "
4715 "http://libguestfs.org/FAQ.html#backup"
4719 #: ../examples/guestfs-recipes.pod:157
4720 msgid "Find out which user is using the most space"
4724 #: ../examples/guestfs-recipes.pod:159
4726 "This simple script examines a Linux guest to find out which user is using "
4727 "the most space in their home directory:"
4731 #: ../examples/guestfs-recipes.pod:162
4739 #: ../examples/guestfs-recipes.pod:164 ../fish/guestfish.pod:984
4747 #: ../examples/guestfs-recipes.pod:166
4756 #: ../examples/guestfs-recipes.pod:169
4759 " eval $(guestfish --ro -d \"$vm\" -i --listen)\n"
4764 #: ../examples/guestfs-recipes.pod:171
4767 " for d in $(guestfish --remote ls \"$dir\"); do\n"
4768 " echo -n \"$dir/$d\"\n"
4770 " guestfish --remote du \"$dir/$d\";\n"
4771 " done | sort -nr -k 2\n"
4776 #: ../examples/guestfs-recipes.pod:177 ../fish/guestfish.pod:941
4779 " guestfish --remote exit\n"
4784 #: ../examples/guestfs-recipes.pod:179
4785 msgid "Get DHCP address from a VM"
4789 #: ../examples/guestfs-recipes.pod:181
4791 "The link below explains the many different possible techniques for getting "
4792 "the last assigned DHCP address of a virtual machine."
4796 #: ../examples/guestfs-recipes.pod:184
4797 msgid "https://rwmj.wordpress.com/2011/03/31/tip-code-for-getting-dhcp-address-from-a-virtual-machine-disk-image/#content"
4801 #: ../examples/guestfs-recipes.pod:186
4803 "In the libguestfs source examples directory you will find the latest version "
4804 "of the C<virt-dhcp-address.c> program."
4808 #: ../examples/guestfs-recipes.pod:189
4809 msgid "Get the operating system product name string"
4813 #: ../examples/guestfs-recipes.pod:191
4814 msgid "Save the following script into a file called C<product-name.sh>:"
4818 #: ../examples/guestfs-recipes.pod:193
4823 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4824 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4825 " guestfish --remote inspect-get-product-name \"$root\"\n"
4826 " guestfish --remote exit\n"
4831 #: ../examples/guestfs-recipes.pod:200
4832 msgid "Make the script executable and run it on a named guest:"
4836 #: ../examples/guestfs-recipes.pod:202
4839 " # product-name.sh RHEL60x64\n"
4840 " Red Hat Enterprise Linux Server release 6.0 (Santiago)\n"
4845 #: ../examples/guestfs-recipes.pod:205
4847 "You can also use an XPath query on the L<virt-inspector(1)> XML using the "
4848 "C<xpath> command line tool or from your favourite programming language:"
4852 #: ../examples/guestfs-recipes.pod:209
4855 " # virt-inspector RHEL60x64 > xml\n"
4856 " # xpath '//product_name' < xml\n"
4859 " <product_name>Red Hat Enterprise Linux Server release 6.0 "
4860 "(Santiago)</product_name>\n"
4865 #: ../examples/guestfs-recipes.pod:215
4866 msgid "Get the default boot kernel for a Linux VM"
4870 #: ../examples/guestfs-recipes.pod:217
4872 "The link below contains a program to print the default boot kernel for a "
4877 #: ../examples/guestfs-recipes.pod:220
4878 msgid "https://rwmj.wordpress.com/2010/10/30/tip-use-augeas-to-get-the-default-boot-kernel-for-a-vm/#content"
4882 #: ../examples/guestfs-recipes.pod:222
4884 "It uses Augeas, and the technique is generally applicable for many different "
4889 #: ../examples/guestfs-recipes.pod:229
4890 msgid "listing the user accounts in the guest"
4894 #: ../examples/guestfs-recipes.pod:233
4895 msgid "what repositories is it configured to use"
4899 #: ../examples/guestfs-recipes.pod:237
4900 msgid "what NTP servers does it connect to"
4904 #: ../examples/guestfs-recipes.pod:241
4905 msgid "what were the boot messages last time it booted"
4909 #: ../examples/guestfs-recipes.pod:245
4910 msgid "listing who was logged in recently"
4914 #: ../examples/guestfs-recipes.pod:249
4915 msgid "http://augeas.net/"
4919 #: ../examples/guestfs-recipes.pod:251
4920 msgid "Install RPMs in a guest"
4924 #: ../examples/guestfs-recipes.pod:253
4926 "The link below contains a method to install RPMs in a guest. In fact the "
4927 "RPMs are just uploaded to the guest along with a \"firstboot\" script that "
4928 "installs them next time the guest is booted. You could use this technique "
4929 "to install vital security updates in an offline guest."
4933 #: ../examples/guestfs-recipes.pod:259
4934 msgid "https://rwmj.wordpress.com/2010/12/01/tip-install-rpms-in-a-guest/#content"
4938 #: ../examples/guestfs-recipes.pod:261
4939 msgid "List applications installed in a VM"
4943 #: ../examples/guestfs-recipes.pod:263
4944 msgid "Save the following to a file C<list-apps.sh>:"
4948 #: ../examples/guestfs-recipes.pod:265
4953 " eval \"$(guestfish --ro -d \"$1\" --i --listen)\"\n"
4954 " root=\"$(guestfish --remote inspect-get-roots)\"\n"
4955 " guestfish --remote inspect-list-applications \"$root\"\n"
4956 " guestfish --remote exit\n"
4961 #: ../examples/guestfs-recipes.pod:272
4963 "Make the file executable and then you can run it on any named virtual "
4968 #: ../examples/guestfs-recipes.pod:275
4971 " # list-apps.sh WinGuest\n"
4973 " app_name: Mozilla Firefox (3.6.12)\n"
4974 " app_display_name: Mozilla Firefox (3.6.12)\n"
4976 " app_version: 3.6.12 (en-GB)\n"
4978 " app_install_path: C:\\Program Files\\Mozilla Firefox\n"
4979 " app_trans_path:\n"
4980 " app_publisher: Mozilla\n"
4981 " app_url: http://www.mozilla.com/en-GB/\n"
4982 " app_source_package:\n"
4984 " app_description: Mozilla Firefox\n"
4987 " app_name: VLC media player\n"
4988 " app_display_name: VLC media player 1.1.5\n"
4990 " app_version: 1.1.5\n"
4992 " app_install_path: C:\\Program Files\\VideoLAN\\VLC\n"
4993 " app_trans_path:\n"
4994 " app_publisher: VideoLAN\n"
4995 " app_url: http://www.videolan.org/\n"
4996 " app_source_package:\n"
4998 " app_description:\n"
5004 #: ../examples/guestfs-recipes.pod:305
5006 "If you want to run the script on disk images (instead of libvirt virtual "
5007 "machines), change C<-d \"$1\"> to C<-a \"$1\">. See also "
5008 "L<virt-inspector(1)>."
5012 #: ../examples/guestfs-recipes.pod:309
5013 msgid "List files and directories in a VM"
5017 #: ../examples/guestfs-recipes.pod:311
5018 msgid "This involves using the L<guestfish(1)> C<find0> command like this:"
5022 #: ../examples/guestfs-recipes.pod:313
5025 " guestfish --ro -d Guest -i find0 / - | tr '\\0' '\\n' | sort\n"
5030 #: ../examples/guestfs-recipes.pod:315
5031 msgid "List services in a Windows VM"
5035 #: ../examples/guestfs-recipes.pod:317
5037 "The link below contains a script that can be used to list out the services "
5038 "from a Windows VM, and whether those services run at boot time or are loaded "
5043 #: ../examples/guestfs-recipes.pod:321
5044 msgid "https://rwmj.wordpress.com/2010/12/10/tip-list-services-in-a-windows-guest/#content"
5048 #: ../examples/guestfs-recipes.pod:323
5049 msgid "Make a disk image sparse"
5053 #: ../examples/guestfs-recipes.pod:325
5055 "The link below contains some guides for making a disk image sparse (or "
5056 "reintroducing sparseness)."
5060 #: ../examples/guestfs-recipes.pod:328
5061 msgid "https://rwmj.wordpress.com/2010/10/19/tip-making-a-disk-image-sparse/#content"
5065 #: ../examples/guestfs-recipes.pod:330
5066 msgid "Monitor disk usage over time"
5070 #: ../examples/guestfs-recipes.pod:332
5072 "You can use L<virt-df(1)> to monitor disk usage of your guests over time. "
5073 "The link below contains a guide."
5077 #: ../examples/guestfs-recipes.pod:335
5078 msgid "http://virt-tools.org/learning/advanced-virt-df/"
5082 #: ../examples/guestfs-recipes.pod:337
5083 msgid "Reading the Windows Event Log from Windows Vista (or later)"
5087 #: ../examples/guestfs-recipes.pod:339
5089 "L<guestfish(1)> plus the tools described in the link below can be used to "
5090 "read out the Windows Event Log from any virtual machine running Windows "
5091 "Vista or a later version."
5095 #: ../examples/guestfs-recipes.pod:343
5096 msgid "https://rwmj.wordpress.com/2011/04/17/decoding-the-windows-event-log-using-guestfish/#content"
5100 #: ../examples/guestfs-recipes.pod:345
5101 msgid "Remove root password (Linux)"
5105 #: ../examples/guestfs-recipes.pod:347
5107 "Using the L<virt-edit(1)> I<-e> option you can do simple replacements on "
5108 "files. One use is to remove the root password from a Linux guest:"
5112 #: ../examples/guestfs-recipes.pod:350
5115 " virt-edit domname /etc/passwd -e 's/^root:.*?:/root::/'\n"
5120 #: ../examples/guestfs-recipes.pod:352
5121 msgid "Remove Administrator password (Windows)"
5125 #: ../examples/guestfs-recipes.pod:354
5127 "The link below contains one technique for removing the Administrator "
5128 "password from a Windows VM, or to be more precise, it gives you a command "
5129 "prompt the next time you log in which you can use to bypass any security:"
5133 #: ../examples/guestfs-recipes.pod:359
5134 msgid "https://mdbooth.wordpress.com/2010/10/18/resetting-a-windows-guests-administrator-password-with-guestfish/"
5138 #: ../examples/guestfs-recipes.pod:361
5139 msgid "Unpack a live CD"
5143 #: ../examples/guestfs-recipes.pod:363
5145 "Linux live CDs often contain multiple layers of disk images wrapped like a "
5146 "Russian doll. You can use L<guestfish(1)> to look inside these multiple "
5147 "layers, as outlined in the guide below."
5151 #: ../examples/guestfs-recipes.pod:367
5152 msgid "https://rwmj.wordpress.com/2009/07/15/unpack-the-russian-doll-of-a-f11-live-cd/#content"
5156 #: ../examples/guestfs-recipes.pod:369
5157 msgid "Uploading and downloading files"
5161 #: ../examples/guestfs-recipes.pod:371
5163 "The link below contains general tips on uploading (copying in) and "
5164 "downloading (copying out) files from VMs."
5168 #: ../examples/guestfs-recipes.pod:374
5169 msgid "https://rwmj.wordpress.com/2010/12/02/tip-uploading-and-downloading/#content"
5173 #: ../examples/guestfs-recipes.pod:376
5174 msgid "Use libguestfs tools on VMware ESX guests"
5178 #: ../examples/guestfs-recipes.pod:378
5180 "The link below explains how to use libguestfs, L<guestfish(1)> and the virt "
5181 "tools on any VMware ESX guests, by first sharing the VMware VMFS over sshfs."
5185 #: ../examples/guestfs-recipes.pod:382
5186 msgid "https://rwmj.wordpress.com/2011/05/10/tip-use-libguestfs-on-vmware-esx-guests/#content"
5190 #: ../examples/guestfs-recipes.pod:386
5192 "L<guestfs(3)>, L<guestfish(1)>, L<guestfs-examples(3)>, "
5193 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
5194 "L<guestfs-perl(3)>, L<guestfs-python(3)>, L<guestfs-ruby(3)>, "
5195 "L<http://libguestfs.org/>."
5199 #: ../examples/guestfs-recipes.pod:403
5200 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
5204 #: ../fish/guestfish-actions.pod:1
5209 #: ../fish/guestfish-actions.pod:3
5212 " add-cdrom filename\n"
5217 #: ../fish/guestfish-actions.pod:5 ../src/guestfs-actions.pod:14
5218 msgid "This function adds a virtual CD-ROM disk image to the guest."
5222 #: ../fish/guestfish-actions.pod:7 ../src/guestfs-actions.pod:16
5223 msgid "This is equivalent to the qemu parameter I<-cdrom filename>."
5227 #: ../fish/guestfish-actions.pod:15
5229 "This call checks for the existence of C<filename>. This stops you from "
5230 "specifying other types of drive which are supported by qemu such as C<nbd:> "
5231 "and C<http:> URLs. To specify those, use the general L</config> call "
5236 #: ../fish/guestfish-actions.pod:22
5238 "If you just want to add an ISO file (often you use this as an efficient way "
5239 "to transfer large files into the guest), then you should probably use "
5240 "L</add-drive-ro> instead."
5244 #: ../fish/guestfish-actions.pod:28 ../fish/guestfish-actions.pod:168 ../fish/guestfish-actions.pod:182
5246 "I<This function is deprecated.> In new code, use the L</add_drive_opts> call "
5251 #: ../fish/guestfish-actions.pod:31 ../fish/guestfish-actions.pod:171 ../fish/guestfish-actions.pod:185 ../fish/guestfish-actions.pod:1031 ../fish/guestfish-actions.pod:1391 ../fish/guestfish-actions.pod:1405 ../fish/guestfish-actions.pod:3175 ../fish/guestfish-actions.pod:3486 ../fish/guestfish-actions.pod:3534 ../fish/guestfish-actions.pod:4447 ../fish/guestfish-actions.pod:4470 ../fish/guestfish-actions.pod:4492 ../fish/guestfish-actions.pod:4530 ../fish/guestfish-actions.pod:5179 ../fish/guestfish-actions.pod:5285 ../src/guestfs-actions.pod:10 ../src/guestfs-actions.pod:258 ../src/guestfs-actions.pod:279 ../src/guestfs-actions.pod:1625 ../src/guestfs-actions.pod:2124 ../src/guestfs-actions.pod:2145 ../src/guestfs-actions.pod:4790 ../src/guestfs-actions.pod:5312 ../src/guestfs-actions.pod:5412 ../src/guestfs-actions.pod:6694 ../src/guestfs-actions.pod:6738 ../src/guestfs-actions.pod:6772 ../src/guestfs-actions.pod:6835 ../src/guestfs-actions.pod:7767 ../src/guestfs-actions.pod:7876 ../src/guestfs-actions.pod:8059
5253 "Deprecated functions will not be removed from the API, but the fact that "
5254 "they are deprecated indicates that there are problems with correct use of "
5259 #: ../fish/guestfish-actions.pod:35
5264 #: ../fish/guestfish-actions.pod:37
5269 #: ../fish/guestfish-actions.pod:39
5272 " add-domain dom [libvirturi:..] [readonly:..] [iface:..] [live:..] "
5278 #: ../fish/guestfish-actions.pod:41
5280 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
5281 "It works by connecting to libvirt, requesting the domain and domain XML from "
5282 "libvirt, parsing it for disks, and calling L</add-drive-opts> on each one."
5286 #: ../fish/guestfish-actions.pod:46 ../src/guestfs-actions.pod:64
5288 "The number of disks added is returned. This operation is atomic: if an "
5289 "error is returned, then no disks are added."
5293 #: ../fish/guestfish-actions.pod:49 ../src/guestfs-actions.pod:67
5295 "This function does some minimal checks to make sure the libvirt domain is "
5296 "not running (unless C<readonly> is true). In a future version we will try "
5297 "to acquire the libvirt lock on each disk."
5301 #: ../fish/guestfish-actions.pod:53 ../src/guestfs-actions.pod:71
5303 "Disks must be accessible locally. This often means that adding disks from a "
5304 "remote libvirt connection (see L<http://libvirt.org/remote.html>) will fail "
5305 "unless those disks are accessible via the same device path locally too."
5309 #: ../fish/guestfish-actions.pod:58 ../src/guestfs-actions.pod:76
5311 "The optional C<libvirturi> parameter sets the libvirt URI (see "
5312 "L<http://libvirt.org/uri.html>). If this is not set then we connect to the "
5313 "default libvirt URI (or one set through an environment variable, see the "
5314 "libvirt documentation for full details)."
5318 #: ../fish/guestfish-actions.pod:64 ../src/guestfs-actions.pod:82
5320 "The optional C<live> flag controls whether this call will try to connect to "
5321 "a running virtual machine C<guestfsd> process if it sees a suitable "
5322 "E<lt>channelE<gt> element in the libvirt XML definition. The default (if "
5323 "the flag is omitted) is never to try. See L<guestfs(3)/ATTACHING TO RUNNING "
5324 "DAEMONS> for more information."
5328 #: ../fish/guestfish-actions.pod:71 ../src/guestfs-actions.pod:89
5330 "If the C<allowuuid> flag is true (default is false) then a UUID I<may> be "
5331 "passed instead of the domain name. The C<dom> string is treated as a UUID "
5332 "first and looked up, and if that lookup fails then we treat C<dom> as a name "
5337 #: ../fish/guestfish-actions.pod:76
5339 "The other optional parameters are passed directly through to "
5340 "L</add-drive-opts>."
5344 #: ../fish/guestfish-actions.pod:79 ../fish/guestfish-actions.pod:148 ../fish/guestfish-actions.pod:578 ../fish/guestfish-actions.pod:789 ../fish/guestfish-actions.pod:810 ../fish/guestfish-actions.pod:2053 ../fish/guestfish-actions.pod:3224 ../fish/guestfish-actions.pod:3387 ../fish/guestfish-actions.pod:3522
5346 "This command has one or more optional arguments. See L</OPTIONAL "
5351 #: ../fish/guestfish-actions.pod:81
5356 #: ../fish/guestfish-actions.pod:83
5359 " add-drive filename\n"
5364 #: ../fish/guestfish-actions.pod:85
5366 "This function is the equivalent of calling L</add-drive-opts> with no "
5367 "optional parameters, so the disk is added writable, with the format being "
5368 "detected automatically."
5372 #: ../fish/guestfish-actions.pod:89
5374 "Automatic detection of the format opens you up to a potential security hole "
5375 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5376 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
5377 "you should think about replacing calls to this function with calls to "
5378 "L</add-drive-opts>, and specifying the format."
5382 #: ../fish/guestfish-actions.pod:96
5383 msgid "add-drive-opts"
5387 #: ../fish/guestfish-actions.pod:98
5392 #: ../fish/guestfish-actions.pod:100
5395 " add-drive-opts filename [readonly:..] [format:..] [iface:..] [name:..]\n"
5400 #: ../fish/guestfish-actions.pod:102 ../src/guestfs-actions.pod:161
5402 "This function adds a virtual machine disk image C<filename> to libguestfs. "
5403 "The first time you call this function, the disk appears as C</dev/sda>, the "
5404 "second time as C</dev/sdb>, and so on."
5408 #: ../fish/guestfish-actions.pod:107 ../src/guestfs-actions.pod:166
5410 "You don't necessarily need to be root when using libguestfs. However you "
5411 "obviously do need sufficient permissions to access the filename for whatever "
5412 "operations you want to perform (ie. read access if you just want to read the "
5413 "image or write access if you want to modify the image)."
5417 #: ../fish/guestfish-actions.pod:113 ../src/guestfs-actions.pod:172
5418 msgid "This call checks that C<filename> exists."
5422 #: ../fish/guestfish-actions.pod:115 ../fish/guestfish-actions.pod:3186 ../src/guestfs-actions.pod:174 ../src/guestfs-actions.pod:4827
5423 msgid "The optional arguments are:"
5427 #: ../fish/guestfish-actions.pod:119 ../src/guestfs-actions.pod:178
5432 #: ../fish/guestfish-actions.pod:121 ../src/guestfs-actions.pod:180
5434 "If true then the image is treated as read-only. Writes are still allowed, "
5435 "but they are stored in a temporary snapshot overlay which is discarded at "
5436 "the end. The disk that you add is not modified."
5440 #: ../fish/guestfish-actions.pod:125 ../src/guestfs-actions.pod:184
5445 #: ../fish/guestfish-actions.pod:127
5447 "This forces the image format. If you omit this (or use L</add-drive> or "
5448 "L</add-drive-ro>) then the format is automatically detected. Possible "
5449 "formats include C<raw> and C<qcow2>."
5453 #: ../fish/guestfish-actions.pod:131 ../src/guestfs-actions.pod:190
5455 "Automatic detection of the format opens you up to a potential security hole "
5456 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
5457 "RHBZ#642934. Specifying the format closes this security hole."
5461 #: ../fish/guestfish-actions.pod:136 ../src/guestfs-actions.pod:195
5466 #: ../fish/guestfish-actions.pod:138
5468 "This rarely-used option lets you emulate the behaviour of the deprecated "
5469 "L</add-drive-with-if> call (q.v.)"
5473 #: ../fish/guestfish-actions.pod:141 ../src/guestfs-actions.pod:200
5478 #: ../fish/guestfish-actions.pod:143 ../src/guestfs-actions.pod:202
5480 "The name the drive had in the original guest, e.g. /dev/sdb. This is used as "
5481 "a hint to the guest inspection process if it is available."
5485 #: ../fish/guestfish-actions.pod:150
5486 msgid "add-drive-ro"
5490 #: ../fish/guestfish-actions.pod:152
5495 #: ../fish/guestfish-actions.pod:154
5498 " add-drive-ro filename\n"
5503 #: ../fish/guestfish-actions.pod:156
5505 "This function is the equivalent of calling L</add-drive-opts> with the "
5506 "optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the disk "
5507 "is added read-only, with the format being detected automatically."
5511 #: ../fish/guestfish-actions.pod:161
5512 msgid "add-drive-ro-with-if"
5516 #: ../fish/guestfish-actions.pod:163
5519 " add-drive-ro-with-if filename iface\n"
5524 #: ../fish/guestfish-actions.pod:165
5526 "This is the same as L</add-drive-ro> but it allows you to specify the QEMU "
5527 "interface emulation to use at run time."
5531 #: ../fish/guestfish-actions.pod:175
5532 msgid "add-drive-with-if"
5536 #: ../fish/guestfish-actions.pod:177
5539 " add-drive-with-if filename iface\n"
5544 #: ../fish/guestfish-actions.pod:179
5546 "This is the same as L</add-drive> but it allows you to specify the QEMU "
5547 "interface emulation to use at run time."
5551 #: ../fish/guestfish-actions.pod:189
5556 #: ../fish/guestfish-actions.pod:191
5559 " aug-clear augpath\n"
5564 #: ../fish/guestfish-actions.pod:193 ../src/guestfs-actions.pod:296
5566 "Set the value associated with C<path> to C<NULL>. This is the same as the "
5567 "L<augtool(1)> C<clear> command."
5571 #: ../fish/guestfish-actions.pod:196
5576 #: ../fish/guestfish-actions.pod:198
5584 #: ../fish/guestfish-actions.pod:200
5586 "Close the current Augeas handle and free up any resources used by it. After "
5587 "calling this, you have to call L</aug-init> again before you can use any "
5588 "other Augeas functions."
5592 #: ../fish/guestfish-actions.pod:205
5597 #: ../fish/guestfish-actions.pod:207
5600 " aug-defnode name expr val\n"
5605 #: ../fish/guestfish-actions.pod:209 ../src/guestfs-actions.pod:325
5606 msgid "Defines a variable C<name> whose value is the result of evaluating C<expr>."
5610 #: ../fish/guestfish-actions.pod:212
5612 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
5613 "calling L</aug-set> C<expr>, C<value>. C<name> will be the nodeset "
5614 "containing that single node."
5618 #: ../fish/guestfish-actions.pod:216 ../src/guestfs-actions.pod:332
5620 "On success this returns a pair containing the number of nodes in the "
5621 "nodeset, and a boolean flag if a node was created."
5625 #: ../fish/guestfish-actions.pod:220
5630 #: ../fish/guestfish-actions.pod:222
5633 " aug-defvar name expr\n"
5638 #: ../fish/guestfish-actions.pod:224 ../src/guestfs-actions.pod:349
5640 "Defines an Augeas variable C<name> whose value is the result of evaluating "
5641 "C<expr>. If C<expr> is NULL, then C<name> is undefined."
5645 #: ../fish/guestfish-actions.pod:228 ../src/guestfs-actions.pod:353
5647 "On success this returns the number of nodes in C<expr>, or C<0> if C<expr> "
5648 "evaluates to something which is not a nodeset."
5652 #: ../fish/guestfish-actions.pod:231
5657 #: ../fish/guestfish-actions.pod:233
5660 " aug-get augpath\n"
5665 #: ../fish/guestfish-actions.pod:235 ../src/guestfs-actions.pod:366
5667 "Look up the value associated with C<path>. If C<path> matches exactly one "
5668 "node, the C<value> is returned."
5672 #: ../fish/guestfish-actions.pod:238
5677 #: ../fish/guestfish-actions.pod:240
5680 " aug-init root flags\n"
5685 #: ../fish/guestfish-actions.pod:242 ../src/guestfs-actions.pod:381
5687 "Create a new Augeas handle for editing configuration files. If there was "
5688 "any previous Augeas handle associated with this guestfs session, then it is "
5693 #: ../fish/guestfish-actions.pod:246
5694 msgid "You must call this before using any other L</aug-*> commands."
5698 #: ../fish/guestfish-actions.pod:249 ../src/guestfs-actions.pod:388
5699 msgid "C<root> is the filesystem root. C<root> must not be NULL, use C</> instead."
5703 #: ../fish/guestfish-actions.pod:252 ../src/guestfs-actions.pod:391
5705 "The flags are the same as the flags defined in E<lt>augeas.hE<gt>, the "
5706 "logical I<or> of the following integers:"
5710 #: ../fish/guestfish-actions.pod:258 ../src/guestfs-actions.pod:397
5711 msgid "C<AUG_SAVE_BACKUP> = 1"
5715 #: ../fish/guestfish-actions.pod:260 ../src/guestfs-actions.pod:399
5716 msgid "Keep the original file with a C<.augsave> extension."
5720 #: ../fish/guestfish-actions.pod:262 ../src/guestfs-actions.pod:401
5721 msgid "C<AUG_SAVE_NEWFILE> = 2"
5725 #: ../fish/guestfish-actions.pod:264 ../src/guestfs-actions.pod:403
5727 "Save changes into a file with extension C<.augnew>, and do not overwrite "
5728 "original. Overrides C<AUG_SAVE_BACKUP>."
5732 #: ../fish/guestfish-actions.pod:267 ../src/guestfs-actions.pod:406
5733 msgid "C<AUG_TYPE_CHECK> = 4"
5737 #: ../fish/guestfish-actions.pod:269 ../src/guestfs-actions.pod:408
5738 msgid "Typecheck lenses."
5742 #: ../fish/guestfish-actions.pod:271
5744 "This option is only useful when debugging Augeas lenses. Use of this option "
5745 "may require additional memory for the libguestfs appliance. You may need to "
5746 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call L</set-memsize>."
5750 #: ../fish/guestfish-actions.pod:276 ../src/guestfs-actions.pod:415
5751 msgid "C<AUG_NO_STDINC> = 8"
5755 #: ../fish/guestfish-actions.pod:278 ../src/guestfs-actions.pod:417
5756 msgid "Do not use standard load path for modules."
5760 #: ../fish/guestfish-actions.pod:280 ../src/guestfs-actions.pod:419
5761 msgid "C<AUG_SAVE_NOOP> = 16"
5765 #: ../fish/guestfish-actions.pod:282 ../src/guestfs-actions.pod:421
5766 msgid "Make save a no-op, just record what would have been changed."
5770 #: ../fish/guestfish-actions.pod:284 ../src/guestfs-actions.pod:423
5771 msgid "C<AUG_NO_LOAD> = 32"
5775 #: ../fish/guestfish-actions.pod:286
5776 msgid "Do not load the tree in L</aug-init>."
5780 #: ../fish/guestfish-actions.pod:290
5781 msgid "To close the handle, you can call L</aug-close>."
5785 #: ../fish/guestfish-actions.pod:292 ../src/guestfs-actions.pod:431
5786 msgid "To find out more about Augeas, see L<http://augeas.net/>."
5790 #: ../fish/guestfish-actions.pod:294
5795 #: ../fish/guestfish-actions.pod:296
5798 " aug-insert augpath label true|false\n"
5803 #: ../fish/guestfish-actions.pod:298 ../src/guestfs-actions.pod:445
5805 "Create a new sibling C<label> for C<path>, inserting it into the tree before "
5806 "or after C<path> (depending on the boolean flag C<before>)."
5810 #: ../fish/guestfish-actions.pod:302 ../src/guestfs-actions.pod:449
5812 "C<path> must match exactly one existing node in the tree, and C<label> must "
5813 "be a label, ie. not contain C</>, C<*> or end with a bracketed index C<[N]>."
5817 #: ../fish/guestfish-actions.pod:306
5822 #: ../fish/guestfish-actions.pod:308
5830 #: ../fish/guestfish-actions.pod:310 ../src/guestfs-actions.pod:462
5831 msgid "Load files into the tree."
5835 #: ../fish/guestfish-actions.pod:312 ../src/guestfs-actions.pod:464
5836 msgid "See C<aug_load> in the Augeas documentation for the full gory details."
5840 #: ../fish/guestfish-actions.pod:315
5845 #: ../fish/guestfish-actions.pod:317
5853 #: ../fish/guestfish-actions.pod:319
5855 "This is just a shortcut for listing L</aug-match> C<path/*> and sorting the "
5856 "resulting nodes into alphabetical order."
5860 #: ../fish/guestfish-actions.pod:322
5865 #: ../fish/guestfish-actions.pod:324
5868 " aug-match augpath\n"
5873 #: ../fish/guestfish-actions.pod:326 ../src/guestfs-actions.pod:492
5875 "Returns a list of paths which match the path expression C<path>. The "
5876 "returned paths are sufficiently qualified so that they match exactly one "
5877 "node in the current tree."
5881 #: ../fish/guestfish-actions.pod:330
5886 #: ../fish/guestfish-actions.pod:332
5889 " aug-mv src dest\n"
5894 #: ../fish/guestfish-actions.pod:334 ../src/guestfs-actions.pod:509
5896 "Move the node C<src> to C<dest>. C<src> must match exactly one node. "
5897 "C<dest> is overwritten if it exists."
5901 #: ../fish/guestfish-actions.pod:337
5906 #: ../fish/guestfish-actions.pod:339
5914 #: ../fish/guestfish-actions.pod:341 ../src/guestfs-actions.pod:522
5915 msgid "Remove C<path> and all of its children."
5919 #: ../fish/guestfish-actions.pod:343 ../src/guestfs-actions.pod:524
5920 msgid "On success this returns the number of entries which were removed."
5924 #: ../fish/guestfish-actions.pod:345
5929 #: ../fish/guestfish-actions.pod:347
5937 #: ../fish/guestfish-actions.pod:349 ../src/guestfs-actions.pod:535
5938 msgid "This writes all pending changes to disk."
5942 #: ../fish/guestfish-actions.pod:351
5944 "The flags which were passed to L</aug-init> affect exactly how files are "
5949 #: ../fish/guestfish-actions.pod:354
5954 #: ../fish/guestfish-actions.pod:356
5957 " aug-set augpath val\n"
5962 #: ../fish/guestfish-actions.pod:358 ../src/guestfs-actions.pod:551
5963 msgid "Set the value associated with C<path> to C<val>."
5967 #: ../fish/guestfish-actions.pod:360
5969 "In the Augeas API, it is possible to clear a node by setting the value to "
5970 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
5971 "this call. Instead you must use the L</aug-clear> call."
5975 #: ../fish/guestfish-actions.pod:365
5980 #: ../fish/guestfish-actions.pod:367
5983 " available 'groups ...'\n"
5988 #: ../fish/guestfish-actions.pod:369 ../src/guestfs-actions.pod:568
5990 "This command is used to check the availability of some groups of "
5991 "functionality in the appliance, which not all builds of the libguestfs "
5992 "appliance will be able to provide."
5996 #: ../fish/guestfish-actions.pod:373
5998 "The libguestfs groups, and the functions that those groups correspond to, "
5999 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
6000 "runtime by calling L</available-all-groups>."
6004 #: ../fish/guestfish-actions.pod:378 ../src/guestfs-actions.pod:577
6006 "The argument C<groups> is a list of group names, eg: C<[\"inotify\", "
6007 "\"augeas\"]> would check for the availability of the Linux inotify functions "
6008 "and Augeas (configuration file editing) functions."
6012 #: ../fish/guestfish-actions.pod:383 ../src/guestfs-actions.pod:582
6013 msgid "The command returns no error if I<all> requested groups are available."
6017 #: ../fish/guestfish-actions.pod:385 ../src/guestfs-actions.pod:584
6019 "It fails with an error if one or more of the requested groups is unavailable "
6024 #: ../fish/guestfish-actions.pod:388 ../src/guestfs-actions.pod:587
6026 "If an unknown group name is included in the list of groups then an error is "
6031 #: ../fish/guestfish-actions.pod:391 ../src/guestfs-actions.pod:590
6036 #: ../fish/guestfish-actions.pod:397
6037 msgid "You must call L</launch> before calling this function."
6041 #: ../fish/guestfish-actions.pod:399 ../src/guestfs-actions.pod:598
6043 "The reason is because we don't know what groups are supported by the "
6044 "appliance/daemon until it is running and can be queried."
6048 #: ../fish/guestfish-actions.pod:405 ../src/guestfs-actions.pod:604
6050 "If a group of functions is available, this does not necessarily mean that "
6051 "they will work. You still have to check for errors when calling individual "
6052 "API functions even if they are available."
6056 #: ../fish/guestfish-actions.pod:412 ../src/guestfs-actions.pod:611
6058 "It is usually the job of distro packagers to build complete functionality "
6059 "into the libguestfs appliance. Upstream libguestfs, if built from source "
6060 "with all requirements satisfied, will support everything."
6064 #: ../fish/guestfish-actions.pod:419
6066 "This call was added in version C<1.0.80>. In previous versions of "
6067 "libguestfs all you could do would be to speculatively execute a command to "
6068 "find out if the daemon implemented it. See also L</version>."
6072 #: ../fish/guestfish-actions.pod:426
6073 msgid "available-all-groups"
6077 #: ../fish/guestfish-actions.pod:428
6080 " available-all-groups\n"
6085 #: ../fish/guestfish-actions.pod:430
6087 "This command returns a list of all optional groups that this daemon knows "
6088 "about. Note this returns both supported and unsupported groups. To find "
6089 "out which ones the daemon can actually support you have to call "
6090 "L</available> on each member of the returned list."
6094 #: ../fish/guestfish-actions.pod:436
6095 msgid "See also L</available> and L<guestfs(3)/AVAILABILITY>."
6099 #: ../fish/guestfish-actions.pod:438
6104 #: ../fish/guestfish-actions.pod:440
6107 " base64-in (base64file|-) filename\n"
6112 #: ../fish/guestfish-actions.pod:442 ../src/guestfs-actions.pod:655
6113 msgid "This command uploads base64-encoded data from C<base64file> to C<filename>."
6117 #: ../fish/guestfish-actions.pod:445 ../fish/guestfish-actions.pod:454 ../fish/guestfish-actions.pod:703 ../fish/guestfish-actions.pod:787 ../fish/guestfish-actions.pod:808 ../fish/guestfish-actions.pod:907 ../fish/guestfish-actions.pod:926 ../fish/guestfish-actions.pod:1300 ../fish/guestfish-actions.pod:4750 ../fish/guestfish-actions.pod:4762 ../fish/guestfish-actions.pod:4773 ../fish/guestfish-actions.pod:4784 ../fish/guestfish-actions.pod:4836 ../fish/guestfish-actions.pod:4845 ../fish/guestfish-actions.pod:4899 ../fish/guestfish-actions.pod:4922
6118 msgid "Use C<-> instead of a filename to read/write from stdin/stdout."
6122 #: ../fish/guestfish-actions.pod:447
6127 #: ../fish/guestfish-actions.pod:449
6130 " base64-out filename (base64file|-)\n"
6135 #: ../fish/guestfish-actions.pod:451 ../src/guestfs-actions.pod:669
6137 "This command downloads the contents of C<filename>, writing it out to local "
6138 "file C<base64file> encoded as base64."
6142 #: ../fish/guestfish-actions.pod:456
6143 msgid "blockdev-flushbufs"
6147 #: ../fish/guestfish-actions.pod:458
6150 " blockdev-flushbufs device\n"
6155 #: ../fish/guestfish-actions.pod:460 ../src/guestfs-actions.pod:682
6156 msgid "This tells the kernel to flush internal buffers associated with C<device>."
6160 #: ../fish/guestfish-actions.pod:463 ../fish/guestfish-actions.pod:474 ../fish/guestfish-actions.pod:483 ../fish/guestfish-actions.pod:493 ../fish/guestfish-actions.pod:505 ../fish/guestfish-actions.pod:518 ../fish/guestfish-actions.pod:526 ../fish/guestfish-actions.pod:537 ../fish/guestfish-actions.pod:545 ../fish/guestfish-actions.pod:553 ../src/guestfs-actions.pod:685 ../src/guestfs-actions.pod:702 ../src/guestfs-actions.pod:717 ../src/guestfs-actions.pod:733 ../src/guestfs-actions.pod:751 ../src/guestfs-actions.pod:770 ../src/guestfs-actions.pod:784 ../src/guestfs-actions.pod:802 ../src/guestfs-actions.pod:816 ../src/guestfs-actions.pod:830
6161 msgid "This uses the L<blockdev(8)> command."
6165 #: ../fish/guestfish-actions.pod:465
6166 msgid "blockdev-getbsz"
6170 #: ../fish/guestfish-actions.pod:467
6173 " blockdev-getbsz device\n"
6178 #: ../fish/guestfish-actions.pod:469 ../src/guestfs-actions.pod:697
6179 msgid "This returns the block size of a device."
6183 #: ../fish/guestfish-actions.pod:471 ../fish/guestfish-actions.pod:534 ../src/guestfs-actions.pod:699 ../src/guestfs-actions.pod:799
6185 "(Note this is different from both I<size in blocks> and I<filesystem block "
6190 #: ../fish/guestfish-actions.pod:476
6191 msgid "blockdev-getro"
6195 #: ../fish/guestfish-actions.pod:478
6198 " blockdev-getro device\n"
6203 #: ../fish/guestfish-actions.pod:480 ../src/guestfs-actions.pod:714
6205 "Returns a boolean indicating if the block device is read-only (true if "
6206 "read-only, false if not)."
6210 #: ../fish/guestfish-actions.pod:485
6211 msgid "blockdev-getsize64"
6215 #: ../fish/guestfish-actions.pod:487
6218 " blockdev-getsize64 device\n"
6223 #: ../fish/guestfish-actions.pod:489 ../src/guestfs-actions.pod:729
6224 msgid "This returns the size of the device in bytes."
6228 #: ../fish/guestfish-actions.pod:491
6229 msgid "See also L</blockdev-getsz>."
6233 #: ../fish/guestfish-actions.pod:495
6234 msgid "blockdev-getss"
6238 #: ../fish/guestfish-actions.pod:497
6241 " blockdev-getss device\n"
6246 #: ../fish/guestfish-actions.pod:499 ../src/guestfs-actions.pod:745
6248 "This returns the size of sectors on a block device. Usually 512, but can be "
6249 "larger for modern devices."
6253 #: ../fish/guestfish-actions.pod:502
6254 msgid "(Note, this is not the size in sectors, use L</blockdev-getsz> for that)."
6258 #: ../fish/guestfish-actions.pod:507
6259 msgid "blockdev-getsz"
6263 #: ../fish/guestfish-actions.pod:509
6266 " blockdev-getsz device\n"
6271 #: ../fish/guestfish-actions.pod:511 ../src/guestfs-actions.pod:763
6273 "This returns the size of the device in units of 512-byte sectors (even if "
6274 "the sectorsize isn't 512 bytes ... weird)."
6278 #: ../fish/guestfish-actions.pod:514
6280 "See also L</blockdev-getss> for the real sector size of the device, and "
6281 "L</blockdev-getsize64> for the more useful I<size in bytes>."
6285 #: ../fish/guestfish-actions.pod:520
6286 msgid "blockdev-rereadpt"
6290 #: ../fish/guestfish-actions.pod:522
6293 " blockdev-rereadpt device\n"
6298 #: ../fish/guestfish-actions.pod:524 ../src/guestfs-actions.pod:782
6299 msgid "Reread the partition table on C<device>."
6303 #: ../fish/guestfish-actions.pod:528
6304 msgid "blockdev-setbsz"
6308 #: ../fish/guestfish-actions.pod:530
6311 " blockdev-setbsz device blocksize\n"
6316 #: ../fish/guestfish-actions.pod:532 ../src/guestfs-actions.pod:797
6317 msgid "This sets the block size of a device."
6321 #: ../fish/guestfish-actions.pod:539
6322 msgid "blockdev-setro"
6326 #: ../fish/guestfish-actions.pod:541
6329 " blockdev-setro device\n"
6334 #: ../fish/guestfish-actions.pod:543 ../src/guestfs-actions.pod:814
6335 msgid "Sets the block device named C<device> to read-only."
6339 #: ../fish/guestfish-actions.pod:547
6340 msgid "blockdev-setrw"
6344 #: ../fish/guestfish-actions.pod:549
6347 " blockdev-setrw device\n"
6352 #: ../fish/guestfish-actions.pod:551 ../src/guestfs-actions.pod:828
6353 msgid "Sets the block device named C<device> to read-write."
6357 #: ../fish/guestfish-actions.pod:555
6358 msgid "btrfs-filesystem-resize"
6362 #: ../fish/guestfish-actions.pod:557
6365 " btrfs-filesystem-resize mountpoint [size:..]\n"
6370 #: ../fish/guestfish-actions.pod:559 ../src/guestfs-actions.pod:850
6371 msgid "This command resizes a btrfs filesystem."
6375 #: ../fish/guestfish-actions.pod:561 ../src/guestfs-actions.pod:852
6377 "Note that unlike other resize calls, the filesystem has to be mounted and "
6378 "the parameter is the mountpoint not the device (this is a requirement of "
6383 #: ../fish/guestfish-actions.pod:565 ../fish/guestfish-actions.pod:3497 ../src/guestfs-actions.pod:856 ../src/guestfs-actions.pod:5351
6384 msgid "The optional parameters are:"
6388 #: ../fish/guestfish-actions.pod:569 ../fish/guestfish-actions.pod:3501 ../src/guestfs-actions.pod:860 ../src/guestfs-actions.pod:5355
6393 #: ../fish/guestfish-actions.pod:571 ../src/guestfs-actions.pod:862
6395 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
6396 "resized to the maximum size."
6400 #: ../fish/guestfish-actions.pod:576 ../src/guestfs-actions.pod:867
6401 msgid "See also L<btrfs(8)>."
6405 #: ../fish/guestfish-actions.pod:580
6406 msgid "case-sensitive-path"
6410 #: ../fish/guestfish-actions.pod:582
6413 " case-sensitive-path path\n"
6418 #: ../fish/guestfish-actions.pod:584 ../src/guestfs-actions.pod:901
6420 "This can be used to resolve case insensitive paths on a filesystem which is "
6421 "case sensitive. The use case is to resolve paths which you have read from "
6422 "Windows configuration files or the Windows Registry, to the true path."
6426 #: ../fish/guestfish-actions.pod:589 ../src/guestfs-actions.pod:906
6428 "The command handles a peculiarity of the Linux ntfs-3g filesystem driver "
6429 "(and probably others), which is that although the underlying filesystem is "
6430 "case-insensitive, the driver exports the filesystem to Linux as "
6435 #: ../fish/guestfish-actions.pod:594 ../src/guestfs-actions.pod:911
6437 "One consequence of this is that special directories such as C<c:\\windows> "
6438 "may appear as C</WINDOWS> or C</windows> (or other things) depending on the "
6439 "precise details of how they were created. In Windows itself this would not "
6444 #: ../fish/guestfish-actions.pod:600 ../src/guestfs-actions.pod:917
6446 "Bug or feature? You decide: "
6447 "L<http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1>"
6451 #: ../fish/guestfish-actions.pod:603 ../src/guestfs-actions.pod:920
6453 "This function resolves the true case of each element in the path and returns "
6454 "the case-sensitive path."
6458 #: ../fish/guestfish-actions.pod:606
6460 "Thus L</case-sensitive-path> (\"/Windows/System32\") might return "
6461 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
6462 "how the directories were originally created under Windows)."
6466 #: ../fish/guestfish-actions.pod:611 ../src/guestfs-actions.pod:928
6467 msgid "I<Note>: This function does not handle drive names, backslashes etc."
6471 #: ../fish/guestfish-actions.pod:614
6472 msgid "See also L</realpath>."
6476 #: ../fish/guestfish-actions.pod:616
6481 #: ../fish/guestfish-actions.pod:618
6489 #: ../fish/guestfish-actions.pod:620 ../fish/guestfish-actions.pod:3917 ../src/guestfs-actions.pod:944 ../src/guestfs-actions.pod:5994
6490 msgid "Return the contents of the file named C<path>."
6494 #: ../fish/guestfish-actions.pod:622
6496 "Note that this function cannot correctly handle binary files (specifically, "
6497 "files containing C<\\0> character which is treated as end of string). For "
6498 "those you need to use the L</read-file> or L</download> functions which have "
6499 "a more complex interface."
6503 #: ../fish/guestfish-actions.pod:627 ../fish/guestfish-actions.pod:762 ../fish/guestfish-actions.pod:774 ../fish/guestfish-actions.pod:985 ../fish/guestfish-actions.pod:995 ../fish/guestfish-actions.pod:1062 ../fish/guestfish-actions.pod:1072 ../fish/guestfish-actions.pod:1264 ../fish/guestfish-actions.pod:1577 ../fish/guestfish-actions.pod:1587 ../fish/guestfish-actions.pod:1637 ../fish/guestfish-actions.pod:1652 ../fish/guestfish-actions.pod:1662 ../fish/guestfish-actions.pod:1681 ../fish/guestfish-actions.pod:3787 ../fish/guestfish-actions.pod:3802 ../fish/guestfish-actions.pod:3878 ../fish/guestfish-actions.pod:3895 ../fish/guestfish-actions.pod:3910 ../fish/guestfish-actions.pod:4591 ../fish/guestfish-actions.pod:4637 ../fish/guestfish-actions.pod:4722 ../fish/guestfish-actions.pod:4737 ../fish/guestfish-actions.pod:5143 ../fish/guestfish-actions.pod:5155 ../fish/guestfish-actions.pod:5173 ../fish/guestfish-actions.pod:5190 ../fish/guestfish-actions.pod:5200 ../fish/guestfish-actions.pod:5257 ../fish/guestfish-actions.pod:5267 ../fish/guestfish-actions.pod:5296 ../fish/guestfish-actions.pod:5306 ../src/guestfs-actions.pod:954 ../src/guestfs-actions.pod:1133 ../src/guestfs-actions.pod:1153 ../src/guestfs-actions.pod:1560 ../src/guestfs-actions.pod:1579 ../src/guestfs-actions.pod:1682 ../src/guestfs-actions.pod:1701 ../src/guestfs-actions.pod:1947 ../src/guestfs-actions.pod:2429 ../src/guestfs-actions.pod:2448 ../src/guestfs-actions.pod:2513 ../src/guestfs-actions.pod:2537 ../src/guestfs-actions.pod:2554 ../src/guestfs-actions.pod:2583 ../src/guestfs-actions.pod:5776 ../src/guestfs-actions.pod:5802 ../src/guestfs-actions.pod:5933 ../src/guestfs-actions.pod:5959 ../src/guestfs-actions.pod:5983 ../src/guestfs-actions.pod:6950 ../src/guestfs-actions.pod:7005 ../src/guestfs-actions.pod:7151 ../src/guestfs-actions.pod:7175 ../src/guestfs-actions.pod:7840 ../src/guestfs-actions.pod:7860 ../src/guestfs-actions.pod:7893 ../src/guestfs-actions.pod:7912 ../src/guestfs-actions.pod:7931 ../src/guestfs-actions.pod:8025 ../src/guestfs-actions.pod:8044 ../src/guestfs-actions.pod:8090 ../src/guestfs-actions.pod:8109
6505 "Because of the message protocol, there is a transfer limit of somewhere "
6506 "between 2MB and 4MB. See L<guestfs(3)/PROTOCOL LIMITS>."
6510 #: ../fish/guestfish-actions.pod:630
6515 #: ../fish/guestfish-actions.pod:632
6518 " checksum csumtype path\n"
6523 #: ../fish/guestfish-actions.pod:634 ../src/guestfs-actions.pod:966
6524 msgid "This call computes the MD5, SHAx or CRC checksum of the file named C<path>."
6528 #: ../fish/guestfish-actions.pod:637 ../src/guestfs-actions.pod:969
6530 "The type of checksum to compute is given by the C<csumtype> parameter which "
6531 "must have one of the following values:"
6535 #: ../fish/guestfish-actions.pod:642 ../src/guestfs-actions.pod:974
6540 #: ../fish/guestfish-actions.pod:644 ../src/guestfs-actions.pod:976
6542 "Compute the cyclic redundancy check (CRC) specified by POSIX for the "
6547 #: ../fish/guestfish-actions.pod:647 ../src/guestfs-actions.pod:979
6552 #: ../fish/guestfish-actions.pod:649 ../src/guestfs-actions.pod:981
6553 msgid "Compute the MD5 hash (using the C<md5sum> program)."
6557 #: ../fish/guestfish-actions.pod:651 ../src/guestfs-actions.pod:983
6562 #: ../fish/guestfish-actions.pod:653 ../src/guestfs-actions.pod:985
6563 msgid "Compute the SHA1 hash (using the C<sha1sum> program)."
6567 #: ../fish/guestfish-actions.pod:655 ../src/guestfs-actions.pod:987
6572 #: ../fish/guestfish-actions.pod:657 ../src/guestfs-actions.pod:989
6573 msgid "Compute the SHA224 hash (using the C<sha224sum> program)."
6577 #: ../fish/guestfish-actions.pod:659 ../src/guestfs-actions.pod:991
6582 #: ../fish/guestfish-actions.pod:661 ../src/guestfs-actions.pod:993
6583 msgid "Compute the SHA256 hash (using the C<sha256sum> program)."
6587 #: ../fish/guestfish-actions.pod:663 ../src/guestfs-actions.pod:995
6592 #: ../fish/guestfish-actions.pod:665 ../src/guestfs-actions.pod:997
6593 msgid "Compute the SHA384 hash (using the C<sha384sum> program)."
6597 #: ../fish/guestfish-actions.pod:667 ../src/guestfs-actions.pod:999
6602 #: ../fish/guestfish-actions.pod:669 ../src/guestfs-actions.pod:1001
6603 msgid "Compute the SHA512 hash (using the C<sha512sum> program)."
6607 #: ../fish/guestfish-actions.pod:673 ../src/guestfs-actions.pod:1005
6608 msgid "The checksum is returned as a printable string."
6612 #: ../fish/guestfish-actions.pod:675
6613 msgid "To get the checksum for a device, use L</checksum-device>."
6617 #: ../fish/guestfish-actions.pod:677
6618 msgid "To get the checksums for many files, use L</checksums-out>."
6622 #: ../fish/guestfish-actions.pod:679
6623 msgid "checksum-device"
6627 #: ../fish/guestfish-actions.pod:681
6630 " checksum-device csumtype device\n"
6635 #: ../fish/guestfish-actions.pod:683
6637 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
6638 "device named C<device>. For the types of checksums supported see the "
6639 "L</checksum> command."
6643 #: ../fish/guestfish-actions.pod:687
6644 msgid "checksums-out"
6648 #: ../fish/guestfish-actions.pod:689
6651 " checksums-out csumtype directory (sumsfile|-)\n"
6656 #: ../fish/guestfish-actions.pod:691 ../src/guestfs-actions.pod:1040
6658 "This command computes the checksums of all regular files in C<directory> and "
6659 "then emits a list of those checksums to the local output file C<sumsfile>."
6663 #: ../fish/guestfish-actions.pod:695 ../src/guestfs-actions.pod:1044
6665 "This can be used for verifying the integrity of a virtual machine. However "
6666 "to be properly secure you should pay attention to the output of the checksum "
6667 "command (it uses the ones from GNU coreutils). In particular when the "
6668 "filename is not printable, coreutils uses a special backslash syntax. For "
6669 "more information, see the GNU coreutils info file."
6673 #: ../fish/guestfish-actions.pod:705
6678 #: ../fish/guestfish-actions.pod:707
6681 " chmod mode path\n"
6686 #: ../fish/guestfish-actions.pod:709 ../src/guestfs-actions.pod:1063
6688 "Change the mode (permissions) of C<path> to C<mode>. Only numeric modes are "
6693 #: ../fish/guestfish-actions.pod:712 ../src/guestfs-actions.pod:1066
6695 "I<Note>: When using this command from guestfish, C<mode> by default would be "
6696 "decimal, unless you prefix it with C<0> to get octal, ie. use C<0700> not "
6701 #: ../fish/guestfish-actions.pod:716 ../fish/guestfish-actions.pod:3150 ../fish/guestfish-actions.pod:3289 ../fish/guestfish-actions.pod:3299 ../fish/guestfish-actions.pod:3309 ../src/guestfs-actions.pod:1070 ../src/guestfs-actions.pod:4758 ../src/guestfs-actions.pod:4967 ../src/guestfs-actions.pod:4986 ../src/guestfs-actions.pod:5005
6702 msgid "The mode actually set is affected by the umask."
6706 #: ../fish/guestfish-actions.pod:718
6711 #: ../fish/guestfish-actions.pod:720
6714 " chown owner group path\n"
6719 #: ../fish/guestfish-actions.pod:722 ../src/guestfs-actions.pod:1084
6720 msgid "Change the file owner to C<owner> and group to C<group>."
6724 #: ../fish/guestfish-actions.pod:724 ../fish/guestfish-actions.pod:2585 ../src/guestfs-actions.pod:1086 ../src/guestfs-actions.pod:3829
6726 "Only numeric uid and gid are supported. If you want to use names, you will "
6727 "need to locate and parse the password file yourself (Augeas support makes "
6728 "this relatively easy)."
6732 #: ../fish/guestfish-actions.pod:728
6737 #: ../fish/guestfish-actions.pod:730
6740 " command 'arguments ...'\n"
6745 #: ../fish/guestfish-actions.pod:732 ../src/guestfs-actions.pod:1100
6747 "This call runs a command from the guest filesystem. The filesystem must be "
6748 "mounted, and must contain a compatible operating system (ie. something "
6749 "Linux, with the same or compatible processor architecture)."
6753 #: ../fish/guestfish-actions.pod:737
6755 "The single parameter is an argv-style list of arguments. The first element "
6756 "is the name of the program to run. Subsequent elements are parameters. The "
6757 "list must be non-empty (ie. must contain a program name). Note that the "
6758 "command runs directly, and is I<not> invoked via the shell (see L</sh>)."
6762 #: ../fish/guestfish-actions.pod:744 ../src/guestfs-actions.pod:1112
6763 msgid "The return value is anything printed to I<stdout> by the command."
6767 #: ../fish/guestfish-actions.pod:747 ../src/guestfs-actions.pod:1115
6769 "If the command returns a non-zero exit status, then this function returns an "
6770 "error message. The error message string is the content of I<stderr> from "
6775 #: ../fish/guestfish-actions.pod:751 ../src/guestfs-actions.pod:1119
6777 "The C<$PATH> environment variable will contain at least C</usr/bin> and "
6778 "C</bin>. If you require a program from another location, you should provide "
6779 "the full path in the first parameter."
6783 #: ../fish/guestfish-actions.pod:756 ../src/guestfs-actions.pod:1124
6785 "Shared libraries and data files required by the program must be available on "
6786 "filesystems which are mounted in the correct places. It is the caller's "
6787 "responsibility to ensure all filesystems that are needed are mounted at the "
6792 #: ../fish/guestfish-actions.pod:765
6793 msgid "command-lines"
6797 #: ../fish/guestfish-actions.pod:767
6800 " command-lines 'arguments ...'\n"
6805 #: ../fish/guestfish-actions.pod:769
6806 msgid "This is the same as L</command>, but splits the result into a list of lines."
6810 #: ../fish/guestfish-actions.pod:772
6811 msgid "See also: L</sh-lines>"
6815 #: ../fish/guestfish-actions.pod:777
6816 msgid "compress-device-out"
6820 #: ../fish/guestfish-actions.pod:779
6823 " compress-device-out ctype device (zdevice|-) [level:..]\n"
6828 #: ../fish/guestfish-actions.pod:781 ../src/guestfs-actions.pod:1174
6830 "This command compresses C<device> and writes it out to the local file "
6835 #: ../fish/guestfish-actions.pod:784
6837 "The C<ctype> and optional C<level> parameters have the same meaning as in "
6842 #: ../fish/guestfish-actions.pod:791
6843 msgid "compress-out"
6847 #: ../fish/guestfish-actions.pod:793
6850 " compress-out ctype file (zfile|-) [level:..]\n"
6855 #: ../fish/guestfish-actions.pod:795 ../src/guestfs-actions.pod:1226
6857 "This command compresses C<file> and writes it out to the local file "
6862 #: ../fish/guestfish-actions.pod:798 ../src/guestfs-actions.pod:1229
6864 "The compression program used is controlled by the C<ctype> parameter. "
6865 "Currently this includes: C<compress>, C<gzip>, C<bzip2>, C<xz> or C<lzop>. "
6866 "Some compression types may not be supported by particular builds of "
6867 "libguestfs, in which case you will get an error containing the substring "
6868 "\"not supported\"."
6872 #: ../fish/guestfish-actions.pod:804 ../src/guestfs-actions.pod:1235
6874 "The optional C<level> parameter controls compression level. The meaning and "
6875 "default for this parameter depends on the compression program being used."
6879 #: ../fish/guestfish-actions.pod:812
6884 #: ../fish/guestfish-actions.pod:814
6887 " config qemuparam qemuvalue\n"
6892 #: ../fish/guestfish-actions.pod:816 ../src/guestfs-actions.pod:1276
6894 "This can be used to add arbitrary qemu command line parameters of the form "
6895 "I<-param value>. Actually it's not quite arbitrary - we prevent you from "
6896 "setting some parameters which would interfere with parameters that we use."
6900 #: ../fish/guestfish-actions.pod:821 ../src/guestfs-actions.pod:1281
6901 msgid "The first character of C<param> string must be a C<-> (dash)."
6905 #: ../fish/guestfish-actions.pod:823 ../src/guestfs-actions.pod:1283
6906 msgid "C<value> can be NULL."
6910 #: ../fish/guestfish-actions.pod:825
6915 #: ../fish/guestfish-actions.pod:827
6918 " copy-size src dest size\n"
6923 #: ../fish/guestfish-actions.pod:829 ../src/guestfs-actions.pod:1297
6925 "This command copies exactly C<size> bytes from one source device or file "
6926 "C<src> to another destination device or file C<dest>."
6930 #: ../fish/guestfish-actions.pod:832 ../src/guestfs-actions.pod:1300
6932 "Note this will fail if the source is too short or if the destination is not "
6937 #: ../fish/guestfish-actions.pod:835
6942 #: ../fish/guestfish-actions.pod:837
6950 #: ../fish/guestfish-actions.pod:839 ../src/guestfs-actions.pod:1319
6952 "This copies a file from C<src> to C<dest> where C<dest> is either a "
6953 "destination filename or destination directory."
6957 #: ../fish/guestfish-actions.pod:842
6962 #: ../fish/guestfish-actions.pod:844
6970 #: ../fish/guestfish-actions.pod:846 ../src/guestfs-actions.pod:1333
6972 "This copies a file or directory from C<src> to C<dest> recursively using the "
6977 #: ../fish/guestfish-actions.pod:849
6982 #: ../fish/guestfish-actions.pod:851
6990 #: ../fish/guestfish-actions.pod:853 ../src/guestfs-actions.pod:1347
6992 "This command copies from one source device or file C<src> to another "
6993 "destination device or file C<dest>. Normally you would use this to copy to "
6994 "or from a device or partition, for example to duplicate a filesystem."
6998 #: ../fish/guestfish-actions.pod:858
7000 "If the destination is a device, it must be as large or larger than the "
7001 "source file or device, otherwise the copy will fail. This command cannot do "
7002 "partial copies (see L</copy-size>)."
7006 #: ../fish/guestfish-actions.pod:862
7011 #: ../fish/guestfish-actions.pod:864
7019 #: ../fish/guestfish-actions.pod:866 ../src/guestfs-actions.pod:1365
7020 msgid "This command runs the C<df> command to report disk space used."
7024 #: ../fish/guestfish-actions.pod:868 ../fish/guestfish-actions.pod:879
7026 "This command is mostly useful for interactive sessions. It is I<not> "
7027 "intended that you try to parse the output string. Use L</statvfs> from "
7032 #: ../fish/guestfish-actions.pod:872
7037 #: ../fish/guestfish-actions.pod:874
7045 #: ../fish/guestfish-actions.pod:876 ../src/guestfs-actions.pod:1381
7047 "This command runs the C<df -h> command to report disk space used in "
7048 "human-readable format."
7052 #: ../fish/guestfish-actions.pod:883
7057 #: ../fish/guestfish-actions.pod:885
7065 #: ../fish/guestfish-actions.pod:887 ../src/guestfs-actions.pod:1398
7067 "This returns the kernel messages (C<dmesg> output) from the guest kernel. "
7068 "This is sometimes useful for extended debugging of problems."
7072 #: ../fish/guestfish-actions.pod:891
7074 "Another way to get the same information is to enable verbose messages with "
7075 "L</set-verbose> or by setting the environment variable C<LIBGUESTFS_DEBUG=1> "
7076 "before running the program."
7080 #: ../fish/guestfish-actions.pod:896
7085 #: ../fish/guestfish-actions.pod:898
7088 " download remotefilename (filename|-)\n"
7093 #: ../fish/guestfish-actions.pod:900 ../fish/guestfish-actions.pod:913 ../src/guestfs-actions.pod:1419 ../src/guestfs-actions.pod:1444
7095 "Download file C<remotefilename> and save it as C<filename> on the local "
7100 #: ../fish/guestfish-actions.pod:903 ../fish/guestfish-actions.pod:4895 ../src/guestfs-actions.pod:1422 ../src/guestfs-actions.pod:7410
7101 msgid "C<filename> can also be a named pipe."
7105 #: ../fish/guestfish-actions.pod:905
7106 msgid "See also L</upload>, L</cat>."
7110 #: ../fish/guestfish-actions.pod:909
7111 msgid "download-offset"
7115 #: ../fish/guestfish-actions.pod:911
7118 " download-offset remotefilename (filename|-) offset size\n"
7123 #: ../fish/guestfish-actions.pod:916 ../src/guestfs-actions.pod:1447
7125 "C<remotefilename> is read for C<size> bytes starting at C<offset> (this "
7126 "region must be within the file or device)."
7130 #: ../fish/guestfish-actions.pod:919
7132 "Note that there is no limit on the amount of data that can be downloaded "
7133 "with this call, unlike with L</pread>, and this call always reads the full "
7134 "amount unless an error occurs."
7138 #: ../fish/guestfish-actions.pod:924
7139 msgid "See also L</download>, L</pread>."
7143 #: ../fish/guestfish-actions.pod:928
7148 #: ../fish/guestfish-actions.pod:930
7151 " drop-caches whattodrop\n"
7156 #: ../fish/guestfish-actions.pod:932 ../src/guestfs-actions.pod:1472
7158 "This instructs the guest kernel to drop its page cache, and/or dentries and "
7159 "inode caches. The parameter C<whattodrop> tells the kernel what precisely "
7160 "to drop, see L<http://linux-mm.org/Drop_Caches>"
7164 #: ../fish/guestfish-actions.pod:937 ../src/guestfs-actions.pod:1477
7165 msgid "Setting C<whattodrop> to 3 should drop everything."
7169 #: ../fish/guestfish-actions.pod:939 ../src/guestfs-actions.pod:1479
7171 "This automatically calls L<sync(2)> before the operation, so that the "
7172 "maximum guest memory is freed."
7176 #: ../fish/guestfish-actions.pod:942
7181 #: ../fish/guestfish-actions.pod:944
7189 #: ../fish/guestfish-actions.pod:946 ../src/guestfs-actions.pod:1492
7191 "This command runs the C<du -s> command to estimate file space usage for "
7196 #: ../fish/guestfish-actions.pod:949 ../src/guestfs-actions.pod:1495
7198 "C<path> can be a file or a directory. If C<path> is a directory then the "
7199 "estimate includes the contents of the directory and all subdirectories "
7204 #: ../fish/guestfish-actions.pod:953 ../src/guestfs-actions.pod:1499
7205 msgid "The result is the estimated size in I<kilobytes> (ie. units of 1024 bytes)."
7209 #: ../fish/guestfish-actions.pod:956
7214 #: ../fish/guestfish-actions.pod:958
7217 " e2fsck-f device\n"
7222 #: ../fish/guestfish-actions.pod:960 ../src/guestfs-actions.pod:1517
7224 "This runs C<e2fsck -p -f device>, ie. runs the ext2/ext3 filesystem checker "
7225 "on C<device>, noninteractively (I<-p>), even if the filesystem appears to be "
7230 #: ../fish/guestfish-actions.pod:964
7232 "This command is only needed because of L</resize2fs> (q.v.). Normally you "
7233 "should use L</fsck>."
7237 #: ../fish/guestfish-actions.pod:967
7242 #: ../fish/guestfish-actions.pod:969
7245 " echo-daemon 'words ...'\n"
7250 #: ../fish/guestfish-actions.pod:971 ../src/guestfs-actions.pod:1534
7252 "This command concatenates the list of C<words> passed with single spaces "
7253 "between them and returns the resulting string."
7257 #: ../fish/guestfish-actions.pod:974 ../src/guestfs-actions.pod:1537
7258 msgid "You can use this command to test the connection through to the daemon."
7262 #: ../fish/guestfish-actions.pod:976
7263 msgid "See also L</ping-daemon>."
7267 #: ../fish/guestfish-actions.pod:978
7272 #: ../fish/guestfish-actions.pod:980
7275 " egrep regex path\n"
7280 #: ../fish/guestfish-actions.pod:982 ../src/guestfs-actions.pod:1553
7281 msgid "This calls the external C<egrep> program and returns the matching lines."
7285 #: ../fish/guestfish-actions.pod:988
7290 #: ../fish/guestfish-actions.pod:990
7293 " egrepi regex path\n"
7298 #: ../fish/guestfish-actions.pod:992 ../src/guestfs-actions.pod:1572
7299 msgid "This calls the external C<egrep -i> program and returns the matching lines."
7303 #: ../fish/guestfish-actions.pod:998
7308 #: ../fish/guestfish-actions.pod:1000
7311 " equal file1 file2\n"
7316 #: ../fish/guestfish-actions.pod:1002 ../src/guestfs-actions.pod:1591
7318 "This compares the two files C<file1> and C<file2> and returns true if their "
7319 "content is exactly equal, or false otherwise."
7323 #: ../fish/guestfish-actions.pod:1005 ../src/guestfs-actions.pod:1594
7324 msgid "The external L<cmp(1)> program is used for the comparison."
7328 #: ../fish/guestfish-actions.pod:1007
7333 #: ../fish/guestfish-actions.pod:1009
7341 #: ../fish/guestfish-actions.pod:1011 ../src/guestfs-actions.pod:1606
7343 "This returns C<true> if and only if there is a file, directory (or anything) "
7344 "with the given C<path> name."
7348 #: ../fish/guestfish-actions.pod:1014
7349 msgid "See also L</is-file>, L</is-dir>, L</stat>."
7353 #: ../fish/guestfish-actions.pod:1016
7358 #: ../fish/guestfish-actions.pod:1018
7361 " fallocate path len\n"
7366 #: ../fish/guestfish-actions.pod:1020 ../fish/guestfish-actions.pod:1039 ../src/guestfs-actions.pod:1629 ../src/guestfs-actions.pod:1648
7368 "This command preallocates a file (containing zero bytes) named C<path> of "
7369 "size C<len> bytes. If the file exists already, it is overwritten."
7373 #: ../fish/guestfish-actions.pod:1024 ../src/guestfs-actions.pod:1633
7375 "Do not confuse this with the guestfish-specific C<alloc> command which "
7376 "allocates a file in the host and attaches it as a device."
7380 #: ../fish/guestfish-actions.pod:1028
7382 "I<This function is deprecated.> In new code, use the L</fallocate64> call "
7387 #: ../fish/guestfish-actions.pod:1035
7392 #: ../fish/guestfish-actions.pod:1037
7395 " fallocate64 path len\n"
7400 #: ../fish/guestfish-actions.pod:1043
7402 "Note that this call allocates disk blocks for the file. To create a sparse "
7403 "file use L</truncate-size> instead."
7407 #: ../fish/guestfish-actions.pod:1046
7409 "The deprecated call L</fallocate> does the same, but owing to an oversight "
7410 "it only allowed 30 bit lengths to be specified, effectively limiting the "
7411 "maximum size of files created through that call to 1GB."
7415 #: ../fish/guestfish-actions.pod:1051 ../src/guestfs-actions.pod:1660
7417 "Do not confuse this with the guestfish-specific C<alloc> and C<sparse> "
7418 "commands which create a file in the host and attach it as a device."
7422 #: ../fish/guestfish-actions.pod:1055
7427 #: ../fish/guestfish-actions.pod:1057
7430 " fgrep pattern path\n"
7435 #: ../fish/guestfish-actions.pod:1059 ../src/guestfs-actions.pod:1675
7436 msgid "This calls the external C<fgrep> program and returns the matching lines."
7440 #: ../fish/guestfish-actions.pod:1065
7445 #: ../fish/guestfish-actions.pod:1067
7448 " fgrepi pattern path\n"
7453 #: ../fish/guestfish-actions.pod:1069 ../src/guestfs-actions.pod:1694
7454 msgid "This calls the external C<fgrep -i> program and returns the matching lines."
7458 #: ../fish/guestfish-actions.pod:1075
7463 #: ../fish/guestfish-actions.pod:1077
7471 #: ../fish/guestfish-actions.pod:1079 ../src/guestfs-actions.pod:1712
7473 "This call uses the standard L<file(1)> command to determine the type or "
7474 "contents of the file."
7478 #: ../fish/guestfish-actions.pod:1082 ../src/guestfs-actions.pod:1715
7480 "This call will also transparently look inside various types of compressed "
7485 #: ../fish/guestfish-actions.pod:1085 ../src/guestfs-actions.pod:1718
7487 "The exact command which runs is C<file -zb path>. Note in particular that "
7488 "the filename is not prepended to the output (the I<-b> option)."
7492 #: ../fish/guestfish-actions.pod:1089 ../src/guestfs-actions.pod:1722
7494 "The output depends on the output of the underlying L<file(1)> command and it "
7495 "can change in future in ways beyond our control. In other words, the output "
7496 "is not guaranteed by the ABI."
7500 #: ../fish/guestfish-actions.pod:1093
7502 "See also: L<file(1)>, L</vfs-type>, L</lstat>, L</is-file>, L</is-blockdev> "
7503 "(etc), L</is-zero>."
7507 #: ../fish/guestfish-actions.pod:1096
7508 msgid "file-architecture"
7512 #: ../fish/guestfish-actions.pod:1098
7515 " file-architecture filename\n"
7520 #: ../fish/guestfish-actions.pod:1100 ../src/guestfs-actions.pod:1740
7522 "This detects the architecture of the binary C<filename>, and returns it if "
7527 #: ../fish/guestfish-actions.pod:1103 ../src/guestfs-actions.pod:1743
7528 msgid "Currently defined architectures are:"
7532 #: ../fish/guestfish-actions.pod:1107 ../src/guestfs-actions.pod:1747
7537 #: ../fish/guestfish-actions.pod:1109 ../src/guestfs-actions.pod:1749
7539 "This string is returned for all 32 bit i386, i486, i586, i686 binaries "
7540 "irrespective of the precise processor requirements of the binary."
7544 #: ../fish/guestfish-actions.pod:1112 ../src/guestfs-actions.pod:1752
7549 #: ../fish/guestfish-actions.pod:1114 ../src/guestfs-actions.pod:1754
7550 msgid "64 bit x86-64."
7554 #: ../fish/guestfish-actions.pod:1116 ../src/guestfs-actions.pod:1756
7559 #: ../fish/guestfish-actions.pod:1118 ../src/guestfs-actions.pod:1758
7560 msgid "32 bit SPARC."
7564 #: ../fish/guestfish-actions.pod:1120 ../src/guestfs-actions.pod:1760
7569 #: ../fish/guestfish-actions.pod:1122 ../src/guestfs-actions.pod:1762
7570 msgid "64 bit SPARC V9 and above."
7574 #: ../fish/guestfish-actions.pod:1124 ../src/guestfs-actions.pod:1764
7579 #: ../fish/guestfish-actions.pod:1126 ../src/guestfs-actions.pod:1766
7580 msgid "Intel Itanium."
7584 #: ../fish/guestfish-actions.pod:1128 ../src/guestfs-actions.pod:1768
7589 #: ../fish/guestfish-actions.pod:1130 ../src/guestfs-actions.pod:1770
7590 msgid "32 bit Power PC."
7594 #: ../fish/guestfish-actions.pod:1132 ../src/guestfs-actions.pod:1772
7599 #: ../fish/guestfish-actions.pod:1134 ../src/guestfs-actions.pod:1774
7600 msgid "64 bit Power PC."
7604 #: ../fish/guestfish-actions.pod:1138 ../src/guestfs-actions.pod:1778
7605 msgid "Libguestfs may return other architecture strings in future."
7609 #: ../fish/guestfish-actions.pod:1140 ../src/guestfs-actions.pod:1780
7610 msgid "The function works on at least the following types of files:"
7614 #: ../fish/guestfish-actions.pod:1146 ../src/guestfs-actions.pod:1786
7615 msgid "many types of Un*x and Linux binary"
7619 #: ../fish/guestfish-actions.pod:1150 ../src/guestfs-actions.pod:1790
7620 msgid "many types of Un*x and Linux shared library"
7624 #: ../fish/guestfish-actions.pod:1154 ../src/guestfs-actions.pod:1794
7625 msgid "Windows Win32 and Win64 binaries"
7629 #: ../fish/guestfish-actions.pod:1158 ../src/guestfs-actions.pod:1798
7630 msgid "Windows Win32 and Win64 DLLs"
7634 #: ../fish/guestfish-actions.pod:1160 ../src/guestfs-actions.pod:1800
7635 msgid "Win32 binaries and DLLs return C<i386>."
7639 #: ../fish/guestfish-actions.pod:1162 ../src/guestfs-actions.pod:1802
7640 msgid "Win64 binaries and DLLs return C<x86_64>."
7644 #: ../fish/guestfish-actions.pod:1166 ../src/guestfs-actions.pod:1806
7645 msgid "Linux kernel modules"
7649 #: ../fish/guestfish-actions.pod:1170 ../src/guestfs-actions.pod:1810
7650 msgid "Linux new-style initrd images"
7654 #: ../fish/guestfish-actions.pod:1174 ../src/guestfs-actions.pod:1814
7655 msgid "some non-x86 Linux vmlinuz kernels"
7659 #: ../fish/guestfish-actions.pod:1178 ../src/guestfs-actions.pod:1818
7660 msgid "What it can't do currently:"
7664 #: ../fish/guestfish-actions.pod:1184 ../src/guestfs-actions.pod:1824
7665 msgid "static libraries (libfoo.a)"
7669 #: ../fish/guestfish-actions.pod:1188 ../src/guestfs-actions.pod:1828
7670 msgid "Linux old-style initrd as compressed ext2 filesystem (RHEL 3)"
7674 #: ../fish/guestfish-actions.pod:1192 ../src/guestfs-actions.pod:1832
7675 msgid "x86 Linux vmlinuz kernels"
7679 #: ../fish/guestfish-actions.pod:1194 ../src/guestfs-actions.pod:1834
7681 "x86 vmlinuz images (bzImage format) consist of a mix of 16-, 32- and "
7682 "compressed code, and are horribly hard to unpack. If you want to find the "
7683 "architecture of a kernel, use the architecture of the associated initrd or "
7684 "kernel module(s) instead."
7688 #: ../fish/guestfish-actions.pod:1201
7693 #: ../fish/guestfish-actions.pod:1203
7701 #: ../fish/guestfish-actions.pod:1205 ../src/guestfs-actions.pod:1852
7702 msgid "This command returns the size of C<file> in bytes."
7706 #: ../fish/guestfish-actions.pod:1207
7708 "To get other stats about a file, use L</stat>, L</lstat>, L</is-dir>, "
7709 "L</is-file> etc. To get the size of block devices, use "
7710 "L</blockdev-getsize64>."
7714 #: ../fish/guestfish-actions.pod:1211
7719 #: ../fish/guestfish-actions.pod:1213
7722 " fill c len path\n"
7727 #: ../fish/guestfish-actions.pod:1215 ../src/guestfs-actions.pod:1870
7729 "This command creates a new file called C<path>. The initial content of the "
7730 "file is C<len> octets of C<c>, where C<c> must be a number in the range "
7735 #: ../fish/guestfish-actions.pod:1219
7737 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
7738 "L</truncate-size>. To create a file with a pattern of repeating bytes use "
7743 #: ../fish/guestfish-actions.pod:1224
7744 msgid "fill-pattern"
7748 #: ../fish/guestfish-actions.pod:1226
7751 " fill-pattern pattern len path\n"
7756 #: ../fish/guestfish-actions.pod:1228
7758 "This function is like L</fill> except that it creates a new file of length "
7759 "C<len> containing the repeating pattern of bytes in C<pattern>. The pattern "
7760 "is truncated if necessary to ensure the length of the file is exactly C<len> "
7765 #: ../fish/guestfish-actions.pod:1233
7770 #: ../fish/guestfish-actions.pod:1235
7778 #: ../fish/guestfish-actions.pod:1237 ../src/guestfs-actions.pod:1916
7780 "This command lists out all files and directories, recursively, starting at "
7781 "C<directory>. It is essentially equivalent to running the shell command "
7782 "C<find directory -print> but some post-processing happens on the output, "
7787 #: ../fish/guestfish-actions.pod:1242 ../src/guestfs-actions.pod:1921
7789 "This returns a list of strings I<without any prefix>. Thus if the directory "
7794 #: ../fish/guestfish-actions.pod:1245 ../src/guestfs-actions.pod:1924
7804 #: ../fish/guestfish-actions.pod:1249
7805 msgid "then the returned list from L</find> C</tmp> would be 4 elements:"
7809 #: ../fish/guestfish-actions.pod:1252 ../src/guestfs-actions.pod:1931
7820 #: ../fish/guestfish-actions.pod:1257 ../src/guestfs-actions.pod:1936
7821 msgid "If C<directory> is not a directory, then this command returns an error."
7825 #: ../fish/guestfish-actions.pod:1260 ../src/guestfs-actions.pod:1939
7826 msgid "The returned list is sorted."
7830 #: ../fish/guestfish-actions.pod:1262
7831 msgid "See also L</find0>."
7835 #: ../fish/guestfish-actions.pod:1267
7840 #: ../fish/guestfish-actions.pod:1269
7843 " find0 directory (files|-)\n"
7848 #: ../fish/guestfish-actions.pod:1271 ../src/guestfs-actions.pod:1959
7850 "This command lists out all files and directories, recursively, starting at "
7851 "C<directory>, placing the resulting list in the external file called "
7856 #: ../fish/guestfish-actions.pod:1275
7857 msgid "This command works the same way as L</find> with the following exceptions:"
7861 #: ../fish/guestfish-actions.pod:1282 ../src/guestfs-actions.pod:1970
7862 msgid "The resulting list is written to an external file."
7866 #: ../fish/guestfish-actions.pod:1286 ../src/guestfs-actions.pod:1974
7868 "Items (filenames) in the result are separated by C<\\0> characters. See "
7869 "L<find(1)> option I<-print0>."
7873 #: ../fish/guestfish-actions.pod:1291 ../src/guestfs-actions.pod:1979
7874 msgid "This command is not limited in the number of names that it can return."
7878 #: ../fish/guestfish-actions.pod:1296 ../src/guestfs-actions.pod:1984
7879 msgid "The result list is not sorted."
7883 #: ../fish/guestfish-actions.pod:1302
7884 msgid "findfs-label"
7888 #: ../fish/guestfish-actions.pod:1304
7891 " findfs-label label\n"
7896 #: ../fish/guestfish-actions.pod:1306 ../src/guestfs-actions.pod:1998
7898 "This command searches the filesystems and returns the one which has the "
7899 "given label. An error is returned if no such filesystem can be found."
7903 #: ../fish/guestfish-actions.pod:1310
7904 msgid "To find the label of a filesystem, use L</vfs-label>."
7908 #: ../fish/guestfish-actions.pod:1312
7913 #: ../fish/guestfish-actions.pod:1314
7916 " findfs-uuid uuid\n"
7921 #: ../fish/guestfish-actions.pod:1316 ../src/guestfs-actions.pod:2015
7923 "This command searches the filesystems and returns the one which has the "
7924 "given UUID. An error is returned if no such filesystem can be found."
7928 #: ../fish/guestfish-actions.pod:1320
7929 msgid "To find the UUID of a filesystem, use L</vfs-uuid>."
7933 #: ../fish/guestfish-actions.pod:1322
7938 #: ../fish/guestfish-actions.pod:1324
7941 " fsck fstype device\n"
7946 #: ../fish/guestfish-actions.pod:1326 ../src/guestfs-actions.pod:2033
7948 "This runs the filesystem checker (fsck) on C<device> which should have "
7949 "filesystem type C<fstype>."
7953 #: ../fish/guestfish-actions.pod:1329 ../src/guestfs-actions.pod:2036
7955 "The returned integer is the status. See L<fsck(8)> for the list of status "
7956 "codes from C<fsck>."
7960 #: ../fish/guestfish-actions.pod:1338 ../src/guestfs-actions.pod:2045
7961 msgid "Multiple status codes can be summed together."
7965 #: ../fish/guestfish-actions.pod:1342 ../src/guestfs-actions.pod:2049
7967 "A non-zero return code can mean \"success\", for example if errors have been "
7968 "corrected on the filesystem."
7972 #: ../fish/guestfish-actions.pod:1347 ../src/guestfs-actions.pod:2054
7973 msgid "Checking or repairing NTFS volumes is not supported (by linux-ntfs)."
7977 #: ../fish/guestfish-actions.pod:1352 ../src/guestfs-actions.pod:2059
7978 msgid "This command is entirely equivalent to running C<fsck -a -t fstype device>."
7982 #: ../fish/guestfish-actions.pod:1354
7987 #: ../fish/guestfish-actions.pod:1356
7995 #: ../fish/guestfish-actions.pod:1358 ../src/guestfs-actions.pod:2070
7997 "Return the additional kernel options which are added to the guest kernel "
8002 #: ../fish/guestfish-actions.pod:1361 ../src/guestfs-actions.pod:2073
8003 msgid "If C<NULL> then no options are added."
8007 #: ../fish/guestfish-actions.pod:1363
8008 msgid "get-attach-method"
8012 #: ../fish/guestfish-actions.pod:1365
8015 " get-attach-method\n"
8020 #: ../fish/guestfish-actions.pod:1367
8021 msgid "Return the current attach method. See L</set-attach-method>."
8025 #: ../fish/guestfish-actions.pod:1369
8026 msgid "get-autosync"
8030 #: ../fish/guestfish-actions.pod:1371
8038 #: ../fish/guestfish-actions.pod:1373 ../src/guestfs-actions.pod:2098
8039 msgid "Get the autosync flag."
8043 #: ../fish/guestfish-actions.pod:1375
8048 #: ../fish/guestfish-actions.pod:1377
8056 #: ../fish/guestfish-actions.pod:1379 ../src/guestfs-actions.pod:2109
8057 msgid "Return the direct appliance mode flag."
8061 #: ../fish/guestfish-actions.pod:1381
8066 #: ../fish/guestfish-actions.pod:1383
8069 " get-e2label device\n"
8074 #: ../fish/guestfish-actions.pod:1385 ../src/guestfs-actions.pod:2128
8075 msgid "This returns the ext2/3/4 filesystem label of the filesystem on C<device>."
8079 #: ../fish/guestfish-actions.pod:1388
8081 "I<This function is deprecated.> In new code, use the L</vfs_label> call "
8086 #: ../fish/guestfish-actions.pod:1395
8091 #: ../fish/guestfish-actions.pod:1397
8094 " get-e2uuid device\n"
8099 #: ../fish/guestfish-actions.pod:1399 ../src/guestfs-actions.pod:2149
8100 msgid "This returns the ext2/3/4 filesystem UUID of the filesystem on C<device>."
8104 #: ../fish/guestfish-actions.pod:1402
8106 "I<This function is deprecated.> In new code, use the L</vfs_uuid> call "
8111 #: ../fish/guestfish-actions.pod:1409
8116 #: ../fish/guestfish-actions.pod:1411
8124 #: ../fish/guestfish-actions.pod:1413 ../src/guestfs-actions.pod:2162
8125 msgid "This gets the memory size in megabytes allocated to the qemu subprocess."
8129 #: ../fish/guestfish-actions.pod:1416
8131 "If L</set-memsize> was not called on this handle, and if "
8132 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
8133 "value for memsize."
8137 #: ../fish/guestfish-actions.pod:1420 ../fish/guestfish-actions.pod:1477 ../fish/guestfish-actions.pod:4243 ../fish/guestfish-actions.pod:4345 ../src/guestfs-actions.pod:2169 ../src/guestfs-actions.pod:2261 ../src/guestfs-actions.pod:6455 ../src/guestfs-actions.pod:6581
8138 msgid "For more information on the architecture of libguestfs, see L<guestfs(3)>."
8142 #: ../fish/guestfish-actions.pod:1423
8147 #: ../fish/guestfish-actions.pod:1425
8155 #: ../fish/guestfish-actions.pod:1427 ../src/guestfs-actions.pod:2181
8156 msgid "This returns the enable network flag."
8160 #: ../fish/guestfish-actions.pod:1429
8165 #: ../fish/guestfish-actions.pod:1431
8173 #: ../fish/guestfish-actions.pod:1433 ../src/guestfs-actions.pod:2192
8174 msgid "Return the current search path."
8178 #: ../fish/guestfish-actions.pod:1435 ../src/guestfs-actions.pod:2194
8180 "This is always non-NULL. If it wasn't set already, then this will return "
8185 #: ../fish/guestfish-actions.pod:1438
8190 #: ../fish/guestfish-actions.pod:1440
8198 #: ../fish/guestfish-actions.pod:1442 ../src/guestfs-actions.pod:2207
8199 msgid "This returns the process group flag."
8203 #: ../fish/guestfish-actions.pod:1444
8208 #: ../fish/guestfish-actions.pod:1446
8213 #: ../fish/guestfish-actions.pod:1448
8221 #: ../fish/guestfish-actions.pod:1450 ../src/guestfs-actions.pod:2218
8223 "Return the process ID of the qemu subprocess. If there is no qemu "
8224 "subprocess, then this will return an error."
8228 #: ../fish/guestfish-actions.pod:1453 ../src/guestfs-actions.pod:2221
8229 msgid "This is an internal call used for debugging and testing."
8233 #: ../fish/guestfish-actions.pod:1455
8238 #: ../fish/guestfish-actions.pod:1457
8246 #: ../fish/guestfish-actions.pod:1459 ../src/guestfs-actions.pod:2232
8247 msgid "Return the current qemu binary."
8251 #: ../fish/guestfish-actions.pod:1461 ../src/guestfs-actions.pod:2234
8253 "This is always non-NULL. If it wasn't set already, then this will return "
8254 "the default qemu binary name."
8258 #: ../fish/guestfish-actions.pod:1464
8259 msgid "get-recovery-proc"
8263 #: ../fish/guestfish-actions.pod:1466
8266 " get-recovery-proc\n"
8271 #: ../fish/guestfish-actions.pod:1468 ../src/guestfs-actions.pod:2247
8272 msgid "Return the recovery process enabled flag."
8276 #: ../fish/guestfish-actions.pod:1470
8281 #: ../fish/guestfish-actions.pod:1472
8289 #: ../fish/guestfish-actions.pod:1474
8291 "This returns the current setting of the selinux flag which is passed to the "
8292 "appliance at boot time. See L</set-selinux>."
8296 #: ../fish/guestfish-actions.pod:1480
8301 #: ../fish/guestfish-actions.pod:1482
8309 #: ../fish/guestfish-actions.pod:1484 ../src/guestfs-actions.pod:2273
8310 msgid "This returns the number of virtual CPUs assigned to the appliance."
8314 #: ../fish/guestfish-actions.pod:1486
8319 #: ../fish/guestfish-actions.pod:1488
8327 #: ../fish/guestfish-actions.pod:1490 ../src/guestfs-actions.pod:2284
8329 "This returns the current state as an opaque integer. This is only useful "
8330 "for printing debug and internal error messages."
8334 #: ../fish/guestfish-actions.pod:1493 ../fish/guestfish-actions.pod:2452 ../fish/guestfish-actions.pod:2470 ../fish/guestfish-actions.pod:2508 ../fish/guestfish-actions.pod:2524 ../src/guestfs-actions.pod:2287 ../src/guestfs-actions.pod:3606 ../src/guestfs-actions.pod:3635 ../src/guestfs-actions.pod:3696 ../src/guestfs-actions.pod:3723
8335 msgid "For more information on states, see L<guestfs(3)>."
8339 #: ../fish/guestfish-actions.pod:1495
8344 #: ../fish/guestfish-actions.pod:1497
8352 #: ../fish/guestfish-actions.pod:1499 ../src/guestfs-actions.pod:2298
8353 msgid "Return the command trace flag."
8357 #: ../fish/guestfish-actions.pod:1501
8362 #: ../fish/guestfish-actions.pod:1503
8370 #: ../fish/guestfish-actions.pod:1505
8372 "Return the current umask. By default the umask is C<022> unless it has been "
8373 "set by calling L</umask>."
8377 #: ../fish/guestfish-actions.pod:1508
8382 #: ../fish/guestfish-actions.pod:1510
8390 #: ../fish/guestfish-actions.pod:1512 ../src/guestfs-actions.pod:2321
8391 msgid "This returns the verbose messages flag."
8395 #: ../fish/guestfish-actions.pod:1514
8400 #: ../fish/guestfish-actions.pod:1516
8408 #: ../fish/guestfish-actions.pod:1518 ../src/guestfs-actions.pod:2332
8409 msgid "This gets the SELinux security context of the daemon."
8413 #: ../fish/guestfish-actions.pod:1520
8414 msgid "See the documentation about SELINUX in L<guestfs(3)>, and L</setcon>"
8418 #: ../fish/guestfish-actions.pod:1523
8423 #: ../fish/guestfish-actions.pod:1525
8426 " getxattr path name\n"
8431 #: ../fish/guestfish-actions.pod:1527
8433 "Get a single extended attribute from file C<path> named C<name>. This call "
8434 "follows symlinks. If you want to lookup an extended attribute for the "
8435 "symlink itself, use L</lgetxattr>."
8439 #: ../fish/guestfish-actions.pod:1531 ../fish/guestfish-actions.pod:2597
8441 "Normally it is better to get all extended attributes from a file in one go "
8442 "by calling L</getxattrs>. However some Linux filesystem implementations are "
8443 "buggy and do not provide a way to list out attributes. For these "
8444 "filesystems (notably ntfs-3g) you have to know the names of the extended "
8445 "attributes you want in advance and call this function."
8449 #: ../fish/guestfish-actions.pod:1538 ../fish/guestfish-actions.pod:2604 ../src/guestfs-actions.pod:2361 ../src/guestfs-actions.pod:3856
8451 "Extended attribute values are blobs of binary data. If there is no extended "
8452 "attribute named C<name>, this returns an error."
8456 #: ../fish/guestfish-actions.pod:1541
8457 msgid "See also: L</getxattrs>, L</lgetxattr>, L<attr(5)>."
8461 #: ../fish/guestfish-actions.pod:1543
8466 #: ../fish/guestfish-actions.pod:1545
8474 #: ../fish/guestfish-actions.pod:1547 ../src/guestfs-actions.pod:2378
8475 msgid "This call lists the extended attributes of the file or directory C<path>."
8479 #: ../fish/guestfish-actions.pod:1550 ../src/guestfs-actions.pod:2381
8481 "At the system call level, this is a combination of the L<listxattr(2)> and "
8482 "L<getxattr(2)> calls."
8486 #: ../fish/guestfish-actions.pod:1553
8487 msgid "See also: L</lgetxattrs>, L<attr(5)>."
8491 #: ../fish/guestfish-actions.pod:1555
8496 #: ../fish/guestfish-actions.pod:1557
8499 " glob-expand pattern\n"
8504 #: ../fish/guestfish-actions.pod:1559 ../src/guestfs-actions.pod:2398
8506 "This command searches for all the pathnames matching C<pattern> according to "
8507 "the wildcard expansion rules used by the shell."
8511 #: ../fish/guestfish-actions.pod:1563 ../src/guestfs-actions.pod:2402
8512 msgid "If no paths match, then this returns an empty list (note: not an error)."
8516 #: ../fish/guestfish-actions.pod:1566 ../src/guestfs-actions.pod:2405
8518 "It is just a wrapper around the C L<glob(3)> function with flags "
8519 "C<GLOB_MARK|GLOB_BRACE>. See that manual page for more details."
8523 #: ../fish/guestfish-actions.pod:1570
8528 #: ../fish/guestfish-actions.pod:1572
8531 " grep regex path\n"
8536 #: ../fish/guestfish-actions.pod:1574 ../src/guestfs-actions.pod:2422
8537 msgid "This calls the external C<grep> program and returns the matching lines."
8541 #: ../fish/guestfish-actions.pod:1580
8546 #: ../fish/guestfish-actions.pod:1582
8549 " grepi regex path\n"
8554 #: ../fish/guestfish-actions.pod:1584 ../src/guestfs-actions.pod:2441
8555 msgid "This calls the external C<grep -i> program and returns the matching lines."
8559 #: ../fish/guestfish-actions.pod:1590
8560 msgid "grub-install"
8564 #: ../fish/guestfish-actions.pod:1592
8567 " grub-install root device\n"
8572 #: ../fish/guestfish-actions.pod:1594 ../src/guestfs-actions.pod:2460
8574 "This command installs GRUB 1 (the Grand Unified Bootloader) on C<device>, "
8575 "with the root directory being C<root>."
8579 #: ../fish/guestfish-actions.pod:1603 ../src/guestfs-actions.pod:2469
8581 "There is currently no way in the API to install grub2, which is used by most "
8582 "modern Linux guests. It is possible to run the grub2 command from the "
8583 "guest, although see the caveats in L<guestfs(3)/RUNNING COMMANDS>."
8587 #: ../fish/guestfish-actions.pod:1610 ../src/guestfs-actions.pod:2476
8589 "This uses C<grub-install> from the host. Unfortunately grub is not always "
8590 "compatible with itself, so this only works in rather narrow circumstances. "
8591 "Careful testing with each guest version is advisable."
8595 #: ../fish/guestfish-actions.pod:1617 ../src/guestfs-actions.pod:2483
8597 "If grub-install reports the error \"No suitable drive was found in the "
8598 "generated device map.\" it may be that you need to create a "
8599 "C</boot/grub/device.map> file first that contains the mapping between grub "
8600 "device names and Linux device names. It is usually sufficient to create a "
8605 #: ../fish/guestfish-actions.pod:1624 ../src/guestfs-actions.pod:2490
8613 #: ../fish/guestfish-actions.pod:1626 ../src/guestfs-actions.pod:2492
8614 msgid "replacing C</dev/vda> with the name of the installation device."
8618 #: ../fish/guestfish-actions.pod:1630
8623 #: ../fish/guestfish-actions.pod:1632
8631 #: ../fish/guestfish-actions.pod:1634 ../src/guestfs-actions.pod:2506
8633 "This command returns up to the first 10 lines of a file as a list of "
8638 #: ../fish/guestfish-actions.pod:1640
8643 #: ../fish/guestfish-actions.pod:1642
8646 " head-n nrlines path\n"
8651 #: ../fish/guestfish-actions.pod:1644 ../src/guestfs-actions.pod:2525
8653 "If the parameter C<nrlines> is a positive number, this returns the first "
8654 "C<nrlines> lines of the file C<path>."
8658 #: ../fish/guestfish-actions.pod:1647 ../src/guestfs-actions.pod:2528
8660 "If the parameter C<nrlines> is a negative number, this returns lines from "
8661 "the file C<path>, excluding the last C<nrlines> lines."
8665 #: ../fish/guestfish-actions.pod:1650 ../fish/guestfish-actions.pod:4735 ../src/guestfs-actions.pod:2531 ../src/guestfs-actions.pod:7169
8666 msgid "If the parameter C<nrlines> is zero, this returns an empty list."
8670 #: ../fish/guestfish-actions.pod:1655
8675 #: ../fish/guestfish-actions.pod:1657
8683 #: ../fish/guestfish-actions.pod:1659 ../src/guestfs-actions.pod:2548
8685 "This runs C<hexdump -C> on the given C<path>. The result is the "
8686 "human-readable, canonical hex dump of the file."
8690 #: ../fish/guestfish-actions.pod:1665
8695 #: ../fish/guestfish-actions.pod:1667
8698 " initrd-cat initrdpath filename\n"
8703 #: ../fish/guestfish-actions.pod:1669 ../src/guestfs-actions.pod:2567
8705 "This command unpacks the file C<filename> from the initrd file called "
8706 "C<initrdpath>. The filename must be given I<without> the initial C</> "
8711 #: ../fish/guestfish-actions.pod:1673 ../src/guestfs-actions.pod:2571
8713 "For example, in guestfish you could use the following command to examine the "
8714 "boot script (usually called C</init>) contained in a Linux initrd or "
8719 #: ../fish/guestfish-actions.pod:1677 ../src/guestfs-actions.pod:2575
8722 " initrd-cat /boot/initrd-<version>.img init\n"
8727 #: ../fish/guestfish-actions.pod:1679
8728 msgid "See also L</initrd-list>."
8732 #: ../fish/guestfish-actions.pod:1684
8737 #: ../fish/guestfish-actions.pod:1686
8740 " initrd-list path\n"
8745 #: ../fish/guestfish-actions.pod:1688 ../src/guestfs-actions.pod:2594
8746 msgid "This command lists out files contained in an initrd."
8750 #: ../fish/guestfish-actions.pod:1690 ../src/guestfs-actions.pod:2596
8752 "The files are listed without any initial C</> character. The files are "
8753 "listed in the order they appear (not necessarily alphabetical). Directory "
8754 "names are listed as separate items."
8758 #: ../fish/guestfish-actions.pod:1694 ../src/guestfs-actions.pod:2600
8760 "Old Linux kernels (2.4 and earlier) used a compressed ext2 filesystem as "
8761 "initrd. We I<only> support the newer initramfs format (compressed cpio "
8766 #: ../fish/guestfish-actions.pod:1698
8767 msgid "inotify-add-watch"
8771 #: ../fish/guestfish-actions.pod:1700
8774 " inotify-add-watch path mask\n"
8779 #: ../fish/guestfish-actions.pod:1702 ../src/guestfs-actions.pod:2617
8780 msgid "Watch C<path> for the events listed in C<mask>."
8784 #: ../fish/guestfish-actions.pod:1704 ../src/guestfs-actions.pod:2619
8786 "Note that if C<path> is a directory then events within that directory are "
8787 "watched, but this does I<not> happen recursively (in subdirectories)."
8791 #: ../fish/guestfish-actions.pod:1708 ../src/guestfs-actions.pod:2623
8793 "Note for non-C or non-Linux callers: the inotify events are defined by the "
8794 "Linux kernel ABI and are listed in C</usr/include/sys/inotify.h>."
8798 #: ../fish/guestfish-actions.pod:1712
8799 msgid "inotify-close"
8803 #: ../fish/guestfish-actions.pod:1714
8811 #: ../fish/guestfish-actions.pod:1716 ../src/guestfs-actions.pod:2636
8813 "This closes the inotify handle which was previously opened by inotify_init. "
8814 "It removes all watches, throws away any pending events, and deallocates all "
8819 #: ../fish/guestfish-actions.pod:1720
8820 msgid "inotify-files"
8824 #: ../fish/guestfish-actions.pod:1722
8832 #: ../fish/guestfish-actions.pod:1724
8834 "This function is a helpful wrapper around L</inotify-read> which just "
8835 "returns a list of pathnames of objects that were touched. The returned "
8836 "pathnames are sorted and deduplicated."
8840 #: ../fish/guestfish-actions.pod:1728
8841 msgid "inotify-init"
8845 #: ../fish/guestfish-actions.pod:1730
8848 " inotify-init maxevents\n"
8853 #: ../fish/guestfish-actions.pod:1732 ../src/guestfs-actions.pod:2665
8855 "This command creates a new inotify handle. The inotify subsystem can be "
8856 "used to notify events which happen to objects in the guest filesystem."
8860 #: ../fish/guestfish-actions.pod:1736
8862 "C<maxevents> is the maximum number of events which will be queued up between "
8863 "calls to L</inotify-read> or L</inotify-files>. If this is passed as C<0>, "
8864 "then the kernel (or previously set) default is used. For Linux 2.6.29 the "
8865 "default was 16384 events. Beyond this limit, the kernel throws away events, "
8866 "but records the fact that it threw them away by setting a flag "
8867 "C<IN_Q_OVERFLOW> in the returned structure list (see L</inotify-read>)."
8871 #: ../fish/guestfish-actions.pod:1746
8873 "Before any events are generated, you have to add some watches to the "
8874 "internal watch list. See: L</inotify-add-watch>, L</inotify-rm-watch> and "
8875 "L</inotify-watch-all>."
8879 #: ../fish/guestfish-actions.pod:1752
8881 "Queued up events should be read periodically by calling L</inotify-read> (or "
8882 "L</inotify-files> which is just a helpful wrapper around L</inotify-read>). "
8883 "If you don't read the events out often enough then you risk the internal "
8884 "queue overflowing."
8888 #: ../fish/guestfish-actions.pod:1759
8890 "The handle should be closed after use by calling L</inotify-close>. This "
8891 "also removes any watches automatically."
8895 #: ../fish/guestfish-actions.pod:1763 ../src/guestfs-actions.pod:2696
8897 "See also L<inotify(7)> for an overview of the inotify interface as exposed "
8898 "by the Linux kernel, which is roughly what we expose via libguestfs. Note "
8899 "that there is one global inotify handle per libguestfs instance."
8903 #: ../fish/guestfish-actions.pod:1768
8904 msgid "inotify-read"
8908 #: ../fish/guestfish-actions.pod:1770
8916 #: ../fish/guestfish-actions.pod:1772 ../src/guestfs-actions.pod:2710
8918 "Return the complete queue of events that have happened since the previous "
8923 #: ../fish/guestfish-actions.pod:1775 ../src/guestfs-actions.pod:2713
8924 msgid "If no events have happened, this returns an empty list."
8928 #: ../fish/guestfish-actions.pod:1777 ../src/guestfs-actions.pod:2715
8930 "I<Note>: In order to make sure that all events have been read, you must call "
8931 "this function repeatedly until it returns an empty list. The reason is that "
8932 "the call will read events up to the maximum appliance-to-host message size "
8933 "and leave remaining events in the queue."
8937 #: ../fish/guestfish-actions.pod:1783
8938 msgid "inotify-rm-watch"
8942 #: ../fish/guestfish-actions.pod:1785
8945 " inotify-rm-watch wd\n"
8950 #: ../fish/guestfish-actions.pod:1787
8951 msgid "Remove a previously defined inotify watch. See L</inotify-add-watch>."
8955 #: ../fish/guestfish-actions.pod:1790
8956 msgid "inspect-get-arch"
8960 #: ../fish/guestfish-actions.pod:1792
8963 " inspect-get-arch root\n"
8968 #: ../fish/guestfish-actions.pod:1794
8970 "This returns the architecture of the inspected operating system. The "
8971 "possible return values are listed under L</file-architecture>."
8975 #: ../fish/guestfish-actions.pod:1798 ../src/guestfs-actions.pod:2750
8977 "If the architecture could not be determined, then the string C<unknown> is "
8982 #: ../fish/guestfish-actions.pod:1801 ../fish/guestfish-actions.pod:1896 ../fish/guestfish-actions.pod:1975 ../fish/guestfish-actions.pod:1987 ../fish/guestfish-actions.pod:2071 ../fish/guestfish-actions.pod:2133 ../fish/guestfish-actions.pod:2154 ../fish/guestfish-actions.pod:2168 ../fish/guestfish-actions.pod:2208 ../fish/guestfish-actions.pod:2244 ../fish/guestfish-actions.pod:2257 ../fish/guestfish-actions.pod:2270 ../fish/guestfish-actions.pod:2280 ../fish/guestfish-actions.pod:2290 ../fish/guestfish-actions.pod:2302 ../fish/guestfish-actions.pod:2398 ../fish/guestfish-actions.pod:2432 ../src/guestfs-actions.pod:2753 ../src/guestfs-actions.pod:2855 ../src/guestfs-actions.pod:2959 ../src/guestfs-actions.pod:2978 ../src/guestfs-actions.pod:3109 ../src/guestfs-actions.pod:3193 ../src/guestfs-actions.pod:3221 ../src/guestfs-actions.pod:3242 ../src/guestfs-actions.pod:3295 ../src/guestfs-actions.pod:3339 ../src/guestfs-actions.pod:3359 ../src/guestfs-actions.pod:3379 ../src/guestfs-actions.pod:3396 ../src/guestfs-actions.pod:3412 ../src/guestfs-actions.pod:3430 ../src/guestfs-actions.pod:3532 ../src/guestfs-actions.pod:3573
8983 msgid "Please read L<guestfs(3)/INSPECTION> for more details."
8987 #: ../fish/guestfish-actions.pod:1803
8988 msgid "inspect-get-distro"
8992 #: ../fish/guestfish-actions.pod:1805
8995 " inspect-get-distro root\n"
9000 #: ../fish/guestfish-actions.pod:1807 ../src/guestfs-actions.pod:2766
9001 msgid "This returns the distro (distribution) of the inspected operating system."
9005 #: ../fish/guestfish-actions.pod:1810 ../src/guestfs-actions.pod:2769
9006 msgid "Currently defined distros are:"
9010 #: ../fish/guestfish-actions.pod:1814 ../src/guestfs-actions.pod:2773
9011 msgid "\"archlinux\""
9015 #: ../fish/guestfish-actions.pod:1816 ../src/guestfs-actions.pod:2775
9020 #: ../fish/guestfish-actions.pod:1818 ../src/guestfs-actions.pod:2777
9025 #: ../fish/guestfish-actions.pod:1820 ../src/guestfs-actions.pod:2779
9030 #: ../fish/guestfish-actions.pod:1822 ../src/guestfs-actions.pod:2781
9035 #: ../fish/guestfish-actions.pod:1824 ../src/guestfs-actions.pod:2783
9040 #: ../fish/guestfish-actions.pod:1826 ../src/guestfs-actions.pod:2785
9045 #: ../fish/guestfish-actions.pod:1828 ../src/guestfs-actions.pod:2787
9050 #: ../fish/guestfish-actions.pod:1830 ../src/guestfs-actions.pod:2789
9055 #: ../fish/guestfish-actions.pod:1832 ../src/guestfs-actions.pod:2791
9060 #: ../fish/guestfish-actions.pod:1834 ../src/guestfs-actions.pod:2793
9061 msgid "\"linuxmint\""
9065 #: ../fish/guestfish-actions.pod:1836 ../src/guestfs-actions.pod:2795
9070 #: ../fish/guestfish-actions.pod:1838 ../src/guestfs-actions.pod:2797
9075 #: ../fish/guestfish-actions.pod:1840 ../src/guestfs-actions.pod:2799
9080 #: ../fish/guestfish-actions.pod:1842 ../src/guestfs-actions.pod:2801
9081 msgid "\"mandriva\""
9085 #: ../fish/guestfish-actions.pod:1844 ../src/guestfs-actions.pod:2803
9090 #: ../fish/guestfish-actions.pod:1846 ../src/guestfs-actions.pod:2805
9095 #: ../fish/guestfish-actions.pod:1848 ../src/guestfs-actions.pod:2807
9100 #: ../fish/guestfish-actions.pod:1850 ../src/guestfs-actions.pod:2809
9101 msgid "\"opensuse\""
9105 #: ../fish/guestfish-actions.pod:1852 ../src/guestfs-actions.pod:2811
9110 #: ../fish/guestfish-actions.pod:1854 ../src/guestfs-actions.pod:2813
9115 #: ../fish/guestfish-actions.pod:1856 ../src/guestfs-actions.pod:2815
9120 #: ../fish/guestfish-actions.pod:1858 ../src/guestfs-actions.pod:2817
9121 msgid "\"redhat-based\""
9125 #: ../fish/guestfish-actions.pod:1860 ../src/guestfs-actions.pod:2819
9126 msgid "Some Red Hat-derived distro."
9130 #: ../fish/guestfish-actions.pod:1862 ../src/guestfs-actions.pod:2821
9135 #: ../fish/guestfish-actions.pod:1864 ../src/guestfs-actions.pod:2823
9136 msgid "Red Hat Enterprise Linux."
9140 #: ../fish/guestfish-actions.pod:1866 ../src/guestfs-actions.pod:2825
9141 msgid "\"scientificlinux\""
9145 #: ../fish/guestfish-actions.pod:1868 ../src/guestfs-actions.pod:2827
9146 msgid "Scientific Linux."
9150 #: ../fish/guestfish-actions.pod:1870 ../src/guestfs-actions.pod:2829
9151 msgid "\"slackware\""
9155 #: ../fish/guestfish-actions.pod:1872 ../src/guestfs-actions.pod:2831
9160 #: ../fish/guestfish-actions.pod:1874 ../src/guestfs-actions.pod:2833
9161 msgid "\"ttylinux\""
9165 #: ../fish/guestfish-actions.pod:1876 ../src/guestfs-actions.pod:2835
9170 #: ../fish/guestfish-actions.pod:1878 ../src/guestfs-actions.pod:2837
9175 #: ../fish/guestfish-actions.pod:1880 ../src/guestfs-actions.pod:2839
9180 #: ../fish/guestfish-actions.pod:1882 ../fish/guestfish-actions.pod:1966 ../fish/guestfish-actions.pod:2235 ../src/guestfs-actions.pod:2841 ../src/guestfs-actions.pod:2950 ../src/guestfs-actions.pod:3330
9185 #: ../fish/guestfish-actions.pod:1884 ../src/guestfs-actions.pod:2843
9186 msgid "The distro could not be determined."
9190 #: ../fish/guestfish-actions.pod:1886 ../fish/guestfish-actions.pod:2223 ../src/guestfs-actions.pod:2845 ../src/guestfs-actions.pod:3318
9195 #: ../fish/guestfish-actions.pod:1888 ../src/guestfs-actions.pod:2847
9197 "Windows does not have distributions. This string is returned if the OS type "
9202 #: ../fish/guestfish-actions.pod:1893 ../fish/guestfish-actions.pod:1972 ../fish/guestfish-actions.pod:2241 ../src/guestfs-actions.pod:2852 ../src/guestfs-actions.pod:2956 ../src/guestfs-actions.pod:3336
9204 "Future versions of libguestfs may return other strings here. The caller "
9205 "should be prepared to handle any string."
9209 #: ../fish/guestfish-actions.pod:1898
9210 msgid "inspect-get-drive-mappings"
9214 #: ../fish/guestfish-actions.pod:1900
9217 " inspect-get-drive-mappings root\n"
9222 #: ../fish/guestfish-actions.pod:1902 ../src/guestfs-actions.pod:2868
9224 "This call is useful for Windows which uses a primitive system of assigning "
9225 "drive letters (like \"C:\") to partitions. This inspection API examines the "
9226 "Windows Registry to find out how disks/partitions are mapped to drive "
9227 "letters, and returns a hash table as in the example below:"
9231 #: ../fish/guestfish-actions.pod:1908 ../src/guestfs-actions.pod:2874
9241 #: ../fish/guestfish-actions.pod:1912 ../src/guestfs-actions.pod:2878
9243 "Note that keys are drive letters. For Windows, the key is case insensitive "
9244 "and just contains the drive letter, without the customary colon separator "
9249 #: ../fish/guestfish-actions.pod:1916 ../src/guestfs-actions.pod:2882
9251 "In future we may support other operating systems that also used drive "
9252 "letters, but the keys for those might not be case insensitive and might be "
9253 "longer than 1 character. For example in OS-9, hard drives were named C<h0>, "
9258 #: ../fish/guestfish-actions.pod:1921 ../src/guestfs-actions.pod:2887
9260 "For Windows guests, currently only hard drive mappings are returned. "
9261 "Removable disks (eg. DVD-ROMs) are ignored."
9265 #: ../fish/guestfish-actions.pod:1924 ../src/guestfs-actions.pod:2890
9267 "For guests that do not use drive mappings, or if the drive mappings could "
9268 "not be determined, this returns an empty hash table."
9272 #: ../fish/guestfish-actions.pod:1927
9274 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9275 "L</inspect-get-mountpoints>, L</inspect-get-filesystems>."
9279 #: ../fish/guestfish-actions.pod:1931
9280 msgid "inspect-get-filesystems"
9284 #: ../fish/guestfish-actions.pod:1933
9287 " inspect-get-filesystems root\n"
9292 #: ../fish/guestfish-actions.pod:1935 ../src/guestfs-actions.pod:2911
9294 "This returns a list of all the filesystems that we think are associated with "
9295 "this operating system. This includes the root filesystem, other ordinary "
9296 "filesystems, and non-mounted devices like swap partitions."
9300 #: ../fish/guestfish-actions.pod:1940 ../src/guestfs-actions.pod:2916
9302 "In the case of a multi-boot virtual machine, it is possible for a filesystem "
9303 "to be shared between operating systems."
9307 #: ../fish/guestfish-actions.pod:1943
9309 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9310 "L</inspect-get-mountpoints>."
9314 #: ../fish/guestfish-actions.pod:1946
9315 msgid "inspect-get-format"
9319 #: ../fish/guestfish-actions.pod:1948
9322 " inspect-get-format root\n"
9327 #: ../fish/guestfish-actions.pod:1950 ../src/guestfs-actions.pod:2934
9329 "This returns the format of the inspected operating system. You can use it "
9330 "to detect install images, live CDs and similar."
9334 #: ../fish/guestfish-actions.pod:1953 ../src/guestfs-actions.pod:2937
9335 msgid "Currently defined formats are:"
9339 #: ../fish/guestfish-actions.pod:1957 ../src/guestfs-actions.pod:2941
9340 msgid "\"installed\""
9344 #: ../fish/guestfish-actions.pod:1959 ../src/guestfs-actions.pod:2943
9345 msgid "This is an installed operating system."
9349 #: ../fish/guestfish-actions.pod:1961 ../src/guestfs-actions.pod:2945
9350 msgid "\"installer\""
9354 #: ../fish/guestfish-actions.pod:1963 ../src/guestfs-actions.pod:2947
9356 "The disk image being inspected is not an installed operating system, but a "
9357 "I<bootable> install disk, live CD, or similar."
9361 #: ../fish/guestfish-actions.pod:1968 ../src/guestfs-actions.pod:2952
9362 msgid "The format of this disk image is not known."
9366 #: ../fish/guestfish-actions.pod:1977
9367 msgid "inspect-get-hostname"
9371 #: ../fish/guestfish-actions.pod:1979
9374 " inspect-get-hostname root\n"
9379 #: ../fish/guestfish-actions.pod:1981 ../src/guestfs-actions.pod:2972
9381 "This function returns the hostname of the operating system as found by "
9382 "inspection of the guest's configuration files."
9386 #: ../fish/guestfish-actions.pod:1984 ../src/guestfs-actions.pod:2975
9388 "If the hostname could not be determined, then the string C<unknown> is "
9393 #: ../fish/guestfish-actions.pod:1989
9394 msgid "inspect-get-icon"
9398 #: ../fish/guestfish-actions.pod:1991
9401 " inspect-get-icon root [favicon:..] [highquality:..]\n"
9406 #: ../fish/guestfish-actions.pod:1993 ../src/guestfs-actions.pod:3001
9408 "This function returns an icon corresponding to the inspected operating "
9409 "system. The icon is returned as a buffer containing a PNG image (re-encoded "
9410 "to PNG if necessary)."
9414 #: ../fish/guestfish-actions.pod:1997 ../src/guestfs-actions.pod:3005
9416 "If it was not possible to get an icon this function returns a zero-length "
9417 "(non-NULL) buffer. I<Callers must check for this case>."
9421 #: ../fish/guestfish-actions.pod:2000 ../src/guestfs-actions.pod:3008
9423 "Libguestfs will start by looking for a file called C</etc/favicon.png> or "
9424 "C<C:\\etc\\favicon.png> and if it has the correct format, the contents of "
9425 "this file will be returned. You can disable favicons by passing the "
9426 "optional C<favicon> boolean as false (default is true)."
9430 #: ../fish/guestfish-actions.pod:2006 ../src/guestfs-actions.pod:3014
9432 "If finding the favicon fails, then we look in other places in the guest for "
9437 #: ../fish/guestfish-actions.pod:2009 ../src/guestfs-actions.pod:3017
9439 "If the optional C<highquality> boolean is true then only high quality icons "
9440 "are returned, which means only icons of high resolution with an alpha "
9441 "channel. The default (false) is to return any icon we can, even if it is of "
9442 "substandard quality."
9446 #: ../fish/guestfish-actions.pod:2020 ../src/guestfs-actions.pod:3028
9448 "Unlike most other inspection API calls, the guest's disks must be mounted up "
9449 "before you call this, since it needs to read information from the guest "
9450 "filesystem during the call."
9454 #: ../fish/guestfish-actions.pod:2026 ../src/guestfs-actions.pod:3034
9456 "B<Security:> The icon data comes from the untrusted guest, and should be "
9457 "treated with caution. PNG files have been known to contain exploits. "
9458 "Ensure that libpng (or other relevant libraries) are fully up to date before "
9459 "trying to process or display the icon."
9463 #: ../fish/guestfish-actions.pod:2034 ../src/guestfs-actions.pod:3042
9465 "The PNG image returned can be any size. It might not be square. Libguestfs "
9466 "tries to return the largest, highest quality icon available. The "
9467 "application must scale the icon to the required size."
9471 #: ../fish/guestfish-actions.pod:2041 ../src/guestfs-actions.pod:3049
9473 "Extracting icons from Windows guests requires the external C<wrestool> "
9474 "program from the C<icoutils> package, and several programs (C<bmptopnm>, "
9475 "C<pnmtopng>, C<pamcut>) from the C<netpbm> package. These must be "
9476 "installed separately."
9480 #: ../fish/guestfish-actions.pod:2048 ../src/guestfs-actions.pod:3056
9482 "Operating system icons are usually trademarks. Seek legal advice before "
9483 "using trademarks in applications."
9487 #: ../fish/guestfish-actions.pod:2055
9488 msgid "inspect-get-major-version"
9492 #: ../fish/guestfish-actions.pod:2057
9495 " inspect-get-major-version root\n"
9500 #: ../fish/guestfish-actions.pod:2059 ../src/guestfs-actions.pod:3097
9501 msgid "This returns the major version number of the inspected operating system."
9505 #: ../fish/guestfish-actions.pod:2062 ../src/guestfs-actions.pod:3100
9507 "Windows uses a consistent versioning scheme which is I<not> reflected in the "
9508 "popular public names used by the operating system. Notably the operating "
9509 "system known as \"Windows 7\" is really version 6.1 (ie. major = 6, minor = "
9510 "1). You can find out the real versions corresponding to releases of Windows "
9511 "by consulting Wikipedia or MSDN."
9515 #: ../fish/guestfish-actions.pod:2069 ../fish/guestfish-actions.pod:2080 ../src/guestfs-actions.pod:3107 ../src/guestfs-actions.pod:3124
9516 msgid "If the version could not be determined, then C<0> is returned."
9520 #: ../fish/guestfish-actions.pod:2073
9521 msgid "inspect-get-minor-version"
9525 #: ../fish/guestfish-actions.pod:2075
9528 " inspect-get-minor-version root\n"
9533 #: ../fish/guestfish-actions.pod:2077 ../src/guestfs-actions.pod:3121
9534 msgid "This returns the minor version number of the inspected operating system."
9538 #: ../fish/guestfish-actions.pod:2082
9540 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9541 "L</inspect-get-major-version>."
9545 #: ../fish/guestfish-actions.pod:2085
9546 msgid "inspect-get-mountpoints"
9550 #: ../fish/guestfish-actions.pod:2087
9553 " inspect-get-mountpoints root\n"
9558 #: ../fish/guestfish-actions.pod:2089 ../src/guestfs-actions.pod:3139
9560 "This returns a hash of where we think the filesystems associated with this "
9561 "operating system should be mounted. Callers should note that this is at "
9562 "best an educated guess made by reading configuration files such as "
9563 "C</etc/fstab>. I<In particular note> that this may return filesystems which "
9564 "are non-existent or not mountable and callers should be prepared to handle "
9565 "or ignore failures if they try to mount them."
9569 #: ../fish/guestfish-actions.pod:2098 ../src/guestfs-actions.pod:3148
9571 "Each element in the returned hashtable has a key which is the path of the "
9572 "mountpoint (eg. C</boot>) and a value which is the filesystem that would be "
9573 "mounted there (eg. C</dev/sda1>)."
9577 #: ../fish/guestfish-actions.pod:2103 ../src/guestfs-actions.pod:3153
9578 msgid "Non-mounted devices such as swap devices are I<not> returned in this list."
9582 #: ../fish/guestfish-actions.pod:2106
9584 "For operating systems like Windows which still use drive letters, this call "
9585 "will only return an entry for the first drive \"mounted on\" C</>. For "
9586 "information about the mapping of drive letters to partitions, see "
9587 "L</inspect-get-drive-mappings>."
9591 #: ../fish/guestfish-actions.pod:2112
9593 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9594 "L</inspect-get-filesystems>."
9598 #: ../fish/guestfish-actions.pod:2115
9599 msgid "inspect-get-package-format"
9603 #: ../fish/guestfish-actions.pod:2117
9606 " inspect-get-package-format root\n"
9611 #: ../fish/guestfish-actions.pod:2119
9613 "This function and L</inspect-get-package-management> return the package "
9614 "format and package management tool used by the inspected operating system. "
9615 "For example for Fedora these functions would return C<rpm> (package format) "
9616 "and C<yum> (package management)."
9620 #: ../fish/guestfish-actions.pod:2125 ../src/guestfs-actions.pod:3185
9622 "This returns the string C<unknown> if we could not determine the package "
9623 "format I<or> if the operating system does not have a real packaging system "
9628 #: ../fish/guestfish-actions.pod:2129 ../src/guestfs-actions.pod:3189
9630 "Possible strings include: C<rpm>, C<deb>, C<ebuild>, C<pisi>, C<pacman>, "
9631 "C<pkgsrc>. Future versions of libguestfs may return other strings."
9635 #: ../fish/guestfish-actions.pod:2135
9636 msgid "inspect-get-package-management"
9640 #: ../fish/guestfish-actions.pod:2137
9643 " inspect-get-package-management root\n"
9648 #: ../fish/guestfish-actions.pod:2139
9650 "L</inspect-get-package-format> and this function return the package format "
9651 "and package management tool used by the inspected operating system. For "
9652 "example for Fedora these functions would return C<rpm> (package format) and "
9653 "C<yum> (package management)."
9657 #: ../fish/guestfish-actions.pod:2145 ../src/guestfs-actions.pod:3212
9659 "This returns the string C<unknown> if we could not determine the package "
9660 "management tool I<or> if the operating system does not have a real packaging "
9661 "system (eg. Windows)."
9665 #: ../fish/guestfish-actions.pod:2149 ../src/guestfs-actions.pod:3216
9667 "Possible strings include: C<yum>, C<up2date>, C<apt> (for all Debian "
9668 "derivatives), C<portage>, C<pisi>, C<pacman>, C<urpmi>, C<zypper>. Future "
9669 "versions of libguestfs may return other strings."
9673 #: ../fish/guestfish-actions.pod:2156
9674 msgid "inspect-get-product-name"
9678 #: ../fish/guestfish-actions.pod:2158
9681 " inspect-get-product-name root\n"
9686 #: ../fish/guestfish-actions.pod:2160 ../src/guestfs-actions.pod:3234
9688 "This returns the product name of the inspected operating system. The "
9689 "product name is generally some freeform string which can be displayed to the "
9690 "user, but should not be parsed by programs."
9694 #: ../fish/guestfish-actions.pod:2165 ../src/guestfs-actions.pod:3239
9696 "If the product name could not be determined, then the string C<unknown> is "
9701 #: ../fish/guestfish-actions.pod:2170
9702 msgid "inspect-get-product-variant"
9706 #: ../fish/guestfish-actions.pod:2172
9709 " inspect-get-product-variant root\n"
9714 #: ../fish/guestfish-actions.pod:2174 ../src/guestfs-actions.pod:3255
9715 msgid "This returns the product variant of the inspected operating system."
9719 #: ../fish/guestfish-actions.pod:2177 ../src/guestfs-actions.pod:3258
9721 "For Windows guests, this returns the contents of the Registry key "
9722 "C<HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion> C<InstallationType> "
9723 "which is usually a string such as C<Client> or C<Server> (other values are "
9724 "possible). This can be used to distinguish consumer and enterprise versions "
9725 "of Windows that have the same version number (for example, Windows 7 and "
9726 "Windows 2008 Server are both version 6.1, but the former is C<Client> and "
9727 "the latter is C<Server>)."
9731 #: ../fish/guestfish-actions.pod:2186 ../src/guestfs-actions.pod:3267
9733 "For enterprise Linux guests, in future we intend this to return the product "
9734 "variant such as C<Desktop>, C<Server> and so on. But this is not "
9735 "implemented at present."
9739 #: ../fish/guestfish-actions.pod:2190 ../src/guestfs-actions.pod:3271
9741 "If the product variant could not be determined, then the string C<unknown> "
9746 #: ../fish/guestfish-actions.pod:2193
9748 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
9749 "L</inspect-get-product-name>, L</inspect-get-major-version>."
9753 #: ../fish/guestfish-actions.pod:2197
9754 msgid "inspect-get-roots"
9758 #: ../fish/guestfish-actions.pod:2199
9761 " inspect-get-roots\n"
9766 #: ../fish/guestfish-actions.pod:2201
9768 "This function is a convenient way to get the list of root devices, as "
9769 "returned from a previous call to L</inspect-os>, but without redoing the "
9770 "whole inspection process."
9774 #: ../fish/guestfish-actions.pod:2205
9776 "This returns an empty list if either no root devices were found or the "
9777 "caller has not called L</inspect-os>."
9781 #: ../fish/guestfish-actions.pod:2210
9782 msgid "inspect-get-type"
9786 #: ../fish/guestfish-actions.pod:2212
9789 " inspect-get-type root\n"
9794 #: ../fish/guestfish-actions.pod:2214 ../src/guestfs-actions.pod:3309
9796 "This returns the type of the inspected operating system. Currently defined "
9801 #: ../fish/guestfish-actions.pod:2219 ../src/guestfs-actions.pod:3314
9806 #: ../fish/guestfish-actions.pod:2221 ../src/guestfs-actions.pod:3316
9807 msgid "Any Linux-based operating system."
9811 #: ../fish/guestfish-actions.pod:2225 ../src/guestfs-actions.pod:3320
9812 msgid "Any Microsoft Windows operating system."
9816 #: ../fish/guestfish-actions.pod:2227 ../src/guestfs-actions.pod:3322
9821 #: ../fish/guestfish-actions.pod:2229 ../src/guestfs-actions.pod:3324
9826 #: ../fish/guestfish-actions.pod:2231 ../src/guestfs-actions.pod:3326
9831 #: ../fish/guestfish-actions.pod:2233 ../src/guestfs-actions.pod:3328
9836 #: ../fish/guestfish-actions.pod:2237 ../src/guestfs-actions.pod:3332
9837 msgid "The operating system type could not be determined."
9841 #: ../fish/guestfish-actions.pod:2246
9842 msgid "inspect-get-windows-current-control-set"
9846 #: ../fish/guestfish-actions.pod:2248
9849 " inspect-get-windows-current-control-set root\n"
9854 #: ../fish/guestfish-actions.pod:2250 ../src/guestfs-actions.pod:3352
9856 "This returns the Windows CurrentControlSet of the inspected guest. The "
9857 "CurrentControlSet is a registry key name such as C<ControlSet001>."
9861 #: ../fish/guestfish-actions.pod:2253 ../src/guestfs-actions.pod:3355
9863 "This call assumes that the guest is Windows and that the Registry could be "
9864 "examined by inspection. If this is not the case then an error is returned."
9868 #: ../fish/guestfish-actions.pod:2259
9869 msgid "inspect-get-windows-systemroot"
9873 #: ../fish/guestfish-actions.pod:2261
9876 " inspect-get-windows-systemroot root\n"
9881 #: ../fish/guestfish-actions.pod:2263 ../src/guestfs-actions.pod:3372
9883 "This returns the Windows systemroot of the inspected guest. The systemroot "
9884 "is a directory path such as C</WINDOWS>."
9888 #: ../fish/guestfish-actions.pod:2266 ../src/guestfs-actions.pod:3375
9890 "This call assumes that the guest is Windows and that the systemroot could be "
9891 "determined by inspection. If this is not the case then an error is "
9896 #: ../fish/guestfish-actions.pod:2272
9897 msgid "inspect-is-live"
9901 #: ../fish/guestfish-actions.pod:2274
9904 " inspect-is-live root\n"
9909 #: ../fish/guestfish-actions.pod:2276
9911 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9912 "then this returns true if a live image was detected on the disk."
9916 #: ../fish/guestfish-actions.pod:2282
9917 msgid "inspect-is-multipart"
9921 #: ../fish/guestfish-actions.pod:2284
9924 " inspect-is-multipart root\n"
9929 #: ../fish/guestfish-actions.pod:2286
9931 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9932 "then this returns true if the disk is part of a set."
9936 #: ../fish/guestfish-actions.pod:2292
9937 msgid "inspect-is-netinst"
9941 #: ../fish/guestfish-actions.pod:2294
9944 " inspect-is-netinst root\n"
9949 #: ../fish/guestfish-actions.pod:2296
9951 "If L</inspect-get-format> returns C<installer> (this is an install disk), "
9952 "then this returns true if the disk is a network installer, ie. not a "
9953 "self-contained install CD but one which is likely to require network access "
9954 "to complete the install."
9958 #: ../fish/guestfish-actions.pod:2304
9959 msgid "inspect-list-applications"
9963 #: ../fish/guestfish-actions.pod:2306
9966 " inspect-list-applications root\n"
9971 #: ../fish/guestfish-actions.pod:2308 ../src/guestfs-actions.pod:3442
9972 msgid "Return the list of applications installed in the operating system."
9976 #: ../fish/guestfish-actions.pod:2310
9978 "I<Note:> This call works differently from other parts of the inspection "
9979 "API. You have to call L</inspect-os>, then L</inspect-get-mountpoints>, "
9980 "then mount up the disks, before calling this. Listing applications is a "
9981 "significantly more difficult operation which requires access to the full "
9982 "filesystem. Also note that unlike the other L</inspect-get-*> calls which "
9983 "are just returning data cached in the libguestfs handle, this call actually "
9984 "reads parts of the mounted filesystems during the call."
9988 #: ../fish/guestfish-actions.pod:2320 ../src/guestfs-actions.pod:3454
9990 "This returns an empty list if the inspection code was not able to determine "
9991 "the list of applications."
9995 #: ../fish/guestfish-actions.pod:2323 ../src/guestfs-actions.pod:3457
9996 msgid "The application structure contains the following fields:"
10000 #: ../fish/guestfish-actions.pod:2327 ../src/guestfs-actions.pod:3461
10001 msgid "C<app_name>"
10005 #: ../fish/guestfish-actions.pod:2329 ../src/guestfs-actions.pod:3463
10007 "The name of the application. For Red Hat-derived and Debian-derived Linux "
10008 "guests, this is the package name."
10012 #: ../fish/guestfish-actions.pod:2332 ../src/guestfs-actions.pod:3466
10013 msgid "C<app_display_name>"
10017 #: ../fish/guestfish-actions.pod:2334 ../src/guestfs-actions.pod:3468
10019 "The display name of the application, sometimes localized to the install "
10020 "language of the guest operating system."
10024 #: ../fish/guestfish-actions.pod:2337 ../src/guestfs-actions.pod:3471
10026 "If unavailable this is returned as an empty string C<\"\">. Callers needing "
10027 "to display something can use C<app_name> instead."
10031 #: ../fish/guestfish-actions.pod:2340 ../src/guestfs-actions.pod:3474
10032 msgid "C<app_epoch>"
10036 #: ../fish/guestfish-actions.pod:2342 ../src/guestfs-actions.pod:3476
10038 "For package managers which use epochs, this contains the epoch of the "
10039 "package (an integer). If unavailable, this is returned as C<0>."
10043 #: ../fish/guestfish-actions.pod:2345 ../src/guestfs-actions.pod:3479
10044 msgid "C<app_version>"
10048 #: ../fish/guestfish-actions.pod:2347 ../src/guestfs-actions.pod:3481
10050 "The version string of the application or package. If unavailable this is "
10051 "returned as an empty string C<\"\">."
10055 #: ../fish/guestfish-actions.pod:2350 ../src/guestfs-actions.pod:3484
10056 msgid "C<app_release>"
10060 #: ../fish/guestfish-actions.pod:2352 ../src/guestfs-actions.pod:3486
10062 "The release string of the application or package, for package managers that "
10063 "use this. If unavailable this is returned as an empty string C<\"\">."
10067 #: ../fish/guestfish-actions.pod:2356 ../src/guestfs-actions.pod:3490
10068 msgid "C<app_install_path>"
10072 #: ../fish/guestfish-actions.pod:2358 ../src/guestfs-actions.pod:3492
10074 "The installation path of the application (on operating systems such as "
10075 "Windows which use installation paths). This path is in the format used by "
10076 "the guest operating system, it is not a libguestfs path."
10080 #: ../fish/guestfish-actions.pod:2363 ../src/guestfs-actions.pod:3497
10081 msgid "If unavailable this is returned as an empty string C<\"\">."
10085 #: ../fish/guestfish-actions.pod:2365 ../src/guestfs-actions.pod:3499
10086 msgid "C<app_trans_path>"
10090 #: ../fish/guestfish-actions.pod:2367 ../src/guestfs-actions.pod:3501
10092 "The install path translated into a libguestfs path. If unavailable this is "
10093 "returned as an empty string C<\"\">."
10097 #: ../fish/guestfish-actions.pod:2370 ../src/guestfs-actions.pod:3504
10098 msgid "C<app_publisher>"
10102 #: ../fish/guestfish-actions.pod:2372 ../src/guestfs-actions.pod:3506
10104 "The name of the publisher of the application, for package managers that use "
10105 "this. If unavailable this is returned as an empty string C<\"\">."
10109 #: ../fish/guestfish-actions.pod:2376 ../src/guestfs-actions.pod:3510
10114 #: ../fish/guestfish-actions.pod:2378 ../src/guestfs-actions.pod:3512
10116 "The URL (eg. upstream URL) of the application. If unavailable this is "
10117 "returned as an empty string C<\"\">."
10121 #: ../fish/guestfish-actions.pod:2381 ../src/guestfs-actions.pod:3515
10122 msgid "C<app_source_package>"
10126 #: ../fish/guestfish-actions.pod:2383 ../src/guestfs-actions.pod:3517
10128 "For packaging systems which support this, the name of the source package. "
10129 "If unavailable this is returned as an empty string C<\"\">."
10133 #: ../fish/guestfish-actions.pod:2386 ../src/guestfs-actions.pod:3520
10134 msgid "C<app_summary>"
10138 #: ../fish/guestfish-actions.pod:2388 ../src/guestfs-actions.pod:3522
10140 "A short (usually one line) description of the application or package. If "
10141 "unavailable this is returned as an empty string C<\"\">."
10145 #: ../fish/guestfish-actions.pod:2391 ../src/guestfs-actions.pod:3525
10146 msgid "C<app_description>"
10150 #: ../fish/guestfish-actions.pod:2393 ../src/guestfs-actions.pod:3527
10152 "A longer description of the application or package. If unavailable this is "
10153 "returned as an empty string C<\"\">."
10157 #: ../fish/guestfish-actions.pod:2400
10162 #: ../fish/guestfish-actions.pod:2402
10170 #: ../fish/guestfish-actions.pod:2404 ../src/guestfs-actions.pod:3545
10172 "This function uses other libguestfs functions and certain heuristics to "
10173 "inspect the disk(s) (usually disks belonging to a virtual machine), looking "
10174 "for operating systems."
10178 #: ../fish/guestfish-actions.pod:2408 ../src/guestfs-actions.pod:3549
10179 msgid "The list returned is empty if no operating systems were found."
10183 #: ../fish/guestfish-actions.pod:2410 ../src/guestfs-actions.pod:3551
10185 "If one operating system was found, then this returns a list with a single "
10186 "element, which is the name of the root filesystem of this operating system. "
10187 "It is also possible for this function to return a list containing more than "
10188 "one element, indicating a dual-boot or multi-boot virtual machine, with each "
10189 "element being the root filesystem of one of the operating systems."
10193 #: ../fish/guestfish-actions.pod:2417
10195 "You can pass the root string(s) returned to other L</inspect-get-*> "
10196 "functions in order to query further information about each operating system, "
10197 "such as the name and version."
10201 #: ../fish/guestfish-actions.pod:2422
10203 "This function uses other libguestfs features such as L</mount-ro> and "
10204 "L</umount-all> in order to mount and unmount filesystems and look at the "
10205 "contents. This should be called with no disks currently mounted. The "
10206 "function may also use Augeas, so any existing Augeas handle will be closed."
10210 #: ../fish/guestfish-actions.pod:2428 ../src/guestfs-actions.pod:3569
10212 "This function cannot decrypt encrypted disks. The caller must do that first "
10213 "(supplying the necessary keys) if the disk is encrypted."
10217 #: ../fish/guestfish-actions.pod:2434 ../fish/guestfish-actions.pod:2632 ../fish/guestfish-actions.pod:2691
10218 msgid "See also L</list-filesystems>."
10222 #: ../fish/guestfish-actions.pod:2436
10223 msgid "is-blockdev"
10227 #: ../fish/guestfish-actions.pod:2438
10230 " is-blockdev path\n"
10235 #: ../fish/guestfish-actions.pod:2440 ../src/guestfs-actions.pod:3589
10237 "This returns C<true> if and only if there is a block device with the given "
10242 #: ../fish/guestfish-actions.pod:2443 ../fish/guestfish-actions.pod:2461 ../fish/guestfish-actions.pod:2480 ../fish/guestfish-actions.pod:2489 ../fish/guestfish-actions.pod:2499 ../fish/guestfish-actions.pod:2533 ../fish/guestfish-actions.pod:2542
10243 msgid "See also L</stat>."
10247 #: ../fish/guestfish-actions.pod:2445
10252 #: ../fish/guestfish-actions.pod:2447
10260 #: ../fish/guestfish-actions.pod:2449 ../src/guestfs-actions.pod:3603
10262 "This returns true iff this handle is busy processing a command (in the "
10267 #: ../fish/guestfish-actions.pod:2454
10272 #: ../fish/guestfish-actions.pod:2456
10275 " is-chardev path\n"
10280 #: ../fish/guestfish-actions.pod:2458 ../src/guestfs-actions.pod:3618
10282 "This returns C<true> if and only if there is a character device with the "
10283 "given C<path> name."
10287 #: ../fish/guestfish-actions.pod:2463
10292 #: ../fish/guestfish-actions.pod:2465
10300 #: ../fish/guestfish-actions.pod:2467 ../src/guestfs-actions.pod:3632
10302 "This returns true iff this handle is being configured (in the C<CONFIG> "
10307 #: ../fish/guestfish-actions.pod:2472
10312 #: ../fish/guestfish-actions.pod:2474
10320 #: ../fish/guestfish-actions.pod:2476 ../src/guestfs-actions.pod:3647
10322 "This returns C<true> if and only if there is a directory with the given "
10323 "C<path> name. Note that it returns false for other objects like files."
10327 #: ../fish/guestfish-actions.pod:2482
10332 #: ../fish/guestfish-actions.pod:2484
10340 #: ../fish/guestfish-actions.pod:2486 ../src/guestfs-actions.pod:3663
10342 "This returns C<true> if and only if there is a FIFO (named pipe) with the "
10343 "given C<path> name."
10347 #: ../fish/guestfish-actions.pod:2491
10352 #: ../fish/guestfish-actions.pod:2493
10360 #: ../fish/guestfish-actions.pod:2495 ../src/guestfs-actions.pod:3678
10362 "This returns C<true> if and only if there is a regular file with the given "
10363 "C<path> name. Note that it returns false for other objects like "
10368 #: ../fish/guestfish-actions.pod:2501
10369 msgid "is-launching"
10373 #: ../fish/guestfish-actions.pod:2503
10381 #: ../fish/guestfish-actions.pod:2505 ../src/guestfs-actions.pod:3693
10383 "This returns true iff this handle is launching the subprocess (in the "
10384 "C<LAUNCHING> state)."
10388 #: ../fish/guestfish-actions.pod:2510
10393 #: ../fish/guestfish-actions.pod:2512
10401 #: ../fish/guestfish-actions.pod:2514 ../src/guestfs-actions.pod:3708
10403 "This command tests whether C<device> is a logical volume, and returns true "
10404 "iff this is the case."
10408 #: ../fish/guestfish-actions.pod:2517
10413 #: ../fish/guestfish-actions.pod:2519
10421 #: ../fish/guestfish-actions.pod:2521 ../src/guestfs-actions.pod:3720
10423 "This returns true iff this handle is ready to accept commands (in the "
10428 #: ../fish/guestfish-actions.pod:2526
10433 #: ../fish/guestfish-actions.pod:2528
10436 " is-socket path\n"
10441 #: ../fish/guestfish-actions.pod:2530 ../src/guestfs-actions.pod:3735
10443 "This returns C<true> if and only if there is a Unix domain socket with the "
10444 "given C<path> name."
10448 #: ../fish/guestfish-actions.pod:2535
10453 #: ../fish/guestfish-actions.pod:2537
10456 " is-symlink path\n"
10461 #: ../fish/guestfish-actions.pod:2539 ../src/guestfs-actions.pod:3750
10463 "This returns C<true> if and only if there is a symbolic link with the given "
10468 #: ../fish/guestfish-actions.pod:2544
10473 #: ../fish/guestfish-actions.pod:2546
10481 #: ../fish/guestfish-actions.pod:2548 ../src/guestfs-actions.pod:3765
10483 "This returns true iff the file exists and the file is empty or it contains "
10488 #: ../fish/guestfish-actions.pod:2551
10489 msgid "is-zero-device"
10493 #: ../fish/guestfish-actions.pod:2553
10496 " is-zero-device device\n"
10501 #: ../fish/guestfish-actions.pod:2555 ../src/guestfs-actions.pod:3778
10502 msgid "This returns true iff the device exists and contains all zero bytes."
10506 #: ../fish/guestfish-actions.pod:2557 ../src/guestfs-actions.pod:3780
10507 msgid "Note that for large devices this can take a long time to run."
10511 #: ../fish/guestfish-actions.pod:2559
10512 msgid "kill-subprocess"
10516 #: ../fish/guestfish-actions.pod:2561
10519 " kill-subprocess\n"
10524 #: ../fish/guestfish-actions.pod:2563 ../src/guestfs-actions.pod:3791
10525 msgid "This kills the qemu subprocess. You should never need to call this."
10529 #: ../fish/guestfish-actions.pod:2565
10534 #: ../fish/guestfish-actions.pod:2567
10539 #: ../fish/guestfish-actions.pod:2569
10547 #: ../fish/guestfish-actions.pod:2571 ../src/guestfs-actions.pod:3802
10549 "Internally libguestfs is implemented by running a virtual machine using "
10554 #: ../fish/guestfish-actions.pod:2574 ../src/guestfs-actions.pod:3805
10556 "You should call this after configuring the handle (eg. adding drives) but "
10557 "before performing any actions."
10561 #: ../fish/guestfish-actions.pod:2577
10566 #: ../fish/guestfish-actions.pod:2579
10569 " lchown owner group path\n"
10574 #: ../fish/guestfish-actions.pod:2581
10576 "Change the file owner to C<owner> and group to C<group>. This is like "
10577 "L</chown> but if C<path> is a symlink then the link itself is changed, not "
10582 #: ../fish/guestfish-actions.pod:2589
10587 #: ../fish/guestfish-actions.pod:2591
10590 " lgetxattr path name\n"
10595 #: ../fish/guestfish-actions.pod:2593 ../src/guestfs-actions.pod:3845
10597 "Get a single extended attribute from file C<path> named C<name>. If C<path> "
10598 "is a symlink, then this call returns an extended attribute from the symlink."
10602 #: ../fish/guestfish-actions.pod:2607
10603 msgid "See also: L</lgetxattrs>, L</getxattr>, L<attr(5)>."
10607 #: ../fish/guestfish-actions.pod:2609
10612 #: ../fish/guestfish-actions.pod:2611
10615 " lgetxattrs path\n"
10620 #: ../fish/guestfish-actions.pod:2613
10622 "This is the same as L</getxattrs>, but if C<path> is a symbolic link, then "
10623 "it returns the extended attributes of the link itself."
10627 #: ../fish/guestfish-actions.pod:2617
10632 #: ../fish/guestfish-actions.pod:2619
10640 #: ../fish/guestfish-actions.pod:2621 ../src/guestfs-actions.pod:3888
10642 "List all 9p filesystems attached to the guest. A list of mount tags is "
10647 #: ../fish/guestfish-actions.pod:2624
10648 msgid "list-devices"
10652 #: ../fish/guestfish-actions.pod:2626
10660 #: ../fish/guestfish-actions.pod:2628 ../src/guestfs-actions.pod:3902
10661 msgid "List all the block devices."
10665 #: ../fish/guestfish-actions.pod:2630 ../src/guestfs-actions.pod:3904
10666 msgid "The full block device names are returned, eg. C</dev/sda>."
10670 #: ../fish/guestfish-actions.pod:2634
10671 msgid "list-dm-devices"
10675 #: ../fish/guestfish-actions.pod:2636
10678 " list-dm-devices\n"
10683 #: ../fish/guestfish-actions.pod:2638 ../src/guestfs-actions.pod:3919
10684 msgid "List all device mapper devices."
10688 #: ../fish/guestfish-actions.pod:2640
10690 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
10691 "previous call to L</luks-open>."
10695 #: ../fish/guestfish-actions.pod:2643
10697 "Device mapper devices which correspond to logical volumes are I<not> "
10698 "returned in this list. Call L</lvs> if you want to list logical volumes."
10702 #: ../fish/guestfish-actions.pod:2647
10703 msgid "list-filesystems"
10707 #: ../fish/guestfish-actions.pod:2649
10710 " list-filesystems\n"
10715 #: ../fish/guestfish-actions.pod:2651 ../src/guestfs-actions.pod:3939
10717 "This inspection command looks for filesystems on partitions, block devices "
10718 "and logical volumes, returning a list of devices containing filesystems and "
10723 #: ../fish/guestfish-actions.pod:2655 ../src/guestfs-actions.pod:3943
10725 "The return value is a hash, where the keys are the devices containing "
10726 "filesystems, and the values are the filesystem types. For example:"
10730 #: ../fish/guestfish-actions.pod:2659 ../src/guestfs-actions.pod:3947
10733 " \"/dev/sda1\" => \"ntfs\"\n"
10734 " \"/dev/sda2\" => \"ext2\"\n"
10735 " \"/dev/vg_guest/lv_root\" => \"ext4\"\n"
10736 " \"/dev/vg_guest/lv_swap\" => \"swap\"\n"
10741 #: ../fish/guestfish-actions.pod:2664 ../src/guestfs-actions.pod:3952
10743 "The value can have the special value \"unknown\", meaning the content of the "
10744 "device is undetermined or empty. \"swap\" means a Linux swap partition."
10748 #: ../fish/guestfish-actions.pod:2668
10750 "This command runs other libguestfs commands, which might include L</mount> "
10751 "and L</umount>, and therefore you should use this soon after launch and only "
10752 "when nothing is mounted."
10756 #: ../fish/guestfish-actions.pod:2672
10758 "Not all of the filesystems returned will be mountable. In particular, swap "
10759 "partitions are returned in the list. Also this command does not check that "
10760 "each filesystem found is valid and mountable, and some filesystems might be "
10761 "mountable but require special options. Filesystems may not all belong to a "
10762 "single logical operating system (use L</inspect-os> to look for OSes)."
10766 #: ../fish/guestfish-actions.pod:2680
10767 msgid "list-partitions"
10771 #: ../fish/guestfish-actions.pod:2682
10774 " list-partitions\n"
10779 #: ../fish/guestfish-actions.pod:2684 ../src/guestfs-actions.pod:3981
10780 msgid "List all the partitions detected on all block devices."
10784 #: ../fish/guestfish-actions.pod:2686 ../src/guestfs-actions.pod:3983
10785 msgid "The full partition device names are returned, eg. C</dev/sda1>"
10789 #: ../fish/guestfish-actions.pod:2688
10791 "This does not return logical volumes. For that you will need to call "
10796 #: ../fish/guestfish-actions.pod:2693
10801 #: ../fish/guestfish-actions.pod:2695
10809 #: ../fish/guestfish-actions.pod:2697 ../src/guestfs-actions.pod:4002
10811 "List the files in C<directory> (relative to the root directory, there is no "
10812 "cwd) in the format of 'ls -la'."
10816 #: ../fish/guestfish-actions.pod:2700 ../src/guestfs-actions.pod:4005
10818 "This command is mostly useful for interactive sessions. It is I<not> "
10819 "intended that you try to parse the output string."
10823 #: ../fish/guestfish-actions.pod:2703
10828 #: ../fish/guestfish-actions.pod:2705
10831 " ln target linkname\n"
10836 #: ../fish/guestfish-actions.pod:2707 ../src/guestfs-actions.pod:4020
10837 msgid "This command creates a hard link using the C<ln> command."
10841 #: ../fish/guestfish-actions.pod:2709
10846 #: ../fish/guestfish-actions.pod:2711
10849 " ln-f target linkname\n"
10854 #: ../fish/guestfish-actions.pod:2713 ../src/guestfs-actions.pod:4033
10856 "This command creates a hard link using the C<ln -f> command. The I<-f> "
10857 "option removes the link (C<linkname>) if it exists already."
10861 #: ../fish/guestfish-actions.pod:2716
10866 #: ../fish/guestfish-actions.pod:2718
10869 " ln-s target linkname\n"
10874 #: ../fish/guestfish-actions.pod:2720 ../src/guestfs-actions.pod:4047
10875 msgid "This command creates a symbolic link using the C<ln -s> command."
10879 #: ../fish/guestfish-actions.pod:2722
10884 #: ../fish/guestfish-actions.pod:2724
10887 " ln-sf target linkname\n"
10892 #: ../fish/guestfish-actions.pod:2726 ../src/guestfs-actions.pod:4060
10894 "This command creates a symbolic link using the C<ln -sf> command, The I<-f> "
10895 "option removes the link (C<linkname>) if it exists already."
10899 #: ../fish/guestfish-actions.pod:2729
10900 msgid "lremovexattr"
10904 #: ../fish/guestfish-actions.pod:2731
10907 " lremovexattr xattr path\n"
10912 #: ../fish/guestfish-actions.pod:2733
10914 "This is the same as L</removexattr>, but if C<path> is a symbolic link, then "
10915 "it removes an extended attribute of the link itself."
10919 #: ../fish/guestfish-actions.pod:2737
10924 #: ../fish/guestfish-actions.pod:2739
10932 #: ../fish/guestfish-actions.pod:2741 ../src/guestfs-actions.pod:4088
10934 "List the files in C<directory> (relative to the root directory, there is no "
10935 "cwd). The '.' and '..' entries are not returned, but hidden files are "
10940 #: ../fish/guestfish-actions.pod:2745
10942 "This command is mostly useful for interactive sessions. Programs should "
10943 "probably use L</readdir> instead."
10947 #: ../fish/guestfish-actions.pod:2748
10952 #: ../fish/guestfish-actions.pod:2750
10955 " lsetxattr xattr val vallen path\n"
10960 #: ../fish/guestfish-actions.pod:2752
10962 "This is the same as L</setxattr>, but if C<path> is a symbolic link, then it "
10963 "sets an extended attribute of the link itself."
10967 #: ../fish/guestfish-actions.pod:2756
10972 #: ../fish/guestfish-actions.pod:2758
10980 #: ../fish/guestfish-actions.pod:2760 ../fish/guestfish-actions.pod:4570 ../src/guestfs-actions.pod:4124 ../src/guestfs-actions.pod:6909
10981 msgid "Returns file information for the given C<path>."
10985 #: ../fish/guestfish-actions.pod:2762
10987 "This is the same as L</stat> except that if C<path> is a symbolic link, then "
10988 "the link is stat-ed, not the file it refers to."
10992 #: ../fish/guestfish-actions.pod:2766 ../src/guestfs-actions.pod:4130
10993 msgid "This is the same as the C<lstat(2)> system call."
10997 #: ../fish/guestfish-actions.pod:2768
11002 #: ../fish/guestfish-actions.pod:2770
11005 " lstatlist path 'names ...'\n"
11010 #: ../fish/guestfish-actions.pod:2772
11012 "This call allows you to perform the L</lstat> operation on multiple files, "
11013 "where all files are in the directory C<path>. C<names> is the list of files "
11014 "from this directory."
11018 #: ../fish/guestfish-actions.pod:2776 ../src/guestfs-actions.pod:4149
11020 "On return you get a list of stat structs, with a one-to-one correspondence "
11021 "to the C<names> list. If any name did not exist or could not be lstat'd, "
11022 "then the C<ino> field of that structure is set to C<-1>."
11026 #: ../fish/guestfish-actions.pod:2781
11028 "This call is intended for programs that want to efficiently list a directory "
11029 "contents without making many round-trips. See also L</lxattrlist> for a "
11030 "similarly efficient call for getting extended attributes. Very long "
11031 "directory listings might cause the protocol message size to be exceeded, "
11032 "causing this call to fail. The caller must split up such requests into "
11033 "smaller groups of names."
11037 #: ../fish/guestfish-actions.pod:2789
11038 msgid "luks-add-key"
11042 #: ../fish/guestfish-actions.pod:2791
11045 " luks-add-key device keyslot\n"
11050 #: ../fish/guestfish-actions.pod:2793 ../src/guestfs-actions.pod:4177
11052 "This command adds a new key on LUKS device C<device>. C<key> is any "
11053 "existing key, and is used to access the device. C<newkey> is the new key to "
11054 "add. C<keyslot> is the key slot that will be replaced."
11058 #: ../fish/guestfish-actions.pod:2798
11060 "Note that if C<keyslot> already contains a key, then this command will "
11061 "fail. You have to use L</luks-kill-slot> first to remove that key."
11065 #: ../fish/guestfish-actions.pod:2802 ../fish/guestfish-actions.pod:2824 ../fish/guestfish-actions.pod:2837 ../fish/guestfish-actions.pod:2851 ../fish/guestfish-actions.pod:2877 ../fish/guestfish-actions.pod:2887
11067 "This command has one or more key or passphrase parameters. Guestfish will "
11068 "prompt for these separately."
11072 #: ../fish/guestfish-actions.pod:2805
11077 #: ../fish/guestfish-actions.pod:2807
11080 " luks-close device\n"
11085 #: ../fish/guestfish-actions.pod:2809
11087 "This closes a LUKS device that was created earlier by L</luks-open> or "
11088 "L</luks-open-ro>. The C<device> parameter must be the name of the LUKS "
11089 "mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
11090 "underlying block device."
11094 #: ../fish/guestfish-actions.pod:2815
11095 msgid "luks-format"
11099 #: ../fish/guestfish-actions.pod:2817
11102 " luks-format device keyslot\n"
11107 #: ../fish/guestfish-actions.pod:2819 ../src/guestfs-actions.pod:4218
11109 "This command erases existing data on C<device> and formats the device as a "
11110 "LUKS encrypted device. C<key> is the initial key, which is added to key "
11111 "slot C<slot>. (LUKS supports 8 key slots, numbered 0-7)."
11115 #: ../fish/guestfish-actions.pod:2827 ../fish/guestfish-actions.pod:2840 ../fish/guestfish-actions.pod:2927 ../fish/guestfish-actions.pod:3578 ../fish/guestfish-actions.pod:4104 ../fish/guestfish-actions.pod:4441 ../fish/guestfish-actions.pod:4464 ../fish/guestfish-actions.pod:4486 ../fish/guestfish-actions.pod:5232 ../src/guestfs-actions.pod:4225 ../src/guestfs-actions.pod:4248 ../src/guestfs-actions.pod:4391 ../src/guestfs-actions.pod:5484 ../src/guestfs-actions.pod:6272 ../src/guestfs-actions.pod:6723 ../src/guestfs-actions.pod:6753 ../src/guestfs-actions.pod:6786 ../src/guestfs-actions.pod:7985
11117 "B<This command is dangerous. Without careful use you can easily destroy all "
11122 #: ../fish/guestfish-actions.pod:2830
11123 msgid "luks-format-cipher"
11127 #: ../fish/guestfish-actions.pod:2832
11130 " luks-format-cipher device keyslot cipher\n"
11135 #: ../fish/guestfish-actions.pod:2834
11137 "This command is the same as L</luks-format> but it also allows you to set "
11138 "the C<cipher> used."
11142 #: ../fish/guestfish-actions.pod:2843
11143 msgid "luks-kill-slot"
11147 #: ../fish/guestfish-actions.pod:2845
11150 " luks-kill-slot device keyslot\n"
11155 #: ../fish/guestfish-actions.pod:2847 ../src/guestfs-actions.pod:4265
11157 "This command deletes the key in key slot C<keyslot> from the encrypted LUKS "
11158 "device C<device>. C<key> must be one of the I<other> keys."
11162 #: ../fish/guestfish-actions.pod:2854
11167 #: ../fish/guestfish-actions.pod:2856
11170 " luks-open device mapname\n"
11175 #: ../fish/guestfish-actions.pod:2858 ../src/guestfs-actions.pod:4285
11177 "This command opens a block device which has been encrypted according to the "
11178 "Linux Unified Key Setup (LUKS) standard."
11182 #: ../fish/guestfish-actions.pod:2861 ../src/guestfs-actions.pod:4288
11183 msgid "C<device> is the encrypted block device or partition."
11187 #: ../fish/guestfish-actions.pod:2863 ../src/guestfs-actions.pod:4290
11189 "The caller must supply one of the keys associated with the LUKS block "
11190 "device, in the C<key> parameter."
11194 #: ../fish/guestfish-actions.pod:2866 ../src/guestfs-actions.pod:4293
11196 "This creates a new block device called C</dev/mapper/mapname>. Reads and "
11197 "writes to this block device are decrypted from and encrypted to the "
11198 "underlying C<device> respectively."
11202 #: ../fish/guestfish-actions.pod:2870
11204 "If this block device contains LVM volume groups, then calling L</vgscan> "
11205 "followed by L</vg-activate-all> will make them visible."
11209 #: ../fish/guestfish-actions.pod:2874
11210 msgid "Use L</list-dm-devices> to list all device mapper devices."
11214 #: ../fish/guestfish-actions.pod:2880
11215 msgid "luks-open-ro"
11219 #: ../fish/guestfish-actions.pod:2882
11222 " luks-open-ro device mapname\n"
11227 #: ../fish/guestfish-actions.pod:2884
11229 "This is the same as L</luks-open> except that a read-only mapping is "
11234 #: ../fish/guestfish-actions.pod:2890
11239 #: ../fish/guestfish-actions.pod:2892
11242 " lvcreate logvol volgroup mbytes\n"
11247 #: ../fish/guestfish-actions.pod:2894 ../src/guestfs-actions.pod:4339
11249 "This creates an LVM logical volume called C<logvol> on the volume group "
11250 "C<volgroup>, with C<size> megabytes."
11254 #: ../fish/guestfish-actions.pod:2897
11255 msgid "lvm-canonical-lv-name"
11259 #: ../fish/guestfish-actions.pod:2899
11262 " lvm-canonical-lv-name lvname\n"
11267 #: ../fish/guestfish-actions.pod:2901 ../src/guestfs-actions.pod:4352
11269 "This converts alternative naming schemes for LVs that you might find to the "
11270 "canonical name. For example, C</dev/mapper/VG-LV> is converted to "
11275 #: ../fish/guestfish-actions.pod:2905 ../src/guestfs-actions.pod:4356
11277 "This command returns an error if the C<lvname> parameter does not refer to a "
11282 #: ../fish/guestfish-actions.pod:2908
11283 msgid "See also L</is-lv>."
11287 #: ../fish/guestfish-actions.pod:2910
11288 msgid "lvm-clear-filter"
11292 #: ../fish/guestfish-actions.pod:2912
11295 " lvm-clear-filter\n"
11300 #: ../fish/guestfish-actions.pod:2914
11302 "This undoes the effect of L</lvm-set-filter>. LVM will be able to see every "
11307 #: ../fish/guestfish-actions.pod:2917 ../fish/guestfish-actions.pod:2948 ../src/guestfs-actions.pod:4374 ../src/guestfs-actions.pod:4416
11308 msgid "This command also clears the LVM cache and performs a volume group scan."
11312 #: ../fish/guestfish-actions.pod:2920
11313 msgid "lvm-remove-all"
11317 #: ../fish/guestfish-actions.pod:2922
11320 " lvm-remove-all\n"
11325 #: ../fish/guestfish-actions.pod:2924 ../src/guestfs-actions.pod:4386
11327 "This command removes all LVM logical volumes, volume groups and physical "
11332 #: ../fish/guestfish-actions.pod:2930
11333 msgid "lvm-set-filter"
11337 #: ../fish/guestfish-actions.pod:2932
11340 " lvm-set-filter 'devices ...'\n"
11345 #: ../fish/guestfish-actions.pod:2934 ../src/guestfs-actions.pod:4402
11347 "This sets the LVM device filter so that LVM will only be able to \"see\" the "
11348 "block devices in the list C<devices>, and will ignore all other attached "
11353 #: ../fish/guestfish-actions.pod:2938 ../src/guestfs-actions.pod:4406
11355 "Where disk image(s) contain duplicate PVs or VGs, this command is useful to "
11356 "get LVM to ignore the duplicates, otherwise LVM can get confused. Note also "
11357 "there are two types of duplication possible: either cloned PVs/VGs which "
11358 "have identical UUIDs; or VGs that are not cloned but just happen to have the "
11359 "same name. In normal operation you cannot create this situation, but you "
11360 "can do it outside LVM, eg. by cloning disk images or by bit twiddling "
11361 "inside the LVM metadata."
11365 #: ../fish/guestfish-actions.pod:2951 ../src/guestfs-actions.pod:4419
11366 msgid "You can filter whole block devices or individual partitions."
11370 #: ../fish/guestfish-actions.pod:2953 ../src/guestfs-actions.pod:4421
11372 "You cannot use this if any VG is currently in use (eg. contains a mounted "
11373 "filesystem), even if you are not filtering out that VG."
11377 #: ../fish/guestfish-actions.pod:2957
11382 #: ../fish/guestfish-actions.pod:2959
11385 " lvremove device\n"
11390 #: ../fish/guestfish-actions.pod:2961 ../src/guestfs-actions.pod:4435
11392 "Remove an LVM logical volume C<device>, where C<device> is the path to the "
11393 "LV, such as C</dev/VG/LV>."
11397 #: ../fish/guestfish-actions.pod:2964 ../src/guestfs-actions.pod:4438
11399 "You can also remove all LVs in a volume group by specifying the VG name, "
11404 #: ../fish/guestfish-actions.pod:2967
11409 #: ../fish/guestfish-actions.pod:2969
11412 " lvrename logvol newlogvol\n"
11417 #: ../fish/guestfish-actions.pod:2971 ../src/guestfs-actions.pod:4452
11418 msgid "Rename a logical volume C<logvol> with the new name C<newlogvol>."
11422 #: ../fish/guestfish-actions.pod:2973
11427 #: ../fish/guestfish-actions.pod:2975
11430 " lvresize device mbytes\n"
11435 #: ../fish/guestfish-actions.pod:2977 ../src/guestfs-actions.pod:4465
11437 "This resizes (expands or shrinks) an existing LVM logical volume to "
11438 "C<mbytes>. When reducing, data in the reduced part is lost."
11442 #: ../fish/guestfish-actions.pod:2981
11443 msgid "lvresize-free"
11447 #: ../fish/guestfish-actions.pod:2983
11450 " lvresize-free lv percent\n"
11455 #: ../fish/guestfish-actions.pod:2985 ../src/guestfs-actions.pod:4480
11457 "This expands an existing logical volume C<lv> so that it fills C<pc>% of the "
11458 "remaining free space in the volume group. Commonly you would call this with "
11459 "pc = 100 which expands the logical volume as much as possible, using all "
11460 "remaining free space in the volume group."
11464 #: ../fish/guestfish-actions.pod:2991
11469 #: ../fish/guestfish-actions.pod:2993
11477 #: ../fish/guestfish-actions.pod:2995 ../src/guestfs-actions.pod:4495
11479 "List all the logical volumes detected. This is the equivalent of the "
11480 "L<lvs(8)> command."
11484 #: ../fish/guestfish-actions.pod:2998 ../src/guestfs-actions.pod:4498
11486 "This returns a list of the logical volume device names "
11487 "(eg. C</dev/VolGroup00/LogVol00>)."
11491 #: ../fish/guestfish-actions.pod:3001
11492 msgid "See also L</lvs-full>, L</list-filesystems>."
11496 #: ../fish/guestfish-actions.pod:3003
11501 #: ../fish/guestfish-actions.pod:3005
11509 #: ../fish/guestfish-actions.pod:3007 ../src/guestfs-actions.pod:4514
11511 "List all the logical volumes detected. This is the equivalent of the "
11512 "L<lvs(8)> command. The \"full\" version includes all fields."
11516 #: ../fish/guestfish-actions.pod:3010
11521 #: ../fish/guestfish-actions.pod:3012
11529 #: ../fish/guestfish-actions.pod:3014 ../src/guestfs-actions.pod:4529
11530 msgid "This command returns the UUID of the LVM LV C<device>."
11534 #: ../fish/guestfish-actions.pod:3016
11539 #: ../fish/guestfish-actions.pod:3018
11542 " lxattrlist path 'names ...'\n"
11547 #: ../fish/guestfish-actions.pod:3020 ../src/guestfs-actions.pod:4543
11549 "This call allows you to get the extended attributes of multiple files, where "
11550 "all files are in the directory C<path>. C<names> is the list of files from "
11555 #: ../fish/guestfish-actions.pod:3024 ../src/guestfs-actions.pod:4547
11557 "On return you get a flat list of xattr structs which must be interpreted "
11558 "sequentially. The first xattr struct always has a zero-length C<attrname>. "
11559 "C<attrval> in this struct is zero-length to indicate there was an error "
11560 "doing C<lgetxattr> for this file, I<or> is a C string which is a decimal "
11561 "number (the number of following attributes for this file, which could be "
11562 "C<\"0\">). Then after the first xattr struct are the zero or more "
11563 "attributes for the first named file. This repeats for the second and "
11564 "subsequent files."
11568 #: ../fish/guestfish-actions.pod:3034
11570 "This call is intended for programs that want to efficiently list a directory "
11571 "contents without making many round-trips. See also L</lstatlist> for a "
11572 "similarly efficient call for getting standard stats. Very long directory "
11573 "listings might cause the protocol message size to be exceeded, causing this "
11574 "call to fail. The caller must split up such requests into smaller groups of "
11579 #: ../fish/guestfish-actions.pod:3042
11584 #: ../fish/guestfish-actions.pod:3044
11592 #: ../fish/guestfish-actions.pod:3046 ../src/guestfs-actions.pod:4577
11593 msgid "Create a directory named C<path>."
11597 #: ../fish/guestfish-actions.pod:3048
11602 #: ../fish/guestfish-actions.pod:3050
11605 " mkdir-mode path mode\n"
11610 #: ../fish/guestfish-actions.pod:3052 ../src/guestfs-actions.pod:4590
11612 "This command creates a directory, setting the initial permissions of the "
11613 "directory to C<mode>."
11617 #: ../fish/guestfish-actions.pod:3055 ../src/guestfs-actions.pod:4593
11619 "For common Linux filesystems, the actual mode which is set will be C<mode & "
11620 "~umask & 01777>. Non-native-Linux filesystems may interpret the mode in "
11625 #: ../fish/guestfish-actions.pod:3059
11626 msgid "See also L</mkdir>, L</umask>"
11630 #: ../fish/guestfish-actions.pod:3061
11635 #: ../fish/guestfish-actions.pod:3063
11643 #: ../fish/guestfish-actions.pod:3065 ../src/guestfs-actions.pod:4609
11645 "Create a directory named C<path>, creating any parent directories as "
11646 "necessary. This is like the C<mkdir -p> shell command."
11650 #: ../fish/guestfish-actions.pod:3068
11655 #: ../fish/guestfish-actions.pod:3070
11658 " mkdtemp template\n"
11663 #: ../fish/guestfish-actions.pod:3072 ../src/guestfs-actions.pod:4622
11665 "This command creates a temporary directory. The C<template> parameter "
11666 "should be a full pathname for the temporary directory name with the final "
11667 "six characters being \"XXXXXX\"."
11671 #: ../fish/guestfish-actions.pod:3077 ../src/guestfs-actions.pod:4627
11673 "For example: \"/tmp/myprogXXXXXX\" or \"/Temp/myprogXXXXXX\", the second one "
11674 "being suitable for Windows filesystems."
11678 #: ../fish/guestfish-actions.pod:3080 ../src/guestfs-actions.pod:4630
11679 msgid "The name of the temporary directory that was created is returned."
11683 #: ../fish/guestfish-actions.pod:3083 ../src/guestfs-actions.pod:4633
11684 msgid "The temporary directory is created with mode 0700 and is owned by root."
11688 #: ../fish/guestfish-actions.pod:3086 ../src/guestfs-actions.pod:4636
11690 "The caller is responsible for deleting the temporary directory and its "
11691 "contents after use."
11695 #: ../fish/guestfish-actions.pod:3089 ../src/guestfs-actions.pod:4639
11696 msgid "See also: L<mkdtemp(3)>"
11700 #: ../fish/guestfish-actions.pod:3091
11705 #: ../fish/guestfish-actions.pod:3093
11708 " mke2fs-J fstype blocksize device journal\n"
11713 #: ../fish/guestfish-actions.pod:3095 ../src/guestfs-actions.pod:4655
11715 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11716 "C<journal>. It is equivalent to the command:"
11720 #: ../fish/guestfish-actions.pod:3099 ../src/guestfs-actions.pod:4659
11723 " mke2fs -t fstype -b blocksize -J device=<journal> <device>\n"
11728 #: ../fish/guestfish-actions.pod:3101
11729 msgid "See also L</mke2journal>."
11733 #: ../fish/guestfish-actions.pod:3103
11738 #: ../fish/guestfish-actions.pod:3105
11741 " mke2fs-JL fstype blocksize device label\n"
11746 #: ../fish/guestfish-actions.pod:3107 ../src/guestfs-actions.pod:4676
11748 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11749 "the journal labeled C<label>."
11753 #: ../fish/guestfish-actions.pod:3110
11754 msgid "See also L</mke2journal-L>."
11758 #: ../fish/guestfish-actions.pod:3112
11763 #: ../fish/guestfish-actions.pod:3114
11766 " mke2fs-JU fstype blocksize device uuid\n"
11771 #: ../fish/guestfish-actions.pod:3116 ../src/guestfs-actions.pod:4694
11773 "This creates an ext2/3/4 filesystem on C<device> with an external journal on "
11774 "the journal with UUID C<uuid>."
11778 #: ../fish/guestfish-actions.pod:3119
11779 msgid "See also L</mke2journal-U>."
11783 #: ../fish/guestfish-actions.pod:3121
11784 msgid "mke2journal"
11788 #: ../fish/guestfish-actions.pod:3123
11791 " mke2journal blocksize device\n"
11796 #: ../fish/guestfish-actions.pod:3125 ../src/guestfs-actions.pod:4710
11798 "This creates an ext2 external journal on C<device>. It is equivalent to the "
11803 #: ../fish/guestfish-actions.pod:3128 ../src/guestfs-actions.pod:4713
11806 " mke2fs -O journal_dev -b blocksize device\n"
11811 #: ../fish/guestfish-actions.pod:3130
11812 msgid "mke2journal-L"
11816 #: ../fish/guestfish-actions.pod:3132
11819 " mke2journal-L blocksize label device\n"
11824 #: ../fish/guestfish-actions.pod:3134 ../src/guestfs-actions.pod:4727
11825 msgid "This creates an ext2 external journal on C<device> with label C<label>."
11829 #: ../fish/guestfish-actions.pod:3136
11830 msgid "mke2journal-U"
11834 #: ../fish/guestfish-actions.pod:3138
11837 " mke2journal-U blocksize uuid device\n"
11842 #: ../fish/guestfish-actions.pod:3140 ../src/guestfs-actions.pod:4741
11843 msgid "This creates an ext2 external journal on C<device> with UUID C<uuid>."
11847 #: ../fish/guestfish-actions.pod:3142
11852 #: ../fish/guestfish-actions.pod:3144
11855 " mkfifo mode path\n"
11860 #: ../fish/guestfish-actions.pod:3146
11862 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
11863 "is just a convenient wrapper around L</mknod>."
11867 #: ../fish/guestfish-actions.pod:3152
11872 #: ../fish/guestfish-actions.pod:3154
11875 " mkfs fstype device\n"
11880 #: ../fish/guestfish-actions.pod:3156 ../src/guestfs-actions.pod:4771
11882 "This creates a filesystem on C<device> (usually a partition or LVM logical "
11883 "volume). The filesystem type is C<fstype>, for example C<ext3>."
11887 #: ../fish/guestfish-actions.pod:3160
11892 #: ../fish/guestfish-actions.pod:3162
11895 " mkfs-b fstype blocksize device\n"
11900 #: ../fish/guestfish-actions.pod:3164
11902 "This call is similar to L</mkfs>, but it allows you to control the block "
11903 "size of the resulting filesystem. Supported block sizes depend on the "
11904 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
11908 #: ../fish/guestfish-actions.pod:3169 ../fish/guestfish-actions.pod:3196 ../src/guestfs-actions.pod:4799 ../src/guestfs-actions.pod:4837
11910 "For VFAT and NTFS the C<blocksize> parameter is treated as the requested "
11915 #: ../fish/guestfish-actions.pod:3172
11917 "I<This function is deprecated.> In new code, use the L</mkfs_opts> call "
11922 #: ../fish/guestfish-actions.pod:3179
11927 #: ../fish/guestfish-actions.pod:3181
11930 " mkfs-opts fstype device [blocksize:..] [features:..] [inode:..] "
11931 "[sectorsize:..]\n"
11936 #: ../fish/guestfish-actions.pod:3183 ../src/guestfs-actions.pod:4824
11938 "This function creates a filesystem on C<device>. The filesystem type is "
11939 "C<fstype>, for example C<ext3>."
11943 #: ../fish/guestfish-actions.pod:3190 ../src/guestfs-actions.pod:4831
11944 msgid "C<blocksize>"
11948 #: ../fish/guestfish-actions.pod:3192 ../src/guestfs-actions.pod:4833
11950 "The filesystem block size. Supported block sizes depend on the filesystem "
11951 "type, but typically they are C<1024>, C<2048> or C<4096> for Linux ext2/3 "
11956 #: ../fish/guestfish-actions.pod:3199 ../src/guestfs-actions.pod:4840
11957 msgid "For UFS block sizes, please see L<mkfs.ufs(8)>."
11961 #: ../fish/guestfish-actions.pod:3201 ../src/guestfs-actions.pod:4842
11962 msgid "C<features>"
11966 #: ../fish/guestfish-actions.pod:3203 ../src/guestfs-actions.pod:4844
11967 msgid "This passes the I<-O> parameter to the external mkfs program."
11971 #: ../fish/guestfish-actions.pod:3205 ../src/guestfs-actions.pod:4846
11973 "For certain filesystem types, this allows extra filesystem features to be "
11974 "selected. See L<mke2fs(8)> and L<mkfs.ufs(8)> for more details."
11978 #: ../fish/guestfish-actions.pod:3209 ../src/guestfs-actions.pod:4850
11980 "You cannot use this optional parameter with the C<gfs> or C<gfs2> filesystem "
11985 #: ../fish/guestfish-actions.pod:3212 ../src/guestfs-actions.pod:4853
11990 #: ../fish/guestfish-actions.pod:3214 ../src/guestfs-actions.pod:4855
11992 "This passes the I<-I> parameter to the external L<mke2fs(8)> program which "
11993 "sets the inode size (only for ext2/3/4 filesystems at present)."
11997 #: ../fish/guestfish-actions.pod:3217 ../src/guestfs-actions.pod:4858
11998 msgid "C<sectorsize>"
12002 #: ../fish/guestfish-actions.pod:3219 ../src/guestfs-actions.pod:4860
12004 "This passes the I<-S> parameter to external L<mkfs.ufs(8)> program, which "
12005 "sets sector size for ufs filesystem."
12009 #: ../fish/guestfish-actions.pod:3226
12010 msgid "mkmountpoint"
12014 #: ../fish/guestfish-actions.pod:3228
12017 " mkmountpoint exemptpath\n"
12022 #: ../fish/guestfish-actions.pod:3230
12024 "L</mkmountpoint> and L</rmmountpoint> are specialized calls that can be used "
12025 "to create extra mountpoints before mounting the first filesystem."
12029 #: ../fish/guestfish-actions.pod:3234 ../src/guestfs-actions.pod:4903
12031 "These calls are I<only> necessary in some very limited circumstances, mainly "
12032 "the case where you want to mount a mix of unrelated and/or read-only "
12033 "filesystems together."
12037 #: ../fish/guestfish-actions.pod:3238 ../src/guestfs-actions.pod:4907
12039 "For example, live CDs often contain a \"Russian doll\" nest of filesystems, "
12040 "an ISO outer layer, with a squashfs image inside, with an ext2/3 image "
12041 "inside that. You can unpack this as follows in guestfish:"
12045 #: ../fish/guestfish-actions.pod:3243 ../src/guestfs-actions.pod:4912
12048 " add-ro Fedora-11-i686-Live.iso\n"
12050 " mkmountpoint /cd\n"
12051 " mkmountpoint /sqsh\n"
12052 " mkmountpoint /ext3fs\n"
12053 " mount /dev/sda /cd\n"
12054 " mount-loop /cd/LiveOS/squashfs.img /sqsh\n"
12055 " mount-loop /sqsh/LiveOS/ext3fs.img /ext3fs\n"
12060 #: ../fish/guestfish-actions.pod:3252 ../src/guestfs-actions.pod:4921
12061 msgid "The inner filesystem is now unpacked under the /ext3fs mountpoint."
12065 #: ../fish/guestfish-actions.pod:3254
12067 "L</mkmountpoint> is not compatible with L</umount-all>. You may get "
12068 "unexpected errors if you try to mix these calls. It is safest to manually "
12069 "unmount filesystems and remove mountpoints after use."
12073 #: ../fish/guestfish-actions.pod:3258
12075 "L</umount-all> unmounts filesystems by sorting the paths longest first, so "
12076 "for this to work for manual mountpoints, you must ensure that the innermost "
12077 "mountpoints have the longest pathnames, as in the example code above."
12081 #: ../fish/guestfish-actions.pod:3263 ../src/guestfs-actions.pod:4932
12082 msgid "For more details see L<https://bugzilla.redhat.com/show_bug.cgi?id=599503>"
12086 #: ../fish/guestfish-actions.pod:3265
12088 "Autosync [see L</set-autosync>, this is set by default on handles] can cause "
12089 "L</umount-all> to be called when the handle is closed which can also trigger "
12094 #: ../fish/guestfish-actions.pod:3269
12099 #: ../fish/guestfish-actions.pod:3271
12102 " mknod mode devmajor devminor path\n"
12107 #: ../fish/guestfish-actions.pod:3273 ../src/guestfs-actions.pod:4951
12109 "This call creates block or character special devices, or named pipes "
12114 #: ../fish/guestfish-actions.pod:3276 ../src/guestfs-actions.pod:4954
12116 "The C<mode> parameter should be the mode, using the standard constants. "
12117 "C<devmajor> and C<devminor> are the device major and minor numbers, only "
12118 "used when creating block and character special devices."
12122 #: ../fish/guestfish-actions.pod:3281
12124 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
12125 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
12126 "regular file). These constants are available in the standard Linux header "
12127 "files, or you can use L</mknod-b>, L</mknod-c> or L</mkfifo> which are "
12128 "wrappers around this command which bitwise OR in the appropriate constant "
12133 #: ../fish/guestfish-actions.pod:3291
12138 #: ../fish/guestfish-actions.pod:3293
12141 " mknod-b mode devmajor devminor path\n"
12146 #: ../fish/guestfish-actions.pod:3295
12148 "This call creates a block device node called C<path> with mode C<mode> and "
12149 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12150 "wrapper around L</mknod>."
12154 #: ../fish/guestfish-actions.pod:3301
12159 #: ../fish/guestfish-actions.pod:3303
12162 " mknod-c mode devmajor devminor path\n"
12167 #: ../fish/guestfish-actions.pod:3305
12169 "This call creates a char device node called C<path> with mode C<mode> and "
12170 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
12171 "wrapper around L</mknod>."
12175 #: ../fish/guestfish-actions.pod:3311
12180 #: ../fish/guestfish-actions.pod:3313
12188 #: ../fish/guestfish-actions.pod:3315 ../src/guestfs-actions.pod:5017
12189 msgid "Create a swap partition on C<device>."
12193 #: ../fish/guestfish-actions.pod:3317
12198 #: ../fish/guestfish-actions.pod:3319
12201 " mkswap-L label device\n"
12206 #: ../fish/guestfish-actions.pod:3321 ../src/guestfs-actions.pod:5030
12207 msgid "Create a swap partition on C<device> with label C<label>."
12211 #: ../fish/guestfish-actions.pod:3323 ../src/guestfs-actions.pod:5032
12213 "Note that you cannot attach a swap label to a block device "
12214 "(eg. C</dev/sda>), just to a partition. This appears to be a limitation of "
12215 "the kernel or swap tools."
12219 #: ../fish/guestfish-actions.pod:3327
12224 #: ../fish/guestfish-actions.pod:3329
12227 " mkswap-U uuid device\n"
12232 #: ../fish/guestfish-actions.pod:3331 ../src/guestfs-actions.pod:5047
12233 msgid "Create a swap partition on C<device> with UUID C<uuid>."
12237 #: ../fish/guestfish-actions.pod:3333
12238 msgid "mkswap-file"
12242 #: ../fish/guestfish-actions.pod:3335
12245 " mkswap-file path\n"
12250 #: ../fish/guestfish-actions.pod:3337 ../src/guestfs-actions.pod:5059
12251 msgid "Create a swap file."
12255 #: ../fish/guestfish-actions.pod:3339
12257 "This command just writes a swap file signature to an existing file. To "
12258 "create the file itself, use something like L</fallocate>."
12262 #: ../fish/guestfish-actions.pod:3342
12267 #: ../fish/guestfish-actions.pod:3344
12270 " modprobe modulename\n"
12275 #: ../fish/guestfish-actions.pod:3346 ../src/guestfs-actions.pod:5074
12276 msgid "This loads a kernel module in the appliance."
12280 #: ../fish/guestfish-actions.pod:3348 ../src/guestfs-actions.pod:5076
12282 "The kernel module must have been whitelisted when libguestfs was built (see "
12283 "C<appliance/kmod.whitelist.in> in the source)."
12287 #: ../fish/guestfish-actions.pod:3351
12292 #: ../fish/guestfish-actions.pod:3353
12295 " mount device mountpoint\n"
12300 #: ../fish/guestfish-actions.pod:3355 ../src/guestfs-actions.pod:5090
12302 "Mount a guest disk at a position in the filesystem. Block devices are named "
12303 "C</dev/sda>, C</dev/sdb> and so on, as they were added to the guest. If "
12304 "those block devices contain partitions, they will have the usual names "
12305 "(eg. C</dev/sda1>). Also LVM C</dev/VG/LV>-style names can be used."
12309 #: ../fish/guestfish-actions.pod:3361 ../src/guestfs-actions.pod:5096
12311 "The rules are the same as for L<mount(2)>: A filesystem must first be "
12312 "mounted on C</> before others can be mounted. Other filesystems can only be "
12313 "mounted on directories which already exist."
12317 #: ../fish/guestfish-actions.pod:3366 ../src/guestfs-actions.pod:5101
12319 "The mounted filesystem is writable, if we have sufficient permissions on the "
12320 "underlying device."
12324 #: ../fish/guestfish-actions.pod:3369
12326 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
12327 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
12328 "problems for users. If your program might need to work with older versions "
12329 "of libguestfs, use L</mount-options> instead (using an empty string for the "
12330 "first parameter if you don't want any options)."
12334 #: ../fish/guestfish-actions.pod:3376
12339 #: ../fish/guestfish-actions.pod:3378
12342 " mount-9p mounttag mountpoint [options:..]\n"
12347 #: ../fish/guestfish-actions.pod:3380 ../src/guestfs-actions.pod:5130
12349 "Mount the virtio-9p filesystem with the tag C<mounttag> on the directory "
12354 #: ../fish/guestfish-actions.pod:3383 ../src/guestfs-actions.pod:5133
12356 "If required, C<trans=virtio> will be automatically added to the options. "
12357 "Any other options required can be passed in the optional C<options> "
12362 #: ../fish/guestfish-actions.pod:3389
12367 #: ../fish/guestfish-actions.pod:3391
12370 " mount-loop file mountpoint\n"
12375 #: ../fish/guestfish-actions.pod:3393 ../src/guestfs-actions.pod:5172
12377 "This command lets you mount C<file> (a filesystem image in a file) on a "
12378 "mount point. It is entirely equivalent to the command C<mount -o loop file "
12383 #: ../fish/guestfish-actions.pod:3397
12384 msgid "mount-options"
12388 #: ../fish/guestfish-actions.pod:3399
12391 " mount-options options device mountpoint\n"
12396 #: ../fish/guestfish-actions.pod:3401
12398 "This is the same as the L</mount> command, but it allows you to set the "
12399 "mount options as for the L<mount(8)> I<-o> flag."
12403 #: ../fish/guestfish-actions.pod:3405 ../src/guestfs-actions.pod:5192
12405 "If the C<options> parameter is an empty string, then no options are passed "
12406 "(all options default to whatever the filesystem uses)."
12410 #: ../fish/guestfish-actions.pod:3409
12415 #: ../fish/guestfish-actions.pod:3411
12418 " mount-ro device mountpoint\n"
12423 #: ../fish/guestfish-actions.pod:3413
12425 "This is the same as the L</mount> command, but it mounts the filesystem with "
12426 "the read-only (I<-o ro>) flag."
12430 #: ../fish/guestfish-actions.pod:3416
12435 #: ../fish/guestfish-actions.pod:3418
12438 " mount-vfs options vfstype device mountpoint\n"
12443 #: ../fish/guestfish-actions.pod:3420
12445 "This is the same as the L</mount> command, but it allows you to set both the "
12446 "mount options and the vfstype as for the L<mount(8)> I<-o> and I<-t> flags."
12450 #: ../fish/guestfish-actions.pod:3424
12451 msgid "mountpoints"
12455 #: ../fish/guestfish-actions.pod:3426
12463 #: ../fish/guestfish-actions.pod:3428
12465 "This call is similar to L</mounts>. That call returns a list of devices. "
12466 "This one returns a hash table (map) of device name to directory where the "
12467 "device is mounted."
12471 #: ../fish/guestfish-actions.pod:3432
12476 #: ../fish/guestfish-actions.pod:3434
12484 #: ../fish/guestfish-actions.pod:3436 ../src/guestfs-actions.pod:5253
12486 "This returns the list of currently mounted filesystems. It returns the list "
12487 "of devices (eg. C</dev/sda1>, C</dev/VG/LV>)."
12491 #: ../fish/guestfish-actions.pod:3439 ../src/guestfs-actions.pod:5256
12492 msgid "Some internal mounts are not shown."
12496 #: ../fish/guestfish-actions.pod:3441
12497 msgid "See also: L</mountpoints>"
12501 #: ../fish/guestfish-actions.pod:3443
12506 #: ../fish/guestfish-actions.pod:3445
12514 #: ../fish/guestfish-actions.pod:3447 ../src/guestfs-actions.pod:5273
12516 "This moves a file from C<src> to C<dest> where C<dest> is either a "
12517 "destination filename or destination directory."
12521 #: ../fish/guestfish-actions.pod:3450
12522 msgid "ntfs-3g-probe"
12526 #: ../fish/guestfish-actions.pod:3452
12529 " ntfs-3g-probe true|false device\n"
12534 #: ../fish/guestfish-actions.pod:3454 ../src/guestfs-actions.pod:5287
12536 "This command runs the L<ntfs-3g.probe(8)> command which probes an NTFS "
12537 "C<device> for mountability. (Not all NTFS volumes can be mounted "
12538 "read-write, and some cannot be mounted at all)."
12542 #: ../fish/guestfish-actions.pod:3458 ../src/guestfs-actions.pod:5291
12544 "C<rw> is a boolean flag. Set it to true if you want to test if the volume "
12545 "can be mounted read-write. Set it to false if you want to test if the "
12546 "volume can be mounted read-only."
12550 #: ../fish/guestfish-actions.pod:3462 ../src/guestfs-actions.pod:5295
12552 "The return value is an integer which C<0> if the operation would succeed, or "
12553 "some non-zero value documented in the L<ntfs-3g.probe(8)> manual page."
12557 #: ../fish/guestfish-actions.pod:3466
12562 #: ../fish/guestfish-actions.pod:3468
12565 " ntfsresize device\n"
12570 #: ../fish/guestfish-actions.pod:3470 ../fish/guestfish-actions.pod:3494 ../src/guestfs-actions.pod:5316 ../src/guestfs-actions.pod:5348
12572 "This command resizes an NTFS filesystem, expanding or shrinking it to the "
12573 "size of the underlying device."
12577 #: ../fish/guestfish-actions.pod:3473 ../src/guestfs-actions.pod:5319
12579 "I<Note:> After the resize operation, the filesystem is marked as requiring a "
12580 "consistency check (for safety). You have to boot into Windows to perform "
12581 "this check and clear this condition. Furthermore, ntfsresize refuses to "
12582 "resize filesystems which have been marked in this way. So in effect it is "
12583 "not possible to call ntfsresize multiple times on a single filesystem "
12584 "without booting into Windows between each resize."
12588 #: ../fish/guestfish-actions.pod:3481 ../fish/guestfish-actions.pod:3520 ../src/guestfs-actions.pod:5327 ../src/guestfs-actions.pod:5374
12589 msgid "See also L<ntfsresize(8)>."
12593 #: ../fish/guestfish-actions.pod:3483 ../fish/guestfish-actions.pod:3531
12595 "I<This function is deprecated.> In new code, use the L</ntfsresize_opts> "
12600 #: ../fish/guestfish-actions.pod:3490
12601 msgid "ntfsresize-opts"
12605 #: ../fish/guestfish-actions.pod:3492
12608 " ntfsresize-opts device [size:..] [force:..]\n"
12613 #: ../fish/guestfish-actions.pod:3503 ../src/guestfs-actions.pod:5357
12615 "The new size (in bytes) of the filesystem. If omitted, the filesystem is "
12616 "resized to fit the container (eg. partition)."
12620 #: ../fish/guestfish-actions.pod:3506 ../src/guestfs-actions.pod:5360
12625 #: ../fish/guestfish-actions.pod:3508 ../src/guestfs-actions.pod:5362
12627 "If this option is true, then force the resize of the filesystem even if the "
12628 "filesystem is marked as requiring a consistency check."
12632 #: ../fish/guestfish-actions.pod:3511
12634 "After the resize operation, the filesystem is always marked as requiring a "
12635 "consistency check (for safety). You have to boot into Windows to perform "
12636 "this check and clear this condition. If you I<don't> set the C<force> "
12637 "option then it is not possible to call L</ntfsresize-opts> multiple times on "
12638 "a single filesystem without booting into Windows between each resize."
12642 #: ../fish/guestfish-actions.pod:3524
12643 msgid "ntfsresize-size"
12647 #: ../fish/guestfish-actions.pod:3526
12650 " ntfsresize-size device size\n"
12655 #: ../fish/guestfish-actions.pod:3528
12657 "This command is the same as L</ntfsresize> except that it allows you to "
12658 "specify the new size (in bytes) explicitly."
12662 #: ../fish/guestfish-actions.pod:3538
12667 #: ../fish/guestfish-actions.pod:3540
12670 " part-add device prlogex startsect endsect\n"
12675 #: ../fish/guestfish-actions.pod:3542
12677 "This command adds a partition to C<device>. If there is no partition table "
12678 "on the device, call L</part-init> first."
12682 #: ../fish/guestfish-actions.pod:3545 ../src/guestfs-actions.pod:5435
12684 "The C<prlogex> parameter is the type of partition. Normally you should pass "
12685 "C<p> or C<primary> here, but MBR partition tables also support C<l> (or "
12686 "C<logical>) and C<e> (or C<extended>) partition types."
12690 #: ../fish/guestfish-actions.pod:3550 ../src/guestfs-actions.pod:5440
12692 "C<startsect> and C<endsect> are the start and end of the partition in "
12693 "I<sectors>. C<endsect> may be negative, which means it counts backwards "
12694 "from the end of the disk (C<-1> is the last sector)."
12698 #: ../fish/guestfish-actions.pod:3554
12700 "Creating a partition which covers the whole disk is not so easy. Use "
12701 "L</part-disk> to do that."
12705 #: ../fish/guestfish-actions.pod:3557
12710 #: ../fish/guestfish-actions.pod:3559
12713 " part-del device partnum\n"
12718 #: ../fish/guestfish-actions.pod:3561 ../src/guestfs-actions.pod:5458
12719 msgid "This command deletes the partition numbered C<partnum> on C<device>."
12723 #: ../fish/guestfish-actions.pod:3563 ../src/guestfs-actions.pod:5460
12725 "Note that in the case of MBR partitioning, deleting an extended partition "
12726 "also deletes any logical partitions it contains."
12730 #: ../fish/guestfish-actions.pod:3567
12735 #: ../fish/guestfish-actions.pod:3569
12738 " part-disk device parttype\n"
12743 #: ../fish/guestfish-actions.pod:3571
12745 "This command is simply a combination of L</part-init> followed by "
12746 "L</part-add> to create a single primary partition covering the whole disk."
12750 #: ../fish/guestfish-actions.pod:3575
12752 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
12753 "possible values are described in L</part-init>."
12757 #: ../fish/guestfish-actions.pod:3581
12758 msgid "part-get-bootable"
12762 #: ../fish/guestfish-actions.pod:3583
12765 " part-get-bootable device partnum\n"
12770 #: ../fish/guestfish-actions.pod:3585 ../src/guestfs-actions.pod:5496
12772 "This command returns true if the partition C<partnum> on C<device> has the "
12773 "bootable flag set."
12777 #: ../fish/guestfish-actions.pod:3588
12778 msgid "See also L</part-set-bootable>."
12782 #: ../fish/guestfish-actions.pod:3590
12783 msgid "part-get-mbr-id"
12787 #: ../fish/guestfish-actions.pod:3592
12790 " part-get-mbr-id device partnum\n"
12795 #: ../fish/guestfish-actions.pod:3594 ../src/guestfs-actions.pod:5512
12797 "Returns the MBR type byte (also known as the ID byte) from the numbered "
12798 "partition C<partnum>."
12802 #: ../fish/guestfish-actions.pod:3597 ../fish/guestfish-actions.pod:3741
12804 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
12805 "undefined results for other partition table types (see "
12806 "L</part-get-parttype>)."
12810 #: ../fish/guestfish-actions.pod:3601
12811 msgid "part-get-parttype"
12815 #: ../fish/guestfish-actions.pod:3603
12818 " part-get-parttype device\n"
12823 #: ../fish/guestfish-actions.pod:3605 ../src/guestfs-actions.pod:5529
12825 "This command examines the partition table on C<device> and returns the "
12826 "partition table type (format) being used."
12830 #: ../fish/guestfish-actions.pod:3608
12832 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
12833 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
12834 "possible, although unusual. See L</part-init> for a full list."
12838 #: ../fish/guestfish-actions.pod:3613
12843 #: ../fish/guestfish-actions.pod:3615
12846 " part-init device parttype\n"
12851 #: ../fish/guestfish-actions.pod:3617 ../src/guestfs-actions.pod:5549
12853 "This creates an empty partition table on C<device> of one of the partition "
12854 "types listed below. Usually C<parttype> should be either C<msdos> or C<gpt> "
12855 "(for large disks)."
12859 #: ../fish/guestfish-actions.pod:3621
12861 "Initially there are no partitions. Following this, you should call "
12862 "L</part-add> for each partition required."
12866 #: ../fish/guestfish-actions.pod:3624 ../src/guestfs-actions.pod:5556
12867 msgid "Possible values for C<parttype> are:"
12871 #: ../fish/guestfish-actions.pod:3628 ../src/guestfs-actions.pod:5560
12876 #: ../fish/guestfish-actions.pod:3630 ../src/guestfs-actions.pod:5562
12881 #: ../fish/guestfish-actions.pod:3632 ../src/guestfs-actions.pod:5564
12882 msgid "Intel EFI / GPT partition table."
12886 #: ../fish/guestfish-actions.pod:3634 ../src/guestfs-actions.pod:5566
12888 "This is recommended for >= 2 TB partitions that will be accessed from Linux "
12889 "and Intel-based Mac OS X. It also has limited backwards compatibility with "
12890 "the C<mbr> format."
12894 #: ../fish/guestfish-actions.pod:3638 ../src/guestfs-actions.pod:5570
12899 #: ../fish/guestfish-actions.pod:3640 ../src/guestfs-actions.pod:5572
12904 #: ../fish/guestfish-actions.pod:3642 ../src/guestfs-actions.pod:5574
12906 "The standard PC \"Master Boot Record\" (MBR) format used by MS-DOS and "
12907 "Windows. This partition type will B<only> work for device sizes up to 2 "
12908 "TB. For large disks we recommend using C<gpt>."
12912 #: ../fish/guestfish-actions.pod:3649 ../src/guestfs-actions.pod:5581
12913 msgid "Other partition table types that may work but are not supported include:"
12917 #: ../fish/guestfish-actions.pod:3654 ../src/guestfs-actions.pod:5586
12922 #: ../fish/guestfish-actions.pod:3656 ../src/guestfs-actions.pod:5588
12923 msgid "AIX disk labels."
12927 #: ../fish/guestfish-actions.pod:3658 ../src/guestfs-actions.pod:5590
12932 #: ../fish/guestfish-actions.pod:3660 ../src/guestfs-actions.pod:5592
12937 #: ../fish/guestfish-actions.pod:3662 ../src/guestfs-actions.pod:5594
12938 msgid "Amiga \"Rigid Disk Block\" format."
12942 #: ../fish/guestfish-actions.pod:3664 ../src/guestfs-actions.pod:5596
12947 #: ../fish/guestfish-actions.pod:3666 ../src/guestfs-actions.pod:5598
12948 msgid "BSD disk labels."
12952 #: ../fish/guestfish-actions.pod:3668 ../src/guestfs-actions.pod:5600
12957 #: ../fish/guestfish-actions.pod:3670 ../src/guestfs-actions.pod:5602
12958 msgid "DASD, used on IBM mainframes."
12962 #: ../fish/guestfish-actions.pod:3672 ../src/guestfs-actions.pod:5604
12967 #: ../fish/guestfish-actions.pod:3674 ../src/guestfs-actions.pod:5606
12968 msgid "MIPS/SGI volumes."
12972 #: ../fish/guestfish-actions.pod:3676 ../src/guestfs-actions.pod:5608
12977 #: ../fish/guestfish-actions.pod:3678 ../src/guestfs-actions.pod:5610
12978 msgid "Old Mac partition format. Modern Macs use C<gpt>."
12982 #: ../fish/guestfish-actions.pod:3680 ../src/guestfs-actions.pod:5612
12987 #: ../fish/guestfish-actions.pod:3682 ../src/guestfs-actions.pod:5614
12988 msgid "NEC PC-98 format, common in Japan apparently."
12992 #: ../fish/guestfish-actions.pod:3684 ../src/guestfs-actions.pod:5616
12997 #: ../fish/guestfish-actions.pod:3686 ../src/guestfs-actions.pod:5618
12998 msgid "Sun disk labels."
13002 #: ../fish/guestfish-actions.pod:3690
13007 #: ../fish/guestfish-actions.pod:3692
13010 " part-list device\n"
13015 #: ../fish/guestfish-actions.pod:3694 ../src/guestfs-actions.pod:5632
13017 "This command parses the partition table on C<device> and returns the list of "
13018 "partitions found."
13022 #: ../fish/guestfish-actions.pod:3697 ../src/guestfs-actions.pod:5635
13023 msgid "The fields in the returned structure are:"
13027 #: ../fish/guestfish-actions.pod:3701 ../src/guestfs-actions.pod:5639
13028 msgid "B<part_num>"
13032 #: ../fish/guestfish-actions.pod:3703 ../src/guestfs-actions.pod:5641
13033 msgid "Partition number, counting from 1."
13037 #: ../fish/guestfish-actions.pod:3705 ../src/guestfs-actions.pod:5643
13038 msgid "B<part_start>"
13042 #: ../fish/guestfish-actions.pod:3707
13044 "Start of the partition I<in bytes>. To get sectors you have to divide by "
13045 "the device's sector size, see L</blockdev-getss>."
13049 #: ../fish/guestfish-actions.pod:3710 ../src/guestfs-actions.pod:5648
13050 msgid "B<part_end>"
13054 #: ../fish/guestfish-actions.pod:3712 ../src/guestfs-actions.pod:5650
13055 msgid "End of the partition in bytes."
13059 #: ../fish/guestfish-actions.pod:3714 ../src/guestfs-actions.pod:5652
13060 msgid "B<part_size>"
13064 #: ../fish/guestfish-actions.pod:3716 ../src/guestfs-actions.pod:5654
13065 msgid "Size of the partition in bytes."
13069 #: ../fish/guestfish-actions.pod:3720
13070 msgid "part-set-bootable"
13074 #: ../fish/guestfish-actions.pod:3722
13077 " part-set-bootable device partnum true|false\n"
13082 #: ../fish/guestfish-actions.pod:3724 ../src/guestfs-actions.pod:5672
13084 "This sets the bootable flag on partition numbered C<partnum> on device "
13085 "C<device>. Note that partitions are numbered from 1."
13089 #: ../fish/guestfish-actions.pod:3727 ../src/guestfs-actions.pod:5675
13091 "The bootable flag is used by some operating systems (notably Windows) to "
13092 "determine which partition to boot from. It is by no means universally "
13097 #: ../fish/guestfish-actions.pod:3731
13098 msgid "part-set-mbr-id"
13102 #: ../fish/guestfish-actions.pod:3733
13105 " part-set-mbr-id device partnum idbyte\n"
13110 #: ../fish/guestfish-actions.pod:3735 ../src/guestfs-actions.pod:5691
13112 "Sets the MBR type byte (also known as the ID byte) of the numbered partition "
13113 "C<partnum> to C<idbyte>. Note that the type bytes quoted in most "
13114 "documentation are in fact hexadecimal numbers, but usually documented "
13115 "without any leading \"0x\" which might be confusing."
13119 #: ../fish/guestfish-actions.pod:3745
13120 msgid "part-set-name"
13124 #: ../fish/guestfish-actions.pod:3747
13127 " part-set-name device partnum name\n"
13132 #: ../fish/guestfish-actions.pod:3749 ../src/guestfs-actions.pod:5713
13134 "This sets the partition name on partition numbered C<partnum> on device "
13135 "C<device>. Note that partitions are numbered from 1."
13139 #: ../fish/guestfish-actions.pod:3752 ../src/guestfs-actions.pod:5716
13141 "The partition name can only be set on certain types of partition table. "
13142 "This works on C<gpt> but not on C<mbr> partitions."
13146 #: ../fish/guestfish-actions.pod:3755
13147 msgid "part-to-dev"
13151 #: ../fish/guestfish-actions.pod:3757
13154 " part-to-dev partition\n"
13159 #: ../fish/guestfish-actions.pod:3759 ../src/guestfs-actions.pod:5729
13161 "This function takes a partition name (eg. \"/dev/sdb1\") and removes the "
13162 "partition number, returning the device name (eg. \"/dev/sdb\")."
13166 #: ../fish/guestfish-actions.pod:3763
13168 "The named partition must exist, for example as a string returned from "
13169 "L</list-partitions>."
13173 #: ../fish/guestfish-actions.pod:3766
13174 msgid "ping-daemon"
13178 #: ../fish/guestfish-actions.pod:3768
13186 #: ../fish/guestfish-actions.pod:3770 ../src/guestfs-actions.pod:5746
13188 "This is a test probe into the guestfs daemon running inside the qemu "
13189 "subprocess. Calling this function checks that the daemon responds to the "
13190 "ping message, without affecting the daemon or attached block device(s) in "
13195 #: ../fish/guestfish-actions.pod:3775
13200 #: ../fish/guestfish-actions.pod:3777
13203 " pread path count offset\n"
13208 #: ../fish/guestfish-actions.pod:3779 ../src/guestfs-actions.pod:5764
13210 "This command lets you read part of a file. It reads C<count> bytes of the "
13211 "file, starting at C<offset>, from file C<path>."
13215 #: ../fish/guestfish-actions.pod:3782 ../fish/guestfish-actions.pod:3797 ../src/guestfs-actions.pod:5767 ../src/guestfs-actions.pod:5793
13217 "This may read fewer bytes than requested. For further details see the "
13218 "L<pread(2)> system call."
13222 #: ../fish/guestfish-actions.pod:3785
13223 msgid "See also L</pwrite>, L</pread-device>."
13227 #: ../fish/guestfish-actions.pod:3790
13228 msgid "pread-device"
13232 #: ../fish/guestfish-actions.pod:3792
13235 " pread-device device count offset\n"
13240 #: ../fish/guestfish-actions.pod:3794 ../src/guestfs-actions.pod:5790
13242 "This command lets you read part of a file. It reads C<count> bytes of "
13243 "C<device>, starting at C<offset>."
13247 #: ../fish/guestfish-actions.pod:3800
13248 msgid "See also L</pread>."
13252 #: ../fish/guestfish-actions.pod:3805
13257 #: ../fish/guestfish-actions.pod:3807
13260 " pvcreate device\n"
13265 #: ../fish/guestfish-actions.pod:3809 ../src/guestfs-actions.pod:5813
13267 "This creates an LVM physical volume on the named C<device>, where C<device> "
13268 "should usually be a partition name such as C</dev/sda1>."
13272 #: ../fish/guestfish-actions.pod:3813
13277 #: ../fish/guestfish-actions.pod:3815
13280 " pvremove device\n"
13285 #: ../fish/guestfish-actions.pod:3817 ../src/guestfs-actions.pod:5827
13287 "This wipes a physical volume C<device> so that LVM will no longer recognise "
13292 #: ../fish/guestfish-actions.pod:3820 ../src/guestfs-actions.pod:5830
13294 "The implementation uses the C<pvremove> command which refuses to wipe "
13295 "physical volumes that contain any volume groups, so you have to remove those "
13300 #: ../fish/guestfish-actions.pod:3824
13305 #: ../fish/guestfish-actions.pod:3826
13308 " pvresize device\n"
13313 #: ../fish/guestfish-actions.pod:3828 ../src/guestfs-actions.pod:5844
13315 "This resizes (expands or shrinks) an existing LVM physical volume to match "
13316 "the new size of the underlying device."
13320 #: ../fish/guestfish-actions.pod:3831
13321 msgid "pvresize-size"
13325 #: ../fish/guestfish-actions.pod:3833
13328 " pvresize-size device size\n"
13333 #: ../fish/guestfish-actions.pod:3835
13335 "This command is the same as L</pvresize> except that it allows you to "
13336 "specify the new size (in bytes) explicitly."
13340 #: ../fish/guestfish-actions.pod:3838
13345 #: ../fish/guestfish-actions.pod:3840
13353 #: ../fish/guestfish-actions.pod:3842 ../src/guestfs-actions.pod:5870
13355 "List all the physical volumes detected. This is the equivalent of the "
13356 "L<pvs(8)> command."
13360 #: ../fish/guestfish-actions.pod:3845 ../src/guestfs-actions.pod:5873
13362 "This returns a list of just the device names that contain PVs "
13363 "(eg. C</dev/sda2>)."
13367 #: ../fish/guestfish-actions.pod:3848
13368 msgid "See also L</pvs-full>."
13372 #: ../fish/guestfish-actions.pod:3850
13377 #: ../fish/guestfish-actions.pod:3852
13385 #: ../fish/guestfish-actions.pod:3854 ../src/guestfs-actions.pod:5889
13387 "List all the physical volumes detected. This is the equivalent of the "
13388 "L<pvs(8)> command. The \"full\" version includes all fields."
13392 #: ../fish/guestfish-actions.pod:3857
13397 #: ../fish/guestfish-actions.pod:3859
13405 #: ../fish/guestfish-actions.pod:3861 ../src/guestfs-actions.pod:5904
13406 msgid "This command returns the UUID of the LVM PV C<device>."
13410 #: ../fish/guestfish-actions.pod:3863
13415 #: ../fish/guestfish-actions.pod:3865
13418 " pwrite path content offset\n"
13423 #: ../fish/guestfish-actions.pod:3867 ../src/guestfs-actions.pod:5920
13425 "This command writes to part of a file. It writes the data buffer C<content> "
13426 "to the file C<path> starting at offset C<offset>."
13430 #: ../fish/guestfish-actions.pod:3870 ../src/guestfs-actions.pod:5923
13432 "This command implements the L<pwrite(2)> system call, and like that system "
13433 "call it may not write the full data requested. The return value is the "
13434 "number of bytes that were actually written to the file. This could even be "
13435 "0, although short writes are unlikely for regular files in ordinary "
13440 #: ../fish/guestfish-actions.pod:3876
13441 msgid "See also L</pread>, L</pwrite-device>."
13445 #: ../fish/guestfish-actions.pod:3881
13446 msgid "pwrite-device"
13450 #: ../fish/guestfish-actions.pod:3883
13453 " pwrite-device device content offset\n"
13458 #: ../fish/guestfish-actions.pod:3885 ../src/guestfs-actions.pod:5947
13460 "This command writes to part of a device. It writes the data buffer "
13461 "C<content> to C<device> starting at offset C<offset>."
13465 #: ../fish/guestfish-actions.pod:3888 ../src/guestfs-actions.pod:5950
13467 "This command implements the L<pwrite(2)> system call, and like that system "
13468 "call it may not write the full data requested (although short writes to disk "
13469 "devices and partitions are probably impossible with standard Linux kernels)."
13473 #: ../fish/guestfish-actions.pod:3893
13474 msgid "See also L</pwrite>."
13478 #: ../fish/guestfish-actions.pod:3898
13483 #: ../fish/guestfish-actions.pod:3900
13486 " read-file path\n"
13491 #: ../fish/guestfish-actions.pod:3902 ../src/guestfs-actions.pod:5971
13492 msgid "This calls returns the contents of the file C<path> as a buffer."
13496 #: ../fish/guestfish-actions.pod:3905
13498 "Unlike L</cat>, this function can correctly handle files that contain "
13499 "embedded ASCII NUL characters. However unlike L</download>, this function "
13500 "is limited in the total size of file that can be handled."
13504 #: ../fish/guestfish-actions.pod:3913
13509 #: ../fish/guestfish-actions.pod:3915
13512 " read-lines path\n"
13517 #: ../fish/guestfish-actions.pod:3919 ../src/guestfs-actions.pod:5996
13519 "The file contents are returned as a list of lines. Trailing C<LF> and "
13520 "C<CRLF> character sequences are I<not> returned."
13524 #: ../fish/guestfish-actions.pod:3922
13526 "Note that this function cannot correctly handle binary files (specifically, "
13527 "files containing C<\\0> character which is treated as end of line). For "
13528 "those you need to use the L</read-file> function which has a more complex "
13533 #: ../fish/guestfish-actions.pod:3927
13538 #: ../fish/guestfish-actions.pod:3929
13546 #: ../fish/guestfish-actions.pod:3931 ../src/guestfs-actions.pod:6016
13547 msgid "This returns the list of directory entries in directory C<dir>."
13551 #: ../fish/guestfish-actions.pod:3933 ../src/guestfs-actions.pod:6018
13553 "All entries in the directory are returned, including C<.> and C<..>. The "
13554 "entries are I<not> sorted, but returned in the same order as the underlying "
13559 #: ../fish/guestfish-actions.pod:3937 ../src/guestfs-actions.pod:6022
13561 "Also this call returns basic file type information about each file. The "
13562 "C<ftyp> field will contain one of the following characters:"
13566 #: ../fish/guestfish-actions.pod:3942 ../src/guestfs-actions.pod:6027
13571 #: ../fish/guestfish-actions.pod:3944 ../src/guestfs-actions.pod:6029
13572 msgid "Block special"
13576 #: ../fish/guestfish-actions.pod:3946 ../src/guestfs-actions.pod:6031
13581 #: ../fish/guestfish-actions.pod:3948 ../src/guestfs-actions.pod:6033
13582 msgid "Char special"
13586 #: ../fish/guestfish-actions.pod:3950 ../src/guestfs-actions.pod:6035
13591 #: ../fish/guestfish-actions.pod:3952 ../src/guestfs-actions.pod:6037
13596 #: ../fish/guestfish-actions.pod:3954 ../src/guestfs-actions.pod:6039
13601 #: ../fish/guestfish-actions.pod:3956 ../src/guestfs-actions.pod:6041
13602 msgid "FIFO (named pipe)"
13606 #: ../fish/guestfish-actions.pod:3958 ../src/guestfs-actions.pod:6043
13611 #: ../fish/guestfish-actions.pod:3960 ../src/guestfs-actions.pod:6045
13612 msgid "Symbolic link"
13616 #: ../fish/guestfish-actions.pod:3962 ../src/guestfs-actions.pod:6047
13621 #: ../fish/guestfish-actions.pod:3964 ../src/guestfs-actions.pod:6049
13622 msgid "Regular file"
13626 #: ../fish/guestfish-actions.pod:3966 ../src/guestfs-actions.pod:6051
13631 #: ../fish/guestfish-actions.pod:3968 ../src/guestfs-actions.pod:6053
13636 #: ../fish/guestfish-actions.pod:3970 ../src/guestfs-actions.pod:6055
13641 #: ../fish/guestfish-actions.pod:3972 ../src/guestfs-actions.pod:6057
13642 msgid "Unknown file type"
13646 #: ../fish/guestfish-actions.pod:3974 ../src/guestfs-actions.pod:6059
13651 #: ../fish/guestfish-actions.pod:3976 ../src/guestfs-actions.pod:6061
13652 msgid "The L<readdir(3)> call returned a C<d_type> field with an unexpected value"
13656 #: ../fish/guestfish-actions.pod:3981
13658 "This function is primarily intended for use by programs. To get a simple "
13659 "list of names, use L</ls>. To get a printable directory for human "
13660 "consumption, use L</ll>."
13664 #: ../fish/guestfish-actions.pod:3985
13669 #: ../fish/guestfish-actions.pod:3987
13677 #: ../fish/guestfish-actions.pod:3989 ../src/guestfs-actions.pod:6082
13678 msgid "This command reads the target of a symbolic link."
13682 #: ../fish/guestfish-actions.pod:3991
13683 msgid "readlinklist"
13687 #: ../fish/guestfish-actions.pod:3993
13690 " readlinklist path 'names ...'\n"
13695 #: ../fish/guestfish-actions.pod:3995 ../src/guestfs-actions.pod:6096
13697 "This call allows you to do a C<readlink> operation on multiple files, where "
13698 "all files are in the directory C<path>. C<names> is the list of files from "
13703 #: ../fish/guestfish-actions.pod:3999 ../src/guestfs-actions.pod:6100
13705 "On return you get a list of strings, with a one-to-one correspondence to the "
13706 "C<names> list. Each string is the value of the symbolic link."
13710 #: ../fish/guestfish-actions.pod:4003 ../src/guestfs-actions.pod:6104
13712 "If the C<readlink(2)> operation fails on any name, then the corresponding "
13713 "result string is the empty string C<\"\">. However the whole operation is "
13714 "completed even if there were C<readlink(2)> errors, and so you can call this "
13715 "function with names where you don't know if they are symbolic links already "
13716 "(albeit slightly less efficient)."
13720 #: ../fish/guestfish-actions.pod:4010 ../src/guestfs-actions.pod:6111
13722 "This call is intended for programs that want to efficiently list a directory "
13723 "contents without making many round-trips. Very long directory listings "
13724 "might cause the protocol message size to be exceeded, causing this call to "
13725 "fail. The caller must split up such requests into smaller groups of names."
13729 #: ../fish/guestfish-actions.pod:4017
13734 #: ../fish/guestfish-actions.pod:4019
13742 #: ../fish/guestfish-actions.pod:4021 ../src/guestfs-actions.pod:6130
13744 "Return the canonicalized absolute pathname of C<path>. The returned path "
13745 "has no C<.>, C<..> or symbolic link path elements."
13749 #: ../fish/guestfish-actions.pod:4024
13750 msgid "removexattr"
13754 #: ../fish/guestfish-actions.pod:4026
13757 " removexattr xattr path\n"
13762 #: ../fish/guestfish-actions.pod:4028 ../src/guestfs-actions.pod:6145
13763 msgid "This call removes the extended attribute named C<xattr> of the file C<path>."
13767 #: ../fish/guestfish-actions.pod:4031
13768 msgid "See also: L</lremovexattr>, L<attr(5)>."
13772 #: ../fish/guestfish-actions.pod:4033
13777 #: ../fish/guestfish-actions.pod:4035
13780 " resize2fs device\n"
13785 #: ../fish/guestfish-actions.pod:4037 ../src/guestfs-actions.pod:6160
13787 "This resizes an ext2, ext3 or ext4 filesystem to match the size of the "
13788 "underlying device."
13792 #: ../fish/guestfish-actions.pod:4040
13794 "I<Note:> It is sometimes required that you run L</e2fsck-f> on the C<device> "
13795 "before calling this command. For unknown reasons C<resize2fs> sometimes "
13796 "gives an error about this and sometimes not. In any case, it is always safe "
13797 "to call L</e2fsck-f> before calling this function."
13801 #: ../fish/guestfish-actions.pod:4046
13802 msgid "resize2fs-M"
13806 #: ../fish/guestfish-actions.pod:4048
13809 " resize2fs-M device\n"
13814 #: ../fish/guestfish-actions.pod:4050
13816 "This command is the same as L</resize2fs>, but the filesystem is resized to "
13817 "its minimum size. This works like the I<-M> option to the C<resize2fs> "
13822 #: ../fish/guestfish-actions.pod:4054
13824 "To get the resulting size of the filesystem you should call L</tune2fs-l> "
13825 "and read the C<Block size> and C<Block count> values. These two numbers, "
13826 "multiplied together, give the resulting size of the minimal filesystem in "
13831 #: ../fish/guestfish-actions.pod:4059
13832 msgid "resize2fs-size"
13836 #: ../fish/guestfish-actions.pod:4061
13839 " resize2fs-size device size\n"
13844 #: ../fish/guestfish-actions.pod:4063
13846 "This command is the same as L</resize2fs> except that it allows you to "
13847 "specify the new size (in bytes) explicitly."
13851 #: ../fish/guestfish-actions.pod:4066
13856 #: ../fish/guestfish-actions.pod:4068
13864 #: ../fish/guestfish-actions.pod:4070 ../src/guestfs-actions.pod:6212
13865 msgid "Remove the single file C<path>."
13869 #: ../fish/guestfish-actions.pod:4072
13874 #: ../fish/guestfish-actions.pod:4074
13882 #: ../fish/guestfish-actions.pod:4076 ../src/guestfs-actions.pod:6224
13884 "Remove the file or directory C<path>, recursively removing the contents if "
13885 "its a directory. This is like the C<rm -rf> shell command."
13889 #: ../fish/guestfish-actions.pod:4080
13894 #: ../fish/guestfish-actions.pod:4082
13902 #: ../fish/guestfish-actions.pod:4084 ../src/guestfs-actions.pod:6238
13903 msgid "Remove the single directory C<path>."
13907 #: ../fish/guestfish-actions.pod:4086
13908 msgid "rmmountpoint"
13912 #: ../fish/guestfish-actions.pod:4088
13915 " rmmountpoint exemptpath\n"
13920 #: ../fish/guestfish-actions.pod:4090
13922 "This calls removes a mountpoint that was previously created with "
13923 "L</mkmountpoint>. See L</mkmountpoint> for full details."
13927 #: ../fish/guestfish-actions.pod:4094
13928 msgid "scrub-device"
13932 #: ../fish/guestfish-actions.pod:4096
13935 " scrub-device device\n"
13940 #: ../fish/guestfish-actions.pod:4098 ../src/guestfs-actions.pod:6264
13942 "This command writes patterns over C<device> to make data retrieval more "
13947 #: ../fish/guestfish-actions.pod:4101 ../fish/guestfish-actions.pod:4116 ../fish/guestfish-actions.pod:4129 ../src/guestfs-actions.pod:6267 ../src/guestfs-actions.pod:6288 ../src/guestfs-actions.pod:6307
13949 "It is an interface to the L<scrub(1)> program. See that manual page for "
13954 #: ../fish/guestfish-actions.pod:4107
13959 #: ../fish/guestfish-actions.pod:4109
13962 " scrub-file file\n"
13967 #: ../fish/guestfish-actions.pod:4111 ../src/guestfs-actions.pod:6283
13969 "This command writes patterns over a file to make data retrieval more "
13974 #: ../fish/guestfish-actions.pod:4114 ../src/guestfs-actions.pod:6286
13975 msgid "The file is I<removed> after scrubbing."
13979 #: ../fish/guestfish-actions.pod:4119
13980 msgid "scrub-freespace"
13984 #: ../fish/guestfish-actions.pod:4121
13987 " scrub-freespace dir\n"
13992 #: ../fish/guestfish-actions.pod:4123
13994 "This command creates the directory C<dir> and then fills it with files until "
13995 "the filesystem is full, and scrubs the files as for L</scrub-file>, and "
13996 "deletes them. The intention is to scrub any free space on the partition "
13997 "containing C<dir>."
14001 #: ../fish/guestfish-actions.pod:4132
14006 #: ../fish/guestfish-actions.pod:4134
14011 #: ../fish/guestfish-actions.pod:4136
14014 " set-append append\n"
14019 #: ../fish/guestfish-actions.pod:4138 ../src/guestfs-actions.pod:6320
14021 "This function is used to add additional options to the guest kernel command "
14026 #: ../fish/guestfish-actions.pod:4141 ../src/guestfs-actions.pod:6323
14028 "The default is C<NULL> unless overridden by setting C<LIBGUESTFS_APPEND> "
14029 "environment variable."
14033 #: ../fish/guestfish-actions.pod:4144 ../src/guestfs-actions.pod:6326
14035 "Setting C<append> to C<NULL> means I<no> additional options are passed "
14036 "(libguestfs always adds a few of its own)."
14040 #: ../fish/guestfish-actions.pod:4147
14041 msgid "set-attach-method"
14045 #: ../fish/guestfish-actions.pod:4149
14046 msgid "attach-method"
14050 #: ../fish/guestfish-actions.pod:4151
14053 " set-attach-method attachmethod\n"
14058 #: ../fish/guestfish-actions.pod:4153 ../src/guestfs-actions.pod:6339
14060 "Set the method that libguestfs uses to connect to the back end guestfsd "
14061 "daemon. Possible methods are:"
14065 #: ../fish/guestfish-actions.pod:4158 ../src/guestfs-actions.pod:6344 ../src/guestfs.pod:2901
14066 msgid "C<appliance>"
14070 #: ../fish/guestfish-actions.pod:4160 ../src/guestfs-actions.pod:6346
14072 "Launch an appliance and connect to it. This is the ordinary method and the "
14077 #: ../fish/guestfish-actions.pod:4163 ../src/guestfs-actions.pod:6349
14078 msgid "C<unix:I<path>>"
14082 #: ../fish/guestfish-actions.pod:4165 ../src/guestfs-actions.pod:6351
14083 msgid "Connect to the Unix domain socket I<path>."
14087 #: ../fish/guestfish-actions.pod:4167 ../src/guestfs-actions.pod:6353
14089 "This method lets you connect to an existing daemon or (using virtio-serial) "
14090 "to a live guest. For more information, see L<guestfs(3)/ATTACHING TO "
14091 "RUNNING DAEMONS>."
14095 #: ../fish/guestfish-actions.pod:4173
14096 msgid "set-autosync"
14100 #: ../fish/guestfish-actions.pod:4175
14105 #: ../fish/guestfish-actions.pod:4177
14108 " set-autosync true|false\n"
14113 #: ../fish/guestfish-actions.pod:4179 ../src/guestfs-actions.pod:6369
14115 "If C<autosync> is true, this enables autosync. Libguestfs will make a best "
14116 "effort attempt to make filesystems consistent and synchronized when the "
14117 "handle is closed (also if the program exits without closing handles)."
14121 #: ../fish/guestfish-actions.pod:4184 ../src/guestfs-actions.pod:6374
14123 "This is enabled by default (since libguestfs 1.5.24, previously it was "
14124 "disabled by default)."
14128 #: ../fish/guestfish-actions.pod:4187
14133 #: ../fish/guestfish-actions.pod:4189
14138 #: ../fish/guestfish-actions.pod:4191
14141 " set-direct true|false\n"
14146 #: ../fish/guestfish-actions.pod:4193 ../src/guestfs-actions.pod:6387
14148 "If the direct appliance mode flag is enabled, then stdin and stdout are "
14149 "passed directly through to the appliance once it is launched."
14153 #: ../fish/guestfish-actions.pod:4197
14155 "One consequence of this is that log messages aren't caught by the library "
14156 "and handled by L</set-log-message-callback>, but go straight to stdout."
14160 #: ../fish/guestfish-actions.pod:4201 ../src/guestfs-actions.pod:6395
14161 msgid "You probably don't want to use this unless you know what you are doing."
14165 #: ../fish/guestfish-actions.pod:4204 ../src/guestfs-actions.pod:6398
14166 msgid "The default is disabled."
14170 #: ../fish/guestfish-actions.pod:4206
14171 msgid "set-e2label"
14175 #: ../fish/guestfish-actions.pod:4208
14178 " set-e2label device label\n"
14183 #: ../fish/guestfish-actions.pod:4210 ../src/guestfs-actions.pod:6411
14185 "This sets the ext2/3/4 filesystem label of the filesystem on C<device> to "
14186 "C<label>. Filesystem labels are limited to 16 characters."
14190 #: ../fish/guestfish-actions.pod:4214
14192 "You can use either L</tune2fs-l> or L</get-e2label> to return the existing "
14193 "label on a filesystem."
14197 #: ../fish/guestfish-actions.pod:4217
14202 #: ../fish/guestfish-actions.pod:4219
14205 " set-e2uuid device uuid\n"
14210 #: ../fish/guestfish-actions.pod:4221 ../src/guestfs-actions.pod:6429
14212 "This sets the ext2/3/4 filesystem UUID of the filesystem on C<device> to "
14213 "C<uuid>. The format of the UUID and alternatives such as C<clear>, "
14214 "C<random> and C<time> are described in the L<tune2fs(8)> manpage."
14218 #: ../fish/guestfish-actions.pod:4226
14220 "You can use either L</tune2fs-l> or L</get-e2uuid> to return the existing "
14221 "UUID of a filesystem."
14225 #: ../fish/guestfish-actions.pod:4229
14226 msgid "set-memsize"
14230 #: ../fish/guestfish-actions.pod:4231
14235 #: ../fish/guestfish-actions.pod:4233
14238 " set-memsize memsize\n"
14243 #: ../fish/guestfish-actions.pod:4235
14245 "This sets the memory size in megabytes allocated to the qemu subprocess. "
14246 "This only has any effect if called before L</launch>."
14250 #: ../fish/guestfish-actions.pod:4239 ../src/guestfs-actions.pod:6451
14252 "You can also change this by setting the environment variable "
14253 "C<LIBGUESTFS_MEMSIZE> before the handle is created."
14257 #: ../fish/guestfish-actions.pod:4246
14258 msgid "set-network"
14262 #: ../fish/guestfish-actions.pod:4248
14267 #: ../fish/guestfish-actions.pod:4250
14270 " set-network true|false\n"
14275 #: ../fish/guestfish-actions.pod:4252 ../src/guestfs-actions.pod:6468
14277 "If C<network> is true, then the network is enabled in the libguestfs "
14278 "appliance. The default is false."
14282 #: ../fish/guestfish-actions.pod:4255 ../src/guestfs-actions.pod:6471
14284 "This affects whether commands are able to access the network (see "
14285 "L<guestfs(3)/RUNNING COMMANDS>)."
14289 #: ../fish/guestfish-actions.pod:4258
14290 msgid "You must call this before calling L</launch>, otherwise it has no effect."
14294 #: ../fish/guestfish-actions.pod:4261
14299 #: ../fish/guestfish-actions.pod:4265
14302 " set-path searchpath\n"
14307 #: ../fish/guestfish-actions.pod:4267 ../src/guestfs-actions.pod:6487
14308 msgid "Set the path that libguestfs searches for kernel and initrd.img."
14312 #: ../fish/guestfish-actions.pod:4269 ../src/guestfs-actions.pod:6489
14314 "The default is C<$libdir/guestfs> unless overridden by setting "
14315 "C<LIBGUESTFS_PATH> environment variable."
14319 #: ../fish/guestfish-actions.pod:4272 ../src/guestfs-actions.pod:6492
14320 msgid "Setting C<path> to C<NULL> restores the default path."
14324 #: ../fish/guestfish-actions.pod:4274
14329 #: ../fish/guestfish-actions.pod:4276
14334 #: ../fish/guestfish-actions.pod:4278
14337 " set-pgroup true|false\n"
14342 #: ../fish/guestfish-actions.pod:4280 ../src/guestfs-actions.pod:6504
14344 "If C<pgroup> is true, child processes are placed into their own process "
14349 #: ../fish/guestfish-actions.pod:4283 ../src/guestfs-actions.pod:6507
14351 "The practical upshot of this is that signals like C<SIGINT> (from users "
14352 "pressing C<^C>) won't be received by the child process."
14356 #: ../fish/guestfish-actions.pod:4286 ../src/guestfs-actions.pod:6510
14358 "The default for this flag is false, because usually you want C<^C> to kill "
14363 #: ../fish/guestfish-actions.pod:4289
14368 #: ../fish/guestfish-actions.pod:4291
14373 #: ../fish/guestfish-actions.pod:4293
14381 #: ../fish/guestfish-actions.pod:4295 ../src/guestfs-actions.pod:6523
14382 msgid "Set the qemu binary that we will use."
14386 #: ../fish/guestfish-actions.pod:4297 ../src/guestfs-actions.pod:6525
14387 msgid "The default is chosen when the library was compiled by the configure script."
14391 #: ../fish/guestfish-actions.pod:4300 ../src/guestfs-actions.pod:6528
14393 "You can also override this by setting the C<LIBGUESTFS_QEMU> environment "
14398 #: ../fish/guestfish-actions.pod:4303 ../src/guestfs-actions.pod:6531
14399 msgid "Setting C<qemu> to C<NULL> restores the default qemu binary."
14403 #: ../fish/guestfish-actions.pod:4305 ../src/guestfs-actions.pod:6533
14405 "Note that you should call this function as early as possible after creating "
14406 "the handle. This is because some pre-launch operations depend on testing "
14407 "qemu features (by running C<qemu -help>). If the qemu binary changes, we "
14408 "don't retest features, and so you might see inconsistent results. Using the "
14409 "environment variable C<LIBGUESTFS_QEMU> is safest of all since that picks "
14410 "the qemu binary at the same time as the handle is created."
14414 #: ../fish/guestfish-actions.pod:4313
14415 msgid "set-recovery-proc"
14419 #: ../fish/guestfish-actions.pod:4315
14420 msgid "recovery-proc"
14424 #: ../fish/guestfish-actions.pod:4317
14427 " set-recovery-proc true|false\n"
14432 #: ../fish/guestfish-actions.pod:4319
14434 "If this is called with the parameter C<false> then L</launch> does not "
14435 "create a recovery process. The purpose of the recovery process is to stop "
14436 "runaway qemu processes in the case where the main program aborts abruptly."
14440 #: ../fish/guestfish-actions.pod:4324
14442 "This only has any effect if called before L</launch>, and the default is "
14447 #: ../fish/guestfish-actions.pod:4327 ../src/guestfs-actions.pod:6559
14449 "About the only time when you would want to disable this is if the main "
14450 "process will fork itself into the background (\"daemonize\" itself). In "
14451 "this case the recovery process thinks that the main program has disappeared "
14452 "and so kills qemu, which is not very helpful."
14456 #: ../fish/guestfish-actions.pod:4333
14457 msgid "set-selinux"
14461 #: ../fish/guestfish-actions.pod:4335
14466 #: ../fish/guestfish-actions.pod:4337
14469 " set-selinux true|false\n"
14474 #: ../fish/guestfish-actions.pod:4339 ../src/guestfs-actions.pod:6575
14476 "This sets the selinux flag that is passed to the appliance at boot time. "
14477 "The default is C<selinux=0> (disabled)."
14481 #: ../fish/guestfish-actions.pod:4342 ../src/guestfs-actions.pod:6578
14483 "Note that if SELinux is enabled, it is always in Permissive mode "
14484 "(C<enforcing=0>)."
14488 #: ../fish/guestfish-actions.pod:4348
14493 #: ../fish/guestfish-actions.pod:4350
14498 #: ../fish/guestfish-actions.pod:4352
14506 #: ../fish/guestfish-actions.pod:4354 ../src/guestfs-actions.pod:6594
14508 "Change the number of virtual CPUs assigned to the appliance. The default is "
14509 "C<1>. Increasing this may improve performance, though often it has no "
14514 #: ../fish/guestfish-actions.pod:4358
14515 msgid "This function must be called before L</launch>."
14519 #: ../fish/guestfish-actions.pod:4360
14524 #: ../fish/guestfish-actions.pod:4362
14529 #: ../fish/guestfish-actions.pod:4364
14532 " set-trace true|false\n"
14537 #: ../fish/guestfish-actions.pod:4366 ../src/guestfs-actions.pod:6610
14539 "If the command trace flag is set to 1, then libguestfs calls, parameters and "
14540 "return values are traced."
14544 #: ../fish/guestfish-actions.pod:4369 ../src/guestfs-actions.pod:6613
14546 "If you want to trace C API calls into libguestfs (and other libraries) then "
14547 "possibly a better way is to use the external ltrace(1) command."
14551 #: ../fish/guestfish-actions.pod:4373 ../src/guestfs-actions.pod:6617
14553 "Command traces are disabled unless the environment variable "
14554 "C<LIBGUESTFS_TRACE> is defined and set to C<1>."
14558 #: ../fish/guestfish-actions.pod:4376
14560 "Trace messages are normally sent to C<stderr>, unless you register a "
14561 "callback to send them somewhere else (see L</set-event-callback>)."
14565 #: ../fish/guestfish-actions.pod:4380
14566 msgid "set-verbose"
14570 #: ../fish/guestfish-actions.pod:4382
14575 #: ../fish/guestfish-actions.pod:4384
14578 " set-verbose true|false\n"
14583 #: ../fish/guestfish-actions.pod:4386 ../src/guestfs-actions.pod:6634
14584 msgid "If C<verbose> is true, this turns on verbose messages."
14588 #: ../fish/guestfish-actions.pod:4388 ../src/guestfs-actions.pod:6636
14590 "Verbose messages are disabled unless the environment variable "
14591 "C<LIBGUESTFS_DEBUG> is defined and set to C<1>."
14595 #: ../fish/guestfish-actions.pod:4391
14597 "Verbose messages are normally sent to C<stderr>, unless you register a "
14598 "callback to send them somewhere else (see L</set-event-callback>)."
14602 #: ../fish/guestfish-actions.pod:4395
14607 #: ../fish/guestfish-actions.pod:4397
14610 " setcon context\n"
14615 #: ../fish/guestfish-actions.pod:4399 ../src/guestfs-actions.pod:6653
14617 "This sets the SELinux security context of the daemon to the string "
14622 #: ../fish/guestfish-actions.pod:4402 ../src/guestfs-actions.pod:6656
14623 msgid "See the documentation about SELINUX in L<guestfs(3)>."
14627 #: ../fish/guestfish-actions.pod:4404
14632 #: ../fish/guestfish-actions.pod:4406
14635 " setxattr xattr val vallen path\n"
14640 #: ../fish/guestfish-actions.pod:4408 ../src/guestfs-actions.pod:6671
14642 "This call sets the extended attribute named C<xattr> of the file C<path> to "
14643 "the value C<val> (of length C<vallen>). The value is arbitrary 8 bit data."
14647 #: ../fish/guestfish-actions.pod:4412
14648 msgid "See also: L</lsetxattr>, L<attr(5)>."
14652 #: ../fish/guestfish-actions.pod:4414
14657 #: ../fish/guestfish-actions.pod:4416
14660 " sfdisk device cyls heads sectors 'lines ...'\n"
14665 #: ../fish/guestfish-actions.pod:4418 ../src/guestfs-actions.pod:6698
14667 "This is a direct interface to the L<sfdisk(8)> program for creating "
14668 "partitions on block devices."
14672 #: ../fish/guestfish-actions.pod:4421 ../src/guestfs-actions.pod:6701
14673 msgid "C<device> should be a block device, for example C</dev/sda>."
14677 #: ../fish/guestfish-actions.pod:4423 ../src/guestfs-actions.pod:6703
14679 "C<cyls>, C<heads> and C<sectors> are the number of cylinders, heads and "
14680 "sectors on the device, which are passed directly to sfdisk as the I<-C>, "
14681 "I<-H> and I<-S> parameters. If you pass C<0> for any of these, then the "
14682 "corresponding parameter is omitted. Usually for 'large' disks, you can just "
14683 "pass C<0> for these, but for small (floppy-sized) disks, sfdisk (or rather, "
14684 "the kernel) cannot work out the right geometry and you will need to tell it."
14688 #: ../fish/guestfish-actions.pod:4431 ../src/guestfs-actions.pod:6711
14690 "C<lines> is a list of lines that we feed to C<sfdisk>. For more information "
14691 "refer to the L<sfdisk(8)> manpage."
14695 #: ../fish/guestfish-actions.pod:4434 ../src/guestfs-actions.pod:6714
14697 "To create a single partition occupying the whole disk, you would pass "
14698 "C<lines> as a single element list, when the single element being the string "
14703 #: ../fish/guestfish-actions.pod:4438
14704 msgid "See also: L</sfdisk-l>, L</sfdisk-N>, L</part-init>"
14708 #: ../fish/guestfish-actions.pod:4444 ../fish/guestfish-actions.pod:4467 ../fish/guestfish-actions.pod:4489
14710 "I<This function is deprecated.> In new code, use the L</part_add> call "
14715 #: ../fish/guestfish-actions.pod:4451
14720 #: ../fish/guestfish-actions.pod:4453
14723 " sfdiskM device 'lines ...'\n"
14728 #: ../fish/guestfish-actions.pod:4455
14730 "This is a simplified interface to the L</sfdisk> command, where partition "
14731 "sizes are specified in megabytes only (rounded to the nearest cylinder) and "
14732 "you don't need to specify the cyls, heads and sectors parameters which were "
14733 "rarely if ever used anyway."
14737 #: ../fish/guestfish-actions.pod:4461
14738 msgid "See also: L</sfdisk>, the L<sfdisk(8)> manpage and L</part-disk>"
14742 #: ../fish/guestfish-actions.pod:4474
14747 #: ../fish/guestfish-actions.pod:4476
14750 " sfdisk-N device partnum cyls heads sectors line\n"
14755 #: ../fish/guestfish-actions.pod:4478 ../src/guestfs-actions.pod:6776
14757 "This runs L<sfdisk(8)> option to modify just the single partition C<n> "
14758 "(note: C<n> counts from 1)."
14762 #: ../fish/guestfish-actions.pod:4481
14764 "For other parameters, see L</sfdisk>. You should usually pass C<0> for the "
14765 "cyls/heads/sectors parameters."
14769 #: ../fish/guestfish-actions.pod:4484
14770 msgid "See also: L</part-add>"
14774 #: ../fish/guestfish-actions.pod:4496
14775 msgid "sfdisk-disk-geometry"
14779 #: ../fish/guestfish-actions.pod:4498
14782 " sfdisk-disk-geometry device\n"
14787 #: ../fish/guestfish-actions.pod:4500
14789 "This displays the disk geometry of C<device> read from the partition table. "
14790 "Especially in the case where the underlying block device has been resized, "
14791 "this can be different from the kernel's idea of the geometry (see "
14792 "L</sfdisk-kernel-geometry>)."
14796 #: ../fish/guestfish-actions.pod:4505 ../fish/guestfish-actions.pod:4514 ../src/guestfs-actions.pod:6802 ../src/guestfs-actions.pod:6818
14797 msgid "The result is in human-readable format, and not designed to be parsed."
14801 #: ../fish/guestfish-actions.pod:4508
14802 msgid "sfdisk-kernel-geometry"
14806 #: ../fish/guestfish-actions.pod:4510
14809 " sfdisk-kernel-geometry device\n"
14814 #: ../fish/guestfish-actions.pod:4512 ../src/guestfs-actions.pod:6816
14815 msgid "This displays the kernel's idea of the geometry of C<device>."
14819 #: ../fish/guestfish-actions.pod:4517
14824 #: ../fish/guestfish-actions.pod:4519
14827 " sfdisk-l device\n"
14832 #: ../fish/guestfish-actions.pod:4521 ../src/guestfs-actions.pod:6839
14834 "This displays the partition table on C<device>, in the human-readable output "
14835 "of the L<sfdisk(8)> command. It is not intended to be parsed."
14839 #: ../fish/guestfish-actions.pod:4525
14840 msgid "See also: L</part-list>"
14844 #: ../fish/guestfish-actions.pod:4527
14846 "I<This function is deprecated.> In new code, use the L</part_list> call "
14851 #: ../fish/guestfish-actions.pod:4534
14856 #: ../fish/guestfish-actions.pod:4536
14864 #: ../fish/guestfish-actions.pod:4538 ../src/guestfs-actions.pod:6856
14866 "This call runs a command from the guest filesystem via the guest's "
14871 #: ../fish/guestfish-actions.pod:4541
14872 msgid "This is like L</command>, but passes the command to:"
14876 #: ../fish/guestfish-actions.pod:4543 ../src/guestfs-actions.pod:6861
14879 " /bin/sh -c \"command\"\n"
14884 #: ../fish/guestfish-actions.pod:4545 ../src/guestfs-actions.pod:6863
14886 "Depending on the guest's shell, this usually results in wildcards being "
14887 "expanded, shell expressions being interpolated and so on."
14891 #: ../fish/guestfish-actions.pod:4549
14892 msgid "All the provisos about L</command> apply to this call."
14896 #: ../fish/guestfish-actions.pod:4551
14901 #: ../fish/guestfish-actions.pod:4553
14904 " sh-lines command\n"
14909 #: ../fish/guestfish-actions.pod:4555
14910 msgid "This is the same as L</sh>, but splits the result into a list of lines."
14914 #: ../fish/guestfish-actions.pod:4558
14915 msgid "See also: L</command-lines>"
14919 #: ../fish/guestfish-actions.pod:4560
14924 #: ../fish/guestfish-actions.pod:4562
14932 #: ../fish/guestfish-actions.pod:4564 ../src/guestfs-actions.pod:6897
14933 msgid "Sleep for C<secs> seconds."
14937 #: ../fish/guestfish-actions.pod:4566
14942 #: ../fish/guestfish-actions.pod:4568
14950 #: ../fish/guestfish-actions.pod:4572 ../src/guestfs-actions.pod:6911
14951 msgid "This is the same as the C<stat(2)> system call."
14955 #: ../fish/guestfish-actions.pod:4574
14960 #: ../fish/guestfish-actions.pod:4576
14968 #: ../fish/guestfish-actions.pod:4578 ../src/guestfs-actions.pod:6925
14970 "Returns file system statistics for any mounted file system. C<path> should "
14971 "be a file or directory in the mounted file system (typically it is the mount "
14972 "point itself, but it doesn't need to be)."
14976 #: ../fish/guestfish-actions.pod:4582 ../src/guestfs-actions.pod:6929
14977 msgid "This is the same as the C<statvfs(2)> system call."
14981 #: ../fish/guestfish-actions.pod:4584
14986 #: ../fish/guestfish-actions.pod:4586
14994 #: ../fish/guestfish-actions.pod:4588 ../src/guestfs-actions.pod:6943
14996 "This runs the L<strings(1)> command on a file and returns the list of "
14997 "printable strings found."
15001 #: ../fish/guestfish-actions.pod:4594
15006 #: ../fish/guestfish-actions.pod:4596
15009 " strings-e encoding path\n"
15014 #: ../fish/guestfish-actions.pod:4598
15016 "This is like the L</strings> command, but allows you to specify the encoding "
15017 "of strings that are looked for in the source file C<path>."
15021 #: ../fish/guestfish-actions.pod:4602 ../src/guestfs-actions.pod:6966
15022 msgid "Allowed encodings are:"
15026 #: ../fish/guestfish-actions.pod:4606 ../src/guestfs-actions.pod:6970
15031 #: ../fish/guestfish-actions.pod:4608
15033 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
15034 "ISO-8859-X (this is what L</strings> uses)."
15038 #: ../fish/guestfish-actions.pod:4611 ../src/guestfs-actions.pod:6975
15043 #: ../fish/guestfish-actions.pod:4613 ../src/guestfs-actions.pod:6977
15044 msgid "Single 8-bit-byte characters."
15048 #: ../fish/guestfish-actions.pod:4615 ../src/guestfs-actions.pod:6979
15053 #: ../fish/guestfish-actions.pod:4617 ../src/guestfs-actions.pod:6981
15054 msgid "16-bit big endian strings such as those encoded in UTF-16BE or UCS-2BE."
15058 #: ../fish/guestfish-actions.pod:4620 ../src/guestfs-actions.pod:6984
15059 msgid "l (lower case letter L)"
15063 #: ../fish/guestfish-actions.pod:4622 ../src/guestfs-actions.pod:6986
15065 "16-bit little endian such as UTF-16LE and UCS-2LE. This is useful for "
15066 "examining binaries in Windows guests."
15070 #: ../fish/guestfish-actions.pod:4625 ../src/guestfs-actions.pod:6989
15075 #: ../fish/guestfish-actions.pod:4627 ../src/guestfs-actions.pod:6991
15076 msgid "32-bit big endian such as UCS-4BE."
15080 #: ../fish/guestfish-actions.pod:4629 ../src/guestfs-actions.pod:6993
15085 #: ../fish/guestfish-actions.pod:4631 ../src/guestfs-actions.pod:6995
15086 msgid "32-bit little endian such as UCS-4LE."
15090 #: ../fish/guestfish-actions.pod:4635 ../src/guestfs-actions.pod:6999
15091 msgid "The returned strings are transcoded to UTF-8."
15095 #: ../fish/guestfish-actions.pod:4640
15096 msgid "swapoff-device"
15100 #: ../fish/guestfish-actions.pod:4642
15103 " swapoff-device device\n"
15108 #: ../fish/guestfish-actions.pod:4644
15110 "This command disables the libguestfs appliance swap device or partition "
15111 "named C<device>. See L</swapon-device>."
15115 #: ../fish/guestfish-actions.pod:4648
15116 msgid "swapoff-file"
15120 #: ../fish/guestfish-actions.pod:4650
15123 " swapoff-file file\n"
15128 #: ../fish/guestfish-actions.pod:4652 ../src/guestfs-actions.pod:7030
15129 msgid "This command disables the libguestfs appliance swap on file."
15133 #: ../fish/guestfish-actions.pod:4654
15134 msgid "swapoff-label"
15138 #: ../fish/guestfish-actions.pod:4656
15141 " swapoff-label label\n"
15146 #: ../fish/guestfish-actions.pod:4658 ../src/guestfs-actions.pod:7042
15148 "This command disables the libguestfs appliance swap on labeled swap "
15153 #: ../fish/guestfish-actions.pod:4661
15154 msgid "swapoff-uuid"
15158 #: ../fish/guestfish-actions.pod:4663
15161 " swapoff-uuid uuid\n"
15166 #: ../fish/guestfish-actions.pod:4665 ../src/guestfs-actions.pod:7055
15168 "This command disables the libguestfs appliance swap partition with the given "
15173 #: ../fish/guestfish-actions.pod:4668
15174 msgid "swapon-device"
15178 #: ../fish/guestfish-actions.pod:4670
15181 " swapon-device device\n"
15186 #: ../fish/guestfish-actions.pod:4672
15188 "This command enables the libguestfs appliance to use the swap device or "
15189 "partition named C<device>. The increased memory is made available for all "
15190 "commands, for example those run using L</command> or L</sh>."
15194 #: ../fish/guestfish-actions.pod:4677 ../src/guestfs-actions.pod:7073
15196 "Note that you should not swap to existing guest swap partitions unless you "
15197 "know what you are doing. They may contain hibernation information, or other "
15198 "information that the guest doesn't want you to trash. You also risk leaking "
15199 "information about the host to the guest this way. Instead, attach a new "
15200 "host device to the guest and swap on that."
15204 #: ../fish/guestfish-actions.pod:4684
15205 msgid "swapon-file"
15209 #: ../fish/guestfish-actions.pod:4686
15212 " swapon-file file\n"
15217 #: ../fish/guestfish-actions.pod:4688
15218 msgid "This command enables swap to a file. See L</swapon-device> for other notes."
15222 #: ../fish/guestfish-actions.pod:4691
15223 msgid "swapon-label"
15227 #: ../fish/guestfish-actions.pod:4693
15230 " swapon-label label\n"
15235 #: ../fish/guestfish-actions.pod:4695
15237 "This command enables swap to a labeled swap partition. See "
15238 "L</swapon-device> for other notes."
15242 #: ../fish/guestfish-actions.pod:4698
15243 msgid "swapon-uuid"
15247 #: ../fish/guestfish-actions.pod:4700
15250 " swapon-uuid uuid\n"
15255 #: ../fish/guestfish-actions.pod:4702
15257 "This command enables swap to a swap partition with the given UUID. See "
15258 "L</swapon-device> for other notes."
15262 #: ../fish/guestfish-actions.pod:4705
15267 #: ../fish/guestfish-actions.pod:4707
15275 #: ../fish/guestfish-actions.pod:4709 ../src/guestfs-actions.pod:7128
15277 "This syncs the disk, so that any writes are flushed through to the "
15278 "underlying disk image."
15282 #: ../fish/guestfish-actions.pod:4712 ../src/guestfs-actions.pod:7131
15284 "You should always call this if you have modified a disk image, before "
15285 "closing the handle."
15289 #: ../fish/guestfish-actions.pod:4715
15294 #: ../fish/guestfish-actions.pod:4717
15302 #: ../fish/guestfish-actions.pod:4719 ../src/guestfs-actions.pod:7144
15303 msgid "This command returns up to the last 10 lines of a file as a list of strings."
15307 #: ../fish/guestfish-actions.pod:4725
15312 #: ../fish/guestfish-actions.pod:4727
15315 " tail-n nrlines path\n"
15320 #: ../fish/guestfish-actions.pod:4729 ../src/guestfs-actions.pod:7163
15322 "If the parameter C<nrlines> is a positive number, this returns the last "
15323 "C<nrlines> lines of the file C<path>."
15327 #: ../fish/guestfish-actions.pod:4732 ../src/guestfs-actions.pod:7166
15329 "If the parameter C<nrlines> is a negative number, this returns lines from "
15330 "the file C<path>, starting with the C<-nrlines>th line."
15334 #: ../fish/guestfish-actions.pod:4740
15339 #: ../fish/guestfish-actions.pod:4742
15342 " tar-in (tarfile|-) directory\n"
15347 #: ../fish/guestfish-actions.pod:4744 ../src/guestfs-actions.pod:7187
15349 "This command uploads and unpacks local file C<tarfile> (an I<uncompressed> "
15350 "tar file) into C<directory>."
15354 #: ../fish/guestfish-actions.pod:4747
15355 msgid "To upload a compressed tarball, use L</tgz-in> or L</txz-in>."
15359 #: ../fish/guestfish-actions.pod:4752
15364 #: ../fish/guestfish-actions.pod:4754
15367 " tar-out directory (tarfile|-)\n"
15372 #: ../fish/guestfish-actions.pod:4756 ../src/guestfs-actions.pod:7204
15374 "This command packs the contents of C<directory> and downloads it to local "
15379 #: ../fish/guestfish-actions.pod:4759
15380 msgid "To download a compressed tarball, use L</tgz-out> or L</txz-out>."
15384 #: ../fish/guestfish-actions.pod:4764
15389 #: ../fish/guestfish-actions.pod:4766
15392 " tgz-in (tarball|-) directory\n"
15397 #: ../fish/guestfish-actions.pod:4768 ../src/guestfs-actions.pod:7221
15399 "This command uploads and unpacks local file C<tarball> (a I<gzip compressed> "
15400 "tar file) into C<directory>."
15404 #: ../fish/guestfish-actions.pod:4771
15405 msgid "To upload an uncompressed tarball, use L</tar-in>."
15409 #: ../fish/guestfish-actions.pod:4775
15414 #: ../fish/guestfish-actions.pod:4777
15417 " tgz-out directory (tarball|-)\n"
15422 #: ../fish/guestfish-actions.pod:4779 ../src/guestfs-actions.pod:7237
15424 "This command packs the contents of C<directory> and downloads it to local "
15429 #: ../fish/guestfish-actions.pod:4782
15430 msgid "To download an uncompressed tarball, use L</tar-out>."
15434 #: ../fish/guestfish-actions.pod:4786
15439 #: ../fish/guestfish-actions.pod:4788
15447 #: ../fish/guestfish-actions.pod:4790 ../src/guestfs-actions.pod:7252
15449 "Touch acts like the L<touch(1)> command. It can be used to update the "
15450 "timestamps on a file, or, if the file does not exist, to create a new "
15451 "zero-length file."
15455 #: ../fish/guestfish-actions.pod:4794 ../src/guestfs-actions.pod:7256
15457 "This command only works on regular files, and will fail on other file types "
15458 "such as directories, symbolic links, block special etc."
15462 #: ../fish/guestfish-actions.pod:4797
15467 #: ../fish/guestfish-actions.pod:4799
15475 #: ../fish/guestfish-actions.pod:4801 ../src/guestfs-actions.pod:7269
15477 "This command truncates C<path> to a zero-length file. The file must exist "
15482 #: ../fish/guestfish-actions.pod:4804
15483 msgid "truncate-size"
15487 #: ../fish/guestfish-actions.pod:4806
15490 " truncate-size path size\n"
15495 #: ../fish/guestfish-actions.pod:4808 ../src/guestfs-actions.pod:7283
15497 "This command truncates C<path> to size C<size> bytes. The file must exist "
15502 #: ../fish/guestfish-actions.pod:4811
15504 "If the current file size is less than C<size> then the file is extended to "
15505 "the required size with zero bytes. This creates a sparse file (ie. disk "
15506 "blocks are not allocated for the file until you write to it). To create a "
15507 "non-sparse file of zeroes, use L</fallocate64> instead."
15511 #: ../fish/guestfish-actions.pod:4817
15516 #: ../fish/guestfish-actions.pod:4819
15519 " tune2fs-l device\n"
15524 #: ../fish/guestfish-actions.pod:4821 ../src/guestfs-actions.pod:7302
15526 "This returns the contents of the ext2, ext3 or ext4 filesystem superblock on "
15531 #: ../fish/guestfish-actions.pod:4824 ../src/guestfs-actions.pod:7305
15533 "It is the same as running C<tune2fs -l device>. See L<tune2fs(8)> manpage "
15534 "for more details. The list of fields returned isn't clearly defined, and "
15535 "depends on both the version of C<tune2fs> that libguestfs was built against, "
15536 "and the filesystem itself."
15540 #: ../fish/guestfish-actions.pod:4829
15545 #: ../fish/guestfish-actions.pod:4831
15548 " txz-in (tarball|-) directory\n"
15553 #: ../fish/guestfish-actions.pod:4833 ../src/guestfs-actions.pod:7325
15555 "This command uploads and unpacks local file C<tarball> (an I<xz compressed> "
15556 "tar file) into C<directory>."
15560 #: ../fish/guestfish-actions.pod:4838
15565 #: ../fish/guestfish-actions.pod:4840
15568 " txz-out directory (tarball|-)\n"
15573 #: ../fish/guestfish-actions.pod:4842 ../src/guestfs-actions.pod:7339
15575 "This command packs the contents of C<directory> and downloads it to local "
15576 "file C<tarball> (as an xz compressed tar archive)."
15580 #: ../fish/guestfish-actions.pod:4847
15585 #: ../fish/guestfish-actions.pod:4849
15593 #: ../fish/guestfish-actions.pod:4851 ../src/guestfs-actions.pod:7352
15595 "This function sets the mask used for creating new files and device nodes to "
15600 #: ../fish/guestfish-actions.pod:4854 ../src/guestfs-actions.pod:7355
15602 "Typical umask values would be C<022> which creates new files with "
15603 "permissions like \"-rw-r--r--\" or \"-rwxr-xr-x\", and C<002> which creates "
15604 "new files with permissions like \"-rw-rw-r--\" or \"-rwxrwxr-x\"."
15608 #: ../fish/guestfish-actions.pod:4859 ../src/guestfs-actions.pod:7360
15610 "The default umask is C<022>. This is important because it means that "
15611 "directories and device nodes will be created with C<0644> or C<0755> mode "
15612 "even if you specify C<0777>."
15616 #: ../fish/guestfish-actions.pod:4863
15617 msgid "See also L</get-umask>, L<umask(2)>, L</mknod>, L</mkdir>."
15621 #: ../fish/guestfish-actions.pod:4866 ../src/guestfs-actions.pod:7367
15622 msgid "This call returns the previous umask."
15626 #: ../fish/guestfish-actions.pod:4868
15631 #: ../fish/guestfish-actions.pod:4870
15636 #: ../fish/guestfish-actions.pod:4872
15639 " umount pathordevice\n"
15644 #: ../fish/guestfish-actions.pod:4874 ../src/guestfs-actions.pod:7379
15646 "This unmounts the given filesystem. The filesystem may be specified either "
15647 "by its mountpoint (path) or the device which contains the filesystem."
15651 #: ../fish/guestfish-actions.pod:4878
15656 #: ../fish/guestfish-actions.pod:4880
15657 msgid "unmount-all"
15661 #: ../fish/guestfish-actions.pod:4882
15669 #: ../fish/guestfish-actions.pod:4884 ../src/guestfs-actions.pod:7392
15670 msgid "This unmounts all mounted filesystems."
15674 #: ../fish/guestfish-actions.pod:4886 ../src/guestfs-actions.pod:7394
15675 msgid "Some internal mounts are not unmounted by this call."
15679 #: ../fish/guestfish-actions.pod:4888
15684 #: ../fish/guestfish-actions.pod:4890
15687 " upload (filename|-) remotefilename\n"
15692 #: ../fish/guestfish-actions.pod:4892 ../fish/guestfish-actions.pod:4905 ../src/guestfs-actions.pod:7407 ../src/guestfs-actions.pod:7431
15693 msgid "Upload local file C<filename> to C<remotefilename> on the filesystem."
15697 #: ../fish/guestfish-actions.pod:4897
15698 msgid "See also L</download>."
15702 #: ../fish/guestfish-actions.pod:4901
15703 msgid "upload-offset"
15707 #: ../fish/guestfish-actions.pod:4903
15710 " upload-offset (filename|-) remotefilename offset\n"
15715 #: ../fish/guestfish-actions.pod:4908 ../src/guestfs-actions.pod:7434
15717 "C<remotefilename> is overwritten starting at the byte C<offset> specified. "
15718 "The intention is to overwrite parts of existing files or devices, although "
15719 "if a non-existant file is specified then it is created with a \"hole\" "
15720 "before C<offset>. The size of the data written is implicit in the size of "
15721 "the source C<filename>."
15725 #: ../fish/guestfish-actions.pod:4915
15727 "Note that there is no limit on the amount of data that can be uploaded with "
15728 "this call, unlike with L</pwrite>, and this call always writes the full "
15729 "amount unless an error occurs."
15733 #: ../fish/guestfish-actions.pod:4920
15734 msgid "See also L</upload>, L</pwrite>."
15738 #: ../fish/guestfish-actions.pod:4924
15743 #: ../fish/guestfish-actions.pod:4926
15746 " utimens path atsecs atnsecs mtsecs mtnsecs\n"
15751 #: ../fish/guestfish-actions.pod:4928 ../src/guestfs-actions.pod:7467
15752 msgid "This command sets the timestamps of a file with nanosecond precision."
15756 #: ../fish/guestfish-actions.pod:4931 ../src/guestfs-actions.pod:7470
15758 "C<atsecs, atnsecs> are the last access time (atime) in secs and nanoseconds "
15763 #: ../fish/guestfish-actions.pod:4934 ../src/guestfs-actions.pod:7473
15765 "C<mtsecs, mtnsecs> are the last modification time (mtime) in secs and "
15766 "nanoseconds from the epoch."
15770 #: ../fish/guestfish-actions.pod:4937 ../src/guestfs-actions.pod:7476
15772 "If the C<*nsecs> field contains the special value C<-1> then the "
15773 "corresponding timestamp is set to the current time. (The C<*secs> field is "
15774 "ignored in this case)."
15778 #: ../fish/guestfish-actions.pod:4941 ../src/guestfs-actions.pod:7480
15780 "If the C<*nsecs> field contains the special value C<-2> then the "
15781 "corresponding timestamp is left unchanged. (The C<*secs> field is ignored "
15786 #: ../fish/guestfish-actions.pod:4945
15791 #: ../fish/guestfish-actions.pod:4947
15799 #: ../fish/guestfish-actions.pod:4949 ../src/guestfs-actions.pod:7493
15800 msgid "Return the libguestfs version number that the program is linked against."
15804 #: ../fish/guestfish-actions.pod:4952 ../src/guestfs-actions.pod:7496
15806 "Note that because of dynamic linking this is not necessarily the version of "
15807 "libguestfs that you compiled against. You can compile the program, and then "
15808 "at runtime dynamically link against a completely different C<libguestfs.so> "
15813 #: ../fish/guestfish-actions.pod:4957 ../src/guestfs-actions.pod:7501
15815 "This call was added in version C<1.0.58>. In previous versions of "
15816 "libguestfs there was no way to get the version number. From C code you can "
15817 "use dynamic linker functions to find out if this symbol exists (if it "
15818 "doesn't, then it's an earlier version)."
15822 #: ../fish/guestfish-actions.pod:4963 ../src/guestfs-actions.pod:7507
15824 "The call returns a structure with four elements. The first three (C<major>, "
15825 "C<minor> and C<release>) are numbers and correspond to the usual version "
15826 "triplet. The fourth element (C<extra>) is a string and is normally empty, "
15827 "but may be used for distro-specific information."
15831 #: ../fish/guestfish-actions.pod:4969 ../src/guestfs-actions.pod:7513
15832 msgid "To construct the original version string: C<$major.$minor.$release$extra>"
15836 #: ../fish/guestfish-actions.pod:4972 ../src/guestfs-actions.pod:7516
15837 msgid "See also: L<guestfs(3)/LIBGUESTFS VERSION NUMBERS>."
15841 #: ../fish/guestfish-actions.pod:4974
15843 "I<Note:> Don't use this call to test for availability of features. In "
15844 "enterprise distributions we backport features from later versions into "
15845 "earlier versions, making this an unreliable way to test for features. Use "
15846 "L</available> instead."
15850 #: ../fish/guestfish-actions.pod:4980
15855 #: ../fish/guestfish-actions.pod:4982
15858 " vfs-label device\n"
15863 #: ../fish/guestfish-actions.pod:4984 ../src/guestfs-actions.pod:7536
15864 msgid "This returns the filesystem label of the filesystem on C<device>."
15868 #: ../fish/guestfish-actions.pod:4987 ../src/guestfs-actions.pod:7539
15869 msgid "If the filesystem is unlabeled, this returns the empty string."
15873 #: ../fish/guestfish-actions.pod:4989
15874 msgid "To find a filesystem from the label, use L</findfs-label>."
15878 #: ../fish/guestfish-actions.pod:4991
15883 #: ../fish/guestfish-actions.pod:4993
15886 " vfs-type device\n"
15891 #: ../fish/guestfish-actions.pod:4995 ../src/guestfs-actions.pod:7554
15893 "This command gets the filesystem type corresponding to the filesystem on "
15898 #: ../fish/guestfish-actions.pod:4998 ../src/guestfs-actions.pod:7557
15900 "For most filesystems, the result is the name of the Linux VFS module which "
15901 "would be used to mount this filesystem if you mounted it without specifying "
15902 "the filesystem type. For example a string such as C<ext3> or C<ntfs>."
15906 #: ../fish/guestfish-actions.pod:5003
15911 #: ../fish/guestfish-actions.pod:5005
15914 " vfs-uuid device\n"
15919 #: ../fish/guestfish-actions.pod:5007 ../src/guestfs-actions.pod:7573
15920 msgid "This returns the filesystem UUID of the filesystem on C<device>."
15924 #: ../fish/guestfish-actions.pod:5010 ../src/guestfs-actions.pod:7576
15925 msgid "If the filesystem does not have a UUID, this returns the empty string."
15929 #: ../fish/guestfish-actions.pod:5012
15930 msgid "To find a filesystem from the UUID, use L</findfs-uuid>."
15934 #: ../fish/guestfish-actions.pod:5014
15935 msgid "vg-activate"
15939 #: ../fish/guestfish-actions.pod:5016
15942 " vg-activate true|false 'volgroups ...'\n"
15947 #: ../fish/guestfish-actions.pod:5018 ../src/guestfs-actions.pod:7592
15949 "This command activates or (if C<activate> is false) deactivates all logical "
15950 "volumes in the listed volume groups C<volgroups>."
15954 #: ../fish/guestfish-actions.pod:5021 ../src/guestfs-actions.pod:7595
15955 msgid "This command is the same as running C<vgchange -a y|n volgroups...>"
15959 #: ../fish/guestfish-actions.pod:5023 ../src/guestfs-actions.pod:7597
15961 "Note that if C<volgroups> is an empty list then B<all> volume groups are "
15962 "activated or deactivated."
15966 #: ../fish/guestfish-actions.pod:5026
15967 msgid "vg-activate-all"
15971 #: ../fish/guestfish-actions.pod:5028
15974 " vg-activate-all true|false\n"
15979 #: ../fish/guestfish-actions.pod:5030 ../src/guestfs-actions.pod:7610
15981 "This command activates or (if C<activate> is false) deactivates all logical "
15982 "volumes in all volume groups."
15986 #: ../fish/guestfish-actions.pod:5033 ../src/guestfs-actions.pod:7613
15987 msgid "This command is the same as running C<vgchange -a y|n>"
15991 #: ../fish/guestfish-actions.pod:5035
15996 #: ../fish/guestfish-actions.pod:5037
15999 " vgcreate volgroup 'physvols ...'\n"
16004 #: ../fish/guestfish-actions.pod:5039 ../src/guestfs-actions.pod:7626
16006 "This creates an LVM volume group called C<volgroup> from the non-empty list "
16007 "of physical volumes C<physvols>."
16011 #: ../fish/guestfish-actions.pod:5042
16016 #: ../fish/guestfish-actions.pod:5044
16019 " vglvuuids vgname\n"
16024 #: ../fish/guestfish-actions.pod:5046 ../src/guestfs-actions.pod:7639
16026 "Given a VG called C<vgname>, this returns the UUIDs of all the logical "
16027 "volumes created in this volume group."
16031 #: ../fish/guestfish-actions.pod:5049
16033 "You can use this along with L</lvs> and L</lvuuid> calls to associate "
16034 "logical volumes and volume groups."
16038 #: ../fish/guestfish-actions.pod:5052
16039 msgid "See also L</vgpvuuids>."
16043 #: ../fish/guestfish-actions.pod:5054
16048 #: ../fish/guestfish-actions.pod:5056
16051 " vgpvuuids vgname\n"
16056 #: ../fish/guestfish-actions.pod:5058 ../src/guestfs-actions.pod:7659
16058 "Given a VG called C<vgname>, this returns the UUIDs of all the physical "
16059 "volumes that this volume group resides on."
16063 #: ../fish/guestfish-actions.pod:5061
16065 "You can use this along with L</pvs> and L</pvuuid> calls to associate "
16066 "physical volumes and volume groups."
16070 #: ../fish/guestfish-actions.pod:5064
16071 msgid "See also L</vglvuuids>."
16075 #: ../fish/guestfish-actions.pod:5066
16080 #: ../fish/guestfish-actions.pod:5068
16083 " vgremove vgname\n"
16088 #: ../fish/guestfish-actions.pod:5070 ../src/guestfs-actions.pod:7679
16089 msgid "Remove an LVM volume group C<vgname>, (for example C<VG>)."
16093 #: ../fish/guestfish-actions.pod:5072 ../src/guestfs-actions.pod:7681
16094 msgid "This also forcibly removes all logical volumes in the volume group (if any)."
16098 #: ../fish/guestfish-actions.pod:5075
16103 #: ../fish/guestfish-actions.pod:5077
16106 " vgrename volgroup newvolgroup\n"
16111 #: ../fish/guestfish-actions.pod:5079 ../src/guestfs-actions.pod:7695
16112 msgid "Rename a volume group C<volgroup> with the new name C<newvolgroup>."
16116 #: ../fish/guestfish-actions.pod:5081
16121 #: ../fish/guestfish-actions.pod:5083
16129 #: ../fish/guestfish-actions.pod:5085 ../src/guestfs-actions.pod:7706
16131 "List all the volumes groups detected. This is the equivalent of the "
16132 "L<vgs(8)> command."
16136 #: ../fish/guestfish-actions.pod:5088 ../src/guestfs-actions.pod:7709
16138 "This returns a list of just the volume group names that were detected "
16139 "(eg. C<VolGroup00>)."
16143 #: ../fish/guestfish-actions.pod:5091
16144 msgid "See also L</vgs-full>."
16148 #: ../fish/guestfish-actions.pod:5093
16153 #: ../fish/guestfish-actions.pod:5095
16161 #: ../fish/guestfish-actions.pod:5097 ../src/guestfs-actions.pod:7725
16163 "List all the volumes groups detected. This is the equivalent of the "
16164 "L<vgs(8)> command. The \"full\" version includes all fields."
16168 #: ../fish/guestfish-actions.pod:5100
16173 #: ../fish/guestfish-actions.pod:5102
16181 #: ../fish/guestfish-actions.pod:5104 ../src/guestfs-actions.pod:7739
16183 "This rescans all block devices and rebuilds the list of LVM physical "
16184 "volumes, volume groups and logical volumes."
16188 #: ../fish/guestfish-actions.pod:5107
16193 #: ../fish/guestfish-actions.pod:5109
16201 #: ../fish/guestfish-actions.pod:5111 ../src/guestfs-actions.pod:7752
16202 msgid "This command returns the UUID of the LVM VG named C<vgname>."
16206 #: ../fish/guestfish-actions.pod:5113
16211 #: ../fish/guestfish-actions.pod:5115
16219 #: ../fish/guestfish-actions.pod:5117 ../src/guestfs-actions.pod:7792
16221 "This command counts the characters in a file, using the C<wc -c> external "
16226 #: ../fish/guestfish-actions.pod:5120
16231 #: ../fish/guestfish-actions.pod:5122
16239 #: ../fish/guestfish-actions.pod:5124 ../src/guestfs-actions.pod:7805
16241 "This command counts the lines in a file, using the C<wc -l> external "
16246 #: ../fish/guestfish-actions.pod:5127
16251 #: ../fish/guestfish-actions.pod:5129
16259 #: ../fish/guestfish-actions.pod:5131 ../src/guestfs-actions.pod:7818
16261 "This command counts the words in a file, using the C<wc -w> external "
16266 #: ../fish/guestfish-actions.pod:5134
16271 #: ../fish/guestfish-actions.pod:5136
16274 " write path content\n"
16279 #: ../fish/guestfish-actions.pod:5138 ../src/guestfs-actions.pod:7833
16281 "This call creates a file called C<path>. The content of the file is the "
16282 "string C<content> (which can contain any 8 bit data)."
16286 #: ../fish/guestfish-actions.pod:5141
16287 msgid "See also L</write-append>."
16291 #: ../fish/guestfish-actions.pod:5146
16292 msgid "write-append"
16296 #: ../fish/guestfish-actions.pod:5148
16299 " write-append path content\n"
16304 #: ../fish/guestfish-actions.pod:5150 ../src/guestfs-actions.pod:7853
16306 "This call appends C<content> to the end of file C<path>. If C<path> does "
16307 "not exist, then a new file is created."
16311 #: ../fish/guestfish-actions.pod:5153
16312 msgid "See also L</write>."
16316 #: ../fish/guestfish-actions.pod:5158
16321 #: ../fish/guestfish-actions.pod:5160
16324 " write-file path content size\n"
16329 #: ../fish/guestfish-actions.pod:5162 ../src/guestfs-actions.pod:7880
16331 "This call creates a file called C<path>. The contents of the file is the "
16332 "string C<content> (which can contain any 8 bit data), with length C<size>."
16336 #: ../fish/guestfish-actions.pod:5166 ../src/guestfs-actions.pod:7884
16338 "As a special case, if C<size> is C<0> then the length is calculated using "
16339 "C<strlen> (so in this case the content cannot contain embedded ASCII NULs)."
16343 #: ../fish/guestfish-actions.pod:5170 ../src/guestfs-actions.pod:7888
16345 "I<NB.> Owing to a bug, writing content containing ASCII NUL characters does "
16346 "I<not> work, even if the length is specified."
16350 #: ../fish/guestfish-actions.pod:5176
16351 msgid "I<This function is deprecated.> In new code, use the L</write> call instead."
16355 #: ../fish/guestfish-actions.pod:5183
16360 #: ../fish/guestfish-actions.pod:5185
16363 " zegrep regex path\n"
16368 #: ../fish/guestfish-actions.pod:5187 ../src/guestfs-actions.pod:7905
16369 msgid "This calls the external C<zegrep> program and returns the matching lines."
16373 #: ../fish/guestfish-actions.pod:5193
16378 #: ../fish/guestfish-actions.pod:5195
16381 " zegrepi regex path\n"
16386 #: ../fish/guestfish-actions.pod:5197 ../src/guestfs-actions.pod:7924
16387 msgid "This calls the external C<zegrep -i> program and returns the matching lines."
16391 #: ../fish/guestfish-actions.pod:5203
16396 #: ../fish/guestfish-actions.pod:5205
16404 #: ../fish/guestfish-actions.pod:5207 ../src/guestfs-actions.pod:7942
16405 msgid "This command writes zeroes over the first few blocks of C<device>."
16409 #: ../fish/guestfish-actions.pod:5209 ../src/guestfs-actions.pod:7944
16411 "How many blocks are zeroed isn't specified (but it's I<not> enough to "
16412 "securely wipe the device). It should be sufficient to remove any partition "
16413 "tables, filesystem superblocks and so on."
16417 #: ../fish/guestfish-actions.pod:5213 ../fish/guestfish-actions.pod:5228 ../src/guestfs-actions.pod:7948 ../src/guestfs-actions.pod:7974
16419 "If blocks are already zero, then this command avoids writing zeroes. This "
16420 "prevents the underlying device from becoming non-sparse or growing "
16425 #: ../fish/guestfish-actions.pod:5217
16426 msgid "See also: L</zero-device>, L</scrub-device>, L</is-zero-device>"
16430 #: ../fish/guestfish-actions.pod:5220
16431 msgid "zero-device"
16435 #: ../fish/guestfish-actions.pod:5222
16438 " zero-device device\n"
16443 #: ../fish/guestfish-actions.pod:5224
16445 "This command writes zeroes over the entire C<device>. Compare with L</zero> "
16446 "which just zeroes the first few blocks of a device."
16450 #: ../fish/guestfish-actions.pod:5235
16455 #: ../fish/guestfish-actions.pod:5237
16458 " zerofree device\n"
16463 #: ../fish/guestfish-actions.pod:5239 ../src/guestfs-actions.pod:7996
16465 "This runs the I<zerofree> program on C<device>. This program claims to zero "
16466 "unused inodes and disk blocks on an ext2/3 filesystem, thus making it "
16467 "possible to compress the filesystem more effectively."
16471 #: ../fish/guestfish-actions.pod:5244 ../src/guestfs-actions.pod:8001
16472 msgid "You should B<not> run this program if the filesystem is mounted."
16476 #: ../fish/guestfish-actions.pod:5247 ../src/guestfs-actions.pod:8004
16478 "It is possible that using this program can damage the filesystem or data on "
16483 #: ../fish/guestfish-actions.pod:5250
16488 #: ../fish/guestfish-actions.pod:5252
16491 " zfgrep pattern path\n"
16496 #: ../fish/guestfish-actions.pod:5254 ../src/guestfs-actions.pod:8018
16497 msgid "This calls the external C<zfgrep> program and returns the matching lines."
16501 #: ../fish/guestfish-actions.pod:5260
16506 #: ../fish/guestfish-actions.pod:5262
16509 " zfgrepi pattern path\n"
16514 #: ../fish/guestfish-actions.pod:5264 ../src/guestfs-actions.pod:8037
16515 msgid "This calls the external C<zfgrep -i> program and returns the matching lines."
16519 #: ../fish/guestfish-actions.pod:5270
16524 #: ../fish/guestfish-actions.pod:5272
16527 " zfile meth path\n"
16532 #: ../fish/guestfish-actions.pod:5274 ../src/guestfs-actions.pod:8063
16533 msgid "This command runs C<file> after first decompressing C<path> using C<method>."
16537 #: ../fish/guestfish-actions.pod:5277 ../src/guestfs-actions.pod:8066
16538 msgid "C<method> must be one of C<gzip>, C<compress> or C<bzip2>."
16542 #: ../fish/guestfish-actions.pod:5279
16543 msgid "Since 1.0.63, use L</file> instead which can now process compressed files."
16547 #: ../fish/guestfish-actions.pod:5282
16548 msgid "I<This function is deprecated.> In new code, use the L</file> call instead."
16552 #: ../fish/guestfish-actions.pod:5289
16557 #: ../fish/guestfish-actions.pod:5291
16560 " zgrep regex path\n"
16565 #: ../fish/guestfish-actions.pod:5293 ../src/guestfs-actions.pod:8083
16566 msgid "This calls the external C<zgrep> program and returns the matching lines."
16570 #: ../fish/guestfish-actions.pod:5299
16575 #: ../fish/guestfish-actions.pod:5301
16578 " zgrepi regex path\n"
16583 #: ../fish/guestfish-actions.pod:5303 ../src/guestfs-actions.pod:8102
16584 msgid "This calls the external C<zgrep -i> program and returns the matching lines."
16588 #: ../fish/guestfish-commands.pod:1
16593 #: ../fish/guestfish-commands.pod:3
16598 #: ../fish/guestfish-commands.pod:5
16601 " alloc filename size\n"
16606 #: ../fish/guestfish-commands.pod:7
16608 "This creates an empty (zeroed) file of the given size, and then adds so it "
16609 "can be further examined."
16613 #: ../fish/guestfish-commands.pod:10 ../fish/guestfish-commands.pod:193
16614 msgid "For more advanced image creation, see L<qemu-img(1)> utility."
16618 #: ../fish/guestfish-commands.pod:12 ../fish/guestfish-commands.pod:195
16619 msgid "Size can be specified using standard suffixes, eg. C<1M>."
16623 #: ../fish/guestfish-commands.pod:14
16625 "To create a sparse file, use L</sparse> instead. To create a prepared disk "
16626 "image, see L</PREPARED DISK IMAGES>."
16630 #: ../fish/guestfish-commands.pod:17
16635 #: ../fish/guestfish-commands.pod:19
16638 " copy-in local [local ...] /remotedir\n"
16643 #: ../fish/guestfish-commands.pod:21
16645 "C<copy-in> copies local files or directories recursively into the disk "
16646 "image, placing them in the directory called C</remotedir> (which must "
16647 "exist). This guestfish meta-command turns into a sequence of L</tar-in> and "
16648 "other commands as necessary."
16652 #: ../fish/guestfish-commands.pod:26
16654 "Multiple local files and directories can be specified, but the last "
16655 "parameter must always be a remote directory. Wildcards cannot be used."
16659 #: ../fish/guestfish-commands.pod:30
16664 #: ../fish/guestfish-commands.pod:32
16667 " copy-out remote [remote ...] localdir\n"
16672 #: ../fish/guestfish-commands.pod:34
16674 "C<copy-out> copies remote files or directories recursively out of the disk "
16675 "image, placing them on the host disk in a local directory called C<localdir> "
16676 "(which must exist). This guestfish meta-command turns into a sequence of "
16677 "L</download>, L</tar-out> and other commands as necessary."
16681 #: ../fish/guestfish-commands.pod:40
16683 "Multiple remote files and directories can be specified, but the last "
16684 "parameter must always be a local directory. To download to the current "
16685 "directory, use C<.> as in:"
16689 #: ../fish/guestfish-commands.pod:44
16692 " copy-out /home .\n"
16697 #: ../fish/guestfish-commands.pod:46
16699 "Wildcards cannot be used in the ordinary command, but you can use them with "
16700 "the help of L</glob> like this:"
16704 #: ../fish/guestfish-commands.pod:49
16707 " glob copy-out /home/* .\n"
16712 #: ../fish/guestfish-commands.pod:51
16717 #: ../fish/guestfish-commands.pod:53
16720 " display filename\n"
16725 #: ../fish/guestfish-commands.pod:55
16727 "Use C<display> (a graphical display program) to display an image file. It "
16728 "downloads the file, and runs C<display> on it."
16732 #: ../fish/guestfish-commands.pod:58
16734 "To use an alternative program, set the C<GUESTFISH_DISPLAY_IMAGE> "
16735 "environment variable. For example to use the GNOME display program:"
16739 #: ../fish/guestfish-commands.pod:61
16742 " export GUESTFISH_DISPLAY_IMAGE=eog\n"
16747 #: ../fish/guestfish-commands.pod:63
16748 msgid "See also L<display(1)>."
16752 #: ../fish/guestfish-commands.pod:65
16757 #: ../fish/guestfish-commands.pod:67
16760 " echo [params ...]\n"
16765 #: ../fish/guestfish-commands.pod:69
16766 msgid "This echos the parameters to the terminal."
16770 #: ../fish/guestfish-commands.pod:71
16775 #: ../fish/guestfish-commands.pod:73
16780 #: ../fish/guestfish-commands.pod:75
16785 #: ../fish/guestfish-commands.pod:77
16793 #: ../fish/guestfish-commands.pod:79
16795 "This is used to edit a file. It downloads the file, edits it locally using "
16796 "your editor, then uploads the result."
16800 #: ../fish/guestfish-commands.pod:82
16802 "The editor is C<$EDITOR>. However if you use the alternate commands C<vi> "
16803 "or C<emacs> you will get those corresponding editors."
16807 #: ../fish/guestfish-commands.pod:86
16812 #: ../fish/guestfish-commands.pod:88
16815 " glob command args...\n"
16820 #: ../fish/guestfish-commands.pod:90
16822 "Expand wildcards in any paths in the args list, and run C<command> "
16823 "repeatedly on each matching path."
16827 #: ../fish/guestfish-commands.pod:93
16828 msgid "See L</WILDCARDS AND GLOBBING>."
16832 #: ../fish/guestfish-commands.pod:95
16837 #: ../fish/guestfish-commands.pod:97
16840 " hexedit <filename|device>\n"
16841 " hexedit <filename|device> <max>\n"
16842 " hexedit <filename|device> <start> <max>\n"
16847 #: ../fish/guestfish-commands.pod:101
16849 "Use hexedit (a hex editor) to edit all or part of a binary file or block "
16854 #: ../fish/guestfish-commands.pod:104
16856 "This command works by downloading potentially the whole file or device, "
16857 "editing it locally, then uploading it. If the file or device is large, you "
16858 "have to specify which part you wish to edit by using C<max> and/or C<start> "
16859 "C<max> parameters. C<start> and C<max> are specified in bytes, with the "
16860 "usual modifiers allowed such as C<1M> (1 megabyte)."
16864 #: ../fish/guestfish-commands.pod:111
16865 msgid "For example to edit the first few sectors of a disk you might do:"
16869 #: ../fish/guestfish-commands.pod:114
16872 " hexedit /dev/sda 1M\n"
16877 #: ../fish/guestfish-commands.pod:116
16879 "which would allow you to edit anywhere within the first megabyte of the "
16884 #: ../fish/guestfish-commands.pod:119
16885 msgid "To edit the superblock of an ext2 filesystem on C</dev/sda1>, do:"
16889 #: ../fish/guestfish-commands.pod:121
16892 " hexedit /dev/sda1 0x400 0x400\n"
16897 #: ../fish/guestfish-commands.pod:123
16898 msgid "(assuming the superblock is in the standard location)."
16902 #: ../fish/guestfish-commands.pod:125
16904 "This command requires the external L<hexedit(1)> program. You can specify "
16905 "another program to use by setting the C<HEXEDITOR> environment variable."
16909 #: ../fish/guestfish-commands.pod:129
16910 msgid "See also L</hexdump>."
16914 #: ../fish/guestfish-commands.pod:131
16919 #: ../fish/guestfish-commands.pod:133
16927 #: ../fish/guestfish-commands.pod:135
16928 msgid "Change the local directory, ie. the current directory of guestfish itself."
16932 #: ../fish/guestfish-commands.pod:138
16933 msgid "Note that C<!cd> won't do what you might expect."
16937 #: ../fish/guestfish-commands.pod:140
16942 #: ../fish/guestfish-commands.pod:142
16947 #: ../fish/guestfish-commands.pod:144
16955 #: ../fish/guestfish-commands.pod:146
16956 msgid "Opens the manual page for guestfish."
16960 #: ../fish/guestfish-commands.pod:148
16965 #: ../fish/guestfish-commands.pod:150
16970 #: ../fish/guestfish-commands.pod:152
16978 #: ../fish/guestfish-commands.pod:154
16986 #: ../fish/guestfish-commands.pod:156
16987 msgid "This is used to view a file."
16991 #: ../fish/guestfish-commands.pod:158
16993 "The default viewer is C<$PAGER>. However if you use the alternate command "
16994 "C<less> you will get the C<less> command specifically."
16998 #: ../fish/guestfish-commands.pod:161
17003 #: ../fish/guestfish-commands.pod:163
17011 #: ../fish/guestfish-commands.pod:165
17013 "Close and reopen the libguestfs handle. It is not necessary to use this "
17014 "normally, because the handle is closed properly when guestfish exits. "
17015 "However this is occasionally useful for testing."
17019 #: ../fish/guestfish-commands.pod:169
17024 #: ../fish/guestfish-commands.pod:171
17027 " setenv VAR value\n"
17032 #: ../fish/guestfish-commands.pod:173
17033 msgid "Set the environment variable C<VAR> to the string C<value>."
17037 #: ../fish/guestfish-commands.pod:175
17038 msgid "To print the value of an environment variable use a shell command such as:"
17042 #: ../fish/guestfish-commands.pod:178
17050 #: ../fish/guestfish-commands.pod:180
17055 #: ../fish/guestfish-commands.pod:182
17058 " sparse filename size\n"
17063 #: ../fish/guestfish-commands.pod:184
17065 "This creates an empty sparse file of the given size, and then adds so it can "
17066 "be further examined."
17070 #: ../fish/guestfish-commands.pod:187
17072 "In all respects it works the same as the L</alloc> command, except that the "
17073 "image file is allocated sparsely, which means that disk blocks are not "
17074 "assigned to the file until they are needed. Sparse disk files only use "
17075 "space when written to, but they are slower and there is a danger you could "
17076 "run out of real disk space during a write operation."
17080 #: ../fish/guestfish-commands.pod:197
17085 #: ../fish/guestfish-commands.pod:199
17093 #: ../fish/guestfish-commands.pod:201
17095 "This command returns a list of the optional groups known to the daemon, and "
17096 "indicates which ones are supported by this build of the libguestfs "
17101 #: ../fish/guestfish-commands.pod:205
17102 msgid "See also L<guestfs(3)/AVAILABILITY>."
17106 #: ../fish/guestfish-commands.pod:207
17111 #: ../fish/guestfish-commands.pod:209
17114 " time command args...\n"
17119 #: ../fish/guestfish-commands.pod:211
17121 "Run the command as usual, but print the elapsed time afterwards. This can "
17122 "be useful for benchmarking operations."
17126 #: ../fish/guestfish-commands.pod:214
17131 #: ../fish/guestfish-commands.pod:216
17139 #: ../fish/guestfish-commands.pod:218
17140 msgid "Remove C<VAR> from the environment."
17144 #: ../fish/guestfish.pod:5
17145 msgid "guestfish - the libguestfs Filesystem Interactive SHell"
17149 #: ../fish/guestfish.pod:9
17152 " guestfish [--options] [commands]\n"
17157 #: ../fish/guestfish.pod:11
17165 #: ../fish/guestfish.pod:13
17168 " guestfish [--ro|--rw] -a disk.img\n"
17173 #: ../fish/guestfish.pod:15
17176 " guestfish [--ro|--rw] -a disk.img -m dev[:mountpoint]\n"
17181 #: ../fish/guestfish.pod:17
17184 " guestfish -d libvirt-domain\n"
17189 #: ../fish/guestfish.pod:19
17192 " guestfish [--ro|--rw] -a disk.img -i\n"
17197 #: ../fish/guestfish.pod:21
17200 " guestfish -d libvirt-domain -i\n"
17205 #: ../fish/guestfish.pod:25
17207 "Using guestfish in read/write mode on live virtual machines can be "
17208 "dangerous, potentially causing disk corruption. Use the I<--ro> (read-only) "
17209 "option to use guestfish safely if the disk image or virtual machine might be "
17214 #: ../fish/guestfish.pod:32
17216 "Guestfish is a shell and command-line tool for examining and modifying "
17217 "virtual machine filesystems. It uses libguestfs and exposes all of the "
17218 "functionality of the guestfs API, see L<guestfs(3)>."
17222 #: ../fish/guestfish.pod:36
17224 "Guestfish gives you structured access to the libguestfs API, from shell "
17225 "scripts or the command line or interactively. If you want to rescue a "
17226 "broken virtual machine image, you should look at the L<virt-rescue(1)> "
17231 #: ../fish/guestfish.pod:43
17232 msgid "As an interactive shell"
17236 #: ../fish/guestfish.pod:45
17244 #: ../fish/guestfish.pod:47
17247 " Welcome to guestfish, the libguestfs filesystem interactive shell for\n"
17248 " editing virtual machine filesystems.\n"
17253 #: ../fish/guestfish.pod:50
17256 " Type: 'help' for a list of commands\n"
17257 " 'man' to read the manual\n"
17258 " 'quit' to quit the shell\n"
17263 #: ../fish/guestfish.pod:54
17266 " ><fs> add-ro disk.img\n"
17268 " ><fs> list-filesystems\n"
17269 " /dev/sda1: ext4\n"
17270 " /dev/vg_guest/lv_root: ext4\n"
17271 " /dev/vg_guest/lv_swap: swap\n"
17272 " ><fs> mount /dev/vg_guest/lv_root /\n"
17273 " ><fs> cat /etc/fstab\n"
17275 " # Created by anaconda\n"
17282 #: ../fish/guestfish.pod:67
17283 msgid "From shell scripts"
17287 #: ../fish/guestfish.pod:69
17288 msgid "Create a new C</etc/motd> file in a guest or disk image:"
17292 #: ../fish/guestfish.pod:71
17295 " guestfish <<_EOF_\n"
17298 " mount /dev/vg_guest/lv_root /\n"
17299 " write /etc/motd \"Welcome, new users\"\n"
17305 #: ../fish/guestfish.pod:78
17306 msgid "List the LVM logical volumes in a disk image:"
17310 #: ../fish/guestfish.pod:80
17313 " guestfish -a disk.img --ro <<_EOF_\n"
17321 #: ../fish/guestfish.pod:85
17322 msgid "List all the filesystems in a disk image:"
17326 #: ../fish/guestfish.pod:87
17329 " guestfish -a disk.img --ro <<_EOF_\n"
17331 " list-filesystems\n"
17337 #: ../fish/guestfish.pod:92
17338 msgid "On one command line"
17342 #: ../fish/guestfish.pod:94 ../fish/virt-copy-in.pod:31
17343 msgid "Update C</etc/resolv.conf> in a guest:"
17347 #: ../fish/guestfish.pod:96
17351 " add disk.img : run : mount /dev/vg_guest/lv_root / : \\\n"
17352 " write /etc/resolv.conf \"nameserver 1.2.3.4\"\n"
17357 #: ../fish/guestfish.pod:100
17358 msgid "Edit C</boot/grub/grub.conf> interactively:"
17362 #: ../fish/guestfish.pod:102
17365 " guestfish --rw --add disk.img \\\n"
17366 " --mount /dev/vg_guest/lv_root \\\n"
17367 " --mount /dev/sda1:/boot \\\n"
17368 " edit /boot/grub/grub.conf\n"
17373 #: ../fish/guestfish.pod:107
17374 msgid "Mount disks automatically"
17378 #: ../fish/guestfish.pod:109
17380 "Use the I<-i> option to automatically mount the disks from a virtual "
17385 #: ../fish/guestfish.pod:112
17388 " guestfish --ro -a disk.img -i cat /etc/group\n"
17393 #: ../fish/guestfish.pod:114
17396 " guestfish --ro -d libvirt-domain -i cat /etc/group\n"
17401 #: ../fish/guestfish.pod:116
17402 msgid "Another way to edit C</boot/grub/grub.conf> interactively is:"
17406 #: ../fish/guestfish.pod:118
17409 " guestfish --rw -a disk.img -i edit /boot/grub/grub.conf\n"
17414 #: ../fish/guestfish.pod:120
17415 msgid "As a script interpreter"
17419 #: ../fish/guestfish.pod:122
17420 msgid "Create a 100MB disk containing an ext2-formatted partition:"
17424 #: ../fish/guestfish.pod:124
17427 " #!/usr/bin/guestfish -f\n"
17428 " sparse test1.img 100M\n"
17430 " part-disk /dev/sda mbr\n"
17431 " mkfs ext2 /dev/sda1\n"
17436 #: ../fish/guestfish.pod:130
17437 msgid "Start with a prepared disk"
17441 #: ../fish/guestfish.pod:132
17443 "An alternate way to create a 100MB disk called C<test1.img> containing a "
17444 "single ext2-formatted partition:"
17448 #: ../fish/guestfish.pod:135 ../src/guestfs.pod:2228
17451 " guestfish -N fs\n"
17456 #: ../fish/guestfish.pod:137
17457 msgid "To list what is available do:"
17461 #: ../fish/guestfish.pod:139 ../fish/guestfish.pod:1042
17464 " guestfish -N help | less\n"
17469 #: ../fish/guestfish.pod:141
17470 msgid "Remote control"
17474 #: ../fish/guestfish.pod:143
17477 " eval \"`guestfish --listen`\"\n"
17478 " guestfish --remote add-ro disk.img\n"
17479 " guestfish --remote run\n"
17480 " guestfish --remote lvs\n"
17485 #: ../fish/guestfish.pod:154
17486 msgid "Displays general help on options."
17490 #: ../fish/guestfish.pod:158
17491 msgid "B<--cmd-help>"
17495 #: ../fish/guestfish.pod:160
17496 msgid "Lists all available guestfish commands."
17500 #: ../fish/guestfish.pod:162
17505 #: ../fish/guestfish.pod:164
17506 msgid "B<--cmd-help cmd>"
17510 #: ../fish/guestfish.pod:166
17511 msgid "Displays detailed help on a single command C<cmd>."
17515 #: ../fish/guestfish.pod:168 ../fuse/guestmount.pod:96
17516 msgid "B<-a image>"
17520 #: ../fish/guestfish.pod:170 ../fuse/guestmount.pod:98
17521 msgid "B<--add image>"
17525 #: ../fish/guestfish.pod:172
17526 msgid "Add a block device or virtual machine image to the shell."
17530 #: ../fish/guestfish.pod:177
17532 "Using this flag is mostly equivalent to using the C<add> command, with "
17533 "C<readonly:true> if the I<--ro> flag was given, and with C<format:...> if "
17534 "the I<--format=...> flag was given."
17538 #: ../fish/guestfish.pod:185 ../fuse/guestmount.pod:109
17540 "When used in conjunction with the I<-d> option, this specifies the libvirt "
17541 "URI to use. The default is to use the default libvirt connection."
17545 #: ../fish/guestfish.pod:189
17550 #: ../fish/guestfish.pod:191
17552 "If using the I<--listen> option and a csh-like shell, use this option. See "
17553 "section L</REMOTE CONTROL AND CSH> below."
17557 #: ../fish/guestfish.pod:194 ../fuse/guestmount.pod:113
17558 msgid "B<-d libvirt-domain>"
17562 #: ../fish/guestfish.pod:196 ../fuse/guestmount.pod:115
17563 msgid "B<--domain libvirt-domain>"
17567 #: ../fish/guestfish.pod:198 ../fuse/guestmount.pod:117
17569 "Add disks from the named libvirt domain. If the I<--ro> option is also "
17570 "used, then any libvirt domain can be used. However in write mode, only "
17571 "libvirt domains which are shut down can be named here."
17575 #: ../fish/guestfish.pod:202 ../fuse/guestmount.pod:121
17576 msgid "Domain UUIDs can be used instead of names."
17580 #: ../fish/guestfish.pod:204
17582 "Using this flag is mostly equivalent to using the C<add-domain> command, "
17583 "with C<readonly:true> if the I<--ro> flag was given, and with C<format:...> "
17584 "if the I<--format:...> flag was given."
17588 #: ../fish/guestfish.pod:208
17593 #: ../fish/guestfish.pod:210
17594 msgid "B<--no-dest-paths>"
17598 #: ../fish/guestfish.pod:212
17600 "Don't tab-complete paths on the guest filesystem. It is useful to be able "
17601 "to hit the tab key to complete paths on the guest filesystem, but this "
17602 "causes extra \"hidden\" guestfs calls to be made, so this option is here to "
17603 "allow this feature to be disabled."
17607 #: ../fish/guestfish.pod:219 ../fuse/guestmount.pod:137
17609 "When prompting for keys and passphrases, guestfish normally turns echoing "
17610 "off so you cannot see what you are typing. If you are not worried about "
17611 "Tempest attacks and there is no one else in the room you can specify this "
17612 "flag to see what you are typing."
17616 #: ../fish/guestfish.pod:224
17621 #: ../fish/guestfish.pod:226
17622 msgid "B<--file file>"
17626 #: ../fish/guestfish.pod:228
17627 msgid "Read commands from C<file>. To write pure guestfish scripts, use:"
17631 #: ../fish/guestfish.pod:231
17634 " #!/usr/bin/guestfish -f\n"
17639 #: ../fish/guestfish.pod:244
17642 " guestfish --format=raw -a disk.img\n"
17647 #: ../fish/guestfish.pod:248
17650 " guestfish --format=raw -a disk.img --format -a another.img\n"
17655 #: ../fish/guestfish.pod:253
17657 "If you have untrusted raw-format guest disk images, you should use this "
17658 "option to specify the disk format. This avoids a possible security problem "
17659 "with malicious guests (CVE-2010-3851). See also L</add-drive-opts>."
17663 #: ../fish/guestfish.pod:260 ../fuse/guestmount.pod:166
17664 msgid "B<--inspector>"
17668 #: ../fish/guestfish.pod:262 ../fuse/guestmount.pod:168
17670 "Using L<virt-inspector(1)> code, inspect the disks looking for an operating "
17671 "system and mount filesystems as they would be mounted on the real virtual "
17676 #: ../fish/guestfish.pod:266
17677 msgid "Typical usage is either:"
17681 #: ../fish/guestfish.pod:268
17684 " guestfish -d myguest -i\n"
17689 #: ../fish/guestfish.pod:270
17690 msgid "(for an inactive libvirt domain called I<myguest>), or:"
17694 #: ../fish/guestfish.pod:272
17697 " guestfish --ro -d myguest -i\n"
17702 #: ../fish/guestfish.pod:274
17703 msgid "(for active domains, readonly), or specify the block device directly:"
17707 #: ../fish/guestfish.pod:276
17710 " guestfish --rw -a /dev/Guests/MyGuest -i\n"
17715 #: ../fish/guestfish.pod:278
17717 "Note that the command line syntax changed slightly over older versions of "
17718 "guestfish. You can still use the old syntax:"
17722 #: ../fish/guestfish.pod:281
17725 " guestfish [--ro] -i disk.img\n"
17730 #: ../fish/guestfish.pod:283
17733 " guestfish [--ro] -i libvirt-domain\n"
17738 #: ../fish/guestfish.pod:285
17740 "Using this flag is mostly equivalent to using the C<inspect-os> command and "
17741 "then using other commands to mount the filesystems that were found."
17745 #: ../fish/guestfish.pod:294
17746 msgid "B<--listen>"
17750 #: ../fish/guestfish.pod:296
17752 "Fork into the background and listen for remote commands. See section "
17753 "L</REMOTE CONTROL GUESTFISH OVER A SOCKET> below."
17757 #: ../fish/guestfish.pod:299 ../fuse/guestmount.pod:177
17762 #: ../fish/guestfish.pod:301 ../fuse/guestmount.pod:179
17764 "Connect to a live virtual machine. (Experimental, see "
17765 "L<guestfs(3)/ATTACHING TO RUNNING DAEMONS>)."
17769 #: ../fish/guestfish.pod:304 ../fuse/guestmount.pod:182
17770 msgid "B<-m dev[:mountpoint[:options]]>"
17774 #: ../fish/guestfish.pod:306 ../fuse/guestmount.pod:184
17775 msgid "B<--mount dev[:mountpoint[:options]]>"
17779 #: ../fish/guestfish.pod:308
17780 msgid "Mount the named partition or logical volume on the given mountpoint."
17784 #: ../fish/guestfish.pod:310
17785 msgid "If the mountpoint is omitted, it defaults to C</>."
17789 #: ../fish/guestfish.pod:312
17790 msgid "You have to mount something on C</> before most commands will work."
17794 #: ../fish/guestfish.pod:314
17796 "If any I<-m> or I<--mount> options are given, the guest is automatically "
17801 #: ../fish/guestfish.pod:317
17803 "If you don't know what filesystems a disk image contains, you can either run "
17804 "guestfish without this option, then list the partitions, filesystems and LVs "
17805 "available (see L</list-partitions>, L</list-filesystems> and L</lvs> "
17806 "commands), or you can use the L<virt-filesystems(1)> program."
17810 #: ../fish/guestfish.pod:323 ../fuse/guestmount.pod:192
17812 "The third (and rarely used) part of the mount parameter is the list of mount "
17813 "options used to mount the underlying filesystem. If this is not given, then "
17814 "the mount options are either the empty string or C<ro> (the latter if the "
17815 "I<--ro> flag is used). By specifying the mount options, you override this "
17816 "default choice. Probably the only time you would use this is to enable ACLs "
17817 "and/or extended attributes if the filesystem can support them:"
17821 #: ../fish/guestfish.pod:331 ../fuse/guestmount.pod:200
17824 " -m /dev/sda1:/:acl,user_xattr\n"
17829 #: ../fish/guestfish.pod:333
17830 msgid "Using this flag is equivalent to using the C<mount-options> command."
17834 #: ../fish/guestfish.pod:335 ../fuse/guestmount.pod:202 ../resize/virt-resize.pod:414
17839 #: ../fish/guestfish.pod:337 ../fuse/guestmount.pod:204
17840 msgid "B<--no-sync>"
17844 #: ../fish/guestfish.pod:339
17846 "Disable autosync. This is enabled by default. See the discussion of "
17847 "autosync in the L<guestfs(3)> manpage."
17851 #: ../fish/guestfish.pod:342
17856 #: ../fish/guestfish.pod:344
17857 msgid "B<--new type>"
17861 #: ../fish/guestfish.pod:346
17866 #: ../fish/guestfish.pod:348
17868 "Prepare a fresh disk image formatted as \"type\". This is an alternative to "
17869 "the I<-a> option: whereas I<-a> adds an existing disk, I<-N> creates a "
17870 "preformatted disk with a filesystem and adds it. See L</PREPARED DISK "
17875 #: ../fish/guestfish.pod:353
17876 msgid "B<--progress-bars>"
17880 #: ../fish/guestfish.pod:355
17881 msgid "Enable progress bars, even when guestfish is used non-interactively."
17885 #: ../fish/guestfish.pod:357
17887 "Progress bars are enabled by default when guestfish is used as an "
17888 "interactive shell."
17892 #: ../fish/guestfish.pod:360
17893 msgid "B<--no-progress-bars>"
17897 #: ../fish/guestfish.pod:362
17898 msgid "Disable progress bars."
17902 #: ../fish/guestfish.pod:364
17903 msgid "B<--remote[=pid]>"
17907 #: ../fish/guestfish.pod:366
17909 "Send remote commands to C<$GUESTFISH_PID> or C<pid>. See section L</REMOTE "
17910 "CONTROL GUESTFISH OVER A SOCKET> below."
17914 #: ../fish/guestfish.pod:369 ../fuse/guestmount.pod:248 ../rescue/virt-rescue.pod:161
17919 #: ../fish/guestfish.pod:371 ../fuse/guestmount.pod:250 ../rescue/virt-rescue.pod:163
17924 #: ../fish/guestfish.pod:373
17926 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17927 "mounts are done read-only."
17931 #: ../fish/guestfish.pod:376 ../rescue/virt-rescue.pod:167
17933 "The option must always be used if the disk image or virtual machine might be "
17934 "running, and is generally recommended in cases where you don't need write "
17935 "access to the disk."
17939 #: ../fish/guestfish.pod:380
17941 "Note that prepared disk images created with I<-N> are not affected by this "
17942 "option. Also commands like C<add> are not affected - you have to specify "
17943 "the C<readonly:true> option explicitly if you need it."
17947 #: ../fish/guestfish.pod:384
17948 msgid "See also L</OPENING DISKS FOR READ AND WRITE> below."
17952 #: ../fish/guestfish.pod:386 ../fuse/guestmount.pod:262 ../rescue/virt-rescue.pod:173
17953 msgid "B<--selinux>"
17957 #: ../fish/guestfish.pod:388
17958 msgid "Enable SELinux support for the guest. See L<guestfs(3)/SELINUX>."
17962 #: ../fish/guestfish.pod:394
17964 "Enable very verbose messages. This is particularly useful if you find a "
17969 #: ../fish/guestfish.pod:401
17970 msgid "Display the guestfish / libguestfs version number and exit."
17974 #: ../fish/guestfish.pod:403 ../fuse/guestmount.pod:278 ../rescue/virt-rescue.pod:194
17979 #: ../fish/guestfish.pod:405 ../fuse/guestmount.pod:280 ../rescue/virt-rescue.pod:196
17984 #: ../fish/guestfish.pod:407 ../fuse/guestmount.pod:282
17986 "This changes the I<-a>, I<-d> and I<-m> options so that disks are added and "
17987 "mounts are done read-write."
17991 #: ../fish/guestfish.pod:410
17992 msgid "See L</OPENING DISKS FOR READ AND WRITE> below."
17996 #: ../fish/guestfish.pod:414
17997 msgid "Echo each command before executing it."
18001 #: ../fish/guestfish.pod:418
18002 msgid "COMMANDS ON COMMAND LINE"
18006 #: ../fish/guestfish.pod:420
18007 msgid "Any additional (non-option) arguments are treated as commands to execute."
18011 #: ../fish/guestfish.pod:423
18013 "Commands to execute should be separated by a colon (C<:>), where the colon "
18014 "is a separate parameter. Thus:"
18018 #: ../fish/guestfish.pod:426
18021 " guestfish cmd [args...] : cmd [args...] : cmd [args...] ...\n"
18026 #: ../fish/guestfish.pod:428
18028 "If there are no additional arguments, then we enter a shell, either an "
18029 "interactive shell with a prompt (if the input is a terminal) or a "
18030 "non-interactive shell."
18034 #: ../fish/guestfish.pod:432
18036 "In either command line mode or non-interactive shell, the first command that "
18037 "gives an error causes the whole shell to exit. In interactive mode (with a "
18038 "prompt) if a command fails, you can continue to enter commands."
18042 #: ../fish/guestfish.pod:437
18043 msgid "USING launch (OR run)"
18047 #: ../fish/guestfish.pod:439
18049 "As with L<guestfs(3)>, you must first configure your guest by adding disks, "
18050 "then launch it, then mount any disks you need, and finally issue "
18051 "actions/commands. So the general order of the day is:"
18055 #: ../fish/guestfish.pod:447
18056 msgid "add or -a/--add"
18060 #: ../fish/guestfish.pod:451
18061 msgid "launch (aka run)"
18065 #: ../fish/guestfish.pod:455
18066 msgid "mount or -m/--mount"
18070 #: ../fish/guestfish.pod:459
18071 msgid "any other commands"
18075 #: ../fish/guestfish.pod:463
18077 "C<run> is a synonym for C<launch>. You must C<launch> (or C<run>) your "
18078 "guest before mounting or performing any other commands."
18082 #: ../fish/guestfish.pod:466
18084 "The only exception is that if any of the I<-i>, I<-m>, I<--mount>, I<-N> or "
18085 "I<--new> options were given then C<run> is done automatically, simply "
18086 "because guestfish can't perform the action you asked for without doing this."
18090 #: ../fish/guestfish.pod:471
18091 msgid "OPENING DISKS FOR READ AND WRITE"
18095 #: ../fish/guestfish.pod:473
18097 "The guestfish, L<guestmount(1)> and L<virt-rescue(1)> options I<--ro> and "
18098 "I<--rw> affect whether the other command line options I<-a>, I<-c>, I<-d>, "
18099 "I<-i> and I<-m> open disk images read-only or for writing."
18103 #: ../fish/guestfish.pod:478
18105 "In libguestfs E<le> 1.10, guestfish, guestmount and virt-rescue defaulted to "
18106 "opening disk images supplied on the command line for write. To open a disk "
18107 "image read-only you have to do I<-a image --ro>."
18111 #: ../fish/guestfish.pod:482
18113 "This matters: If you accidentally open a live VM disk image writable then "
18114 "you will cause irreversible disk corruption."
18118 #: ../fish/guestfish.pod:485
18120 "In a future libguestfs we intend to change the default the other way. Disk "
18121 "images will be opened read-only. You will have to either specify "
18122 "I<guestfish --rw>, I<guestmount --rw>, I<virt-rescue --rw>, or change the "
18123 "configuration file C</etc/libguestfs-tools.conf> in order to get write "
18124 "access for disk images specified by those other command line options."
18128 #: ../fish/guestfish.pod:492
18130 "This version of guestfish, guestmount and virt-rescue has a I<--rw> option "
18131 "which does nothing (it is already the default). However it is highly "
18132 "recommended that you use this option to indicate that you need write access, "
18133 "and prepare your scripts for the day when this option will be required for "
18138 #: ../fish/guestfish.pod:498
18140 "B<Note:> This does I<not> affect commands like L</add> and L</mount>, or any "
18141 "other libguestfs program apart from guestfish and guestmount."
18145 #: ../fish/guestfish.pod:501
18150 #: ../fish/guestfish.pod:503
18152 "You can quote ordinary parameters using either single or double quotes. For "
18157 #: ../fish/guestfish.pod:506
18160 " add \"file with a space.img\"\n"
18165 #: ../fish/guestfish.pod:508
18168 " rm '/file name'\n"
18173 #: ../fish/guestfish.pod:510
18181 #: ../fish/guestfish.pod:512
18183 "A few commands require a list of strings to be passed. For these, use a "
18184 "whitespace-separated list, enclosed in quotes. Strings containing "
18185 "whitespace to be passed through must be enclosed in single quotes. A "
18186 "literal single quote must be escaped with a backslash."
18190 #: ../fish/guestfish.pod:517
18193 " vgcreate VG \"/dev/sda1 /dev/sdb1\"\n"
18194 " command \"/bin/echo 'foo bar'\"\n"
18195 " command \"/bin/echo \\'foo\\'\"\n"
18200 #: ../fish/guestfish.pod:521
18201 msgid "ESCAPE SEQUENCES IN DOUBLE QUOTED ARGUMENTS"
18205 #: ../fish/guestfish.pod:523
18207 "In double-quoted arguments (only) use backslash to insert special "
18212 #: ../fish/guestfish.pod:528
18217 #: ../fish/guestfish.pod:530
18218 msgid "Alert (bell) character."
18222 #: ../fish/guestfish.pod:532
18227 #: ../fish/guestfish.pod:534
18228 msgid "Backspace character."
18232 #: ../fish/guestfish.pod:536
18237 #: ../fish/guestfish.pod:538
18238 msgid "Form feed character."
18242 #: ../fish/guestfish.pod:540
18247 #: ../fish/guestfish.pod:542
18248 msgid "Newline character."
18252 #: ../fish/guestfish.pod:544
18257 #: ../fish/guestfish.pod:546
18258 msgid "Carriage return character."
18262 #: ../fish/guestfish.pod:548
18267 #: ../fish/guestfish.pod:550
18268 msgid "Horizontal tab character."
18272 #: ../fish/guestfish.pod:552
18277 #: ../fish/guestfish.pod:554
18278 msgid "Vertical tab character."
18282 #: ../fish/guestfish.pod:556
18287 #: ../fish/guestfish.pod:558
18288 msgid "A literal double quote character."
18292 #: ../fish/guestfish.pod:560
18297 #: ../fish/guestfish.pod:562
18299 "A character with octal value I<ooo>. There must be precisely 3 octal digits "
18304 #: ../fish/guestfish.pod:565
18309 #: ../fish/guestfish.pod:567
18310 msgid "A character with hex value I<hh>. There must be precisely 2 hex digits."
18314 #: ../fish/guestfish.pod:570
18316 "In the current implementation C<\\000> and C<\\x00> cannot be used in "
18321 #: ../fish/guestfish.pod:573
18326 #: ../fish/guestfish.pod:575
18327 msgid "A literal backslash character."
18331 #: ../fish/guestfish.pod:579
18332 msgid "OPTIONAL ARGUMENTS"
18336 #: ../fish/guestfish.pod:581
18338 "Some commands take optional arguments. These arguments appear in this "
18339 "documentation as C<[argname:..]>. You can use them as in these examples:"
18343 #: ../fish/guestfish.pod:585
18346 " add-drive-opts filename\n"
18351 #: ../fish/guestfish.pod:587
18354 " add-drive-opts filename readonly:true\n"
18359 #: ../fish/guestfish.pod:589
18362 " add-drive-opts filename format:qcow2 readonly:false\n"
18367 #: ../fish/guestfish.pod:591
18369 "Each optional argument can appear at most once. All optional arguments must "
18370 "appear after the required ones."
18374 #: ../fish/guestfish.pod:594
18379 #: ../fish/guestfish.pod:596
18380 msgid "This section applies to all commands which can take integers as parameters."
18384 #: ../fish/guestfish.pod:599
18385 msgid "SIZE SUFFIX"
18389 #: ../fish/guestfish.pod:601
18391 "When the command takes a parameter measured in bytes, you can use one of the "
18392 "following suffixes to specify kilobytes, megabytes and larger sizes:"
18396 #: ../fish/guestfish.pod:607
18397 msgid "B<k> or B<K> or B<KiB>"
18401 #: ../fish/guestfish.pod:609
18402 msgid "The size in kilobytes (multiplied by 1024)."
18406 #: ../fish/guestfish.pod:611
18411 #: ../fish/guestfish.pod:613
18412 msgid "The size in SI 1000 byte units."
18416 #: ../fish/guestfish.pod:615
18417 msgid "B<M> or B<MiB>"
18421 #: ../fish/guestfish.pod:617
18422 msgid "The size in megabytes (multiplied by 1048576)."
18426 #: ../fish/guestfish.pod:619
18431 #: ../fish/guestfish.pod:621
18432 msgid "The size in SI 1000000 byte units."
18436 #: ../fish/guestfish.pod:623
18437 msgid "B<G> or B<GiB>"
18441 #: ../fish/guestfish.pod:625
18442 msgid "The size in gigabytes (multiplied by 2**30)."
18446 #: ../fish/guestfish.pod:627
18451 #: ../fish/guestfish.pod:629
18452 msgid "The size in SI 10**9 byte units."
18456 #: ../fish/guestfish.pod:631
18457 msgid "B<T> or B<TiB>"
18461 #: ../fish/guestfish.pod:633
18462 msgid "The size in terabytes (multiplied by 2**40)."
18466 #: ../fish/guestfish.pod:635
18471 #: ../fish/guestfish.pod:637
18472 msgid "The size in SI 10**12 byte units."
18476 #: ../fish/guestfish.pod:639
18477 msgid "B<P> or B<PiB>"
18481 #: ../fish/guestfish.pod:641
18482 msgid "The size in petabytes (multiplied by 2**50)."
18486 #: ../fish/guestfish.pod:643
18491 #: ../fish/guestfish.pod:645
18492 msgid "The size in SI 10**15 byte units."
18496 #: ../fish/guestfish.pod:647
18497 msgid "B<E> or B<EiB>"
18501 #: ../fish/guestfish.pod:649
18502 msgid "The size in exabytes (multiplied by 2**60)."
18506 #: ../fish/guestfish.pod:651
18511 #: ../fish/guestfish.pod:653
18512 msgid "The size in SI 10**18 byte units."
18516 #: ../fish/guestfish.pod:655
18517 msgid "B<Z> or B<ZiB>"
18521 #: ../fish/guestfish.pod:657
18522 msgid "The size in zettabytes (multiplied by 2**70)."
18526 #: ../fish/guestfish.pod:659
18531 #: ../fish/guestfish.pod:661
18532 msgid "The size in SI 10**21 byte units."
18536 #: ../fish/guestfish.pod:663
18537 msgid "B<Y> or B<YiB>"
18541 #: ../fish/guestfish.pod:665
18542 msgid "The size in yottabytes (multiplied by 2**80)."
18546 #: ../fish/guestfish.pod:667
18551 #: ../fish/guestfish.pod:669
18552 msgid "The size in SI 10**24 byte units."
18556 #: ../fish/guestfish.pod:675
18559 " truncate-size /file 1G\n"
18564 #: ../fish/guestfish.pod:677
18565 msgid "would truncate the file to 1 gigabyte."
18569 #: ../fish/guestfish.pod:679
18571 "Be careful because a few commands take sizes in kilobytes or megabytes "
18572 "(eg. the parameter to L</memsize> is specified in megabytes already). "
18573 "Adding a suffix will probably not do what you expect."
18577 #: ../fish/guestfish.pod:683
18578 msgid "OCTAL AND HEXADECIMAL NUMBERS"
18582 #: ../fish/guestfish.pod:685
18584 "For specifying the radix (base) use the C convention: C<0> to prefix an "
18585 "octal number or C<0x> to prefix a hexadecimal number. For example:"
18589 #: ../fish/guestfish.pod:688
18592 " 1234 decimal number 1234\n"
18593 " 02322 octal number, equivalent to decimal 1234\n"
18594 " 0x4d2 hexadecimal number, equivalent to decimal 1234\n"
18599 #: ../fish/guestfish.pod:692
18601 "When using the C<chmod> command, you almost always want to specify an octal "
18602 "number for the mode, and you must prefix it with C<0> (unlike the Unix "
18603 "L<chmod(1)> program):"
18607 #: ../fish/guestfish.pod:696
18610 " chmod 0777 /public # OK\n"
18611 " chmod 777 /public # WRONG! This is mode 777 decimal = 01411 octal.\n"
18616 #: ../fish/guestfish.pod:699
18618 "Commands that return numbers usually print them in decimal, but some "
18619 "commands print numbers in other radices (eg. C<umask> prints the mode in "
18620 "octal, preceeded by C<0>)."
18624 #: ../fish/guestfish.pod:703
18625 msgid "WILDCARDS AND GLOBBING"
18629 #: ../fish/guestfish.pod:705
18631 "Neither guestfish nor the underlying guestfs API performs wildcard expansion "
18632 "(globbing) by default. So for example the following will not do what you "
18637 #: ../fish/guestfish.pod:709
18645 #: ../fish/guestfish.pod:711
18647 "Assuming you don't have a directory called literally C</home/*> then the "
18648 "above command will return an error."
18652 #: ../fish/guestfish.pod:714
18653 msgid "To perform wildcard expansion, use the C<glob> command."
18657 #: ../fish/guestfish.pod:716
18660 " glob rm-rf /home/*\n"
18665 #: ../fish/guestfish.pod:718
18667 "runs C<rm-rf> on each path that matches (ie. potentially running the command "
18668 "many times), equivalent to:"
18672 #: ../fish/guestfish.pod:721
18675 " rm-rf /home/jim\n"
18676 " rm-rf /home/joe\n"
18677 " rm-rf /home/mary\n"
18682 #: ../fish/guestfish.pod:725
18683 msgid "C<glob> only works on simple guest paths and not on device names."
18687 #: ../fish/guestfish.pod:727
18689 "If you have several parameters, each containing a wildcard, then glob will "
18690 "perform a Cartesian product."
18694 #: ../fish/guestfish.pod:730
18699 #: ../fish/guestfish.pod:732
18701 "Any line which starts with a I<#> character is treated as a comment and "
18702 "ignored. The I<#> can optionally be preceeded by whitespace, but B<not> by "
18703 "a command. For example:"
18707 #: ../fish/guestfish.pod:736
18710 " # this is a comment\n"
18711 " # this is a comment\n"
18712 " foo # NOT a comment\n"
18717 #: ../fish/guestfish.pod:740
18718 msgid "Blank lines are also ignored."
18722 #: ../fish/guestfish.pod:742
18723 msgid "RUNNING COMMANDS LOCALLY"
18727 #: ../fish/guestfish.pod:744
18729 "Any line which starts with a I<!> character is treated as a command sent to "
18730 "the local shell (C</bin/sh> or whatever L<system(3)> uses). For example:"
18734 #: ../fish/guestfish.pod:748
18738 " tgz-out /remote local/remote-data.tar.gz\n"
18743 #: ../fish/guestfish.pod:751
18745 "will create a directory C<local> on the host, and then export the contents "
18746 "of C</remote> on the mounted filesystem to C<local/remote-data.tar.gz>. "
18747 "(See C<tgz-out>)."
18751 #: ../fish/guestfish.pod:755
18753 "To change the local directory, use the C<lcd> command. C<!cd> will have no "
18754 "effect, due to the way that subprocesses work in Unix."
18758 #: ../fish/guestfish.pod:758
18759 msgid "LOCAL COMMANDS WITH INLINE EXECUTION"
18763 #: ../fish/guestfish.pod:760
18765 "If a line starts with I<E<lt>!> then the shell command is executed (as for "
18766 "I<!>), but subsequently any output (stdout) of the shell command is parsed "
18767 "and executed as guestfish commands."
18771 #: ../fish/guestfish.pod:764
18773 "Thus you can use shell script to construct arbitrary guestfish commands "
18774 "which are then parsed by guestfish."
18778 #: ../fish/guestfish.pod:767
18780 "For example it is tedious to create a sequence of files (eg. C</foo.1> "
18781 "through C</foo.100>) using guestfish commands alone. However this is simple "
18782 "if we use a shell script to create the guestfish commands for us:"
18786 #: ../fish/guestfish.pod:772
18789 " <! for n in `seq 1 100`; do echo write /foo.$n $n; done\n"
18794 #: ../fish/guestfish.pod:774
18795 msgid "or with names like C</foo.001>:"
18799 #: ../fish/guestfish.pod:776
18802 " <! for n in `seq 1 100`; do printf \"write /foo.%03d %d\\n\" $n $n; done\n"
18807 #: ../fish/guestfish.pod:778
18809 "When using guestfish interactively it can be helpful to just run the shell "
18810 "script first (ie. remove the initial C<E<lt>> character so it is just an "
18811 "ordinary I<!> local command), see what guestfish commands it would run, and "
18812 "when you are happy with those prepend the C<E<lt>> character to run the "
18813 "guestfish commands for real."
18817 #: ../fish/guestfish.pod:784
18822 #: ../fish/guestfish.pod:786
18824 "Use C<command E<lt>spaceE<gt> | command> to pipe the output of the first "
18825 "command (a guestfish command) to the second command (any host command). For "
18830 #: ../fish/guestfish.pod:790
18833 " cat /etc/passwd | awk -F: '$3 == 0 { print }'\n"
18838 #: ../fish/guestfish.pod:792
18840 "(where C<cat> is the guestfish cat command, but C<awk> is the host awk "
18841 "program). The above command would list all accounts in the guest filesystem "
18842 "which have UID 0, ie. root accounts including backdoors. Other examples:"
18846 #: ../fish/guestfish.pod:797
18849 " hexdump /bin/ls | head\n"
18850 " list-devices | tail -1\n"
18851 " tgz-out / - | tar ztf -\n"
18856 #: ../fish/guestfish.pod:801
18858 "The space before the pipe symbol is required, any space after the pipe "
18859 "symbol is optional. Everything after the pipe symbol is just passed "
18860 "straight to the host shell, so it can contain redirections, globs and "
18861 "anything else that makes sense on the host side."
18865 #: ../fish/guestfish.pod:806
18867 "To use a literal argument which begins with a pipe symbol, you have to quote "
18872 #: ../fish/guestfish.pod:809
18880 #: ../fish/guestfish.pod:811
18881 msgid "HOME DIRECTORIES"
18885 #: ../fish/guestfish.pod:813
18887 "If a parameter starts with the character C<~> then the tilde may be expanded "
18888 "as a home directory path (either C<~> for the current user's home directory, "
18889 "or C<~user> for another user)."
18893 #: ../fish/guestfish.pod:817
18895 "Note that home directory expansion happens for users known I<on the host>, "
18896 "not in the guest filesystem."
18900 #: ../fish/guestfish.pod:820
18902 "To use a literal argument which begins with a tilde, you have to quote it, "
18907 #: ../fish/guestfish.pod:823
18915 #: ../fish/guestfish.pod:825 ../src/guestfs.pod:519
18916 msgid "ENCRYPTED DISKS"
18920 #: ../fish/guestfish.pod:827
18922 "Libguestfs has some support for Linux guests encrypted according to the "
18923 "Linux Unified Key Setup (LUKS) standard, which includes nearly all whole "
18924 "disk encryption systems used by modern Linux guests. Currently only "
18925 "LVM-on-LUKS is supported."
18929 #: ../fish/guestfish.pod:832
18930 msgid "Identify encrypted block devices and partitions using L</vfs-type>:"
18934 #: ../fish/guestfish.pod:834
18937 " ><fs> vfs-type /dev/sda2\n"
18943 #: ../fish/guestfish.pod:837
18945 "Then open those devices using L</luks-open>. This creates a device-mapper "
18946 "device called C</dev/mapper/luksdev>."
18950 #: ../fish/guestfish.pod:840
18953 " ><fs> luks-open /dev/sda2 luksdev\n"
18954 " Enter key or passphrase (\"key\"): <enter the passphrase>\n"
18959 #: ../fish/guestfish.pod:843
18961 "Finally you have to tell LVM to scan for volume groups on the newly created "
18966 #: ../fish/guestfish.pod:846
18970 " vg-activate-all true\n"
18975 #: ../fish/guestfish.pod:849
18976 msgid "The logical volume(s) can now be mounted in the usual way."
18980 #: ../fish/guestfish.pod:851
18982 "Before closing a LUKS device you must unmount any logical volumes on it and "
18983 "deactivate the volume groups by calling C<vg-activate false VG> on each "
18984 "one. Then you can close the mapper device:"
18988 #: ../fish/guestfish.pod:855
18991 " vg-activate false /dev/VG\n"
18992 " luks-close /dev/mapper/luksdev\n"
18997 #: ../fish/guestfish.pod:860
18999 "If a path is prefixed with C<win:> then you can use Windows-style drive "
19000 "letters and paths (with some limitations). The following commands are "
19005 #: ../fish/guestfish.pod:864
19008 " file /WINDOWS/system32/config/system.LOG\n"
19013 #: ../fish/guestfish.pod:866
19016 " file win:\\windows\\system32\\config\\system.log\n"
19021 #: ../fish/guestfish.pod:868
19024 " file WIN:C:\\Windows\\SYSTEM32\\CONFIG\\SYSTEM.LOG\n"
19029 #: ../fish/guestfish.pod:870
19031 "The parameter is rewritten \"behind the scenes\" by looking up the position "
19032 "where the drive is mounted, prepending that to the path, changing all "
19033 "backslash characters to forward slash, then resolving the result using "
19034 "L</case-sensitive-path>. For example if the E: drive was mounted on C</e> "
19035 "then the parameter might be rewritten like this:"
19039 #: ../fish/guestfish.pod:876
19042 " win:e:\\foo\\bar => /e/FOO/bar\n"
19047 #: ../fish/guestfish.pod:878
19048 msgid "This only works in argument positions that expect a path."
19052 #: ../fish/guestfish.pod:880
19053 msgid "UPLOADING AND DOWNLOADING FILES"
19057 #: ../fish/guestfish.pod:882
19059 "For commands such as C<upload>, C<download>, C<tar-in>, C<tar-out> and "
19060 "others which upload from or download to a local file, you can use the "
19061 "special filename C<-> to mean \"from stdin\" or \"to stdout\". For example:"
19065 #: ../fish/guestfish.pod:886
19073 #: ../fish/guestfish.pod:888
19074 msgid "reads stdin and creates from that a file C</foo> in the disk image, and:"
19078 #: ../fish/guestfish.pod:891
19081 " tar-out /etc - | tar tf -\n"
19086 #: ../fish/guestfish.pod:893
19088 "writes the tarball to stdout and then pipes that into the external \"tar\" "
19089 "command (see L</PIPES>)."
19093 #: ../fish/guestfish.pod:896
19095 "When using C<-> to read from stdin, the input is read up to the end of "
19096 "stdin. You can also use a special \"heredoc\"-like syntax to read up to "
19097 "some arbitrary end marker:"
19101 #: ../fish/guestfish.pod:900
19104 " upload -<<END /foo\n"
19113 #: ../fish/guestfish.pod:906
19115 "Any string of characters can be used instead of C<END>. The end marker must "
19116 "appear on a line of its own, without any preceeding or following characters "
19117 "(not even spaces)."
19121 #: ../fish/guestfish.pod:910
19123 "Note that the C<-E<lt>E<lt>> syntax only applies to parameters used to "
19124 "upload local files (so-called \"FileIn\" parameters in the generator)."
19128 #: ../fish/guestfish.pod:913
19129 msgid "EXIT ON ERROR BEHAVIOUR"
19133 #: ../fish/guestfish.pod:915
19135 "By default, guestfish will ignore any errors when in interactive mode "
19136 "(ie. taking commands from a human over a tty), and will exit on the first "
19137 "error in non-interactive mode (scripts, commands given on the command line)."
19141 #: ../fish/guestfish.pod:920
19143 "If you prefix a command with a I<-> character, then that command will not "
19144 "cause guestfish to exit, even if that (one) command returns an error."
19148 #: ../fish/guestfish.pod:924
19149 msgid "REMOTE CONTROL GUESTFISH OVER A SOCKET"
19153 #: ../fish/guestfish.pod:926
19155 "Guestfish can be remote-controlled over a socket. This is useful "
19156 "particularly in shell scripts where you want to make several different "
19157 "changes to a filesystem, but you don't want the overhead of starting up a "
19158 "guestfish process each time."
19162 #: ../fish/guestfish.pod:931
19163 msgid "Start a guestfish server process using:"
19167 #: ../fish/guestfish.pod:933
19170 " eval \"`guestfish --listen`\"\n"
19175 #: ../fish/guestfish.pod:935
19176 msgid "and then send it commands by doing:"
19180 #: ../fish/guestfish.pod:937
19183 " guestfish --remote cmd [...]\n"
19188 #: ../fish/guestfish.pod:939
19189 msgid "To cause the server to exit, send it the exit command:"
19193 #: ../fish/guestfish.pod:943
19195 "Note that the server will normally exit if there is an error in a command. "
19196 "You can change this in the usual way. See section L</EXIT ON ERROR "
19201 #: ../fish/guestfish.pod:947
19202 msgid "CONTROLLING MULTIPLE GUESTFISH PROCESSES"
19206 #: ../fish/guestfish.pod:949
19208 "The C<eval> statement sets the environment variable C<$GUESTFISH_PID>, which "
19209 "is how the I<--remote> option knows where to send the commands. You can "
19210 "have several guestfish listener processes running using:"
19214 #: ../fish/guestfish.pod:953
19217 " eval \"`guestfish --listen`\"\n"
19218 " pid1=$GUESTFISH_PID\n"
19219 " eval \"`guestfish --listen`\"\n"
19220 " pid2=$GUESTFISH_PID\n"
19222 " guestfish --remote=$pid1 cmd\n"
19223 " guestfish --remote=$pid2 cmd\n"
19228 #: ../fish/guestfish.pod:961
19229 msgid "REMOTE CONTROL AND CSH"
19233 #: ../fish/guestfish.pod:963
19235 "When using csh-like shells (csh, tcsh etc) you have to add the I<--csh> "
19240 #: ../fish/guestfish.pod:966
19243 " eval \"`guestfish --listen --csh`\"\n"
19248 #: ../fish/guestfish.pod:968
19249 msgid "REMOTE CONTROL DETAILS"
19253 #: ../fish/guestfish.pod:970
19255 "Remote control happens over a Unix domain socket called "
19256 "C</tmp/.guestfish-$UID/socket-$PID>, where C<$UID> is the effective user ID "
19257 "of the process, and C<$PID> is the process ID of the server."
19261 #: ../fish/guestfish.pod:974
19262 msgid "Guestfish client and server versions must match exactly."
19266 #: ../fish/guestfish.pod:976
19267 msgid "USING REMOTE CONTROL ROBUSTLY FROM SHELL SCRIPTS"
19271 #: ../fish/guestfish.pod:978
19273 "From Bash, you can use the following code which creates a guestfish "
19274 "instance, correctly quotes the command line, handles failure to start, and "
19275 "cleans up guestfish when the script exits:"
19279 #: ../fish/guestfish.pod:982 ../src/guestfs.pod:965
19287 #: ../fish/guestfish.pod:986
19290 " guestfish[0]=\"guestfish\"\n"
19291 " guestfish[1]=\"--listen\"\n"
19292 " guestfish[2]=\"--ro\"\n"
19293 " guestfish[3]=\"-a\"\n"
19294 " guestfish[4]=\"disk.img\"\n"
19299 #: ../fish/guestfish.pod:992
19302 " GUESTFISH_PID=\n"
19303 " eval $(\"${guestfish[@]}\")\n"
19304 " if [ -z \"$GUESTFISH_PID\" ]; then\n"
19305 " echo \"error: guestfish didn't start up, see error messages above\"\n"
19312 #: ../fish/guestfish.pod:999
19315 " cleanup_guestfish ()\n"
19317 " guestfish --remote -- exit >/dev/null 2>&1 ||:\n"
19319 " trap cleanup_guestfish EXIT ERR\n"
19324 #: ../fish/guestfish.pod:1005
19327 " guestfish --remote -- run\n"
19332 #: ../fish/guestfish.pod:1007
19340 #: ../fish/guestfish.pod:1009
19341 msgid "REMOTE CONTROL RUN COMMAND HANGING"
19345 #: ../fish/guestfish.pod:1011
19347 "Using the C<run> (or C<launch>) command remotely in a command substitution "
19348 "context hangs, ie. don't do (note the backquotes):"
19352 #: ../fish/guestfish.pod:1014
19355 " a=`guestfish --remote run`\n"
19360 #: ../fish/guestfish.pod:1016
19362 "Since the C<run> command produces no output on stdout, this is not useful "
19363 "anyway. For further information see "
19364 "L<https://bugzilla.redhat.com/show_bug.cgi?id=592910>."
19368 #: ../fish/guestfish.pod:1020
19369 msgid "PREPARED DISK IMAGES"
19373 #: ../fish/guestfish.pod:1022
19375 "Use the I<-N type> or I<--new type> parameter to select one of a set of "
19376 "preformatted disk images that guestfish can make for you to save typing. "
19377 "This is particularly useful for testing purposes. This option is used "
19378 "instead of the I<-a> option, and like I<-a> can appear multiple times (and "
19379 "can be mixed with I<-a>)."
19383 #: ../fish/guestfish.pod:1028
19385 "The new disk is called C<test1.img> for the first I<-N>, C<test2.img> for "
19386 "the second and so on. Existing files in the current directory are "
19391 #: ../fish/guestfish.pod:1032
19393 "The type briefly describes how the disk should be sized, partitioned, how "
19394 "filesystem(s) should be created, and how content should be added. "
19395 "Optionally the type can be followed by extra parameters, separated by C<:> "
19396 "(colon) characters. For example, I<-N fs> creates a default 100MB, "
19397 "sparsely-allocated disk, containing a single partition, with the partition "
19398 "formatted as ext2. I<-N fs:ext4:1G> is the same, but for an ext4 filesystem "
19399 "on a 1GB disk instead."
19403 #: ../fish/guestfish.pod:1040
19404 msgid "To list the available types and any extra parameters they take, run:"
19408 #: ../fish/guestfish.pod:1044
19410 "Note that the prepared filesystem is not mounted. You would usually have to "
19411 "use the C<mount /dev/sda1 /> command or add the I<-m /dev/sda1> option."
19415 #: ../fish/guestfish.pod:1048
19417 "If any I<-N> or I<--new> options are given, the guest is automatically "
19422 #: ../fish/guestfish.pod:1053
19423 msgid "Create a 100MB disk with an ext4-formatted partition:"
19427 #: ../fish/guestfish.pod:1055
19430 " guestfish -N fs:ext4\n"
19435 #: ../fish/guestfish.pod:1057
19436 msgid "Create a 32MB disk with a VFAT-formatted partition, and mount it:"
19440 #: ../fish/guestfish.pod:1059
19443 " guestfish -N fs:vfat:32M -m /dev/sda1\n"
19448 #: ../fish/guestfish.pod:1061
19449 msgid "Create a blank 200MB disk:"
19453 #: ../fish/guestfish.pod:1063
19456 " guestfish -N disk:200M\n"
19461 #: ../fish/guestfish.pod:1065
19462 msgid "PROGRESS BARS"
19466 #: ../fish/guestfish.pod:1067
19468 "Some (not all) long-running commands send progress notification messages as "
19469 "they are running. Guestfish turns these messages into progress bars."
19473 #: ../fish/guestfish.pod:1071
19475 "When a command that supports progress bars takes longer than two seconds to "
19476 "run, and if progress bars are enabled, then you will see one appearing below "
19481 #: ../fish/guestfish.pod:1075
19484 " ><fs> copy-size /large-file /another-file 2048M\n"
19485 " / 10% [#####-----------------------------------------] 00:30\n"
19490 #: ../fish/guestfish.pod:1078
19492 "The spinner on the left hand side moves round once for every progress "
19493 "notification received from the backend. This is a (reasonably) golden "
19494 "assurance that the command is \"doing something\" even if the progress bar "
19495 "is not moving, because the command is able to send the progress "
19496 "notifications. When the bar reaches 100% and the command finishes, the "
19497 "spinner disappears."
19501 #: ../fish/guestfish.pod:1085
19503 "Progress bars are enabled by default when guestfish is used interactively. "
19504 "You can enable them even for non-interactive modes using I<--progress-bars>, "
19505 "and you can disable them completely using I<--no-progress-bars>."
19509 #: ../fish/guestfish.pod:1090
19510 msgid "GUESTFISH COMMANDS"
19514 #: ../fish/guestfish.pod:1092
19516 "The commands in this section are guestfish convenience commands, in other "
19517 "words, they are not part of the L<guestfs(3)> API."
19521 #: ../fish/guestfish.pod:1095
19526 #: ../fish/guestfish.pod:1097
19535 #: ../fish/guestfish.pod:1100
19536 msgid "Without any parameter, this provides general help."
19540 #: ../fish/guestfish.pod:1102
19541 msgid "With a C<cmd> parameter, this displays detailed help for that command."
19545 #: ../fish/guestfish.pod:1104
19546 msgid "quit | exit"
19550 #: ../fish/guestfish.pod:1106
19551 msgid "This exits guestfish. You can also use C<^D> key."
19555 #: ../fish/guestfish.pod:1108
19556 msgid "@FISH_COMMANDS@"
19560 #: ../fish/guestfish.pod:1110
19565 #: ../fish/guestfish.pod:1112 ../src/guestfs.pod:1505
19570 #: ../fish/guestfish.pod:1116
19572 "guestfish returns 0 if the commands completed without error, or 1 if there "
19577 #: ../fish/guestfish.pod:1123
19582 #: ../fish/guestfish.pod:1125
19584 "The C<edit> command uses C<$EDITOR> as the editor. If not set, it uses "
19589 #: ../fish/guestfish.pod:1128 ../src/guestfs.pod:3198
19590 msgid "FEBOOTSTRAP_KERNEL"
19594 #: ../fish/guestfish.pod:1130 ../src/guestfs.pod:3200
19595 msgid "FEBOOTSTRAP_MODULES"
19599 #: ../fish/guestfish.pod:1132 ../src/guestfs.pod:3202
19601 "These two environment variables allow the kernel that libguestfs uses in the "
19602 "appliance to be selected. If C<$FEBOOTSTRAP_KERNEL> is not set, then the "
19603 "most recent host kernel is chosen. For more information about kernel "
19604 "selection, see L<febootstrap-supermin-helper(8)>. This feature is only "
19605 "available in febootstrap E<ge> 3.8."
19609 #: ../fish/guestfish.pod:1138
19610 msgid "GUESTFISH_DISPLAY_IMAGE"
19614 #: ../fish/guestfish.pod:1140
19616 "The C<display> command uses C<$GUESTFISH_DISPLAY_IMAGE> to display images. "
19617 "If not set, it uses L<display(1)>."
19621 #: ../fish/guestfish.pod:1143
19622 msgid "GUESTFISH_PID"
19626 #: ../fish/guestfish.pod:1145
19628 "Used with the I<--remote> option to specify the remote guestfish process to "
19629 "control. See section L</REMOTE CONTROL GUESTFISH OVER A SOCKET>."
19633 #: ../fish/guestfish.pod:1149
19638 #: ../fish/guestfish.pod:1151
19640 "The L</hexedit> command uses C<$HEXEDITOR> as the external hex editor. If "
19641 "not specified, the external L<hexedit(1)> program is used."
19645 #: ../fish/guestfish.pod:1155
19650 #: ../fish/guestfish.pod:1157
19652 "If compiled with GNU readline support, various files in the home directory "
19653 "can be used. See L</FILES>."
19657 #: ../fish/guestfish.pod:1160 ../src/guestfs.pod:3208
19658 msgid "LIBGUESTFS_APPEND"
19662 #: ../fish/guestfish.pod:1162 ../src/guestfs.pod:3210
19663 msgid "Pass additional options to the guest kernel."
19667 #: ../fish/guestfish.pod:1164 ../src/guestfs.pod:3212
19668 msgid "LIBGUESTFS_DEBUG"
19672 #: ../fish/guestfish.pod:1166
19674 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
19675 "effect as using the B<-v> option."
19679 #: ../fish/guestfish.pod:1169 ../src/guestfs.pod:3217
19680 msgid "LIBGUESTFS_MEMSIZE"
19684 #: ../fish/guestfish.pod:1171 ../src/guestfs.pod:3219
19685 msgid "Set the memory allocated to the qemu process, in megabytes. For example:"
19689 #: ../fish/guestfish.pod:1174 ../src/guestfs.pod:3222
19692 " LIBGUESTFS_MEMSIZE=700\n"
19697 #: ../fish/guestfish.pod:1176 ../src/guestfs.pod:3224
19698 msgid "LIBGUESTFS_PATH"
19702 #: ../fish/guestfish.pod:1178
19704 "Set the path that guestfish uses to search for kernel and initrd.img. See "
19705 "the discussion of paths in L<guestfs(3)>."
19709 #: ../fish/guestfish.pod:1181 ../src/guestfs.pod:3229
19710 msgid "LIBGUESTFS_QEMU"
19714 #: ../fish/guestfish.pod:1183 ../src/guestfs.pod:3231
19716 "Set the default qemu binary that libguestfs uses. If not set, then the qemu "
19717 "which was found at compile time by the configure script is used."
19721 #: ../fish/guestfish.pod:1187 ../src/guestfs.pod:3237
19722 msgid "LIBGUESTFS_TRACE"
19726 #: ../fish/guestfish.pod:1189
19727 msgid "Set C<LIBGUESTFS_TRACE=1> to enable command traces."
19731 #: ../fish/guestfish.pod:1191
19736 #: ../fish/guestfish.pod:1193
19738 "The C<more> command uses C<$PAGER> as the pager. If not set, it uses "
19743 #: ../fish/guestfish.pod:1196 ../sparsify/virt-sparsify.pod:236 ../src/guestfs.pod:3242
19748 #: ../fish/guestfish.pod:1198 ../src/guestfs.pod:3244
19750 "Location of temporary directory, defaults to C</tmp> except for the cached "
19751 "supermin appliance which defaults to C</var/tmp>."
19755 #: ../fish/guestfish.pod:1201 ../src/guestfs.pod:3247
19757 "If libguestfs was compiled to use the supermin appliance then the real "
19758 "appliance is cached in this directory, shared between all handles belonging "
19759 "to the same EUID. You can use C<$TMPDIR> to configure another directory to "
19760 "use in case C</var/tmp> is not large enough."
19764 #: ../fish/guestfish.pod:1209 ../fuse/guestmount.pod:297 ../rescue/virt-rescue.pod:273
19769 #: ../fish/guestfish.pod:1213 ../fuse/guestmount.pod:301 ../rescue/virt-rescue.pod:277
19770 msgid "$HOME/.libguestfs-tools.rc"
19774 #: ../fish/guestfish.pod:1215 ../fuse/guestmount.pod:303 ../rescue/virt-rescue.pod:279
19775 msgid "/etc/libguestfs-tools.conf"
19779 #: ../fish/guestfish.pod:1217 ../fuse/guestmount.pod:305 ../rescue/virt-rescue.pod:281
19781 "This configuration file controls the default read-only or read-write mode "
19782 "(I<--ro> or I<--rw>)."
19786 #: ../fish/guestfish.pod:1220
19787 msgid "See L</OPENING DISKS FOR READ AND WRITE>."
19791 #: ../fish/guestfish.pod:1222
19792 msgid "$HOME/.guestfish"
19796 #: ../fish/guestfish.pod:1224
19798 "If compiled with GNU readline support, then the command history is saved in "
19803 #: ../fish/guestfish.pod:1227
19804 msgid "$HOME/.inputrc"
19808 #: ../fish/guestfish.pod:1229
19809 msgid "/etc/inputrc"
19813 #: ../fish/guestfish.pod:1231
19815 "If compiled with GNU readline support, then these files can be used to "
19816 "configure readline. For further information, please see "
19817 "L<readline(3)/INITIALIZATION FILE>."
19821 #: ../fish/guestfish.pod:1235
19822 msgid "To write rules which only apply to guestfish, use:"
19826 #: ../fish/guestfish.pod:1237
19836 #: ../fish/guestfish.pod:1241
19838 "Variables that you can set in inputrc that change the behaviour of guestfish "
19839 "in useful ways include:"
19843 #: ../fish/guestfish.pod:1246
19844 msgid "completion-ignore-case (default: on)"
19848 #: ../fish/guestfish.pod:1248
19850 "By default, guestfish will ignore case when tab-completing paths on the "
19855 #: ../fish/guestfish.pod:1251
19858 " set completion-ignore-case off\n"
19863 #: ../fish/guestfish.pod:1253
19864 msgid "to make guestfish case sensitive."
19868 #: ../fish/guestfish.pod:1257
19873 #: ../fish/guestfish.pod:1259
19874 msgid "test2.img (etc)"
19878 #: ../fish/guestfish.pod:1261
19880 "When using the I<-N> or I<--new> option, the prepared disk or filesystem "
19881 "will be created in the file C<test1.img> in the current directory. The "
19882 "second use of I<-N> will use C<test2.img> and so on. Any existing file with "
19883 "the same name will be overwritten."
19887 #: ../fish/guestfish.pod:1270
19889 "L<guestfs(3)>, L<http://libguestfs.org/>, L<virt-alignment-scan(1)>, "
19890 "L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-df(1)>, "
19891 "L<virt-edit(1)>, L<virt-filesystems(1)>, L<virt-inspector(1)>, "
19892 "L<virt-list-filesystems(1)>, L<virt-list-partitions(1)>, L<virt-ls(1)>, "
19893 "L<virt-make-fs(1)>, L<virt-rescue(1)>, L<virt-resize(1)>, "
19894 "L<virt-sparsify(1)>, L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, "
19895 "L<virt-tar-out(1)>, L<virt-win-reg(1)>, L<display(1)>, L<hexedit(1)>, "
19896 "L<febootstrap-supermin-helper(8)>."
19900 #: ../fish/guestfish.pod:1302 ../src/guestfs.pod:3339 ../test-tool/libguestfs-test-tool.pod:112
19901 msgid "Copyright (C) 2009-2011 Red Hat Inc. L<http://libguestfs.org/>"
19905 #: ../fish/virt-copy-in.pod:5
19906 msgid "virt-copy-in - Copy files and directories into a virtual machine disk image."
19910 #: ../fish/virt-copy-in.pod:9
19913 " virt-copy-in -a disk.img file|dir [file|dir ...] /destination\n"
19918 #: ../fish/virt-copy-in.pod:11
19921 " virt-copy-in -d domain file|dir [file|dir ...] /destination\n"
19926 #: ../fish/virt-copy-in.pod:15
19928 "Using C<virt-copy-in> on live virtual machines can be dangerous, potentially "
19929 "causing disk corruption. The virtual machine must be shut down before you "
19930 "use this command."
19934 #: ../fish/virt-copy-in.pod:21
19936 "C<virt-copy-in> copies files and directories from the local disk into a "
19937 "virtual machine disk image or named libvirt domain."
19941 #: ../fish/virt-copy-in.pod:24
19943 "You can give one of more filenames and directories on the command line. "
19944 "Directories are copied in recursively. The final parameter must be the "
19945 "destination directory in the disk image which must be an absolute path "
19946 "starting with a C</> character."
19950 #: ../fish/virt-copy-in.pod:33
19953 " virt-copy-in -d MyGuest resolv.conf /etc\n"
19958 #: ../fish/virt-copy-in.pod:35 ../fish/virt-tar-in.pod:32
19959 msgid "Upload a home directory to a guest:"
19963 #: ../fish/virt-copy-in.pod:37
19966 " virt-copy-in -d MyGuest skel /home\n"
19971 #: ../fish/virt-copy-in.pod:39 ../fish/virt-copy-out.pod:28 ../fish/virt-tar-in.pod:36 ../fish/virt-tar-out.pod:30
19972 msgid "JUST A SHELL SCRIPT WRAPPER AROUND GUESTFISH"
19976 #: ../fish/virt-copy-in.pod:41
19978 "This command is just a simple shell script wrapper around the "
19979 "L<guestfish(1)> C<copy-in> command. For anything more complex than a "
19980 "trivial copy, you are probably better off using guestfish directly."
19984 #: ../fish/virt-copy-in.pod:47 ../fish/virt-copy-out.pod:36 ../fish/virt-tar-in.pod:44 ../fish/virt-tar-out.pod:38
19986 "Since the shell script just passes options straight to guestfish, read "
19987 "L<guestfish(1)> to see the full list of options."
19991 #: ../fish/virt-copy-in.pod:52
19993 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-out(1)>, L<virt-edit(1)>, "
19994 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
19998 #: ../fish/virt-copy-in.pod:66 ../fish/virt-copy-out.pod:55 ../fish/virt-tar-in.pod:64 ../fish/virt-tar-out.pod:57
19999 msgid "Copyright (C) 2011 Red Hat Inc. L<http://libguestfs.org/>"
20003 #: ../fish/virt-copy-out.pod:5
20005 "virt-copy-out - Copy files and directories out of a virtual machine disk "
20010 #: ../fish/virt-copy-out.pod:9
20013 " virt-copy-out -a disk.img /file|dir [/file|dir ...] localdir\n"
20018 #: ../fish/virt-copy-out.pod:11
20021 " virt-copy-out -d domain /file|dir [/file|dir ...] localdir\n"
20026 #: ../fish/virt-copy-out.pod:15
20028 "C<virt-copy-out> copies files and directories out of a virtual machine disk "
20029 "image or named libvirt domain."
20033 #: ../fish/virt-copy-out.pod:18
20035 "You can give one of more filenames and directories on the command line. "
20036 "Directories are copied out recursively."
20040 #: ../fish/virt-copy-out.pod:23
20041 msgid "Download the home directories from a virtual machine:"
20045 #: ../fish/virt-copy-out.pod:25
20049 " virt-copy-out -d MyGuest /home homes\n"
20054 #: ../fish/virt-copy-out.pod:30
20056 "This command is just a simple shell script wrapper around the "
20057 "L<guestfish(1)> C<copy-out> command. For anything more complex than a "
20058 "trivial copy, you are probably better off using guestfish directly."
20062 #: ../fish/virt-copy-out.pod:41
20064 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-edit(1)>, "
20065 "L<virt-tar-in(1)>, L<virt-tar-out(1)>, L<http://libguestfs.org/>."
20069 #: ../fish/virt-tar-in.pod:5
20070 msgid "virt-tar-in - Unpack a tarball into a virtual machine disk image."
20074 #: ../fish/virt-tar-in.pod:9
20077 " virt-tar-in -a disk.img data.tar /destination\n"
20082 #: ../fish/virt-tar-in.pod:11
20085 " virt-tar-in -d domain data.tar /destination\n"
20090 #: ../fish/virt-tar-in.pod:13
20093 " zcat data.tar.gz | virt-tar-in -d domain - /destination\n"
20098 #: ../fish/virt-tar-in.pod:17
20100 "Using C<virt-tar-in> on live virtual machines can be dangerous, potentially "
20101 "causing disk corruption. The virtual machine must be shut down before you "
20102 "use this command."
20106 #: ../fish/virt-tar-in.pod:23
20108 "C<virt-tar-in> unpacks an uncompressed tarball into a virtual machine disk "
20109 "image or named libvirt domain."
20113 #: ../fish/virt-tar-in.pod:26
20115 "The first parameter is the tar file. Use C<-> to read the tar file from "
20116 "standard input. The second parameter is the absolute target directory to "
20121 #: ../fish/virt-tar-in.pod:34
20124 " virt-tar-in -d MyGuest homes.tar /home\n"
20129 #: ../fish/virt-tar-in.pod:38
20131 "This command is just a simple shell script wrapper around the "
20132 "L<guestfish(1)> C<tar-in> command. For anything more complex than a trivial "
20133 "copy, you are probably better off using guestfish directly."
20137 #: ../fish/virt-tar-in.pod:49
20139 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20140 "L<virt-edit(1)>, L<virt-make-fs(1)>, L<virt-tar-out(1)>, "
20141 "L<http://libguestfs.org/>."
20145 #: ../fish/virt-tar-out.pod:5
20146 msgid "virt-tar-out - Pack a virtual machine disk image directory into a tarball."
20150 #: ../fish/virt-tar-out.pod:9
20153 " virt-tar-out -a disk.img /dir files.tar\n"
20158 #: ../fish/virt-tar-out.pod:11
20161 " virt-tar-out -d domain /dir files.tar\n"
20166 #: ../fish/virt-tar-out.pod:13
20169 " virt-tar-out -d domain /dir - | gzip --best > files.tar.gz\n"
20174 #: ../fish/virt-tar-out.pod:17
20175 msgid "C<virt-tar-out> packs a virtual machine disk image directory into a tarball."
20179 #: ../fish/virt-tar-out.pod:20
20181 "The first parameter is the absolute path of the virtual machine directory. "
20182 "The second parameter is the tar file to write. Use C<-> to write to "
20187 #: ../fish/virt-tar-out.pod:26
20188 msgid "Download the home directories from a guest:"
20192 #: ../fish/virt-tar-out.pod:28
20195 " virt-tar-out -d MyGuest /home - | gzip --best > homes.tar.gz\n"
20200 #: ../fish/virt-tar-out.pod:32
20202 "This command is just a simple shell script wrapper around the "
20203 "L<guestfish(1)> C<tar-out> command. For anything more complex than a "
20204 "trivial copy, you are probably better off using guestfish directly."
20208 #: ../fish/virt-tar-out.pod:43
20210 "L<guestfish(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
20211 "L<virt-edit(1)>, L<virt-tar-in(1)>, L<http://libguestfs.org/>."
20215 #: ../fuse/guestmount.pod:5
20216 msgid "guestmount - Mount a guest filesystem on the host using FUSE and libguestfs"
20220 #: ../fuse/guestmount.pod:9
20223 " guestmount [--options] -a disk.img -m device [--ro] mountpoint\n"
20228 #: ../fuse/guestmount.pod:11
20231 " guestmount [--options] -a disk.img -i [--ro] mountpoint\n"
20236 #: ../fuse/guestmount.pod:13
20239 " guestmount [--options] -d Guest -i [--ro] mountpoint\n"
20244 #: ../fuse/guestmount.pod:17
20246 "You must I<not> use C<guestmount> in read-write mode on live virtual "
20247 "machines. If you do this, you risk disk corruption in the VM."
20251 #: ../fuse/guestmount.pod:22
20253 "The guestmount program can be used to mount virtual machine filesystems and "
20254 "other disk images on the host. It uses libguestfs for access to the guest "
20255 "filesystem, and FUSE (the \"filesystem in userspace\") to make it appear as "
20256 "a mountable device."
20260 #: ../fuse/guestmount.pod:27
20262 "Along with other options, you have to give at least one device (I<-a> "
20263 "option) or libvirt domain (I<-d> option), and at least one mountpoint (I<-m> "
20264 "option) or use the I<-i> inspection option. How this works is better "
20265 "explained in the L<guestfish(1)> manual page, or by looking at the examples "
20270 #: ../fuse/guestmount.pod:33
20272 "FUSE lets you mount filesystems as non-root. The mountpoint must be owned "
20273 "by you, and the filesystem will not be visible to any other users unless you "
20274 "make certain global configuration changes to C</etc/fuse.conf>. To unmount "
20275 "the filesystem, use the C<fusermount -u> command."
20279 #: ../fuse/guestmount.pod:41
20281 "For a typical Windows guest which has its main filesystem on the first "
20286 #: ../fuse/guestmount.pod:44
20289 " guestmount -a windows.img -m /dev/sda1 --ro /mnt\n"
20294 #: ../fuse/guestmount.pod:46
20296 "For a typical Linux guest which has a /boot filesystem on the first "
20297 "partition, and the root filesystem on a logical volume:"
20301 #: ../fuse/guestmount.pod:49
20304 " guestmount -a linux.img -m /dev/VG/LV -m /dev/sda1:/boot --ro /mnt\n"
20309 #: ../fuse/guestmount.pod:51
20310 msgid "To get libguestfs to detect guest mountpoints for you:"
20314 #: ../fuse/guestmount.pod:53
20317 " guestmount -a guest.img -i --ro /mnt\n"
20322 #: ../fuse/guestmount.pod:55
20323 msgid "For a libvirt guest called \"Guest\" you could do:"
20327 #: ../fuse/guestmount.pod:57
20330 " guestmount -d Guest -i --ro /mnt\n"
20335 #: ../fuse/guestmount.pod:59
20337 "If you don't know what filesystems are contained in a guest or disk image, "
20338 "use L<virt-filesystems(1)> first:"
20342 #: ../fuse/guestmount.pod:62
20345 " virt-filesystems MyGuest\n"
20350 #: ../fuse/guestmount.pod:64
20352 "If you want to trace the libguestfs calls but without excessive debugging "
20353 "information, we recommend:"
20357 #: ../fuse/guestmount.pod:67
20360 " guestmount [...] --trace /mnt\n"
20365 #: ../fuse/guestmount.pod:69
20366 msgid "If you want to debug the program, we recommend:"
20370 #: ../fuse/guestmount.pod:71
20373 " guestmount [...] --trace --verbose /mnt\n"
20378 #: ../fuse/guestmount.pod:73 ../rescue/virt-rescue.pod:68 ../resize/virt-resize.pod:600
20383 #: ../fuse/guestmount.pod:75
20384 msgid "Other users cannot see the filesystem by default"
20388 #: ../fuse/guestmount.pod:77
20390 "If you mount a filesystem as one user (eg. root), then other users will not "
20391 "be able to see it by default. The fix is to add the FUSE C<allow_other> "
20392 "option when mounting:"
20396 #: ../fuse/guestmount.pod:81
20399 " sudo guestmount [...] -o allow_other /mnt\n"
20404 #: ../fuse/guestmount.pod:83
20405 msgid "Enabling FUSE"
20409 #: ../fuse/guestmount.pod:85
20411 "On some distros, you may need to add yourself to a special group "
20412 "(eg. C<fuse>) before you can use any FUSE filesystem. This is necessary on "
20413 "Debian and derivatives."
20417 #: ../fuse/guestmount.pod:89
20419 "On other distros, no special group is required. It is not necessary on "
20420 "Fedora or Red Hat Enterprise Linux."
20424 #: ../fuse/guestmount.pod:100
20425 msgid "Add a block device or virtual machine image."
20429 #: ../fuse/guestmount.pod:123
20430 msgid "B<--dir-cache-timeout N>"
20434 #: ../fuse/guestmount.pod:125
20436 "Set the readdir cache timeout to I<N> seconds, the default being 60 "
20437 "seconds. The readdir cache [actually, there are several semi-independent "
20438 "caches] is populated after a readdir(2) call with the stat and extended "
20439 "attributes of the files in the directory, in anticipation that they will be "
20440 "requested soon after."
20444 #: ../fuse/guestmount.pod:131
20446 "There is also a different attribute cache implemented by FUSE (see the FUSE "
20447 "option I<-o attr_timeout>), but the FUSE cache does not anticipate future "
20448 "requests, only cache existing ones."
20452 #: ../fuse/guestmount.pod:151
20454 "If you have untrusted raw-format guest disk images, you should use this "
20455 "option to specify the disk format. This avoids a possible security problem "
20456 "with malicious guests (CVE-2010-3851). See also "
20457 "L<guestfs(3)/guestfs_add_drive_opts>."
20461 #: ../fuse/guestmount.pod:156
20462 msgid "B<--fuse-help>"
20466 #: ../fuse/guestmount.pod:158
20467 msgid "Display help on special FUSE options (see I<-o> below)."
20471 #: ../fuse/guestmount.pod:162
20472 msgid "Display brief help and exit."
20476 #: ../fuse/guestmount.pod:186
20478 "Mount the named partition or logical volume on the given mountpoint B<in the "
20479 "guest> (this has nothing to do with mountpoints in the host)."
20483 #: ../fuse/guestmount.pod:189
20485 "If the mountpoint is omitted, it defaults to C</>. You have to mount "
20486 "something on C</>."
20490 #: ../fuse/guestmount.pod:206
20492 "By default, we attempt to sync the guest disk when the FUSE mountpoint is "
20493 "unmounted. If you specify this option, then we don't attempt to sync the "
20494 "disk. See the discussion of autosync in the L<guestfs(3)> manpage."
20498 #: ../fuse/guestmount.pod:211
20499 msgid "B<-o option>"
20503 #: ../fuse/guestmount.pod:213
20504 msgid "B<--option option>"
20508 #: ../fuse/guestmount.pod:215
20509 msgid "Pass extra options to FUSE."
20513 #: ../fuse/guestmount.pod:217
20515 "To get a list of all the extra options supported by FUSE, use the command "
20516 "below. Note that only the FUSE I<-o> options can be passed, and only some "
20517 "of them are a good idea."
20521 #: ../fuse/guestmount.pod:221
20524 " guestmount --fuse-help\n"
20529 #: ../fuse/guestmount.pod:223
20530 msgid "Some potentially useful FUSE options:"
20534 #: ../fuse/guestmount.pod:227
20535 msgid "B<-o allow_other>"
20539 #: ../fuse/guestmount.pod:229
20540 msgid "Allow other users to see the filesystem."
20544 #: ../fuse/guestmount.pod:231
20545 msgid "B<-o attr_timeout=N>"
20549 #: ../fuse/guestmount.pod:233
20550 msgid "Enable attribute caching by FUSE, and set the timeout to I<N> seconds."
20554 #: ../fuse/guestmount.pod:235
20555 msgid "B<-o kernel_cache>"
20559 #: ../fuse/guestmount.pod:237
20561 "Allow the kernel to cache files (reduces the number of reads that have to go "
20562 "through the L<guestfs(3)> API). This is generally a good idea if you can "
20563 "afford the extra memory usage."
20567 #: ../fuse/guestmount.pod:241
20568 msgid "B<-o uid=N> B<-o gid=N>"
20572 #: ../fuse/guestmount.pod:243
20574 "Use these options to map all UIDs and GIDs inside the guest filesystem to "
20575 "the chosen values."
20579 #: ../fuse/guestmount.pod:252
20581 "Add devices and mount everything read-only. Also disallow writes and make "
20582 "the disk appear read-only to FUSE."
20586 #: ../fuse/guestmount.pod:255
20588 "This is highly recommended if you are not going to edit the guest disk. If "
20589 "the guest is running and this option is I<not> supplied, then there is a "
20590 "strong risk of disk corruption in the guest. We try to prevent this from "
20591 "happening, but it is not always possible."
20595 #: ../fuse/guestmount.pod:260 ../rescue/virt-rescue.pod:171
20596 msgid "See also L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20600 #: ../fuse/guestmount.pod:264
20601 msgid "Enable SELinux support for the guest."
20605 #: ../fuse/guestmount.pod:270
20606 msgid "Enable verbose messages from underlying libguestfs."
20610 #: ../fuse/guestmount.pod:276
20611 msgid "Display the program version and exit."
20615 #: ../fuse/guestmount.pod:285 ../fuse/guestmount.pod:308 ../rescue/virt-rescue.pod:201 ../rescue/virt-rescue.pod:284
20616 msgid "See L<guestfish(1)/OPENING DISKS FOR READ AND WRITE>."
20620 #: ../fuse/guestmount.pod:289
20625 #: ../fuse/guestmount.pod:291
20626 msgid "Trace libguestfs calls and entry into each FUSE function."
20630 #: ../fuse/guestmount.pod:293
20631 msgid "This also stops the daemon from forking into the background."
20635 #: ../fuse/guestmount.pod:319
20637 "L<guestfish(1)>, L<virt-inspector(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
20638 "L<virt-tar(1)>, L<guestfs(3)>, L<http://libguestfs.org/>, "
20639 "L<http://fuse.sf.net/>."
20643 #: ../fuse/guestmount.pod:334
20644 msgid "Copyright (C) 2009-2010 Red Hat Inc. L<http://libguestfs.org/>"
20648 #: ../inspector/virt-inspector.pod:5
20650 "virt-inspector - Display operating system version and other information "
20651 "about a virtual machine"
20655 #: ../inspector/virt-inspector.pod:9
20658 " virt-inspector [--options] -d domname\n"
20663 #: ../inspector/virt-inspector.pod:11
20666 " virt-inspector [--options] -a disk.img [-a disk.img ...]\n"
20671 #: ../inspector/virt-inspector.pod:15
20674 " virt-inspector domname\n"
20679 #: ../inspector/virt-inspector.pod:17 ../inspector/virt-inspector.pod:141
20682 " virt-inspector disk.img [disk.img ...]\n"
20687 #: ../inspector/virt-inspector.pod:21
20689 "B<virt-inspector> examines a virtual machine or disk image and tries to "
20690 "determine the version of the operating system and other information about "
20691 "the virtual machine."
20695 #: ../inspector/virt-inspector.pod:25
20696 msgid "Virt-inspector produces XML output for feeding into other programs."
20700 #: ../inspector/virt-inspector.pod:27
20702 "In the normal usage, use C<virt-inspector -d domname> where C<domname> is "
20703 "the libvirt domain (see: C<virsh list --all>)."
20707 #: ../inspector/virt-inspector.pod:30
20709 "You can also run virt-inspector directly on disk images from a single "
20710 "virtual machine. Use C<virt-inspector -a disk.img>. In rare cases a domain "
20711 "has several block devices, in which case you should list several I<-a> "
20712 "options one after another, with the first corresponding to the guest's "
20713 "C</dev/sda>, the second to the guest's C</dev/sdb> and so on."
20717 #: ../inspector/virt-inspector.pod:37
20719 "You can also run virt-inspector on install disks, live CDs, bootable USB "
20720 "keys and similar."
20724 #: ../inspector/virt-inspector.pod:40
20726 "Virt-inspector can only inspect and report upon I<one domain at a time>. To "
20727 "inspect several virtual machines, you have to run virt-inspector several "
20728 "times (for example, from a shell script for-loop)."
20732 #: ../inspector/virt-inspector.pod:45
20734 "Because virt-inspector needs direct access to guest images, it won't "
20735 "normally work over remote libvirt connections."
20739 #: ../inspector/virt-inspector.pod:48
20741 "All of the information available from virt-inspector is also available "
20742 "through the core libguestfs inspection API (see L<guestfs(3)/INSPECTION>). "
20743 "The same information can also be fetched using guestfish or via libguestfs "
20744 "bindings in many programming languages (see L<guestfs(3)/USING LIBGUESTFS "
20745 "WITH OTHER PROGRAMMING LANGUAGES>)."
20749 #: ../inspector/virt-inspector.pod:81
20751 "Libvirt is only used if you specify a C<domname> on the command line. If "
20752 "you specify guest block devices directly (I<-a>), then libvirt is not used "
20757 #: ../inspector/virt-inspector.pod:94
20759 "When prompting for keys and passphrases, virt-inspector normally turns "
20760 "echoing off so you cannot see what you are typing. If you are not worried "
20761 "about Tempest attacks and there is no one else in the room you can specify "
20762 "this flag to see what you are typing."
20766 #: ../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
20768 "Specify the format of disk images given on the command line. If this is "
20769 "omitted then the format is autodetected from the content of the disk image."
20773 #: ../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
20775 "If disk images are requested from libvirt, then this program asks libvirt "
20776 "for this information. In this case, the value of the format parameter is "
20781 #: ../inspector/virt-inspector.pod:111 ../resize/virt-resize.pod:370 ../resize/virt-resize.pod:462 ../sparsify/virt-sparsify.pod:132 ../tools/virt-list-filesystems.pl:101 ../tools/virt-list-partitions.pl:102 ../tools/virt-tar.pl:151 ../tools/virt-win-reg.pl:152
20783 "If working with untrusted raw-format guest disk images, you should ensure "
20784 "the format is always specified."
20788 #: ../inspector/virt-inspector.pod:139
20789 msgid "Previous versions of virt-inspector allowed you to write either:"
20793 #: ../inspector/virt-inspector.pod:145
20796 " virt-inspector guestname\n"
20801 #: ../inspector/virt-inspector.pod:153
20806 #: ../inspector/virt-inspector.pod:155
20808 "The virt-inspector XML is described precisely in a RELAX NG schema file "
20809 "C<virt-inspector.rng> which is supplied with libguestfs. This section is "
20810 "just an overview."
20814 #: ../inspector/virt-inspector.pod:159
20816 "The top-level element is E<lt>operatingsystemsE<gt>, and it contains one or "
20817 "more E<lt>operatingsystemE<gt> elements. You would only see more than one "
20818 "E<lt>operatingsystemE<gt> element if the virtual machine is multi-boot, "
20819 "which is vanishingly rare in real world VMs."
20823 #: ../inspector/virt-inspector.pod:164
20824 msgid "E<lt>operatingsystemE<gt>"
20828 #: ../inspector/virt-inspector.pod:166
20830 "In the E<lt>operatingsystemE<gt> tag are various optional fields that "
20831 "describe the operating system, its architecture, the descriptive \"product "
20832 "name\" string, the type of OS and so on, as in this example:"
20836 #: ../inspector/virt-inspector.pod:170
20839 " <operatingsystems>\n"
20840 " <operatingsystem>\n"
20841 " <root>/dev/sda2</root>\n"
20842 " <name>windows</name>\n"
20843 " <arch>i386</arch>\n"
20844 " <distro>windows</distro>\n"
20845 " <product_name>Windows 7 Enterprise</product_name>\n"
20846 " <product_variant>Client</product_variant>\n"
20847 " <major_version>6</major_version>\n"
20848 " <minor_version>1</minor_version>\n"
20849 " <windows_systemroot>/Windows</windows_systemroot>\n"
20850 " <format>installed</format>\n"
20855 #: ../inspector/virt-inspector.pod:183
20857 "In brief, E<lt>nameE<gt> is the class of operating system (something like "
20858 "C<linux> or C<windows>), E<lt>distroE<gt> is the distribution (eg. C<fedora> "
20859 "but many other distros are recognized) and E<lt>archE<gt> is the guest "
20860 "architecture. The other fields are fairly self-explanatory, but because "
20861 "these fields are taken directly from the libguestfs inspection API you can "
20862 "find precise information from L<guestfs(3)/INSPECTION>."
20866 #: ../inspector/virt-inspector.pod:191
20868 "The E<lt>rootE<gt> element is the root filesystem device, but from the point "
20869 "of view of libguestfs (block devices may have completely different names "
20870 "inside the VM itself)."
20874 #: ../inspector/virt-inspector.pod:195
20875 msgid "E<lt>mountpointsE<gt>"
20879 #: ../inspector/virt-inspector.pod:197
20881 "Un*x-like guests typically have multiple filesystems which are mounted at "
20882 "various mountpoints, and these are described in the E<lt>mountpointsE<gt> "
20883 "element which looks like this:"
20887 #: ../inspector/virt-inspector.pod:201
20890 " <operatingsystems>\n"
20891 " <operatingsystem>\n"
20894 " <mountpoint dev=\"/dev/vg_f13x64/lv_root\">/</mountpoint>\n"
20895 " <mountpoint dev=\"/dev/sda1\">/boot</mountpoint>\n"
20896 " </mountpoints>\n"
20901 #: ../inspector/virt-inspector.pod:209
20903 "As with E<lt>rootE<gt>, devices are from the point of view of libguestfs, "
20904 "and may have completely different names inside the guest. Only mountable "
20905 "filesystems appear in this list, not things like swap devices."
20909 #: ../inspector/virt-inspector.pod:214
20910 msgid "E<lt>filesystemsE<gt>"
20914 #: ../inspector/virt-inspector.pod:216
20916 "E<lt>filesystemsE<gt> is like E<lt>mountpointsE<gt> but covers I<all> "
20917 "filesystems belonging to the guest, including swap and empty partitions. "
20918 "(In the rare case of a multi-boot guest, it covers filesystems belonging to "
20919 "this OS or shared with this OS and other OSes)."
20923 #: ../inspector/virt-inspector.pod:222
20924 msgid "You might see something like this:"
20928 #: ../inspector/virt-inspector.pod:224
20931 " <operatingsystems>\n"
20932 " <operatingsystem>\n"
20935 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
20936 " <type>ext4</type>\n"
20937 " <label>Fedora-13-x86_64</label>\n"
20938 " <uuid>e6a4db1e-15c2-477b-ac2a-699181c396aa</uuid>\n"
20944 #: ../inspector/virt-inspector.pod:234
20946 "The optional elements within E<lt>filesystemE<gt> are the filesystem type, "
20947 "the label, and the UUID."
20951 #: ../inspector/virt-inspector.pod:237
20952 msgid "E<lt>applicationsE<gt>"
20956 #: ../inspector/virt-inspector.pod:239
20958 "The related elements E<lt>package_formatE<gt>, E<lt>package_managementE<gt> "
20959 "and E<lt>applicationsE<gt> describe applications installed in the virtual "
20964 #: ../inspector/virt-inspector.pod:243
20966 "E<lt>package_formatE<gt>, if present, describes the packaging system used. "
20967 "Typical values would be C<rpm> and C<deb>."
20971 #: ../inspector/virt-inspector.pod:246
20973 "E<lt>package_managementE<gt>, if present, describes the package manager. "
20974 "Typical values include C<yum>, C<up2date> and C<apt>"
20978 #: ../inspector/virt-inspector.pod:249
20979 msgid "E<lt>applicationsE<gt> lists the packages or applications installed."
20983 #: ../inspector/virt-inspector.pod:252
20986 " <operatingsystems>\n"
20987 " <operatingsystem>\n"
20989 " <applications>\n"
20991 " <name>coreutils</name>\n"
20992 " <version>8.5</version>\n"
20993 " <release>1</release>\n"
20994 " </application>\n"
20999 #: ../inspector/virt-inspector.pod:262
21001 "The version and release fields may not be available for some types guests. "
21002 "Other fields are possible, see "
21003 "L<guestfs(3)/guestfs_inspect_list_applications>."
21007 #: ../inspector/virt-inspector.pod:266
21008 msgid "E<lt>drive_mappingsE<gt>"
21012 #: ../inspector/virt-inspector.pod:268
21014 "For operating systems like Windows which use drive letters, virt-inspector "
21015 "is able to find out how drive letters map to filesystems."
21019 #: ../inspector/virt-inspector.pod:272
21022 " <operatingsystems>\n"
21023 " <operatingsystem>\n"
21025 " <drive_mappings>\n"
21026 " <drive_mapping name=\"C\">/dev/sda2</drive_mapping>\n"
21027 " <drive_mapping name=\"E\">/dev/sdb1</drive_mapping>\n"
21028 " </drive_mappings>\n"
21033 #: ../inspector/virt-inspector.pod:280
21035 "In the example above, drive C maps to the filesystem on the second partition "
21036 "on the first disk, and drive E maps to the filesystem on the first partition "
21037 "on the second disk."
21041 #: ../inspector/virt-inspector.pod:284
21043 "Note that this only covers permanent local filesystem mappings, not things "
21044 "like network shares. Furthermore NTFS volume mount points may not be listed "
21049 #: ../inspector/virt-inspector.pod:288
21050 msgid "E<lt>iconE<gt>"
21054 #: ../inspector/virt-inspector.pod:290
21056 "Virt-inspector is sometimes able to extract an icon or logo for the guest. "
21057 "The icon is returned as base64-encoded PNG data. Note that the icon can be "
21058 "very large and high quality."
21062 #: ../inspector/virt-inspector.pod:294
21065 " <operatingsystems>\n"
21066 " <operatingsystem>\n"
21069 " iVBORw0KGgoAAAANSUhEUgAAAGAAAABg[.......]\n"
21070 " [... many lines of base64 data ...]\n"
21076 #: ../inspector/virt-inspector.pod:302
21078 "To display the icon, you have to extract it and convert the base64 data back "
21079 "to a binary file. Use an XPath query or simply an editor to extract the "
21080 "data, then use the coreutils L<base64(1)> program to do the conversion back "
21085 #: ../inspector/virt-inspector.pod:307
21088 " base64 -i -d < icon.data > icon.png\n"
21093 #: ../inspector/virt-inspector.pod:309
21094 msgid "INSPECTING INSTALL DISKS, LIVE CDs"
21098 #: ../inspector/virt-inspector.pod:311
21100 "Virt-inspector can detect some operating system installers on install disks, "
21101 "live CDs, bootable USB keys and more."
21105 #: ../inspector/virt-inspector.pod:314
21107 "In this case the E<lt>formatE<gt> tag will contain C<installer> and other "
21108 "fields may be present to indicate a live CD, network installer, or one part "
21109 "of a multipart CD. For example:"
21113 #: ../inspector/virt-inspector.pod:318
21116 " <operatingsystems>\n"
21117 " <operatingsystem>\n"
21118 " <root>/dev/sda</root>\n"
21119 " <name>linux</name>\n"
21120 " <arch>i386</arch>\n"
21121 " <distro>ubuntu</distro>\n"
21122 " <product_name>Ubuntu 10.10 "Maverick "
21123 "Meerkat"</product_name>\n"
21124 " <major_version>10</major_version>\n"
21125 " <minor_version>10</minor_version>\n"
21126 " <format>installer</format>\n"
21132 #: ../inspector/virt-inspector.pod:330
21133 msgid "USING XPATH"
21137 #: ../inspector/virt-inspector.pod:332
21139 "You can use the XPath query language to select parts of the XML. We "
21140 "recommend using C<xmlstarlet> to perform XPath queries from the command "
21145 #: ../inspector/virt-inspector.pod:338
21148 " $ virt-inspector -d Guest | xmlstarlet sel -t -c '//filesystems'\n"
21150 " <filesystem dev=\"/dev/vg_f13x64/lv_root\">\n"
21151 " <type>ext4</type>\n"
21157 #: ../inspector/virt-inspector.pod:344
21160 " $ virt-inspector -d Guest | \\\n"
21161 " xmlstarlet sel -t -c \"string(//filesystem[@dev='/dev/sda1']/type)\"\n"
21167 #: ../inspector/virt-inspector.pod:348
21170 " $ virt-inspector -d Guest | \\\n"
21171 " xmlstarlet sel -t -v '//icon' | base64 -i -d | display -\n"
21172 " [displays the guest icon, if there is one]\n"
21177 #: ../inspector/virt-inspector.pod:359
21178 msgid "OLD VERSIONS OF VIRT-INSPECTOR"
21182 #: ../inspector/virt-inspector.pod:361
21184 "Early versions of libguestfs shipped with a different virt-inspector program "
21185 "written in Perl (the current version is written in C). The XML output of "
21186 "the Perl virt-inspector was different and it could also output in other "
21187 "formats like text."
21191 #: ../inspector/virt-inspector.pod:366
21192 msgid "The old virt-inspector is no longer supported or shipped with libguestfs."
21196 #: ../inspector/virt-inspector.pod:369
21198 "To confuse matters further, in Red Hat Enterprise Linux 6 we ship two "
21199 "versions of virt-inspector with different names:"
21203 #: ../inspector/virt-inspector.pod:372
21206 " virt-inspector Old Perl version.\n"
21207 " virt-inspector2 New C version.\n"
21212 #: ../inspector/virt-inspector.pod:382
21214 "L<guestfs(3)>, L<guestfish(1)>, L<http://www.w3.org/TR/xpath/>, "
21215 "L<base64(1)>, L<xmlstarlet(1)>, L<http://libguestfs.org/>."
21219 #: ../inspector/virt-inspector.pod:399
21220 msgid "Matthew Booth L<mbooth@redhat.com>"
21224 #: ../java/examples/guestfs-java.pod:5
21225 msgid "guestfs-java - How to use libguestfs from Java"
21229 #: ../java/examples/guestfs-java.pod:9
21232 " import com.redhat.et.libguestfs.*;\n"
21237 #: ../java/examples/guestfs-java.pod:11
21240 " GuestFS g = new GuestFS ();\n"
21241 " g.add_drive_opts (\"disk.img\", null);\n"
21247 #: ../java/examples/guestfs-java.pod:17
21249 "This manual page documents how to call libguestfs from the Java programming "
21250 "language. This page just documents the differences from the C API and gives "
21251 "some examples. If you are not familiar with using libguestfs, you also need "
21252 "to read L<guestfs(3)>."
21256 #: ../java/examples/guestfs-java.pod:22 ../ocaml/examples/guestfs-ocaml.pod:53
21257 msgid "CLOSING THE HANDLE"
21261 #: ../java/examples/guestfs-java.pod:24
21263 "The handle is closed when it is reaped by the garbage collector. Because "
21264 "libguestfs handles include a lot of state, it is also possible to close (and "
21265 "hence free) them explicitly by calling the C<close> method."
21269 #: ../java/examples/guestfs-java.pod:29 ../ocaml/examples/guestfs-ocaml.pod:60 ../python/examples/guestfs-python.pod:21 ../ruby/examples/guestfs-ruby.pod:22
21274 #: ../java/examples/guestfs-java.pod:31
21276 "Errors from libguestfs functions are mapped into the C<LibGuestFSException> "
21277 "exception. This has a single parameter which is the error message (a "
21282 #: ../java/examples/guestfs-java.pod:35
21283 msgid "Calling any method on a closed handle raises the same exception."
21287 #: ../java/examples/guestfs-java.pod:47
21289 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21290 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21291 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21292 "L<http://caml.inria.fr/>."
21296 #: ../ocaml/examples/guestfs-ocaml.pod:5
21297 msgid "guestfs-ocaml - How to use libguestfs from OCaml"
21301 #: ../ocaml/examples/guestfs-ocaml.pod:9
21302 msgid "Module style:"
21306 #: ../ocaml/examples/guestfs-ocaml.pod:11
21309 " let g = Guestfs.create () in\n"
21310 " Guestfs.add_drive_opts g ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21311 " Guestfs.launch g;\n"
21316 #: ../ocaml/examples/guestfs-ocaml.pod:15
21317 msgid "Object-oriented style:"
21321 #: ../ocaml/examples/guestfs-ocaml.pod:17
21324 " let g = new Guestfs.guestfs () in\n"
21325 " g#add_drive_opts ~format:\"raw\" ~readonly:true \"disk.img\";\n"
21331 #: ../ocaml/examples/guestfs-ocaml.pod:21
21334 " ocamlfind opt prog.ml -package guestfs -linkpkg -o prog\n"
21336 " ocamlopt -I +guestfs mlguestfs.cmxa prog.ml -o prog\n"
21341 #: ../ocaml/examples/guestfs-ocaml.pod:27
21343 "This manual page documents how to call libguestfs from the OCaml programming "
21344 "language. This page just documents the differences from the C API and gives "
21345 "some examples. If you are not familiar with using libguestfs, you also need "
21346 "to read L<guestfs(3)>."
21350 #: ../ocaml/examples/guestfs-ocaml.pod:32
21351 msgid "PROGRAMMING STYLES"
21355 #: ../ocaml/examples/guestfs-ocaml.pod:34
21357 "There are two different programming styles supported by the OCaml bindings. "
21358 "You can use a module style, with each C function mapped to an OCaml "
21363 #: ../ocaml/examples/guestfs-ocaml.pod:38
21366 " int guestfs_set_verbose (guestfs_h *g, int flag);\n"
21371 #: ../ocaml/examples/guestfs-ocaml.pod:40
21376 #: ../ocaml/examples/guestfs-ocaml.pod:42
21379 " val Guestfs.set_verbose : Guestfs.t -> bool -> unit\n"
21384 #: ../ocaml/examples/guestfs-ocaml.pod:44
21386 "Alternately you can use an object-oriented style, calling methods on the "
21387 "class C<Guestfs.guestfs>:"
21391 #: ../ocaml/examples/guestfs-ocaml.pod:47
21394 " method set_verbose : bool -> unit\n"
21399 #: ../ocaml/examples/guestfs-ocaml.pod:49
21401 "The object-oriented style is usually briefer, and the minor performance "
21402 "penalty isn't noticable in the general overhead of performing libguestfs "
21407 #: ../ocaml/examples/guestfs-ocaml.pod:55
21409 "The handle is closed when it is reaped by the garbage collector. Because "
21410 "libguestfs handles include a lot of state, it is also possible to close (and "
21411 "hence free) them explicitly by calling C<Guestfs.close> or the C<#close> "
21416 #: ../ocaml/examples/guestfs-ocaml.pod:62
21418 "Errors from libguestfs functions are mapped into the C<Guestfs.Error> "
21419 "exception. This has a single parameter which is the error message (a "
21424 #: ../ocaml/examples/guestfs-ocaml.pod:66
21426 "Calling any function/method on a closed handle raises "
21427 "C<Guestfs.Handle_closed>. The single parameter is the name of the function "
21432 #: ../ocaml/examples/guestfs-ocaml.pod:80
21434 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21435 "L<guestfs-java(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
21436 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>, "
21437 "L<http://caml.inria.fr/>."
21441 #: ../perl/examples/guestfs-perl.pod:5
21442 msgid "guestfs-perl - How to use libguestfs from Perl"
21446 #: ../perl/examples/guestfs-perl.pod:9
21449 " use Sys::Guestfs;\n"
21454 #: ../perl/examples/guestfs-perl.pod:11
21457 " my $h = Sys::Guestfs->new ();\n"
21458 " $h->add_drive_opts ('guest.img', format => 'raw');\n"
21459 " $h->launch ();\n"
21460 " $h->mount_options ('', '/dev/sda1', '/');\n"
21461 " $h->touch ('/hello');\n"
21467 #: ../perl/examples/guestfs-perl.pod:20
21469 "This manual page documents how to call libguestfs from the Perl programming "
21470 "language. This page just documents the differences from the C API and gives "
21471 "some examples. If you are not familiar with using libguestfs, you also need "
21472 "to read L<guestfs(3)>. To read the full Perl API, see L<Sys::Guestfs(3)>."
21476 #: ../perl/examples/guestfs-perl.pod:26
21481 #: ../perl/examples/guestfs-perl.pod:28
21483 "Errors from libguestfs functions turn into calls to C<croak> (see "
21488 #: ../perl/examples/guestfs-perl.pod:41
21490 "L<Sys::Guestfs(3)>, L<guestfs(3)>, L<guestfs-examples(3)>, "
21491 "L<guestfs-erlang(3)>, L<guestfs-java(3)>, L<guestfs-ocaml(3)>, "
21492 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, "
21493 "L<http://libguestfs.org/>."
21497 #: ../python/examples/guestfs-python.pod:5
21498 msgid "guestfs-python - How to use libguestfs from Python"
21502 #: ../python/examples/guestfs-python.pod:9
21505 " import guestfs\n"
21506 " g = guestfs.GuestFS ()\n"
21507 " g.add_drive_opts (\"disk.img\", format=\"raw\", readonly=1)\n"
21513 #: ../python/examples/guestfs-python.pod:16
21515 "This manual page documents how to call libguestfs from the Python "
21516 "programming language. This page just documents the differences from the C "
21517 "API and gives some examples. If you are not familiar with using libguestfs, "
21518 "you also need to read L<guestfs(3)>."
21522 #: ../python/examples/guestfs-python.pod:23
21524 "Errors from libguestfs functions are mapped into C<RuntimeException> with a "
21525 "single string argument which is the error message."
21529 #: ../python/examples/guestfs-python.pod:26
21530 msgid "MORE DOCUMENTATION"
21534 #: ../python/examples/guestfs-python.pod:28
21539 #: ../python/examples/guestfs-python.pod:30
21543 " >>> import guestfs\n"
21544 " >>> help (guestfs)\n"
21549 #: ../python/examples/guestfs-python.pod:44
21551 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
21552 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
21553 "L<guestfs-recipes(1)>, L<guestfs-ruby(3)>, L<http://libguestfs.org/>."
21557 #: ../rescue/virt-rescue.pod:5
21558 msgid "virt-rescue - Run a rescue shell on a virtual machine"
21562 #: ../rescue/virt-rescue.pod:9
21565 " virt-rescue [--options] -d domname\n"
21570 #: ../rescue/virt-rescue.pod:11
21573 " virt-rescue [--options] -a disk.img [-a disk.img ...]\n"
21578 #: ../rescue/virt-rescue.pod:15
21581 " virt-rescue [--options] domname\n"
21586 #: ../rescue/virt-rescue.pod:17
21589 " virt-rescue [--options] disk.img [disk.img ...]\n"
21594 #: ../rescue/virt-rescue.pod:21
21596 "You must I<not> use C<virt-rescue> on live virtual machines. Doing so will "
21597 "probably result in disk corruption in the VM. C<virt-rescue> tries to stop "
21598 "you from doing this, but doesn't catch all cases."
21602 #: ../rescue/virt-rescue.pod:25
21604 "However if you use the I<--ro> (read only) option, then you can attach a "
21605 "shell to a live virtual machine. The results might be strange or "
21606 "inconsistent at times but you won't get disk corruption."
21610 #: ../rescue/virt-rescue.pod:31
21612 "virt-rescue is like a Rescue CD, but for virtual machines, and without the "
21613 "need for a CD. virt-rescue gives you a rescue shell and some simple "
21614 "recovery tools which you can use to examine or rescue a virtual machine or "
21619 #: ../rescue/virt-rescue.pod:36
21621 "You can run virt-rescue on any virtual machine known to libvirt, or directly "
21622 "on disk image(s):"
21626 #: ../rescue/virt-rescue.pod:39
21629 " virt-rescue -d GuestName\n"
21634 #: ../rescue/virt-rescue.pod:41
21637 " virt-rescue --ro -a /path/to/disk.img\n"
21642 #: ../rescue/virt-rescue.pod:43
21645 " virt-rescue -a /dev/sdc\n"
21650 #: ../rescue/virt-rescue.pod:45
21651 msgid "For live VMs you I<must> use the --ro option."
21655 #: ../rescue/virt-rescue.pod:47
21657 "When you run virt-rescue on a virtual machine or disk image, you are placed "
21658 "in an interactive bash shell where you can use many ordinary Linux "
21659 "commands. What you see in C</> (C</bin>, C</lib> etc) is the rescue "
21660 "appliance. You must mount the virtual machine's filesystems by hand. There "
21661 "is an empty directory called C</sysroot> where you can mount filesystems."
21665 #: ../rescue/virt-rescue.pod:54
21667 "In the example below, we list logical volumes, then choose one to mount "
21668 "under C</sysroot>:"
21672 #: ../rescue/virt-rescue.pod:57
21676 " LV VG Attr LSize Origin Snap% Move Log Copy% Convert\n"
21677 " lv_root vg_f11x64 -wi-a- 8.83G\n"
21678 " lv_swap vg_f11x64 -wi-a- 992.00M\n"
21679 " ><rescue> mount /dev/vg_f11x64/lv_root /sysroot\n"
21680 " ><rescue> ls /sysroot\n"
21685 #: ../rescue/virt-rescue.pod:64
21687 "If you don't know what filesystems are available on the virtual machine then "
21688 "you can use commands such as L<parted(8)> and L<lvs(8)> to find out."
21692 #: ../rescue/virt-rescue.pod:70
21694 "Virt-rescue can be used on I<any> disk image file or device, not just a "
21695 "virtual machine. For example you can use it on a blank file if you want to "
21696 "partition that file (although we would recommend using L<guestfish(1)> "
21697 "instead as it is more suitable for this purpose). You can even use "
21698 "virt-rescue on things like SD cards."
21702 #: ../rescue/virt-rescue.pod:76
21704 "Virt-rescue does not require root. You only need to run it as root if you "
21705 "need root to open the disk image."
21709 #: ../rescue/virt-rescue.pod:79
21711 "This tool is just designed for quick interactive hacking on a virtual "
21712 "machine. For more structured access to a virtual machine disk image, you "
21713 "should use L<guestfs(3)>. To get a structured shell that you can use to "
21714 "make scripted changes to guests, use L<guestfish(1)>."
21718 #: ../rescue/virt-rescue.pod:103
21719 msgid "B<--append kernelopts>"
21723 #: ../rescue/virt-rescue.pod:105
21724 msgid "Pass additional options to the rescue kernel."
21728 #: ../rescue/virt-rescue.pod:135
21731 " virt-rescue --format=raw -a disk.img\n"
21736 #: ../rescue/virt-rescue.pod:139
21739 " virt-rescue --format=raw -a disk.img --format -a another.img\n"
21744 #: ../rescue/virt-rescue.pod:148
21749 #: ../rescue/virt-rescue.pod:150
21750 msgid "B<--memsize MB>"
21754 #: ../rescue/virt-rescue.pod:152
21756 "Change the amount of memory allocated to the rescue system. The default is "
21757 "set by libguestfs and is small but adequate for running system tools. The "
21758 "occasional program might need more memory. The parameter is specified in "
21763 #: ../rescue/virt-rescue.pod:157
21764 msgid "B<--network>"
21768 #: ../rescue/virt-rescue.pod:159
21769 msgid "Enable QEMU user networking in the guest. See L</NETWORK>."
21773 #: ../rescue/virt-rescue.pod:165
21774 msgid "Open the image read-only."
21778 #: ../rescue/virt-rescue.pod:175
21780 "Enable SELinux in the rescue appliance. You should read "
21781 "L<guestfs(3)/SELINUX> before using this option."
21785 #: ../rescue/virt-rescue.pod:178
21790 #: ../rescue/virt-rescue.pod:180
21791 msgid "Enable N E<ge> 2 virtual CPUs in the rescue appliance."
21795 #: ../rescue/virt-rescue.pod:198
21797 "This changes the I<-a> and I<-d> options so that disks are added and mounts "
21798 "are done read-write."
21802 #: ../rescue/virt-rescue.pod:211
21803 msgid "Previous versions of virt-rescue allowed you to write either:"
21807 #: ../rescue/virt-rescue.pod:213
21810 " virt-rescue disk.img [disk.img ...]\n"
21815 #: ../rescue/virt-rescue.pod:217
21818 " virt-rescue guestname\n"
21823 #: ../rescue/virt-rescue.pod:225
21828 #: ../rescue/virt-rescue.pod:227
21830 "Adding the I<--network> option enables QEMU user networking in the rescue "
21831 "appliance. There are some differences between user networking and ordinary "
21836 #: ../rescue/virt-rescue.pod:233
21837 msgid "ping does not work"
21841 #: ../rescue/virt-rescue.pod:235
21843 "Because the ICMP ECHO_REQUEST protocol generally requires root in order to "
21844 "send the ping packets, and because virt-rescue must be able to run as "
21845 "non-root, QEMU user networking is not able to emulate the L<ping(8)> "
21846 "command. The ping command will appear to resolve addresses but will not be "
21847 "able to send or receive any packets. This does not mean that the network is "
21852 #: ../rescue/virt-rescue.pod:242
21853 msgid "cannot receive connections"
21857 #: ../rescue/virt-rescue.pod:244
21858 msgid "QEMU user networking cannot receive incoming connections."
21862 #: ../rescue/virt-rescue.pod:246
21863 msgid "making TCP connections"
21867 #: ../rescue/virt-rescue.pod:248
21869 "The virt-rescue appliance needs to be small and so does not include many "
21870 "network tools. In particular there is no L<telnet(1)> command. You can "
21871 "make TCP connections from the shell using the magical "
21872 "C</dev/tcp/E<lt>hostnameE<gt>/E<lt>portE<gt>> syntax:"
21876 #: ../rescue/virt-rescue.pod:253
21879 " exec 3<>/dev/tcp/redhat.com/80\n"
21880 " echo \"GET /\" >&3\n"
21886 #: ../rescue/virt-rescue.pod:257
21887 msgid "See L<bash(1)> for more details."
21891 #: ../rescue/virt-rescue.pod:263
21893 "Several environment variables affect virt-rescue. See "
21894 "L<guestfs(3)/ENVIRONMENT VARIABLES> for the complete list."
21898 #: ../rescue/virt-rescue.pod:290
21900 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
21901 "L<http://libguestfs.org/>."
21905 #: ../resize/virt-resize.pod:5
21906 msgid "virt-resize - Resize a virtual machine disk"
21910 #: ../resize/virt-resize.pod:9
21913 " virt-resize [--resize /dev/sdaN=[+/-]<size>[%]]\n"
21914 " [--expand /dev/sdaN] [--shrink /dev/sdaN]\n"
21915 " [--ignore /dev/sdaN] [--delete /dev/sdaN] [...] indisk outdisk\n"
21920 #: ../resize/virt-resize.pod:15
21922 "Virt-resize is a tool which can resize a virtual machine disk, making it "
21923 "larger or smaller overall, and resizing or deleting any partitions contained "
21928 #: ../resize/virt-resize.pod:19
21930 "Virt-resize B<cannot> resize disk images in-place. Virt-resize B<should "
21931 "not> be used on live virtual machines - for consistent results, shut the "
21932 "virtual machine down before resizing it."
21936 #: ../resize/virt-resize.pod:23
21938 "If you are not familiar with the associated tools: L<virt-filesystems(1)> "
21939 "and L<virt-df(1)>, we recommend you go and read those manual pages first."
21943 #: ../resize/virt-resize.pod:31 ../resize/virt-resize.pod:576 ../sparsify/virt-sparsify.pod:203 ../src/guestfs.pod:469 ../src/guestfs.pod:1287 ../src/guestfs.pod:1426 ../src/guestfs.pod:2675
21948 #: ../resize/virt-resize.pod:33
21950 "Copy C<olddisk> to C<newdisk>, extending one of the guest's partitions to "
21951 "fill the extra 5GB of space."
21955 #: ../resize/virt-resize.pod:36
21958 " virt-filesystems --long -h --all -a olddisk\n"
21963 #: ../resize/virt-resize.pod:38
21966 " truncate -r olddisk newdisk\n"
21967 " truncate -s +5G newdisk\n"
21972 #: ../resize/virt-resize.pod:41
21975 " # Note \"/dev/sda2\" is a partition inside the \"olddisk\" file.\n"
21976 " virt-resize --expand /dev/sda2 olddisk newdisk\n"
21981 #: ../resize/virt-resize.pod:44 ../resize/virt-resize.pod:583 ../sparsify/virt-sparsify.pod:210 ../src/guestfs.pod:475 ../src/guestfs.pod:1291 ../src/guestfs.pod:1430 ../src/guestfs.pod:2700
21986 #: ../resize/virt-resize.pod:46
21988 "As above, but make the /boot partition 200MB bigger, while giving the "
21989 "remaining space to /dev/sda2:"
21993 #: ../resize/virt-resize.pod:49
21996 " virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
21997 " olddisk newdisk\n"
22002 #: ../resize/virt-resize.pod:52 ../resize/virt-resize.pod:589 ../sparsify/virt-sparsify.pod:216 ../src/guestfs.pod:486 ../src/guestfs.pod:1436
22007 #: ../resize/virt-resize.pod:54
22009 "As in the first example, but expand a logical volume as the final step. "
22010 "This is what you would typically use for Linux guests that use LVM:"
22014 #: ../resize/virt-resize.pod:58
22017 " virt-resize --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root \\\n"
22018 " olddisk newdisk\n"
22023 #: ../resize/virt-resize.pod:61
22028 #: ../resize/virt-resize.pod:63
22030 "As in the first example, but the output format will be qcow2 instead of a "
22035 #: ../resize/virt-resize.pod:66
22038 " qemu-img create -f qcow2 newdisk.qcow2 15G\n"
22039 " virt-resize --expand /dev/sda2 olddisk newdisk.qcow2\n"
22044 #: ../resize/virt-resize.pod:71
22045 msgid "DETAILED USAGE"
22049 #: ../resize/virt-resize.pod:73
22050 msgid "EXPANDING A VIRTUAL MACHINE DISK"
22054 #: ../resize/virt-resize.pod:77
22055 msgid "1. Shut down the virtual machine"
22059 #: ../resize/virt-resize.pod:79
22060 msgid "2. Locate input disk image"
22064 #: ../resize/virt-resize.pod:81
22066 "Locate the input disk image (ie. the file or device on the host containing "
22067 "the guest's disk). If the guest is managed by libvirt, you can use C<virsh "
22068 "dumpxml> like this to find the disk image name:"
22072 #: ../resize/virt-resize.pod:85
22075 " # virsh dumpxml guestname | xpath /domain/devices/disk/source\n"
22076 " Found 1 nodes:\n"
22078 " <source dev=\"/dev/vg/lv_guest\" />\n"
22083 #: ../resize/virt-resize.pod:90
22084 msgid "3. Look at current sizing"
22088 #: ../resize/virt-resize.pod:92
22089 msgid "Use L<virt-filesystems(1)> to display the current partitions and sizes:"
22093 #: ../resize/virt-resize.pod:95
22096 " # virt-filesystems --long --parts --blkdevs -h -a /dev/vg/lv_guest\n"
22097 " Name Type Size Parent\n"
22098 " /dev/sda1 partition 101M /dev/sda\n"
22099 " /dev/sda2 partition 7.9G /dev/sda\n"
22100 " /dev/sda device 8.0G -\n"
22105 #: ../resize/virt-resize.pod:101
22107 "(This example is a virtual machine with an 8 GB disk which we would like to "
22108 "expand up to 10 GB)."
22112 #: ../resize/virt-resize.pod:104
22113 msgid "4. Create output disk"
22117 #: ../resize/virt-resize.pod:106
22119 "Virt-resize cannot do in-place disk modifications. You have to have space "
22120 "to store the resized output disk."
22124 #: ../resize/virt-resize.pod:109
22125 msgid "To store the resized disk image in a file, create a file of a suitable size:"
22129 #: ../resize/virt-resize.pod:112
22132 " # rm -f outdisk\n"
22133 " # truncate -s 10G outdisk\n"
22138 #: ../resize/virt-resize.pod:115
22139 msgid "Or use L<lvcreate(1)> to create a logical volume:"
22143 #: ../resize/virt-resize.pod:117
22146 " # lvcreate -L 10G -n lv_name vg_name\n"
22151 #: ../resize/virt-resize.pod:119
22152 msgid "Or use L<virsh(1)> vol-create-as to create a libvirt storage volume:"
22156 #: ../resize/virt-resize.pod:121
22159 " # virsh pool-list\n"
22160 " # virsh vol-create-as poolname newvol 10G\n"
22165 #: ../resize/virt-resize.pod:124
22170 #: ../resize/virt-resize.pod:126
22172 "virt-resize takes two mandatory parameters, the input disk (eg. device or "
22173 "file) and the output disk. The output disk is the one created in the "
22178 #: ../resize/virt-resize.pod:130
22181 " # virt-resize indisk outdisk\n"
22186 #: ../resize/virt-resize.pod:132
22188 "This command just copies disk image C<indisk> to disk image C<outdisk> "
22189 "I<without> resizing or changing any existing partitions. If C<outdisk> is "
22190 "larger, then an extra, empty partition is created at the end of the disk "
22191 "covering the extra space. If C<outdisk> is smaller, then it will give an "
22196 #: ../resize/virt-resize.pod:138
22198 "More realistically you'd want to expand existing partitions in the disk "
22199 "image by passing extra options (for the full list see the L</OPTIONS> "
22204 #: ../resize/virt-resize.pod:142
22206 "L</--expand> is the most useful option. It expands the named partition "
22207 "within the disk to fill any extra space:"
22211 #: ../resize/virt-resize.pod:145
22214 " # virt-resize --expand /dev/sda2 indisk outdisk\n"
22219 #: ../resize/virt-resize.pod:147
22221 "(In this case, an extra partition is I<not> created at the end of the disk, "
22222 "because there will be no unused space)."
22226 #: ../resize/virt-resize.pod:150
22228 "L</--resize> is the other commonly used option. The following would "
22229 "increase the size of /dev/sda1 by 200M, and expand /dev/sda2 to fill the "
22230 "rest of the available space:"
22234 #: ../resize/virt-resize.pod:154
22237 " # virt-resize --resize /dev/sda1=+200M --expand /dev/sda2 \\\n"
22238 " indisk outdisk\n"
22243 #: ../resize/virt-resize.pod:157
22245 "If the expanded partition in the image contains a filesystem or LVM PV, then "
22246 "if virt-resize knows how, it will resize the contents, the equivalent of "
22247 "calling a command such as L<pvresize(8)>, L<resize2fs(8)>, L<ntfsresize(8)> "
22248 "or L<btrfs(8)>. However virt-resize does not know how to resize some "
22249 "filesystems, so you would have to online resize them after booting the "
22254 #: ../resize/virt-resize.pod:164
22255 msgid "Other options are covered below."
22259 #: ../resize/virt-resize.pod:166
22264 #: ../resize/virt-resize.pod:168
22265 msgid "Thoroughly test the new disk image I<before> discarding the old one."
22269 #: ../resize/virt-resize.pod:170
22270 msgid "If you are using libvirt, edit the XML to point at the new disk:"
22274 #: ../resize/virt-resize.pod:172
22277 " # virsh edit guestname\n"
22282 #: ../resize/virt-resize.pod:174
22284 "Change E<lt>source ...E<gt>, see "
22285 "L<http://libvirt.org/formatdomain.html#elementsDisks>"
22289 #: ../resize/virt-resize.pod:177
22290 msgid "Then start up the domain with the new, resized disk:"
22294 #: ../resize/virt-resize.pod:179
22297 " # virsh start guestname\n"
22302 #: ../resize/virt-resize.pod:181
22304 "and check that it still works. See also the L</NOTES> section below for "
22305 "additional information."
22309 #: ../resize/virt-resize.pod:184
22310 msgid "7. Resize LVs etc inside the guest"
22314 #: ../resize/virt-resize.pod:186
22315 msgid "(This can also be done offline using L<guestfish(1)>)"
22319 #: ../resize/virt-resize.pod:188
22321 "Once the guest has booted you should see the new space available, at least "
22322 "for filesystems that virt-resize knows how to resize, and for PVs. The user "
22323 "may need to resize LVs inside PVs, and also resize filesystem types that "
22324 "virt-resize does not know how to expand."
22328 #: ../resize/virt-resize.pod:195
22329 msgid "SHRINKING A VIRTUAL MACHINE DISK"
22333 #: ../resize/virt-resize.pod:197
22335 "Shrinking is somewhat more complex than expanding, and only an overview is "
22340 #: ../resize/virt-resize.pod:200
22342 "Firstly virt-resize will not attempt to shrink any partition content (PVs, "
22343 "filesystems). The user has to shrink content before passing the disk image "
22344 "to virt-resize, and virt-resize will check that the content has been shrunk "
22349 #: ../resize/virt-resize.pod:205
22350 msgid "(Shrinking can also be done offline using L<guestfish(1)>)"
22354 #: ../resize/virt-resize.pod:207
22356 "After shrinking PVs and filesystems, shut down the guest, and proceed with "
22357 "steps 3 and 4 above to allocate a new disk image."
22361 #: ../resize/virt-resize.pod:210
22362 msgid "Then run virt-resize with any of the I<--shrink> and/or I<--resize> options."
22366 #: ../resize/virt-resize.pod:213
22367 msgid "IGNORING OR DELETING PARTITIONS"
22371 #: ../resize/virt-resize.pod:215
22373 "virt-resize also gives a convenient way to ignore or delete partitions when "
22374 "copying from the input disk to the output disk. Ignoring a partition speeds "
22375 "up the copy where you don't care about the existing contents of a "
22376 "partition. Deleting a partition removes it completely, but note that it "
22377 "also renumbers any partitions after the one which is deleted, which can "
22378 "leave some guests unbootable."
22382 #: ../resize/virt-resize.pod:222
22383 msgid "QCOW2 AND NON-SPARSE RAW FORMATS"
22387 #: ../resize/virt-resize.pod:224
22389 "If the input disk is in qcow2 format, then you may prefer that the output is "
22390 "in qcow2 format as well. Alternately, virt-resize can convert the format on "
22391 "the fly. The output format is simply determined by the format of the empty "
22392 "output container that you provide. Thus to create qcow2 output, use:"
22396 #: ../resize/virt-resize.pod:230
22399 " qemu-img create [-c] -f qcow2 outdisk [size]\n"
22404 #: ../resize/virt-resize.pod:232
22405 msgid "instead of the truncate command (use I<-c> for a compressed disk)."
22409 #: ../resize/virt-resize.pod:234
22410 msgid "Similarly, to get non-sparse raw output use:"
22414 #: ../resize/virt-resize.pod:236
22417 " fallocate -l size outdisk\n"
22422 #: ../resize/virt-resize.pod:238
22424 "(on older systems that don't have the L<fallocate(1)> command use C<dd "
22425 "if=/dev/zero of=outdisk bs=1M count=..>)"
22429 #: ../resize/virt-resize.pod:247 ../sparsify/virt-sparsify.pod:105
22430 msgid "Display help."
22434 #: ../resize/virt-resize.pod:249
22435 msgid "B<--align-first auto>"
22439 #: ../resize/virt-resize.pod:251
22440 msgid "B<--align-first never>"
22444 #: ../resize/virt-resize.pod:253
22445 msgid "B<--align-first always>"
22449 #: ../resize/virt-resize.pod:255
22451 "Align the first partition for improved performance (see also the "
22452 "I<--alignment> option)."
22456 #: ../resize/virt-resize.pod:258
22458 "The default is I<--align-first auto> which only aligns the first partition "
22459 "if it is safe to do so. That is, only when we know how to fix the "
22460 "bootloader automatically, and at the moment that can only be done for "
22465 #: ../resize/virt-resize.pod:263
22467 "I<--align-first never> means we never move the first partition. This is the "
22468 "safest option. Try this if the guest does not boot after resizing."
22472 #: ../resize/virt-resize.pod:267
22474 "I<--align-first always> means we always align the first partition (if it "
22475 "needs to be aligned). For some guests this will break the bootloader, "
22476 "making the guest unbootable."
22480 #: ../resize/virt-resize.pod:271
22481 msgid "B<--alignment N>"
22485 #: ../resize/virt-resize.pod:273
22487 "Set the alignment of partitions to C<N> sectors. The default in virt-resize "
22488 "E<lt> 1.13.19 was 64 sectors, and after that is 128 sectors."
22492 #: ../resize/virt-resize.pod:277
22494 "Assuming 512 byte sector size inside the guest, here are some suitable "
22499 #: ../resize/virt-resize.pod:282
22500 msgid "I<--alignment 1> (512 bytes)"
22504 #: ../resize/virt-resize.pod:284
22506 "The partitions would be packed together as closely as possible, but would be "
22507 "completely unaligned. In some cases this can cause very poor performance. "
22508 "See L<virt-alignment-scan(1)> for further details."
22512 #: ../resize/virt-resize.pod:288
22513 msgid "I<--alignment 8> (4K)"
22517 #: ../resize/virt-resize.pod:290
22519 "This would be the minimum acceptable alignment for reasonable performance on "
22524 #: ../resize/virt-resize.pod:293
22525 msgid "I<--alignment 128> (64K)"
22529 #: ../resize/virt-resize.pod:295
22531 "This alignment provides good performance when the host is using high end "
22536 #: ../resize/virt-resize.pod:298
22537 msgid "I<--alignment 2048> (1M)"
22541 #: ../resize/virt-resize.pod:300
22543 "This is the standard alignment used by all newly installed guests since "
22548 #: ../resize/virt-resize.pod:305
22553 #: ../resize/virt-resize.pod:307 ../tools/virt-make-fs.pl:177 ../tools/virt-win-reg.pl:120
22558 #: ../resize/virt-resize.pod:309 ../tools/virt-win-reg.pl:122
22559 msgid "Enable debugging messages."
22563 #: ../resize/virt-resize.pod:311
22564 msgid "B<--delete part>"
22568 #: ../resize/virt-resize.pod:313
22570 "Delete the named partition. It would be more accurate to describe this as "
22571 "\"don't copy it over\", since virt-resize doesn't do in-place changes and "
22572 "the original disk image is left intact."
22576 #: ../resize/virt-resize.pod:317
22578 "Note that when you delete a partition, then anything contained in the "
22579 "partition is also deleted. Furthermore, this causes any partitions that "
22580 "come after to be I<renumbered>, which can easily make your guest unbootable."
22584 #: ../resize/virt-resize.pod:322 ../resize/virt-resize.pod:383 ../resize/virt-resize.pod:510 ../sparsify/virt-sparsify.pod:145
22585 msgid "You can give this option multiple times."
22589 #: ../resize/virt-resize.pod:324
22590 msgid "B<--expand part>"
22594 #: ../resize/virt-resize.pod:326
22596 "Expand the named partition so it uses up all extra space (space left over "
22597 "after any other resize changes that you request have been done)."
22601 #: ../resize/virt-resize.pod:329
22603 "If virt-resize knows how, it will expand the direct content of the "
22604 "partition. For example, if the partition is an LVM PV, it will expand the "
22605 "PV to fit (like calling L<pvresize(8)>). Virt-resize leaves any other "
22606 "content it doesn't know about alone."
22610 #: ../resize/virt-resize.pod:334
22611 msgid "Currently virt-resize can resize:"
22615 #: ../resize/virt-resize.pod:340
22616 msgid "ext2, ext3 and ext4 filesystems."
22620 #: ../resize/virt-resize.pod:344
22621 msgid "NTFS filesystems, if libguestfs was compiled with support for NTFS."
22625 #: ../resize/virt-resize.pod:346
22627 "The filesystem must have been shut down consistently last time it was used. "
22628 "Additionally, L<ntfsresize(8)> marks the resized filesystem as requiring a "
22629 "consistency check, so at the first boot after resizing Windows will check "
22634 #: ../resize/virt-resize.pod:353
22636 "LVM PVs (physical volumes). virt-resize does not usually resize anything "
22637 "inside the PV, but see the I<--LV-expand> option. The user could also "
22638 "resize LVs as desired after boot."
22642 #: ../resize/virt-resize.pod:359
22643 msgid "Btrfs filesystems, if libguestfs was compiled with support for btrfs."
22647 #: ../resize/virt-resize.pod:363 ../resize/virt-resize.pod:538
22648 msgid "Note that you cannot use I<--expand> and I<--shrink> together."
22652 #: ../resize/virt-resize.pod:365 ../sparsify/virt-sparsify.pod:125 ../tools/virt-list-filesystems.pl:91 ../tools/virt-list-partitions.pl:92 ../tools/virt-tar.pl:141 ../tools/virt-win-reg.pl:142
22653 msgid "B<--format> raw"
22657 #: ../resize/virt-resize.pod:367 ../sparsify/virt-sparsify.pod:129
22659 "Specify the format of the input disk image. If this flag is not given then "
22660 "it is auto-detected from the image itself."
22664 #: ../resize/virt-resize.pod:373
22666 "Note that this option I<does not> affect the output format. See L</QCOW2 "
22667 "AND NON-SPARSE RAW FORMATS>."
22671 #: ../resize/virt-resize.pod:376
22672 msgid "B<--ignore part>"
22676 #: ../resize/virt-resize.pod:378
22678 "Ignore the named partition. Effectively this means the partition is "
22679 "allocated on the destination disk, but the content is not copied across from "
22680 "the source disk. The content of the partition will be blank (all zero "
22685 #: ../resize/virt-resize.pod:385
22686 msgid "B<--LV-expand logvol>"
22690 #: ../resize/virt-resize.pod:387
22692 "This takes the logical volume and, as a final step, expands it to fill all "
22693 "the space available in its volume group. A typical usage, assuming a Linux "
22694 "guest with a single PV C</dev/sda2> and a root device called "
22695 "C</dev/vg_guest/lv_root> would be:"
22699 #: ../resize/virt-resize.pod:392
22702 " virt-resize indisk outdisk \\\n"
22703 " --expand /dev/sda2 --LV-expand /dev/vg_guest/lv_root\n"
22708 #: ../resize/virt-resize.pod:395
22710 "This would first expand the partition (and PV), and then expand the root "
22711 "device to fill the extra space in the PV."
22715 #: ../resize/virt-resize.pod:398
22717 "The contents of the LV are also resized if virt-resize knows how to do "
22718 "that. You can stop virt-resize from trying to expand the content by using "
22719 "the option I<--no-expand-content>."
22723 #: ../resize/virt-resize.pod:402
22724 msgid "Use L<virt-filesystems(1)> to list the filesystems in the guest."
22728 #: ../resize/virt-resize.pod:404
22730 "You can give this option multiple times, I<but> it doesn't make sense to do "
22731 "this unless the logical volumes you specify are all in different volume "
22736 #: ../resize/virt-resize.pod:408 ../sparsify/virt-sparsify.pod:147
22737 msgid "B<--machine-readable>"
22741 #: ../resize/virt-resize.pod:410 ../sparsify/virt-sparsify.pod:149
22743 "This option is used to make the output more machine friendly when being "
22744 "parsed by other programs. See L</MACHINE READABLE OUTPUT> below."
22748 #: ../resize/virt-resize.pod:416
22749 msgid "B<--dryrun>"
22753 #: ../resize/virt-resize.pod:418
22754 msgid "Print a summary of what would be done, but don't do anything."
22758 #: ../resize/virt-resize.pod:420
22759 msgid "B<--no-copy-boot-loader>"
22763 #: ../resize/virt-resize.pod:422
22765 "By default, virt-resize copies over some sectors at the start of the disk "
22766 "(up to the beginning of the first partition). Commonly these sectors "
22767 "contain the Master Boot Record (MBR) and the boot loader, and are required "
22768 "in order for the guest to boot correctly."
22772 #: ../resize/virt-resize.pod:427
22774 "If you specify this flag, then this initial copy is not done. You may need "
22775 "to reinstall the boot loader in this case."
22779 #: ../resize/virt-resize.pod:430
22780 msgid "B<--no-extra-partition>"
22784 #: ../resize/virt-resize.pod:432
22786 "By default, virt-resize creates an extra partition if there is any extra, "
22787 "unused space after all resizing has happened. Use this option to prevent "
22788 "the extra partition from being created. If you do this then the extra space "
22789 "will be inaccessible until you run fdisk, parted, or some other partitioning "
22790 "tool in the guest."
22794 #: ../resize/virt-resize.pod:438
22796 "Note that if the surplus space is smaller than 10 MB, no extra partition "
22801 #: ../resize/virt-resize.pod:441
22802 msgid "B<--no-expand-content>"
22806 #: ../resize/virt-resize.pod:443
22808 "By default, virt-resize will try to expand the direct contents of "
22809 "partitions, if it knows how (see I<--expand> option above)."
22813 #: ../resize/virt-resize.pod:446
22815 "If you give the I<--no-expand-content> option then virt-resize will not "
22820 #: ../resize/virt-resize.pod:449
22821 msgid "B<--ntfsresize-force>"
22825 #: ../resize/virt-resize.pod:451
22827 "Pass the I<--force> option to L<ntfsresize(8)>, allowing resizing even if "
22828 "the NTFS disk is marked as needing a consistency check. You have to use "
22829 "this option if you want to resize a Windows guest multiple times without "
22830 "booting into Windows between each resize."
22834 #: ../resize/virt-resize.pod:457
22835 msgid "B<--output-format> raw"
22839 #: ../resize/virt-resize.pod:459
22841 "Specify the format of the output disk image. If this flag is not given then "
22842 "it is auto-detected from the image itself."
22846 #: ../resize/virt-resize.pod:465
22848 "Note that this option I<does not create> the output format. This option "
22849 "just tells libguestfs what it is so it doesn't try to guess it. You still "
22850 "need to create the output disk with the right format. See L</QCOW2 AND "
22851 "NON-SPARSE RAW FORMATS>."
22855 #: ../resize/virt-resize.pod:474
22856 msgid "Don't print the summary."
22860 #: ../resize/virt-resize.pod:476
22861 msgid "B<--resize part=size>"
22865 #: ../resize/virt-resize.pod:478
22867 "Resize the named partition (expanding or shrinking it) so that it has the "
22872 #: ../resize/virt-resize.pod:481
22874 "C<size> can be expressed as an absolute number followed by b/K/M/G to mean "
22875 "bytes, Kilobytes, Megabytes, or Gigabytes; or as a percentage of the current "
22876 "size; or as a relative number or percentage. For example:"
22880 #: ../resize/virt-resize.pod:487
22883 " --resize /dev/sda2=10G\n"
22888 #: ../resize/virt-resize.pod:489
22891 " --resize /dev/sda4=90%\n"
22896 #: ../resize/virt-resize.pod:491
22899 " --resize /dev/sda2=+1G\n"
22904 #: ../resize/virt-resize.pod:493
22907 " --resize /dev/sda2=-200M\n"
22912 #: ../resize/virt-resize.pod:495
22915 " --resize /dev/sda1=+128K\n"
22920 #: ../resize/virt-resize.pod:497
22923 " --resize /dev/sda1=+10%\n"
22928 #: ../resize/virt-resize.pod:499
22931 " --resize /dev/sda1=-10%\n"
22936 #: ../resize/virt-resize.pod:501
22938 "You can increase the size of any partition. Virt-resize will expand the "
22939 "direct content of the partition if it knows how (see I<--expand> below)."
22943 #: ../resize/virt-resize.pod:505
22945 "You can only I<decrease> the size of partitions that contain filesystems or "
22946 "PVs which have already been shrunk. Virt-resize will check this has been "
22947 "done before proceeding, or else will print an error (see also "
22948 "I<--resize-force>)."
22952 #: ../resize/virt-resize.pod:512
22953 msgid "B<--resize-force part=size>"
22957 #: ../resize/virt-resize.pod:514
22959 "This is the same as I<--resize> except that it will let you decrease the "
22960 "size of any partition. Generally this means you will lose any data which "
22961 "was at the end of the partition you shrink, but you may not care about that "
22962 "(eg. if shrinking an unused partition, or if you can easily recreate it such "
22963 "as a swap partition)."
22967 #: ../resize/virt-resize.pod:520
22968 msgid "See also the I<--ignore> option."
22972 #: ../resize/virt-resize.pod:522
22973 msgid "B<--shrink part>"
22977 #: ../resize/virt-resize.pod:524
22979 "Shrink the named partition until the overall disk image fits in the "
22980 "destination. The named partition B<must> contain a filesystem or PV which "
22981 "has already been shrunk using another tool (eg. L<guestfish(1)> or other "
22982 "online tools). Virt-resize will check this and give an error if it has not "
22987 #: ../resize/virt-resize.pod:530
22989 "The amount by which the overall disk must be shrunk (after carrying out all "
22990 "other operations requested by the user) is called the \"deficit\". For "
22991 "example, a straight copy (assume no other operations) from a 5GB disk image "
22992 "to a 4GB disk image results in a 1GB deficit. In this case, virt-resize "
22993 "would give an error unless the user specified a partition to shrink and that "
22994 "partition had more than a gigabyte of free space."
22998 #: ../resize/virt-resize.pod:548 ../sparsify/virt-sparsify.pod:177
22999 msgid "MACHINE READABLE OUTPUT"
23003 #: ../resize/virt-resize.pod:550
23005 "The I<--machine-readable> option can be used to make the output more machine "
23006 "friendly, which is useful when calling virt-resize from other programs, GUIs "
23011 #: ../resize/virt-resize.pod:554 ../sparsify/virt-sparsify.pod:183
23012 msgid "There are two ways to use this option."
23016 #: ../resize/virt-resize.pod:556
23018 "Firstly use the option on its own to query the capabilities of the "
23019 "virt-resize binary. Typical output looks like this:"
23023 #: ../resize/virt-resize.pod:559
23026 " $ virt-resize --machine-readable\n"
23028 " ntfsresize-force\n"
23036 #: ../resize/virt-resize.pod:566 ../sparsify/virt-sparsify.pod:193
23038 "A list of features is printed, one per line, and the program exits with "
23043 #: ../resize/virt-resize.pod:569 ../sparsify/virt-sparsify.pod:196
23045 "Secondly use the option in conjunction with other options to make the "
23046 "regular program output more machine friendly."
23050 #: ../resize/virt-resize.pod:572 ../sparsify/virt-sparsify.pod:199
23051 msgid "At the moment this means:"
23055 #: ../resize/virt-resize.pod:578 ../sparsify/virt-sparsify.pod:205
23057 "Progress bar messages can be parsed from stdout by looking for this regular "
23062 #: ../resize/virt-resize.pod:581 ../sparsify/virt-sparsify.pod:208
23065 " ^[0-9]+/[0-9]+$\n"
23070 #: ../resize/virt-resize.pod:585 ../sparsify/virt-sparsify.pod:212
23072 "The calling program should treat messages sent to stdout (except for "
23073 "progress bar messages) as status messages. They can be logged and/or "
23074 "displayed to the user."
23078 #: ../resize/virt-resize.pod:591
23080 "The calling program should treat messages sent to stderr as error messages. "
23081 "In addition, virt-resize exits with a non-zero status code if there was a "
23086 #: ../resize/virt-resize.pod:597
23088 "Versions of the program prior to 1.13.9 did not support the "
23089 "I<--machine-readable> option and will return an error."
23093 #: ../resize/virt-resize.pod:602
23094 msgid "\"Partition 1 does not end on cylinder boundary.\""
23098 #: ../resize/virt-resize.pod:604
23100 "Virt-resize aligns partitions to multiples of 128 sectors (see the "
23101 "I<--alignment> parameter). Usually this means the partitions will not be "
23102 "aligned to the ancient CHS geometry. However CHS geometry is meaningless "
23103 "for disks manufactured since the early 1990s, and doubly so for virtual hard "
23104 "drives. Alignment of partitions to cylinders is not required by any modern "
23105 "operating system."
23109 #: ../resize/virt-resize.pod:611
23110 msgid "RESIZING WINDOWS VIRTUAL MACHINES"
23114 #: ../resize/virt-resize.pod:613
23116 "In Windows Vista and later versions, Microsoft switched to using a separate "
23117 "boot partition. In these VMs, typically C</dev/sda1> is the boot partition "
23118 "and C</dev/sda2> is the main (C:) drive. Resizing the first (boot) "
23119 "partition causes the bootloader to fail with C<0xC0000225> error. Resizing "
23120 "the second partition (ie. C: drive) should work."
23124 #: ../resize/virt-resize.pod:620
23126 "Windows may initiate a lengthy \"chkdsk\" on first boot after a resize, if "
23127 "NTFS partitions have been expanded. This is just a safety check and (unless "
23128 "it find errors) is nothing to worry about."
23132 #: ../resize/virt-resize.pod:624
23133 msgid "GUEST BOOT STUCK AT \"GRUB\""
23137 #: ../resize/virt-resize.pod:626
23139 "If a Linux guest does not boot after resizing, and the boot is stuck after "
23140 "printing C<GRUB> on the console, try reinstalling grub."
23144 #: ../resize/virt-resize.pod:629
23147 " guestfish -i -a newdisk\n"
23148 " ><fs> cat /boot/grub/device.map\n"
23149 " # check the contents of this file are sensible or\n"
23150 " # edit the file if necessary\n"
23151 " ><fs> grub-install / /dev/vda\n"
23157 #: ../resize/virt-resize.pod:636
23159 "For more flexible guest reconfiguration, including if you need to specify "
23160 "other parameters to grub-install, use L<virt-rescue(1)>."
23164 #: ../resize/virt-resize.pod:639
23165 msgid "ALTERNATIVE TOOLS"
23169 #: ../resize/virt-resize.pod:641
23171 "There are several proprietary tools for resizing partitions. We won't "
23172 "mention any here."
23176 #: ../resize/virt-resize.pod:644
23178 "L<parted(8)> and its graphical shell gparted can do some types of resizing "
23179 "operations on disk images. They can resize and move partitions, but I don't "
23180 "think they can do anything with the contents, and they certainly don't "
23185 #: ../resize/virt-resize.pod:649
23187 "L<guestfish(1)> can do everything that virt-resize can do and a lot more, "
23188 "but at a much lower level. You will probably end up hand-calculating sector "
23189 "offsets, which is something that virt-resize was designed to avoid. If you "
23190 "want to see the guestfish-equivalent commands that virt-resize runs, use the "
23195 #: ../resize/virt-resize.pod:669
23197 "L<virt-filesystems(1)>, L<virt-df(1)>, L<guestfs(3)>, L<guestfish(1)>, "
23198 "L<lvm(8)>, L<pvresize(8)>, L<lvresize(8)>, L<resize2fs(8)>, "
23199 "L<ntfsresize(8)>, L<btrfs(8)>, L<virsh(1)>, L<parted(8)>, L<truncate(1)>, "
23200 "L<fallocate(1)>, L<grub(8)>, L<grub-install(8)>, L<virt-rescue(1)>, "
23201 "L<virt-sparsify(1)>, L<virt-alignment-scan(1)>, L<http://libguestfs.org/>."
23205 #: ../ruby/examples/guestfs-ruby.pod:5
23206 msgid "guestfs-ruby - How to use libguestfs from Ruby"
23210 #: ../ruby/examples/guestfs-ruby.pod:9
23213 " require 'guestfs'\n"
23214 " g = Guestfs::Guestfs.new()\n"
23215 " g.add_drive_opts(\"disk.img\",\n"
23216 " :readonly => 1, :format => \"raw\")\n"
23222 #: ../ruby/examples/guestfs-ruby.pod:17
23224 "This manual page documents how to call libguestfs from the Ruby programming "
23225 "language. This page just documents the differences from the C API and gives "
23226 "some examples. If you are not familiar with using libguestfs, you also need "
23227 "to read L<guestfs(3)>."
23231 #: ../ruby/examples/guestfs-ruby.pod:24
23233 "Errors from libguestfs functions are mapped into the C<Error> exception. "
23234 "This has a single parameter which is the error message (a string)."
23238 #: ../ruby/examples/guestfs-ruby.pod:38
23240 "L<guestfs(3)>, L<guestfs-examples(3)>, L<guestfs-erlang(3)>, "
23241 "L<guestfs-java(3)>, L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, "
23242 "L<guestfs-python(3)>, L<guestfs-recipes(1)>, L<http://libguestfs.org/>."
23246 #: ../sparsify/virt-sparsify.pod:5
23247 msgid "virt-sparsify - Make a virtual machine disk sparse"
23251 #: ../sparsify/virt-sparsify.pod:9
23254 " virt-sparsify [--options] indisk outdisk\n"
23259 #: ../sparsify/virt-sparsify.pod:13
23261 "Virt-sparsify is a tool which can make a virtual machine disk (or any disk "
23262 "image) sparse a.k.a. thin-provisioned. This means that free space within "
23263 "the disk image can be converted back to free space on the host."
23267 #: ../sparsify/virt-sparsify.pod:18
23269 "Virt-sparsify can locate and sparsify free space in most filesystems "
23270 "(eg. ext2/3/4, btrfs, NTFS, etc.), and also in LVM physical volumes."
23274 #: ../sparsify/virt-sparsify.pod:21
23276 "Virt-sparsify can also convert between some disk formats, for example "
23277 "converting a raw disk image to a thin-provisioned qcow2 image."
23281 #: ../sparsify/virt-sparsify.pod:24
23283 "Virt-sparsify can operate on any disk image, not just ones from virtual "
23284 "machines. If a virtual machine has more than one attached disk, you must "
23285 "sparsify each one separately."
23289 #: ../sparsify/virt-sparsify.pod:28
23290 msgid "IMPORTANT LIMITATIONS"
23294 #: ../sparsify/virt-sparsify.pod:34
23296 "Virt-sparsify does not do in-place modifications. It copies from a source "
23297 "image to a destination image, leaving the source unchanged. I<Check that "
23298 "the sparsification was successful before deleting the source image>."
23302 #: ../sparsify/virt-sparsify.pod:41
23303 msgid "The virtual machine I<must be shut down> before using this tool."
23307 #: ../sparsify/virt-sparsify.pod:45
23309 "Virt-sparsify may require up to 2x the virtual size of the source disk image "
23310 "(1 temporary copy + 1 destination image). This is in the worst case and "
23311 "usually much less space is required."
23315 #: ../sparsify/virt-sparsify.pod:51
23316 msgid "Virt-sparsify cannot resize disk images. To do that, use L<virt-resize(1)>."
23320 #: ../sparsify/virt-sparsify.pod:56
23321 msgid "Virt-sparsify cannot handle encrypted disks."
23325 #: ../sparsify/virt-sparsify.pod:60
23327 "Virt-sparsify cannot yet sparsify the space between partitions. Note that "
23328 "this space is often used for critical items like bootloaders so it's not "
23333 #: ../sparsify/virt-sparsify.pod:66
23335 "Virt-sparsify does not yet know how to sparsify swapspace. It is not safe "
23336 "to do this unless we can be sure there is no hibernation data, so at the "
23337 "moment swap partitions are ignored."
23341 #: ../sparsify/virt-sparsify.pod:72
23343 "You may also want to read the manual pages for the associated tools "
23344 "L<virt-filesystems(1)> and L<virt-df(1)> before starting."
23348 #: ../sparsify/virt-sparsify.pod:77
23349 msgid "Typical usage is:"
23353 #: ../sparsify/virt-sparsify.pod:79
23356 " virt-sparsify indisk outdisk\n"
23361 #: ../sparsify/virt-sparsify.pod:81
23363 "which copies C<indisk> to C<outdisk>, making the output sparse. C<outdisk> "
23364 "is created, or overwritten if it already exists. The format of the input "
23365 "disk is detected (eg. qcow2) and the same format is used for the output "
23370 #: ../sparsify/virt-sparsify.pod:86
23371 msgid "To convert between formats, use the I<--convert> option:"
23375 #: ../sparsify/virt-sparsify.pod:88
23378 " virt-sparsify disk.raw --convert qcow2 disk.qcow2\n"
23383 #: ../sparsify/virt-sparsify.pod:90
23385 "Virt-sparsify tries to zero and sparsify free space on every filesystem it "
23386 "can find within the source disk image. You can get it to ignore (don't zero "
23387 "free space on) certain filesystems by doing:"
23391 #: ../sparsify/virt-sparsify.pod:94
23394 " virt-sparsify --ignore /dev/sda1 indisk outdisk\n"
23399 #: ../sparsify/virt-sparsify.pod:96
23400 msgid "See L<virt-filesystems(1)> to get a list of filesystems within a disk image."
23404 #: ../sparsify/virt-sparsify.pod:107
23405 msgid "B<--convert> raw"
23409 #: ../sparsify/virt-sparsify.pod:109
23410 msgid "B<--convert> qcow2"
23414 #: ../sparsify/virt-sparsify.pod:111
23415 msgid "B<--convert> [other formats]"
23419 #: ../sparsify/virt-sparsify.pod:113
23421 "Use C<output-format> as the format for the destination image. If this is "
23422 "not specified, then the input format is used."
23426 #: ../sparsify/virt-sparsify.pod:116
23427 msgid "Supported and known-working output formats are: C<raw>, C<qcow2>."
23431 #: ../sparsify/virt-sparsify.pod:118
23433 "You can also use any format supported by the L<qemu-img(1)> program, "
23434 "eg. C<vdi> or C<vmdk>, but support for other formats is reliant on qemu."
23438 #: ../sparsify/virt-sparsify.pod:122
23440 "Specifying the I<--convert> option is usually a good idea, because then "
23441 "virt-sparsify doesn't need to try to guess the input format."
23445 #: ../sparsify/virt-sparsify.pod:127
23446 msgid "B<--format> qcow2"
23450 #: ../sparsify/virt-sparsify.pod:135
23451 msgid "B<--ignore> filesystem"
23455 #: ../sparsify/virt-sparsify.pod:137
23456 msgid "B<--ignore> volgroup"
23460 #: ../sparsify/virt-sparsify.pod:139
23462 "Ignore the named filesystem. Free space on the filesystem will not be "
23463 "zeroed, but existing blocks of zeroes will still be sparsified."
23467 #: ../sparsify/virt-sparsify.pod:142
23469 "In the second form, this ignores the named volume group. Use the volume "
23470 "group name without the C</dev/> prefix, eg. I<--ignore vg_foo>"
23474 #: ../sparsify/virt-sparsify.pod:157
23475 msgid "This disables progress bars and other unnecessary output."
23479 #: ../sparsify/virt-sparsify.pod:179
23481 "The I<--machine-readable> option can be used to make the output more machine "
23482 "friendly, which is useful when calling virt-sparsify from other programs, "
23487 #: ../sparsify/virt-sparsify.pod:185
23489 "Firstly use the option on its own to query the capabilities of the "
23490 "virt-sparsify binary. Typical output looks like this:"
23494 #: ../sparsify/virt-sparsify.pod:188
23497 " $ virt-sparsify --machine-readable\n"
23505 #: ../sparsify/virt-sparsify.pod:218
23507 "The calling program should treat messages sent to stderr as error messages. "
23508 "In addition, virt-sparsify exits with a non-zero status code if there was a "
23513 #: ../sparsify/virt-sparsify.pod:224
23515 "All versions of virt-sparsify have supported the I<--machine-readable> "
23520 #: ../sparsify/virt-sparsify.pod:238
23522 "Location of the temporary directory used for the potentially large temporary "
23527 #: ../sparsify/virt-sparsify.pod:241
23529 "You should ensure there is enough free space in the worst case for a full "
23530 "copy of the source disk (I<virtual> size), or else set C<$TMPDIR> to point "
23531 "to another directory that has enough space."
23535 #: ../sparsify/virt-sparsify.pod:245
23536 msgid "This defaults to C</tmp>."
23540 #: ../sparsify/virt-sparsify.pod:249
23541 msgid "For other environment variables, see L<guestfs(3)/ENVIRONMENT VARIABLES>."
23545 #: ../sparsify/virt-sparsify.pod:253
23547 "L<virt-filesystems(1)>, L<virt-df(1)>, L<virt-resize(1)>, L<virt-rescue(1)>, "
23548 "L<guestfs(3)>, L<guestfish(1)>, L<truncate(1)>, L<fallocate(1)>, "
23549 "L<qemu-img(1)>, L<http://libguestfs.org/>."
23553 #: ../src/guestfs-actions.pod:1
23554 msgid "guestfs_add_cdrom"
23558 #: ../src/guestfs-actions.pod:3
23562 " guestfs_add_cdrom (guestfs_h *g,\n"
23563 " const char *filename);\n"
23568 #: ../src/guestfs-actions.pod:7 ../src/guestfs-actions.pod:255 ../src/guestfs-actions.pod:276
23570 "I<This function is deprecated.> In new code, use the "
23571 "L</guestfs_add_drive_opts> call instead."
23575 #: ../src/guestfs-actions.pod:24
23577 "This call checks for the existence of C<filename>. This stops you from "
23578 "specifying other types of drive which are supported by qemu such as C<nbd:> "
23579 "and C<http:> URLs. To specify those, use the general C<guestfs_config> call "
23584 #: ../src/guestfs-actions.pod:31
23586 "If you just want to add an ISO file (often you use this as an efficient way "
23587 "to transfer large files into the guest), then you should probably use "
23588 "C<guestfs_add_drive_ro> instead."
23592 #: ../src/guestfs-actions.pod:37 ../src/guestfs-actions.pod:140 ../src/guestfs-actions.pod:207 ../src/guestfs-actions.pod:244 ../src/guestfs-actions.pod:265 ../src/guestfs-actions.pod:286 ../src/guestfs-actions.pod:299 ../src/guestfs-actions.pod:313 ../src/guestfs-actions.pod:433 ../src/guestfs-actions.pod:453 ../src/guestfs-actions.pod:467 ../src/guestfs-actions.pod:512 ../src/guestfs-actions.pod:540 ../src/guestfs-actions.pod:558 ../src/guestfs-actions.pod:625 ../src/guestfs-actions.pod:658 ../src/guestfs-actions.pod:672 ../src/guestfs-actions.pod:687 ../src/guestfs-actions.pod:786 ../src/guestfs-actions.pod:804 ../src/guestfs-actions.pod:818 ../src/guestfs-actions.pod:832 ../src/guestfs-actions.pod:869 ../src/guestfs-actions.pod:1052 ../src/guestfs-actions.pod:1072 ../src/guestfs-actions.pod:1090 ../src/guestfs-actions.pod:1180 ../src/guestfs-actions.pod:1239 ../src/guestfs-actions.pod:1285 ../src/guestfs-actions.pod:1303 ../src/guestfs-actions.pod:1322 ../src/guestfs-actions.pod:1336 ../src/guestfs-actions.pod:1356 ../src/guestfs-actions.pod:1426 ../src/guestfs-actions.pod:1457 ../src/guestfs-actions.pod:1482 ../src/guestfs-actions.pod:1524 ../src/guestfs-actions.pod:1637 ../src/guestfs-actions.pod:1664 ../src/guestfs-actions.pod:1879 ../src/guestfs-actions.pod:1901 ../src/guestfs-actions.pod:1988 ../src/guestfs-actions.pod:2496 ../src/guestfs-actions.pod:2640 ../src/guestfs-actions.pod:2701 ../src/guestfs-actions.pod:2736 ../src/guestfs-actions.pod:3793 ../src/guestfs-actions.pod:3808 ../src/guestfs-actions.pod:3833 ../src/guestfs-actions.pod:4022 ../src/guestfs-actions.pod:4036 ../src/guestfs-actions.pod:4049 ../src/guestfs-actions.pod:4063 ../src/guestfs-actions.pod:4078 ../src/guestfs-actions.pod:4114 ../src/guestfs-actions.pod:4186 ../src/guestfs-actions.pod:4206 ../src/guestfs-actions.pod:4223 ../src/guestfs-actions.pod:4246 ../src/guestfs-actions.pod:4269 ../src/guestfs-actions.pod:4304 ../src/guestfs-actions.pod:4323 ../src/guestfs-actions.pod:4342 ../src/guestfs-actions.pod:4377 ../src/guestfs-actions.pod:4389 ../src/guestfs-actions.pod:4425 ../src/guestfs-actions.pod:4441 ../src/guestfs-actions.pod:4454 ../src/guestfs-actions.pod:4469 ../src/guestfs-actions.pod:4486 ../src/guestfs-actions.pod:4579 ../src/guestfs-actions.pod:4599 ../src/guestfs-actions.pod:4612 ../src/guestfs-actions.pod:4663 ../src/guestfs-actions.pod:4681 ../src/guestfs-actions.pod:4699 ../src/guestfs-actions.pod:4715 ../src/guestfs-actions.pod:4729 ../src/guestfs-actions.pod:4743 ../src/guestfs-actions.pod:4760 ../src/guestfs-actions.pod:4775 ../src/guestfs-actions.pod:4802 ../src/guestfs-actions.pod:4865 ../src/guestfs-actions.pod:4938 ../src/guestfs-actions.pod:4969 ../src/guestfs-actions.pod:4988 ../src/guestfs-actions.pod:5007 ../src/guestfs-actions.pod:5019 ../src/guestfs-actions.pod:5036 ../src/guestfs-actions.pod:5049 ../src/guestfs-actions.pod:5064 ../src/guestfs-actions.pod:5079 ../src/guestfs-actions.pod:5111 ../src/guestfs-actions.pod:5137 ../src/guestfs-actions.pod:5176 ../src/guestfs-actions.pod:5196 ../src/guestfs-actions.pod:5210 ../src/guestfs-actions.pod:5227 ../src/guestfs-actions.pod:5276 ../src/guestfs-actions.pod:5329 ../src/guestfs-actions.pod:5376 ../src/guestfs-actions.pod:5419 ../src/guestfs-actions.pod:5447 ../src/guestfs-actions.pod:5464 ../src/guestfs-actions.pod:5482 ../src/guestfs-actions.pod:5622 ../src/guestfs-actions.pod:5679 ../src/guestfs-actions.pod:5701 ../src/guestfs-actions.pod:5719 ../src/guestfs-actions.pod:5751 ../src/guestfs-actions.pod:5817 ../src/guestfs-actions.pod:5834 ../src/guestfs-actions.pod:5847 ../src/guestfs-actions.pod:5861 ../src/guestfs-actions.pod:6150 ../src/guestfs-actions.pod:6169 ../src/guestfs-actions.pod:6188 ../src/guestfs-actions.pod:6202 ../src/guestfs-actions.pod:6214 ../src/guestfs-actions.pod:6228 ../src/guestfs-actions.pod:6240 ../src/guestfs-actions.pod:6254 ../src/guestfs-actions.pod:6270 ../src/guestfs-actions.pod:6291 ../src/guestfs-actions.pod:6310 ../src/guestfs-actions.pod:6329 ../src/guestfs-actions.pod:6359 ../src/guestfs-actions.pod:6377 ../src/guestfs-actions.pod:6400 ../src/guestfs-actions.pod:6418 ../src/guestfs-actions.pod:6437 ../src/guestfs-actions.pod:6458 ../src/guestfs-actions.pod:6477 ../src/guestfs-actions.pod:6494 ../src/guestfs-actions.pod:6513 ../src/guestfs-actions.pod:6541 ../src/guestfs-actions.pod:6565 ../src/guestfs-actions.pod:6584 ../src/guestfs-actions.pod:6600 ../src/guestfs-actions.pod:6624 ../src/guestfs-actions.pod:6643 ../src/guestfs-actions.pod:6658 ../src/guestfs-actions.pod:6677 ../src/guestfs-actions.pod:6721 ../src/guestfs-actions.pod:6751 ../src/guestfs-actions.pod:6784 ../src/guestfs-actions.pod:6899 ../src/guestfs-actions.pod:7020 ../src/guestfs-actions.pod:7032 ../src/guestfs-actions.pod:7045 ../src/guestfs-actions.pod:7058 ../src/guestfs-actions.pod:7080 ../src/guestfs-actions.pod:7093 ../src/guestfs-actions.pod:7106 ../src/guestfs-actions.pod:7119 ../src/guestfs-actions.pod:7134 ../src/guestfs-actions.pod:7193 ../src/guestfs-actions.pod:7210 ../src/guestfs-actions.pod:7226 ../src/guestfs-actions.pod:7242 ../src/guestfs-actions.pod:7259 ../src/guestfs-actions.pod:7272 ../src/guestfs-actions.pod:7292 ../src/guestfs-actions.pod:7328 ../src/guestfs-actions.pod:7342 ../src/guestfs-actions.pod:7383 ../src/guestfs-actions.pod:7396 ../src/guestfs-actions.pod:7414 ../src/guestfs-actions.pod:7448 ../src/guestfs-actions.pod:7484 ../src/guestfs-actions.pod:7600 ../src/guestfs-actions.pod:7615 ../src/guestfs-actions.pod:7629 ../src/guestfs-actions.pod:7684 ../src/guestfs-actions.pod:7697 ../src/guestfs-actions.pod:7742 ../src/guestfs-actions.pod:7782 ../src/guestfs-actions.pod:7838 ../src/guestfs-actions.pod:7858 ../src/guestfs-actions.pod:7891 ../src/guestfs-actions.pod:7955 ../src/guestfs-actions.pod:7978 ../src/guestfs-actions.pod:8007
23593 msgid "This function returns 0 on success or -1 on error."
23597 #: ../src/guestfs-actions.pod:39 ../src/guestfs-actions.pod:142 ../src/guestfs-actions.pod:1287 ../src/guestfs-actions.pod:2102 ../src/guestfs-actions.pod:2200 ../src/guestfs-actions.pod:2325 ../src/guestfs-actions.pod:3795 ../src/guestfs-actions.pod:3815 ../src/guestfs-actions.pod:5113 ../src/guestfs-actions.pod:6379 ../src/guestfs-actions.pod:6496 ../src/guestfs-actions.pod:6645 ../src/guestfs-actions.pod:7136 ../src/guestfs-actions.pod:7261 ../src/guestfs-actions.pod:7784
23598 msgid "(Added in 0.3)"
23602 #: ../src/guestfs-actions.pod:41
23603 msgid "guestfs_add_domain"
23607 #: ../src/guestfs-actions.pod:43
23611 " guestfs_add_domain (guestfs_h *g,\n"
23612 " const char *dom,\n"
23618 #: ../src/guestfs-actions.pod:48 ../src/guestfs-actions.pod:151 ../src/guestfs-actions.pod:843 ../src/guestfs-actions.pod:1167 ../src/guestfs-actions.pod:1219 ../src/guestfs-actions.pod:2993 ../src/guestfs-actions.pod:4814 ../src/guestfs-actions.pod:5123 ../src/guestfs-actions.pod:5340
23620 "You may supply a list of optional arguments to this call. Use zero or more "
23621 "of the following pairs of parameters, and terminate the list with C<-1> on "
23622 "its own. See L</CALLS WITH OPTIONAL ARGUMENTS>."
23626 #: ../src/guestfs-actions.pod:53
23629 " GUESTFS_ADD_DOMAIN_LIBVIRTURI, const char *libvirturi,\n"
23630 " GUESTFS_ADD_DOMAIN_READONLY, int readonly,\n"
23631 " GUESTFS_ADD_DOMAIN_IFACE, const char *iface,\n"
23632 " GUESTFS_ADD_DOMAIN_LIVE, int live,\n"
23633 " GUESTFS_ADD_DOMAIN_ALLOWUUID, int allowuuid,\n"
23638 #: ../src/guestfs-actions.pod:59
23640 "This function adds the disk(s) attached to the named libvirt domain C<dom>. "
23641 "It works by connecting to libvirt, requesting the domain and domain XML from "
23642 "libvirt, parsing it for disks, and calling C<guestfs_add_drive_opts> on each "
23647 #: ../src/guestfs-actions.pod:94
23649 "The other optional parameters are passed directly through to "
23650 "C<guestfs_add_drive_opts>."
23654 #: ../src/guestfs-actions.pod:97 ../src/guestfs-actions.pod:356 ../src/guestfs-actions.pod:526 ../src/guestfs-actions.pod:704 ../src/guestfs-actions.pod:735 ../src/guestfs-actions.pod:753 ../src/guestfs-actions.pod:772 ../src/guestfs-actions.pod:1502 ../src/guestfs-actions.pod:1858 ../src/guestfs-actions.pod:2061 ../src/guestfs-actions.pod:2172 ../src/guestfs-actions.pod:2223 ../src/guestfs-actions.pod:2275 ../src/guestfs-actions.pod:2289 ../src/guestfs-actions.pod:2312 ../src/guestfs-actions.pod:2627 ../src/guestfs-actions.pod:3111 ../src/guestfs-actions.pod:3129 ../src/guestfs-actions.pod:5299 ../src/guestfs-actions.pod:5519 ../src/guestfs-actions.pod:5931 ../src/guestfs-actions.pod:5957 ../src/guestfs-actions.pod:7369 ../src/guestfs-actions.pod:7795 ../src/guestfs-actions.pod:7808 ../src/guestfs-actions.pod:7821
23655 msgid "On error this function returns -1."
23659 #: ../src/guestfs-actions.pod:99
23660 msgid "(Added in 1.7.4)"
23664 #: ../src/guestfs-actions.pod:101
23665 msgid "guestfs_add_domain_va"
23669 #: ../src/guestfs-actions.pod:103
23673 " guestfs_add_domain_va (guestfs_h *g,\n"
23674 " const char *dom,\n"
23675 " va_list args);\n"
23680 #: ../src/guestfs-actions.pod:108
23681 msgid "This is the \"va_list variant\" of L</guestfs_add_domain>."
23685 #: ../src/guestfs-actions.pod:110 ../src/guestfs-actions.pod:121 ../src/guestfs-actions.pod:220 ../src/guestfs-actions.pod:231 ../src/guestfs-actions.pod:882 ../src/guestfs-actions.pod:893 ../src/guestfs-actions.pod:1195 ../src/guestfs-actions.pod:1208 ../src/guestfs-actions.pod:1254 ../src/guestfs-actions.pod:1267 ../src/guestfs-actions.pod:3077 ../src/guestfs-actions.pod:3089 ../src/guestfs-actions.pod:4879 ../src/guestfs-actions.pod:4891 ../src/guestfs-actions.pod:5151 ../src/guestfs-actions.pod:5163 ../src/guestfs-actions.pod:5389 ../src/guestfs-actions.pod:5400
23686 msgid "See L</CALLS WITH OPTIONAL ARGUMENTS>."
23690 #: ../src/guestfs-actions.pod:112
23691 msgid "guestfs_add_domain_argv"
23695 #: ../src/guestfs-actions.pod:114
23699 " guestfs_add_domain_argv (guestfs_h *g,\n"
23700 " const char *dom,\n"
23701 " const struct guestfs_add_domain_argv *optargs);\n"
23706 #: ../src/guestfs-actions.pod:119
23707 msgid "This is the \"argv variant\" of L</guestfs_add_domain>."
23711 #: ../src/guestfs-actions.pod:123
23712 msgid "guestfs_add_drive"
23716 #: ../src/guestfs-actions.pod:125
23720 " guestfs_add_drive (guestfs_h *g,\n"
23721 " const char *filename);\n"
23726 #: ../src/guestfs-actions.pod:129
23728 "This function is the equivalent of calling C<guestfs_add_drive_opts> with no "
23729 "optional parameters, so the disk is added writable, with the format being "
23730 "detected automatically."
23734 #: ../src/guestfs-actions.pod:133
23736 "Automatic detection of the format opens you up to a potential security hole "
23737 "when dealing with untrusted raw-format images. See CVE-2010-3851 and "
23738 "RHBZ#642934. Specifying the format closes this security hole. Therefore "
23739 "you should think about replacing calls to this function with calls to "
23740 "C<guestfs_add_drive_opts>, and specifying the format."
23744 #: ../src/guestfs-actions.pod:144
23745 msgid "guestfs_add_drive_opts"
23749 #: ../src/guestfs-actions.pod:146
23753 " guestfs_add_drive_opts (guestfs_h *g,\n"
23754 " const char *filename,\n"
23760 #: ../src/guestfs-actions.pod:156
23763 " GUESTFS_ADD_DRIVE_OPTS_READONLY, int readonly,\n"
23764 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, const char *format,\n"
23765 " GUESTFS_ADD_DRIVE_OPTS_IFACE, const char *iface,\n"
23766 " GUESTFS_ADD_DRIVE_OPTS_NAME, const char *name,\n"
23771 #: ../src/guestfs-actions.pod:186
23773 "This forces the image format. If you omit this (or use C<guestfs_add_drive> "
23774 "or C<guestfs_add_drive_ro>) then the format is automatically detected. "
23775 "Possible formats include C<raw> and C<qcow2>."
23779 #: ../src/guestfs-actions.pod:197
23781 "This rarely-used option lets you emulate the behaviour of the deprecated "
23782 "C<guestfs_add_drive_with_if> call (q.v.)"
23786 #: ../src/guestfs-actions.pod:209
23787 msgid "(Added in 1.5.23)"
23791 #: ../src/guestfs-actions.pod:211
23792 msgid "guestfs_add_drive_opts_va"
23796 #: ../src/guestfs-actions.pod:213
23800 " guestfs_add_drive_opts_va (guestfs_h *g,\n"
23801 " const char *filename,\n"
23802 " va_list args);\n"
23807 #: ../src/guestfs-actions.pod:218
23808 msgid "This is the \"va_list variant\" of L</guestfs_add_drive_opts>."
23812 #: ../src/guestfs-actions.pod:222
23813 msgid "guestfs_add_drive_opts_argv"
23817 #: ../src/guestfs-actions.pod:224
23821 " guestfs_add_drive_opts_argv (guestfs_h *g,\n"
23822 " const char *filename,\n"
23823 " const struct guestfs_add_drive_opts_argv "
23829 #: ../src/guestfs-actions.pod:229
23830 msgid "This is the \"argv variant\" of L</guestfs_add_drive_opts>."
23834 #: ../src/guestfs-actions.pod:233
23835 msgid "guestfs_add_drive_ro"
23839 #: ../src/guestfs-actions.pod:235
23843 " guestfs_add_drive_ro (guestfs_h *g,\n"
23844 " const char *filename);\n"
23849 #: ../src/guestfs-actions.pod:239
23851 "This function is the equivalent of calling C<guestfs_add_drive_opts> with "
23852 "the optional parameter C<GUESTFS_ADD_DRIVE_OPTS_READONLY> set to 1, so the "
23853 "disk is added read-only, with the format being detected automatically."
23857 #: ../src/guestfs-actions.pod:246
23858 msgid "(Added in 1.0.38)"
23862 #: ../src/guestfs-actions.pod:248
23863 msgid "guestfs_add_drive_ro_with_if"
23867 #: ../src/guestfs-actions.pod:250
23871 " guestfs_add_drive_ro_with_if (guestfs_h *g,\n"
23872 " const char *filename,\n"
23873 " const char *iface);\n"
23878 #: ../src/guestfs-actions.pod:262
23880 "This is the same as C<guestfs_add_drive_ro> but it allows you to specify the "
23881 "QEMU interface emulation to use at run time."
23885 #: ../src/guestfs-actions.pod:267 ../src/guestfs-actions.pod:288 ../src/guestfs-actions.pod:2586
23886 msgid "(Added in 1.0.84)"
23890 #: ../src/guestfs-actions.pod:269
23891 msgid "guestfs_add_drive_with_if"
23895 #: ../src/guestfs-actions.pod:271
23899 " guestfs_add_drive_with_if (guestfs_h *g,\n"
23900 " const char *filename,\n"
23901 " const char *iface);\n"
23906 #: ../src/guestfs-actions.pod:283
23908 "This is the same as C<guestfs_add_drive> but it allows you to specify the "
23909 "QEMU interface emulation to use at run time."
23913 #: ../src/guestfs-actions.pod:290
23914 msgid "guestfs_aug_clear"
23918 #: ../src/guestfs-actions.pod:292
23922 " guestfs_aug_clear (guestfs_h *g,\n"
23923 " const char *augpath);\n"
23928 #: ../src/guestfs-actions.pod:301 ../src/guestfs-actions.pod:2314
23929 msgid "(Added in 1.3.4)"
23933 #: ../src/guestfs-actions.pod:303
23934 msgid "guestfs_aug_close"
23938 #: ../src/guestfs-actions.pod:305
23942 " guestfs_aug_close (guestfs_h *g);\n"
23947 #: ../src/guestfs-actions.pod:308
23949 "Close the current Augeas handle and free up any resources used by it. After "
23950 "calling this, you have to call C<guestfs_aug_init> again before you can use "
23951 "any other Augeas functions."
23955 #: ../src/guestfs-actions.pod:315 ../src/guestfs-actions.pod:340 ../src/guestfs-actions.pod:358 ../src/guestfs-actions.pod:372 ../src/guestfs-actions.pod:435 ../src/guestfs-actions.pod:455 ../src/guestfs-actions.pod:469 ../src/guestfs-actions.pod:500 ../src/guestfs-actions.pod:514 ../src/guestfs-actions.pod:528 ../src/guestfs-actions.pod:542 ../src/guestfs-actions.pod:560 ../src/guestfs-actions.pod:6008
23956 msgid "(Added in 0.7)"
23960 #: ../src/guestfs-actions.pod:317
23961 msgid "guestfs_aug_defnode"
23965 #: ../src/guestfs-actions.pod:319
23968 " struct guestfs_int_bool *\n"
23969 " guestfs_aug_defnode (guestfs_h *g,\n"
23970 " const char *name,\n"
23971 " const char *expr,\n"
23972 " const char *val);\n"
23977 #: ../src/guestfs-actions.pod:328
23979 "If C<expr> evaluates to an empty nodeset, a node is created, equivalent to "
23980 "calling C<guestfs_aug_set> C<expr>, C<value>. C<name> will be the nodeset "
23981 "containing that single node."
23985 #: ../src/guestfs-actions.pod:336
23987 "This function returns a C<struct guestfs_int_bool *>, or NULL if there was "
23988 "an error. I<The caller must call C<guestfs_free_int_bool> after use>."
23992 #: ../src/guestfs-actions.pod:342
23993 msgid "guestfs_aug_defvar"
23997 #: ../src/guestfs-actions.pod:344
24001 " guestfs_aug_defvar (guestfs_h *g,\n"
24002 " const char *name,\n"
24003 " const char *expr);\n"
24008 #: ../src/guestfs-actions.pod:360
24009 msgid "guestfs_aug_get"
24013 #: ../src/guestfs-actions.pod:362
24017 " guestfs_aug_get (guestfs_h *g,\n"
24018 " const char *augpath);\n"
24023 #: ../src/guestfs-actions.pod:369 ../src/guestfs-actions.pod:933 ../src/guestfs-actions.pod:951 ../src/guestfs-actions.pod:1011 ../src/guestfs-actions.pod:1027 ../src/guestfs-actions.pod:1130 ../src/guestfs-actions.pod:1371 ../src/guestfs-actions.pod:1388 ../src/guestfs-actions.pod:1407 ../src/guestfs-actions.pod:1541 ../src/guestfs-actions.pod:1729 ../src/guestfs-actions.pod:1841 ../src/guestfs-actions.pod:2004 ../src/guestfs-actions.pod:2021 ../src/guestfs-actions.pod:2088 ../src/guestfs-actions.pod:2131 ../src/guestfs-actions.pod:2152 ../src/guestfs-actions.pod:2337 ../src/guestfs-actions.pod:2551 ../src/guestfs-actions.pod:2755 ../src/guestfs-actions.pod:2857 ../src/guestfs-actions.pod:2961 ../src/guestfs-actions.pod:2980 ../src/guestfs-actions.pod:3195 ../src/guestfs-actions.pod:3223 ../src/guestfs-actions.pod:3244 ../src/guestfs-actions.pod:3278 ../src/guestfs-actions.pod:3341 ../src/guestfs-actions.pod:3361 ../src/guestfs-actions.pod:3381 ../src/guestfs-actions.pod:4008 ../src/guestfs-actions.pod:4361 ../src/guestfs-actions.pod:4531 ../src/guestfs-actions.pod:4641 ../src/guestfs-actions.pod:5537 ../src/guestfs-actions.pod:5736 ../src/guestfs-actions.pod:5906 ../src/guestfs-actions.pod:6084 ../src/guestfs-actions.pod:6133 ../src/guestfs-actions.pod:6805 ../src/guestfs-actions.pod:6821 ../src/guestfs-actions.pod:6845 ../src/guestfs-actions.pod:6869 ../src/guestfs-actions.pod:7543 ../src/guestfs-actions.pod:7562 ../src/guestfs-actions.pod:7580 ../src/guestfs-actions.pod:7754 ../src/guestfs-actions.pod:8071
24025 "This function returns a string, or NULL on error. I<The caller must free "
24026 "the returned string after use>."
24030 #: ../src/guestfs-actions.pod:374
24031 msgid "guestfs_aug_init"
24035 #: ../src/guestfs-actions.pod:376
24039 " guestfs_aug_init (guestfs_h *g,\n"
24040 " const char *root,\n"
24046 #: ../src/guestfs-actions.pod:385
24047 msgid "You must call this before using any other C<guestfs_aug_*> commands."
24051 #: ../src/guestfs-actions.pod:410
24053 "This option is only useful when debugging Augeas lenses. Use of this option "
24054 "may require additional memory for the libguestfs appliance. You may need to "
24055 "set the C<LIBGUESTFS_MEMSIZE> environment variable or call "
24056 "C<guestfs_set_memsize>."
24060 #: ../src/guestfs-actions.pod:425
24061 msgid "Do not load the tree in C<guestfs_aug_init>."
24065 #: ../src/guestfs-actions.pod:429
24066 msgid "To close the handle, you can call C<guestfs_aug_close>."
24070 #: ../src/guestfs-actions.pod:437
24071 msgid "guestfs_aug_insert"
24075 #: ../src/guestfs-actions.pod:439
24079 " guestfs_aug_insert (guestfs_h *g,\n"
24080 " const char *augpath,\n"
24081 " const char *label,\n"
24087 #: ../src/guestfs-actions.pod:457
24088 msgid "guestfs_aug_load"
24092 #: ../src/guestfs-actions.pod:459
24096 " guestfs_aug_load (guestfs_h *g);\n"
24101 #: ../src/guestfs-actions.pod:471
24102 msgid "guestfs_aug_ls"
24106 #: ../src/guestfs-actions.pod:473
24110 " guestfs_aug_ls (guestfs_h *g,\n"
24111 " const char *augpath);\n"
24116 #: ../src/guestfs-actions.pod:477
24118 "This is just a shortcut for listing C<guestfs_aug_match> C<path/*> and "
24119 "sorting the resulting nodes into alphabetical order."
24123 #: ../src/guestfs-actions.pod:480 ../src/guestfs-actions.pod:496 ../src/guestfs-actions.pod:642 ../src/guestfs-actions.pod:1149 ../src/guestfs-actions.pod:1556 ../src/guestfs-actions.pod:1575 ../src/guestfs-actions.pod:1678 ../src/guestfs-actions.pod:1697 ../src/guestfs-actions.pod:1943 ../src/guestfs-actions.pod:2409 ../src/guestfs-actions.pod:2425 ../src/guestfs-actions.pod:2444 ../src/guestfs-actions.pod:2509 ../src/guestfs-actions.pod:2533 ../src/guestfs-actions.pod:2604 ../src/guestfs-actions.pod:2653 ../src/guestfs-actions.pod:2922 ../src/guestfs-actions.pod:3297 ../src/guestfs-actions.pod:3577 ../src/guestfs-actions.pod:3891 ../src/guestfs-actions.pod:3908 ../src/guestfs-actions.pod:3928 ../src/guestfs-actions.pod:3990 ../src/guestfs-actions.pod:4095 ../src/guestfs-actions.pod:4503 ../src/guestfs-actions.pod:5260 ../src/guestfs-actions.pod:5878 ../src/guestfs-actions.pod:6004 ../src/guestfs-actions.pod:6118 ../src/guestfs-actions.pod:6885 ../src/guestfs-actions.pod:6946 ../src/guestfs-actions.pod:7001 ../src/guestfs-actions.pod:7147 ../src/guestfs-actions.pod:7171 ../src/guestfs-actions.pod:7647 ../src/guestfs-actions.pod:7667 ../src/guestfs-actions.pod:7714 ../src/guestfs-actions.pod:7908 ../src/guestfs-actions.pod:7927 ../src/guestfs-actions.pod:8021 ../src/guestfs-actions.pod:8040 ../src/guestfs-actions.pod:8086 ../src/guestfs-actions.pod:8105
24125 "This function returns a NULL-terminated array of strings (like "
24126 "L<environ(3)>), or NULL if there was an error. I<The caller must free the "
24127 "strings and the array after use>."
24131 #: ../src/guestfs-actions.pod:484 ../src/guestfs-actions.pod:1074 ../src/guestfs-actions.pod:1092 ../src/guestfs-actions.pod:1613 ../src/guestfs-actions.pod:3655 ../src/guestfs-actions.pod:3686 ../src/guestfs-actions.pod:4344 ../src/guestfs-actions.pod:4394 ../src/guestfs-actions.pod:4581 ../src/guestfs-actions.pod:4614 ../src/guestfs-actions.pod:4777 ../src/guestfs-actions.pod:5264 ../src/guestfs-actions.pod:5819 ../src/guestfs-actions.pod:6216 ../src/guestfs-actions.pod:6230 ../src/guestfs-actions.pod:6242 ../src/guestfs-actions.pod:6726 ../src/guestfs-actions.pod:7385 ../src/guestfs-actions.pod:7398 ../src/guestfs-actions.pod:7631 ../src/guestfs-actions.pod:7896
24132 msgid "(Added in 0.8)"
24136 #: ../src/guestfs-actions.pod:486
24137 msgid "guestfs_aug_match"
24141 #: ../src/guestfs-actions.pod:488
24145 " guestfs_aug_match (guestfs_h *g,\n"
24146 " const char *augpath);\n"
24151 #: ../src/guestfs-actions.pod:502
24152 msgid "guestfs_aug_mv"
24156 #: ../src/guestfs-actions.pod:504
24160 " guestfs_aug_mv (guestfs_h *g,\n"
24161 " const char *src,\n"
24162 " const char *dest);\n"
24167 #: ../src/guestfs-actions.pod:516
24168 msgid "guestfs_aug_rm"
24172 #: ../src/guestfs-actions.pod:518
24176 " guestfs_aug_rm (guestfs_h *g,\n"
24177 " const char *augpath);\n"
24182 #: ../src/guestfs-actions.pod:530
24183 msgid "guestfs_aug_save"
24187 #: ../src/guestfs-actions.pod:532
24191 " guestfs_aug_save (guestfs_h *g);\n"
24196 #: ../src/guestfs-actions.pod:537
24198 "The flags which were passed to C<guestfs_aug_init> affect exactly how files "
24203 #: ../src/guestfs-actions.pod:544
24204 msgid "guestfs_aug_set"
24208 #: ../src/guestfs-actions.pod:546
24212 " guestfs_aug_set (guestfs_h *g,\n"
24213 " const char *augpath,\n"
24214 " const char *val);\n"
24219 #: ../src/guestfs-actions.pod:553
24221 "In the Augeas API, it is possible to clear a node by setting the value to "
24222 "NULL. Due to an oversight in the libguestfs API you cannot do that with "
24223 "this call. Instead you must use the C<guestfs_aug_clear> call."
24227 #: ../src/guestfs-actions.pod:562
24228 msgid "guestfs_available"
24232 #: ../src/guestfs-actions.pod:564
24236 " guestfs_available (guestfs_h *g,\n"
24237 " char *const *groups);\n"
24242 #: ../src/guestfs-actions.pod:572
24244 "The libguestfs groups, and the functions that those groups correspond to, "
24245 "are listed in L<guestfs(3)/AVAILABILITY>. You can also fetch this list at "
24246 "runtime by calling C<guestfs_available_all_groups>."
24250 #: ../src/guestfs-actions.pod:596
24251 msgid "You must call C<guestfs_launch> before calling this function."
24255 #: ../src/guestfs-actions.pod:618
24257 "This call was added in version C<1.0.80>. In previous versions of "
24258 "libguestfs all you could do would be to speculatively execute a command to "
24259 "find out if the daemon implemented it. See also C<guestfs_version>."
24263 #: ../src/guestfs-actions.pod:627 ../src/guestfs-actions.pod:1358
24264 msgid "(Added in 1.0.80)"
24268 #: ../src/guestfs-actions.pod:629
24269 msgid "guestfs_available_all_groups"
24273 #: ../src/guestfs-actions.pod:631
24277 " guestfs_available_all_groups (guestfs_h *g);\n"
24282 #: ../src/guestfs-actions.pod:634
24284 "This command returns a list of all optional groups that this daemon knows "
24285 "about. Note this returns both supported and unsupported groups. To find "
24286 "out which ones the daemon can actually support you have to call "
24287 "C<guestfs_available> on each member of the returned list."
24291 #: ../src/guestfs-actions.pod:640
24292 msgid "See also C<guestfs_available> and L<guestfs(3)/AVAILABILITY>."
24296 #: ../src/guestfs-actions.pod:646
24297 msgid "(Added in 1.3.15)"
24301 #: ../src/guestfs-actions.pod:648
24302 msgid "guestfs_base64_in"
24306 #: ../src/guestfs-actions.pod:650
24310 " guestfs_base64_in (guestfs_h *g,\n"
24311 " const char *base64file,\n"
24312 " const char *filename);\n"
24317 #: ../src/guestfs-actions.pod:660 ../src/guestfs-actions.pod:674
24318 msgid "(Added in 1.3.5)"
24322 #: ../src/guestfs-actions.pod:662
24323 msgid "guestfs_base64_out"
24327 #: ../src/guestfs-actions.pod:664
24331 " guestfs_base64_out (guestfs_h *g,\n"
24332 " const char *filename,\n"
24333 " const char *base64file);\n"
24338 #: ../src/guestfs-actions.pod:676
24339 msgid "guestfs_blockdev_flushbufs"
24343 #: ../src/guestfs-actions.pod:678
24347 " guestfs_blockdev_flushbufs (guestfs_h *g,\n"
24348 " const char *device);\n"
24353 #: ../src/guestfs-actions.pod:689 ../src/guestfs-actions.pod:706 ../src/guestfs-actions.pod:721 ../src/guestfs-actions.pod:737 ../src/guestfs-actions.pod:755 ../src/guestfs-actions.pod:774 ../src/guestfs-actions.pod:788 ../src/guestfs-actions.pod:806 ../src/guestfs-actions.pod:820 ../src/guestfs-actions.pod:834
24354 msgid "(Added in 0.9.3)"
24358 #: ../src/guestfs-actions.pod:691
24359 msgid "guestfs_blockdev_getbsz"
24363 #: ../src/guestfs-actions.pod:693
24367 " guestfs_blockdev_getbsz (guestfs_h *g,\n"
24368 " const char *device);\n"
24373 #: ../src/guestfs-actions.pod:708
24374 msgid "guestfs_blockdev_getro"
24378 #: ../src/guestfs-actions.pod:710
24382 " guestfs_blockdev_getro (guestfs_h *g,\n"
24383 " const char *device);\n"
24388 #: ../src/guestfs-actions.pod:719 ../src/guestfs-actions.pod:1596 ../src/guestfs-actions.pod:1611 ../src/guestfs-actions.pod:2100 ../src/guestfs-actions.pod:2111 ../src/guestfs-actions.pod:2183 ../src/guestfs-actions.pod:2209 ../src/guestfs-actions.pod:2249 ../src/guestfs-actions.pod:2264 ../src/guestfs-actions.pod:2300 ../src/guestfs-actions.pod:2323 ../src/guestfs-actions.pod:3398 ../src/guestfs-actions.pod:3414 ../src/guestfs-actions.pod:3432 ../src/guestfs-actions.pod:3594 ../src/guestfs-actions.pod:3608 ../src/guestfs-actions.pod:3623 ../src/guestfs-actions.pod:3637 ../src/guestfs-actions.pod:3653 ../src/guestfs-actions.pod:3668 ../src/guestfs-actions.pod:3684 ../src/guestfs-actions.pod:3698 ../src/guestfs-actions.pod:3711 ../src/guestfs-actions.pod:3725 ../src/guestfs-actions.pod:3740 ../src/guestfs-actions.pod:3755 ../src/guestfs-actions.pod:3768 ../src/guestfs-actions.pod:3782 ../src/guestfs-actions.pod:5501
24389 msgid "This function returns a C truth value on success or -1 on error."
24393 #: ../src/guestfs-actions.pod:723
24394 msgid "guestfs_blockdev_getsize64"
24398 #: ../src/guestfs-actions.pod:725
24402 " guestfs_blockdev_getsize64 (guestfs_h *g,\n"
24403 " const char *device);\n"
24408 #: ../src/guestfs-actions.pod:731
24409 msgid "See also C<guestfs_blockdev_getsz>."
24413 #: ../src/guestfs-actions.pod:739
24414 msgid "guestfs_blockdev_getss"
24418 #: ../src/guestfs-actions.pod:741
24422 " guestfs_blockdev_getss (guestfs_h *g,\n"
24423 " const char *device);\n"
24428 #: ../src/guestfs-actions.pod:748
24430 "(Note, this is not the size in sectors, use C<guestfs_blockdev_getsz> for "
24435 #: ../src/guestfs-actions.pod:757
24436 msgid "guestfs_blockdev_getsz"
24440 #: ../src/guestfs-actions.pod:759
24444 " guestfs_blockdev_getsz (guestfs_h *g,\n"
24445 " const char *device);\n"
24450 #: ../src/guestfs-actions.pod:766
24452 "See also C<guestfs_blockdev_getss> for the real sector size of the device, "
24453 "and C<guestfs_blockdev_getsize64> for the more useful I<size in bytes>."
24457 #: ../src/guestfs-actions.pod:776
24458 msgid "guestfs_blockdev_rereadpt"
24462 #: ../src/guestfs-actions.pod:778
24466 " guestfs_blockdev_rereadpt (guestfs_h *g,\n"
24467 " const char *device);\n"
24472 #: ../src/guestfs-actions.pod:790
24473 msgid "guestfs_blockdev_setbsz"
24477 #: ../src/guestfs-actions.pod:792
24481 " guestfs_blockdev_setbsz (guestfs_h *g,\n"
24482 " const char *device,\n"
24483 " int blocksize);\n"
24488 #: ../src/guestfs-actions.pod:808
24489 msgid "guestfs_blockdev_setro"
24493 #: ../src/guestfs-actions.pod:810
24497 " guestfs_blockdev_setro (guestfs_h *g,\n"
24498 " const char *device);\n"
24503 #: ../src/guestfs-actions.pod:822
24504 msgid "guestfs_blockdev_setrw"
24508 #: ../src/guestfs-actions.pod:824
24512 " guestfs_blockdev_setrw (guestfs_h *g,\n"
24513 " const char *device);\n"
24518 #: ../src/guestfs-actions.pod:836
24519 msgid "guestfs_btrfs_filesystem_resize"
24523 #: ../src/guestfs-actions.pod:838
24527 " guestfs_btrfs_filesystem_resize (guestfs_h *g,\n"
24528 " const char *mountpoint,\n"
24534 #: ../src/guestfs-actions.pod:848
24537 " GUESTFS_BTRFS_FILESYSTEM_RESIZE_SIZE, int64_t size,\n"
24542 #: ../src/guestfs-actions.pod:871
24543 msgid "(Added in 1.11.17)"
24547 #: ../src/guestfs-actions.pod:873
24548 msgid "guestfs_btrfs_filesystem_resize_va"
24552 #: ../src/guestfs-actions.pod:875
24556 " guestfs_btrfs_filesystem_resize_va (guestfs_h *g,\n"
24557 " const char *mountpoint,\n"
24558 " va_list args);\n"
24563 #: ../src/guestfs-actions.pod:880
24564 msgid "This is the \"va_list variant\" of L</guestfs_btrfs_filesystem_resize>."
24568 #: ../src/guestfs-actions.pod:884
24569 msgid "guestfs_btrfs_filesystem_resize_argv"
24573 #: ../src/guestfs-actions.pod:886
24577 " guestfs_btrfs_filesystem_resize_argv (guestfs_h *g,\n"
24578 " const char *mountpoint,\n"
24580 "guestfs_btrfs_filesystem_resize_argv *optargs);\n"
24585 #: ../src/guestfs-actions.pod:891
24586 msgid "This is the \"argv variant\" of L</guestfs_btrfs_filesystem_resize>."
24590 #: ../src/guestfs-actions.pod:895
24591 msgid "guestfs_case_sensitive_path"
24595 #: ../src/guestfs-actions.pod:897
24599 " guestfs_case_sensitive_path (guestfs_h *g,\n"
24600 " const char *path);\n"
24605 #: ../src/guestfs-actions.pod:923
24607 "Thus C<guestfs_case_sensitive_path> (\"/Windows/System32\") might return "
24608 "C<\"/WINDOWS/system32\"> (the exact return value would depend on details of "
24609 "how the directories were originally created under Windows)."
24613 #: ../src/guestfs-actions.pod:931
24614 msgid "See also C<guestfs_realpath>."
24618 #: ../src/guestfs-actions.pod:936 ../src/guestfs-actions.pod:7565
24619 msgid "(Added in 1.0.75)"
24623 #: ../src/guestfs-actions.pod:938
24624 msgid "guestfs_cat"
24628 #: ../src/guestfs-actions.pod:940
24632 " guestfs_cat (guestfs_h *g,\n"
24633 " const char *path);\n"
24638 #: ../src/guestfs-actions.pod:946
24640 "Note that this function cannot correctly handle binary files (specifically, "
24641 "files containing C<\\0> character which is treated as end of string). For "
24642 "those you need to use the C<guestfs_read_file> or C<guestfs_download> "
24643 "functions which have a more complex interface."
24647 #: ../src/guestfs-actions.pod:957 ../src/guestfs-actions.pod:3912 ../src/guestfs-actions.pod:3994 ../src/guestfs-actions.pod:4011 ../src/guestfs-actions.pod:4099 ../src/guestfs-actions.pod:4507 ../src/guestfs-actions.pod:4521 ../src/guestfs-actions.pod:5882 ../src/guestfs-actions.pod:5896 ../src/guestfs-actions.pod:7718 ../src/guestfs-actions.pod:7732
24648 msgid "(Added in 0.4)"
24652 #: ../src/guestfs-actions.pod:959
24653 msgid "guestfs_checksum"
24657 #: ../src/guestfs-actions.pod:961
24661 " guestfs_checksum (guestfs_h *g,\n"
24662 " const char *csumtype,\n"
24663 " const char *path);\n"
24668 #: ../src/guestfs-actions.pod:1007
24669 msgid "To get the checksum for a device, use C<guestfs_checksum_device>."
24673 #: ../src/guestfs-actions.pod:1009
24674 msgid "To get the checksums for many files, use C<guestfs_checksums_out>."
24678 #: ../src/guestfs-actions.pod:1014 ../src/guestfs-actions.pod:1433 ../src/guestfs-actions.pod:2291 ../src/guestfs-actions.pod:3610 ../src/guestfs-actions.pod:3639 ../src/guestfs-actions.pod:3700 ../src/guestfs-actions.pod:3727 ../src/guestfs-actions.pod:7421
24679 msgid "(Added in 1.0.2)"
24683 #: ../src/guestfs-actions.pod:1016
24684 msgid "guestfs_checksum_device"
24688 #: ../src/guestfs-actions.pod:1018
24692 " guestfs_checksum_device (guestfs_h *g,\n"
24693 " const char *csumtype,\n"
24694 " const char *device);\n"
24699 #: ../src/guestfs-actions.pod:1023
24701 "This call computes the MD5, SHAx or CRC checksum of the contents of the "
24702 "device named C<device>. For the types of checksums supported see the "
24703 "C<guestfs_checksum> command."
24707 #: ../src/guestfs-actions.pod:1030 ../src/guestfs-actions.pod:5331 ../src/guestfs-actions.pod:5466 ../src/guestfs-actions.pod:5503 ../src/guestfs-actions.pod:5521 ../src/guestfs-actions.pod:5703 ../src/guestfs-actions.pod:7330 ../src/guestfs-actions.pod:7344 ../src/guestfs-actions.pod:7744
24708 msgid "(Added in 1.3.2)"
24712 #: ../src/guestfs-actions.pod:1032
24713 msgid "guestfs_checksums_out"
24717 #: ../src/guestfs-actions.pod:1034
24721 " guestfs_checksums_out (guestfs_h *g,\n"
24722 " const char *csumtype,\n"
24723 " const char *directory,\n"
24724 " const char *sumsfile);\n"
24729 #: ../src/guestfs-actions.pod:1054
24730 msgid "(Added in 1.3.7)"
24734 #: ../src/guestfs-actions.pod:1056
24735 msgid "guestfs_chmod"
24739 #: ../src/guestfs-actions.pod:1058
24743 " guestfs_chmod (guestfs_h *g,\n"
24745 " const char *path);\n"
24750 #: ../src/guestfs-actions.pod:1076
24751 msgid "guestfs_chown"
24755 #: ../src/guestfs-actions.pod:1078
24759 " guestfs_chown (guestfs_h *g,\n"
24762 " const char *path);\n"
24767 #: ../src/guestfs-actions.pod:1094
24768 msgid "guestfs_command"
24772 #: ../src/guestfs-actions.pod:1096
24776 " guestfs_command (guestfs_h *g,\n"
24777 " char *const *arguments);\n"
24782 #: ../src/guestfs-actions.pod:1105
24784 "The single parameter is an argv-style list of arguments. The first element "
24785 "is the name of the program to run. Subsequent elements are parameters. The "
24786 "list must be non-empty (ie. must contain a program name). Note that the "
24787 "command runs directly, and is I<not> invoked via the shell (see "
24792 #: ../src/guestfs-actions.pod:1136 ../src/guestfs-actions.pod:1156 ../src/guestfs-actions.pod:1732
24793 msgid "(Added in 0.9.1)"
24797 #: ../src/guestfs-actions.pod:1138
24798 msgid "guestfs_command_lines"
24802 #: ../src/guestfs-actions.pod:1140
24806 " guestfs_command_lines (guestfs_h *g,\n"
24807 " char *const *arguments);\n"
24812 #: ../src/guestfs-actions.pod:1144
24814 "This is the same as C<guestfs_command>, but splits the result into a list of "
24819 #: ../src/guestfs-actions.pod:1147
24820 msgid "See also: C<guestfs_sh_lines>"
24824 #: ../src/guestfs-actions.pod:1158
24825 msgid "guestfs_compress_device_out"
24829 #: ../src/guestfs-actions.pod:1160
24833 " guestfs_compress_device_out (guestfs_h *g,\n"
24834 " const char *ctype,\n"
24835 " const char *device,\n"
24836 " const char *zdevice,\n"
24842 #: ../src/guestfs-actions.pod:1172
24845 " GUESTFS_COMPRESS_DEVICE_OUT_LEVEL, int level,\n"
24850 #: ../src/guestfs-actions.pod:1177
24852 "The C<ctype> and optional C<level> parameters have the same meaning as in "
24853 "C<guestfs_compress_out>."
24857 #: ../src/guestfs-actions.pod:1182 ../src/guestfs-actions.pod:1241 ../src/guestfs-actions.pod:2277 ../src/guestfs-actions.pod:6602
24858 msgid "(Added in 1.13.15)"
24862 #: ../src/guestfs-actions.pod:1184
24863 msgid "guestfs_compress_device_out_va"
24867 #: ../src/guestfs-actions.pod:1186
24871 " guestfs_compress_device_out_va (guestfs_h *g,\n"
24872 " const char *ctype,\n"
24873 " const char *device,\n"
24874 " const char *zdevice,\n"
24875 " va_list args);\n"
24880 #: ../src/guestfs-actions.pod:1193
24881 msgid "This is the \"va_list variant\" of L</guestfs_compress_device_out>."
24885 #: ../src/guestfs-actions.pod:1197
24886 msgid "guestfs_compress_device_out_argv"
24890 #: ../src/guestfs-actions.pod:1199
24894 " guestfs_compress_device_out_argv (guestfs_h *g,\n"
24895 " const char *ctype,\n"
24896 " const char *device,\n"
24897 " const char *zdevice,\n"
24899 "guestfs_compress_device_out_argv *optargs);\n"
24904 #: ../src/guestfs-actions.pod:1206
24905 msgid "This is the \"argv variant\" of L</guestfs_compress_device_out>."
24909 #: ../src/guestfs-actions.pod:1210
24910 msgid "guestfs_compress_out"
24914 #: ../src/guestfs-actions.pod:1212
24918 " guestfs_compress_out (guestfs_h *g,\n"
24919 " const char *ctype,\n"
24920 " const char *file,\n"
24921 " const char *zfile,\n"
24927 #: ../src/guestfs-actions.pod:1224
24930 " GUESTFS_COMPRESS_OUT_LEVEL, int level,\n"
24935 #: ../src/guestfs-actions.pod:1243
24936 msgid "guestfs_compress_out_va"
24940 #: ../src/guestfs-actions.pod:1245
24944 " guestfs_compress_out_va (guestfs_h *g,\n"
24945 " const char *ctype,\n"
24946 " const char *file,\n"
24947 " const char *zfile,\n"
24948 " va_list args);\n"
24953 #: ../src/guestfs-actions.pod:1252
24954 msgid "This is the \"va_list variant\" of L</guestfs_compress_out>."
24958 #: ../src/guestfs-actions.pod:1256
24959 msgid "guestfs_compress_out_argv"
24963 #: ../src/guestfs-actions.pod:1258
24967 " guestfs_compress_out_argv (guestfs_h *g,\n"
24968 " const char *ctype,\n"
24969 " const char *file,\n"
24970 " const char *zfile,\n"
24971 " const struct guestfs_compress_out_argv "
24977 #: ../src/guestfs-actions.pod:1265
24978 msgid "This is the \"argv variant\" of L</guestfs_compress_out>."
24982 #: ../src/guestfs-actions.pod:1269
24983 msgid "guestfs_config"
24987 #: ../src/guestfs-actions.pod:1271
24991 " guestfs_config (guestfs_h *g,\n"
24992 " const char *qemuparam,\n"
24993 " const char *qemuvalue);\n"
24998 #: ../src/guestfs-actions.pod:1289
24999 msgid "guestfs_copy_size"
25003 #: ../src/guestfs-actions.pod:1291
25007 " guestfs_copy_size (guestfs_h *g,\n"
25008 " const char *src,\n"
25009 " const char *dest,\n"
25010 " int64_t size);\n"
25015 #: ../src/guestfs-actions.pod:1305 ../src/guestfs-actions.pod:1428 ../src/guestfs-actions.pod:1459 ../src/guestfs-actions.pod:1504 ../src/guestfs-actions.pod:1881 ../src/guestfs-actions.pod:1903 ../src/guestfs-actions.pod:3810 ../src/guestfs-actions.pod:7416 ../src/guestfs-actions.pod:7450 ../src/guestfs-actions.pod:7957 ../src/guestfs-actions.pod:7980
25017 "This long-running command can generate progress notification messages so "
25018 "that the caller can display a progress bar or indicator. To receive these "
25019 "messages, the caller must register a progress event callback. See "
25020 "L<guestfs(3)/GUESTFS_EVENT_PROGRESS>."
25024 #: ../src/guestfs-actions.pod:1310 ../src/guestfs-actions.pod:4534 ../src/guestfs-actions.pod:5909 ../src/guestfs-actions.pod:7651 ../src/guestfs-actions.pod:7671 ../src/guestfs-actions.pod:7757
25025 msgid "(Added in 1.0.87)"
25029 #: ../src/guestfs-actions.pod:1312
25034 #: ../src/guestfs-actions.pod:1314
25038 " guestfs_cp (guestfs_h *g,\n"
25039 " const char *src,\n"
25040 " const char *dest);\n"
25045 #: ../src/guestfs-actions.pod:1324 ../src/guestfs-actions.pod:1338 ../src/guestfs-actions.pod:1410 ../src/guestfs-actions.pod:1484 ../src/guestfs-actions.pod:1598 ../src/guestfs-actions.pod:5278 ../src/guestfs-actions.pod:5753
25046 msgid "(Added in 1.0.18)"
25050 #: ../src/guestfs-actions.pod:1326
25051 msgid "guestfs_cp_a"
25055 #: ../src/guestfs-actions.pod:1328
25059 " guestfs_cp_a (guestfs_h *g,\n"
25060 " const char *src,\n"
25061 " const char *dest);\n"
25066 #: ../src/guestfs-actions.pod:1340
25071 #: ../src/guestfs-actions.pod:1342
25075 " guestfs_dd (guestfs_h *g,\n"
25076 " const char *src,\n"
25077 " const char *dest);\n"
25082 #: ../src/guestfs-actions.pod:1352
25084 "If the destination is a device, it must be as large or larger than the "
25085 "source file or device, otherwise the copy will fail. This command cannot do "
25086 "partial copies (see C<guestfs_copy_size>)."
25090 #: ../src/guestfs-actions.pod:1360
25095 #: ../src/guestfs-actions.pod:1362
25099 " guestfs_df (guestfs_h *g);\n"
25104 #: ../src/guestfs-actions.pod:1367 ../src/guestfs-actions.pod:1384
25106 "This command is mostly useful for interactive sessions. It is I<not> "
25107 "intended that you try to parse the output string. Use C<guestfs_statvfs> "
25112 #: ../src/guestfs-actions.pod:1374 ../src/guestfs-actions.pod:1391 ../src/guestfs-actions.pod:1509 ../src/guestfs-actions.pod:2516 ../src/guestfs-actions.pod:2540 ../src/guestfs-actions.pod:2608 ../src/guestfs-actions.pod:4644 ../src/guestfs-actions.pod:5178 ../src/guestfs-actions.pod:7154 ../src/guestfs-actions.pod:7178 ../src/guestfs-actions.pod:7797 ../src/guestfs-actions.pod:7810 ../src/guestfs-actions.pod:7823
25113 msgid "(Added in 1.0.54)"
25117 #: ../src/guestfs-actions.pod:1376
25118 msgid "guestfs_df_h"
25122 #: ../src/guestfs-actions.pod:1378
25126 " guestfs_df_h (guestfs_h *g);\n"
25131 #: ../src/guestfs-actions.pod:1393
25132 msgid "guestfs_dmesg"
25136 #: ../src/guestfs-actions.pod:1395
25140 " guestfs_dmesg (guestfs_h *g);\n"
25145 #: ../src/guestfs-actions.pod:1402
25147 "Another way to get the same information is to enable verbose messages with "
25148 "C<guestfs_set_verbose> or by setting the environment variable "
25149 "C<LIBGUESTFS_DEBUG=1> before running the program."
25153 #: ../src/guestfs-actions.pod:1412
25154 msgid "guestfs_download"
25158 #: ../src/guestfs-actions.pod:1414
25162 " guestfs_download (guestfs_h *g,\n"
25163 " const char *remotefilename,\n"
25164 " const char *filename);\n"
25169 #: ../src/guestfs-actions.pod:1424
25170 msgid "See also C<guestfs_upload>, C<guestfs_cat>."
25174 #: ../src/guestfs-actions.pod:1435
25175 msgid "guestfs_download_offset"
25179 #: ../src/guestfs-actions.pod:1437
25183 " guestfs_download_offset (guestfs_h *g,\n"
25184 " const char *remotefilename,\n"
25185 " const char *filename,\n"
25186 " int64_t offset,\n"
25187 " int64_t size);\n"
25192 #: ../src/guestfs-actions.pod:1450
25194 "Note that there is no limit on the amount of data that can be downloaded "
25195 "with this call, unlike with C<guestfs_pread>, and this call always reads the "
25196 "full amount unless an error occurs."
25200 #: ../src/guestfs-actions.pod:1455
25201 msgid "See also C<guestfs_download>, C<guestfs_pread>."
25205 #: ../src/guestfs-actions.pod:1464 ../src/guestfs-actions.pod:7455
25206 msgid "(Added in 1.5.17)"
25210 #: ../src/guestfs-actions.pod:1466
25211 msgid "guestfs_drop_caches"
25215 #: ../src/guestfs-actions.pod:1468
25219 " guestfs_drop_caches (guestfs_h *g,\n"
25220 " int whattodrop);\n"
25225 #: ../src/guestfs-actions.pod:1486
25230 #: ../src/guestfs-actions.pod:1488
25234 " guestfs_du (guestfs_h *g,\n"
25235 " const char *path);\n"
25240 #: ../src/guestfs-actions.pod:1511
25241 msgid "guestfs_e2fsck_f"
25245 #: ../src/guestfs-actions.pod:1513
25249 " guestfs_e2fsck_f (guestfs_h *g,\n"
25250 " const char *device);\n"
25255 #: ../src/guestfs-actions.pod:1521
25257 "This command is only needed because of C<guestfs_resize2fs> (q.v.). "
25258 "Normally you should use C<guestfs_fsck>."
25262 #: ../src/guestfs-actions.pod:1526
25263 msgid "(Added in 1.0.29)"
25267 #: ../src/guestfs-actions.pod:1528
25268 msgid "guestfs_echo_daemon"
25272 #: ../src/guestfs-actions.pod:1530
25276 " guestfs_echo_daemon (guestfs_h *g,\n"
25277 " char *const *words);\n"
25282 #: ../src/guestfs-actions.pod:1539
25283 msgid "See also C<guestfs_ping_daemon>."
25287 #: ../src/guestfs-actions.pod:1544 ../src/guestfs-actions.pod:2302 ../src/guestfs-actions.pod:6626
25288 msgid "(Added in 1.0.69)"
25292 #: ../src/guestfs-actions.pod:1546
25293 msgid "guestfs_egrep"
25297 #: ../src/guestfs-actions.pod:1548
25301 " guestfs_egrep (guestfs_h *g,\n"
25302 " const char *regex,\n"
25303 " const char *path);\n"
25308 #: ../src/guestfs-actions.pod:1563 ../src/guestfs-actions.pod:1582 ../src/guestfs-actions.pod:1639 ../src/guestfs-actions.pod:1685 ../src/guestfs-actions.pod:1704 ../src/guestfs-actions.pod:2432 ../src/guestfs-actions.pod:2451 ../src/guestfs-actions.pod:2629 ../src/guestfs-actions.pod:2642 ../src/guestfs-actions.pod:2657 ../src/guestfs-actions.pod:2703 ../src/guestfs-actions.pod:2725 ../src/guestfs-actions.pod:2738 ../src/guestfs-actions.pod:4024 ../src/guestfs-actions.pod:4038 ../src/guestfs-actions.pod:4051 ../src/guestfs-actions.pod:4065 ../src/guestfs-actions.pod:5066 ../src/guestfs-actions.pod:6087 ../src/guestfs-actions.pod:6136 ../src/guestfs-actions.pod:7022 ../src/guestfs-actions.pod:7034 ../src/guestfs-actions.pod:7047 ../src/guestfs-actions.pod:7060 ../src/guestfs-actions.pod:7082 ../src/guestfs-actions.pod:7095 ../src/guestfs-actions.pod:7108 ../src/guestfs-actions.pod:7121 ../src/guestfs-actions.pod:7915 ../src/guestfs-actions.pod:7934 ../src/guestfs-actions.pod:8028 ../src/guestfs-actions.pod:8047 ../src/guestfs-actions.pod:8093 ../src/guestfs-actions.pod:8112
25309 msgid "(Added in 1.0.66)"
25313 #: ../src/guestfs-actions.pod:1565
25314 msgid "guestfs_egrepi"
25318 #: ../src/guestfs-actions.pod:1567
25322 " guestfs_egrepi (guestfs_h *g,\n"
25323 " const char *regex,\n"
25324 " const char *path);\n"
25329 #: ../src/guestfs-actions.pod:1584
25330 msgid "guestfs_equal"
25334 #: ../src/guestfs-actions.pod:1586
25338 " guestfs_equal (guestfs_h *g,\n"
25339 " const char *file1,\n"
25340 " const char *file2);\n"
25345 #: ../src/guestfs-actions.pod:1600
25346 msgid "guestfs_exists"
25350 #: ../src/guestfs-actions.pod:1602
25354 " guestfs_exists (guestfs_h *g,\n"
25355 " const char *path);\n"
25360 #: ../src/guestfs-actions.pod:1609
25361 msgid "See also C<guestfs_is_file>, C<guestfs_is_dir>, C<guestfs_stat>."
25365 #: ../src/guestfs-actions.pod:1615
25366 msgid "guestfs_fallocate"
25370 #: ../src/guestfs-actions.pod:1617
25374 " guestfs_fallocate (guestfs_h *g,\n"
25375 " const char *path,\n"
25381 #: ../src/guestfs-actions.pod:1622
25383 "I<This function is deprecated.> In new code, use the L</guestfs_fallocate64> "
25388 #: ../src/guestfs-actions.pod:1641
25389 msgid "guestfs_fallocate64"
25393 #: ../src/guestfs-actions.pod:1643
25397 " guestfs_fallocate64 (guestfs_h *g,\n"
25398 " const char *path,\n"
25404 #: ../src/guestfs-actions.pod:1652
25406 "Note that this call allocates disk blocks for the file. To create a sparse "
25407 "file use C<guestfs_truncate_size> instead."
25411 #: ../src/guestfs-actions.pod:1655
25413 "The deprecated call C<guestfs_fallocate> does the same, but owing to an "
25414 "oversight it only allowed 30 bit lengths to be specified, effectively "
25415 "limiting the maximum size of files created through that call to 1GB."
25419 #: ../src/guestfs-actions.pod:1666
25420 msgid "(Added in 1.3.17)"
25424 #: ../src/guestfs-actions.pod:1668
25425 msgid "guestfs_fgrep"
25429 #: ../src/guestfs-actions.pod:1670
25433 " guestfs_fgrep (guestfs_h *g,\n"
25434 " const char *pattern,\n"
25435 " const char *path);\n"
25440 #: ../src/guestfs-actions.pod:1687
25441 msgid "guestfs_fgrepi"
25445 #: ../src/guestfs-actions.pod:1689
25449 " guestfs_fgrepi (guestfs_h *g,\n"
25450 " const char *pattern,\n"
25451 " const char *path);\n"
25456 #: ../src/guestfs-actions.pod:1706
25457 msgid "guestfs_file"
25461 #: ../src/guestfs-actions.pod:1708
25465 " guestfs_file (guestfs_h *g,\n"
25466 " const char *path);\n"
25471 #: ../src/guestfs-actions.pod:1726
25473 "See also: L<file(1)>, C<guestfs_vfs_type>, C<guestfs_lstat>, "
25474 "C<guestfs_is_file>, C<guestfs_is_blockdev> (etc), C<guestfs_is_zero>."
25478 #: ../src/guestfs-actions.pod:1734
25479 msgid "guestfs_file_architecture"
25483 #: ../src/guestfs-actions.pod:1736
25487 " guestfs_file_architecture (guestfs_h *g,\n"
25488 " const char *filename);\n"
25493 #: ../src/guestfs-actions.pod:1844 ../src/guestfs-actions.pod:2007 ../src/guestfs-actions.pod:2024 ../src/guestfs-actions.pod:2758 ../src/guestfs-actions.pod:2860 ../src/guestfs-actions.pod:2926 ../src/guestfs-actions.pod:3113 ../src/guestfs-actions.pod:3131 ../src/guestfs-actions.pod:3171 ../src/guestfs-actions.pod:3247 ../src/guestfs-actions.pod:3344 ../src/guestfs-actions.pod:3581 ../src/guestfs-actions.pod:3713
25494 msgid "(Added in 1.5.3)"
25498 #: ../src/guestfs-actions.pod:1846
25499 msgid "guestfs_filesize"
25503 #: ../src/guestfs-actions.pod:1848
25507 " guestfs_filesize (guestfs_h *g,\n"
25508 " const char *file);\n"
25513 #: ../src/guestfs-actions.pod:1854
25515 "To get other stats about a file, use C<guestfs_stat>, C<guestfs_lstat>, "
25516 "C<guestfs_is_dir>, C<guestfs_is_file> etc. To get the size of block "
25517 "devices, use C<guestfs_blockdev_getsize64>."
25521 #: ../src/guestfs-actions.pod:1860
25522 msgid "(Added in 1.0.82)"
25526 #: ../src/guestfs-actions.pod:1862
25527 msgid "guestfs_fill"
25531 #: ../src/guestfs-actions.pod:1864
25535 " guestfs_fill (guestfs_h *g,\n"
25538 " const char *path);\n"
25543 #: ../src/guestfs-actions.pod:1874
25545 "To fill a file with zero bytes (sparsely), it is much more efficient to use "
25546 "C<guestfs_truncate_size>. To create a file with a pattern of repeating "
25547 "bytes use C<guestfs_fill_pattern>."
25551 #: ../src/guestfs-actions.pod:1886
25552 msgid "(Added in 1.0.79)"
25556 #: ../src/guestfs-actions.pod:1888
25557 msgid "guestfs_fill_pattern"
25561 #: ../src/guestfs-actions.pod:1890
25565 " guestfs_fill_pattern (guestfs_h *g,\n"
25566 " const char *pattern,\n"
25568 " const char *path);\n"
25573 #: ../src/guestfs-actions.pod:1896
25575 "This function is like C<guestfs_fill> except that it creates a new file of "
25576 "length C<len> containing the repeating pattern of bytes in C<pattern>. The "
25577 "pattern is truncated if necessary to ensure the length of the file is "
25578 "exactly C<len> bytes."
25582 #: ../src/guestfs-actions.pod:1908
25583 msgid "(Added in 1.3.12)"
25587 #: ../src/guestfs-actions.pod:1910
25588 msgid "guestfs_find"
25592 #: ../src/guestfs-actions.pod:1912
25596 " guestfs_find (guestfs_h *g,\n"
25597 " const char *directory);\n"
25602 #: ../src/guestfs-actions.pod:1928
25603 msgid "then the returned list from C<guestfs_find> C</tmp> would be 4 elements:"
25607 #: ../src/guestfs-actions.pod:1941
25608 msgid "See also C<guestfs_find0>."
25612 #: ../src/guestfs-actions.pod:1950 ../src/guestfs-actions.pod:4471 ../src/guestfs-actions.pod:6171
25613 msgid "(Added in 1.0.27)"
25617 #: ../src/guestfs-actions.pod:1952
25618 msgid "guestfs_find0"
25622 #: ../src/guestfs-actions.pod:1954
25626 " guestfs_find0 (guestfs_h *g,\n"
25627 " const char *directory,\n"
25628 " const char *files);\n"
25633 #: ../src/guestfs-actions.pod:1963
25635 "This command works the same way as C<guestfs_find> with the following "
25640 #: ../src/guestfs-actions.pod:1990
25641 msgid "(Added in 1.0.74)"
25645 #: ../src/guestfs-actions.pod:1992
25646 msgid "guestfs_findfs_label"
25650 #: ../src/guestfs-actions.pod:1994
25654 " guestfs_findfs_label (guestfs_h *g,\n"
25655 " const char *label);\n"
25660 #: ../src/guestfs-actions.pod:2002
25661 msgid "To find the label of a filesystem, use C<guestfs_vfs_label>."
25665 #: ../src/guestfs-actions.pod:2009
25666 msgid "guestfs_findfs_uuid"
25670 #: ../src/guestfs-actions.pod:2011
25674 " guestfs_findfs_uuid (guestfs_h *g,\n"
25675 " const char *uuid);\n"
25680 #: ../src/guestfs-actions.pod:2019
25681 msgid "To find the UUID of a filesystem, use C<guestfs_vfs_uuid>."
25685 #: ../src/guestfs-actions.pod:2026
25686 msgid "guestfs_fsck"
25690 #: ../src/guestfs-actions.pod:2028
25694 " guestfs_fsck (guestfs_h *g,\n"
25695 " const char *fstype,\n"
25696 " const char *device);\n"
25701 #: ../src/guestfs-actions.pod:2063 ../src/guestfs-actions.pod:7962
25702 msgid "(Added in 1.0.16)"
25706 #: ../src/guestfs-actions.pod:2065
25707 msgid "guestfs_get_append"
25711 #: ../src/guestfs-actions.pod:2067
25715 " guestfs_get_append (guestfs_h *g);\n"
25720 #: ../src/guestfs-actions.pod:2075
25722 "This function returns a string which may be NULL. There is no way to return "
25723 "an error from this function. The string is owned by the guest handle and "
25724 "must I<not> be freed."
25728 #: ../src/guestfs-actions.pod:2079 ../src/guestfs-actions.pod:5849 ../src/guestfs-actions.pod:6331 ../src/guestfs-actions.pod:6789 ../src/guestfs-actions.pod:6808 ../src/guestfs-actions.pod:6824 ../src/guestfs-actions.pod:6848 ../src/guestfs-actions.pod:7602 ../src/guestfs-actions.pod:7617 ../src/guestfs-actions.pod:8009
25729 msgid "(Added in 1.0.26)"
25733 #: ../src/guestfs-actions.pod:2081
25734 msgid "guestfs_get_attach_method"
25738 #: ../src/guestfs-actions.pod:2083
25742 " guestfs_get_attach_method (guestfs_h *g);\n"
25747 #: ../src/guestfs-actions.pod:2086
25748 msgid "Return the current attach method. See C<guestfs_set_attach_method>."
25752 #: ../src/guestfs-actions.pod:2091 ../src/guestfs-actions.pod:6361
25753 msgid "(Added in 1.9.8)"
25757 #: ../src/guestfs-actions.pod:2093
25758 msgid "guestfs_get_autosync"
25762 #: ../src/guestfs-actions.pod:2095
25766 " guestfs_get_autosync (guestfs_h *g);\n"
25771 #: ../src/guestfs-actions.pod:2104
25772 msgid "guestfs_get_direct"
25776 #: ../src/guestfs-actions.pod:2106
25780 " guestfs_get_direct (guestfs_h *g);\n"
25785 #: ../src/guestfs-actions.pod:2113 ../src/guestfs-actions.pod:6402
25786 msgid "(Added in 1.0.72)"
25790 #: ../src/guestfs-actions.pod:2115
25791 msgid "guestfs_get_e2label"
25795 #: ../src/guestfs-actions.pod:2117
25799 " guestfs_get_e2label (guestfs_h *g,\n"
25800 " const char *device);\n"
25805 #: ../src/guestfs-actions.pod:2121
25807 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_label> "
25812 #: ../src/guestfs-actions.pod:2134 ../src/guestfs-actions.pod:2155 ../src/guestfs-actions.pod:6420 ../src/guestfs-actions.pod:6439
25813 msgid "(Added in 1.0.15)"
25817 #: ../src/guestfs-actions.pod:2136
25818 msgid "guestfs_get_e2uuid"
25822 #: ../src/guestfs-actions.pod:2138
25826 " guestfs_get_e2uuid (guestfs_h *g,\n"
25827 " const char *device);\n"
25832 #: ../src/guestfs-actions.pod:2142
25834 "I<This function is deprecated.> In new code, use the L</guestfs_vfs_uuid> "
25839 #: ../src/guestfs-actions.pod:2157
25840 msgid "guestfs_get_memsize"
25844 #: ../src/guestfs-actions.pod:2159
25848 " guestfs_get_memsize (guestfs_h *g);\n"
25853 #: ../src/guestfs-actions.pod:2165
25855 "If C<guestfs_set_memsize> was not called on this handle, and if "
25856 "C<LIBGUESTFS_MEMSIZE> was not set, then this returns the compiled-in default "
25857 "value for memsize."
25861 #: ../src/guestfs-actions.pod:2174 ../src/guestfs-actions.pod:4762 ../src/guestfs-actions.pod:4971 ../src/guestfs-actions.pod:4990 ../src/guestfs-actions.pod:5009 ../src/guestfs-actions.pod:5021 ../src/guestfs-actions.pod:5038 ../src/guestfs-actions.pod:5051 ../src/guestfs-actions.pod:6074 ../src/guestfs-actions.pod:6460 ../src/guestfs-actions.pod:6756 ../src/guestfs-actions.pod:7371
25862 msgid "(Added in 1.0.55)"
25866 #: ../src/guestfs-actions.pod:2176
25867 msgid "guestfs_get_network"
25871 #: ../src/guestfs-actions.pod:2178
25875 " guestfs_get_network (guestfs_h *g);\n"
25880 #: ../src/guestfs-actions.pod:2185 ../src/guestfs-actions.pod:6479
25881 msgid "(Added in 1.5.4)"
25885 #: ../src/guestfs-actions.pod:2187
25886 msgid "guestfs_get_path"
25890 #: ../src/guestfs-actions.pod:2189
25894 " guestfs_get_path (guestfs_h *g);\n"
25899 #: ../src/guestfs-actions.pod:2197 ../src/guestfs-actions.pod:2237
25901 "This function returns a string, or NULL on error. The string is owned by "
25902 "the guest handle and must I<not> be freed."
25906 #: ../src/guestfs-actions.pod:2202
25907 msgid "guestfs_get_pgroup"
25911 #: ../src/guestfs-actions.pod:2204
25915 " guestfs_get_pgroup (guestfs_h *g);\n"
25920 #: ../src/guestfs-actions.pod:2211 ../src/guestfs-actions.pod:6515 ../src/guestfs-actions.pod:7863
25921 msgid "(Added in 1.11.18)"
25925 #: ../src/guestfs-actions.pod:2213
25926 msgid "guestfs_get_pid"
25930 #: ../src/guestfs-actions.pod:2215
25934 " guestfs_get_pid (guestfs_h *g);\n"
25939 #: ../src/guestfs-actions.pod:2225
25940 msgid "(Added in 1.0.56)"
25944 #: ../src/guestfs-actions.pod:2227
25945 msgid "guestfs_get_qemu"
25949 #: ../src/guestfs-actions.pod:2229
25953 " guestfs_get_qemu (guestfs_h *g);\n"
25958 #: ../src/guestfs-actions.pod:2240 ../src/guestfs-actions.pod:6543
25959 msgid "(Added in 1.0.6)"
25963 #: ../src/guestfs-actions.pod:2242
25964 msgid "guestfs_get_recovery_proc"
25968 #: ../src/guestfs-actions.pod:2244
25972 " guestfs_get_recovery_proc (guestfs_h *g);\n"
25977 #: ../src/guestfs-actions.pod:2251 ../src/guestfs-actions.pod:3835 ../src/guestfs-actions.pod:4166 ../src/guestfs-actions.pod:4569 ../src/guestfs-actions.pod:4601 ../src/guestfs-actions.pod:5779 ../src/guestfs-actions.pod:6122 ../src/guestfs-actions.pod:6567 ../src/guestfs-actions.pod:7274 ../src/guestfs-actions.pod:7294 ../src/guestfs-actions.pod:7486
25978 msgid "(Added in 1.0.77)"
25982 #: ../src/guestfs-actions.pod:2253
25983 msgid "guestfs_get_selinux"
25987 #: ../src/guestfs-actions.pod:2255
25991 " guestfs_get_selinux (guestfs_h *g);\n"
25996 #: ../src/guestfs-actions.pod:2258
25998 "This returns the current setting of the selinux flag which is passed to the "
25999 "appliance at boot time. See C<guestfs_set_selinux>."
26003 #: ../src/guestfs-actions.pod:2266 ../src/guestfs-actions.pod:2340 ../src/guestfs-actions.pod:6586 ../src/guestfs-actions.pod:6660
26004 msgid "(Added in 1.0.67)"
26008 #: ../src/guestfs-actions.pod:2268
26009 msgid "guestfs_get_smp"
26013 #: ../src/guestfs-actions.pod:2270
26017 " guestfs_get_smp (guestfs_h *g);\n"
26022 #: ../src/guestfs-actions.pod:2279
26023 msgid "guestfs_get_state"
26027 #: ../src/guestfs-actions.pod:2281
26031 " guestfs_get_state (guestfs_h *g);\n"
26036 #: ../src/guestfs-actions.pod:2293
26037 msgid "guestfs_get_trace"
26041 #: ../src/guestfs-actions.pod:2295
26045 " guestfs_get_trace (guestfs_h *g);\n"
26050 #: ../src/guestfs-actions.pod:2304
26051 msgid "guestfs_get_umask"
26055 #: ../src/guestfs-actions.pod:2306
26059 " guestfs_get_umask (guestfs_h *g);\n"
26064 #: ../src/guestfs-actions.pod:2309
26066 "Return the current umask. By default the umask is C<022> unless it has been "
26067 "set by calling C<guestfs_umask>."
26071 #: ../src/guestfs-actions.pod:2316
26072 msgid "guestfs_get_verbose"
26076 #: ../src/guestfs-actions.pod:2318
26080 " guestfs_get_verbose (guestfs_h *g);\n"
26085 #: ../src/guestfs-actions.pod:2327
26086 msgid "guestfs_getcon"
26090 #: ../src/guestfs-actions.pod:2329
26094 " guestfs_getcon (guestfs_h *g);\n"
26099 #: ../src/guestfs-actions.pod:2334
26100 msgid "See the documentation about SELINUX in L<guestfs(3)>, and C<guestfs_setcon>"
26104 #: ../src/guestfs-actions.pod:2342
26105 msgid "guestfs_getxattr"
26109 #: ../src/guestfs-actions.pod:2344
26113 " guestfs_getxattr (guestfs_h *g,\n"
26114 " const char *path,\n"
26115 " const char *name,\n"
26116 " size_t *size_r);\n"
26121 #: ../src/guestfs-actions.pod:2350
26123 "Get a single extended attribute from file C<path> named C<name>. This call "
26124 "follows symlinks. If you want to lookup an extended attribute for the "
26125 "symlink itself, use C<guestfs_lgetxattr>."
26129 #: ../src/guestfs-actions.pod:2354 ../src/guestfs-actions.pod:3849
26131 "Normally it is better to get all extended attributes from a file in one go "
26132 "by calling C<guestfs_getxattrs>. However some Linux filesystem "
26133 "implementations are buggy and do not provide a way to list out attributes. "
26134 "For these filesystems (notably ntfs-3g) you have to know the names of the "
26135 "extended attributes you want in advance and call this function."
26139 #: ../src/guestfs-actions.pod:2364
26140 msgid "See also: C<guestfs_getxattrs>, C<guestfs_lgetxattr>, L<attr(5)>."
26144 #: ../src/guestfs-actions.pod:2366 ../src/guestfs-actions.pod:2579 ../src/guestfs-actions.pod:3061 ../src/guestfs-actions.pod:3861 ../src/guestfs-actions.pod:5772 ../src/guestfs-actions.pod:5798 ../src/guestfs-actions.pod:5979
26146 "This function returns a buffer, or NULL on error. The size of the returned "
26147 "buffer is written to C<*size_r>. I<The caller must free the returned buffer "
26152 #: ../src/guestfs-actions.pod:2370 ../src/guestfs-actions.pod:3865
26153 msgid "(Added in 1.7.24)"
26157 #: ../src/guestfs-actions.pod:2372
26158 msgid "guestfs_getxattrs"
26162 #: ../src/guestfs-actions.pod:2374
26165 " struct guestfs_xattr_list *\n"
26166 " guestfs_getxattrs (guestfs_h *g,\n"
26167 " const char *path);\n"
26172 #: ../src/guestfs-actions.pod:2384
26173 msgid "See also: C<guestfs_lgetxattrs>, L<attr(5)>."
26177 #: ../src/guestfs-actions.pod:2386 ../src/guestfs-actions.pod:3877 ../src/guestfs-actions.pod:4565
26179 "This function returns a C<struct guestfs_xattr_list *>, or NULL if there was "
26180 "an error. I<The caller must call C<guestfs_free_xattr_list> after use>."
26184 #: ../src/guestfs-actions.pod:2390 ../src/guestfs-actions.pod:3881 ../src/guestfs-actions.pod:4080 ../src/guestfs-actions.pod:4116 ../src/guestfs-actions.pod:6152 ../src/guestfs-actions.pod:6679 ../src/guestfs-actions.pod:8074
26185 msgid "(Added in 1.0.59)"
26189 #: ../src/guestfs-actions.pod:2392
26190 msgid "guestfs_glob_expand"
26194 #: ../src/guestfs-actions.pod:2394
26198 " guestfs_glob_expand (guestfs_h *g,\n"
26199 " const char *pattern);\n"
26204 #: ../src/guestfs-actions.pod:2413 ../src/guestfs-actions.pod:6872 ../src/guestfs-actions.pod:6889
26205 msgid "(Added in 1.0.50)"
26209 #: ../src/guestfs-actions.pod:2415
26210 msgid "guestfs_grep"
26214 #: ../src/guestfs-actions.pod:2417
26218 " guestfs_grep (guestfs_h *g,\n"
26219 " const char *regex,\n"
26220 " const char *path);\n"
26225 #: ../src/guestfs-actions.pod:2434
26226 msgid "guestfs_grepi"
26230 #: ../src/guestfs-actions.pod:2436
26234 " guestfs_grepi (guestfs_h *g,\n"
26235 " const char *regex,\n"
26236 " const char *path);\n"
26241 #: ../src/guestfs-actions.pod:2453
26242 msgid "guestfs_grub_install"
26246 #: ../src/guestfs-actions.pod:2455
26250 " guestfs_grub_install (guestfs_h *g,\n"
26251 " const char *root,\n"
26252 " const char *device);\n"
26257 #: ../src/guestfs-actions.pod:2498
26258 msgid "(Added in 1.0.17)"
26262 #: ../src/guestfs-actions.pod:2500
26263 msgid "guestfs_head"
26267 #: ../src/guestfs-actions.pod:2502
26271 " guestfs_head (guestfs_h *g,\n"
26272 " const char *path);\n"
26277 #: ../src/guestfs-actions.pod:2518
26278 msgid "guestfs_head_n"
26282 #: ../src/guestfs-actions.pod:2520
26286 " guestfs_head_n (guestfs_h *g,\n"
26288 " const char *path);\n"
26293 #: ../src/guestfs-actions.pod:2542
26294 msgid "guestfs_hexdump"
26298 #: ../src/guestfs-actions.pod:2544
26302 " guestfs_hexdump (guestfs_h *g,\n"
26303 " const char *path);\n"
26308 #: ../src/guestfs-actions.pod:2557 ../src/guestfs-actions.pod:6953 ../src/guestfs-actions.pod:7008
26309 msgid "(Added in 1.0.22)"
26313 #: ../src/guestfs-actions.pod:2559
26314 msgid "guestfs_initrd_cat"
26318 #: ../src/guestfs-actions.pod:2561
26322 " guestfs_initrd_cat (guestfs_h *g,\n"
26323 " const char *initrdpath,\n"
26324 " const char *filename,\n"
26325 " size_t *size_r);\n"
26330 #: ../src/guestfs-actions.pod:2577
26331 msgid "See also C<guestfs_initrd_list>."
26335 #: ../src/guestfs-actions.pod:2588
26336 msgid "guestfs_initrd_list"
26340 #: ../src/guestfs-actions.pod:2590
26344 " guestfs_initrd_list (guestfs_h *g,\n"
26345 " const char *path);\n"
26350 #: ../src/guestfs-actions.pod:2610
26351 msgid "guestfs_inotify_add_watch"
26355 #: ../src/guestfs-actions.pod:2612
26359 " guestfs_inotify_add_watch (guestfs_h *g,\n"
26360 " const char *path,\n"
26366 #: ../src/guestfs-actions.pod:2631
26367 msgid "guestfs_inotify_close"
26371 #: ../src/guestfs-actions.pod:2633
26375 " guestfs_inotify_close (guestfs_h *g);\n"
26380 #: ../src/guestfs-actions.pod:2644
26381 msgid "guestfs_inotify_files"
26385 #: ../src/guestfs-actions.pod:2646
26389 " guestfs_inotify_files (guestfs_h *g);\n"
26394 #: ../src/guestfs-actions.pod:2649
26396 "This function is a helpful wrapper around C<guestfs_inotify_read> which just "
26397 "returns a list of pathnames of objects that were touched. The returned "
26398 "pathnames are sorted and deduplicated."
26402 #: ../src/guestfs-actions.pod:2659
26403 msgid "guestfs_inotify_init"
26407 #: ../src/guestfs-actions.pod:2661
26411 " guestfs_inotify_init (guestfs_h *g,\n"
26412 " int maxevents);\n"
26417 #: ../src/guestfs-actions.pod:2669
26419 "C<maxevents> is the maximum number of events which will be queued up between "
26420 "calls to C<guestfs_inotify_read> or C<guestfs_inotify_files>. If this is "
26421 "passed as C<0>, then the kernel (or previously set) default is used. For "
26422 "Linux 2.6.29 the default was 16384 events. Beyond this limit, the kernel "
26423 "throws away events, but records the fact that it threw them away by setting "
26424 "a flag C<IN_Q_OVERFLOW> in the returned structure list (see "
26425 "C<guestfs_inotify_read>)."
26429 #: ../src/guestfs-actions.pod:2679
26431 "Before any events are generated, you have to add some watches to the "
26432 "internal watch list. See: C<guestfs_inotify_add_watch>, "
26433 "C<guestfs_inotify_rm_watch> and C<guestfs_inotify_watch_all>."
26437 #: ../src/guestfs-actions.pod:2685
26439 "Queued up events should be read periodically by calling "
26440 "C<guestfs_inotify_read> (or C<guestfs_inotify_files> which is just a helpful "
26441 "wrapper around C<guestfs_inotify_read>). If you don't read the events out "
26442 "often enough then you risk the internal queue overflowing."
26446 #: ../src/guestfs-actions.pod:2692
26448 "The handle should be closed after use by calling C<guestfs_inotify_close>. "
26449 "This also removes any watches automatically."
26453 #: ../src/guestfs-actions.pod:2705
26454 msgid "guestfs_inotify_read"
26458 #: ../src/guestfs-actions.pod:2707
26461 " struct guestfs_inotify_event_list *\n"
26462 " guestfs_inotify_read (guestfs_h *g);\n"
26467 #: ../src/guestfs-actions.pod:2721
26469 "This function returns a C<struct guestfs_inotify_event_list *>, or NULL if "
26470 "there was an error. I<The caller must call "
26471 "C<guestfs_free_inotify_event_list> after use>."
26475 #: ../src/guestfs-actions.pod:2727
26476 msgid "guestfs_inotify_rm_watch"
26480 #: ../src/guestfs-actions.pod:2729
26484 " guestfs_inotify_rm_watch (guestfs_h *g,\n"
26490 #: ../src/guestfs-actions.pod:2733
26492 "Remove a previously defined inotify watch. See "
26493 "C<guestfs_inotify_add_watch>."
26497 #: ../src/guestfs-actions.pod:2740
26498 msgid "guestfs_inspect_get_arch"
26502 #: ../src/guestfs-actions.pod:2742
26506 " guestfs_inspect_get_arch (guestfs_h *g,\n"
26507 " const char *root);\n"
26512 #: ../src/guestfs-actions.pod:2746
26514 "This returns the architecture of the inspected operating system. The "
26515 "possible return values are listed under C<guestfs_file_architecture>."
26519 #: ../src/guestfs-actions.pod:2760
26520 msgid "guestfs_inspect_get_distro"
26524 #: ../src/guestfs-actions.pod:2762
26528 " guestfs_inspect_get_distro (guestfs_h *g,\n"
26529 " const char *root);\n"
26534 #: ../src/guestfs-actions.pod:2862
26535 msgid "guestfs_inspect_get_drive_mappings"
26539 #: ../src/guestfs-actions.pod:2864
26543 " guestfs_inspect_get_drive_mappings (guestfs_h *g,\n"
26544 " const char *root);\n"
26549 #: ../src/guestfs-actions.pod:2893
26551 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26552 "C<guestfs_inspect_get_mountpoints>, C<guestfs_inspect_get_filesystems>."
26556 #: ../src/guestfs-actions.pod:2897 ../src/guestfs-actions.pod:3165 ../src/guestfs-actions.pod:3968 ../src/guestfs-actions.pod:5240 ../src/guestfs-actions.pod:7310
26558 "This function returns a NULL-terminated array of strings, or NULL if there "
26559 "was an error. The array of strings will always have length C<2n+1>, where "
26560 "C<n> keys and values alternate, followed by the trailing NULL entry. I<The "
26561 "caller must free the strings and the array after use>."
26565 #: ../src/guestfs-actions.pod:2903 ../src/guestfs-actions.pod:3364
26566 msgid "(Added in 1.9.17)"
26570 #: ../src/guestfs-actions.pod:2905
26571 msgid "guestfs_inspect_get_filesystems"
26575 #: ../src/guestfs-actions.pod:2907
26579 " guestfs_inspect_get_filesystems (guestfs_h *g,\n"
26580 " const char *root);\n"
26585 #: ../src/guestfs-actions.pod:2919
26587 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26588 "C<guestfs_inspect_get_mountpoints>."
26592 #: ../src/guestfs-actions.pod:2928
26593 msgid "guestfs_inspect_get_format"
26597 #: ../src/guestfs-actions.pod:2930
26601 " guestfs_inspect_get_format (guestfs_h *g,\n"
26602 " const char *root);\n"
26607 #: ../src/guestfs-actions.pod:2964 ../src/guestfs-actions.pod:3400 ../src/guestfs-actions.pod:3416 ../src/guestfs-actions.pod:3434 ../src/guestfs-actions.pod:6190
26608 msgid "(Added in 1.9.4)"
26612 #: ../src/guestfs-actions.pod:2966
26613 msgid "guestfs_inspect_get_hostname"
26617 #: ../src/guestfs-actions.pod:2968
26621 " guestfs_inspect_get_hostname (guestfs_h *g,\n"
26622 " const char *root);\n"
26627 #: ../src/guestfs-actions.pod:2983
26628 msgid "(Added in 1.7.9)"
26632 #: ../src/guestfs-actions.pod:2985
26633 msgid "guestfs_inspect_get_icon"
26637 #: ../src/guestfs-actions.pod:2987
26641 " guestfs_inspect_get_icon (guestfs_h *g,\n"
26642 " const char *root,\n"
26643 " size_t *size_r,\n"
26649 #: ../src/guestfs-actions.pod:2998
26652 " GUESTFS_INSPECT_GET_ICON_FAVICON, int favicon,\n"
26653 " GUESTFS_INSPECT_GET_ICON_HIGHQUALITY, int highquality,\n"
26658 #: ../src/guestfs-actions.pod:3065 ../src/guestfs-actions.pod:3895 ../src/guestfs-actions.pod:5139
26659 msgid "(Added in 1.11.12)"
26663 #: ../src/guestfs-actions.pod:3067
26664 msgid "guestfs_inspect_get_icon_va"
26668 #: ../src/guestfs-actions.pod:3069
26672 " guestfs_inspect_get_icon_va (guestfs_h *g,\n"
26673 " const char *root,\n"
26674 " size_t *size_r,\n"
26675 " va_list args);\n"
26680 #: ../src/guestfs-actions.pod:3075
26681 msgid "This is the \"va_list variant\" of L</guestfs_inspect_get_icon>."
26685 #: ../src/guestfs-actions.pod:3079
26686 msgid "guestfs_inspect_get_icon_argv"
26690 #: ../src/guestfs-actions.pod:3081
26694 " guestfs_inspect_get_icon_argv (guestfs_h *g,\n"
26695 " const char *root,\n"
26696 " size_t *size_r,\n"
26697 " const struct guestfs_inspect_get_icon_argv "
26703 #: ../src/guestfs-actions.pod:3087
26704 msgid "This is the \"argv variant\" of L</guestfs_inspect_get_icon>."
26708 #: ../src/guestfs-actions.pod:3091
26709 msgid "guestfs_inspect_get_major_version"
26713 #: ../src/guestfs-actions.pod:3093
26717 " guestfs_inspect_get_major_version (guestfs_h *g,\n"
26718 " const char *root);\n"
26723 #: ../src/guestfs-actions.pod:3115
26724 msgid "guestfs_inspect_get_minor_version"
26728 #: ../src/guestfs-actions.pod:3117
26732 " guestfs_inspect_get_minor_version (guestfs_h *g,\n"
26733 " const char *root);\n"
26738 #: ../src/guestfs-actions.pod:3126
26740 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26741 "C<guestfs_inspect_get_major_version>."
26745 #: ../src/guestfs-actions.pod:3133
26746 msgid "guestfs_inspect_get_mountpoints"
26750 #: ../src/guestfs-actions.pod:3135
26754 " guestfs_inspect_get_mountpoints (guestfs_h *g,\n"
26755 " const char *root);\n"
26760 #: ../src/guestfs-actions.pod:3156
26762 "For operating systems like Windows which still use drive letters, this call "
26763 "will only return an entry for the first drive \"mounted on\" C</>. For "
26764 "information about the mapping of drive letters to partitions, see "
26765 "C<guestfs_inspect_get_drive_mappings>."
26769 #: ../src/guestfs-actions.pod:3162
26771 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26772 "C<guestfs_inspect_get_filesystems>."
26776 #: ../src/guestfs-actions.pod:3173
26777 msgid "guestfs_inspect_get_package_format"
26781 #: ../src/guestfs-actions.pod:3175
26785 " guestfs_inspect_get_package_format (guestfs_h *g,\n"
26786 " const char *root);\n"
26791 #: ../src/guestfs-actions.pod:3179
26793 "This function and C<guestfs_inspect_get_package_management> return the "
26794 "package format and package management tool used by the inspected operating "
26795 "system. For example for Fedora these functions would return C<rpm> (package "
26796 "format) and C<yum> (package management)."
26800 #: ../src/guestfs-actions.pod:3198 ../src/guestfs-actions.pod:3226
26801 msgid "(Added in 1.7.5)"
26805 #: ../src/guestfs-actions.pod:3200
26806 msgid "guestfs_inspect_get_package_management"
26810 #: ../src/guestfs-actions.pod:3202
26814 " guestfs_inspect_get_package_management (guestfs_h *g,\n"
26815 " const char *root);\n"
26820 #: ../src/guestfs-actions.pod:3206
26822 "C<guestfs_inspect_get_package_format> and this function return the package "
26823 "format and package management tool used by the inspected operating system. "
26824 "For example for Fedora these functions would return C<rpm> (package format) "
26825 "and C<yum> (package management)."
26829 #: ../src/guestfs-actions.pod:3228
26830 msgid "guestfs_inspect_get_product_name"
26834 #: ../src/guestfs-actions.pod:3230
26838 " guestfs_inspect_get_product_name (guestfs_h *g,\n"
26839 " const char *root);\n"
26844 #: ../src/guestfs-actions.pod:3249
26845 msgid "guestfs_inspect_get_product_variant"
26849 #: ../src/guestfs-actions.pod:3251
26853 " guestfs_inspect_get_product_variant (guestfs_h *g,\n"
26854 " const char *root);\n"
26859 #: ../src/guestfs-actions.pod:3274
26861 "Please read L<guestfs(3)/INSPECTION> for more details. See also "
26862 "C<guestfs_inspect_get_product_name>, C<guestfs_inspect_get_major_version>."
26866 #: ../src/guestfs-actions.pod:3281
26867 msgid "(Added in 1.9.13)"
26871 #: ../src/guestfs-actions.pod:3283
26872 msgid "guestfs_inspect_get_roots"
26876 #: ../src/guestfs-actions.pod:3285
26880 " guestfs_inspect_get_roots (guestfs_h *g);\n"
26885 #: ../src/guestfs-actions.pod:3288
26887 "This function is a convenient way to get the list of root devices, as "
26888 "returned from a previous call to C<guestfs_inspect_os>, but without redoing "
26889 "the whole inspection process."
26893 #: ../src/guestfs-actions.pod:3292
26895 "This returns an empty list if either no root devices were found or the "
26896 "caller has not called C<guestfs_inspect_os>."
26900 #: ../src/guestfs-actions.pod:3301
26901 msgid "(Added in 1.7.3)"
26905 #: ../src/guestfs-actions.pod:3303
26906 msgid "guestfs_inspect_get_type"
26910 #: ../src/guestfs-actions.pod:3305
26914 " guestfs_inspect_get_type (guestfs_h *g,\n"
26915 " const char *root);\n"
26920 #: ../src/guestfs-actions.pod:3346
26921 msgid "guestfs_inspect_get_windows_current_control_set"
26925 #: ../src/guestfs-actions.pod:3348
26929 " guestfs_inspect_get_windows_current_control_set (guestfs_h *g,\n"
26930 " const char *root);\n"
26935 #: ../src/guestfs-actions.pod:3366
26936 msgid "guestfs_inspect_get_windows_systemroot"
26940 #: ../src/guestfs-actions.pod:3368
26944 " guestfs_inspect_get_windows_systemroot (guestfs_h *g,\n"
26945 " const char *root);\n"
26950 #: ../src/guestfs-actions.pod:3384
26951 msgid "(Added in 1.5.25)"
26955 #: ../src/guestfs-actions.pod:3386
26956 msgid "guestfs_inspect_is_live"
26960 #: ../src/guestfs-actions.pod:3388
26964 " guestfs_inspect_is_live (guestfs_h *g,\n"
26965 " const char *root);\n"
26970 #: ../src/guestfs-actions.pod:3392
26972 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26973 "disk), then this returns true if a live image was detected on the disk."
26977 #: ../src/guestfs-actions.pod:3402
26978 msgid "guestfs_inspect_is_multipart"
26982 #: ../src/guestfs-actions.pod:3404
26986 " guestfs_inspect_is_multipart (guestfs_h *g,\n"
26987 " const char *root);\n"
26992 #: ../src/guestfs-actions.pod:3408
26994 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
26995 "disk), then this returns true if the disk is part of a set."
26999 #: ../src/guestfs-actions.pod:3418
27000 msgid "guestfs_inspect_is_netinst"
27004 #: ../src/guestfs-actions.pod:3420
27008 " guestfs_inspect_is_netinst (guestfs_h *g,\n"
27009 " const char *root);\n"
27014 #: ../src/guestfs-actions.pod:3424
27016 "If C<guestfs_inspect_get_format> returns C<installer> (this is an install "
27017 "disk), then this returns true if the disk is a network installer, ie. not a "
27018 "self-contained install CD but one which is likely to require network access "
27019 "to complete the install."
27023 #: ../src/guestfs-actions.pod:3436
27024 msgid "guestfs_inspect_list_applications"
27028 #: ../src/guestfs-actions.pod:3438
27031 " struct guestfs_application_list *\n"
27032 " guestfs_inspect_list_applications (guestfs_h *g,\n"
27033 " const char *root);\n"
27038 #: ../src/guestfs-actions.pod:3444
27040 "I<Note:> This call works differently from other parts of the inspection "
27041 "API. You have to call C<guestfs_inspect_os>, then "
27042 "C<guestfs_inspect_get_mountpoints>, then mount up the disks, before calling "
27043 "this. Listing applications is a significantly more difficult operation "
27044 "which requires access to the full filesystem. Also note that unlike the "
27045 "other C<guestfs_inspect_get_*> calls which are just returning data cached in "
27046 "the libguestfs handle, this call actually reads parts of the mounted "
27047 "filesystems during the call."
27051 #: ../src/guestfs-actions.pod:3534
27053 "This function returns a C<struct guestfs_application_list *>, or NULL if "
27054 "there was an error. I<The caller must call C<guestfs_free_application_list> "
27059 #: ../src/guestfs-actions.pod:3538
27060 msgid "(Added in 1.7.8)"
27064 #: ../src/guestfs-actions.pod:3540
27065 msgid "guestfs_inspect_os"
27069 #: ../src/guestfs-actions.pod:3542
27073 " guestfs_inspect_os (guestfs_h *g);\n"
27078 #: ../src/guestfs-actions.pod:3558
27080 "You can pass the root string(s) returned to other C<guestfs_inspect_get_*> "
27081 "functions in order to query further information about each operating system, "
27082 "such as the name and version."
27086 #: ../src/guestfs-actions.pod:3563
27088 "This function uses other libguestfs features such as C<guestfs_mount_ro> and "
27089 "C<guestfs_umount_all> in order to mount and unmount filesystems and look at "
27090 "the contents. This should be called with no disks currently mounted. The "
27091 "function may also use Augeas, so any existing Augeas handle will be closed."
27095 #: ../src/guestfs-actions.pod:3575 ../src/guestfs-actions.pod:3906 ../src/guestfs-actions.pod:3988
27096 msgid "See also C<guestfs_list_filesystems>."
27100 #: ../src/guestfs-actions.pod:3583
27101 msgid "guestfs_is_blockdev"
27105 #: ../src/guestfs-actions.pod:3585
27109 " guestfs_is_blockdev (guestfs_h *g,\n"
27110 " const char *path);\n"
27115 #: ../src/guestfs-actions.pod:3592 ../src/guestfs-actions.pod:3621 ../src/guestfs-actions.pod:3651 ../src/guestfs-actions.pod:3666 ../src/guestfs-actions.pod:3682 ../src/guestfs-actions.pod:3738 ../src/guestfs-actions.pod:3753
27116 msgid "See also C<guestfs_stat>."
27120 #: ../src/guestfs-actions.pod:3596 ../src/guestfs-actions.pod:3625 ../src/guestfs-actions.pod:3670 ../src/guestfs-actions.pod:3742 ../src/guestfs-actions.pod:3757
27121 msgid "(Added in 1.5.10)"
27125 #: ../src/guestfs-actions.pod:3598
27126 msgid "guestfs_is_busy"
27130 #: ../src/guestfs-actions.pod:3600
27134 " guestfs_is_busy (guestfs_h *g);\n"
27139 #: ../src/guestfs-actions.pod:3612
27140 msgid "guestfs_is_chardev"
27144 #: ../src/guestfs-actions.pod:3614
27148 " guestfs_is_chardev (guestfs_h *g,\n"
27149 " const char *path);\n"
27154 #: ../src/guestfs-actions.pod:3627
27155 msgid "guestfs_is_config"
27159 #: ../src/guestfs-actions.pod:3629
27163 " guestfs_is_config (guestfs_h *g);\n"
27168 #: ../src/guestfs-actions.pod:3641
27169 msgid "guestfs_is_dir"
27173 #: ../src/guestfs-actions.pod:3643
27177 " guestfs_is_dir (guestfs_h *g,\n"
27178 " const char *path);\n"
27183 #: ../src/guestfs-actions.pod:3657
27184 msgid "guestfs_is_fifo"
27188 #: ../src/guestfs-actions.pod:3659
27192 " guestfs_is_fifo (guestfs_h *g,\n"
27193 " const char *path);\n"
27198 #: ../src/guestfs-actions.pod:3672
27199 msgid "guestfs_is_file"
27203 #: ../src/guestfs-actions.pod:3674
27207 " guestfs_is_file (guestfs_h *g,\n"
27208 " const char *path);\n"
27213 #: ../src/guestfs-actions.pod:3688
27214 msgid "guestfs_is_launching"
27218 #: ../src/guestfs-actions.pod:3690
27222 " guestfs_is_launching (guestfs_h *g);\n"
27227 #: ../src/guestfs-actions.pod:3702
27228 msgid "guestfs_is_lv"
27232 #: ../src/guestfs-actions.pod:3704
27236 " guestfs_is_lv (guestfs_h *g,\n"
27237 " const char *device);\n"
27242 #: ../src/guestfs-actions.pod:3715
27243 msgid "guestfs_is_ready"
27247 #: ../src/guestfs-actions.pod:3717
27251 " guestfs_is_ready (guestfs_h *g);\n"
27256 #: ../src/guestfs-actions.pod:3729
27257 msgid "guestfs_is_socket"
27261 #: ../src/guestfs-actions.pod:3731
27265 " guestfs_is_socket (guestfs_h *g,\n"
27266 " const char *path);\n"
27271 #: ../src/guestfs-actions.pod:3744
27272 msgid "guestfs_is_symlink"
27276 #: ../src/guestfs-actions.pod:3746
27280 " guestfs_is_symlink (guestfs_h *g,\n"
27281 " const char *path);\n"
27286 #: ../src/guestfs-actions.pod:3759
27287 msgid "guestfs_is_zero"
27291 #: ../src/guestfs-actions.pod:3761
27295 " guestfs_is_zero (guestfs_h *g,\n"
27296 " const char *path);\n"
27301 #: ../src/guestfs-actions.pod:3770 ../src/guestfs-actions.pod:3784
27302 msgid "(Added in 1.11.8)"
27306 #: ../src/guestfs-actions.pod:3772
27307 msgid "guestfs_is_zero_device"
27311 #: ../src/guestfs-actions.pod:3774
27315 " guestfs_is_zero_device (guestfs_h *g,\n"
27316 " const char *device);\n"
27321 #: ../src/guestfs-actions.pod:3786
27322 msgid "guestfs_kill_subprocess"
27326 #: ../src/guestfs-actions.pod:3788
27330 " guestfs_kill_subprocess (guestfs_h *g);\n"
27335 #: ../src/guestfs-actions.pod:3797
27336 msgid "guestfs_launch"
27340 #: ../src/guestfs-actions.pod:3799
27344 " guestfs_launch (guestfs_h *g);\n"
27349 #: ../src/guestfs-actions.pod:3817
27350 msgid "guestfs_lchown"
27354 #: ../src/guestfs-actions.pod:3819
27358 " guestfs_lchown (guestfs_h *g,\n"
27361 " const char *path);\n"
27366 #: ../src/guestfs-actions.pod:3825
27368 "Change the file owner to C<owner> and group to C<group>. This is like "
27369 "C<guestfs_chown> but if C<path> is a symlink then the link itself is "
27370 "changed, not the target."
27374 #: ../src/guestfs-actions.pod:3837
27375 msgid "guestfs_lgetxattr"
27379 #: ../src/guestfs-actions.pod:3839
27383 " guestfs_lgetxattr (guestfs_h *g,\n"
27384 " const char *path,\n"
27385 " const char *name,\n"
27386 " size_t *size_r);\n"
27391 #: ../src/guestfs-actions.pod:3859
27392 msgid "See also: C<guestfs_lgetxattrs>, C<guestfs_getxattr>, L<attr(5)>."
27396 #: ../src/guestfs-actions.pod:3867
27397 msgid "guestfs_lgetxattrs"
27401 #: ../src/guestfs-actions.pod:3869
27404 " struct guestfs_xattr_list *\n"
27405 " guestfs_lgetxattrs (guestfs_h *g,\n"
27406 " const char *path);\n"
27411 #: ../src/guestfs-actions.pod:3873
27413 "This is the same as C<guestfs_getxattrs>, but if C<path> is a symbolic link, "
27414 "then it returns the extended attributes of the link itself."
27418 #: ../src/guestfs-actions.pod:3883
27419 msgid "guestfs_list_9p"
27423 #: ../src/guestfs-actions.pod:3885
27427 " guestfs_list_9p (guestfs_h *g);\n"
27432 #: ../src/guestfs-actions.pod:3897
27433 msgid "guestfs_list_devices"
27437 #: ../src/guestfs-actions.pod:3899
27441 " guestfs_list_devices (guestfs_h *g);\n"
27446 #: ../src/guestfs-actions.pod:3914
27447 msgid "guestfs_list_dm_devices"
27451 #: ../src/guestfs-actions.pod:3916
27455 " guestfs_list_dm_devices (guestfs_h *g);\n"
27460 #: ../src/guestfs-actions.pod:3921
27462 "The returned list contains C</dev/mapper/*> devices, eg. ones created by a "
27463 "previous call to C<guestfs_luks_open>."
27467 #: ../src/guestfs-actions.pod:3924
27469 "Device mapper devices which correspond to logical volumes are I<not> "
27470 "returned in this list. Call C<guestfs_lvs> if you want to list logical "
27475 #: ../src/guestfs-actions.pod:3932 ../src/guestfs-actions.pod:5378
27476 msgid "(Added in 1.11.15)"
27480 #: ../src/guestfs-actions.pod:3934
27481 msgid "guestfs_list_filesystems"
27485 #: ../src/guestfs-actions.pod:3936
27489 " guestfs_list_filesystems (guestfs_h *g);\n"
27494 #: ../src/guestfs-actions.pod:3956
27496 "This command runs other libguestfs commands, which might include "
27497 "C<guestfs_mount> and C<guestfs_umount>, and therefore you should use this "
27498 "soon after launch and only when nothing is mounted."
27502 #: ../src/guestfs-actions.pod:3960
27504 "Not all of the filesystems returned will be mountable. In particular, swap "
27505 "partitions are returned in the list. Also this command does not check that "
27506 "each filesystem found is valid and mountable, and some filesystems might be "
27507 "mountable but require special options. Filesystems may not all belong to a "
27508 "single logical operating system (use C<guestfs_inspect_os> to look for "
27513 #: ../src/guestfs-actions.pod:3974 ../src/guestfs-actions.pod:5739
27514 msgid "(Added in 1.5.15)"
27518 #: ../src/guestfs-actions.pod:3976
27519 msgid "guestfs_list_partitions"
27523 #: ../src/guestfs-actions.pod:3978
27527 " guestfs_list_partitions (guestfs_h *g);\n"
27532 #: ../src/guestfs-actions.pod:3985
27534 "This does not return logical volumes. For that you will need to call "
27539 #: ../src/guestfs-actions.pod:3996
27544 #: ../src/guestfs-actions.pod:3998
27548 " guestfs_ll (guestfs_h *g,\n"
27549 " const char *directory);\n"
27554 #: ../src/guestfs-actions.pod:4013
27559 #: ../src/guestfs-actions.pod:4015
27563 " guestfs_ln (guestfs_h *g,\n"
27564 " const char *target,\n"
27565 " const char *linkname);\n"
27570 #: ../src/guestfs-actions.pod:4026
27571 msgid "guestfs_ln_f"
27575 #: ../src/guestfs-actions.pod:4028
27579 " guestfs_ln_f (guestfs_h *g,\n"
27580 " const char *target,\n"
27581 " const char *linkname);\n"
27586 #: ../src/guestfs-actions.pod:4040
27587 msgid "guestfs_ln_s"
27591 #: ../src/guestfs-actions.pod:4042
27595 " guestfs_ln_s (guestfs_h *g,\n"
27596 " const char *target,\n"
27597 " const char *linkname);\n"
27602 #: ../src/guestfs-actions.pod:4053
27603 msgid "guestfs_ln_sf"
27607 #: ../src/guestfs-actions.pod:4055
27611 " guestfs_ln_sf (guestfs_h *g,\n"
27612 " const char *target,\n"
27613 " const char *linkname);\n"
27618 #: ../src/guestfs-actions.pod:4067
27619 msgid "guestfs_lremovexattr"
27623 #: ../src/guestfs-actions.pod:4069
27627 " guestfs_lremovexattr (guestfs_h *g,\n"
27628 " const char *xattr,\n"
27629 " const char *path);\n"
27634 #: ../src/guestfs-actions.pod:4074
27636 "This is the same as C<guestfs_removexattr>, but if C<path> is a symbolic "
27637 "link, then it removes an extended attribute of the link itself."
27641 #: ../src/guestfs-actions.pod:4082
27646 #: ../src/guestfs-actions.pod:4084
27650 " guestfs_ls (guestfs_h *g,\n"
27651 " const char *directory);\n"
27656 #: ../src/guestfs-actions.pod:4092
27658 "This command is mostly useful for interactive sessions. Programs should "
27659 "probably use C<guestfs_readdir> instead."
27663 #: ../src/guestfs-actions.pod:4101
27664 msgid "guestfs_lsetxattr"
27668 #: ../src/guestfs-actions.pod:4103
27672 " guestfs_lsetxattr (guestfs_h *g,\n"
27673 " const char *xattr,\n"
27674 " const char *val,\n"
27676 " const char *path);\n"
27681 #: ../src/guestfs-actions.pod:4110
27683 "This is the same as C<guestfs_setxattr>, but if C<path> is a symbolic link, "
27684 "then it sets an extended attribute of the link itself."
27688 #: ../src/guestfs-actions.pod:4118
27689 msgid "guestfs_lstat"
27693 #: ../src/guestfs-actions.pod:4120
27696 " struct guestfs_stat *\n"
27697 " guestfs_lstat (guestfs_h *g,\n"
27698 " const char *path);\n"
27703 #: ../src/guestfs-actions.pod:4126
27705 "This is the same as C<guestfs_stat> except that if C<path> is a symbolic "
27706 "link, then the link is stat-ed, not the file it refers to."
27710 #: ../src/guestfs-actions.pod:4132 ../src/guestfs-actions.pod:6913
27712 "This function returns a C<struct guestfs_stat *>, or NULL if there was an "
27713 "error. I<The caller must call C<guestfs_free_stat> after use>."
27717 #: ../src/guestfs-actions.pod:4136 ../src/guestfs-actions.pod:6917 ../src/guestfs-actions.pod:6935 ../src/guestfs-actions.pod:7316
27718 msgid "(Added in 0.9.2)"
27722 #: ../src/guestfs-actions.pod:4138
27723 msgid "guestfs_lstatlist"
27727 #: ../src/guestfs-actions.pod:4140
27730 " struct guestfs_stat_list *\n"
27731 " guestfs_lstatlist (guestfs_h *g,\n"
27732 " const char *path,\n"
27733 " char *const *names);\n"
27738 #: ../src/guestfs-actions.pod:4145
27740 "This call allows you to perform the C<guestfs_lstat> operation on multiple "
27741 "files, where all files are in the directory C<path>. C<names> is the list "
27742 "of files from this directory."
27746 #: ../src/guestfs-actions.pod:4154
27748 "This call is intended for programs that want to efficiently list a directory "
27749 "contents without making many round-trips. See also C<guestfs_lxattrlist> "
27750 "for a similarly efficient call for getting extended attributes. Very long "
27751 "directory listings might cause the protocol message size to be exceeded, "
27752 "causing this call to fail. The caller must split up such requests into "
27753 "smaller groups of names."
27757 #: ../src/guestfs-actions.pod:4162
27759 "This function returns a C<struct guestfs_stat_list *>, or NULL if there was "
27760 "an error. I<The caller must call C<guestfs_free_stat_list> after use>."
27764 #: ../src/guestfs-actions.pod:4168
27765 msgid "guestfs_luks_add_key"
27769 #: ../src/guestfs-actions.pod:4170
27773 " guestfs_luks_add_key (guestfs_h *g,\n"
27774 " const char *device,\n"
27775 " const char *key,\n"
27776 " const char *newkey,\n"
27782 #: ../src/guestfs-actions.pod:4182
27784 "Note that if C<keyslot> already contains a key, then this command will "
27785 "fail. You have to use C<guestfs_luks_kill_slot> first to remove that key."
27789 #: ../src/guestfs-actions.pod:4188 ../src/guestfs-actions.pod:4228 ../src/guestfs-actions.pod:4251 ../src/guestfs-actions.pod:4271 ../src/guestfs-actions.pod:4306 ../src/guestfs-actions.pod:4325
27791 "This function takes a key or passphrase parameter which could contain "
27792 "sensitive material. Read the section L</KEYS AND PASSPHRASES> for more "
27797 #: ../src/guestfs-actions.pod:4192 ../src/guestfs-actions.pod:4232 ../src/guestfs-actions.pod:4255 ../src/guestfs-actions.pod:4275
27798 msgid "(Added in 1.5.2)"
27802 #: ../src/guestfs-actions.pod:4194
27803 msgid "guestfs_luks_close"
27807 #: ../src/guestfs-actions.pod:4196
27811 " guestfs_luks_close (guestfs_h *g,\n"
27812 " const char *device);\n"
27817 #: ../src/guestfs-actions.pod:4200
27819 "This closes a LUKS device that was created earlier by C<guestfs_luks_open> "
27820 "or C<guestfs_luks_open_ro>. The C<device> parameter must be the name of the "
27821 "LUKS mapping device (ie. C</dev/mapper/mapname>) and I<not> the name of the "
27822 "underlying block device."
27826 #: ../src/guestfs-actions.pod:4208 ../src/guestfs-actions.pod:4310 ../src/guestfs-actions.pod:4329 ../src/guestfs-actions.pod:4379 ../src/guestfs-actions.pod:4427
27827 msgid "(Added in 1.5.1)"
27831 #: ../src/guestfs-actions.pod:4210
27832 msgid "guestfs_luks_format"
27836 #: ../src/guestfs-actions.pod:4212
27840 " guestfs_luks_format (guestfs_h *g,\n"
27841 " const char *device,\n"
27842 " const char *key,\n"
27848 #: ../src/guestfs-actions.pod:4234
27849 msgid "guestfs_luks_format_cipher"
27853 #: ../src/guestfs-actions.pod:4236
27857 " guestfs_luks_format_cipher (guestfs_h *g,\n"
27858 " const char *device,\n"
27859 " const char *key,\n"
27861 " const char *cipher);\n"
27866 #: ../src/guestfs-actions.pod:4243
27868 "This command is the same as C<guestfs_luks_format> but it also allows you to "
27869 "set the C<cipher> used."
27873 #: ../src/guestfs-actions.pod:4257
27874 msgid "guestfs_luks_kill_slot"
27878 #: ../src/guestfs-actions.pod:4259
27882 " guestfs_luks_kill_slot (guestfs_h *g,\n"
27883 " const char *device,\n"
27884 " const char *key,\n"
27890 #: ../src/guestfs-actions.pod:4277
27891 msgid "guestfs_luks_open"
27895 #: ../src/guestfs-actions.pod:4279
27899 " guestfs_luks_open (guestfs_h *g,\n"
27900 " const char *device,\n"
27901 " const char *key,\n"
27902 " const char *mapname);\n"
27907 #: ../src/guestfs-actions.pod:4297
27909 "If this block device contains LVM volume groups, then calling "
27910 "C<guestfs_vgscan> followed by C<guestfs_vg_activate_all> will make them "
27915 #: ../src/guestfs-actions.pod:4301
27916 msgid "Use C<guestfs_list_dm_devices> to list all device mapper devices."
27920 #: ../src/guestfs-actions.pod:4312
27921 msgid "guestfs_luks_open_ro"
27925 #: ../src/guestfs-actions.pod:4314
27929 " guestfs_luks_open_ro (guestfs_h *g,\n"
27930 " const char *device,\n"
27931 " const char *key,\n"
27932 " const char *mapname);\n"
27937 #: ../src/guestfs-actions.pod:4320
27939 "This is the same as C<guestfs_luks_open> except that a read-only mapping is "
27944 #: ../src/guestfs-actions.pod:4331
27945 msgid "guestfs_lvcreate"
27949 #: ../src/guestfs-actions.pod:4333
27953 " guestfs_lvcreate (guestfs_h *g,\n"
27954 " const char *logvol,\n"
27955 " const char *volgroup,\n"
27961 #: ../src/guestfs-actions.pod:4346
27962 msgid "guestfs_lvm_canonical_lv_name"
27966 #: ../src/guestfs-actions.pod:4348
27970 " guestfs_lvm_canonical_lv_name (guestfs_h *g,\n"
27971 " const char *lvname);\n"
27976 #: ../src/guestfs-actions.pod:4359
27977 msgid "See also C<guestfs_is_lv>."
27981 #: ../src/guestfs-actions.pod:4364
27982 msgid "(Added in 1.5.24)"
27986 #: ../src/guestfs-actions.pod:4366
27987 msgid "guestfs_lvm_clear_filter"
27991 #: ../src/guestfs-actions.pod:4368
27995 " guestfs_lvm_clear_filter (guestfs_h *g);\n"
28000 #: ../src/guestfs-actions.pod:4371
28002 "This undoes the effect of C<guestfs_lvm_set_filter>. LVM will be able to "
28003 "see every block device."
28007 #: ../src/guestfs-actions.pod:4381
28008 msgid "guestfs_lvm_remove_all"
28012 #: ../src/guestfs-actions.pod:4383
28016 " guestfs_lvm_remove_all (guestfs_h *g);\n"
28021 #: ../src/guestfs-actions.pod:4396
28022 msgid "guestfs_lvm_set_filter"
28026 #: ../src/guestfs-actions.pod:4398
28030 " guestfs_lvm_set_filter (guestfs_h *g,\n"
28031 " char *const *devices);\n"
28036 #: ../src/guestfs-actions.pod:4429
28037 msgid "guestfs_lvremove"
28041 #: ../src/guestfs-actions.pod:4431
28045 " guestfs_lvremove (guestfs_h *g,\n"
28046 " const char *device);\n"
28051 #: ../src/guestfs-actions.pod:4443 ../src/guestfs-actions.pod:5836 ../src/guestfs-actions.pod:7686
28052 msgid "(Added in 1.0.13)"
28056 #: ../src/guestfs-actions.pod:4445
28057 msgid "guestfs_lvrename"
28061 #: ../src/guestfs-actions.pod:4447
28065 " guestfs_lvrename (guestfs_h *g,\n"
28066 " const char *logvol,\n"
28067 " const char *newlogvol);\n"
28072 #: ../src/guestfs-actions.pod:4456 ../src/guestfs-actions.pod:7699
28073 msgid "(Added in 1.0.83)"
28077 #: ../src/guestfs-actions.pod:4458
28078 msgid "guestfs_lvresize"
28082 #: ../src/guestfs-actions.pod:4460
28086 " guestfs_lvresize (guestfs_h *g,\n"
28087 " const char *device,\n"
28093 #: ../src/guestfs-actions.pod:4473
28094 msgid "guestfs_lvresize_free"
28098 #: ../src/guestfs-actions.pod:4475
28102 " guestfs_lvresize_free (guestfs_h *g,\n"
28103 " const char *lv,\n"
28109 #: ../src/guestfs-actions.pod:4488
28110 msgid "(Added in 1.3.3)"
28114 #: ../src/guestfs-actions.pod:4490
28115 msgid "guestfs_lvs"
28119 #: ../src/guestfs-actions.pod:4492
28123 " guestfs_lvs (guestfs_h *g);\n"
28128 #: ../src/guestfs-actions.pod:4501
28129 msgid "See also C<guestfs_lvs_full>, C<guestfs_list_filesystems>."
28133 #: ../src/guestfs-actions.pod:4509
28134 msgid "guestfs_lvs_full"
28138 #: ../src/guestfs-actions.pod:4511
28141 " struct guestfs_lvm_lv_list *\n"
28142 " guestfs_lvs_full (guestfs_h *g);\n"
28147 #: ../src/guestfs-actions.pod:4517
28149 "This function returns a C<struct guestfs_lvm_lv_list *>, or NULL if there "
28150 "was an error. I<The caller must call C<guestfs_free_lvm_lv_list> after "
28155 #: ../src/guestfs-actions.pod:4523
28156 msgid "guestfs_lvuuid"
28160 #: ../src/guestfs-actions.pod:4525
28164 " guestfs_lvuuid (guestfs_h *g,\n"
28165 " const char *device);\n"
28170 #: ../src/guestfs-actions.pod:4536
28171 msgid "guestfs_lxattrlist"
28175 #: ../src/guestfs-actions.pod:4538
28178 " struct guestfs_xattr_list *\n"
28179 " guestfs_lxattrlist (guestfs_h *g,\n"
28180 " const char *path,\n"
28181 " char *const *names);\n"
28186 #: ../src/guestfs-actions.pod:4557
28188 "This call is intended for programs that want to efficiently list a directory "
28189 "contents without making many round-trips. See also C<guestfs_lstatlist> for "
28190 "a similarly efficient call for getting standard stats. Very long directory "
28191 "listings might cause the protocol message size to be exceeded, causing this "
28192 "call to fail. The caller must split up such requests into smaller groups of "
28197 #: ../src/guestfs-actions.pod:4571
28198 msgid "guestfs_mkdir"
28202 #: ../src/guestfs-actions.pod:4573
28206 " guestfs_mkdir (guestfs_h *g,\n"
28207 " const char *path);\n"
28212 #: ../src/guestfs-actions.pod:4583
28213 msgid "guestfs_mkdir_mode"
28217 #: ../src/guestfs-actions.pod:4585
28221 " guestfs_mkdir_mode (guestfs_h *g,\n"
28222 " const char *path,\n"
28228 #: ../src/guestfs-actions.pod:4597
28229 msgid "See also C<guestfs_mkdir>, C<guestfs_umask>"
28233 #: ../src/guestfs-actions.pod:4603
28234 msgid "guestfs_mkdir_p"
28238 #: ../src/guestfs-actions.pod:4605
28242 " guestfs_mkdir_p (guestfs_h *g,\n"
28243 " const char *path);\n"
28248 #: ../src/guestfs-actions.pod:4616
28249 msgid "guestfs_mkdtemp"
28253 #: ../src/guestfs-actions.pod:4618
28257 " guestfs_mkdtemp (guestfs_h *g,\n"
28258 " const char *template);\n"
28263 #: ../src/guestfs-actions.pod:4646
28264 msgid "guestfs_mke2fs_J"
28268 #: ../src/guestfs-actions.pod:4648
28272 " guestfs_mke2fs_J (guestfs_h *g,\n"
28273 " const char *fstype,\n"
28274 " int blocksize,\n"
28275 " const char *device,\n"
28276 " const char *journal);\n"
28281 #: ../src/guestfs-actions.pod:4661
28282 msgid "See also C<guestfs_mke2journal>."
28286 #: ../src/guestfs-actions.pod:4665 ../src/guestfs-actions.pod:4683 ../src/guestfs-actions.pod:4701 ../src/guestfs-actions.pod:4717 ../src/guestfs-actions.pod:4731 ../src/guestfs-actions.pod:4745 ../src/guestfs-actions.pod:4804 ../src/guestfs-actions.pod:5081
28287 msgid "(Added in 1.0.68)"
28291 #: ../src/guestfs-actions.pod:4667
28292 msgid "guestfs_mke2fs_JL"
28296 #: ../src/guestfs-actions.pod:4669
28300 " guestfs_mke2fs_JL (guestfs_h *g,\n"
28301 " const char *fstype,\n"
28302 " int blocksize,\n"
28303 " const char *device,\n"
28304 " const char *label);\n"
28309 #: ../src/guestfs-actions.pod:4679
28310 msgid "See also C<guestfs_mke2journal_L>."
28314 #: ../src/guestfs-actions.pod:4685
28315 msgid "guestfs_mke2fs_JU"
28319 #: ../src/guestfs-actions.pod:4687
28323 " guestfs_mke2fs_JU (guestfs_h *g,\n"
28324 " const char *fstype,\n"
28325 " int blocksize,\n"
28326 " const char *device,\n"
28327 " const char *uuid);\n"
28332 #: ../src/guestfs-actions.pod:4697
28333 msgid "See also C<guestfs_mke2journal_U>."
28337 #: ../src/guestfs-actions.pod:4703
28338 msgid "guestfs_mke2journal"
28342 #: ../src/guestfs-actions.pod:4705
28346 " guestfs_mke2journal (guestfs_h *g,\n"
28347 " int blocksize,\n"
28348 " const char *device);\n"
28353 #: ../src/guestfs-actions.pod:4719
28354 msgid "guestfs_mke2journal_L"
28358 #: ../src/guestfs-actions.pod:4721
28362 " guestfs_mke2journal_L (guestfs_h *g,\n"
28363 " int blocksize,\n"
28364 " const char *label,\n"
28365 " const char *device);\n"
28370 #: ../src/guestfs-actions.pod:4733
28371 msgid "guestfs_mke2journal_U"
28375 #: ../src/guestfs-actions.pod:4735
28379 " guestfs_mke2journal_U (guestfs_h *g,\n"
28380 " int blocksize,\n"
28381 " const char *uuid,\n"
28382 " const char *device);\n"
28387 #: ../src/guestfs-actions.pod:4747
28388 msgid "guestfs_mkfifo"
28392 #: ../src/guestfs-actions.pod:4749
28396 " guestfs_mkfifo (guestfs_h *g,\n"
28398 " const char *path);\n"
28403 #: ../src/guestfs-actions.pod:4754
28405 "This call creates a FIFO (named pipe) called C<path> with mode C<mode>. It "
28406 "is just a convenient wrapper around C<guestfs_mknod>."
28410 #: ../src/guestfs-actions.pod:4764
28411 msgid "guestfs_mkfs"
28415 #: ../src/guestfs-actions.pod:4766
28419 " guestfs_mkfs (guestfs_h *g,\n"
28420 " const char *fstype,\n"
28421 " const char *device);\n"
28426 #: ../src/guestfs-actions.pod:4779
28427 msgid "guestfs_mkfs_b"
28431 #: ../src/guestfs-actions.pod:4781
28435 " guestfs_mkfs_b (guestfs_h *g,\n"
28436 " const char *fstype,\n"
28437 " int blocksize,\n"
28438 " const char *device);\n"
28443 #: ../src/guestfs-actions.pod:4787
28445 "I<This function is deprecated.> In new code, use the L</guestfs_mkfs_opts> "
28450 #: ../src/guestfs-actions.pod:4794
28452 "This call is similar to C<guestfs_mkfs>, but it allows you to control the "
28453 "block size of the resulting filesystem. Supported block sizes depend on the "
28454 "filesystem type, but typically they are C<1024>, C<2048> or C<4096> only."
28458 #: ../src/guestfs-actions.pod:4806
28459 msgid "guestfs_mkfs_opts"
28463 #: ../src/guestfs-actions.pod:4808
28467 " guestfs_mkfs_opts (guestfs_h *g,\n"
28468 " const char *fstype,\n"
28469 " const char *device,\n"
28475 #: ../src/guestfs-actions.pod:4819
28478 " GUESTFS_MKFS_OPTS_BLOCKSIZE, int blocksize,\n"
28479 " GUESTFS_MKFS_OPTS_FEATURES, const char *features,\n"
28480 " GUESTFS_MKFS_OPTS_INODE, int inode,\n"
28481 " GUESTFS_MKFS_OPTS_SECTORSIZE, int sectorsize,\n"
28486 #: ../src/guestfs-actions.pod:4867
28487 msgid "(Added in 1.7.19)"
28491 #: ../src/guestfs-actions.pod:4869
28492 msgid "guestfs_mkfs_opts_va"
28496 #: ../src/guestfs-actions.pod:4871
28500 " guestfs_mkfs_opts_va (guestfs_h *g,\n"
28501 " const char *fstype,\n"
28502 " const char *device,\n"
28503 " va_list args);\n"
28508 #: ../src/guestfs-actions.pod:4877
28509 msgid "This is the \"va_list variant\" of L</guestfs_mkfs_opts>."
28513 #: ../src/guestfs-actions.pod:4881
28514 msgid "guestfs_mkfs_opts_argv"
28518 #: ../src/guestfs-actions.pod:4883
28522 " guestfs_mkfs_opts_argv (guestfs_h *g,\n"
28523 " const char *fstype,\n"
28524 " const char *device,\n"
28525 " const struct guestfs_mkfs_opts_argv *optargs);\n"
28530 #: ../src/guestfs-actions.pod:4889
28531 msgid "This is the \"argv variant\" of L</guestfs_mkfs_opts>."
28535 #: ../src/guestfs-actions.pod:4893
28536 msgid "guestfs_mkmountpoint"
28540 #: ../src/guestfs-actions.pod:4895
28544 " guestfs_mkmountpoint (guestfs_h *g,\n"
28545 " const char *exemptpath);\n"
28550 #: ../src/guestfs-actions.pod:4899
28552 "C<guestfs_mkmountpoint> and C<guestfs_rmmountpoint> are specialized calls "
28553 "that can be used to create extra mountpoints before mounting the first "
28558 #: ../src/guestfs-actions.pod:4923
28560 "C<guestfs_mkmountpoint> is not compatible with C<guestfs_umount_all>. You "
28561 "may get unexpected errors if you try to mix these calls. It is safest to "
28562 "manually unmount filesystems and remove mountpoints after use."
28566 #: ../src/guestfs-actions.pod:4927
28568 "C<guestfs_umount_all> unmounts filesystems by sorting the paths longest "
28569 "first, so for this to work for manual mountpoints, you must ensure that the "
28570 "innermost mountpoints have the longest pathnames, as in the example code "
28575 #: ../src/guestfs-actions.pod:4934
28577 "Autosync [see C<guestfs_set_autosync>, this is set by default on handles] "
28578 "can cause C<guestfs_umount_all> to be called when the handle is closed which "
28579 "can also trigger these issues."
28583 #: ../src/guestfs-actions.pod:4940 ../src/guestfs-actions.pod:5246 ../src/guestfs-actions.pod:6256
28584 msgid "(Added in 1.0.62)"
28588 #: ../src/guestfs-actions.pod:4942
28589 msgid "guestfs_mknod"
28593 #: ../src/guestfs-actions.pod:4944
28597 " guestfs_mknod (guestfs_h *g,\n"
28601 " const char *path);\n"
28606 #: ../src/guestfs-actions.pod:4959
28608 "Note that, just like L<mknod(2)>, the mode must be bitwise OR'd with "
28609 "S_IFBLK, S_IFCHR, S_IFIFO or S_IFSOCK (otherwise this call just creates a "
28610 "regular file). These constants are available in the standard Linux header "
28611 "files, or you can use C<guestfs_mknod_b>, C<guestfs_mknod_c> or "
28612 "C<guestfs_mkfifo> which are wrappers around this command which bitwise OR in "
28613 "the appropriate constant for you."
28617 #: ../src/guestfs-actions.pod:4973
28618 msgid "guestfs_mknod_b"
28622 #: ../src/guestfs-actions.pod:4975
28626 " guestfs_mknod_b (guestfs_h *g,\n"
28630 " const char *path);\n"
28635 #: ../src/guestfs-actions.pod:4982
28637 "This call creates a block device node called C<path> with mode C<mode> and "
28638 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28639 "wrapper around C<guestfs_mknod>."
28643 #: ../src/guestfs-actions.pod:4992
28644 msgid "guestfs_mknod_c"
28648 #: ../src/guestfs-actions.pod:4994
28652 " guestfs_mknod_c (guestfs_h *g,\n"
28656 " const char *path);\n"
28661 #: ../src/guestfs-actions.pod:5001
28663 "This call creates a char device node called C<path> with mode C<mode> and "
28664 "device major/minor C<devmajor> and C<devminor>. It is just a convenient "
28665 "wrapper around C<guestfs_mknod>."
28669 #: ../src/guestfs-actions.pod:5011
28670 msgid "guestfs_mkswap"
28674 #: ../src/guestfs-actions.pod:5013
28678 " guestfs_mkswap (guestfs_h *g,\n"
28679 " const char *device);\n"
28684 #: ../src/guestfs-actions.pod:5023
28685 msgid "guestfs_mkswap_L"
28689 #: ../src/guestfs-actions.pod:5025
28693 " guestfs_mkswap_L (guestfs_h *g,\n"
28694 " const char *label,\n"
28695 " const char *device);\n"
28700 #: ../src/guestfs-actions.pod:5040
28701 msgid "guestfs_mkswap_U"
28705 #: ../src/guestfs-actions.pod:5042
28709 " guestfs_mkswap_U (guestfs_h *g,\n"
28710 " const char *uuid,\n"
28711 " const char *device);\n"
28716 #: ../src/guestfs-actions.pod:5053
28717 msgid "guestfs_mkswap_file"
28721 #: ../src/guestfs-actions.pod:5055
28725 " guestfs_mkswap_file (guestfs_h *g,\n"
28726 " const char *path);\n"
28731 #: ../src/guestfs-actions.pod:5061
28733 "This command just writes a swap file signature to an existing file. To "
28734 "create the file itself, use something like C<guestfs_fallocate>."
28738 #: ../src/guestfs-actions.pod:5068
28739 msgid "guestfs_modprobe"
28743 #: ../src/guestfs-actions.pod:5070
28747 " guestfs_modprobe (guestfs_h *g,\n"
28748 " const char *modulename);\n"
28753 #: ../src/guestfs-actions.pod:5083
28754 msgid "guestfs_mount"
28758 #: ../src/guestfs-actions.pod:5085
28762 " guestfs_mount (guestfs_h *g,\n"
28763 " const char *device,\n"
28764 " const char *mountpoint);\n"
28769 #: ../src/guestfs-actions.pod:5104
28771 "Before libguestfs 1.13.16, this call implicitly added the options C<sync> "
28772 "and C<noatime>. The C<sync> option greatly slowed writes and caused many "
28773 "problems for users. If your program might need to work with older versions "
28774 "of libguestfs, use C<guestfs_mount_options> instead (using an empty string "
28775 "for the first parameter if you don't want any options)."
28779 #: ../src/guestfs-actions.pod:5115
28780 msgid "guestfs_mount_9p"
28784 #: ../src/guestfs-actions.pod:5117
28788 " guestfs_mount_9p (guestfs_h *g,\n"
28789 " const char *mounttag,\n"
28790 " const char *mountpoint,\n"
28796 #: ../src/guestfs-actions.pod:5128
28799 " GUESTFS_MOUNT_9P_OPTIONS, const char *options,\n"
28804 #: ../src/guestfs-actions.pod:5141
28805 msgid "guestfs_mount_9p_va"
28809 #: ../src/guestfs-actions.pod:5143
28813 " guestfs_mount_9p_va (guestfs_h *g,\n"
28814 " const char *mounttag,\n"
28815 " const char *mountpoint,\n"
28816 " va_list args);\n"
28821 #: ../src/guestfs-actions.pod:5149
28822 msgid "This is the \"va_list variant\" of L</guestfs_mount_9p>."
28826 #: ../src/guestfs-actions.pod:5153
28827 msgid "guestfs_mount_9p_argv"
28831 #: ../src/guestfs-actions.pod:5155
28835 " guestfs_mount_9p_argv (guestfs_h *g,\n"
28836 " const char *mounttag,\n"
28837 " const char *mountpoint,\n"
28838 " const struct guestfs_mount_9p_argv *optargs);\n"
28843 #: ../src/guestfs-actions.pod:5161
28844 msgid "This is the \"argv variant\" of L</guestfs_mount_9p>."
28848 #: ../src/guestfs-actions.pod:5165
28849 msgid "guestfs_mount_loop"
28853 #: ../src/guestfs-actions.pod:5167
28857 " guestfs_mount_loop (guestfs_h *g,\n"
28858 " const char *file,\n"
28859 " const char *mountpoint);\n"
28864 #: ../src/guestfs-actions.pod:5180
28865 msgid "guestfs_mount_options"
28869 #: ../src/guestfs-actions.pod:5182
28873 " guestfs_mount_options (guestfs_h *g,\n"
28874 " const char *options,\n"
28875 " const char *device,\n"
28876 " const char *mountpoint);\n"
28881 #: ../src/guestfs-actions.pod:5188
28883 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28884 "the mount options as for the L<mount(8)> I<-o> flag."
28888 #: ../src/guestfs-actions.pod:5198 ../src/guestfs-actions.pod:5212 ../src/guestfs-actions.pod:5229
28889 msgid "(Added in 1.0.10)"
28893 #: ../src/guestfs-actions.pod:5200
28894 msgid "guestfs_mount_ro"
28898 #: ../src/guestfs-actions.pod:5202
28902 " guestfs_mount_ro (guestfs_h *g,\n"
28903 " const char *device,\n"
28904 " const char *mountpoint);\n"
28909 #: ../src/guestfs-actions.pod:5207
28911 "This is the same as the C<guestfs_mount> command, but it mounts the "
28912 "filesystem with the read-only (I<-o ro>) flag."
28916 #: ../src/guestfs-actions.pod:5214
28917 msgid "guestfs_mount_vfs"
28921 #: ../src/guestfs-actions.pod:5216
28925 " guestfs_mount_vfs (guestfs_h *g,\n"
28926 " const char *options,\n"
28927 " const char *vfstype,\n"
28928 " const char *device,\n"
28929 " const char *mountpoint);\n"
28934 #: ../src/guestfs-actions.pod:5223
28936 "This is the same as the C<guestfs_mount> command, but it allows you to set "
28937 "both the mount options and the vfstype as for the L<mount(8)> I<-o> and "
28942 #: ../src/guestfs-actions.pod:5231
28943 msgid "guestfs_mountpoints"
28947 #: ../src/guestfs-actions.pod:5233
28951 " guestfs_mountpoints (guestfs_h *g);\n"
28956 #: ../src/guestfs-actions.pod:5236
28958 "This call is similar to C<guestfs_mounts>. That call returns a list of "
28959 "devices. This one returns a hash table (map) of device name to directory "
28960 "where the device is mounted."
28964 #: ../src/guestfs-actions.pod:5248
28965 msgid "guestfs_mounts"
28969 #: ../src/guestfs-actions.pod:5250
28973 " guestfs_mounts (guestfs_h *g);\n"
28978 #: ../src/guestfs-actions.pod:5258
28979 msgid "See also: C<guestfs_mountpoints>"
28983 #: ../src/guestfs-actions.pod:5266
28988 #: ../src/guestfs-actions.pod:5268
28992 " guestfs_mv (guestfs_h *g,\n"
28993 " const char *src,\n"
28994 " const char *dest);\n"
28999 #: ../src/guestfs-actions.pod:5280
29000 msgid "guestfs_ntfs_3g_probe"
29004 #: ../src/guestfs-actions.pod:5282
29008 " guestfs_ntfs_3g_probe (guestfs_h *g,\n"
29010 " const char *device);\n"
29015 #: ../src/guestfs-actions.pod:5301
29016 msgid "(Added in 1.0.43)"
29020 #: ../src/guestfs-actions.pod:5303
29021 msgid "guestfs_ntfsresize"
29025 #: ../src/guestfs-actions.pod:5305
29029 " guestfs_ntfsresize (guestfs_h *g,\n"
29030 " const char *device);\n"
29035 #: ../src/guestfs-actions.pod:5309 ../src/guestfs-actions.pod:5409
29037 "I<This function is deprecated.> In new code, use the "
29038 "L</guestfs_ntfsresize_opts> call instead."
29042 #: ../src/guestfs-actions.pod:5333
29043 msgid "guestfs_ntfsresize_opts"
29047 #: ../src/guestfs-actions.pod:5335
29051 " guestfs_ntfsresize_opts (guestfs_h *g,\n"
29052 " const char *device,\n"
29058 #: ../src/guestfs-actions.pod:5345
29061 " GUESTFS_NTFSRESIZE_OPTS_SIZE, int64_t size,\n"
29062 " GUESTFS_NTFSRESIZE_OPTS_FORCE, int force,\n"
29067 #: ../src/guestfs-actions.pod:5365
29069 "After the resize operation, the filesystem is always marked as requiring a "
29070 "consistency check (for safety). You have to boot into Windows to perform "
29071 "this check and clear this condition. If you I<don't> set the C<force> "
29072 "option then it is not possible to call C<guestfs_ntfsresize_opts> multiple "
29073 "times on a single filesystem without booting into Windows between each "
29078 #: ../src/guestfs-actions.pod:5380
29079 msgid "guestfs_ntfsresize_opts_va"
29083 #: ../src/guestfs-actions.pod:5382
29087 " guestfs_ntfsresize_opts_va (guestfs_h *g,\n"
29088 " const char *device,\n"
29089 " va_list args);\n"
29094 #: ../src/guestfs-actions.pod:5387
29095 msgid "This is the \"va_list variant\" of L</guestfs_ntfsresize_opts>."
29099 #: ../src/guestfs-actions.pod:5391
29100 msgid "guestfs_ntfsresize_opts_argv"
29104 #: ../src/guestfs-actions.pod:5393
29108 " guestfs_ntfsresize_opts_argv (guestfs_h *g,\n"
29109 " const char *device,\n"
29110 " const struct guestfs_ntfsresize_opts_argv "
29116 #: ../src/guestfs-actions.pod:5398
29117 msgid "This is the \"argv variant\" of L</guestfs_ntfsresize_opts>."
29121 #: ../src/guestfs-actions.pod:5402
29122 msgid "guestfs_ntfsresize_size"
29126 #: ../src/guestfs-actions.pod:5404
29130 " guestfs_ntfsresize_size (guestfs_h *g,\n"
29131 " const char *device,\n"
29132 " int64_t size);\n"
29137 #: ../src/guestfs-actions.pod:5416
29139 "This command is the same as C<guestfs_ntfsresize> except that it allows you "
29140 "to specify the new size (in bytes) explicitly."
29144 #: ../src/guestfs-actions.pod:5421 ../src/guestfs-actions.pod:5863 ../src/guestfs-actions.pod:5936 ../src/guestfs-actions.pod:6204 ../src/guestfs-actions.pod:7843
29145 msgid "(Added in 1.3.14)"
29149 #: ../src/guestfs-actions.pod:5423
29150 msgid "guestfs_part_add"
29154 #: ../src/guestfs-actions.pod:5425
29158 " guestfs_part_add (guestfs_h *g,\n"
29159 " const char *device,\n"
29160 " const char *prlogex,\n"
29161 " int64_t startsect,\n"
29162 " int64_t endsect);\n"
29167 #: ../src/guestfs-actions.pod:5432
29169 "This command adds a partition to C<device>. If there is no partition table "
29170 "on the device, call C<guestfs_part_init> first."
29174 #: ../src/guestfs-actions.pod:5444
29176 "Creating a partition which covers the whole disk is not so easy. Use "
29177 "C<guestfs_part_disk> to do that."
29181 #: ../src/guestfs-actions.pod:5449 ../src/guestfs-actions.pod:5487 ../src/guestfs-actions.pod:5540 ../src/guestfs-actions.pod:5624 ../src/guestfs-actions.pod:5662 ../src/guestfs-actions.pod:5681 ../src/guestfs-actions.pod:5721
29182 msgid "(Added in 1.0.78)"
29186 #: ../src/guestfs-actions.pod:5451
29187 msgid "guestfs_part_del"
29191 #: ../src/guestfs-actions.pod:5453
29195 " guestfs_part_del (guestfs_h *g,\n"
29196 " const char *device,\n"
29202 #: ../src/guestfs-actions.pod:5468
29203 msgid "guestfs_part_disk"
29207 #: ../src/guestfs-actions.pod:5470
29211 " guestfs_part_disk (guestfs_h *g,\n"
29212 " const char *device,\n"
29213 " const char *parttype);\n"
29218 #: ../src/guestfs-actions.pod:5475
29220 "This command is simply a combination of C<guestfs_part_init> followed by "
29221 "C<guestfs_part_add> to create a single primary partition covering the whole "
29226 #: ../src/guestfs-actions.pod:5479
29228 "C<parttype> is the partition table type, usually C<mbr> or C<gpt>, but other "
29229 "possible values are described in C<guestfs_part_init>."
29233 #: ../src/guestfs-actions.pod:5489
29234 msgid "guestfs_part_get_bootable"
29238 #: ../src/guestfs-actions.pod:5491
29242 " guestfs_part_get_bootable (guestfs_h *g,\n"
29243 " const char *device,\n"
29249 #: ../src/guestfs-actions.pod:5499
29250 msgid "See also C<guestfs_part_set_bootable>."
29254 #: ../src/guestfs-actions.pod:5505
29255 msgid "guestfs_part_get_mbr_id"
29259 #: ../src/guestfs-actions.pod:5507
29263 " guestfs_part_get_mbr_id (guestfs_h *g,\n"
29264 " const char *device,\n"
29270 #: ../src/guestfs-actions.pod:5515 ../src/guestfs-actions.pod:5697
29272 "Note that only MBR (old DOS-style) partitions have type bytes. You will get "
29273 "undefined results for other partition table types (see "
29274 "C<guestfs_part_get_parttype>)."
29278 #: ../src/guestfs-actions.pod:5523
29279 msgid "guestfs_part_get_parttype"
29283 #: ../src/guestfs-actions.pod:5525
29287 " guestfs_part_get_parttype (guestfs_h *g,\n"
29288 " const char *device);\n"
29293 #: ../src/guestfs-actions.pod:5532
29295 "Common return values include: C<msdos> (a DOS/Windows style MBR partition "
29296 "table), C<gpt> (a GPT/EFI-style partition table). Other values are "
29297 "possible, although unusual. See C<guestfs_part_init> for a full list."
29301 #: ../src/guestfs-actions.pod:5542
29302 msgid "guestfs_part_init"
29306 #: ../src/guestfs-actions.pod:5544
29310 " guestfs_part_init (guestfs_h *g,\n"
29311 " const char *device,\n"
29312 " const char *parttype);\n"
29317 #: ../src/guestfs-actions.pod:5553
29319 "Initially there are no partitions. Following this, you should call "
29320 "C<guestfs_part_add> for each partition required."
29324 #: ../src/guestfs-actions.pod:5626
29325 msgid "guestfs_part_list"
29329 #: ../src/guestfs-actions.pod:5628
29332 " struct guestfs_partition_list *\n"
29333 " guestfs_part_list (guestfs_h *g,\n"
29334 " const char *device);\n"
29339 #: ../src/guestfs-actions.pod:5645
29341 "Start of the partition I<in bytes>. To get sectors you have to divide by "
29342 "the device's sector size, see C<guestfs_blockdev_getss>."
29346 #: ../src/guestfs-actions.pod:5658
29348 "This function returns a C<struct guestfs_partition_list *>, or NULL if there "
29349 "was an error. I<The caller must call C<guestfs_free_partition_list> after "
29354 #: ../src/guestfs-actions.pod:5664
29355 msgid "guestfs_part_set_bootable"
29359 #: ../src/guestfs-actions.pod:5666
29363 " guestfs_part_set_bootable (guestfs_h *g,\n"
29364 " const char *device,\n"
29366 " int bootable);\n"
29371 #: ../src/guestfs-actions.pod:5683
29372 msgid "guestfs_part_set_mbr_id"
29376 #: ../src/guestfs-actions.pod:5685
29380 " guestfs_part_set_mbr_id (guestfs_h *g,\n"
29381 " const char *device,\n"
29388 #: ../src/guestfs-actions.pod:5705
29389 msgid "guestfs_part_set_name"
29393 #: ../src/guestfs-actions.pod:5707
29397 " guestfs_part_set_name (guestfs_h *g,\n"
29398 " const char *device,\n"
29400 " const char *name);\n"
29405 #: ../src/guestfs-actions.pod:5723
29406 msgid "guestfs_part_to_dev"
29410 #: ../src/guestfs-actions.pod:5725
29414 " guestfs_part_to_dev (guestfs_h *g,\n"
29415 " const char *partition);\n"
29420 #: ../src/guestfs-actions.pod:5733
29422 "The named partition must exist, for example as a string returned from "
29423 "C<guestfs_list_partitions>."
29427 #: ../src/guestfs-actions.pod:5741
29428 msgid "guestfs_ping_daemon"
29432 #: ../src/guestfs-actions.pod:5743
29436 " guestfs_ping_daemon (guestfs_h *g);\n"
29441 #: ../src/guestfs-actions.pod:5755
29442 msgid "guestfs_pread"
29446 #: ../src/guestfs-actions.pod:5757
29450 " guestfs_pread (guestfs_h *g,\n"
29451 " const char *path,\n"
29453 " int64_t offset,\n"
29454 " size_t *size_r);\n"
29459 #: ../src/guestfs-actions.pod:5770
29460 msgid "See also C<guestfs_pwrite>, C<guestfs_pread_device>."
29464 #: ../src/guestfs-actions.pod:5781
29465 msgid "guestfs_pread_device"
29469 #: ../src/guestfs-actions.pod:5783
29473 " guestfs_pread_device (guestfs_h *g,\n"
29474 " const char *device,\n"
29476 " int64_t offset,\n"
29477 " size_t *size_r);\n"
29482 #: ../src/guestfs-actions.pod:5796
29483 msgid "See also C<guestfs_pread>."
29487 #: ../src/guestfs-actions.pod:5805
29488 msgid "(Added in 1.5.21)"
29492 #: ../src/guestfs-actions.pod:5807
29493 msgid "guestfs_pvcreate"
29497 #: ../src/guestfs-actions.pod:5809
29501 " guestfs_pvcreate (guestfs_h *g,\n"
29502 " const char *device);\n"
29507 #: ../src/guestfs-actions.pod:5821
29508 msgid "guestfs_pvremove"
29512 #: ../src/guestfs-actions.pod:5823
29516 " guestfs_pvremove (guestfs_h *g,\n"
29517 " const char *device);\n"
29522 #: ../src/guestfs-actions.pod:5838
29523 msgid "guestfs_pvresize"
29527 #: ../src/guestfs-actions.pod:5840
29531 " guestfs_pvresize (guestfs_h *g,\n"
29532 " const char *device);\n"
29537 #: ../src/guestfs-actions.pod:5851
29538 msgid "guestfs_pvresize_size"
29542 #: ../src/guestfs-actions.pod:5853
29546 " guestfs_pvresize_size (guestfs_h *g,\n"
29547 " const char *device,\n"
29548 " int64_t size);\n"
29553 #: ../src/guestfs-actions.pod:5858
29555 "This command is the same as C<guestfs_pvresize> except that it allows you to "
29556 "specify the new size (in bytes) explicitly."
29560 #: ../src/guestfs-actions.pod:5865
29561 msgid "guestfs_pvs"
29565 #: ../src/guestfs-actions.pod:5867
29569 " guestfs_pvs (guestfs_h *g);\n"
29574 #: ../src/guestfs-actions.pod:5876
29575 msgid "See also C<guestfs_pvs_full>."
29579 #: ../src/guestfs-actions.pod:5884
29580 msgid "guestfs_pvs_full"
29584 #: ../src/guestfs-actions.pod:5886
29587 " struct guestfs_lvm_pv_list *\n"
29588 " guestfs_pvs_full (guestfs_h *g);\n"
29593 #: ../src/guestfs-actions.pod:5892
29595 "This function returns a C<struct guestfs_lvm_pv_list *>, or NULL if there "
29596 "was an error. I<The caller must call C<guestfs_free_lvm_pv_list> after "
29601 #: ../src/guestfs-actions.pod:5898
29602 msgid "guestfs_pvuuid"
29606 #: ../src/guestfs-actions.pod:5900
29610 " guestfs_pvuuid (guestfs_h *g,\n"
29611 " const char *device);\n"
29616 #: ../src/guestfs-actions.pod:5911
29617 msgid "guestfs_pwrite"
29621 #: ../src/guestfs-actions.pod:5913
29625 " guestfs_pwrite (guestfs_h *g,\n"
29626 " const char *path,\n"
29627 " const char *content,\n"
29628 " size_t content_size,\n"
29629 " int64_t offset);\n"
29634 #: ../src/guestfs-actions.pod:5929
29635 msgid "See also C<guestfs_pread>, C<guestfs_pwrite_device>."
29639 #: ../src/guestfs-actions.pod:5938
29640 msgid "guestfs_pwrite_device"
29644 #: ../src/guestfs-actions.pod:5940
29648 " guestfs_pwrite_device (guestfs_h *g,\n"
29649 " const char *device,\n"
29650 " const char *content,\n"
29651 " size_t content_size,\n"
29652 " int64_t offset);\n"
29657 #: ../src/guestfs-actions.pod:5955
29658 msgid "See also C<guestfs_pwrite>."
29662 #: ../src/guestfs-actions.pod:5962
29663 msgid "(Added in 1.5.20)"
29667 #: ../src/guestfs-actions.pod:5964
29668 msgid "guestfs_read_file"
29672 #: ../src/guestfs-actions.pod:5966
29676 " guestfs_read_file (guestfs_h *g,\n"
29677 " const char *path,\n"
29678 " size_t *size_r);\n"
29683 #: ../src/guestfs-actions.pod:5974
29685 "Unlike C<guestfs_cat>, this function can correctly handle files that contain "
29686 "embedded ASCII NUL characters. However unlike C<guestfs_download>, this "
29687 "function is limited in the total size of file that can be handled."
29691 #: ../src/guestfs-actions.pod:5986
29692 msgid "(Added in 1.0.63)"
29696 #: ../src/guestfs-actions.pod:5988
29697 msgid "guestfs_read_lines"
29701 #: ../src/guestfs-actions.pod:5990
29705 " guestfs_read_lines (guestfs_h *g,\n"
29706 " const char *path);\n"
29711 #: ../src/guestfs-actions.pod:5999
29713 "Note that this function cannot correctly handle binary files (specifically, "
29714 "files containing C<\\0> character which is treated as end of line). For "
29715 "those you need to use the C<guestfs_read_file> function which has a more "
29716 "complex interface."
29720 #: ../src/guestfs-actions.pod:6010
29721 msgid "guestfs_readdir"
29725 #: ../src/guestfs-actions.pod:6012
29728 " struct guestfs_dirent_list *\n"
29729 " guestfs_readdir (guestfs_h *g,\n"
29730 " const char *dir);\n"
29735 #: ../src/guestfs-actions.pod:6066
29737 "This function is primarily intended for use by programs. To get a simple "
29738 "list of names, use C<guestfs_ls>. To get a printable directory for human "
29739 "consumption, use C<guestfs_ll>."
29743 #: ../src/guestfs-actions.pod:6070
29745 "This function returns a C<struct guestfs_dirent_list *>, or NULL if there "
29746 "was an error. I<The caller must call C<guestfs_free_dirent_list> after "
29751 #: ../src/guestfs-actions.pod:6076
29752 msgid "guestfs_readlink"
29756 #: ../src/guestfs-actions.pod:6078
29760 " guestfs_readlink (guestfs_h *g,\n"
29761 " const char *path);\n"
29766 #: ../src/guestfs-actions.pod:6089
29767 msgid "guestfs_readlinklist"
29771 #: ../src/guestfs-actions.pod:6091
29775 " guestfs_readlinklist (guestfs_h *g,\n"
29776 " const char *path,\n"
29777 " char *const *names);\n"
29782 #: ../src/guestfs-actions.pod:6124
29783 msgid "guestfs_realpath"
29787 #: ../src/guestfs-actions.pod:6126
29791 " guestfs_realpath (guestfs_h *g,\n"
29792 " const char *path);\n"
29797 #: ../src/guestfs-actions.pod:6138
29798 msgid "guestfs_removexattr"
29802 #: ../src/guestfs-actions.pod:6140
29806 " guestfs_removexattr (guestfs_h *g,\n"
29807 " const char *xattr,\n"
29808 " const char *path);\n"
29813 #: ../src/guestfs-actions.pod:6148
29814 msgid "See also: C<guestfs_lremovexattr>, L<attr(5)>."
29818 #: ../src/guestfs-actions.pod:6154
29819 msgid "guestfs_resize2fs"
29823 #: ../src/guestfs-actions.pod:6156
29827 " guestfs_resize2fs (guestfs_h *g,\n"
29828 " const char *device);\n"
29833 #: ../src/guestfs-actions.pod:6163
29835 "I<Note:> It is sometimes required that you run C<guestfs_e2fsck_f> on the "
29836 "C<device> before calling this command. For unknown reasons C<resize2fs> "
29837 "sometimes gives an error about this and sometimes not. In any case, it is "
29838 "always safe to call C<guestfs_e2fsck_f> before calling this function."
29842 #: ../src/guestfs-actions.pod:6173
29843 msgid "guestfs_resize2fs_M"
29847 #: ../src/guestfs-actions.pod:6175
29851 " guestfs_resize2fs_M (guestfs_h *g,\n"
29852 " const char *device);\n"
29857 #: ../src/guestfs-actions.pod:6179
29859 "This command is the same as C<guestfs_resize2fs>, but the filesystem is "
29860 "resized to its minimum size. This works like the I<-M> option to the "
29861 "C<resize2fs> command."
29865 #: ../src/guestfs-actions.pod:6183
29867 "To get the resulting size of the filesystem you should call "
29868 "C<guestfs_tune2fs_l> and read the C<Block size> and C<Block count> values. "
29869 "These two numbers, multiplied together, give the resulting size of the "
29870 "minimal filesystem in bytes."
29874 #: ../src/guestfs-actions.pod:6192
29875 msgid "guestfs_resize2fs_size"
29879 #: ../src/guestfs-actions.pod:6194
29883 " guestfs_resize2fs_size (guestfs_h *g,\n"
29884 " const char *device,\n"
29885 " int64_t size);\n"
29890 #: ../src/guestfs-actions.pod:6199
29892 "This command is the same as C<guestfs_resize2fs> except that it allows you "
29893 "to specify the new size (in bytes) explicitly."
29897 #: ../src/guestfs-actions.pod:6206
29902 #: ../src/guestfs-actions.pod:6208
29906 " guestfs_rm (guestfs_h *g,\n"
29907 " const char *path);\n"
29912 #: ../src/guestfs-actions.pod:6218
29913 msgid "guestfs_rm_rf"
29917 #: ../src/guestfs-actions.pod:6220
29921 " guestfs_rm_rf (guestfs_h *g,\n"
29922 " const char *path);\n"
29927 #: ../src/guestfs-actions.pod:6232
29928 msgid "guestfs_rmdir"
29932 #: ../src/guestfs-actions.pod:6234
29936 " guestfs_rmdir (guestfs_h *g,\n"
29937 " const char *path);\n"
29942 #: ../src/guestfs-actions.pod:6244
29943 msgid "guestfs_rmmountpoint"
29947 #: ../src/guestfs-actions.pod:6246
29951 " guestfs_rmmountpoint (guestfs_h *g,\n"
29952 " const char *exemptpath);\n"
29957 #: ../src/guestfs-actions.pod:6250
29959 "This calls removes a mountpoint that was previously created with "
29960 "C<guestfs_mkmountpoint>. See C<guestfs_mkmountpoint> for full details."
29964 #: ../src/guestfs-actions.pod:6258
29965 msgid "guestfs_scrub_device"
29969 #: ../src/guestfs-actions.pod:6260
29973 " guestfs_scrub_device (guestfs_h *g,\n"
29974 " const char *device);\n"
29979 #: ../src/guestfs-actions.pod:6275 ../src/guestfs-actions.pod:6293 ../src/guestfs-actions.pod:6312
29980 msgid "(Added in 1.0.52)"
29984 #: ../src/guestfs-actions.pod:6277
29985 msgid "guestfs_scrub_file"
29989 #: ../src/guestfs-actions.pod:6279
29993 " guestfs_scrub_file (guestfs_h *g,\n"
29994 " const char *file);\n"
29999 #: ../src/guestfs-actions.pod:6295
30000 msgid "guestfs_scrub_freespace"
30004 #: ../src/guestfs-actions.pod:6297
30008 " guestfs_scrub_freespace (guestfs_h *g,\n"
30009 " const char *dir);\n"
30014 #: ../src/guestfs-actions.pod:6301
30016 "This command creates the directory C<dir> and then fills it with files until "
30017 "the filesystem is full, and scrubs the files as for C<guestfs_scrub_file>, "
30018 "and deletes them. The intention is to scrub any free space on the partition "
30019 "containing C<dir>."
30023 #: ../src/guestfs-actions.pod:6314
30024 msgid "guestfs_set_append"
30028 #: ../src/guestfs-actions.pod:6316
30032 " guestfs_set_append (guestfs_h *g,\n"
30033 " const char *append);\n"
30038 #: ../src/guestfs-actions.pod:6333
30039 msgid "guestfs_set_attach_method"
30043 #: ../src/guestfs-actions.pod:6335
30047 " guestfs_set_attach_method (guestfs_h *g,\n"
30048 " const char *attachmethod);\n"
30053 #: ../src/guestfs-actions.pod:6363
30054 msgid "guestfs_set_autosync"
30058 #: ../src/guestfs-actions.pod:6365
30062 " guestfs_set_autosync (guestfs_h *g,\n"
30063 " int autosync);\n"
30068 #: ../src/guestfs-actions.pod:6381
30069 msgid "guestfs_set_direct"
30073 #: ../src/guestfs-actions.pod:6383
30077 " guestfs_set_direct (guestfs_h *g,\n"
30083 #: ../src/guestfs-actions.pod:6391
30085 "One consequence of this is that log messages aren't caught by the library "
30086 "and handled by C<guestfs_set_log_message_callback>, but go straight to "
30091 #: ../src/guestfs-actions.pod:6404
30092 msgid "guestfs_set_e2label"
30096 #: ../src/guestfs-actions.pod:6406
30100 " guestfs_set_e2label (guestfs_h *g,\n"
30101 " const char *device,\n"
30102 " const char *label);\n"
30107 #: ../src/guestfs-actions.pod:6415
30109 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2label> to return "
30110 "the existing label on a filesystem."
30114 #: ../src/guestfs-actions.pod:6422
30115 msgid "guestfs_set_e2uuid"
30119 #: ../src/guestfs-actions.pod:6424
30123 " guestfs_set_e2uuid (guestfs_h *g,\n"
30124 " const char *device,\n"
30125 " const char *uuid);\n"
30130 #: ../src/guestfs-actions.pod:6434
30132 "You can use either C<guestfs_tune2fs_l> or C<guestfs_get_e2uuid> to return "
30133 "the existing UUID of a filesystem."
30137 #: ../src/guestfs-actions.pod:6441
30138 msgid "guestfs_set_memsize"
30142 #: ../src/guestfs-actions.pod:6443
30146 " guestfs_set_memsize (guestfs_h *g,\n"
30152 #: ../src/guestfs-actions.pod:6447
30154 "This sets the memory size in megabytes allocated to the qemu subprocess. "
30155 "This only has any effect if called before C<guestfs_launch>."
30159 #: ../src/guestfs-actions.pod:6462
30160 msgid "guestfs_set_network"
30164 #: ../src/guestfs-actions.pod:6464
30168 " guestfs_set_network (guestfs_h *g,\n"
30174 #: ../src/guestfs-actions.pod:6474
30176 "You must call this before calling C<guestfs_launch>, otherwise it has no "
30181 #: ../src/guestfs-actions.pod:6481
30182 msgid "guestfs_set_path"
30186 #: ../src/guestfs-actions.pod:6483
30190 " guestfs_set_path (guestfs_h *g,\n"
30191 " const char *searchpath);\n"
30196 #: ../src/guestfs-actions.pod:6498
30197 msgid "guestfs_set_pgroup"
30201 #: ../src/guestfs-actions.pod:6500
30205 " guestfs_set_pgroup (guestfs_h *g,\n"
30211 #: ../src/guestfs-actions.pod:6517
30212 msgid "guestfs_set_qemu"
30216 #: ../src/guestfs-actions.pod:6519
30220 " guestfs_set_qemu (guestfs_h *g,\n"
30221 " const char *qemu);\n"
30226 #: ../src/guestfs-actions.pod:6545
30227 msgid "guestfs_set_recovery_proc"
30231 #: ../src/guestfs-actions.pod:6547
30235 " guestfs_set_recovery_proc (guestfs_h *g,\n"
30236 " int recoveryproc);\n"
30241 #: ../src/guestfs-actions.pod:6551
30243 "If this is called with the parameter C<false> then C<guestfs_launch> does "
30244 "not create a recovery process. The purpose of the recovery process is to "
30245 "stop runaway qemu processes in the case where the main program aborts "
30250 #: ../src/guestfs-actions.pod:6556
30252 "This only has any effect if called before C<guestfs_launch>, and the default "
30257 #: ../src/guestfs-actions.pod:6569
30258 msgid "guestfs_set_selinux"
30262 #: ../src/guestfs-actions.pod:6571
30266 " guestfs_set_selinux (guestfs_h *g,\n"
30272 #: ../src/guestfs-actions.pod:6588
30273 msgid "guestfs_set_smp"
30277 #: ../src/guestfs-actions.pod:6590
30281 " guestfs_set_smp (guestfs_h *g,\n"
30287 #: ../src/guestfs-actions.pod:6598
30288 msgid "This function must be called before C<guestfs_launch>."
30292 #: ../src/guestfs-actions.pod:6604
30293 msgid "guestfs_set_trace"
30297 #: ../src/guestfs-actions.pod:6606
30301 " guestfs_set_trace (guestfs_h *g,\n"
30307 #: ../src/guestfs-actions.pod:6620
30309 "Trace messages are normally sent to C<stderr>, unless you register a "
30310 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30314 #: ../src/guestfs-actions.pod:6628
30315 msgid "guestfs_set_verbose"
30319 #: ../src/guestfs-actions.pod:6630
30323 " guestfs_set_verbose (guestfs_h *g,\n"
30329 #: ../src/guestfs-actions.pod:6639
30331 "Verbose messages are normally sent to C<stderr>, unless you register a "
30332 "callback to send them somewhere else (see C<guestfs_set_event_callback>)."
30336 #: ../src/guestfs-actions.pod:6647
30337 msgid "guestfs_setcon"
30341 #: ../src/guestfs-actions.pod:6649
30345 " guestfs_setcon (guestfs_h *g,\n"
30346 " const char *context);\n"
30351 #: ../src/guestfs-actions.pod:6662
30352 msgid "guestfs_setxattr"
30356 #: ../src/guestfs-actions.pod:6664
30360 " guestfs_setxattr (guestfs_h *g,\n"
30361 " const char *xattr,\n"
30362 " const char *val,\n"
30364 " const char *path);\n"
30369 #: ../src/guestfs-actions.pod:6675
30370 msgid "See also: C<guestfs_lsetxattr>, L<attr(5)>."
30374 #: ../src/guestfs-actions.pod:6681
30375 msgid "guestfs_sfdisk"
30379 #: ../src/guestfs-actions.pod:6683
30383 " guestfs_sfdisk (guestfs_h *g,\n"
30384 " const char *device,\n"
30388 " char *const *lines);\n"
30393 #: ../src/guestfs-actions.pod:6691 ../src/guestfs-actions.pod:6735 ../src/guestfs-actions.pod:6769
30395 "I<This function is deprecated.> In new code, use the L</guestfs_part_add> "
30400 #: ../src/guestfs-actions.pod:6718
30401 msgid "See also: C<guestfs_sfdisk_l>, C<guestfs_sfdisk_N>, C<guestfs_part_init>"
30405 #: ../src/guestfs-actions.pod:6728
30406 msgid "guestfs_sfdiskM"
30410 #: ../src/guestfs-actions.pod:6730
30414 " guestfs_sfdiskM (guestfs_h *g,\n"
30415 " const char *device,\n"
30416 " char *const *lines);\n"
30421 #: ../src/guestfs-actions.pod:6742
30423 "This is a simplified interface to the C<guestfs_sfdisk> command, where "
30424 "partition sizes are specified in megabytes only (rounded to the nearest "
30425 "cylinder) and you don't need to specify the cyls, heads and sectors "
30426 "parameters which were rarely if ever used anyway."
30430 #: ../src/guestfs-actions.pod:6748
30432 "See also: C<guestfs_sfdisk>, the L<sfdisk(8)> manpage and "
30433 "C<guestfs_part_disk>"
30437 #: ../src/guestfs-actions.pod:6758
30438 msgid "guestfs_sfdisk_N"
30442 #: ../src/guestfs-actions.pod:6760
30446 " guestfs_sfdisk_N (guestfs_h *g,\n"
30447 " const char *device,\n"
30452 " const char *line);\n"
30457 #: ../src/guestfs-actions.pod:6779
30459 "For other parameters, see C<guestfs_sfdisk>. You should usually pass C<0> "
30460 "for the cyls/heads/sectors parameters."
30464 #: ../src/guestfs-actions.pod:6782
30465 msgid "See also: C<guestfs_part_add>"
30469 #: ../src/guestfs-actions.pod:6791
30470 msgid "guestfs_sfdisk_disk_geometry"
30474 #: ../src/guestfs-actions.pod:6793
30478 " guestfs_sfdisk_disk_geometry (guestfs_h *g,\n"
30479 " const char *device);\n"
30484 #: ../src/guestfs-actions.pod:6797
30486 "This displays the disk geometry of C<device> read from the partition table. "
30487 "Especially in the case where the underlying block device has been resized, "
30488 "this can be different from the kernel's idea of the geometry (see "
30489 "C<guestfs_sfdisk_kernel_geometry>)."
30493 #: ../src/guestfs-actions.pod:6810
30494 msgid "guestfs_sfdisk_kernel_geometry"
30498 #: ../src/guestfs-actions.pod:6812
30502 " guestfs_sfdisk_kernel_geometry (guestfs_h *g,\n"
30503 " const char *device);\n"
30508 #: ../src/guestfs-actions.pod:6826
30509 msgid "guestfs_sfdisk_l"
30513 #: ../src/guestfs-actions.pod:6828
30517 " guestfs_sfdisk_l (guestfs_h *g,\n"
30518 " const char *device);\n"
30523 #: ../src/guestfs-actions.pod:6832
30525 "I<This function is deprecated.> In new code, use the L</guestfs_part_list> "
30530 #: ../src/guestfs-actions.pod:6843
30531 msgid "See also: C<guestfs_part_list>"
30535 #: ../src/guestfs-actions.pod:6850
30540 #: ../src/guestfs-actions.pod:6852
30544 " guestfs_sh (guestfs_h *g,\n"
30545 " const char *command);\n"
30550 #: ../src/guestfs-actions.pod:6859
30551 msgid "This is like C<guestfs_command>, but passes the command to:"
30555 #: ../src/guestfs-actions.pod:6867
30556 msgid "All the provisos about C<guestfs_command> apply to this call."
30560 #: ../src/guestfs-actions.pod:6874
30561 msgid "guestfs_sh_lines"
30565 #: ../src/guestfs-actions.pod:6876
30569 " guestfs_sh_lines (guestfs_h *g,\n"
30570 " const char *command);\n"
30575 #: ../src/guestfs-actions.pod:6880
30577 "This is the same as C<guestfs_sh>, but splits the result into a list of "
30582 #: ../src/guestfs-actions.pod:6883
30583 msgid "See also: C<guestfs_command_lines>"
30587 #: ../src/guestfs-actions.pod:6891
30588 msgid "guestfs_sleep"
30592 #: ../src/guestfs-actions.pod:6893
30596 " guestfs_sleep (guestfs_h *g,\n"
30602 #: ../src/guestfs-actions.pod:6901
30603 msgid "(Added in 1.0.41)"
30607 #: ../src/guestfs-actions.pod:6903 ../src/guestfs-structs.pod:109
30608 msgid "guestfs_stat"
30612 #: ../src/guestfs-actions.pod:6905
30615 " struct guestfs_stat *\n"
30616 " guestfs_stat (guestfs_h *g,\n"
30617 " const char *path);\n"
30622 #: ../src/guestfs-actions.pod:6919 ../src/guestfs-structs.pod:135
30623 msgid "guestfs_statvfs"
30627 #: ../src/guestfs-actions.pod:6921
30630 " struct guestfs_statvfs *\n"
30631 " guestfs_statvfs (guestfs_h *g,\n"
30632 " const char *path);\n"
30637 #: ../src/guestfs-actions.pod:6931
30639 "This function returns a C<struct guestfs_statvfs *>, or NULL if there was an "
30640 "error. I<The caller must call C<guestfs_free_statvfs> after use>."
30644 #: ../src/guestfs-actions.pod:6937
30645 msgid "guestfs_strings"
30649 #: ../src/guestfs-actions.pod:6939
30653 " guestfs_strings (guestfs_h *g,\n"
30654 " const char *path);\n"
30659 #: ../src/guestfs-actions.pod:6955
30660 msgid "guestfs_strings_e"
30664 #: ../src/guestfs-actions.pod:6957
30668 " guestfs_strings_e (guestfs_h *g,\n"
30669 " const char *encoding,\n"
30670 " const char *path);\n"
30675 #: ../src/guestfs-actions.pod:6962
30677 "This is like the C<guestfs_strings> command, but allows you to specify the "
30678 "encoding of strings that are looked for in the source file C<path>."
30682 #: ../src/guestfs-actions.pod:6972
30684 "Single 7-bit-byte characters like ASCII and the ASCII-compatible parts of "
30685 "ISO-8859-X (this is what C<guestfs_strings> uses)."
30689 #: ../src/guestfs-actions.pod:7010
30690 msgid "guestfs_swapoff_device"
30694 #: ../src/guestfs-actions.pod:7012
30698 " guestfs_swapoff_device (guestfs_h *g,\n"
30699 " const char *device);\n"
30704 #: ../src/guestfs-actions.pod:7016
30706 "This command disables the libguestfs appliance swap device or partition "
30707 "named C<device>. See C<guestfs_swapon_device>."
30711 #: ../src/guestfs-actions.pod:7024
30712 msgid "guestfs_swapoff_file"
30716 #: ../src/guestfs-actions.pod:7026
30720 " guestfs_swapoff_file (guestfs_h *g,\n"
30721 " const char *file);\n"
30726 #: ../src/guestfs-actions.pod:7036
30727 msgid "guestfs_swapoff_label"
30731 #: ../src/guestfs-actions.pod:7038
30735 " guestfs_swapoff_label (guestfs_h *g,\n"
30736 " const char *label);\n"
30741 #: ../src/guestfs-actions.pod:7049
30742 msgid "guestfs_swapoff_uuid"
30746 #: ../src/guestfs-actions.pod:7051
30750 " guestfs_swapoff_uuid (guestfs_h *g,\n"
30751 " const char *uuid);\n"
30756 #: ../src/guestfs-actions.pod:7062
30757 msgid "guestfs_swapon_device"
30761 #: ../src/guestfs-actions.pod:7064
30765 " guestfs_swapon_device (guestfs_h *g,\n"
30766 " const char *device);\n"
30771 #: ../src/guestfs-actions.pod:7068
30773 "This command enables the libguestfs appliance to use the swap device or "
30774 "partition named C<device>. The increased memory is made available for all "
30775 "commands, for example those run using C<guestfs_command> or C<guestfs_sh>."
30779 #: ../src/guestfs-actions.pod:7084
30780 msgid "guestfs_swapon_file"
30784 #: ../src/guestfs-actions.pod:7086
30788 " guestfs_swapon_file (guestfs_h *g,\n"
30789 " const char *file);\n"
30794 #: ../src/guestfs-actions.pod:7090
30796 "This command enables swap to a file. See C<guestfs_swapon_device> for other "
30801 #: ../src/guestfs-actions.pod:7097
30802 msgid "guestfs_swapon_label"
30806 #: ../src/guestfs-actions.pod:7099
30810 " guestfs_swapon_label (guestfs_h *g,\n"
30811 " const char *label);\n"
30816 #: ../src/guestfs-actions.pod:7103
30818 "This command enables swap to a labeled swap partition. See "
30819 "C<guestfs_swapon_device> for other notes."
30823 #: ../src/guestfs-actions.pod:7110
30824 msgid "guestfs_swapon_uuid"
30828 #: ../src/guestfs-actions.pod:7112
30832 " guestfs_swapon_uuid (guestfs_h *g,\n"
30833 " const char *uuid);\n"
30838 #: ../src/guestfs-actions.pod:7116
30840 "This command enables swap to a swap partition with the given UUID. See "
30841 "C<guestfs_swapon_device> for other notes."
30845 #: ../src/guestfs-actions.pod:7123
30846 msgid "guestfs_sync"
30850 #: ../src/guestfs-actions.pod:7125
30854 " guestfs_sync (guestfs_h *g);\n"
30859 #: ../src/guestfs-actions.pod:7138
30860 msgid "guestfs_tail"
30864 #: ../src/guestfs-actions.pod:7140
30868 " guestfs_tail (guestfs_h *g,\n"
30869 " const char *path);\n"
30874 #: ../src/guestfs-actions.pod:7156
30875 msgid "guestfs_tail_n"
30879 #: ../src/guestfs-actions.pod:7158
30883 " guestfs_tail_n (guestfs_h *g,\n"
30885 " const char *path);\n"
30890 #: ../src/guestfs-actions.pod:7180
30891 msgid "guestfs_tar_in"
30895 #: ../src/guestfs-actions.pod:7182
30899 " guestfs_tar_in (guestfs_h *g,\n"
30900 " const char *tarfile,\n"
30901 " const char *directory);\n"
30906 #: ../src/guestfs-actions.pod:7190
30907 msgid "To upload a compressed tarball, use C<guestfs_tgz_in> or C<guestfs_txz_in>."
30911 #: ../src/guestfs-actions.pod:7195 ../src/guestfs-actions.pod:7212 ../src/guestfs-actions.pod:7228 ../src/guestfs-actions.pod:7244
30912 msgid "(Added in 1.0.3)"
30916 #: ../src/guestfs-actions.pod:7197
30917 msgid "guestfs_tar_out"
30921 #: ../src/guestfs-actions.pod:7199
30925 " guestfs_tar_out (guestfs_h *g,\n"
30926 " const char *directory,\n"
30927 " const char *tarfile);\n"
30932 #: ../src/guestfs-actions.pod:7207
30934 "To download a compressed tarball, use C<guestfs_tgz_out> or "
30935 "C<guestfs_txz_out>."
30939 #: ../src/guestfs-actions.pod:7214
30940 msgid "guestfs_tgz_in"
30944 #: ../src/guestfs-actions.pod:7216
30948 " guestfs_tgz_in (guestfs_h *g,\n"
30949 " const char *tarball,\n"
30950 " const char *directory);\n"
30955 #: ../src/guestfs-actions.pod:7224
30956 msgid "To upload an uncompressed tarball, use C<guestfs_tar_in>."
30960 #: ../src/guestfs-actions.pod:7230
30961 msgid "guestfs_tgz_out"
30965 #: ../src/guestfs-actions.pod:7232
30969 " guestfs_tgz_out (guestfs_h *g,\n"
30970 " const char *directory,\n"
30971 " const char *tarball);\n"
30976 #: ../src/guestfs-actions.pod:7240
30977 msgid "To download an uncompressed tarball, use C<guestfs_tar_out>."
30981 #: ../src/guestfs-actions.pod:7246
30982 msgid "guestfs_touch"
30986 #: ../src/guestfs-actions.pod:7248
30990 " guestfs_touch (guestfs_h *g,\n"
30991 " const char *path);\n"
30996 #: ../src/guestfs-actions.pod:7263
30997 msgid "guestfs_truncate"
31001 #: ../src/guestfs-actions.pod:7265
31005 " guestfs_truncate (guestfs_h *g,\n"
31006 " const char *path);\n"
31011 #: ../src/guestfs-actions.pod:7276
31012 msgid "guestfs_truncate_size"
31016 #: ../src/guestfs-actions.pod:7278
31020 " guestfs_truncate_size (guestfs_h *g,\n"
31021 " const char *path,\n"
31022 " int64_t size);\n"
31027 #: ../src/guestfs-actions.pod:7286
31029 "If the current file size is less than C<size> then the file is extended to "
31030 "the required size with zero bytes. This creates a sparse file (ie. disk "
31031 "blocks are not allocated for the file until you write to it). To create a "
31032 "non-sparse file of zeroes, use C<guestfs_fallocate64> instead."
31036 #: ../src/guestfs-actions.pod:7296
31037 msgid "guestfs_tune2fs_l"
31041 #: ../src/guestfs-actions.pod:7298
31045 " guestfs_tune2fs_l (guestfs_h *g,\n"
31046 " const char *device);\n"
31051 #: ../src/guestfs-actions.pod:7318
31052 msgid "guestfs_txz_in"
31056 #: ../src/guestfs-actions.pod:7320
31060 " guestfs_txz_in (guestfs_h *g,\n"
31061 " const char *tarball,\n"
31062 " const char *directory);\n"
31067 #: ../src/guestfs-actions.pod:7332
31068 msgid "guestfs_txz_out"
31072 #: ../src/guestfs-actions.pod:7334
31076 " guestfs_txz_out (guestfs_h *g,\n"
31077 " const char *directory,\n"
31078 " const char *tarball);\n"
31083 #: ../src/guestfs-actions.pod:7346
31084 msgid "guestfs_umask"
31088 #: ../src/guestfs-actions.pod:7348
31092 " guestfs_umask (guestfs_h *g,\n"
31098 #: ../src/guestfs-actions.pod:7364
31100 "See also C<guestfs_get_umask>, L<umask(2)>, C<guestfs_mknod>, "
31101 "C<guestfs_mkdir>."
31105 #: ../src/guestfs-actions.pod:7373
31106 msgid "guestfs_umount"
31110 #: ../src/guestfs-actions.pod:7375
31114 " guestfs_umount (guestfs_h *g,\n"
31115 " const char *pathordevice);\n"
31120 #: ../src/guestfs-actions.pod:7387
31121 msgid "guestfs_umount_all"
31125 #: ../src/guestfs-actions.pod:7389
31129 " guestfs_umount_all (guestfs_h *g);\n"
31134 #: ../src/guestfs-actions.pod:7400
31135 msgid "guestfs_upload"
31139 #: ../src/guestfs-actions.pod:7402
31143 " guestfs_upload (guestfs_h *g,\n"
31144 " const char *filename,\n"
31145 " const char *remotefilename);\n"
31150 #: ../src/guestfs-actions.pod:7412
31151 msgid "See also C<guestfs_download>."
31155 #: ../src/guestfs-actions.pod:7423
31156 msgid "guestfs_upload_offset"
31160 #: ../src/guestfs-actions.pod:7425
31164 " guestfs_upload_offset (guestfs_h *g,\n"
31165 " const char *filename,\n"
31166 " const char *remotefilename,\n"
31167 " int64_t offset);\n"
31172 #: ../src/guestfs-actions.pod:7441
31174 "Note that there is no limit on the amount of data that can be uploaded with "
31175 "this call, unlike with C<guestfs_pwrite>, and this call always writes the "
31176 "full amount unless an error occurs."
31180 #: ../src/guestfs-actions.pod:7446
31181 msgid "See also C<guestfs_upload>, C<guestfs_pwrite>."
31185 #: ../src/guestfs-actions.pod:7457
31186 msgid "guestfs_utimens"
31190 #: ../src/guestfs-actions.pod:7459
31194 " guestfs_utimens (guestfs_h *g,\n"
31195 " const char *path,\n"
31196 " int64_t atsecs,\n"
31197 " int64_t atnsecs,\n"
31198 " int64_t mtsecs,\n"
31199 " int64_t mtnsecs);\n"
31204 #: ../src/guestfs-actions.pod:7488 ../src/guestfs-structs.pod:175
31205 msgid "guestfs_version"
31209 #: ../src/guestfs-actions.pod:7490
31212 " struct guestfs_version *\n"
31213 " guestfs_version (guestfs_h *g);\n"
31218 #: ../src/guestfs-actions.pod:7518
31220 "I<Note:> Don't use this call to test for availability of features. In "
31221 "enterprise distributions we backport features from later versions into "
31222 "earlier versions, making this an unreliable way to test for features. Use "
31223 "C<guestfs_available> instead."
31227 #: ../src/guestfs-actions.pod:7524
31229 "This function returns a C<struct guestfs_version *>, or NULL if there was an "
31230 "error. I<The caller must call C<guestfs_free_version> after use>."
31234 #: ../src/guestfs-actions.pod:7528
31235 msgid "(Added in 1.0.58)"
31239 #: ../src/guestfs-actions.pod:7530
31240 msgid "guestfs_vfs_label"
31244 #: ../src/guestfs-actions.pod:7532
31248 " guestfs_vfs_label (guestfs_h *g,\n"
31249 " const char *device);\n"
31254 #: ../src/guestfs-actions.pod:7541
31255 msgid "To find a filesystem from the label, use C<guestfs_findfs_label>."
31259 #: ../src/guestfs-actions.pod:7546 ../src/guestfs-actions.pod:7583
31260 msgid "(Added in 1.3.18)"
31264 #: ../src/guestfs-actions.pod:7548
31265 msgid "guestfs_vfs_type"
31269 #: ../src/guestfs-actions.pod:7550
31273 " guestfs_vfs_type (guestfs_h *g,\n"
31274 " const char *device);\n"
31279 #: ../src/guestfs-actions.pod:7567
31280 msgid "guestfs_vfs_uuid"
31284 #: ../src/guestfs-actions.pod:7569
31288 " guestfs_vfs_uuid (guestfs_h *g,\n"
31289 " const char *device);\n"
31294 #: ../src/guestfs-actions.pod:7578
31295 msgid "To find a filesystem from the UUID, use C<guestfs_findfs_uuid>."
31299 #: ../src/guestfs-actions.pod:7585
31300 msgid "guestfs_vg_activate"
31304 #: ../src/guestfs-actions.pod:7587
31308 " guestfs_vg_activate (guestfs_h *g,\n"
31310 " char *const *volgroups);\n"
31315 #: ../src/guestfs-actions.pod:7604
31316 msgid "guestfs_vg_activate_all"
31320 #: ../src/guestfs-actions.pod:7606
31324 " guestfs_vg_activate_all (guestfs_h *g,\n"
31325 " int activate);\n"
31330 #: ../src/guestfs-actions.pod:7619
31331 msgid "guestfs_vgcreate"
31335 #: ../src/guestfs-actions.pod:7621
31339 " guestfs_vgcreate (guestfs_h *g,\n"
31340 " const char *volgroup,\n"
31341 " char *const *physvols);\n"
31346 #: ../src/guestfs-actions.pod:7633
31347 msgid "guestfs_vglvuuids"
31351 #: ../src/guestfs-actions.pod:7635
31355 " guestfs_vglvuuids (guestfs_h *g,\n"
31356 " const char *vgname);\n"
31361 #: ../src/guestfs-actions.pod:7642
31363 "You can use this along with C<guestfs_lvs> and C<guestfs_lvuuid> calls to "
31364 "associate logical volumes and volume groups."
31368 #: ../src/guestfs-actions.pod:7645
31369 msgid "See also C<guestfs_vgpvuuids>."
31373 #: ../src/guestfs-actions.pod:7653
31374 msgid "guestfs_vgpvuuids"
31378 #: ../src/guestfs-actions.pod:7655
31382 " guestfs_vgpvuuids (guestfs_h *g,\n"
31383 " const char *vgname);\n"
31388 #: ../src/guestfs-actions.pod:7662
31390 "You can use this along with C<guestfs_pvs> and C<guestfs_pvuuid> calls to "
31391 "associate physical volumes and volume groups."
31395 #: ../src/guestfs-actions.pod:7665
31396 msgid "See also C<guestfs_vglvuuids>."
31400 #: ../src/guestfs-actions.pod:7673
31401 msgid "guestfs_vgremove"
31405 #: ../src/guestfs-actions.pod:7675
31409 " guestfs_vgremove (guestfs_h *g,\n"
31410 " const char *vgname);\n"
31415 #: ../src/guestfs-actions.pod:7688
31416 msgid "guestfs_vgrename"
31420 #: ../src/guestfs-actions.pod:7690
31424 " guestfs_vgrename (guestfs_h *g,\n"
31425 " const char *volgroup,\n"
31426 " const char *newvolgroup);\n"
31431 #: ../src/guestfs-actions.pod:7701
31432 msgid "guestfs_vgs"
31436 #: ../src/guestfs-actions.pod:7703
31440 " guestfs_vgs (guestfs_h *g);\n"
31445 #: ../src/guestfs-actions.pod:7712
31446 msgid "See also C<guestfs_vgs_full>."
31450 #: ../src/guestfs-actions.pod:7720
31451 msgid "guestfs_vgs_full"
31455 #: ../src/guestfs-actions.pod:7722
31458 " struct guestfs_lvm_vg_list *\n"
31459 " guestfs_vgs_full (guestfs_h *g);\n"
31464 #: ../src/guestfs-actions.pod:7728
31466 "This function returns a C<struct guestfs_lvm_vg_list *>, or NULL if there "
31467 "was an error. I<The caller must call C<guestfs_free_lvm_vg_list> after "
31472 #: ../src/guestfs-actions.pod:7734
31473 msgid "guestfs_vgscan"
31477 #: ../src/guestfs-actions.pod:7736
31481 " guestfs_vgscan (guestfs_h *g);\n"
31486 #: ../src/guestfs-actions.pod:7746
31487 msgid "guestfs_vguuid"
31491 #: ../src/guestfs-actions.pod:7748
31495 " guestfs_vguuid (guestfs_h *g,\n"
31496 " const char *vgname);\n"
31501 #: ../src/guestfs-actions.pod:7759
31502 msgid "guestfs_wait_ready"
31506 #: ../src/guestfs-actions.pod:7761
31510 " guestfs_wait_ready (guestfs_h *g);\n"
31515 #: ../src/guestfs-actions.pod:7764
31517 "I<This function is deprecated.> In new code, use the L</guestfs_launch> call "
31522 #: ../src/guestfs-actions.pod:7771
31523 msgid "This function is a no op."
31527 #: ../src/guestfs-actions.pod:7773
31529 "In versions of the API E<lt> 1.0.71 you had to call this function just after "
31530 "calling C<guestfs_launch> to wait for the launch to complete. However this "
31531 "is no longer necessary because C<guestfs_launch> now does the waiting."
31535 #: ../src/guestfs-actions.pod:7778
31537 "If you see any calls to this function in code then you can just remove them, "
31538 "unless you want to retain compatibility with older versions of the API."
31542 #: ../src/guestfs-actions.pod:7786
31543 msgid "guestfs_wc_c"
31547 #: ../src/guestfs-actions.pod:7788
31551 " guestfs_wc_c (guestfs_h *g,\n"
31552 " const char *path);\n"
31557 #: ../src/guestfs-actions.pod:7799
31558 msgid "guestfs_wc_l"
31562 #: ../src/guestfs-actions.pod:7801
31566 " guestfs_wc_l (guestfs_h *g,\n"
31567 " const char *path);\n"
31572 #: ../src/guestfs-actions.pod:7812
31573 msgid "guestfs_wc_w"
31577 #: ../src/guestfs-actions.pod:7814
31581 " guestfs_wc_w (guestfs_h *g,\n"
31582 " const char *path);\n"
31587 #: ../src/guestfs-actions.pod:7825
31588 msgid "guestfs_write"
31592 #: ../src/guestfs-actions.pod:7827
31596 " guestfs_write (guestfs_h *g,\n"
31597 " const char *path,\n"
31598 " const char *content,\n"
31599 " size_t content_size);\n"
31604 #: ../src/guestfs-actions.pod:7836
31605 msgid "See also C<guestfs_write_append>."
31609 #: ../src/guestfs-actions.pod:7845
31610 msgid "guestfs_write_append"
31614 #: ../src/guestfs-actions.pod:7847
31618 " guestfs_write_append (guestfs_h *g,\n"
31619 " const char *path,\n"
31620 " const char *content,\n"
31621 " size_t content_size);\n"
31626 #: ../src/guestfs-actions.pod:7856
31627 msgid "See also C<guestfs_write>."
31631 #: ../src/guestfs-actions.pod:7865
31632 msgid "guestfs_write_file"
31636 #: ../src/guestfs-actions.pod:7867
31640 " guestfs_write_file (guestfs_h *g,\n"
31641 " const char *path,\n"
31642 " const char *content,\n"
31648 #: ../src/guestfs-actions.pod:7873
31650 "I<This function is deprecated.> In new code, use the L</guestfs_write> call "
31655 #: ../src/guestfs-actions.pod:7898
31656 msgid "guestfs_zegrep"
31660 #: ../src/guestfs-actions.pod:7900
31664 " guestfs_zegrep (guestfs_h *g,\n"
31665 " const char *regex,\n"
31666 " const char *path);\n"
31671 #: ../src/guestfs-actions.pod:7917
31672 msgid "guestfs_zegrepi"
31676 #: ../src/guestfs-actions.pod:7919
31680 " guestfs_zegrepi (guestfs_h *g,\n"
31681 " const char *regex,\n"
31682 " const char *path);\n"
31687 #: ../src/guestfs-actions.pod:7936
31688 msgid "guestfs_zero"
31692 #: ../src/guestfs-actions.pod:7938
31696 " guestfs_zero (guestfs_h *g,\n"
31697 " const char *device);\n"
31702 #: ../src/guestfs-actions.pod:7952
31704 "See also: C<guestfs_zero_device>, C<guestfs_scrub_device>, "
31705 "C<guestfs_is_zero_device>"
31709 #: ../src/guestfs-actions.pod:7964
31710 msgid "guestfs_zero_device"
31714 #: ../src/guestfs-actions.pod:7966
31718 " guestfs_zero_device (guestfs_h *g,\n"
31719 " const char *device);\n"
31724 #: ../src/guestfs-actions.pod:7970
31726 "This command writes zeroes over the entire C<device>. Compare with "
31727 "C<guestfs_zero> which just zeroes the first few blocks of a device."
31731 #: ../src/guestfs-actions.pod:7988
31732 msgid "(Added in 1.3.1)"
31736 #: ../src/guestfs-actions.pod:7990
31737 msgid "guestfs_zerofree"
31741 #: ../src/guestfs-actions.pod:7992
31745 " guestfs_zerofree (guestfs_h *g,\n"
31746 " const char *device);\n"
31751 #: ../src/guestfs-actions.pod:8011
31752 msgid "guestfs_zfgrep"
31756 #: ../src/guestfs-actions.pod:8013
31760 " guestfs_zfgrep (guestfs_h *g,\n"
31761 " const char *pattern,\n"
31762 " const char *path);\n"
31767 #: ../src/guestfs-actions.pod:8030
31768 msgid "guestfs_zfgrepi"
31772 #: ../src/guestfs-actions.pod:8032
31776 " guestfs_zfgrepi (guestfs_h *g,\n"
31777 " const char *pattern,\n"
31778 " const char *path);\n"
31783 #: ../src/guestfs-actions.pod:8049
31784 msgid "guestfs_zfile"
31788 #: ../src/guestfs-actions.pod:8051
31792 " guestfs_zfile (guestfs_h *g,\n"
31793 " const char *meth,\n"
31794 " const char *path);\n"
31799 #: ../src/guestfs-actions.pod:8056
31801 "I<This function is deprecated.> In new code, use the L</guestfs_file> call "
31806 #: ../src/guestfs-actions.pod:8068
31808 "Since 1.0.63, use C<guestfs_file> instead which can now process compressed "
31813 #: ../src/guestfs-actions.pod:8076
31814 msgid "guestfs_zgrep"
31818 #: ../src/guestfs-actions.pod:8078
31822 " guestfs_zgrep (guestfs_h *g,\n"
31823 " const char *regex,\n"
31824 " const char *path);\n"
31829 #: ../src/guestfs-actions.pod:8095
31830 msgid "guestfs_zgrepi"
31834 #: ../src/guestfs-actions.pod:8097
31838 " guestfs_zgrepi (guestfs_h *g,\n"
31839 " const char *regex,\n"
31840 " const char *path);\n"
31845 #: ../src/guestfs-availability.pod:3
31850 #: ../src/guestfs-availability.pod:5
31852 "The following functions: L</guestfs_aug_clear> L</guestfs_aug_close> "
31853 "L</guestfs_aug_defnode> L</guestfs_aug_defvar> L</guestfs_aug_get> "
31854 "L</guestfs_aug_init> L</guestfs_aug_insert> L</guestfs_aug_load> "
31855 "L</guestfs_aug_ls> L</guestfs_aug_match> L</guestfs_aug_mv> "
31856 "L</guestfs_aug_rm> L</guestfs_aug_save> L</guestfs_aug_set>"
31860 #: ../src/guestfs-availability.pod:21
31865 #: ../src/guestfs-availability.pod:23
31866 msgid "The following functions: L</guestfs_btrfs_filesystem_resize>"
31870 #: ../src/guestfs-availability.pod:26
31875 #: ../src/guestfs-availability.pod:28
31876 msgid "The following functions: L</guestfs_grub_install>"
31880 #: ../src/guestfs-availability.pod:31
31885 #: ../src/guestfs-availability.pod:33
31887 "The following functions: L</guestfs_inotify_add_watch> "
31888 "L</guestfs_inotify_close> L</guestfs_inotify_files> L</guestfs_inotify_init> "
31889 "L</guestfs_inotify_read> L</guestfs_inotify_rm_watch>"
31893 #: ../src/guestfs-availability.pod:41
31894 msgid "B<linuxfsuuid>"
31898 #: ../src/guestfs-availability.pod:43
31900 "The following functions: L</guestfs_mke2fs_JU> L</guestfs_mke2journal_U> "
31901 "L</guestfs_mkswap_U> L</guestfs_swapoff_uuid> L</guestfs_swapon_uuid>"
31905 #: ../src/guestfs-availability.pod:50
31906 msgid "B<linuxmodules>"
31910 #: ../src/guestfs-availability.pod:52
31911 msgid "The following functions: L</guestfs_modprobe>"
31915 #: ../src/guestfs-availability.pod:55
31916 msgid "B<linuxxattrs>"
31920 #: ../src/guestfs-availability.pod:57
31922 "The following functions: L</guestfs_getxattr> L</guestfs_getxattrs> "
31923 "L</guestfs_lgetxattr> L</guestfs_lgetxattrs> L</guestfs_lremovexattr> "
31924 "L</guestfs_lsetxattr> L</guestfs_lxattrlist> L</guestfs_removexattr> "
31925 "L</guestfs_setxattr>"
31929 #: ../src/guestfs-availability.pod:68
31934 #: ../src/guestfs-availability.pod:70
31936 "The following functions: L</guestfs_luks_add_key> L</guestfs_luks_close> "
31937 "L</guestfs_luks_format> L</guestfs_luks_format_cipher> "
31938 "L</guestfs_luks_kill_slot> L</guestfs_luks_open> L</guestfs_luks_open_ro>"
31942 #: ../src/guestfs-availability.pod:79
31947 #: ../src/guestfs-availability.pod:81
31949 "The following functions: L</guestfs_is_lv> L</guestfs_lvcreate> "
31950 "L</guestfs_lvm_remove_all> L</guestfs_lvm_set_filter> L</guestfs_lvremove> "
31951 "L</guestfs_lvresize> L</guestfs_lvresize_free> L</guestfs_lvs> "
31952 "L</guestfs_lvs_full> L</guestfs_pvcreate> L</guestfs_pvremove> "
31953 "L</guestfs_pvresize> L</guestfs_pvresize_size> L</guestfs_pvs> "
31954 "L</guestfs_pvs_full> L</guestfs_vg_activate> L</guestfs_vg_activate_all> "
31955 "L</guestfs_vgcreate> L</guestfs_vgremove> L</guestfs_vgs> "
31956 "L</guestfs_vgs_full>"
31960 #: ../src/guestfs-availability.pod:104
31965 #: ../src/guestfs-availability.pod:106
31967 "The following functions: L</guestfs_mkfifo> L</guestfs_mknod> "
31968 "L</guestfs_mknod_b> L</guestfs_mknod_c>"
31972 #: ../src/guestfs-availability.pod:112
31977 #: ../src/guestfs-availability.pod:114
31978 msgid "The following functions: L</guestfs_ntfs_3g_probe>"
31982 #: ../src/guestfs-availability.pod:117
31983 msgid "B<ntfsprogs>"
31987 #: ../src/guestfs-availability.pod:119
31989 "The following functions: L</guestfs_ntfsresize> L</guestfs_ntfsresize_opts> "
31990 "L</guestfs_ntfsresize_size>"
31994 #: ../src/guestfs-availability.pod:124
31995 msgid "B<realpath>"
31999 #: ../src/guestfs-availability.pod:126
32000 msgid "The following functions: L</guestfs_realpath>"
32004 #: ../src/guestfs-availability.pod:129
32009 #: ../src/guestfs-availability.pod:131
32011 "The following functions: L</guestfs_scrub_device> L</guestfs_scrub_file> "
32012 "L</guestfs_scrub_freespace>"
32016 #: ../src/guestfs-availability.pod:136
32021 #: ../src/guestfs-availability.pod:138
32022 msgid "The following functions: L</guestfs_getcon> L</guestfs_setcon>"
32026 #: ../src/guestfs-availability.pod:142
32031 #: ../src/guestfs-availability.pod:144
32032 msgid "The following functions: L</guestfs_txz_in> L</guestfs_txz_out>"
32036 #: ../src/guestfs-availability.pod:148
32037 msgid "B<zerofree>"
32041 #: ../src/guestfs-availability.pod:150
32042 msgid "The following functions: L</guestfs_zerofree>"
32046 #: ../src/guestfs-structs.pod:1
32047 msgid "guestfs_int_bool"
32051 #: ../src/guestfs-structs.pod:3
32054 " struct guestfs_int_bool {\n"
32062 #: ../src/guestfs-structs.pod:8
32065 " struct guestfs_int_bool_list {\n"
32066 " uint32_t len; /* Number of elements in list. */\n"
32067 " struct guestfs_int_bool *val; /* Elements. */\n"
32073 #: ../src/guestfs-structs.pod:13
32076 " void guestfs_free_int_bool (struct guestfs_free_int_bool *);\n"
32077 " void guestfs_free_int_bool_list (struct guestfs_free_int_bool_list *);\n"
32082 #: ../src/guestfs-structs.pod:16
32083 msgid "guestfs_lvm_pv"
32087 #: ../src/guestfs-structs.pod:18
32090 " struct guestfs_lvm_pv {\n"
32091 " char *pv_name;\n"
32092 " /* The next field is NOT nul-terminated, be careful when printing it: "
32094 " char pv_uuid[32];\n"
32096 " uint64_t pv_size;\n"
32097 " uint64_t dev_size;\n"
32098 " uint64_t pv_free;\n"
32099 " uint64_t pv_used;\n"
32100 " char *pv_attr;\n"
32101 " int64_t pv_pe_count;\n"
32102 " int64_t pv_pe_alloc_count;\n"
32103 " char *pv_tags;\n"
32104 " uint64_t pe_start;\n"
32105 " int64_t pv_mda_count;\n"
32106 " uint64_t pv_mda_free;\n"
32112 #: ../src/guestfs-structs.pod:36
32115 " struct guestfs_lvm_pv_list {\n"
32116 " uint32_t len; /* Number of elements in list. */\n"
32117 " struct guestfs_lvm_pv *val; /* Elements. */\n"
32123 #: ../src/guestfs-structs.pod:41
32126 " void guestfs_free_lvm_pv (struct guestfs_free_lvm_pv *);\n"
32127 " void guestfs_free_lvm_pv_list (struct guestfs_free_lvm_pv_list *);\n"
32132 #: ../src/guestfs-structs.pod:44
32133 msgid "guestfs_lvm_vg"
32137 #: ../src/guestfs-structs.pod:46
32140 " struct guestfs_lvm_vg {\n"
32141 " char *vg_name;\n"
32142 " /* The next field is NOT nul-terminated, be careful when printing it: "
32144 " char vg_uuid[32];\n"
32146 " char *vg_attr;\n"
32147 " uint64_t vg_size;\n"
32148 " uint64_t vg_free;\n"
32149 " char *vg_sysid;\n"
32150 " uint64_t vg_extent_size;\n"
32151 " int64_t vg_extent_count;\n"
32152 " int64_t vg_free_count;\n"
32153 " int64_t max_lv;\n"
32154 " int64_t max_pv;\n"
32155 " int64_t pv_count;\n"
32156 " int64_t lv_count;\n"
32157 " int64_t snap_count;\n"
32158 " int64_t vg_seqno;\n"
32159 " char *vg_tags;\n"
32160 " int64_t vg_mda_count;\n"
32161 " uint64_t vg_mda_free;\n"
32167 #: ../src/guestfs-structs.pod:69
32170 " struct guestfs_lvm_vg_list {\n"
32171 " uint32_t len; /* Number of elements in list. */\n"
32172 " struct guestfs_lvm_vg *val; /* Elements. */\n"
32178 #: ../src/guestfs-structs.pod:74
32181 " void guestfs_free_lvm_vg (struct guestfs_free_lvm_vg *);\n"
32182 " void guestfs_free_lvm_vg_list (struct guestfs_free_lvm_vg_list *);\n"
32187 #: ../src/guestfs-structs.pod:77
32188 msgid "guestfs_lvm_lv"
32192 #: ../src/guestfs-structs.pod:79
32195 " struct guestfs_lvm_lv {\n"
32196 " char *lv_name;\n"
32197 " /* The next field is NOT nul-terminated, be careful when printing it: "
32199 " char lv_uuid[32];\n"
32200 " char *lv_attr;\n"
32201 " int64_t lv_major;\n"
32202 " int64_t lv_minor;\n"
32203 " int64_t lv_kernel_major;\n"
32204 " int64_t lv_kernel_minor;\n"
32205 " uint64_t lv_size;\n"
32206 " int64_t seg_count;\n"
32208 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32209 " float snap_percent;\n"
32210 " /* The next field is [0..100] or -1 meaning 'not present': */\n"
32211 " float copy_percent;\n"
32212 " char *move_pv;\n"
32213 " char *lv_tags;\n"
32214 " char *mirror_log;\n"
32215 " char *modules;\n"
32221 #: ../src/guestfs-structs.pod:101
32224 " struct guestfs_lvm_lv_list {\n"
32225 " uint32_t len; /* Number of elements in list. */\n"
32226 " struct guestfs_lvm_lv *val; /* Elements. */\n"
32232 #: ../src/guestfs-structs.pod:106
32235 " void guestfs_free_lvm_lv (struct guestfs_free_lvm_lv *);\n"
32236 " void guestfs_free_lvm_lv_list (struct guestfs_free_lvm_lv_list *);\n"
32241 #: ../src/guestfs-structs.pod:111
32244 " struct guestfs_stat {\n"
32248 " int64_t nlink;\n"
32253 " int64_t blksize;\n"
32254 " int64_t blocks;\n"
32255 " int64_t atime;\n"
32256 " int64_t mtime;\n"
32257 " int64_t ctime;\n"
32263 #: ../src/guestfs-structs.pod:127
32266 " struct guestfs_stat_list {\n"
32267 " uint32_t len; /* Number of elements in list. */\n"
32268 " struct guestfs_stat *val; /* Elements. */\n"
32274 #: ../src/guestfs-structs.pod:132
32277 " void guestfs_free_stat (struct guestfs_free_stat *);\n"
32278 " void guestfs_free_stat_list (struct guestfs_free_stat_list *);\n"
32283 #: ../src/guestfs-structs.pod:137
32286 " struct guestfs_statvfs {\n"
32287 " int64_t bsize;\n"
32288 " int64_t frsize;\n"
32289 " int64_t blocks;\n"
32290 " int64_t bfree;\n"
32291 " int64_t bavail;\n"
32292 " int64_t files;\n"
32293 " int64_t ffree;\n"
32294 " int64_t favail;\n"
32297 " int64_t namemax;\n"
32303 #: ../src/guestfs-structs.pod:151
32306 " struct guestfs_statvfs_list {\n"
32307 " uint32_t len; /* Number of elements in list. */\n"
32308 " struct guestfs_statvfs *val; /* Elements. */\n"
32314 #: ../src/guestfs-structs.pod:156
32317 " void guestfs_free_statvfs (struct guestfs_free_statvfs *);\n"
32318 " void guestfs_free_statvfs_list (struct guestfs_free_statvfs_list *);\n"
32323 #: ../src/guestfs-structs.pod:159
32324 msgid "guestfs_dirent"
32328 #: ../src/guestfs-structs.pod:161
32331 " struct guestfs_dirent {\n"
32340 #: ../src/guestfs-structs.pod:167
32343 " struct guestfs_dirent_list {\n"
32344 " uint32_t len; /* Number of elements in list. */\n"
32345 " struct guestfs_dirent *val; /* Elements. */\n"
32351 #: ../src/guestfs-structs.pod:172
32354 " void guestfs_free_dirent (struct guestfs_free_dirent *);\n"
32355 " void guestfs_free_dirent_list (struct guestfs_free_dirent_list *);\n"
32360 #: ../src/guestfs-structs.pod:177
32363 " struct guestfs_version {\n"
32364 " int64_t major;\n"
32365 " int64_t minor;\n"
32366 " int64_t release;\n"
32373 #: ../src/guestfs-structs.pod:184
32376 " struct guestfs_version_list {\n"
32377 " uint32_t len; /* Number of elements in list. */\n"
32378 " struct guestfs_version *val; /* Elements. */\n"
32384 #: ../src/guestfs-structs.pod:189
32387 " void guestfs_free_version (struct guestfs_free_version *);\n"
32388 " void guestfs_free_version_list (struct guestfs_free_version_list *);\n"
32393 #: ../src/guestfs-structs.pod:192
32394 msgid "guestfs_xattr"
32398 #: ../src/guestfs-structs.pod:194
32401 " struct guestfs_xattr {\n"
32402 " char *attrname;\n"
32403 " /* The next two fields describe a byte array. */\n"
32404 " uint32_t attrval_len;\n"
32405 " char *attrval;\n"
32411 #: ../src/guestfs-structs.pod:201
32414 " struct guestfs_xattr_list {\n"
32415 " uint32_t len; /* Number of elements in list. */\n"
32416 " struct guestfs_xattr *val; /* Elements. */\n"
32422 #: ../src/guestfs-structs.pod:206
32425 " void guestfs_free_xattr (struct guestfs_free_xattr *);\n"
32426 " void guestfs_free_xattr_list (struct guestfs_free_xattr_list *);\n"
32431 #: ../src/guestfs-structs.pod:209
32432 msgid "guestfs_inotify_event"
32436 #: ../src/guestfs-structs.pod:211
32439 " struct guestfs_inotify_event {\n"
32440 " int64_t in_wd;\n"
32441 " uint32_t in_mask;\n"
32442 " uint32_t in_cookie;\n"
32443 " char *in_name;\n"
32449 #: ../src/guestfs-structs.pod:218
32452 " struct guestfs_inotify_event_list {\n"
32453 " uint32_t len; /* Number of elements in list. */\n"
32454 " struct guestfs_inotify_event *val; /* Elements. */\n"
32460 #: ../src/guestfs-structs.pod:223
32463 " void guestfs_free_inotify_event (struct guestfs_free_inotify_event *);\n"
32464 " void guestfs_free_inotify_event_list (struct "
32465 "guestfs_free_inotify_event_list *);\n"
32470 #: ../src/guestfs-structs.pod:226
32471 msgid "guestfs_partition"
32475 #: ../src/guestfs-structs.pod:228
32478 " struct guestfs_partition {\n"
32479 " int32_t part_num;\n"
32480 " uint64_t part_start;\n"
32481 " uint64_t part_end;\n"
32482 " uint64_t part_size;\n"
32488 #: ../src/guestfs-structs.pod:235
32491 " struct guestfs_partition_list {\n"
32492 " uint32_t len; /* Number of elements in list. */\n"
32493 " struct guestfs_partition *val; /* Elements. */\n"
32499 #: ../src/guestfs-structs.pod:240
32502 " void guestfs_free_partition (struct guestfs_free_partition *);\n"
32503 " void guestfs_free_partition_list (struct guestfs_free_partition_list *);\n"
32508 #: ../src/guestfs-structs.pod:243
32509 msgid "guestfs_application"
32513 #: ../src/guestfs-structs.pod:245
32516 " struct guestfs_application {\n"
32517 " char *app_name;\n"
32518 " char *app_display_name;\n"
32519 " int32_t app_epoch;\n"
32520 " char *app_version;\n"
32521 " char *app_release;\n"
32522 " char *app_install_path;\n"
32523 " char *app_trans_path;\n"
32524 " char *app_publisher;\n"
32525 " char *app_url;\n"
32526 " char *app_source_package;\n"
32527 " char *app_summary;\n"
32528 " char *app_description;\n"
32534 #: ../src/guestfs-structs.pod:260
32537 " struct guestfs_application_list {\n"
32538 " uint32_t len; /* Number of elements in list. */\n"
32539 " struct guestfs_application *val; /* Elements. */\n"
32545 #: ../src/guestfs-structs.pod:265
32548 " void guestfs_free_application (struct guestfs_free_application *);\n"
32549 " void guestfs_free_application_list (struct guestfs_free_application_list "
32555 #: ../src/guestfs.pod:5
32556 msgid "guestfs - Library for accessing and modifying virtual machine images"
32560 #: ../src/guestfs.pod:11
32563 " guestfs_h *g = guestfs_create ();\n"
32564 " guestfs_add_drive (g, \"guest.img\");\n"
32565 " guestfs_launch (g);\n"
32566 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
32567 " guestfs_touch (g, \"/hello\");\n"
32568 " guestfs_umount (g, \"/\");\n"
32569 " guestfs_close (g);\n"
32574 #: ../src/guestfs.pod:25
32576 "Libguestfs is a library for accessing and modifying guest disk images. "
32577 "Amongst the things this is good for: making batch configuration changes to "
32578 "guests, getting disk used/free statistics (see also: virt-df), migrating "
32579 "between virtualization systems (see also: virt-p2v), performing partial "
32580 "backups, performing partial guest clones, cloning guests and changing "
32581 "registry/UUID/hostname info, and much else besides."
32585 #: ../src/guestfs.pod:33
32587 "Libguestfs uses Linux kernel and qemu code, and can access any type of guest "
32588 "filesystem that Linux and qemu can, including but not limited to: ext2/3/4, "
32589 "btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, "
32594 #: ../src/guestfs.pod:38
32596 "Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, "
32597 "what filesystem is in each LV, etc.). It can also run commands in the "
32598 "context of the guest. Also you can access filesystems over FUSE."
32602 #: ../src/guestfs.pod:43
32604 "Libguestfs is a library that can be linked with C and C++ management "
32605 "programs (or management programs written in OCaml, Perl, Python, Ruby, Java, "
32606 "PHP, Erlang, Haskell or C#). You can also use it from shell scripts or the "
32611 #: ../src/guestfs.pod:48
32613 "You don't need to be root to use libguestfs, although obviously you do need "
32614 "enough permissions to access the disk images."
32618 #: ../src/guestfs.pod:51
32620 "Libguestfs is a large API because it can do many things. For a gentle "
32621 "introduction, please read the L</API OVERVIEW> section next."
32625 #: ../src/guestfs.pod:54
32627 "There are also some example programs in the L<guestfs-examples(3)> manual "
32632 #: ../src/guestfs.pod:57
32633 msgid "API OVERVIEW"
32637 #: ../src/guestfs.pod:59
32639 "This section provides a gentler overview of the libguestfs API. We also try "
32640 "to group API calls together, where that may not be obvious from reading "
32641 "about the individual calls in the main section of this manual."
32645 #: ../src/guestfs.pod:64
32650 #: ../src/guestfs.pod:66
32652 "Before you can use libguestfs calls, you have to create a handle. Then you "
32653 "must add at least one disk image to the handle, followed by launching the "
32654 "handle, then performing whatever operations you want, and finally closing "
32655 "the handle. By convention we use the single letter C<g> for the name of the "
32656 "handle variable, although of course you can use any name you want."
32660 #: ../src/guestfs.pod:73
32661 msgid "The general structure of all libguestfs-using programs looks like this:"
32665 #: ../src/guestfs.pod:76
32668 " guestfs_h *g = guestfs_create ();\n"
32673 #: ../src/guestfs.pod:78
32676 " /* Call guestfs_add_drive additional times if there are\n"
32677 " * multiple disk images.\n"
32679 " guestfs_add_drive (g, \"guest.img\");\n"
32684 #: ../src/guestfs.pod:83
32687 " /* Most manipulation calls won't work until you've launched\n"
32688 " * the handle 'g'. You have to do this _after_ adding drives\n"
32689 " * and _before_ other commands.\n"
32691 " guestfs_launch (g);\n"
32696 #: ../src/guestfs.pod:89
32699 " /* Now you can examine what partitions, LVs etc are available.\n"
32701 " char **partitions = guestfs_list_partitions (g);\n"
32702 " char **logvols = guestfs_lvs (g);\n"
32707 #: ../src/guestfs.pod:94
32710 " /* To access a filesystem in the image, you must mount it.\n"
32712 " guestfs_mount (g, \"/dev/sda1\", \"/\");\n"
32717 #: ../src/guestfs.pod:98
32720 " /* Now you can perform filesystem actions on the guest\n"
32723 " guestfs_touch (g, \"/hello\");\n"
32728 #: ../src/guestfs.pod:103
32731 " /* This is only needed for libguestfs < 1.5.24. Since then\n"
32732 " * it is done automatically when you close the handle. See\n"
32733 " * discussion of autosync in this page.\n"
32735 " guestfs_sync (g);\n"
32740 #: ../src/guestfs.pod:109
32743 " /* Close the handle 'g'. */\n"
32744 " guestfs_close (g);\n"
32749 #: ../src/guestfs.pod:112
32751 "The code above doesn't include any error checking. In real code you should "
32752 "check return values carefully for errors. In general all functions that "
32753 "return integers return C<-1> on error, and all functions that return "
32754 "pointers return C<NULL> on error. See section L</ERROR HANDLING> below for "
32755 "how to handle errors, and consult the documentation for each function call "
32756 "below to see precisely how they return error indications. See "
32757 "L<guestfs-examples(3)> for fully worked examples."
32761 #: ../src/guestfs.pod:121
32762 msgid "DISK IMAGES"
32766 #: ../src/guestfs.pod:123
32768 "The image filename (C<\"guest.img\"> in the example above) could be a disk "
32769 "image from a virtual machine, a L<dd(1)> copy of a physical hard disk, an "
32770 "actual block device, or simply an empty file of zeroes that you have created "
32771 "through L<posix_fallocate(3)>. Libguestfs lets you do useful things to all "
32776 #: ../src/guestfs.pod:129
32778 "The call you should use in modern code for adding drives is "
32779 "L</guestfs_add_drive_opts>. To add a disk image, allowing writes, and "
32780 "specifying that the format is raw, do:"
32784 #: ../src/guestfs.pod:133
32787 " guestfs_add_drive_opts (g, filename,\n"
32788 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32794 #: ../src/guestfs.pod:137
32795 msgid "You can add a disk read-only using:"
32799 #: ../src/guestfs.pod:139
32802 " guestfs_add_drive_opts (g, filename,\n"
32803 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"raw\",\n"
32804 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
32810 #: ../src/guestfs.pod:144
32812 "or by calling the older function L</guestfs_add_drive_ro>. In either case "
32813 "libguestfs won't modify the file."
32817 #: ../src/guestfs.pod:147
32819 "Be extremely cautious if the disk image is in use, eg. if it is being used "
32820 "by a virtual machine. Adding it read-write will almost certainly cause disk "
32821 "corruption, but adding it read-only is safe."
32825 #: ../src/guestfs.pod:151
32827 "You must add at least one disk image, and you may add multiple disk images. "
32828 "In the API, the disk images are usually referred to as C</dev/sda> (for the "
32829 "first one you added), C</dev/sdb> (for the second one you added), etc."
32833 #: ../src/guestfs.pod:156
32835 "Once L</guestfs_launch> has been called you cannot add any more images. You "
32836 "can call L</guestfs_list_devices> to get a list of the device names, in the "
32837 "order that you added them. See also L</BLOCK DEVICE NAMING> below."
32841 #: ../src/guestfs.pod:161
32846 #: ../src/guestfs.pod:163
32848 "Before you can read or write files, create directories and so on in a disk "
32849 "image that contains filesystems, you have to mount those filesystems using "
32850 "L</guestfs_mount_options> or L</guestfs_mount_ro>. If you already know that "
32851 "a disk image contains (for example) one partition with a filesystem on that "
32852 "partition, then you can mount it directly:"
32856 #: ../src/guestfs.pod:170
32859 " guestfs_mount_options (g, \"\", \"/dev/sda1\", \"/\");\n"
32864 #: ../src/guestfs.pod:172
32866 "where C</dev/sda1> means literally the first partition (C<1>) of the first "
32867 "disk image that we added (C</dev/sda>). If the disk contains Linux LVM2 "
32868 "logical volumes you could refer to those instead (eg. C</dev/VG/LV>). Note "
32869 "that these are libguestfs virtual devices, and are nothing to do with host "
32874 #: ../src/guestfs.pod:178
32876 "If you are given a disk image and you don't know what it contains then you "
32877 "have to find out. Libguestfs can do that too: use "
32878 "L</guestfs_list_partitions> and L</guestfs_lvs> to list possible partitions "
32879 "and LVs, and either try mounting each to see what is mountable, or else "
32880 "examine them with L</guestfs_vfs_type> or L</guestfs_file>. To list just "
32881 "filesystems, use L</guestfs_list_filesystems>."
32885 #: ../src/guestfs.pod:186
32887 "Libguestfs also has a set of APIs for inspection of unknown disk images (see "
32888 "L</INSPECTION> below). But you might find it easier to look at higher level "
32889 "programs built on top of libguestfs, in particular L<virt-inspector(1)>."
32893 #: ../src/guestfs.pod:191
32895 "To mount a filesystem read-only, use L</guestfs_mount_ro>. There are "
32896 "several other variations of the C<guestfs_mount_*> call."
32900 #: ../src/guestfs.pod:194
32901 msgid "FILESYSTEM ACCESS AND MODIFICATION"
32905 #: ../src/guestfs.pod:196
32907 "The majority of the libguestfs API consists of fairly low-level calls for "
32908 "accessing and modifying the files, directories, symlinks etc on mounted "
32909 "filesystems. There are over a hundred such calls which you can find listed "
32910 "in detail below in this man page, and we don't even pretend to cover them "
32911 "all in this overview."
32915 #: ../src/guestfs.pod:202
32917 "Specify filenames as full paths, starting with C<\"/\"> and including the "
32922 #: ../src/guestfs.pod:205
32924 "For example, if you mounted a filesystem at C<\"/\"> and you want to read "
32925 "the file called C<\"etc/passwd\"> then you could do:"
32929 #: ../src/guestfs.pod:208
32932 " char *data = guestfs_cat (g, \"/etc/passwd\");\n"
32937 #: ../src/guestfs.pod:210
32939 "This would return C<data> as a newly allocated buffer containing the full "
32940 "content of that file (with some conditions: see also L</DOWNLOADING> below), "
32941 "or C<NULL> if there was an error."
32945 #: ../src/guestfs.pod:214
32947 "As another example, to create a top-level directory on that filesystem "
32948 "called C<\"var\"> you would do:"
32952 #: ../src/guestfs.pod:217
32955 " guestfs_mkdir (g, \"/var\");\n"
32960 #: ../src/guestfs.pod:219
32961 msgid "To create a symlink you could do:"
32965 #: ../src/guestfs.pod:221
32968 " guestfs_ln_s (g, \"/etc/init.d/portmap\",\n"
32969 " \"/etc/rc3.d/S30portmap\");\n"
32974 #: ../src/guestfs.pod:224
32976 "Libguestfs will reject attempts to use relative paths and there is no "
32977 "concept of a current working directory."
32981 #: ../src/guestfs.pod:227
32983 "Libguestfs can return errors in many situations: for example if the "
32984 "filesystem isn't writable, or if a file or directory that you requested "
32985 "doesn't exist. If you are using the C API (documented here) you have to "
32986 "check for those error conditions after each call. (Other language bindings "
32987 "turn these errors into exceptions)."
32991 #: ../src/guestfs.pod:233
32993 "File writes are affected by the per-handle umask, set by calling "
32994 "L</guestfs_umask> and defaulting to 022. See L</UMASK>."
32998 #: ../src/guestfs.pod:236
32999 msgid "PARTITIONING"
33003 #: ../src/guestfs.pod:238
33005 "Libguestfs contains API calls to read, create and modify partition tables on "
33010 #: ../src/guestfs.pod:241
33012 "In the common case where you want to create a single partition covering the "
33013 "whole disk, you should use the L</guestfs_part_disk> call:"
33017 #: ../src/guestfs.pod:245
33020 " const char *parttype = \"mbr\";\n"
33021 " if (disk_is_larger_than_2TB)\n"
33022 " parttype = \"gpt\";\n"
33023 " guestfs_part_disk (g, \"/dev/sda\", parttype);\n"
33028 #: ../src/guestfs.pod:250
33030 "Obviously this effectively wipes anything that was on that disk image "
33035 #: ../src/guestfs.pod:253
33040 #: ../src/guestfs.pod:255
33042 "Libguestfs provides access to a large part of the LVM2 API, such as "
33043 "L</guestfs_lvcreate> and L</guestfs_vgremove>. It won't make much sense "
33044 "unless you familiarize yourself with the concepts of physical volumes, "
33045 "volume groups and logical volumes."
33049 #: ../src/guestfs.pod:260
33051 "This author strongly recommends reading the LVM HOWTO, online at "
33052 "L<http://tldp.org/HOWTO/LVM-HOWTO/>."
33056 #: ../src/guestfs.pod:263
33057 msgid "DOWNLOADING"
33061 #: ../src/guestfs.pod:265
33063 "Use L</guestfs_cat> to download small, text only files. This call is "
33064 "limited to files which are less than 2 MB and which cannot contain any ASCII "
33065 "NUL (C<\\0>) characters. However the API is very simple to use."
33069 #: ../src/guestfs.pod:269
33071 "L</guestfs_read_file> can be used to read files which contain arbitrary 8 "
33072 "bit data, since it returns a (pointer, size) pair. However it is still "
33073 "limited to \"small\" files, less than 2 MB."
33077 #: ../src/guestfs.pod:273
33079 "L</guestfs_download> can be used to download any file, with no limits on "
33080 "content or size (even files larger than 4 GB)."
33084 #: ../src/guestfs.pod:276
33085 msgid "To download multiple files, see L</guestfs_tar_out> and L</guestfs_tgz_out>."
33089 #: ../src/guestfs.pod:279
33094 #: ../src/guestfs.pod:281
33096 "It's often the case that you want to write a file or files to the disk "
33101 #: ../src/guestfs.pod:284
33103 "To write a small file with fixed content, use L</guestfs_write>. To create "
33104 "a file of all zeroes, use L</guestfs_truncate_size> (sparse) or "
33105 "L</guestfs_fallocate64> (with all disk blocks allocated). There are a "
33106 "variety of other functions for creating test files, for example "
33107 "L</guestfs_fill> and L</guestfs_fill_pattern>."
33111 #: ../src/guestfs.pod:290
33113 "To upload a single file, use L</guestfs_upload>. This call has no limits on "
33114 "file content or size (even files larger than 4 GB)."
33118 #: ../src/guestfs.pod:293
33119 msgid "To upload multiple files, see L</guestfs_tar_in> and L</guestfs_tgz_in>."
33123 #: ../src/guestfs.pod:295
33125 "However the fastest way to upload I<large numbers of arbitrary files> is to "
33126 "turn them into a squashfs or CD ISO (see L<mksquashfs(8)> and "
33127 "L<mkisofs(8)>), then attach this using L</guestfs_add_drive_ro>. If you add "
33128 "the drive in a predictable way (eg. adding it last after all other drives) "
33129 "then you can get the device name from L</guestfs_list_devices> and mount it "
33130 "directly using L</guestfs_mount_ro>. Note that squashfs images are "
33131 "sometimes non-portable between kernel versions, and they don't support "
33132 "labels or UUIDs. If you want to pre-build an image or you need to mount it "
33133 "using a label or UUID, use an ISO image instead."
33137 #: ../src/guestfs.pod:306
33142 #: ../src/guestfs.pod:308
33144 "There are various different commands for copying between files and devices "
33145 "and in and out of the guest filesystem. These are summarised in the table "
33150 #: ../src/guestfs.pod:314
33151 msgid "B<file> to B<file>"
33155 #: ../src/guestfs.pod:316
33157 "Use L</guestfs_cp> to copy a single file, or L</guestfs_cp_a> to copy "
33158 "directories recursively."
33162 #: ../src/guestfs.pod:319
33163 msgid "B<file or device> to B<file or device>"
33167 #: ../src/guestfs.pod:321
33169 "Use L</guestfs_dd> which efficiently uses L<dd(1)> to copy between files and "
33170 "devices in the guest."
33174 #: ../src/guestfs.pod:324
33175 msgid "Example: duplicate the contents of an LV:"
33179 #: ../src/guestfs.pod:326
33182 " guestfs_dd (g, \"/dev/VG/Original\", \"/dev/VG/Copy\");\n"
33187 #: ../src/guestfs.pod:328
33189 "The destination (C</dev/VG/Copy>) must be at least as large as the source "
33190 "(C</dev/VG/Original>). To copy less than the whole source device, use "
33191 "L</guestfs_copy_size>."
33195 #: ../src/guestfs.pod:332
33196 msgid "B<file on the host> to B<file or device>"
33200 #: ../src/guestfs.pod:334
33201 msgid "Use L</guestfs_upload>. See L</UPLOADING> above."
33205 #: ../src/guestfs.pod:336
33206 msgid "B<file or device> to B<file on the host>"
33210 #: ../src/guestfs.pod:338
33211 msgid "Use L</guestfs_download>. See L</DOWNLOADING> above."
33215 #: ../src/guestfs.pod:342
33216 msgid "UPLOADING AND DOWNLOADING TO PIPES AND FILE DESCRIPTORS"
33220 #: ../src/guestfs.pod:344
33222 "Calls like L</guestfs_upload>, L</guestfs_download>, L</guestfs_tar_in>, "
33223 "L</guestfs_tar_out> etc appear to only take filenames as arguments, so it "
33224 "appears you can only upload and download to files. However many Un*x-like "
33225 "hosts let you use the special device files C</dev/stdin>, C</dev/stdout>, "
33226 "C</dev/stderr> and C</dev/fd/N> to read and write from stdin, stdout, "
33227 "stderr, and arbitrary file descriptor N."
33231 #: ../src/guestfs.pod:352
33232 msgid "For example, L<virt-cat(1)> writes its output to stdout by doing:"
33236 #: ../src/guestfs.pod:355
33239 " guestfs_download (g, filename, \"/dev/stdout\");\n"
33244 #: ../src/guestfs.pod:357
33245 msgid "and you can write tar output to a file descriptor C<fd> by doing:"
33249 #: ../src/guestfs.pod:359
33252 " char devfd[64];\n"
33253 " snprintf (devfd, sizeof devfd, \"/dev/fd/%d\", fd);\n"
33254 " guestfs_tar_out (g, \"/\", devfd);\n"
33259 #: ../src/guestfs.pod:363
33260 msgid "LISTING FILES"
33264 #: ../src/guestfs.pod:365
33266 "L</guestfs_ll> is just designed for humans to read (mainly when using the "
33267 "L<guestfish(1)>-equivalent command C<ll>)."
33271 #: ../src/guestfs.pod:368
33273 "L</guestfs_ls> is a quick way to get a list of files in a directory from "
33274 "programs, as a flat list of strings."
33278 #: ../src/guestfs.pod:371
33280 "L</guestfs_readdir> is a programmatic way to get a list of files in a "
33281 "directory, plus additional information about each one. It is more "
33282 "equivalent to using the L<readdir(3)> call on a local filesystem."
33286 #: ../src/guestfs.pod:375
33288 "L</guestfs_find> and L</guestfs_find0> can be used to recursively list "
33293 #: ../src/guestfs.pod:378
33294 msgid "RUNNING COMMANDS"
33298 #: ../src/guestfs.pod:380
33300 "Although libguestfs is primarily an API for manipulating files inside guest "
33301 "images, we also provide some limited facilities for running commands inside "
33306 #: ../src/guestfs.pod:384
33307 msgid "There are many limitations to this:"
33311 #: ../src/guestfs.pod:390
33313 "The kernel version that the command runs under will be different from what "
33318 #: ../src/guestfs.pod:395
33320 "If the command needs to communicate with daemons, then most likely they "
33321 "won't be running."
33325 #: ../src/guestfs.pod:400
33326 msgid "The command will be running in limited memory."
33330 #: ../src/guestfs.pod:404
33332 "The network may not be available unless you enable it (see "
33333 "L</guestfs_set_network>)."
33337 #: ../src/guestfs.pod:409
33338 msgid "Only supports Linux guests (not Windows, BSD, etc)."
33342 #: ../src/guestfs.pod:413
33343 msgid "Architecture limitations (eg. won't work for a PPC guest on an X86 host)."
33347 #: ../src/guestfs.pod:418
33349 "For SELinux guests, you may need to enable SELinux and load policy first. "
33350 "See L</SELINUX> in this manpage."
33354 #: ../src/guestfs.pod:423
33356 "I<Security:> It is not safe to run commands from untrusted, possibly "
33357 "malicious guests. These commands may attempt to exploit your program by "
33358 "sending unexpected output. They could also try to exploit the Linux kernel "
33359 "or qemu provided by the libguestfs appliance. They could use the network "
33360 "provided by the libguestfs appliance to bypass ordinary network partitions "
33361 "and firewalls. They could use the elevated privileges or different SELinux "
33362 "context of your program to their advantage."
33366 #: ../src/guestfs.pod:432
33368 "A secure alternative is to use libguestfs to install a \"firstboot\" script "
33369 "(a script which runs when the guest next boots normally), and to have this "
33370 "script run the commands you want in the normal context of the running guest, "
33371 "network security and so on. For information about other security issues, "
33372 "see L</SECURITY>."
33376 #: ../src/guestfs.pod:440
33378 "The two main API calls to run commands are L</guestfs_command> and "
33379 "L</guestfs_sh> (there are also variations)."
33383 #: ../src/guestfs.pod:443
33385 "The difference is that L</guestfs_sh> runs commands using the shell, so any "
33386 "shell globs, redirections, etc will work."
33390 #: ../src/guestfs.pod:446
33391 msgid "CONFIGURATION FILES"
33395 #: ../src/guestfs.pod:448
33397 "To read and write configuration files in Linux guest filesystems, we "
33398 "strongly recommend using Augeas. For example, Augeas understands how to "
33399 "read and write, say, a Linux shadow password file or X.org configuration "
33400 "file, and so avoids you having to write that code."
33404 #: ../src/guestfs.pod:453
33406 "The main Augeas calls are bound through the C<guestfs_aug_*> APIs. We don't "
33407 "document Augeas itself here because there is excellent documentation on the "
33408 "L<http://augeas.net/> website."
33412 #: ../src/guestfs.pod:457
33414 "If you don't want to use Augeas (you fool!) then try calling "
33415 "L</guestfs_read_lines> to get the file as a list of lines which you can "
33420 #: ../src/guestfs.pod:461
33425 #: ../src/guestfs.pod:463
33427 "We support SELinux guests. To ensure that labeling happens correctly in "
33428 "SELinux guests, you need to enable SELinux and load the guest's policy:"
33432 #: ../src/guestfs.pod:471
33433 msgid "Before launching, do:"
33437 #: ../src/guestfs.pod:473
33440 " guestfs_set_selinux (g, 1);\n"
33445 #: ../src/guestfs.pod:477
33447 "After mounting the guest's filesystem(s), load the policy. This is best "
33448 "done by running the L<load_policy(8)> command in the guest itself:"
33452 #: ../src/guestfs.pod:481
33455 " guestfs_sh (g, \"/usr/sbin/load_policy\");\n"
33460 #: ../src/guestfs.pod:483
33462 "(Older versions of C<load_policy> require you to specify the name of the "
33467 #: ../src/guestfs.pod:488
33469 "Optionally, set the security context for the API. The correct security "
33470 "context to use can only be known by inspecting the guest. As an example:"
33474 #: ../src/guestfs.pod:492
33477 " guestfs_setcon (g, \"unconfined_u:unconfined_r:unconfined_t:s0\");\n"
33482 #: ../src/guestfs.pod:496
33483 msgid "This will work for running commands and editing existing files."
33487 #: ../src/guestfs.pod:498
33489 "When new files are created, you may need to label them explicitly, for "
33490 "example by running the external command C<restorecon pathname>."
33494 #: ../src/guestfs.pod:502
33499 #: ../src/guestfs.pod:504
33501 "Certain calls are affected by the current file mode creation mask (the "
33502 "\"umask\"). In particular ones which create files or directories, such as "
33503 "L</guestfs_touch>, L</guestfs_mknod> or L</guestfs_mkdir>. This affects "
33504 "either the default mode that the file is created with or modifies the mode "
33509 #: ../src/guestfs.pod:510
33511 "The default umask is C<022>, so files are created with modes such as C<0644> "
33512 "and directories with C<0755>."
33516 #: ../src/guestfs.pod:513
33518 "There are two ways to avoid being affected by umask. Either set umask to 0 "
33519 "(call C<guestfs_umask (g, 0)> early after launching). Or call "
33520 "L</guestfs_chmod> after creating each file or directory."
33524 #: ../src/guestfs.pod:517
33525 msgid "For more information about umask, see L<umask(2)>."
33529 #: ../src/guestfs.pod:521
33531 "Libguestfs allows you to access Linux guests which have been encrypted using "
33532 "whole disk encryption that conforms to the Linux Unified Key Setup (LUKS) "
33533 "standard. This includes nearly all whole disk encryption systems used by "
33534 "modern Linux guests."
33538 #: ../src/guestfs.pod:527
33540 "Use L</guestfs_vfs_type> to identify LUKS-encrypted block devices (it "
33541 "returns the string C<crypto_LUKS>)."
33545 #: ../src/guestfs.pod:530
33547 "Then open these devices by calling L</guestfs_luks_open>. Obviously you "
33548 "will require the passphrase!"
33552 #: ../src/guestfs.pod:533
33554 "Opening a LUKS device creates a new device mapper device called "
33555 "C</dev/mapper/mapname> (where C<mapname> is the string you supply to "
33556 "L</guestfs_luks_open>). Reads and writes to this mapper device are "
33557 "decrypted from and encrypted to the underlying block device respectively."
33561 #: ../src/guestfs.pod:539
33563 "LVM volume groups on the device can be made visible by calling "
33564 "L</guestfs_vgscan> followed by L</guestfs_vg_activate_all>. The logical "
33565 "volume(s) can now be mounted in the usual way."
33569 #: ../src/guestfs.pod:543
33571 "Use the reverse process to close a LUKS device. Unmount any logical volumes "
33572 "on it, deactivate the volume groups by caling C<guestfs_vg_activate (g, 0, "
33573 "[\"/dev/VG\"])>. Then close the mapper device by calling "
33574 "L</guestfs_luks_close> on the C</dev/mapper/mapname> device (I<not> the "
33575 "underlying encrypted block device)."
33579 #: ../src/guestfs.pod:550
33584 #: ../src/guestfs.pod:552
33586 "Libguestfs has APIs for inspecting an unknown disk image to find out if it "
33587 "contains operating systems, an install CD or a live CD. (These APIs used to "
33588 "be in a separate Perl-only library called L<Sys::Guestfs::Lib(3)> but since "
33589 "version 1.5.3 the most frequently used part of this library has been "
33590 "rewritten in C and moved into the core code)."
33594 #: ../src/guestfs.pod:559
33596 "Add all disks belonging to the unknown virtual machine and call "
33597 "L</guestfs_launch> in the usual way."
33601 #: ../src/guestfs.pod:562
33603 "Then call L</guestfs_inspect_os>. This function uses other libguestfs calls "
33604 "and certain heuristics, and returns a list of operating systems that were "
33605 "found. An empty list means none were found. A single element is the root "
33606 "filesystem of the operating system. For dual- or multi-boot guests, "
33607 "multiple roots can be returned, each one corresponding to a separate "
33608 "operating system. (Multi-boot virtual machines are extremely rare in the "
33609 "world of virtualization, but since this scenario can happen, we have built "
33610 "libguestfs to deal with it.)"
33614 #: ../src/guestfs.pod:571
33616 "For each root, you can then call various C<guestfs_inspect_get_*> functions "
33617 "to get additional details about that operating system. For example, call "
33618 "L</guestfs_inspect_get_type> to return the string C<windows> or C<linux> for "
33619 "Windows and Linux-based operating systems respectively."
33623 #: ../src/guestfs.pod:577
33625 "Un*x-like and Linux-based operating systems usually consist of several "
33626 "filesystems which are mounted at boot time (for example, a separate boot "
33627 "partition mounted on C</boot>). The inspection rules are able to detect how "
33628 "filesystems correspond to mount points. Call "
33629 "C<guestfs_inspect_get_mountpoints> to get this mapping. It might return a "
33630 "hash table like this example:"
33634 #: ../src/guestfs.pod:584
33637 " /boot => /dev/sda1\n"
33638 " / => /dev/vg_guest/lv_root\n"
33639 " /usr => /dev/vg_guest/lv_usr\n"
33644 #: ../src/guestfs.pod:588
33646 "The caller can then make calls to L</guestfs_mount_options> to mount the "
33647 "filesystems as suggested."
33651 #: ../src/guestfs.pod:591
33653 "Be careful to mount filesystems in the right order (eg. C</> before "
33654 "C</usr>). Sorting the keys of the hash by length, shortest first, should "
33659 #: ../src/guestfs.pod:595
33661 "Inspection currently only works for some common operating systems. "
33662 "Contributors are welcome to send patches for other operating systems that we "
33663 "currently cannot detect."
33667 #: ../src/guestfs.pod:599
33669 "Encrypted disks must be opened before inspection. See L</ENCRYPTED DISKS> "
33670 "for more details. The L</guestfs_inspect_os> function just ignores any "
33671 "encrypted devices."
33675 #: ../src/guestfs.pod:603
33677 "A note on the implementation: The call L</guestfs_inspect_os> performs "
33678 "inspection and caches the results in the guest handle. Subsequent calls to "
33679 "C<guestfs_inspect_get_*> return this cached information, but I<do not> "
33680 "re-read the disks. If you change the content of the guest disks, you can "
33681 "redo inspection by calling L</guestfs_inspect_os> again. "
33682 "(L</guestfs_inspect_list_applications> works a little differently from the "
33683 "other calls and does read the disks. See documentation for that function "
33688 #: ../src/guestfs.pod:612
33689 msgid "INSPECTING INSTALL DISKS"
33693 #: ../src/guestfs.pod:614
33695 "Libguestfs (since 1.9.4) can detect some install disks, install CDs, live "
33700 #: ../src/guestfs.pod:617
33702 "Call L</guestfs_inspect_get_format> to return the format of the operating "
33703 "system, which currently can be C<installed> (a regular operating system) or "
33704 "C<installer> (some sort of install disk)."
33708 #: ../src/guestfs.pod:621
33710 "Further information is available about the operating system that can be "
33711 "installed using the regular inspection APIs like "
33712 "L</guestfs_inspect_get_product_name>, L</guestfs_inspect_get_major_version> "
33717 #: ../src/guestfs.pod:626
33719 "Some additional information specific to installer disks is also available "
33720 "from the L</guestfs_inspect_is_live>, L</guestfs_inspect_is_netinst> and "
33721 "L</guestfs_inspect_is_multipart> calls."
33725 #: ../src/guestfs.pod:631
33726 msgid "SPECIAL CONSIDERATIONS FOR WINDOWS GUESTS"
33730 #: ../src/guestfs.pod:633
33732 "Libguestfs can mount NTFS partitions. It does this using the "
33733 "L<http://www.ntfs-3g.org/> driver."
33737 #: ../src/guestfs.pod:636
33738 msgid "DRIVE LETTERS AND PATHS"
33742 #: ../src/guestfs.pod:638
33744 "DOS and Windows still use drive letters, and the filesystems are always "
33745 "treated as case insensitive by Windows itself, and therefore you might find "
33746 "a Windows configuration file referring to a path like "
33747 "C<c:\\windows\\system32>. When the filesystem is mounted in libguestfs, "
33748 "that directory might be referred to as C</WINDOWS/System32>."
33752 #: ../src/guestfs.pod:644
33754 "Drive letter mappings can be found using inspection (see L</INSPECTION> and "
33755 "L</guestfs_inspect_get_drive_mappings>)"
33759 #: ../src/guestfs.pod:647
33761 "Dealing with separator characters (backslash vs forward slash) is outside "
33762 "the scope of libguestfs, but usually a simple character replacement will "
33767 #: ../src/guestfs.pod:651
33769 "To resolve the case insensitivity of paths, call "
33770 "L</guestfs_case_sensitive_path>."
33774 #: ../src/guestfs.pod:654
33775 msgid "ACCESSING THE WINDOWS REGISTRY"
33779 #: ../src/guestfs.pod:656
33781 "Libguestfs also provides some help for decoding Windows Registry \"hive\" "
33782 "files, through the library C<hivex> which is part of the libguestfs project "
33783 "although ships as a separate tarball. You have to locate and download the "
33784 "hive file(s) yourself, and then pass them to C<hivex> functions. See also "
33785 "the programs L<hivexml(1)>, L<hivexsh(1)>, L<hivexregedit(1)> and "
33786 "L<virt-win-reg(1)> for more help on this issue."
33790 #: ../src/guestfs.pod:664
33791 msgid "SYMLINKS ON NTFS-3G FILESYSTEMS"
33795 #: ../src/guestfs.pod:666
33797 "Ntfs-3g tries to rewrite \"Junction Points\" and NTFS \"symbolic links\" to "
33798 "provide something which looks like a Linux symlink. The way it tries to do "
33799 "the rewriting is described here:"
33803 #: ../src/guestfs.pod:670
33804 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/junction-points-and-symbolic-links/>"
33808 #: ../src/guestfs.pod:672
33810 "The essential problem is that ntfs-3g simply does not have enough "
33811 "information to do a correct job. NTFS links can contain drive letters and "
33812 "references to external device GUIDs that ntfs-3g has no way of resolving. "
33813 "It is almost certainly the case that libguestfs callers should ignore what "
33814 "ntfs-3g does (ie. don't use L</guestfs_readlink> on NTFS volumes)."
33818 #: ../src/guestfs.pod:679
33820 "Instead if you encounter a symbolic link on an ntfs-3g filesystem, use "
33821 "L</guestfs_lgetxattr> to read the C<system.ntfs_reparse_data> extended "
33822 "attribute, and read the raw reparse data from that (you can find the format "
33823 "documented in various places around the web)."
33827 #: ../src/guestfs.pod:684
33828 msgid "EXTENDED ATTRIBUTES ON NTFS-3G FILESYSTEMS"
33832 #: ../src/guestfs.pod:686
33834 "There are other useful extended attributes that can be read from ntfs-3g "
33835 "filesystems (using L</guestfs_getxattr>). See:"
33839 #: ../src/guestfs.pod:689
33840 msgid "L<http://www.tuxera.com/community/ntfs-3g-advanced/extended-attributes/>"
33844 #: ../src/guestfs.pod:691
33845 msgid "USING LIBGUESTFS WITH OTHER PROGRAMMING LANGUAGES"
33849 #: ../src/guestfs.pod:693
33851 "Although we don't want to discourage you from using the C API, we will "
33852 "mention here that the same API is also available in other languages."
33856 #: ../src/guestfs.pod:696
33858 "The API is broadly identical in all supported languages. This means that "
33859 "the C call C<guestfs_add_drive_ro(g,file)> is C<$g-E<gt>add_drive_ro($file)> "
33860 "in Perl, C<g.add_drive_ro(file)> in Python, and C<g#add_drive_ro file> in "
33861 "OCaml. In other words, a straightforward, predictable isomorphism between "
33866 #: ../src/guestfs.pod:702
33868 "Error messages are automatically transformed into exceptions if the language "
33873 #: ../src/guestfs.pod:705
33875 "We don't try to \"object orientify\" parts of the API in OO languages, "
33876 "although contributors are welcome to write higher level APIs above what we "
33877 "provide in their favourite languages if they wish."
33881 #: ../src/guestfs.pod:711
33886 #: ../src/guestfs.pod:713
33888 "You can use the I<guestfs.h> header file from C++ programs. The C++ API is "
33889 "identical to the C API. C++ classes and exceptions are not used."
33893 #: ../src/guestfs.pod:717
33898 #: ../src/guestfs.pod:719
33900 "The C# bindings are highly experimental. Please read the warnings at the "
33901 "top of C<csharp/Libguestfs.cs>."
33905 #: ../src/guestfs.pod:722
33910 #: ../src/guestfs.pod:724
33911 msgid "See L<guestfs-erlang(3)>."
33915 #: ../src/guestfs.pod:726
33920 #: ../src/guestfs.pod:728
33922 "This is the only language binding that is working but incomplete. Only "
33923 "calls which return simple integers have been bound in Haskell, and we are "
33924 "looking for help to complete this binding."
33928 #: ../src/guestfs.pod:732
33933 #: ../src/guestfs.pod:734
33935 "Full documentation is contained in the Javadoc which is distributed with "
33936 "libguestfs. For examples, see L<guestfs-java(3)>."
33940 #: ../src/guestfs.pod:737
33945 #: ../src/guestfs.pod:739
33946 msgid "See L<guestfs-ocaml(3)>."
33950 #: ../src/guestfs.pod:741
33955 #: ../src/guestfs.pod:743
33956 msgid "See L<guestfs-perl(3)> and L<Sys::Guestfs(3)>."
33960 #: ../src/guestfs.pod:745
33965 #: ../src/guestfs.pod:747
33967 "For documentation see C<README-PHP> supplied with libguestfs sources or in "
33968 "the php-libguestfs package for your distribution."
33972 #: ../src/guestfs.pod:750
33973 msgid "The PHP binding only works correctly on 64 bit machines."
33977 #: ../src/guestfs.pod:752
33982 #: ../src/guestfs.pod:754
33983 msgid "See L<guestfs-python(3)>."
33987 #: ../src/guestfs.pod:756
33992 #: ../src/guestfs.pod:758
33993 msgid "See L<guestfs-ruby(3)>."
33997 #: ../src/guestfs.pod:760
33998 msgid "B<shell scripts>"
34002 #: ../src/guestfs.pod:762
34003 msgid "See L<guestfish(1)>."
34007 #: ../src/guestfs.pod:766
34008 msgid "LIBGUESTFS GOTCHAS"
34012 #: ../src/guestfs.pod:768
34014 "L<http://en.wikipedia.org/wiki/Gotcha_(programming)>: \"A feature of a "
34015 "system [...] that works in the way it is documented but is counterintuitive "
34016 "and almost invites mistakes.\""
34020 #: ../src/guestfs.pod:772
34022 "Since we developed libguestfs and the associated tools, there are several "
34023 "things we would have designed differently, but are now stuck with for "
34024 "backwards compatibility or other reasons. If there is ever a libguestfs 2.0 "
34025 "release, you can expect these to change. Beware of them."
34029 #: ../src/guestfs.pod:780
34030 msgid "Autosync / forgetting to sync."
34034 #: ../src/guestfs.pod:782
34036 "I<Update:> Autosync is enabled by default for all API users starting from "
34037 "libguestfs 1.5.24. This section only applies to older versions."
34041 #: ../src/guestfs.pod:785
34043 "When modifying a filesystem from C or another language, you B<must> unmount "
34044 "all filesystems and call L</guestfs_sync> explicitly before you close the "
34045 "libguestfs handle. You can also call:"
34049 #: ../src/guestfs.pod:789
34052 " guestfs_set_autosync (g, 1);\n"
34057 #: ../src/guestfs.pod:791
34059 "to have the unmount/sync done automatically for you when the handle 'g' is "
34060 "closed. (This feature is called \"autosync\", L</guestfs_set_autosync> "
34065 #: ../src/guestfs.pod:795
34067 "If you forget to do this, then it is entirely possible that your changes "
34068 "won't be written out, or will be partially written, or (very rarely) that "
34069 "you'll get disk corruption."
34073 #: ../src/guestfs.pod:799
34075 "Note that in L<guestfish(3)> autosync is the default. So quick and dirty "
34076 "guestfish scripts that forget to sync will work just fine, which can make "
34077 "this very puzzling if you are trying to debug a problem."
34081 #: ../src/guestfs.pod:803
34082 msgid "Mount option C<-o sync> should not be the default."
34086 #: ../src/guestfs.pod:805
34088 "I<Update:> L</guestfs_mount> no longer adds any options starting from "
34089 "libguestfs 1.13.16. This section only applies to older versions."
34093 #: ../src/guestfs.pod:808
34095 "If you use L</guestfs_mount>, then C<-o sync,noatime> are added implicitly. "
34096 "However C<-o sync> does not add any reliability benefit, but does have a "
34097 "very large performance impact."
34101 #: ../src/guestfs.pod:812
34103 "The work around is to use L</guestfs_mount_options> and set the mount "
34104 "options that you actually want to use."
34108 #: ../src/guestfs.pod:815
34109 msgid "Read-only should be the default."
34113 #: ../src/guestfs.pod:817
34115 "In L<guestfish(3)>, I<--ro> should be the default, and you should have to "
34116 "specify I<--rw> if you want to make changes to the image."
34120 #: ../src/guestfs.pod:820
34121 msgid "This would reduce the potential to corrupt live VM images."
34125 #: ../src/guestfs.pod:822
34127 "Note that many filesystems change the disk when you just mount and unmount, "
34128 "even if you didn't perform any writes. You need to use "
34129 "L</guestfs_add_drive_ro> to guarantee that the disk is not changed."
34133 #: ../src/guestfs.pod:826
34134 msgid "guestfish command line is hard to use."
34138 #: ../src/guestfs.pod:828
34140 "C<guestfish disk.img> doesn't do what people expect (open C<disk.img> for "
34141 "examination). It tries to run a guestfish command C<disk.img> which doesn't "
34142 "exist, so it fails. In earlier versions of guestfish the error message was "
34143 "also unintuitive, but we have corrected this since. Like the Bourne shell, "
34144 "we should have used C<guestfish -c command> to run commands."
34148 #: ../src/guestfs.pod:835
34149 msgid "guestfish megabyte modifiers don't work right on all commands"
34153 #: ../src/guestfs.pod:837
34155 "In recent guestfish you can use C<1M> to mean 1 megabyte (and similarly for "
34156 "other modifiers). What guestfish actually does is to multiply the number "
34157 "part by the modifier part and pass the result to the C API. However this "
34158 "doesn't work for a few APIs which aren't expecting bytes, but are already "
34159 "expecting some other unit (eg. megabytes)."
34163 #: ../src/guestfs.pod:844
34164 msgid "The most common is L</guestfs_lvcreate>. The guestfish command:"
34168 #: ../src/guestfs.pod:846
34171 " lvcreate LV VG 100M\n"
34176 #: ../src/guestfs.pod:848
34178 "does not do what you might expect. Instead because L</guestfs_lvcreate> is "
34179 "already expecting megabytes, this tries to create a 100 I<terabyte> (100 "
34180 "megabytes * megabytes) logical volume. The error message you get from this "
34181 "is also a little obscure."
34185 #: ../src/guestfs.pod:853
34187 "This could be fixed in the generator by specially marking parameters and "
34188 "return values which take bytes or other units."
34192 #: ../src/guestfs.pod:856
34193 msgid "Ambiguity between devices and paths"
34197 #: ../src/guestfs.pod:858
34199 "There is a subtle ambiguity in the API between a device name "
34200 "(eg. C</dev/sdb2>) and a similar pathname. A file might just happen to be "
34201 "called C<sdb2> in the directory C</dev> (consider some non-Unix VM image)."
34205 #: ../src/guestfs.pod:863
34207 "In the current API we usually resolve this ambiguity by having two separate "
34208 "calls, for example L</guestfs_checksum> and L</guestfs_checksum_device>. "
34209 "Some API calls are ambiguous and (incorrectly) resolve the problem by "
34210 "detecting if the path supplied begins with C</dev/>."
34214 #: ../src/guestfs.pod:869
34216 "To avoid both the ambiguity and the need to duplicate some calls, we could "
34217 "make paths/devices into structured names. One way to do this would be to "
34218 "use a notation like grub (C<hd(0,0)>), although nobody really likes this "
34219 "aspect of grub. Another way would be to use a structured type, equivalent "
34220 "to this OCaml type:"
34224 #: ../src/guestfs.pod:875
34227 " type path = Path of string | Device of int | Partition of int * int\n"
34232 #: ../src/guestfs.pod:877
34233 msgid "which would allow you to pass arguments like:"
34237 #: ../src/guestfs.pod:879
34240 " Path \"/foo/bar\"\n"
34241 " Device 1 (* /dev/sdb, or perhaps /dev/sda *)\n"
34242 " Partition (1, 2) (* /dev/sdb2 (or is it /dev/sda2 or /dev/sdb3?) *)\n"
34243 " Path \"/dev/sdb2\" (* not a device *)\n"
34248 #: ../src/guestfs.pod:884
34250 "As you can see there are still problems to resolve even with this "
34251 "representation. Also consider how it might work in guestfish."
34255 #: ../src/guestfs.pod:889
34256 msgid "KEYS AND PASSPHRASES"
34260 #: ../src/guestfs.pod:891
34262 "Certain libguestfs calls take a parameter that contains sensitive key "
34263 "material, passed in as a C string."
34267 #: ../src/guestfs.pod:894
34269 "In the future we would hope to change the libguestfs implementation so that "
34270 "keys are L<mlock(2)>-ed into physical RAM, and thus can never end up in "
34271 "swap. However this is I<not> done at the moment, because of the complexity "
34272 "of such an implementation."
34276 #: ../src/guestfs.pod:899
34278 "Therefore you should be aware that any key parameter you pass to libguestfs "
34279 "might end up being written out to the swap partition. If this is a concern, "
34280 "scrub the swap partition or don't use libguestfs on encrypted devices."
34284 #: ../src/guestfs.pod:904
34285 msgid "MULTIPLE HANDLES AND MULTIPLE THREADS"
34289 #: ../src/guestfs.pod:906
34291 "All high-level libguestfs actions are synchronous. If you want to use "
34292 "libguestfs asynchronously then you must create a thread."
34296 #: ../src/guestfs.pod:909
34298 "Only use the handle from a single thread. Either use the handle exclusively "
34299 "from one thread, or provide your own mutex so that two threads cannot issue "
34300 "calls on the same handle at the same time."
34304 #: ../src/guestfs.pod:913
34306 "See the graphical program guestfs-browser for one possible architecture for "
34307 "multithreaded programs using libvirt and libguestfs."
34311 #: ../src/guestfs.pod:916
34316 #: ../src/guestfs.pod:918
34318 "Libguestfs needs a supermin appliance, which it finds by looking along an "
34323 #: ../src/guestfs.pod:921
34325 "By default it looks for these in the directory C<$libdir/guestfs> "
34326 "(eg. C</usr/local/lib/guestfs> or C</usr/lib64/guestfs>)."
34330 #: ../src/guestfs.pod:924
34332 "Use L</guestfs_set_path> or set the environment variable L</LIBGUESTFS_PATH> "
34333 "to change the directories that libguestfs will search in. The value is a "
34334 "colon-separated list of paths. The current directory is I<not> searched "
34335 "unless the path contains an empty element or C<.>. For example "
34336 "C<LIBGUESTFS_PATH=:/usr/lib/guestfs> would search the current directory and "
34337 "then C</usr/lib/guestfs>."
34341 #: ../src/guestfs.pod:931
34342 msgid "QEMU WRAPPERS"
34346 #: ../src/guestfs.pod:933
34348 "If you want to compile your own qemu, run qemu from a non-standard location, "
34349 "or pass extra arguments to qemu, then you can write a shell-script wrapper "
34354 #: ../src/guestfs.pod:937
34356 "There is one important rule to remember: you I<must C<exec qemu>> as the "
34357 "last command in the shell script (so that qemu replaces the shell and "
34358 "becomes the direct child of the libguestfs-using program). If you don't do "
34359 "this, then the qemu process won't be cleaned up correctly."
34363 #: ../src/guestfs.pod:942
34365 "Here is an example of a wrapper, where I have built my own copy of qemu from "
34370 #: ../src/guestfs.pod:945
34374 " qemudir=/home/rjones/d/qemu\n"
34375 " exec $qemudir/x86_64-softmmu/qemu-system-x86_64 -L $qemudir/pc-bios "
34381 #: ../src/guestfs.pod:949
34383 "Save this script as C</tmp/qemu.wrapper> (or wherever), C<chmod +x>, and "
34384 "then use it by setting the LIBGUESTFS_QEMU environment variable. For "
34389 #: ../src/guestfs.pod:953
34392 " LIBGUESTFS_QEMU=/tmp/qemu.wrapper guestfish\n"
34397 #: ../src/guestfs.pod:955
34399 "Note that libguestfs also calls qemu with the -help and -version options in "
34400 "order to determine features."
34404 #: ../src/guestfs.pod:958
34406 "Wrappers can also be used to edit the options passed to qemu. In the "
34407 "following example, the C<-machine ...> option (C<-machine> and the following "
34408 "argument) are removed from the command line and replaced with C<-machine "
34409 "pc,accel=tcg>. The while loop iterates over the options until it finds the "
34410 "right one to remove, putting the remaining options into the C<args> array."
34414 #: ../src/guestfs.pod:967
34418 " while [ $# -gt 0 ]; do\n"
34419 " case \"$1\" in\n"
34423 " args[i]=\"$1\"\n"
34432 #: ../src/guestfs.pod:979
34435 " exec qemu-kvm -machine pc,accel=tcg \"${args[@]}\"\n"
34440 #: ../src/guestfs.pod:981
34441 msgid "ATTACHING TO RUNNING DAEMONS"
34445 #: ../src/guestfs.pod:983
34447 "I<Note (1):> This is B<highly experimental> and has a tendency to eat "
34448 "babies. Use with caution."
34452 #: ../src/guestfs.pod:986
34454 "I<Note (2):> This section explains how to attach to a running daemon from a "
34455 "low level perspective. For most users, simply using virt tools such as "
34456 "L<guestfish(1)> with the I<--live> option will \"just work\"."
34460 #: ../src/guestfs.pod:990
34461 msgid "Using guestfs_set_attach_method"
34465 #: ../src/guestfs.pod:992
34467 "By calling L</guestfs_set_attach_method> you can change how the library "
34468 "connects to the C<guestfsd> daemon in L</guestfs_launch> (read "
34469 "L</ARCHITECTURE> for some background)."
34473 #: ../src/guestfs.pod:996
34475 "The normal attach method is C<appliance>, where a small appliance is created "
34476 "containing the daemon, and then the library connects to this."
34480 #: ../src/guestfs.pod:999
34482 "Setting attach method to C<unix:I<path>> (where I<path> is the path of a "
34483 "Unix domain socket) causes L</guestfs_launch> to connect to an existing "
34484 "daemon over the Unix domain socket."
34488 #: ../src/guestfs.pod:1003
34490 "The normal use for this is to connect to a running virtual machine that "
34491 "contains a C<guestfsd> daemon, and send commands so you can read and write "
34492 "files inside the live virtual machine."
34496 #: ../src/guestfs.pod:1007
34497 msgid "Using guestfs_add_domain with live flag"
34501 #: ../src/guestfs.pod:1009
34503 "L</guestfs_add_domain> provides some help for getting the correct attach "
34504 "method. If you pass the C<live> option to this function, then (if the "
34505 "virtual machine is running) it will examine the libvirt XML looking for a "
34506 "virtio-serial channel to connect to:"
34510 #: ../src/guestfs.pod:1015
34517 " <channel type='unix'>\n"
34518 " <source mode='bind' path='/path/to/socket'/>\n"
34519 " <target type='virtio' name='org.libguestfs.channel.0'/>\n"
34528 #: ../src/guestfs.pod:1027
34530 "L</guestfs_add_domain> extracts C</path/to/socket> and sets the attach "
34531 "method to C<unix:/path/to/socket>."
34535 #: ../src/guestfs.pod:1030
34537 "Some of the libguestfs tools (including guestfish) support a I<--live> "
34538 "option which is passed through to L</guestfs_add_domain> thus allowing you "
34539 "to attach to and modify live virtual machines."
34543 #: ../src/guestfs.pod:1034
34545 "The virtual machine needs to have been set up beforehand so that it has the "
34546 "virtio-serial channel and so that guestfsd is running inside it."
34550 #: ../src/guestfs.pod:1038
34551 msgid "ABI GUARANTEE"
34555 #: ../src/guestfs.pod:1040
34557 "We guarantee the libguestfs ABI (binary interface), for public, high-level "
34558 "actions as outlined in this section. Although we will deprecate some "
34559 "actions, for example if they get replaced by newer calls, we will keep the "
34560 "old actions forever. This allows you the developer to program in confidence "
34561 "against the libguestfs API."
34565 #: ../src/guestfs.pod:1046
34566 msgid "BLOCK DEVICE NAMING"
34570 #: ../src/guestfs.pod:1048
34572 "In the kernel there is now quite a profusion of schemata for naming block "
34573 "devices (in this context, by I<block device> I mean a physical or virtual "
34574 "hard drive). The original Linux IDE driver used names starting with "
34575 "C</dev/hd*>. SCSI devices have historically used a different naming scheme, "
34576 "C</dev/sd*>. When the Linux kernel I<libata> driver became a popular "
34577 "replacement for the old IDE driver (particularly for SATA devices) those "
34578 "devices also used the C</dev/sd*> scheme. Additionally we now have virtual "
34579 "machines with paravirtualized drivers. This has created several different "
34580 "naming systems, such as C</dev/vd*> for virtio disks and C</dev/xvd*> for "
34585 #: ../src/guestfs.pod:1060
34587 "As discussed above, libguestfs uses a qemu appliance running an embedded "
34588 "Linux kernel to access block devices. We can run a variety of appliances "
34589 "based on a variety of Linux kernels."
34593 #: ../src/guestfs.pod:1064
34595 "This causes a problem for libguestfs because many API calls use device or "
34596 "partition names. Working scripts and the recipe (example) scripts that we "
34597 "make available over the internet could fail if the naming scheme changes."
34601 #: ../src/guestfs.pod:1069
34603 "Therefore libguestfs defines C</dev/sd*> as the I<standard naming scheme>. "
34604 "Internally C</dev/sd*> names are translated, if necessary, to other names as "
34605 "required. For example, under RHEL 5 which uses the C</dev/hd*> scheme, any "
34606 "device parameter C</dev/sda2> is translated to C</dev/hda2> transparently."
34610 #: ../src/guestfs.pod:1075
34612 "Note that this I<only> applies to parameters. The L</guestfs_list_devices>, "
34613 "L</guestfs_list_partitions> and similar calls return the true names of the "
34614 "devices and partitions as known to the appliance."
34618 #: ../src/guestfs.pod:1080
34619 msgid "ALGORITHM FOR BLOCK DEVICE NAME TRANSLATION"
34623 #: ../src/guestfs.pod:1082
34625 "Usually this translation is transparent. However in some (very rare) cases "
34626 "you may need to know the exact algorithm. Such cases include where you use "
34627 "L</guestfs_config> to add a mixture of virtio and IDE devices to the "
34628 "qemu-based appliance, so have a mixture of C</dev/sd*> and C</dev/vd*> "
34633 #: ../src/guestfs.pod:1088
34635 "The algorithm is applied only to I<parameters> which are known to be either "
34636 "device or partition names. Return values from functions such as "
34637 "L</guestfs_list_devices> are never changed."
34641 #: ../src/guestfs.pod:1096
34642 msgid "Is the string a parameter which is a device or partition name?"
34646 #: ../src/guestfs.pod:1100
34647 msgid "Does the string begin with C</dev/sd>?"
34651 #: ../src/guestfs.pod:1104
34653 "Does the named device exist? If so, we use that device. However if I<not> "
34654 "then we continue with this algorithm."
34658 #: ../src/guestfs.pod:1109
34659 msgid "Replace initial C</dev/sd> string with C</dev/hd>."
34663 #: ../src/guestfs.pod:1111
34664 msgid "For example, change C</dev/sda2> to C</dev/hda2>."
34668 #: ../src/guestfs.pod:1113
34669 msgid "If that named device exists, use it. If not, continue."
34673 #: ../src/guestfs.pod:1117
34674 msgid "Replace initial C</dev/sd> string with C</dev/vd>."
34678 #: ../src/guestfs.pod:1119
34679 msgid "If that named device exists, use it. If not, return an error."
34683 #: ../src/guestfs.pod:1123
34684 msgid "PORTABILITY CONCERNS WITH BLOCK DEVICE NAMING"
34688 #: ../src/guestfs.pod:1125
34690 "Although the standard naming scheme and automatic translation is useful for "
34691 "simple programs and guestfish scripts, for larger programs it is best not to "
34692 "rely on this mechanism."
34696 #: ../src/guestfs.pod:1129
34698 "Where possible for maximum future portability programs using libguestfs "
34699 "should use these future-proof techniques:"
34703 #: ../src/guestfs.pod:1136
34705 "Use L</guestfs_list_devices> or L</guestfs_list_partitions> to list actual "
34706 "device names, and then use those names directly."
34710 #: ../src/guestfs.pod:1139
34711 msgid "Since those device names exist by definition, they will never be translated."
34715 #: ../src/guestfs.pod:1144
34717 "Use higher level ways to identify filesystems, such as LVM names, UUIDs and "
34718 "filesystem labels."
34722 #: ../src/guestfs.pod:1151
34724 "This section discusses security implications of using libguestfs, "
34725 "particularly with untrusted or malicious guests or disk images."
34729 #: ../src/guestfs.pod:1154
34730 msgid "GENERAL SECURITY CONSIDERATIONS"
34734 #: ../src/guestfs.pod:1156
34736 "Be careful with any files or data that you download from a guest (by "
34737 "\"download\" we mean not just the L</guestfs_download> command but any "
34738 "command that reads files, filenames, directories or anything else from a "
34739 "disk image). An attacker could manipulate the data to fool your program "
34740 "into doing the wrong thing. Consider cases such as:"
34744 #: ../src/guestfs.pod:1166
34745 msgid "the data (file etc) not being present"
34749 #: ../src/guestfs.pod:1170
34750 msgid "being present but empty"
34754 #: ../src/guestfs.pod:1174
34755 msgid "being much larger than normal"
34759 #: ../src/guestfs.pod:1178
34760 msgid "containing arbitrary 8 bit data"
34764 #: ../src/guestfs.pod:1182
34765 msgid "being in an unexpected character encoding"
34769 #: ../src/guestfs.pod:1186
34770 msgid "containing homoglyphs."
34774 #: ../src/guestfs.pod:1190
34775 msgid "SECURITY OF MOUNTING FILESYSTEMS"
34779 #: ../src/guestfs.pod:1192
34781 "When you mount a filesystem under Linux, mistakes in the kernel filesystem "
34782 "(VFS) module can sometimes be escalated into exploits by deliberately "
34783 "creating a malicious, malformed filesystem. These exploits are very severe "
34784 "for two reasons. Firstly there are very many filesystem drivers in the "
34785 "kernel, and many of them are infrequently used and not much developer "
34786 "attention has been paid to the code. Linux userspace helps potential "
34787 "crackers by detecting the filesystem type and automatically choosing the "
34788 "right VFS driver, even if that filesystem type is obscure or unexpected for "
34789 "the administrator. Secondly, a kernel-level exploit is like a local root "
34790 "exploit (worse in some ways), giving immediate and total access to the "
34791 "system right down to the hardware level."
34795 #: ../src/guestfs.pod:1205
34797 "That explains why you should never mount a filesystem from an untrusted "
34798 "guest on your host kernel. How about libguestfs? We run a Linux kernel "
34799 "inside a qemu virtual machine, usually running as a non-root user. The "
34800 "attacker would need to write a filesystem which first exploited the kernel, "
34801 "and then exploited either qemu virtualization (eg. a faulty qemu driver) or "
34802 "the libguestfs protocol, and finally to be as serious as the host kernel "
34803 "exploit it would need to escalate its privileges to root. This multi-step "
34804 "escalation, performed by a static piece of data, is thought to be extremely "
34805 "hard to do, although we never say 'never' about security issues."
34809 #: ../src/guestfs.pod:1216
34811 "In any case callers can reduce the attack surface by forcing the filesystem "
34812 "type when mounting (use L</guestfs_mount_vfs>)."
34816 #: ../src/guestfs.pod:1219
34817 msgid "PROTOCOL SECURITY"
34821 #: ../src/guestfs.pod:1221
34823 "The protocol is designed to be secure, being based on RFC 4506 (XDR) with a "
34824 "defined upper message size. However a program that uses libguestfs must "
34825 "also take care - for example you can write a program that downloads a binary "
34826 "from a disk image and executes it locally, and no amount of protocol "
34827 "security will save you from the consequences."
34831 #: ../src/guestfs.pod:1227
34832 msgid "INSPECTION SECURITY"
34836 #: ../src/guestfs.pod:1229
34838 "Parts of the inspection API (see L</INSPECTION>) return untrusted strings "
34839 "directly from the guest, and these could contain any 8 bit data. Callers "
34840 "should be careful to escape these before printing them to a structured file "
34841 "(for example, use HTML escaping if creating a web page)."
34845 #: ../src/guestfs.pod:1235
34847 "Guest configuration may be altered in unusual ways by the administrator of "
34848 "the virtual machine, and may not reflect reality (particularly for untrusted "
34849 "or actively malicious guests). For example we parse the hostname from "
34850 "configuration files like C</etc/sysconfig/network> that we find in the "
34851 "guest, but the guest administrator can easily manipulate these files to "
34852 "provide the wrong hostname."
34856 #: ../src/guestfs.pod:1243
34858 "The inspection API parses guest configuration using two external libraries: "
34859 "Augeas (Linux configuration) and hivex (Windows Registry). Both are "
34860 "designed to be robust in the face of malicious data, although denial of "
34861 "service attacks are still possible, for example with oversized configuration "
34866 #: ../src/guestfs.pod:1249
34867 msgid "RUNNING UNTRUSTED GUEST COMMANDS"
34871 #: ../src/guestfs.pod:1251
34873 "Be very cautious about running commands from the guest. By running a "
34874 "command in the guest, you are giving CPU time to a binary that you do not "
34875 "control, under the same user account as the library, albeit wrapped in qemu "
34876 "virtualization. More information and alternatives can be found in the "
34877 "section L</RUNNING COMMANDS>."
34881 #: ../src/guestfs.pod:1257
34882 msgid "CVE-2010-3851"
34886 #: ../src/guestfs.pod:1259
34887 msgid "https://bugzilla.redhat.com/642934"
34891 #: ../src/guestfs.pod:1261
34893 "This security bug concerns the automatic disk format detection that qemu "
34894 "does on disk images."
34898 #: ../src/guestfs.pod:1264
34900 "A raw disk image is just the raw bytes, there is no header. Other disk "
34901 "images like qcow2 contain a special header. Qemu deals with this by looking "
34902 "for one of the known headers, and if none is found then assuming the disk "
34903 "image must be raw."
34907 #: ../src/guestfs.pod:1269
34909 "This allows a guest which has been given a raw disk image to write some "
34910 "other header. At next boot (or when the disk image is accessed by "
34911 "libguestfs) qemu would do autodetection and think the disk image format was, "
34912 "say, qcow2 based on the header written by the guest."
34916 #: ../src/guestfs.pod:1274
34918 "This in itself would not be a problem, but qcow2 offers many features, one "
34919 "of which is to allow a disk image to refer to another image (called the "
34920 "\"backing disk\"). It does this by placing the path to the backing disk "
34921 "into the qcow2 header. This path is not validated and could point to any "
34922 "host file (eg. \"/etc/passwd\"). The backing disk is then exposed through "
34923 "\"holes\" in the qcow2 disk image, which of course is completely under the "
34924 "control of the attacker."
34928 #: ../src/guestfs.pod:1282
34929 msgid "In libguestfs this is rather hard to exploit except under two circumstances:"
34933 #: ../src/guestfs.pod:1289
34934 msgid "You have enabled the network or have opened the disk in write mode."
34938 #: ../src/guestfs.pod:1293
34940 "You are also running untrusted code from the guest (see L</RUNNING "
34945 #: ../src/guestfs.pod:1298
34947 "The way to avoid this is to specify the expected disk format when adding "
34948 "disks (the optional C<format> option to L</guestfs_add_drive_opts>). You "
34949 "should always do this if the disk is raw format, and it's a good idea for "
34954 #: ../src/guestfs.pod:1303
34956 "For disks added from libvirt using calls like L</guestfs_add_domain>, the "
34957 "format is fetched from libvirt and passed through."
34961 #: ../src/guestfs.pod:1306
34963 "For libguestfs tools, use the I<--format> command line parameter as "
34968 #: ../src/guestfs.pod:1309
34969 msgid "CONNECTION MANAGEMENT"
34973 #: ../src/guestfs.pod:1311
34974 msgid "guestfs_h *"
34978 #: ../src/guestfs.pod:1313
34980 "C<guestfs_h> is the opaque type representing a connection handle. Create a "
34981 "handle by calling L</guestfs_create>. Call L</guestfs_close> to free the "
34982 "handle and release all resources used."
34986 #: ../src/guestfs.pod:1317
34988 "For information on using multiple handles and threads, see the section "
34989 "L</MULTIPLE HANDLES AND MULTIPLE THREADS> above."
34993 #: ../src/guestfs.pod:1320
34994 msgid "guestfs_create"
34998 #: ../src/guestfs.pod:1322
35001 " guestfs_h *guestfs_create (void);\n"
35006 #: ../src/guestfs.pod:1324
35007 msgid "Create a connection handle."
35011 #: ../src/guestfs.pod:1326
35013 "On success this returns a non-NULL pointer to a handle. On error it returns "
35018 #: ../src/guestfs.pod:1329
35020 "You have to \"configure\" the handle after creating it. This includes "
35021 "calling L</guestfs_add_drive_opts> (or one of the equivalent calls) on the "
35022 "handle at least once."
35026 #: ../src/guestfs.pod:1333
35027 msgid "After configuring the handle, you have to call L</guestfs_launch>."
35031 #: ../src/guestfs.pod:1335
35033 "You may also want to configure error handling for the handle. See the "
35034 "L</ERROR HANDLING> section below."
35038 #: ../src/guestfs.pod:1338
35039 msgid "guestfs_close"
35043 #: ../src/guestfs.pod:1340
35046 " void guestfs_close (guestfs_h *g);\n"
35051 #: ../src/guestfs.pod:1342
35052 msgid "This closes the connection handle and frees up all resources used."
35056 #: ../src/guestfs.pod:1344
35058 "If autosync was set on the handle and the handle was launched, then this "
35059 "implicitly calls various functions to unmount filesystems and sync the "
35060 "disk. See L</guestfs_set_autosync> for more details."
35064 #: ../src/guestfs.pod:1348
35065 msgid "If a close callback was set on the handle, then it is called."
35069 #: ../src/guestfs.pod:1350
35070 msgid "ERROR HANDLING"
35074 #: ../src/guestfs.pod:1352
35076 "API functions can return errors. For example, almost all functions that "
35077 "return C<int> will return C<-1> to indicate an error."
35081 #: ../src/guestfs.pod:1355
35083 "Additional information is available for errors: an error message string and "
35084 "optionally an error number (errno) if the thing that failed was a system "
35089 #: ../src/guestfs.pod:1359
35091 "You can get at the additional information about the last error on the handle "
35092 "by calling L</guestfs_last_error>, L</guestfs_last_errno>, and/or by setting "
35093 "up an error handler with L</guestfs_set_error_handler>."
35097 #: ../src/guestfs.pod:1364
35099 "When the handle is created, a default error handler is installed which "
35100 "prints the error message string to C<stderr>. For small short-running "
35101 "command line programs it is sufficient to do:"
35105 #: ../src/guestfs.pod:1368
35108 " if (guestfs_launch (g) == -1)\n"
35109 " exit (EXIT_FAILURE);\n"
35114 #: ../src/guestfs.pod:1371
35116 "since the default error handler will ensure that an error message has been "
35117 "printed to C<stderr> before the program exits."
35121 #: ../src/guestfs.pod:1374
35123 "For other programs the caller will almost certainly want to install an "
35124 "alternate error handler or do error handling in-line like this:"
35128 #: ../src/guestfs.pod:1377
35131 " /* This disables the default behaviour of printing errors\n"
35133 " guestfs_set_error_handler (g, NULL, NULL);\n"
35138 #: ../src/guestfs.pod:1381
35141 " if (guestfs_launch (g) == -1) {\n"
35142 " /* Examine the error message and print it etc. */\n"
35143 " char *msg = guestfs_last_error (g);\n"
35144 " int errnum = guestfs_last_errno (g);\n"
35145 " fprintf (stderr, \"%s\", msg);\n"
35146 " if (errnum != 0)\n"
35147 " fprintf (stderr, \": %s\", strerror (errnum));\n"
35148 " fprintf (stderr, \"\\n\");\n"
35155 #: ../src/guestfs.pod:1392
35157 "Out of memory errors are handled differently. The default action is to call "
35158 "L<abort(3)>. If this is undesirable, then you can set a handler using "
35159 "L</guestfs_set_out_of_memory_handler>."
35163 #: ../src/guestfs.pod:1396
35165 "L</guestfs_create> returns C<NULL> if the handle cannot be created, and "
35166 "because there is no handle if this happens there is no way to get additional "
35167 "error information. However L</guestfs_create> is supposed to be a "
35168 "lightweight operation which can only fail because of insufficient memory (it "
35169 "returns NULL in this case)."
35173 #: ../src/guestfs.pod:1402
35174 msgid "guestfs_last_error"
35178 #: ../src/guestfs.pod:1404
35181 " const char *guestfs_last_error (guestfs_h *g);\n"
35186 #: ../src/guestfs.pod:1406
35188 "This returns the last error message that happened on C<g>. If there has not "
35189 "been an error since the handle was created, then this returns C<NULL>."
35193 #: ../src/guestfs.pod:1410
35195 "The lifetime of the returned string is until the next error occurs, or "
35196 "L</guestfs_close> is called."
35200 #: ../src/guestfs.pod:1413
35201 msgid "guestfs_last_errno"
35205 #: ../src/guestfs.pod:1415
35208 " int guestfs_last_errno (guestfs_h *g);\n"
35213 #: ../src/guestfs.pod:1417
35214 msgid "This returns the last error number (errno) that happened on C<g>."
35218 #: ../src/guestfs.pod:1419
35219 msgid "If successful, an errno integer not equal to zero is returned."
35223 #: ../src/guestfs.pod:1421
35224 msgid "If no error, this returns 0. This call can return 0 in three situations:"
35228 #: ../src/guestfs.pod:1428
35229 msgid "There has not been any error on the handle."
35233 #: ../src/guestfs.pod:1432
35235 "There has been an error but the errno was meaningless. This corresponds to "
35236 "the case where the error did not come from a failed system call, but for "
35237 "some other reason."
35241 #: ../src/guestfs.pod:1438
35243 "There was an error from a failed system call, but for some reason the errno "
35244 "was not captured and returned. This usually indicates a bug in libguestfs."
35248 #: ../src/guestfs.pod:1444
35250 "Libguestfs tries to convert the errno from inside the applicance into a "
35251 "corresponding errno for the caller (not entirely trivial: the appliance "
35252 "might be running a completely different operating system from the library "
35253 "and error numbers are not standardized across Un*xen). If this could not be "
35254 "done, then the error is translated to C<EINVAL>. In practice this should "
35255 "only happen in very rare circumstances."
35259 #: ../src/guestfs.pod:1452
35260 msgid "guestfs_set_error_handler"
35264 #: ../src/guestfs.pod:1454
35267 " typedef void (*guestfs_error_handler_cb) (guestfs_h *g,\n"
35269 " const char *msg);\n"
35270 " void guestfs_set_error_handler (guestfs_h *g,\n"
35271 " guestfs_error_handler_cb cb,\n"
35272 " void *opaque);\n"
35277 #: ../src/guestfs.pod:1461
35279 "The callback C<cb> will be called if there is an error. The parameters "
35280 "passed to the callback are an opaque data pointer and the error message "
35285 #: ../src/guestfs.pod:1465
35287 "C<errno> is not passed to the callback. To get that the callback must call "
35288 "L</guestfs_last_errno>."
35292 #: ../src/guestfs.pod:1468
35294 "Note that the message string C<msg> is freed as soon as the callback "
35295 "function returns, so if you want to stash it somewhere you must make your "
35300 #: ../src/guestfs.pod:1472
35301 msgid "The default handler prints messages on C<stderr>."
35305 #: ../src/guestfs.pod:1474
35306 msgid "If you set C<cb> to C<NULL> then I<no> handler is called."
35310 #: ../src/guestfs.pod:1476
35311 msgid "guestfs_get_error_handler"
35315 #: ../src/guestfs.pod:1478
35318 " guestfs_error_handler_cb guestfs_get_error_handler (guestfs_h *g,\n"
35319 " void **opaque_rtn);\n"
35324 #: ../src/guestfs.pod:1481
35325 msgid "Returns the current error handler callback."
35329 #: ../src/guestfs.pod:1483
35330 msgid "guestfs_set_out_of_memory_handler"
35334 #: ../src/guestfs.pod:1485
35337 " typedef void (*guestfs_abort_cb) (void);\n"
35338 " void guestfs_set_out_of_memory_handler (guestfs_h *g,\n"
35339 " guestfs_abort_cb);\n"
35344 #: ../src/guestfs.pod:1489
35346 "The callback C<cb> will be called if there is an out of memory situation. "
35347 "I<Note this callback must not return>."
35351 #: ../src/guestfs.pod:1492
35352 msgid "The default is to call L<abort(3)>."
35356 #: ../src/guestfs.pod:1494
35357 msgid "You cannot set C<cb> to C<NULL>. You can't ignore out of memory situations."
35361 #: ../src/guestfs.pod:1497
35362 msgid "guestfs_get_out_of_memory_handler"
35366 #: ../src/guestfs.pod:1499
35369 " guestfs_abort_fn guestfs_get_out_of_memory_handler (guestfs_h *g);\n"
35374 #: ../src/guestfs.pod:1501
35375 msgid "This returns the current out of memory handler."
35379 #: ../src/guestfs.pod:1503
35384 #: ../src/guestfs.pod:1507
35389 #: ../src/guestfs.pod:1509
35394 #: ../src/guestfs.pod:1511
35395 msgid "AVAILABILITY"
35399 #: ../src/guestfs.pod:1513
35400 msgid "GROUPS OF FUNCTIONALITY IN THE APPLIANCE"
35404 #: ../src/guestfs.pod:1515
35406 "Using L</guestfs_available> you can test availability of the following "
35407 "groups of functions. This test queries the appliance to see if the "
35408 "appliance you are currently using supports the functionality."
35412 #: ../src/guestfs.pod:1520
35413 msgid "@AVAILABILITY@"
35417 #: ../src/guestfs.pod:1522
35418 msgid "GUESTFISH supported COMMAND"
35422 #: ../src/guestfs.pod:1524
35424 "In L<guestfish(3)> there is a handy interactive command C<supported> which "
35425 "prints out the available groups and whether they are supported by this build "
35426 "of libguestfs. Note however that you have to do C<run> first."
35430 #: ../src/guestfs.pod:1529
35431 msgid "SINGLE CALLS AT COMPILE TIME"
35435 #: ../src/guestfs.pod:1531
35437 "Since version 1.5.8, C<E<lt>guestfs.hE<gt>> defines symbols for each C API "
35438 "function, such as:"
35442 #: ../src/guestfs.pod:1534
35445 " #define LIBGUESTFS_HAVE_DD 1\n"
35450 #: ../src/guestfs.pod:1536
35451 msgid "if L</guestfs_dd> is available."
35455 #: ../src/guestfs.pod:1538
35457 "Before version 1.5.8, if you needed to test whether a single libguestfs "
35458 "function is available at compile time, we recommended using build tools such "
35459 "as autoconf or cmake. For example in autotools you could use:"
35463 #: ../src/guestfs.pod:1543
35466 " AC_CHECK_LIB([guestfs],[guestfs_create])\n"
35467 " AC_CHECK_FUNCS([guestfs_dd])\n"
35472 #: ../src/guestfs.pod:1546
35474 "which would result in C<HAVE_GUESTFS_DD> being either defined or not defined "
35479 #: ../src/guestfs.pod:1549
35480 msgid "SINGLE CALLS AT RUN TIME"
35484 #: ../src/guestfs.pod:1551
35486 "Testing at compile time doesn't guarantee that a function really exists in "
35487 "the library. The reason is that you might be dynamically linked against a "
35488 "previous I<libguestfs.so> (dynamic library) which doesn't have the call. "
35489 "This situation unfortunately results in a segmentation fault, which is a "
35490 "shortcoming of the C dynamic linking system itself."
35494 #: ../src/guestfs.pod:1558
35496 "You can use L<dlopen(3)> to test if a function is available at run time, as "
35497 "in this example program (note that you still need the compile time check as "
35502 #: ../src/guestfs.pod:1562
35505 " #include <stdio.h>\n"
35506 " #include <stdlib.h>\n"
35507 " #include <unistd.h>\n"
35508 " #include <dlfcn.h>\n"
35509 " #include <guestfs.h>\n"
35514 #: ../src/guestfs.pod:1568
35519 " #ifdef LIBGUESTFS_HAVE_DD\n"
35521 " int has_function;\n"
35526 #: ../src/guestfs.pod:1574
35529 " /* Test if the function guestfs_dd is really available. */\n"
35530 " dl = dlopen (NULL, RTLD_LAZY);\n"
35532 " fprintf (stderr, \"dlopen: %s\\n\", dlerror ());\n"
35533 " exit (EXIT_FAILURE);\n"
35535 " has_function = dlsym (dl, \"guestfs_dd\") != NULL;\n"
35541 #: ../src/guestfs.pod:1583
35544 " if (!has_function)\n"
35545 " printf (\"this libguestfs.so does NOT have guestfs_dd function\\n\");\n"
35547 " printf (\"this libguestfs.so has guestfs_dd function\\n\");\n"
35548 " /* Now it's safe to call\n"
35549 " guestfs_dd (g, \"foo\", \"bar\");\n"
35553 " printf (\"guestfs_dd function was not found at compile time\\n\");\n"
35560 #: ../src/guestfs.pod:1596
35562 "You may think the above is an awful lot of hassle, and it is. There are "
35563 "other ways outside of the C linking system to ensure that this kind of "
35564 "incompatibility never arises, such as using package versioning:"
35568 #: ../src/guestfs.pod:1601
35571 " Requires: libguestfs >= 1.0.80\n"
35576 #: ../src/guestfs.pod:1603
35577 msgid "CALLS WITH OPTIONAL ARGUMENTS"
35581 #: ../src/guestfs.pod:1605
35583 "A recent feature of the API is the introduction of calls which take optional "
35584 "arguments. In C these are declared 3 ways. The main way is as a call which "
35585 "takes variable arguments (ie. C<...>), as in this example:"
35589 #: ../src/guestfs.pod:1610
35592 " int guestfs_add_drive_opts (guestfs_h *g, const char *filename, ...);\n"
35597 #: ../src/guestfs.pod:1612
35599 "Call this with a list of optional arguments, terminated by C<-1>. So to "
35600 "call with no optional arguments specified:"
35604 #: ../src/guestfs.pod:1615
35607 " guestfs_add_drive_opts (g, filename, -1);\n"
35612 #: ../src/guestfs.pod:1617
35613 msgid "With a single optional argument:"
35617 #: ../src/guestfs.pod:1619
35620 " guestfs_add_drive_opts (g, filename,\n"
35621 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35627 #: ../src/guestfs.pod:1623
35632 #: ../src/guestfs.pod:1625
35635 " guestfs_add_drive_opts (g, filename,\n"
35636 " GUESTFS_ADD_DRIVE_OPTS_FORMAT, \"qcow2\",\n"
35637 " GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,\n"
35643 #: ../src/guestfs.pod:1630
35645 "and so forth. Don't forget the terminating C<-1> otherwise Bad Things will "
35650 #: ../src/guestfs.pod:1633
35651 msgid "USING va_list FOR OPTIONAL ARGUMENTS"
35655 #: ../src/guestfs.pod:1635
35657 "The second variant has the same name with the suffix C<_va>, which works the "
35658 "same way but takes a C<va_list>. See the C manual for details. For the "
35659 "example function, this is declared:"
35663 #: ../src/guestfs.pod:1639
35666 " int guestfs_add_drive_opts_va (guestfs_h *g, const char *filename,\n"
35667 " va_list args);\n"
35672 #: ../src/guestfs.pod:1642
35673 msgid "CONSTRUCTING OPTIONAL ARGUMENTS"
35677 #: ../src/guestfs.pod:1644
35679 "The third variant is useful where you need to construct these calls. You "
35680 "pass in a structure where you fill in the optional fields. The structure "
35681 "has a bitmask as the first element which you must set to indicate which "
35682 "fields you have filled in. For our example function the structure and call "
35687 #: ../src/guestfs.pod:1650
35690 " struct guestfs_add_drive_opts_argv {\n"
35691 " uint64_t bitmask;\n"
35693 " const char *format;\n"
35696 " int guestfs_add_drive_opts_argv (guestfs_h *g, const char *filename,\n"
35697 " const struct guestfs_add_drive_opts_argv *optargs);\n"
35702 #: ../src/guestfs.pod:1659
35703 msgid "You could call it like this:"
35707 #: ../src/guestfs.pod:1661
35710 " struct guestfs_add_drive_opts_argv optargs = {\n"
35711 " .bitmask = GUESTFS_ADD_DRIVE_OPTS_READONLY_BITMASK |\n"
35712 " GUESTFS_ADD_DRIVE_OPTS_FORMAT_BITMASK,\n"
35713 " .readonly = 1,\n"
35714 " .format = \"qcow2\"\n"
35720 #: ../src/guestfs.pod:1668
35723 " guestfs_add_drive_opts_argv (g, filename, &optargs);\n"
35728 #: ../src/guestfs.pod:1676
35729 msgid "The C<_BITMASK> suffix on each option name when specifying the bitmask."
35733 #: ../src/guestfs.pod:1681
35734 msgid "You do not need to fill in all fields of the structure."
35738 #: ../src/guestfs.pod:1685
35740 "There must be a one-to-one correspondence between fields of the structure "
35741 "that are filled in, and bits set in the bitmask."
35745 #: ../src/guestfs.pod:1690
35746 msgid "OPTIONAL ARGUMENTS IN OTHER LANGUAGES"
35750 #: ../src/guestfs.pod:1692
35752 "In other languages, optional arguments are expressed in the way that is "
35753 "natural for that language. We refer you to the language-specific "
35754 "documentation for more details on that."
35758 #: ../src/guestfs.pod:1696
35759 msgid "For guestfish, see L<guestfish(1)/OPTIONAL ARGUMENTS>."
35763 #: ../src/guestfs.pod:1698
35764 msgid "SETTING CALLBACKS TO HANDLE EVENTS"
35768 #: ../src/guestfs.pod:1700
35770 "B<Note:> This section documents the generic event mechanism introduced in "
35771 "libguestfs 1.10, which you should use in new code if possible. The old "
35772 "functions C<guestfs_set_log_message_callback>, "
35773 "C<guestfs_set_subprocess_quit_callback>, "
35774 "C<guestfs_set_launch_done_callback>, C<guestfs_set_close_callback> and "
35775 "C<guestfs_set_progress_callback> are no longer documented in this manual "
35776 "page. Because of the ABI guarantee, the old functions continue to work."
35780 #: ../src/guestfs.pod:1709
35782 "Handles generate events when certain things happen, such as log messages "
35783 "being generated, progress messages during long-running operations, or the "
35784 "handle being closed. The API calls described below let you register a "
35785 "callback to be called when events happen. You can register multiple "
35786 "callbacks (for the same, different or overlapping sets of events), and "
35787 "individually remove callbacks. If callbacks are not removed, then they "
35788 "remain in force until the handle is closed."
35792 #: ../src/guestfs.pod:1717
35794 "In the current implementation, events are only generated synchronously: that "
35795 "means that events (and hence callbacks) can only happen while you are in the "
35796 "middle of making another libguestfs call. The callback is called in the "
35801 #: ../src/guestfs.pod:1722
35803 "Events may contain a payload, usually nothing (void), an array of 64 bit "
35804 "unsigned integers, or a message buffer. Payloads are discussed later on."
35808 #: ../src/guestfs.pod:1726
35809 msgid "CLASSES OF EVENTS"
35813 #: ../src/guestfs.pod:1730
35814 msgid "GUESTFS_EVENT_CLOSE (payload type: void)"
35818 #: ../src/guestfs.pod:1733
35820 "The callback function will be called while the handle is being closed "
35821 "(synchronously from L</guestfs_close>)."
35825 #: ../src/guestfs.pod:1736
35827 "Note that libguestfs installs an L<atexit(3)> handler to try to clean up "
35828 "handles that are open when the program exits. This means that this callback "
35829 "might be called indirectly from L<exit(3)>, which can cause unexpected "
35830 "problems in higher-level languages (eg. if your HLL interpreter has already "
35831 "been cleaned up by the time this is called, and if your callback then jumps "
35832 "into some HLL function)."
35836 #: ../src/guestfs.pod:1743
35838 "If no callback is registered: the handle is closed without any callback "
35843 #: ../src/guestfs.pod:1746
35844 msgid "GUESTFS_EVENT_SUBPROCESS_QUIT (payload type: void)"
35848 #: ../src/guestfs.pod:1749
35850 "The callback function will be called when the child process quits, either "
35851 "asynchronously or if killed by L</guestfs_kill_subprocess>. (This "
35852 "corresponds to a transition from any state to the CONFIG state)."
35856 #: ../src/guestfs.pod:1753 ../src/guestfs.pod:1762 ../src/guestfs.pod:1879
35857 msgid "If no callback is registered: the event is ignored."
35861 #: ../src/guestfs.pod:1755
35862 msgid "GUESTFS_EVENT_LAUNCH_DONE (payload type: void)"
35866 #: ../src/guestfs.pod:1758
35868 "The callback function will be called when the child process becomes ready "
35869 "first time after it has been launched. (This corresponds to a transition "
35870 "from LAUNCHING to the READY state)."
35874 #: ../src/guestfs.pod:1764
35875 msgid "GUESTFS_EVENT_PROGRESS (payload type: array of 4 x uint64_t)"
35879 #: ../src/guestfs.pod:1767
35881 "Some long-running operations can generate progress messages. If this "
35882 "callback is registered, then it will be called each time a progress message "
35883 "is generated (usually two seconds after the operation started, and three "
35884 "times per second thereafter until it completes, although the frequency may "
35885 "change in future versions)."
35889 #: ../src/guestfs.pod:1773
35891 "The callback receives in the payload four unsigned 64 bit numbers which are "
35892 "(in order): C<proc_nr>, C<serial>, C<position>, C<total>."
35896 #: ../src/guestfs.pod:1776
35898 "The units of C<total> are not defined, although for some operations C<total> "
35899 "may relate in some way to the amount of data to be transferred (eg. in bytes "
35900 "or megabytes), and C<position> may be the portion which has been "
35905 #: ../src/guestfs.pod:1781
35906 msgid "The only defined and stable parts of the API are:"
35910 #: ../src/guestfs.pod:1787
35912 "The callback can display to the user some type of progress bar or indicator "
35913 "which shows the ratio of C<position>:C<total>."
35917 #: ../src/guestfs.pod:1792
35918 msgid "0 E<lt>= C<position> E<lt>= C<total>"
35922 #: ../src/guestfs.pod:1796
35924 "If any progress notification is sent during a call, then a final progress "
35925 "notification is always sent when C<position> = C<total> (I<unless> the call "
35926 "fails with an error)."
35930 #: ../src/guestfs.pod:1800
35932 "This is to simplify caller code, so callers can easily set the progress "
35933 "indicator to \"100%\" at the end of the operation, without requiring special "
35934 "code to detect this case."
35938 #: ../src/guestfs.pod:1806
35940 "For some calls we are unable to estimate the progress of the call, but we "
35941 "can still generate progress messages to indicate activity. This is known as "
35942 "\"pulse mode\", and is directly supported by certain progress bar "
35943 "implementations (eg. GtkProgressBar)."
35947 #: ../src/guestfs.pod:1811
35949 "For these calls, zero or more progress messages are generated with "
35950 "C<position = 0> and C<total = 1>, followed by a final message with "
35951 "C<position = total = 1>."
35955 #: ../src/guestfs.pod:1815
35957 "As noted above, if the call fails with an error then the final message may "
35958 "not be generated."
35962 #: ../src/guestfs.pod:1820
35964 "The callback also receives the procedure number (C<proc_nr>) and serial "
35965 "number (C<serial>) of the call. These are only useful for debugging "
35966 "protocol issues, and the callback can normally ignore them. The callback "
35967 "may want to print these numbers in error messages or debugging messages."
35971 #: ../src/guestfs.pod:1826
35972 msgid "If no callback is registered: progress messages are discarded."
35976 #: ../src/guestfs.pod:1828
35977 msgid "GUESTFS_EVENT_APPLIANCE (payload type: message buffer)"
35981 #: ../src/guestfs.pod:1831
35983 "The callback function is called whenever a log message is generated by qemu, "
35984 "the appliance kernel, guestfsd (daemon), or utility programs."
35988 #: ../src/guestfs.pod:1834
35990 "If the verbose flag (L</guestfs_set_verbose>) is set before launch "
35991 "(L</guestfs_launch>) then additional debug messages are generated."
35995 #: ../src/guestfs.pod:1837 ../src/guestfs.pod:1851
35997 "If no callback is registered: the messages are discarded unless the verbose "
35998 "flag is set in which case they are sent to stderr. You can override the "
35999 "printing of verbose messages to stderr by setting up a callback."
36003 #: ../src/guestfs.pod:1842
36004 msgid "GUESTFS_EVENT_LIBRARY (payload type: message buffer)"
36008 #: ../src/guestfs.pod:1845
36010 "The callback function is called whenever a log message is generated by the "
36011 "library part of libguestfs."
36015 #: ../src/guestfs.pod:1848
36017 "If the verbose flag (L</guestfs_set_verbose>) is set then additional debug "
36018 "messages are generated."
36022 #: ../src/guestfs.pod:1856
36023 msgid "GUESTFS_EVENT_TRACE (payload type: message buffer)"
36027 #: ../src/guestfs.pod:1859
36029 "The callback function is called whenever a trace message is generated. This "
36030 "only applies if the trace flag (L</guestfs_set_trace>) is set."
36034 #: ../src/guestfs.pod:1862
36036 "If no callback is registered: the messages are sent to stderr. You can "
36037 "override the printing of trace messages to stderr by setting up a callback."
36041 #: ../src/guestfs.pod:1866
36042 msgid "GUESTFS_EVENT_ENTER (payload type: function name)"
36046 #: ../src/guestfs.pod:1869
36047 msgid "The callback function is called whenever a libguestfs function is entered."
36051 #: ../src/guestfs.pod:1872
36053 "The payload is a string which contains the name of the function that we are "
36054 "entering (not including C<guestfs_> prefix)."
36058 #: ../src/guestfs.pod:1875
36060 "Note that libguestfs functions can call themselves, so you may see many "
36061 "events from a single call. A few libguestfs functions do not generate this "
36066 #: ../src/guestfs.pod:1883
36067 msgid "guestfs_set_event_callback"
36071 #: ../src/guestfs.pod:1885
36074 " int guestfs_set_event_callback (guestfs_h *g,\n"
36075 " guestfs_event_callback cb,\n"
36076 " uint64_t event_bitmask,\n"
36078 " void *opaque);\n"
36083 #: ../src/guestfs.pod:1891
36085 "This function registers a callback (C<cb>) for all event classes in the "
36086 "C<event_bitmask>."
36090 #: ../src/guestfs.pod:1894
36092 "For example, to register for all log message events, you could call this "
36093 "function with the bitmask C<GUESTFS_EVENT_APPLIANCE|GUESTFS_EVENT_LIBRARY>. "
36094 "To register a single callback for all possible classes of events, use "
36095 "C<GUESTFS_EVENT_ALL>."
36099 #: ../src/guestfs.pod:1900
36100 msgid "C<flags> should always be passed as 0."
36104 #: ../src/guestfs.pod:1902
36106 "C<opaque> is an opaque pointer which is passed to the callback. You can use "
36107 "it for any purpose."
36111 #: ../src/guestfs.pod:1905
36113 "The return value is the event handle (an integer) which you can use to "
36114 "delete the callback (see below)."
36118 #: ../src/guestfs.pod:1908
36120 "If there is an error, this function returns C<-1>, and sets the error in the "
36121 "handle in the usual way (see L</guestfs_last_error> etc.)"
36125 #: ../src/guestfs.pod:1911
36127 "Callbacks remain in effect until they are deleted, or until the handle is "
36132 #: ../src/guestfs.pod:1914
36134 "In the case where multiple callbacks are registered for a particular event "
36135 "class, all of the callbacks are called. The order in which multiple "
36136 "callbacks are called is not defined."
36140 #: ../src/guestfs.pod:1918
36141 msgid "guestfs_delete_event_callback"
36145 #: ../src/guestfs.pod:1920
36148 " void guestfs_delete_event_callback (guestfs_h *g, int event_handle);\n"
36153 #: ../src/guestfs.pod:1922
36155 "Delete a callback that was previously registered. C<event_handle> should be "
36156 "the integer that was returned by a previous call to "
36157 "C<guestfs_set_event_callback> on the same handle."
36161 #: ../src/guestfs.pod:1926
36162 msgid "guestfs_event_callback"
36166 #: ../src/guestfs.pod:1928
36169 " typedef void (*guestfs_event_callback) (\n"
36172 " uint64_t event,\n"
36173 " int event_handle,\n"
36175 " const char *buf, size_t buf_len,\n"
36176 " const uint64_t *array, size_t array_len);\n"
36181 #: ../src/guestfs.pod:1937
36182 msgid "This is the type of the event callback function that you have to provide."
36186 #: ../src/guestfs.pod:1940
36188 "The basic parameters are: the handle (C<g>), the opaque user pointer "
36189 "(C<opaque>), the event class (eg. C<GUESTFS_EVENT_PROGRESS>), the event "
36190 "handle, and C<flags> which in the current API you should ignore."
36194 #: ../src/guestfs.pod:1944
36196 "The remaining parameters contain the event payload (if any). Each event may "
36197 "contain a payload, which usually relates to the event class, but for future "
36198 "proofing your code should be written to handle any payload for any event "
36203 #: ../src/guestfs.pod:1949
36205 "C<buf> and C<buf_len> contain a message buffer (if C<buf_len == 0>, then "
36206 "there is no message buffer). Note that this message buffer can contain "
36207 "arbitrary 8 bit data, including NUL bytes."
36211 #: ../src/guestfs.pod:1953
36213 "C<array> and C<array_len> is an array of 64 bit unsigned integers. At the "
36214 "moment this is only used for progress messages."
36218 #: ../src/guestfs.pod:1956
36219 msgid "EXAMPLE: CAPTURING LOG MESSAGES"
36223 #: ../src/guestfs.pod:1958
36225 "One motivation for the generic event API was to allow GUI programs to "
36226 "capture debug and other messages. In libguestfs E<le> 1.8 these were sent "
36227 "unconditionally to C<stderr>."
36231 #: ../src/guestfs.pod:1962
36233 "Events associated with log messages are: C<GUESTFS_EVENT_LIBRARY>, "
36234 "C<GUESTFS_EVENT_APPLIANCE> and C<GUESTFS_EVENT_TRACE>. (Note that error "
36235 "messages are not events; you must capture error messages separately)."
36239 #: ../src/guestfs.pod:1967
36241 "Programs have to set up a callback to capture the classes of events of "
36246 #: ../src/guestfs.pod:1970
36250 " guestfs_set_event_callback\n"
36251 " (g, message_callback,\n"
36252 " GUESTFS_EVENT_LIBRARY|GUESTFS_EVENT_APPLIANCE|\n"
36253 " GUESTFS_EVENT_TRACE,\n"
36254 " 0, NULL) == -1)\n"
36255 " if (eh == -1) {\n"
36256 " // handle error in the usual way\n"
36262 #: ../src/guestfs.pod:1980
36264 "The callback can then direct messages to the appropriate place. In this "
36265 "example, messages are directed to syslog:"
36269 #: ../src/guestfs.pod:1983
36273 " message_callback (\n"
36276 " uint64_t event,\n"
36277 " int event_handle,\n"
36279 " const char *buf, size_t buf_len,\n"
36280 " const uint64_t *array, size_t array_len)\n"
36282 " const int priority = LOG_USER|LOG_INFO;\n"
36283 " if (buf_len > 0)\n"
36284 " syslog (priority, \"event 0x%lx: %s\", event, buf);\n"
36290 #: ../src/guestfs.pod:1998
36291 msgid "CANCELLING LONG TRANSFERS"
36295 #: ../src/guestfs.pod:2000
36297 "Some operations can be cancelled by the caller while they are in progress. "
36298 "Currently only operations that involve uploading or downloading data can be "
36299 "cancelled (technically: operations that have C<FileIn> or C<FileOut> "
36300 "parameters in the generator)."
36304 #: ../src/guestfs.pod:2005
36305 msgid "guestfs_user_cancel"
36309 #: ../src/guestfs.pod:2007
36312 " void guestfs_user_cancel (guestfs_h *g);\n"
36317 #: ../src/guestfs.pod:2009
36318 msgid "C<guestfs_user_cancel> cancels the current upload or download operation."
36322 #: ../src/guestfs.pod:2012
36324 "Unlike most other libguestfs calls, this function is signal safe and thread "
36325 "safe. You can call it from a signal handler or from another thread, without "
36326 "needing to do any locking."
36330 #: ../src/guestfs.pod:2016
36332 "The transfer that was in progress (if there is one) will stop shortly "
36333 "afterwards, and will return an error. The errno (see "
36334 "L</guestfs_last_errno>) is set to C<EINTR>, so you can test for this to find "
36335 "out if the operation was cancelled or failed because of another error."
36339 #: ../src/guestfs.pod:2022
36341 "No cleanup is performed: for example, if a file was being uploaded then "
36342 "after cancellation there may be a partially uploaded file. It is the "
36343 "caller's responsibility to clean up if necessary."
36347 #: ../src/guestfs.pod:2026
36348 msgid "There are two common places that you might call C<guestfs_user_cancel>."
36352 #: ../src/guestfs.pod:2028
36354 "In an interactive text-based program, you might call it from a C<SIGINT> "
36355 "signal handler so that pressing C<^C> cancels the current operation. (You "
36356 "also need to call L</guestfs_set_pgroup> so that child processes don't "
36357 "receive the C<^C> signal)."
36361 #: ../src/guestfs.pod:2033
36363 "In a graphical program, when the main thread is displaying a progress bar "
36364 "with a cancel button, wire up the cancel button to call this function."
36368 #: ../src/guestfs.pod:2037
36369 msgid "PRIVATE DATA AREA"
36373 #: ../src/guestfs.pod:2039
36375 "You can attach named pieces of private data to the libguestfs handle, fetch "
36376 "them by name, and walk over them, for the lifetime of the handle. This is "
36377 "called the private data area and is only available from the C API."
36381 #: ../src/guestfs.pod:2044
36382 msgid "To attach a named piece of data, use the following call:"
36386 #: ../src/guestfs.pod:2046
36389 " void guestfs_set_private (guestfs_h *g, const char *key, void *data);\n"
36394 #: ../src/guestfs.pod:2048
36396 "C<key> is the name to associate with this data, and C<data> is an arbitrary "
36397 "pointer (which can be C<NULL>). Any previous item with the same key is "
36402 #: ../src/guestfs.pod:2052
36404 "You can use any C<key> you want, but your key should I<not> start with an "
36405 "underscore character. Keys beginning with an underscore character are "
36406 "reserved for internal libguestfs purposes (eg. for implementing language "
36407 "bindings). It is recommended that you prefix the key with some unique "
36408 "string to avoid collisions with other users."
36412 #: ../src/guestfs.pod:2058
36413 msgid "To retrieve the pointer, use:"
36417 #: ../src/guestfs.pod:2060
36420 " void *guestfs_get_private (guestfs_h *g, const char *key);\n"
36425 #: ../src/guestfs.pod:2062
36427 "This function returns C<NULL> if either no data is found associated with "
36428 "C<key>, or if the user previously set the C<key>'s C<data> pointer to "
36433 #: ../src/guestfs.pod:2066
36435 "Libguestfs does not try to look at or interpret the C<data> pointer in any "
36436 "way. As far as libguestfs is concerned, it need not be a valid pointer at "
36437 "all. In particular, libguestfs does I<not> try to free the data when the "
36438 "handle is closed. If the data must be freed, then the caller must either "
36439 "free it before calling L</guestfs_close> or must set up a close callback to "
36440 "do it (see L</GUESTFS_EVENT_CLOSE>)."
36444 #: ../src/guestfs.pod:2073
36445 msgid "To walk over all entries, use these two functions:"
36449 #: ../src/guestfs.pod:2075
36452 " void *guestfs_first_private (guestfs_h *g, const char **key_rtn);\n"
36457 #: ../src/guestfs.pod:2077
36460 " void *guestfs_next_private (guestfs_h *g, const char **key_rtn);\n"
36465 #: ../src/guestfs.pod:2079
36467 "C<guestfs_first_private> returns the first key, pointer pair (\"first\" does "
36468 "not have any particular meaning -- keys are not returned in any defined "
36469 "order). A pointer to the key is returned in C<*key_rtn> and the "
36470 "corresponding data pointer is returned from the function. C<NULL> is "
36471 "returned if there are no keys stored in the handle."
36475 #: ../src/guestfs.pod:2085
36477 "C<guestfs_next_private> returns the next key, pointer pair. The return "
36478 "value of this function is also C<NULL> is there are no further entries to "
36483 #: ../src/guestfs.pod:2089
36484 msgid "Notes about walking over entries:"
36488 #: ../src/guestfs.pod:2095
36489 msgid "You must not call C<guestfs_set_private> while walking over the entries."
36493 #: ../src/guestfs.pod:2100
36495 "The handle maintains an internal iterator which is reset when you call "
36496 "C<guestfs_first_private>. This internal iterator is invalidated when you "
36497 "call C<guestfs_set_private>."
36501 #: ../src/guestfs.pod:2106
36502 msgid "If you have set the data pointer associated with a key to C<NULL>, ie:"
36506 #: ../src/guestfs.pod:2108
36509 " guestfs_set_private (g, key, NULL);\n"
36514 #: ../src/guestfs.pod:2110
36515 msgid "then that C<key> is not returned when walking."
36519 #: ../src/guestfs.pod:2114
36521 "C<*key_rtn> is only valid until the next call to C<guestfs_first_private>, "
36522 "C<guestfs_next_private> or C<guestfs_set_private>."
36526 #: ../src/guestfs.pod:2120
36528 "The following example code shows how to print all keys and data pointers "
36529 "that are associated with the handle C<g>:"
36533 #: ../src/guestfs.pod:2123
36536 " const char *key;\n"
36537 " void *data = guestfs_first_private (g, &key);\n"
36538 " while (data != NULL)\n"
36540 " printf (\"key = %s, data = %p\\n\", key, data);\n"
36541 " data = guestfs_next_private (g, &key);\n"
36547 #: ../src/guestfs.pod:2131
36549 "More commonly you are only interested in keys that begin with an "
36550 "application-specific prefix C<foo_>. Modify the loop like so:"
36554 #: ../src/guestfs.pod:2134
36557 " const char *key;\n"
36558 " void *data = guestfs_first_private (g, &key);\n"
36559 " while (data != NULL)\n"
36561 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
36562 " printf (\"key = %s, data = %p\\n\", key, data);\n"
36563 " data = guestfs_next_private (g, &key);\n"
36569 #: ../src/guestfs.pod:2143
36571 "If you need to modify keys while walking, then you have to jump back to the "
36572 "beginning of the loop. For example, to delete all keys prefixed with "
36577 #: ../src/guestfs.pod:2147
36580 " const char *key;\n"
36583 " data = guestfs_first_private (g, &key);\n"
36584 " while (data != NULL)\n"
36586 " if (strncmp (key, \"foo_\", strlen (\"foo_\")) == 0)\n"
36588 " guestfs_set_private (g, key, NULL);\n"
36589 " /* note that 'key' pointer is now invalid, and so is\n"
36590 " the internal iterator */\n"
36593 " data = guestfs_next_private (g, &key);\n"
36599 #: ../src/guestfs.pod:2163
36601 "Note that the above loop is guaranteed to terminate because the keys are "
36602 "being deleted, but other manipulations of keys within the loop might not "
36603 "terminate unless you also maintain an indication of which keys have been "
36608 #: ../src/guestfs.pod:2168
36613 #: ../src/guestfs.pod:2170
36615 "The libguestfs C library can be probed using systemtap or DTrace. This is "
36616 "true of any library, not just libguestfs. However libguestfs also contains "
36617 "static markers to help in probing internal operations."
36621 #: ../src/guestfs.pod:2174
36622 msgid "You can list all the static markers by doing:"
36626 #: ../src/guestfs.pod:2176
36629 " stap -l 'process(\"/usr/lib*/libguestfs.so.0\")\n"
36630 " .provider(\"guestfs\").mark(\"*\")'\n"
36635 #: ../src/guestfs.pod:2179
36637 "B<Note:> These static markers are I<not> part of the stable API and may "
36638 "change in future versions."
36642 #: ../src/guestfs.pod:2182
36643 msgid "SYSTEMTAP SCRIPT EXAMPLE"
36647 #: ../src/guestfs.pod:2184
36649 "This script contains examples of displaying both the static markers and some "
36650 "ordinary C entry points:"
36654 #: ../src/guestfs.pod:2187
36662 #: ../src/guestfs.pod:2189
36665 " function display_time () {\n"
36666 " now = gettimeofday_us ();\n"
36669 " delta = now - last;\n"
36675 #: ../src/guestfs.pod:2196
36678 " printf (\"%d (+%d):\", now, delta);\n"
36684 #: ../src/guestfs.pod:2199
36689 " printf (\"ready\\n\");\n"
36695 #: ../src/guestfs.pod:2204
36698 " /* Display all calls to static markers. */\n"
36699 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
36700 " .provider(\"guestfs\").mark(\"*\") ? {\n"
36701 " display_time();\n"
36702 " printf (\"\\t%s %s\\n\", $$name, $$parms);\n"
36708 #: ../src/guestfs.pod:2211
36711 " /* Display all calls to guestfs_mkfs* functions. */\n"
36712 " probe process(\"/usr/lib*/libguestfs.so.0\")\n"
36713 " .function(\"guestfs_mkfs*\") ? {\n"
36714 " display_time();\n"
36715 " printf (\"\\t%s %s\\n\", probefunc(), $$parms);\n"
36721 #: ../src/guestfs.pod:2218
36723 "The script above can be saved to C<test.stap> and run using the L<stap(1)> "
36724 "program. Note that you either have to be root, or you have to add yourself "
36725 "to several special stap groups. Consult the systemtap documentation for "
36726 "more information."
36730 #: ../src/guestfs.pod:2223
36733 " # stap /tmp/test.stap\n"
36739 #: ../src/guestfs.pod:2226
36740 msgid "In another terminal, run a guestfish command such as this:"
36744 #: ../src/guestfs.pod:2230
36745 msgid "In the first terminal, stap trace output similar to this is shown:"
36749 #: ../src/guestfs.pod:2232
36752 " 1318248056692655 (+0):\tlaunch_start\n"
36753 " 1318248056692850 (+195): launch_build_appliance_start\n"
36754 " 1318248056818285 (+125435): launch_build_appliance_end\n"
36755 " 1318248056838059 (+19774): launch_run_qemu\n"
36756 " 1318248061071167 (+4233108): launch_end\n"
36757 " 1318248061280324 (+209157): guestfs_mkfs g=0x1024ab0 fstype=0x46116f "
36758 "device=0x1024e60\n"
36763 #: ../src/guestfs.pod:2239 ../src/guestfs.pod:2244
36768 #: ../src/guestfs.pod:2241
36770 "<!-- old anchor for the next section --> <a "
36771 "name=\"state_machine_and_low_level_event_api\"/>"
36775 #: ../src/guestfs.pod:2246
36776 msgid "ARCHITECTURE"
36780 #: ../src/guestfs.pod:2248
36782 "Internally, libguestfs is implemented by running an appliance (a special "
36783 "type of small virtual machine) using L<qemu(1)>. Qemu runs as a child "
36784 "process of the main program."
36788 #: ../src/guestfs.pod:2252
36791 " ___________________\n"
36793 " | main program |\n"
36795 " | | child process / appliance\n"
36796 " | | __________________________\n"
36798 " +-------------------+ RPC | +-----------------+ |\n"
36799 " | libguestfs <--------------------> guestfsd | |\n"
36800 " | | | +-----------------+ |\n"
36801 " \\___________________/ | | Linux kernel | |\n"
36802 " | +--^--------------+ |\n"
36803 " \\_________|________________/\n"
36805 " _______v______\n"
36808 " | disk image |\n"
36809 " \\______________/\n"
36814 #: ../src/guestfs.pod:2272
36816 "The library, linked to the main program, creates the child process and hence "
36817 "the appliance in the L</guestfs_launch> function."
36821 #: ../src/guestfs.pod:2275
36823 "Inside the appliance is a Linux kernel and a complete stack of userspace "
36824 "tools (such as LVM and ext2 programs) and a small controlling daemon called "
36825 "L</guestfsd>. The library talks to L</guestfsd> using remote procedure "
36826 "calls (RPC). There is a mostly one-to-one correspondence between libguestfs "
36827 "API calls and RPC calls to the daemon. Lastly the disk image(s) are "
36828 "attached to the qemu process which translates device access by the "
36829 "appliance's Linux kernel into accesses to the image."
36833 #: ../src/guestfs.pod:2284
36835 "A common misunderstanding is that the appliance \"is\" the virtual machine. "
36836 "Although the disk image you are attached to might also be used by some "
36837 "virtual machine, libguestfs doesn't know or care about this. (But you will "
36838 "care if both libguestfs's qemu process and your virtual machine are trying "
36839 "to update the disk image at the same time, since these usually results in "
36840 "massive disk corruption)."
36844 #: ../src/guestfs.pod:2291
36845 msgid "STATE MACHINE"
36849 #: ../src/guestfs.pod:2293
36850 msgid "libguestfs uses a state machine to model the child process:"
36854 #: ../src/guestfs.pod:2295
36858 " guestfs_create\n"
36866 " / | \\ \\ guestfs_launch\n"
36867 " / | _\\__V______\n"
36869 " / | | LAUNCHING |\n"
36870 " / | \\___________/\n"
36872 " / | guestfs_launch\n"
36874 " ______ / __|____V\n"
36875 " / \\ ------> / \\\n"
36876 " | BUSY | | READY |\n"
36877 " \\______/ <------ \\________/\n"
36882 #: ../src/guestfs.pod:2317
36884 "The normal transitions are (1) CONFIG (when the handle is created, but there "
36885 "is no child process), (2) LAUNCHING (when the child process is booting up), "
36886 "(3) alternating between READY and BUSY as commands are issued to, and "
36887 "carried out by, the child process."
36891 #: ../src/guestfs.pod:2322
36893 "The guest may be killed by L</guestfs_kill_subprocess>, or may die "
36894 "asynchronously at any time (eg. due to some internal error), and that causes "
36895 "the state to transition back to CONFIG."
36899 #: ../src/guestfs.pod:2326
36901 "Configuration commands for qemu such as L</guestfs_add_drive> can only be "
36902 "issued when in the CONFIG state."
36906 #: ../src/guestfs.pod:2329
36908 "The API offers one call that goes from CONFIG through LAUNCHING to READY. "
36909 "L</guestfs_launch> blocks until the child process is READY to accept "
36910 "commands (or until some failure or timeout). L</guestfs_launch> internally "
36911 "moves the state from CONFIG to LAUNCHING while it is running."
36915 #: ../src/guestfs.pod:2335
36917 "API actions such as L</guestfs_mount> can only be issued when in the READY "
36918 "state. These API calls block waiting for the command to be carried out "
36919 "(ie. the state to transition to BUSY and then back to READY). There are no "
36920 "non-blocking versions, and no way to issue more than one command per handle "
36921 "at the same time."
36925 #: ../src/guestfs.pod:2341
36927 "Finally, the child process sends asynchronous messages back to the main "
36928 "program, such as kernel log messages. You can register a callback to "
36929 "receive these messages."
36933 #: ../src/guestfs.pod:2345
36938 #: ../src/guestfs.pod:2347
36939 msgid "APPLIANCE BOOT PROCESS"
36943 #: ../src/guestfs.pod:2349
36945 "This process has evolved and continues to evolve. The description here "
36946 "corresponds only to the current version of libguestfs and is provided for "
36947 "information only."
36951 #: ../src/guestfs.pod:2353
36953 "In order to follow the stages involved below, enable libguestfs debugging "
36954 "(set the environment variable C<LIBGUESTFS_DEBUG=1>)."
36958 #: ../src/guestfs.pod:2358
36959 msgid "Create the appliance"
36963 #: ../src/guestfs.pod:2360
36965 "C<febootstrap-supermin-helper> is invoked to create the kernel, a small "
36966 "initrd and the appliance."
36970 #: ../src/guestfs.pod:2363
36972 "The appliance is cached in C</var/tmp/.guestfs-E<lt>UIDE<gt>> (or in another "
36973 "directory if C<TMPDIR> is set)."
36977 #: ../src/guestfs.pod:2366
36979 "For a complete description of how the appliance is created and cached, read "
36980 "the L<febootstrap(8)> and L<febootstrap-supermin-helper(8)> man pages."
36984 #: ../src/guestfs.pod:2370
36985 msgid "Start qemu and boot the kernel"
36989 #: ../src/guestfs.pod:2372
36990 msgid "qemu is invoked to boot the kernel."
36994 #: ../src/guestfs.pod:2374
36995 msgid "Run the initrd"
36999 #: ../src/guestfs.pod:2376
37001 "C<febootstrap-supermin-helper> builds a small initrd. The initrd is not the "
37002 "appliance. The purpose of the initrd is to load enough kernel modules in "
37003 "order that the appliance itself can be mounted and started."
37007 #: ../src/guestfs.pod:2380
37009 "The initrd is a cpio archive called "
37010 "C</var/tmp/.guestfs-E<lt>UIDE<gt>/initrd>."
37014 #: ../src/guestfs.pod:2383
37016 "When the initrd has started you will see messages showing that kernel "
37017 "modules are being loaded, similar to this:"
37021 #: ../src/guestfs.pod:2386
37024 " febootstrap: ext2 mini initrd starting up\n"
37025 " febootstrap: mounting /sys\n"
37026 " febootstrap: internal insmod libcrc32c.ko\n"
37027 " febootstrap: internal insmod crc32c-intel.ko\n"
37032 #: ../src/guestfs.pod:2391
37033 msgid "Find and mount the appliance device"
37037 #: ../src/guestfs.pod:2393
37039 "The appliance is a sparse file containing an ext2 filesystem which contains "
37040 "a familiar (although reduced in size) Linux operating system. It would "
37041 "normally be called C</var/tmp/.guestfs-E<lt>UIDE<gt>/root>."
37045 #: ../src/guestfs.pod:2397
37047 "The regular disks being inspected by libguestfs are the first devices "
37048 "exposed by qemu (eg. as C</dev/vda>)."
37052 #: ../src/guestfs.pod:2400
37054 "The last disk added to qemu is the appliance itself (eg. C</dev/vdb> if "
37055 "there was only one regular disk)."
37059 #: ../src/guestfs.pod:2403
37061 "Thus the final job of the initrd is to locate the appliance disk, mount it, "
37062 "and switch root into the appliance, and run C</init> from the appliance."
37066 #: ../src/guestfs.pod:2407
37067 msgid "If this works successfully you will see messages such as:"
37071 #: ../src/guestfs.pod:2409
37074 " febootstrap: picked /sys/block/vdb/dev as root device\n"
37075 " febootstrap: creating /dev/root as block special 252:16\n"
37076 " febootstrap: mounting new root on /root\n"
37077 " febootstrap: chroot\n"
37078 " Starting /init script ...\n"
37083 #: ../src/guestfs.pod:2415
37085 "Note that C<Starting /init script ...> indicates that the appliance's init "
37086 "script is now running."
37090 #: ../src/guestfs.pod:2418
37091 msgid "Initialize the appliance"
37095 #: ../src/guestfs.pod:2420
37097 "The appliance itself now initializes itself. This involves starting certain "
37098 "processes like C<udev>, possibly printing some debug information, and "
37099 "finally running the daemon (C<guestfsd>)."
37103 #: ../src/guestfs.pod:2424
37108 #: ../src/guestfs.pod:2426
37110 "Finally the daemon (C<guestfsd>) runs inside the appliance. If it runs you "
37115 #: ../src/guestfs.pod:2429
37118 " verbose daemon enabled\n"
37123 #: ../src/guestfs.pod:2431
37125 "The daemon expects to see a named virtio-serial port exposed by qemu and "
37126 "connected on the other end to the library."
37130 #: ../src/guestfs.pod:2434
37132 "The daemon connects to this port (and hence to the library) and sends a four "
37133 "byte message C<GUESTFS_LAUNCH_FLAG>, which initiates the communication "
37134 "protocol (see below)."
37138 #: ../src/guestfs.pod:2440
37139 msgid "COMMUNICATION PROTOCOL"
37143 #: ../src/guestfs.pod:2442
37145 "Don't rely on using this protocol directly. This section documents how it "
37146 "currently works, but it may change at any time."
37150 #: ../src/guestfs.pod:2445
37152 "The protocol used to talk between the library and the daemon running inside "
37153 "the qemu virtual machine is a simple RPC mechanism built on top of XDR (RFC "
37154 "1014, RFC 1832, RFC 4506)."
37158 #: ../src/guestfs.pod:2449
37160 "The detailed format of structures is in C<src/guestfs_protocol.x> (note: "
37161 "this file is automatically generated)."
37165 #: ../src/guestfs.pod:2452
37167 "There are two broad cases, ordinary functions that don't have any C<FileIn> "
37168 "and C<FileOut> parameters, which are handled with very simple request/reply "
37169 "messages. Then there are functions that have any C<FileIn> or C<FileOut> "
37170 "parameters, which use the same request and reply messages, but they may also "
37171 "be followed by files sent using a chunked encoding."
37175 #: ../src/guestfs.pod:2459
37176 msgid "ORDINARY FUNCTIONS (NO FILEIN/FILEOUT PARAMS)"
37180 #: ../src/guestfs.pod:2461
37181 msgid "For ordinary functions, the request message is:"
37185 #: ../src/guestfs.pod:2463
37188 " total length (header + arguments,\n"
37189 " but not including the length word itself)\n"
37190 " struct guestfs_message_header (encoded as XDR)\n"
37191 " struct guestfs_<foo>_args (encoded as XDR)\n"
37196 #: ../src/guestfs.pod:2468
37198 "The total length field allows the daemon to allocate a fixed size buffer "
37199 "into which it slurps the rest of the message. As a result, the total length "
37200 "is limited to C<GUESTFS_MESSAGE_MAX> bytes (currently 4MB), which means the "
37201 "effective size of any request is limited to somewhere under this size."
37205 #: ../src/guestfs.pod:2474
37207 "Note also that many functions don't take any arguments, in which case the "
37208 "C<guestfs_I<foo>_args> is completely omitted."
37212 #: ../src/guestfs.pod:2477
37214 "The header contains the procedure number (C<guestfs_proc>) which is how the "
37215 "receiver knows what type of args structure to expect, or none at all."
37219 #: ../src/guestfs.pod:2481
37221 "For functions that take optional arguments, the optional arguments are "
37222 "encoded in the C<guestfs_I<foo>_args> structure in the same way as ordinary "
37223 "arguments. A bitmask in the header indicates which optional arguments are "
37224 "meaningful. The bitmask is also checked to see if it contains bits set "
37225 "which the daemon does not know about (eg. if more optional arguments were "
37226 "added in a later version of the library), and this causes the call to be "
37231 #: ../src/guestfs.pod:2489
37232 msgid "The reply message for ordinary functions is:"
37236 #: ../src/guestfs.pod:2491
37239 " total length (header + ret,\n"
37240 " but not including the length word itself)\n"
37241 " struct guestfs_message_header (encoded as XDR)\n"
37242 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37247 #: ../src/guestfs.pod:2496
37249 "As above the C<guestfs_I<foo>_ret> structure may be completely omitted for "
37250 "functions that return no formal return values."
37254 #: ../src/guestfs.pod:2499
37255 msgid "As above the total length of the reply is limited to C<GUESTFS_MESSAGE_MAX>."
37259 #: ../src/guestfs.pod:2502
37261 "In the case of an error, a flag is set in the header, and the reply message "
37262 "is slightly changed:"
37266 #: ../src/guestfs.pod:2505
37269 " total length (header + error,\n"
37270 " but not including the length word itself)\n"
37271 " struct guestfs_message_header (encoded as XDR)\n"
37272 " struct guestfs_message_error (encoded as XDR)\n"
37277 #: ../src/guestfs.pod:2510
37279 "The C<guestfs_message_error> structure contains the error message as a "
37284 #: ../src/guestfs.pod:2513
37285 msgid "FUNCTIONS THAT HAVE FILEIN PARAMETERS"
37289 #: ../src/guestfs.pod:2515
37291 "A C<FileIn> parameter indicates that we transfer a file I<into> the guest. "
37292 "The normal request message is sent (see above). However this is followed by "
37293 "a sequence of file chunks."
37297 #: ../src/guestfs.pod:2519
37300 " total length (header + arguments,\n"
37301 " but not including the length word itself,\n"
37302 " and not including the chunks)\n"
37303 " struct guestfs_message_header (encoded as XDR)\n"
37304 " struct guestfs_<foo>_args (encoded as XDR)\n"
37305 " sequence of chunks for FileIn param #0\n"
37306 " sequence of chunks for FileIn param #1 etc.\n"
37311 #: ../src/guestfs.pod:2527
37312 msgid "The \"sequence of chunks\" is:"
37316 #: ../src/guestfs.pod:2529
37319 " length of chunk (not including length word itself)\n"
37320 " struct guestfs_chunk (encoded as XDR)\n"
37321 " length of chunk\n"
37322 " struct guestfs_chunk (encoded as XDR)\n"
37324 " length of chunk\n"
37325 " struct guestfs_chunk (with data.data_len == 0)\n"
37330 #: ../src/guestfs.pod:2537
37332 "The final chunk has the C<data_len> field set to zero. Additionally a flag "
37333 "is set in the final chunk to indicate either successful completion or early "
37338 #: ../src/guestfs.pod:2541
37340 "At time of writing there are no functions that have more than one FileIn "
37341 "parameter. However this is (theoretically) supported, by sending the "
37342 "sequence of chunks for each FileIn parameter one after another (from left to "
37347 #: ../src/guestfs.pod:2546
37349 "Both the library (sender) I<and> the daemon (receiver) may cancel the "
37350 "transfer. The library does this by sending a chunk with a special flag set "
37351 "to indicate cancellation. When the daemon sees this, it cancels the whole "
37352 "RPC, does I<not> send any reply, and goes back to reading the next request."
37356 #: ../src/guestfs.pod:2552
37358 "The daemon may also cancel. It does this by writing a special word "
37359 "C<GUESTFS_CANCEL_FLAG> to the socket. The library listens for this during "
37360 "the transfer, and if it gets it, it will cancel the transfer (it sends a "
37361 "cancel chunk). The special word is chosen so that even if cancellation "
37362 "happens right at the end of the transfer (after the library has finished "
37363 "writing and has started listening for the reply), the \"spurious\" cancel "
37364 "flag will not be confused with the reply message."
37368 #: ../src/guestfs.pod:2561
37370 "This protocol allows the transfer of arbitrary sized files (no 32 bit "
37371 "limit), and also files where the size is not known in advance (eg. from "
37372 "pipes or sockets). However the chunks are rather small "
37373 "(C<GUESTFS_MAX_CHUNK_SIZE>), so that neither the library nor the daemon need "
37374 "to keep much in memory."
37378 #: ../src/guestfs.pod:2567
37379 msgid "FUNCTIONS THAT HAVE FILEOUT PARAMETERS"
37383 #: ../src/guestfs.pod:2569
37385 "The protocol for FileOut parameters is exactly the same as for FileIn "
37386 "parameters, but with the roles of daemon and library reversed."
37390 #: ../src/guestfs.pod:2572
37393 " total length (header + ret,\n"
37394 " but not including the length word itself,\n"
37395 " and not including the chunks)\n"
37396 " struct guestfs_message_header (encoded as XDR)\n"
37397 " struct guestfs_<foo>_ret (encoded as XDR)\n"
37398 " sequence of chunks for FileOut param #0\n"
37399 " sequence of chunks for FileOut param #1 etc.\n"
37404 #: ../src/guestfs.pod:2580
37405 msgid "INITIAL MESSAGE"
37409 #: ../src/guestfs.pod:2582
37411 "When the daemon launches it sends an initial word (C<GUESTFS_LAUNCH_FLAG>) "
37412 "which indicates that the guest and daemon is alive. This is what "
37413 "L</guestfs_launch> waits for."
37417 #: ../src/guestfs.pod:2586
37418 msgid "PROGRESS NOTIFICATION MESSAGES"
37422 #: ../src/guestfs.pod:2588
37424 "The daemon may send progress notification messages at any time. These are "
37425 "distinguished by the normal length word being replaced by "
37426 "C<GUESTFS_PROGRESS_FLAG>, followed by a fixed size progress message."
37430 #: ../src/guestfs.pod:2592
37432 "The library turns them into progress callbacks (see "
37433 "L</GUESTFS_EVENT_PROGRESS>) if there is a callback registered, or discards "
37438 #: ../src/guestfs.pod:2596
37440 "The daemon self-limits the frequency of progress messages it sends (see "
37441 "C<daemon/proto.c:notify_progress>). Not all calls generate progress "
37446 #: ../src/guestfs.pod:2600
37447 msgid "LIBGUESTFS VERSION NUMBERS"
37451 #: ../src/guestfs.pod:2602
37453 "Since April 2010, libguestfs has started to make separate development and "
37454 "stable releases, along with corresponding branches in our git repository. "
37455 "These separate releases can be identified by version number:"
37459 #: ../src/guestfs.pod:2607
37462 " even numbers for stable: 1.2.x, 1.4.x, ...\n"
37463 " .-------- odd numbers for development: 1.3.x, 1.5.x, ...\n"
37469 " | `-------- sub-version\n"
37471 " `------ always '1' because we don't change the ABI\n"
37476 #: ../src/guestfs.pod:2618
37477 msgid "Thus \"1.3.5\" is the 5th update to the development branch \"1.3\"."
37481 #: ../src/guestfs.pod:2620
37483 "As time passes we cherry pick fixes from the development branch and backport "
37484 "those into the stable branch, the effect being that the stable branch should "
37485 "get more stable and less buggy over time. So the stable releases are ideal "
37486 "for people who don't need new features but would just like the software to "
37491 #: ../src/guestfs.pod:2626
37492 msgid "Our criteria for backporting changes are:"
37496 #: ../src/guestfs.pod:2632
37498 "Documentation changes which don't affect any code are backported unless the "
37499 "documentation refers to a future feature which is not in stable."
37503 #: ../src/guestfs.pod:2638
37505 "Bug fixes which are not controversial, fix obvious problems, and have been "
37506 "well tested are backported."
37510 #: ../src/guestfs.pod:2643
37512 "Simple rearrangements of code which shouldn't affect how it works get "
37513 "backported. This is so that the code in the two branches doesn't get too "
37514 "far out of step, allowing us to backport future fixes more easily."
37518 #: ../src/guestfs.pod:2649
37520 "We I<don't> backport new features, new APIs, new tools etc, except in one "
37521 "exceptional case: the new feature is required in order to implement an "
37522 "important bug fix."
37526 #: ../src/guestfs.pod:2655
37528 "A new stable branch starts when we think the new features in development are "
37529 "substantial and compelling enough over the current stable branch to warrant "
37530 "it. When that happens we create new stable and development versions 1.N.0 "
37531 "and 1.(N+1).0 [N is even]. The new dot-oh release won't necessarily be so "
37532 "stable at this point, but by backporting fixes from development, that branch "
37533 "will stabilize over time."
37537 #: ../src/guestfs.pod:2663
37538 msgid "EXTENDING LIBGUESTFS"
37542 #: ../src/guestfs.pod:2665
37543 msgid "ADDING A NEW API ACTION"
37547 #: ../src/guestfs.pod:2667
37549 "Large amounts of boilerplate code in libguestfs (RPC, bindings, "
37550 "documentation) are generated, and this makes it easy to extend the "
37555 #: ../src/guestfs.pod:2671
37556 msgid "To add a new API action there are two changes:"
37560 #: ../src/guestfs.pod:2677
37562 "You need to add a description of the call (name, parameters, return type, "
37563 "tests, documentation) to C<generator/generator_actions.ml>."
37567 #: ../src/guestfs.pod:2680
37569 "There are two sorts of API action, depending on whether the call goes "
37570 "through to the daemon in the appliance, or is serviced entirely by the "
37571 "library (see L</ARCHITECTURE> above). L</guestfs_sync> is an example of the "
37572 "former, since the sync is done in the appliance. L</guestfs_set_trace> is "
37573 "an example of the latter, since a trace flag is maintained in the handle and "
37574 "all tracing is done on the library side."
37578 #: ../src/guestfs.pod:2688
37580 "Most new actions are of the first type, and get added to the "
37581 "C<daemon_functions> list. Each function has a unique procedure number used "
37582 "in the RPC protocol which is assigned to that action when we publish "
37583 "libguestfs and cannot be reused. Take the latest procedure number and "
37588 #: ../src/guestfs.pod:2694
37590 "For library-only actions of the second type, add to the "
37591 "C<non_daemon_functions> list. Since these functions are serviced by the "
37592 "library and do not travel over the RPC mechanism to the daemon, these "
37593 "functions do not need a procedure number, and so the procedure number is set "
37598 #: ../src/guestfs.pod:2702
37599 msgid "Implement the action (in C):"
37603 #: ../src/guestfs.pod:2704
37605 "For daemon actions, implement the function C<do_E<lt>nameE<gt>> in the "
37606 "C<daemon/> directory."
37610 #: ../src/guestfs.pod:2707
37612 "For library actions, implement the function C<guestfs__E<lt>nameE<gt>> "
37613 "(note: double underscore) in the C<src/> directory."
37617 #: ../src/guestfs.pod:2710
37618 msgid "In either case, use another function as an example of what to do."
37622 #: ../src/guestfs.pod:2714
37623 msgid "After making these changes, use C<make> to compile."
37627 #: ../src/guestfs.pod:2716
37629 "Note that you don't need to implement the RPC, language bindings, manual "
37630 "pages or anything else. It's all automatically generated from the OCaml "
37635 #: ../src/guestfs.pod:2720
37636 msgid "ADDING TESTS FOR AN API ACTION"
37640 #: ../src/guestfs.pod:2722
37642 "You can supply zero or as many tests as you want per API call. The tests "
37643 "can either be added as part of the API description "
37644 "(C<generator/generator_actions.ml>), or in some rarer cases you may want to "
37645 "drop a script into C<regressions/>. Note that adding a script to "
37646 "C<regressions/> is slower, so if possible use the first method."
37650 #: ../src/guestfs.pod:2728
37652 "The following describes the test environment used when you add an API test "
37653 "in C<generator_actions.ml>."
37657 #: ../src/guestfs.pod:2731
37658 msgid "The test environment has 4 block devices:"
37662 #: ../src/guestfs.pod:2735
37663 msgid "C</dev/sda> 500MB"
37667 #: ../src/guestfs.pod:2737
37668 msgid "General block device for testing."
37672 #: ../src/guestfs.pod:2739
37673 msgid "C</dev/sdb> 50MB"
37677 #: ../src/guestfs.pod:2741
37679 "C</dev/sdb1> is an ext2 filesystem used for testing filesystem write "
37684 #: ../src/guestfs.pod:2744
37685 msgid "C</dev/sdc> 10MB"
37689 #: ../src/guestfs.pod:2746
37690 msgid "Used in a few tests where two block devices are needed."
37694 #: ../src/guestfs.pod:2748
37695 msgid "C</dev/sdd>"
37699 #: ../src/guestfs.pod:2750
37700 msgid "ISO with fixed content (see C<images/test.iso>)."
37704 #: ../src/guestfs.pod:2754
37706 "To be able to run the tests in a reasonable amount of time, the libguestfs "
37707 "appliance and block devices are reused between tests. So don't try testing "
37708 "L</guestfs_kill_subprocess> :-x"
37712 #: ../src/guestfs.pod:2758
37714 "Each test starts with an initial scenario, selected using one of the "
37715 "C<Init*> expressions, described in C<generator/generator_types.ml>. These "
37716 "initialize the disks mentioned above in a particular way as documented in "
37717 "C<generator_types.ml>. You should not assume anything about the previous "
37718 "contents of other disks that are not initialized."
37722 #: ../src/guestfs.pod:2764
37724 "You can add a prerequisite clause to any individual test. This is a "
37725 "run-time check, which, if it fails, causes the test to be skipped. Useful "
37726 "if testing a command which might not work on all variations of libguestfs "
37727 "builds. A test that has prerequisite of C<Always> means to run "
37732 #: ../src/guestfs.pod:2770
37734 "In addition, packagers can skip individual tests by setting environment "
37735 "variables before running C<make check>."
37739 #: ../src/guestfs.pod:2773
37742 " SKIP_TEST_<CMD>_<NUM>=1\n"
37747 #: ../src/guestfs.pod:2775
37748 msgid "eg: C<SKIP_TEST_COMMAND_3=1> skips test #3 of L</guestfs_command>."
37752 #: ../src/guestfs.pod:2777
37757 #: ../src/guestfs.pod:2779
37760 " SKIP_TEST_<CMD>=1\n"
37765 #: ../src/guestfs.pod:2781
37766 msgid "eg: C<SKIP_TEST_ZEROFREE=1> skips all L</guestfs_zerofree> tests."
37770 #: ../src/guestfs.pod:2783
37771 msgid "Packagers can run only certain tests by setting for example:"
37775 #: ../src/guestfs.pod:2785
37778 " TEST_ONLY=\"vfs_type zerofree\"\n"
37783 #: ../src/guestfs.pod:2787
37785 "See C<capitests/tests.c> for more details of how these environment variables "
37790 #: ../src/guestfs.pod:2790
37791 msgid "DEBUGGING NEW API ACTIONS"
37795 #: ../src/guestfs.pod:2792
37796 msgid "Test new actions work before submitting them."
37800 #: ../src/guestfs.pod:2794
37801 msgid "You can use guestfish to try out new commands."
37805 #: ../src/guestfs.pod:2796
37807 "Debugging the daemon is a problem because it runs inside a minimal "
37808 "environment. However you can fprintf messages in the daemon to stderr, and "
37809 "they will show up if you use C<guestfish -v>."
37813 #: ../src/guestfs.pod:2800
37814 msgid "FORMATTING CODE AND OTHER CONVENTIONS"
37818 #: ../src/guestfs.pod:2802
37820 "Our C source code generally adheres to some basic code-formatting "
37821 "conventions. The existing code base is not totally consistent on this "
37822 "front, but we do prefer that contributed code be formatted similarly. In "
37823 "short, use spaces-not-TABs for indentation, use 2 spaces for each "
37824 "indentation level, and other than that, follow the K&R style."
37828 #: ../src/guestfs.pod:2808
37830 "If you use Emacs, add the following to one of one of your start-up files "
37831 "(e.g., ~/.emacs), to help ensure that you get indentation right:"
37835 #: ../src/guestfs.pod:2811
37838 " ;;; In libguestfs, indent with spaces everywhere (not TABs).\n"
37839 " ;;; Exceptions: Makefile and ChangeLog modes.\n"
37840 " (add-hook 'find-file-hook\n"
37841 " '(lambda () (if (and buffer-file-name\n"
37842 " (string-match \"/libguestfs\\\\>\"\n"
37843 " (buffer-file-name))\n"
37844 " (not (string-equal mode-name \"Change Log\"))\n"
37845 " (not (string-equal mode-name \"Makefile\")))\n"
37846 " (setq indent-tabs-mode nil))))\n"
37851 #: ../src/guestfs.pod:2821
37854 " ;;; When editing C sources in libguestfs, use this style.\n"
37855 " (defun libguestfs-c-mode ()\n"
37856 " \"C mode with adjusted defaults for use with libguestfs.\"\n"
37858 " (c-set-style \"K&R\")\n"
37859 " (setq c-indent-level 2)\n"
37860 " (setq c-basic-offset 2))\n"
37861 " (add-hook 'c-mode-hook\n"
37862 " '(lambda () (if (string-match \"/libguestfs\\\\>\"\n"
37863 " (buffer-file-name))\n"
37864 " (libguestfs-c-mode))))\n"
37869 #: ../src/guestfs.pod:2833
37870 msgid "Enable warnings when compiling (and fix any problems this finds):"
37874 #: ../src/guestfs.pod:2836
37877 " ./configure --enable-gcc-warnings\n"
37882 #: ../src/guestfs.pod:2838
37883 msgid "Useful targets are:"
37887 #: ../src/guestfs.pod:2840
37890 " make syntax-check # checks the syntax of the C code\n"
37891 " make check # runs the test suite\n"
37896 #: ../src/guestfs.pod:2843
37897 msgid "DAEMON CUSTOM PRINTF FORMATTERS"
37901 #: ../src/guestfs.pod:2845
37903 "In the daemon code we have created custom printf formatters C<%Q> and C<%R>, "
37904 "which are used to do shell quoting."
37908 #: ../src/guestfs.pod:2850
37913 #: ../src/guestfs.pod:2852
37915 "Simple shell quoted string. Any spaces or other shell characters are "
37920 #: ../src/guestfs.pod:2855
37925 #: ../src/guestfs.pod:2857
37927 "Same as C<%Q> except the string is treated as a path which is prefixed by "
37932 #: ../src/guestfs.pod:2864
37935 " asprintf (&cmd, \"cat %R\", path);\n"
37940 #: ../src/guestfs.pod:2866
37941 msgid "would produce C<cat /sysroot/some\\ path\\ with\\ spaces>"
37945 #: ../src/guestfs.pod:2868
37947 "I<Note:> Do I<not> use these when you are passing parameters to the "
37948 "C<command{,r,v,rv}()> functions. These parameters do NOT need to be quoted "
37949 "because they are not passed via the shell (instead, straight to exec). You "
37950 "probably want to use the C<sysroot_path()> function however."
37954 #: ../src/guestfs.pod:2874
37955 msgid "SUBMITTING YOUR NEW API ACTIONS"
37959 #: ../src/guestfs.pod:2876
37961 "Submit patches to the mailing list: "
37962 "L<http://www.redhat.com/mailman/listinfo/libguestfs> and CC to "
37963 "L<rjones@redhat.com>."
37967 #: ../src/guestfs.pod:2880
37968 msgid "INTERNATIONALIZATION (I18N) SUPPORT"
37972 #: ../src/guestfs.pod:2882
37973 msgid "We support i18n (gettext anyhow) in the library."
37977 #: ../src/guestfs.pod:2884
37979 "However many messages come from the daemon, and we don't translate those at "
37980 "the moment. One reason is that the appliance generally has all locale files "
37981 "removed from it, because they take up a lot of space. So we'd have to readd "
37982 "some of those, as well as copying our PO files into the appliance."
37986 #: ../src/guestfs.pod:2890
37988 "Debugging messages are never translated, since they are intended for the "
37993 #: ../src/guestfs.pod:2893
37994 msgid "SOURCE CODE SUBDIRECTORIES"
37998 #: ../src/guestfs.pod:2897
38003 #: ../src/guestfs.pod:2899
38004 msgid "L<virt-alignment-scan(1)> command and documentation."
38008 #: ../src/guestfs.pod:2903
38009 msgid "The libguestfs appliance, build scripts and so on."
38013 #: ../src/guestfs.pod:2905
38014 msgid "C<capitests>"
38018 #: ../src/guestfs.pod:2907
38019 msgid "Automated tests of the C API."
38023 #: ../src/guestfs.pod:2909
38028 #: ../src/guestfs.pod:2911
38030 "The L<virt-cat(1)>, L<virt-filesystems(1)> and L<virt-ls(1)> commands and "
38035 #: ../src/guestfs.pod:2914
38040 #: ../src/guestfs.pod:2916
38042 "Safety and liveness tests of components that libguestfs depends upon (not of "
38043 "libguestfs itself). Mainly this is for qemu and the kernel."
38047 #: ../src/guestfs.pod:2919
38052 #: ../src/guestfs.pod:2921
38054 "Tools for cloning virtual machines. Currently contains L<virt-sysprep(1)> "
38055 "command and documentation."
38059 #: ../src/guestfs.pod:2924
38064 #: ../src/guestfs.pod:2926
38065 msgid "Outside contributions, experimental parts."
38069 #: ../src/guestfs.pod:2928
38074 #: ../src/guestfs.pod:2930
38076 "The daemon that runs inside the libguestfs appliance and carries out "
38081 #: ../src/guestfs.pod:2933
38086 #: ../src/guestfs.pod:2935
38087 msgid "L<virt-df(1)> command and documentation."
38091 #: ../src/guestfs.pod:2937
38096 #: ../src/guestfs.pod:2939
38097 msgid "L<virt-edit(1)> command and documentation."
38101 #: ../src/guestfs.pod:2941
38102 msgid "C<examples>"
38106 #: ../src/guestfs.pod:2943
38107 msgid "C API example code."
38111 #: ../src/guestfs.pod:2945
38116 #: ../src/guestfs.pod:2947
38118 "L<guestfish(1)>, the command-line shell, and various shell scripts built on "
38119 "top such as L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
38120 "L<virt-tar-out(1)>."
38124 #: ../src/guestfs.pod:2951
38129 #: ../src/guestfs.pod:2953
38130 msgid "L<guestmount(1)>, FUSE (userspace filesystem) built on top of libguestfs."
38134 #: ../src/guestfs.pod:2955
38135 msgid "C<generator>"
38139 #: ../src/guestfs.pod:2957
38141 "The crucially important generator, used to automatically generate large "
38142 "amounts of boilerplate C code for things like RPC and bindings."
38146 #: ../src/guestfs.pod:2960
38151 #: ../src/guestfs.pod:2962
38152 msgid "Files used by the test suite."
38156 #: ../src/guestfs.pod:2964
38157 msgid "Some \"phony\" guest images which we test against."
38161 #: ../src/guestfs.pod:2966
38162 msgid "C<inspector>"
38166 #: ../src/guestfs.pod:2968
38167 msgid "L<virt-inspector(1)>, the virtual machine image inspector."
38171 #: ../src/guestfs.pod:2970
38176 #: ../src/guestfs.pod:2972
38177 msgid "Logo used on the website. The fish is called Arthur by the way."
38181 #: ../src/guestfs.pod:2974
38186 #: ../src/guestfs.pod:2976
38187 msgid "M4 macros used by autoconf."
38191 #: ../src/guestfs.pod:2978
38196 #: ../src/guestfs.pod:2980
38197 msgid "Translations of simple gettext strings."
38201 #: ../src/guestfs.pod:2982
38206 #: ../src/guestfs.pod:2984
38208 "The build infrastructure and PO files for translations of manpages and POD "
38209 "files. Eventually this will be combined with the C<po> directory, but that "
38210 "is rather complicated."
38214 #: ../src/guestfs.pod:2988
38215 msgid "C<regressions>"
38219 #: ../src/guestfs.pod:2990
38220 msgid "Regression tests."
38224 #: ../src/guestfs.pod:2992
38229 #: ../src/guestfs.pod:2994
38230 msgid "L<virt-rescue(1)> command and documentation."
38234 #: ../src/guestfs.pod:2996
38239 #: ../src/guestfs.pod:2998
38240 msgid "L<virt-resize(1)> command and documentation."
38244 #: ../src/guestfs.pod:3000
38245 msgid "C<sparsify>"
38249 #: ../src/guestfs.pod:3002
38250 msgid "L<virt-sparsify(1)> command and documentation."
38254 #: ../src/guestfs.pod:3004
38259 #: ../src/guestfs.pod:3006
38260 msgid "Source code to the C library."
38264 #: ../src/guestfs.pod:3008
38269 #: ../src/guestfs.pod:3010
38270 msgid "Command line tools written in Perl (L<virt-win-reg(1)> and many others)."
38274 #: ../src/guestfs.pod:3012
38275 msgid "C<test-tool>"
38279 #: ../src/guestfs.pod:3014
38281 "Test tool for end users to test if their qemu/kernel combination will work "
38286 #: ../src/guestfs.pod:3017
38291 #: ../src/guestfs.pod:3019
38296 #: ../src/guestfs.pod:3021
38301 #: ../src/guestfs.pod:3023
38306 #: ../src/guestfs.pod:3025
38311 #: ../src/guestfs.pod:3027
38316 #: ../src/guestfs.pod:3029
38321 #: ../src/guestfs.pod:3031
38326 #: ../src/guestfs.pod:3033
38331 #: ../src/guestfs.pod:3035
38332 msgid "Language bindings."
38336 #: ../src/guestfs.pod:3039
38337 msgid "MAKING A STABLE RELEASE"
38341 #: ../src/guestfs.pod:3041
38343 "When we make a stable release, there are several steps documented here. See "
38344 "L</LIBGUESTFS VERSION NUMBERS> for general information about the stable "
38349 #: ../src/guestfs.pod:3049
38350 msgid "Check C<make && make check> works on at least Fedora, Debian and Ubuntu."
38354 #: ../src/guestfs.pod:3054
38355 msgid "Finalize RELEASE-NOTES."
38359 #: ../src/guestfs.pod:3058
38360 msgid "Update ROADMAP."
38364 #: ../src/guestfs.pod:3062
38365 msgid "Run C<src/api-support/update-from-tarballs.sh>."
38369 #: ../src/guestfs.pod:3066
38370 msgid "Push and pull from Transifex."
38374 #: ../src/guestfs.pod:3068
38379 #: ../src/guestfs.pod:3070
38387 #: ../src/guestfs.pod:3072
38388 msgid "to push the latest POT files to Transifex. Then run:"
38392 #: ../src/guestfs.pod:3074
38400 #: ../src/guestfs.pod:3076
38401 msgid "which is a wrapper to pull the latest translated C<*.po> files."
38405 #: ../src/guestfs.pod:3080
38407 "Create new stable and development directories under "
38408 "L<http://libguestfs.org/download>."
38412 #: ../src/guestfs.pod:3085
38413 msgid "Create the branch in git:"
38417 #: ../src/guestfs.pod:3087
38420 " git tag -a 1.XX.0 -m \"Version 1.XX.0 (stable)\"\n"
38421 " git tag -a 1.YY.0 -m \"Version 1.YY.0 (development)\"\n"
38422 " git branch stable-1.XX\n"
38423 " git push origin tag 1.XX.0 1.YY.0 stable-1.XX\n"
38428 #: ../src/guestfs.pod:3094
38433 #: ../src/guestfs.pod:3096
38434 msgid "PROTOCOL LIMITS"
38438 #: ../src/guestfs.pod:3098
38440 "Internally libguestfs uses a message-based protocol to pass API calls and "
38441 "their responses to and from a small \"appliance\" (see L</INTERNALS> for "
38442 "plenty more detail about this). The maximum message size used by the "
38443 "protocol is slightly less than 4 MB. For some API calls you may need to be "
38444 "aware of this limit. The API calls which may be affected are individually "
38445 "documented, with a link back to this section of the documentation."
38449 #: ../src/guestfs.pod:3106
38451 "A simple call such as L</guestfs_cat> returns its result (the file data) in "
38452 "a simple string. Because this string is at some point internally encoded as "
38453 "a message, the maximum size that it can return is slightly under 4 MB. If "
38454 "the requested file is larger than this then you will get an error."
38458 #: ../src/guestfs.pod:3112
38460 "In order to transfer large files into and out of the guest filesystem, you "
38461 "need to use particular calls that support this. The sections L</UPLOADING> "
38462 "and L</DOWNLOADING> document how to do this."
38466 #: ../src/guestfs.pod:3116
38468 "You might also consider mounting the disk image using our FUSE filesystem "
38469 "support (L<guestmount(1)>)."
38473 #: ../src/guestfs.pod:3119
38474 msgid "MAXIMUM NUMBER OF DISKS"
38478 #: ../src/guestfs.pod:3121
38479 msgid "When using virtio disks (the default) the current limit is B<25> disks."
38483 #: ../src/guestfs.pod:3124
38485 "Virtio itself consumes 1 virtual PCI slot per disk, and PCI is limited to 31 "
38486 "slots. However febootstrap only understands disks with names C</dev/vda> "
38487 "through C</dev/vdz> (26 letters) and it reserves one disk for its own "
38492 #: ../src/guestfs.pod:3129
38494 "We are working to substantially raise this limit in future versions but it "
38495 "requires complex changes to qemu."
38499 #: ../src/guestfs.pod:3132
38501 "In future versions of libguestfs it should also be possible to \"hot plug\" "
38502 "disks (add and remove disks after calling L</guestfs_launch>). This also "
38503 "requires changes to qemu."
38507 #: ../src/guestfs.pod:3136
38508 msgid "MAXIMUM NUMBER OF PARTITIONS PER DISK"
38512 #: ../src/guestfs.pod:3138
38513 msgid "Virtio limits the maximum number of partitions per disk to B<15>."
38517 #: ../src/guestfs.pod:3140
38519 "This is because it reserves 4 bits for the minor device number (thus "
38520 "C</dev/vda>, and C</dev/vda1> through C</dev/vda15>)."
38524 #: ../src/guestfs.pod:3143
38526 "If you attach a disk with more than 15 partitions, the extra partitions are "
38527 "ignored by libguestfs."
38531 #: ../src/guestfs.pod:3146
38532 msgid "MAXIMUM SIZE OF A DISK"
38536 #: ../src/guestfs.pod:3148
38537 msgid "Probably the limit is between 2**63-1 and 2**64-1 bytes."
38541 #: ../src/guestfs.pod:3150
38543 "We have tested block devices up to 1 exabyte (2**60 or "
38544 "1,152,921,504,606,846,976 bytes) using sparse files backed by an XFS host "
38549 #: ../src/guestfs.pod:3154
38551 "Although libguestfs probably does not impose any limit, the underlying host "
38552 "storage will. If you store disk images on a host ext4 filesystem, then the "
38553 "maximum size will be limited by the maximum ext4 file size (currently 16 "
38554 "TB). If you store disk images as host logical volumes then you are limited "
38555 "by the maximum size of an LV."
38559 #: ../src/guestfs.pod:3160
38561 "For the hugest disk image files, we recommend using XFS on the host for "
38566 #: ../src/guestfs.pod:3163
38567 msgid "MAXIMUM SIZE OF A PARTITION"
38571 #: ../src/guestfs.pod:3165
38573 "The MBR (ie. classic MS-DOS) partitioning scheme uses 32 bit sector "
38574 "numbers. Assuming a 512 byte sector size, this means that MBR cannot "
38575 "address a partition located beyond 2 TB on the disk."
38579 #: ../src/guestfs.pod:3169
38581 "It is recommended that you use GPT partitions on disks which are larger than "
38582 "this size. GPT uses 64 bit sector numbers and so can address partitions "
38583 "which are theoretically larger than the largest disk we could support."
38587 #: ../src/guestfs.pod:3174
38588 msgid "MAXIMUM SIZE OF A FILESYSTEM, FILES, DIRECTORIES"
38592 #: ../src/guestfs.pod:3176
38594 "This depends on the filesystem type. libguestfs itself does not impose any "
38595 "known limit. Consult Wikipedia or the filesystem documentation to find out "
38596 "what these limits are."
38600 #: ../src/guestfs.pod:3180
38601 msgid "MAXIMUM UPLOAD AND DOWNLOAD"
38605 #: ../src/guestfs.pod:3182
38607 "The API functions L</guestfs_upload>, L</guestfs_download>, "
38608 "L</guestfs_tar_in>, L</guestfs_tar_out> and the like allow unlimited sized "
38609 "uploads and downloads."
38613 #: ../src/guestfs.pod:3186
38614 msgid "INSPECTION LIMITS"
38618 #: ../src/guestfs.pod:3188
38620 "The inspection code has several arbitrary limits on things like the size of "
38621 "Windows Registry hive it will read, and the length of product name. These "
38622 "are intended to stop a malicious guest from consuming arbitrary amounts of "
38623 "memory and disk space on the host, and should not be reached in practice. "
38624 "See the source code for more information."
38628 #: ../src/guestfs.pod:3214
38630 "Set C<LIBGUESTFS_DEBUG=1> to enable verbose messages. This has the same "
38631 "effect as calling C<guestfs_set_verbose (g, 1)>."
38635 #: ../src/guestfs.pod:3226
38637 "Set the path that libguestfs uses to search for a supermin appliance. See "
38638 "the discussion of paths in section L</PATH> above."
38642 #: ../src/guestfs.pod:3235
38643 msgid "See also L</QEMU WRAPPERS> above."
38647 #: ../src/guestfs.pod:3239
38649 "Set C<LIBGUESTFS_TRACE=1> to enable command traces. This has the same "
38650 "effect as calling C<guestfs_set_trace (g, 1)>."
38654 #: ../src/guestfs.pod:3257
38656 "L<guestfs-examples(3)>, L<guestfs-erlang(3)>, L<guestfs-java(3)>, "
38657 "L<guestfs-ocaml(3)>, L<guestfs-perl(3)>, L<guestfs-python(3)>, "
38658 "L<guestfs-ruby(3)>, L<guestfish(1)>, L<guestmount(1)>, "
38659 "L<virt-alignment-scan(1)>, L<virt-cat(1)>, L<virt-copy-in(1)>, "
38660 "L<virt-copy-out(1)>, L<virt-df(1)>, L<virt-edit(1)>, L<virt-filesystems(1)>, "
38661 "L<virt-inspector(1)>, L<virt-list-filesystems(1)>, "
38662 "L<virt-list-partitions(1)>, L<virt-ls(1)>, L<virt-make-fs(1)>, "
38663 "L<virt-rescue(1)>, L<virt-resize(1)>, L<virt-sparsify(1)>, "
38664 "L<virt-sysprep(1)>, L<virt-tar(1)>, L<virt-tar-in(1)>, L<virt-tar-out(1)>, "
38665 "L<virt-win-reg(1)>, L<qemu(1)>, L<febootstrap(1)>, "
38666 "L<febootstrap-supermin-helper(8)>, L<hivex(3)>, L<stap(1)>, "
38667 "L<http://libguestfs.org/>."
38671 #: ../src/guestfs.pod:3293
38673 "Tools with a similar purpose: L<fdisk(8)>, L<parted(8)>, L<kpartx(8)>, "
38674 "L<lvm(8)>, L<disktype(1)>."
38678 #: ../src/guestfs.pod:3300 ../tools/virt-make-fs.pl:553 ../tools/virt-win-reg.pl:761
38683 #: ../src/guestfs.pod:3302
38684 msgid "To get a list of bugs against libguestfs use this link:"
38688 #: ../src/guestfs.pod:3304
38689 msgid "L<https://bugzilla.redhat.com/buglist.cgi?component=libguestfs&product=Virtualization+Tools>"
38693 #: ../src/guestfs.pod:3306
38694 msgid "To report a new bug against libguestfs use this link:"
38698 #: ../src/guestfs.pod:3308
38699 msgid "L<https://bugzilla.redhat.com/enter_bug.cgi?component=libguestfs&product=Virtualization+Tools>"
38703 #: ../src/guestfs.pod:3310
38704 msgid "When reporting a bug, please check:"
38708 #: ../src/guestfs.pod:3316
38709 msgid "That the bug hasn't been reported already."
38713 #: ../src/guestfs.pod:3320
38714 msgid "That you are testing a recent version."
38718 #: ../src/guestfs.pod:3324
38719 msgid "Describe the bug accurately, and give a way to reproduce it."
38723 #: ../src/guestfs.pod:3328
38725 "Run libguestfs-test-tool and paste the B<complete, unedited> output into the "
38730 #: ../test-tool/libguestfs-test-tool.pod:5
38731 msgid "libguestfs-test-tool - Diagnostics for libguestfs"
38735 #: ../test-tool/libguestfs-test-tool.pod:9
38738 " libguestfs-test-tool [--options]\n"
38743 #: ../test-tool/libguestfs-test-tool.pod:13
38745 "libguestfs-test-tool is a test program shipped with libguestfs to allow you "
38746 "to check basic libguestfs functionality is working. This is needed because "
38747 "libguestfs occasionally breaks for reasons beyond our control: usually "
38748 "because of changes in the underlying qemu or kernel packages, or the host "
38753 #: ../test-tool/libguestfs-test-tool.pod:19
38754 msgid "If you suspect a problem in libguestfs, then just run:"
38758 #: ../test-tool/libguestfs-test-tool.pod:21
38761 " libguestfs-test-tool\n"
38766 #: ../test-tool/libguestfs-test-tool.pod:23
38767 msgid "It will print lots of diagnostic messages."
38771 #: ../test-tool/libguestfs-test-tool.pod:25
38772 msgid "If it runs to completion successfully, you will see this near the end:"
38776 #: ../test-tool/libguestfs-test-tool.pod:27
38779 " ===== TEST FINISHED OK =====\n"
38784 #: ../test-tool/libguestfs-test-tool.pod:29
38785 msgid "and the test tool will exit with code 0."
38789 #: ../test-tool/libguestfs-test-tool.pod:31
38791 "If it fails (and/or exits with non-zero error code), please paste the "
38792 "I<complete, unedited> output of the test tool into a bug report. More "
38793 "information about reporting bugs can be found on the "
38794 "L<http://libguestfs.org/> website."
38798 #: ../test-tool/libguestfs-test-tool.pod:42
38799 msgid "Display short usage information and exit."
38803 #: ../test-tool/libguestfs-test-tool.pod:44
38804 msgid "B<--qemu qemu_binary>"
38808 #: ../test-tool/libguestfs-test-tool.pod:46
38810 "If you have downloaded another qemu binary, point this option at the full "
38811 "path of the binary to try it."
38815 #: ../test-tool/libguestfs-test-tool.pod:49
38816 msgid "B<--qemudir qemu_source_dir>"
38820 #: ../test-tool/libguestfs-test-tool.pod:51
38822 "If you have compiled qemu from source, point this option at the source "
38823 "directory to try it."
38827 #: ../test-tool/libguestfs-test-tool.pod:54
38832 #: ../test-tool/libguestfs-test-tool.pod:56
38833 msgid "B<--timeout N>"
38837 #: ../test-tool/libguestfs-test-tool.pod:58
38839 "Set the launch timeout to C<N> seconds. The default is 600 seconds (10 "
38840 "minutes) which does not usually need to be adjusted."
38844 #: ../test-tool/libguestfs-test-tool.pod:63
38845 msgid "TRYING OUT A DIFFERENT VERSION OF QEMU"
38849 #: ../test-tool/libguestfs-test-tool.pod:65
38851 "If you have compiled another version of qemu from source and would like to "
38852 "try that, then you can use the I<--qemudir> option to point to the qemu "
38853 "source directory."
38857 #: ../test-tool/libguestfs-test-tool.pod:69
38859 "If you have downloaded a qemu binary from somewhere, use the I<--qemu> "
38860 "option to point to the binary."
38864 #: ../test-tool/libguestfs-test-tool.pod:72
38866 "Note when using these options, you can ignore the business of qemu wrapper "
38867 "scripts (L<guestfs(3)/QEMU WRAPPERS>), since libguestfs-test-tool writes a "
38868 "wrapper script for you if one is needed."
38872 #: ../test-tool/libguestfs-test-tool.pod:76
38873 msgid "TRYING OUT A DIFFERENT KERNEL"
38877 #: ../test-tool/libguestfs-test-tool.pod:78
38879 "If you are using febootstrap E<ge> 3.8 then you can select which kernel "
38880 "libguestfs tries. You do this by setting the environment variables "
38881 "C<FEBOOTSTRAP_KERNEL> and/or C<FEBOOTSTRAP_MODULES>."
38885 #: ../test-tool/libguestfs-test-tool.pod:82
38887 "Refer to L<febootstrap-supermin-helper(8)/ENVIRONMENT VARIABLES> for further "
38892 #: ../test-tool/libguestfs-test-tool.pod:85
38893 msgid "SELF-DIAGNOSIS"
38897 #: ../test-tool/libguestfs-test-tool.pod:87
38899 "Refer to L<guestfs(3)/APPLIANCE BOOT PROCESS> to understand the messages "
38900 "produced by libguestfs-test-tool and/or possible errors."
38904 #: ../test-tool/libguestfs-test-tool.pod:92
38906 "libguestfs-test-tool returns I<0> if the tests completed without error, or "
38907 "I<1> if there was an error."
38911 #: ../test-tool/libguestfs-test-tool.pod:97
38913 "For the full list of environment variables which may affect libguestfs, "
38914 "please see the L<guestfs(3)> manual page."
38918 #: ../test-tool/libguestfs-test-tool.pod:102
38919 msgid "L<guestfs(3)>, L<http://libguestfs.org/>, L<http://qemu.org/>."
38923 #: ../tools/virt-list-filesystems.pl:32
38924 msgid "virt-list-filesystems - List filesystems in a virtual machine or disk image"
38928 #: ../tools/virt-list-filesystems.pl:36
38931 " virt-list-filesystems [--options] domname\n"
38936 #: ../tools/virt-list-filesystems.pl:38
38939 " virt-list-filesystems [--options] disk.img [disk.img ...]\n"
38944 #: ../tools/virt-list-filesystems.pl:42 ../tools/virt-list-partitions.pl:42
38946 "This tool is obsolete. Use L<virt-filesystems(1)> as a more flexible "
38951 #: ../tools/virt-list-filesystems.pl:45
38953 "C<virt-list-filesystems> is a command line tool to list the filesystems that "
38954 "are contained in a virtual machine or disk image."
38958 #: ../tools/virt-list-filesystems.pl:49
38960 "C<virt-list-filesystems> is just a simple wrapper around L<libguestfs(3)> "
38961 "functionality. For more complex cases you should look at the "
38962 "L<guestfish(1)> tool."
38966 #: ../tools/virt-list-filesystems.pl:112
38968 "With this option, C<virt-list-filesystems> displays the type of each "
38969 "filesystem too (where \"type\" means C<ext3>, C<xfs> etc.)"
38973 #: ../tools/virt-list-filesystems.pl:119
38978 #: ../tools/virt-list-filesystems.pl:123
38980 "Normally we only show mountable filesystems. If this option is given then "
38981 "swap devices are shown too."
38985 #: ../tools/virt-list-filesystems.pl:197
38987 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-tar(1)>, "
38988 "L<virt-filesystems(1)>, L<virt-list-partitions(1)>, L<Sys::Guestfs(3)>, "
38989 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
38993 #: ../tools/virt-list-filesystems.pl:214 ../tools/virt-tar.pl:317
38994 msgid "Copyright (C) 2009 Red Hat Inc."
38998 #: ../tools/virt-list-partitions.pl:32
38999 msgid "virt-list-partitions - List partitions in a virtual machine or disk image"
39003 #: ../tools/virt-list-partitions.pl:36
39006 " virt-list-partitions [--options] domname\n"
39011 #: ../tools/virt-list-partitions.pl:38
39014 " virt-list-partitions [--options] disk.img [disk.img ...]\n"
39019 #: ../tools/virt-list-partitions.pl:45
39021 "C<virt-list-partitions> is a command line tool to list the partitions that "
39022 "are contained in a virtual machine or disk image. It is mainly useful as a "
39023 "first step to using L<virt-resize(1)>."
39027 #: ../tools/virt-list-partitions.pl:50
39029 "C<virt-list-partitions> is just a simple wrapper around L<libguestfs(3)> "
39030 "functionality. For more complex cases you should look at the "
39031 "L<guestfish(1)> tool."
39035 #: ../tools/virt-list-partitions.pl:113
39036 msgid "Show sizes in human-readable form (eg. \"1G\")."
39040 #: ../tools/virt-list-partitions.pl:123
39042 "With this option, C<virt-list-partitions> displays the type and size of each "
39043 "partition too (where \"type\" means C<ext3>, C<pv> etc.)"
39047 #: ../tools/virt-list-partitions.pl:130
39052 #: ../tools/virt-list-partitions.pl:132
39057 #: ../tools/virt-list-partitions.pl:134
39058 msgid "Display the total size of each block device (as a separate row or rows)."
39062 #: ../tools/virt-list-partitions.pl:267
39064 "L<guestfs(3)>, L<guestfish(1)>, L<virt-filesystems(1)>, "
39065 "L<virt-list-filesystems(1)>, L<virt-resize(1)>, L<Sys::Guestfs(3)>, "
39066 "L<Sys::Guestfs::Lib(3)>, L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39070 #: ../tools/virt-list-partitions.pl:283
39071 msgid "Copyright (C) 2009-2010 Red Hat Inc."
39075 #: ../tools/virt-make-fs.pl:37
39076 msgid "virt-make-fs - Make a filesystem from a tar archive or files"
39080 #: ../tools/virt-make-fs.pl:41
39083 " virt-make-fs [--options] input.tar output.img\n"
39088 #: ../tools/virt-make-fs.pl:43
39091 " virt-make-fs [--options] input.tar.gz output.img\n"
39096 #: ../tools/virt-make-fs.pl:45
39099 " virt-make-fs [--options] directory output.img\n"
39104 #: ../tools/virt-make-fs.pl:49
39106 "Virt-make-fs is a command line tool for creating a filesystem from a tar "
39107 "archive or some files in a directory. It is similar to tools like "
39108 "L<mkisofs(1)>, L<genisoimage(1)> and L<mksquashfs(1)>. Unlike those tools, "
39109 "it can create common filesystem types like ext2/3 or NTFS, which can be "
39110 "useful if you want to attach these filesystems to existing virtual machines "
39111 "(eg. to import large amounts of read-only data to a VM)."
39115 #: ../tools/virt-make-fs.pl:57
39116 msgid "Basic usage is:"
39120 #: ../tools/virt-make-fs.pl:59
39123 " virt-make-fs input output\n"
39128 #: ../tools/virt-make-fs.pl:61
39130 "where C<input> is either a directory containing files that you want to add, "
39131 "or a tar archive (either uncompressed tar or gzip-compressed tar); and "
39132 "C<output> is a disk image. The input type is detected automatically. The "
39133 "output disk image defaults to a raw ext2 image unless you specify extra "
39134 "flags (see L</OPTIONS> below)."
39138 #: ../tools/virt-make-fs.pl:67
39139 msgid "EXTRA SPACE"
39143 #: ../tools/virt-make-fs.pl:69
39145 "Unlike formats such as tar and squashfs, a filesystem does not \"just fit\" "
39146 "the files that it contains, but might have extra space. Depending on how "
39147 "you are going to use the output, you might think this extra space is wasted "
39148 "and want to minimize it, or you might want to leave space so that more files "
39149 "can be added later. Virt-make-fs defaults to minimizing the extra space, "
39150 "but you can use the I<--size> flag to leave space in the filesystem if you "
39155 #: ../tools/virt-make-fs.pl:77
39157 "An alternative way to leave extra space but not make the output image any "
39158 "bigger is to use an alternative disk image format (instead of the default "
39159 "\"raw\" format). Using I<--format=qcow2> will use the native QEmu/KVM qcow2 "
39160 "image format (check your hypervisor supports this before using it). This "
39161 "allows you to choose a large I<--size> but the extra space won't actually be "
39162 "allocated in the image until you try to store something in it."
39166 #: ../tools/virt-make-fs.pl:85
39168 "Don't forget that you can also use local commands including L<resize2fs(8)> "
39169 "and L<virt-resize(1)> to resize existing filesystems, or rerun virt-make-fs "
39170 "to build another image from scratch."
39174 #: ../tools/virt-make-fs.pl:89 ../tools/virt-make-fs.pl:123 ../tools/virt-make-fs.pl:142
39179 #: ../tools/virt-make-fs.pl:91
39182 " virt-make-fs --format=qcow2 --size=+200M input output.img\n"
39187 #: ../tools/virt-make-fs.pl:93
39188 msgid "FILESYSTEM TYPE"
39192 #: ../tools/virt-make-fs.pl:95
39194 "The default filesystem type is C<ext2>. Just about any filesystem type that "
39195 "libguestfs supports can be used (but I<not> read-only formats like "
39196 "ISO9660). Here are some of the more common choices:"
39200 #: ../tools/virt-make-fs.pl:101
39205 #: ../tools/virt-make-fs.pl:103
39207 "Note that ext3 filesystems contain a journal, typically 1-32 MB in size. If "
39208 "you are not going to use the filesystem in a way that requires the journal, "
39209 "then this is just wasted overhead."
39213 #: ../tools/virt-make-fs.pl:107
39214 msgid "I<ntfs> or I<vfat>"
39218 #: ../tools/virt-make-fs.pl:109
39219 msgid "Useful if exporting data to a Windows guest."
39223 #: ../tools/virt-make-fs.pl:111
39225 "I<Note for vfat>: The tar archive or local directory must only contain files "
39226 "which are owned by root (ie. UID:GID = 0:0). The reason is that the tar "
39227 "program running within libguestfs is unable to change the ownership of "
39228 "non-root files, since vfat itself does not support this."
39232 #: ../tools/virt-make-fs.pl:116
39237 #: ../tools/virt-make-fs.pl:118
39239 "Lower overhead than C<ext2>, but certain limitations on filename length and "
39240 "total filesystem size."
39244 #: ../tools/virt-make-fs.pl:125
39247 " virt-make-fs --type=minix input minixfs.img\n"
39252 #: ../tools/virt-make-fs.pl:127
39253 msgid "TO PARTITION OR NOT TO PARTITION"
39257 #: ../tools/virt-make-fs.pl:129
39258 msgid "Optionally virt-make-fs can add a partition table to the output disk."
39262 #: ../tools/virt-make-fs.pl:131
39264 "Adding a partition can make the disk image more compatible with certain "
39265 "virtualized operating systems which don't expect to see a filesystem "
39266 "directly located on a block device (Linux doesn't care and will happily "
39267 "handle both types)."
39271 #: ../tools/virt-make-fs.pl:136
39273 "On the other hand, if you have a partition table then the output image is no "
39274 "longer a straight filesystem. For example you cannot run L<fsck(8)> "
39275 "directly on a partitioned disk image. (However libguestfs tools such as "
39276 "L<guestfish(1)> and L<virt-resize(1)> can still be used)."
39280 #: ../tools/virt-make-fs.pl:144
39281 msgid "Add an MBR partition:"
39285 #: ../tools/virt-make-fs.pl:146
39288 " virt-make-fs --partition -- input disk.img\n"
39293 #: ../tools/virt-make-fs.pl:148
39295 "If the output disk image could be terabyte-sized or larger, it's better to "
39296 "use an EFI/GPT-compatible partition table:"
39300 #: ../tools/virt-make-fs.pl:151
39303 " virt-make-fs --partition=gpt --size=+4T --format=qcow2 input disk.img\n"
39308 #: ../tools/virt-make-fs.pl:179
39309 msgid "Enable debugging information."
39313 #: ../tools/virt-make-fs.pl:185
39314 msgid "B<--size=E<lt>NE<gt>>"
39318 #: ../tools/virt-make-fs.pl:187
39319 msgid "B<--size=+E<lt>NE<gt>>"
39323 #: ../tools/virt-make-fs.pl:189
39324 msgid "B<-s E<lt>NE<gt>>"
39328 #: ../tools/virt-make-fs.pl:191
39329 msgid "B<-s +E<lt>NE<gt>>"
39333 #: ../tools/virt-make-fs.pl:193
39334 msgid "Use the I<--size> (or I<-s>) option to choose the size of the output image."
39338 #: ../tools/virt-make-fs.pl:196
39340 "If this option is I<not> given, then the output image will be just large "
39341 "enough to contain all the files, with not much wasted space."
39345 #: ../tools/virt-make-fs.pl:199
39347 "To choose a fixed size output disk, specify an absolute number followed by "
39348 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
39349 "Petabytes or Exabytes. This must be large enough to contain all the input "
39350 "files, else you will get an error."
39354 #: ../tools/virt-make-fs.pl:204
39356 "To leave extra space, specify C<+> (plus sign) and a number followed by "
39357 "b/K/M/G/T/P/E to mean bytes, Kilobytes, Megabytes, Gigabytes, Terabytes, "
39358 "Petabytes or Exabytes. For example: I<--size=+200M> means enough space for "
39359 "the input files, and (approximately) an extra 200 MB free space."
39363 #: ../tools/virt-make-fs.pl:210
39365 "Note that virt-make-fs estimates free space, and therefore will not produce "
39366 "filesystems containing precisely the free space requested. (It is much more "
39367 "expensive and time-consuming to produce a filesystem which has precisely the "
39368 "desired free space)."
39372 #: ../tools/virt-make-fs.pl:219
39373 msgid "B<--format=E<lt>fmtE<gt>>"
39377 #: ../tools/virt-make-fs.pl:221
39378 msgid "B<-F E<lt>fmtE<gt>>"
39382 #: ../tools/virt-make-fs.pl:223
39383 msgid "Choose the output disk image format."
39387 #: ../tools/virt-make-fs.pl:225
39388 msgid "The default is C<raw> (raw disk image)."
39392 #: ../tools/virt-make-fs.pl:227
39394 "For other choices, see the L<qemu-img(1)> manpage. The only other choice "
39395 "that would really make sense here is C<qcow2>."
39399 #: ../tools/virt-make-fs.pl:234
39400 msgid "B<--type=E<lt>fsE<gt>>"
39404 #: ../tools/virt-make-fs.pl:236
39405 msgid "B<-t E<lt>fsE<gt>>"
39409 #: ../tools/virt-make-fs.pl:238
39410 msgid "Choose the output filesystem type."
39414 #: ../tools/virt-make-fs.pl:240
39415 msgid "The default is C<ext2>."
39419 #: ../tools/virt-make-fs.pl:242
39420 msgid "Any filesystem which is supported read-write by libguestfs can be used here."
39424 #: ../tools/virt-make-fs.pl:249
39425 msgid "B<--partition>"
39429 #: ../tools/virt-make-fs.pl:251
39430 msgid "B<--partition=E<lt>parttypeE<gt>>"
39434 #: ../tools/virt-make-fs.pl:253
39436 "If specified, this flag adds an MBR partition table to the output disk "
39441 #: ../tools/virt-make-fs.pl:256
39443 "You can change the partition table type, eg. I<--partition=gpt> for large "
39448 #: ../tools/virt-make-fs.pl:259
39450 "Note that if you just use a lonesome I<--partition>, the Perl option parser "
39451 "might consider the next parameter to be the partition type. For example:"
39455 #: ../tools/virt-make-fs.pl:263
39458 " virt-make-fs --partition input.tar ...\n"
39463 #: ../tools/virt-make-fs.pl:265
39465 "would cause virt-make-fs to think you wanted to use a partition type of "
39466 "C<input.tar> which is completely wrong. To avoid this, use I<--> (a double "
39467 "dash) between options and the input file argument:"
39471 #: ../tools/virt-make-fs.pl:269
39474 " virt-make-fs --partition -- input.tar ...\n"
39479 #: ../tools/virt-make-fs.pl:541
39481 "L<guestfish(1)>, L<virt-resize(1)>, L<virt-tar-in(1)>, L<mkisofs(1)>, "
39482 "L<genisoimage(1)>, L<mksquashfs(1)>, L<mke2fs(8)>, L<resize2fs(8)>, "
39483 "L<guestfs(3)>, L<Sys::Guestfs(3)>, L<http://libguestfs.org/>."
39487 #: ../tools/virt-make-fs.pl:555 ../tools/virt-win-reg.pl:763
39489 "When reporting bugs, please enable debugging and capture the I<complete> "
39494 #: ../tools/virt-make-fs.pl:558
39497 " export LIBGUESTFS_DEBUG=1\n"
39498 " virt-make-fs --debug [...] > /tmp/virt-make-fs.log 2>&1\n"
39503 #: ../tools/virt-make-fs.pl:561
39505 "Attach /tmp/virt-make-fs.log to a new bug report at "
39506 "L<https://bugzilla.redhat.com/>"
39510 #: ../tools/virt-tar.pl:33
39511 msgid "virt-tar - Extract or upload files to a virtual machine"
39515 #: ../tools/virt-tar.pl:37
39518 " virt-tar [--options] -x domname directory tarball\n"
39523 #: ../tools/virt-tar.pl:39
39526 " virt-tar [--options] -u domname tarball directory\n"
39531 #: ../tools/virt-tar.pl:41
39534 " virt-tar [--options] disk.img [disk.img ...] -x directory tarball\n"
39539 #: ../tools/virt-tar.pl:43
39542 " virt-tar [--options] disk.img [disk.img ...] -u tarball directory\n"
39547 #: ../tools/virt-tar.pl:45 ../tools/virt-win-reg.pl:88
39552 #: ../tools/virt-tar.pl:47
39554 "This tool is obsolete. Use L<virt-copy-in(1)>, L<virt-copy-out(1)>, "
39555 "L<virt-tar-in(1)>, L<virt-tar-out(1)> as replacements."
39559 #: ../tools/virt-tar.pl:52
39560 msgid "Download C</home> from the VM into a local tarball:"
39564 #: ../tools/virt-tar.pl:54
39567 " virt-tar -x domname /home home.tar\n"
39572 #: ../tools/virt-tar.pl:56
39575 " virt-tar -zx domname /home home.tar.gz\n"
39580 #: ../tools/virt-tar.pl:58
39581 msgid "Upload a local tarball and unpack it inside C</tmp> in the VM:"
39585 #: ../tools/virt-tar.pl:60
39588 " virt-tar -u domname uploadstuff.tar /tmp\n"
39593 #: ../tools/virt-tar.pl:62
39596 " virt-tar -zu domname uploadstuff.tar.gz /tmp\n"
39601 #: ../tools/virt-tar.pl:66
39603 "You must I<not> use C<virt-tar> with the I<-u> option (upload) on live "
39604 "virtual machines. If you do this, you risk disk corruption in the VM. "
39605 "C<virt-tar> tries to stop you from doing this, but doesn't catch all cases."
39609 #: ../tools/virt-tar.pl:71
39611 "You can use I<-x> (extract) on live virtual machines, but you might get "
39612 "inconsistent results or errors if there is filesystem activity inside the "
39613 "VM. If the live VM is synched and quiescent, then C<virt-tar> will usually "
39614 "work, but the only way to guarantee consistent results is if the virtual "
39615 "machine is shut down."
39619 #: ../tools/virt-tar.pl:79
39621 "C<virt-tar> is a general purpose archive tool for downloading and uploading "
39622 "parts of a guest filesystem. There are many possibilities: making backups, "
39623 "uploading data files, snooping on guest activity, fixing or customizing "
39628 #: ../tools/virt-tar.pl:84
39630 "If you want to just view a single file, use L<virt-cat(1)>. If you just "
39631 "want to edit a single file, use L<virt-edit(1)>. For more complex cases you "
39632 "should look at the L<guestfish(1)> tool."
39636 #: ../tools/virt-tar.pl:88
39638 "There are two modes of operation: I<-x> (eXtract) downloads a directory and "
39639 "its contents (recursively) from the virtual machine into a local tarball. "
39640 "I<-u> uploads from a local tarball, unpacking it into a directory inside the "
39641 "virtual machine. You cannot use these two options together."
39645 #: ../tools/virt-tar.pl:94
39647 "In addition, you may need to use the I<-z> (gZip) option to enable "
39648 "compression. When uploading, you have to specify I<-z> if the upload file "
39649 "is compressed because virt-tar won't detect this on its own."
39653 #: ../tools/virt-tar.pl:98
39655 "C<virt-tar> can only handle tar (optionally gzipped) format tarballs. For "
39656 "example it cannot do PKZip files or bzip2 compression. If you want that "
39657 "then you'll have to rebuild the tarballs yourself. (This is a limitation of "
39658 "the L<libguestfs(3)> API)."
39662 #: ../tools/virt-tar.pl:160
39663 msgid "B<--extract>"
39667 #: ../tools/virt-tar.pl:162
39668 msgid "B<--download>"
39672 #: ../tools/virt-tar.pl:164
39677 #: ../tools/virt-tar.pl:166
39678 msgid "B<--upload>"
39682 #: ../tools/virt-tar.pl:168
39684 "Use I<-x> to extract (download) a directory from a virtual machine to a "
39689 #: ../tools/virt-tar.pl:171
39691 "Use I<-u> to upload and unpack from a local tarball into a virtual machine. "
39692 "Please read the L</WARNING> section above before using this option."
39696 #: ../tools/virt-tar.pl:175
39697 msgid "You must specify exactly one of these options."
39701 #: ../tools/virt-tar.pl:181
39706 #: ../tools/virt-tar.pl:183
39711 #: ../tools/virt-tar.pl:185
39712 msgid "Specify that the input or output tarball is gzip-compressed."
39716 #: ../tools/virt-tar.pl:298
39718 "L<guestfs(3)>, L<guestfish(1)>, L<virt-cat(1)>, L<virt-edit(1)>, "
39719 "L<virt-copy-in(1)>, L<virt-copy-out(1)>, L<virt-tar-in(1)>, "
39720 "L<virt-tar-out(1)>, L<Sys::Guestfs(3)>, L<Sys::Guestfs::Lib(3)>, "
39721 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
39725 #: ../tools/virt-win-reg.pl:37
39727 "virt-win-reg - Export and merge Windows Registry entries from a Windows "
39732 #: ../tools/virt-win-reg.pl:41
39735 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey'\n"
39740 #: ../tools/virt-win-reg.pl:43
39743 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' name\n"
39748 #: ../tools/virt-win-reg.pl:45
39751 " virt-win-reg domname 'HKLM\\Path\\To\\Subkey' @\n"
39756 #: ../tools/virt-win-reg.pl:47
39759 " virt-win-reg --merge domname [input.reg ...]\n"
39764 #: ../tools/virt-win-reg.pl:49
39767 " virt-win-reg [--options] disk.img ... # instead of domname\n"
39772 #: ../tools/virt-win-reg.pl:53
39774 "You must I<not> use C<virt-win-reg> with the I<--merge> option on live "
39775 "virtual machines. If you do this, you I<will> get irreversible disk "
39776 "corruption in the VM. C<virt-win-reg> tries to stop you from doing this, "
39777 "but doesn't catch all cases."
39781 #: ../tools/virt-win-reg.pl:58
39783 "Modifying the Windows Registry is an inherently risky operation. The format "
39784 "is deliberately obscure and undocumented, and Registry changes can leave the "
39785 "system unbootable. Therefore when using the I<--merge> option, make sure "
39786 "you have a reliable backup first."
39790 #: ../tools/virt-win-reg.pl:65
39792 "This program can export and merge Windows Registry entries from a Windows "
39797 #: ../tools/virt-win-reg.pl:68
39799 "The first parameter is the libvirt guest name or the raw disk image of a "
39804 #: ../tools/virt-win-reg.pl:71
39806 "If I<--merge> is I<not> specified, then the chosen registry key is "
39807 "displayed/exported (recursively). For example:"
39811 #: ../tools/virt-win-reg.pl:74
39814 " $ virt-win-reg Windows7 'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft'\n"
39819 #: ../tools/virt-win-reg.pl:76
39820 msgid "You can also display single values from within registry keys, for example:"
39824 #: ../tools/virt-win-reg.pl:79
39827 " $ cvkey='HKLM\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion'\n"
39828 " $ virt-win-reg Windows7 $cvkey ProductName\n"
39829 " Windows 7 Enterprise\n"
39834 #: ../tools/virt-win-reg.pl:83
39836 "With I<--merge>, you can merge a textual regedit file into the Windows "
39841 #: ../tools/virt-win-reg.pl:86
39844 " $ virt-win-reg --merge Windows7 changes.reg\n"
39849 #: ../tools/virt-win-reg.pl:90
39851 "This program is only meant for simple access to the registry. If you want "
39852 "to do complicated things with the registry, we suggest you download the "
39853 "Registry hive files from the guest using L<libguestfs(3)> or L<guestfish(1)> "
39854 "and access them locally, eg. using L<hivex(3)>, L<hivexsh(1)> or "
39855 "L<hivexregedit(1)>."
39859 #: ../tools/virt-win-reg.pl:159
39864 #: ../tools/virt-win-reg.pl:161
39866 "In merge mode, this merges a textual regedit file into the Windows Registry "
39867 "of the virtual machine. If this flag is I<not> given then virt-win-reg "
39868 "displays or exports Registry entries instead."
39872 #: ../tools/virt-win-reg.pl:165
39874 "Note that I<--merge> is I<unsafe> to use on live virtual machines, and will "
39875 "result in disk corruption. However exporting (without this flag) is always "
39880 #: ../tools/virt-win-reg.pl:173
39881 msgid "B<--encoding> UTF-16LE|ASCII"
39885 #: ../tools/virt-win-reg.pl:175
39887 "When merging (only), you may need to specify the encoding for strings to be "
39888 "used in the hive file. This is explained in detail in "
39889 "L<Win::Hivex::Regedit(3)/ENCODING STRINGS>."
39893 #: ../tools/virt-win-reg.pl:179
39895 "The default is to use UTF-16LE, which should work with recent versions of "
39900 #: ../tools/virt-win-reg.pl:186
39901 msgid "B<--unsafe-printable-strings>"
39905 #: ../tools/virt-win-reg.pl:188
39907 "When exporting (only), assume strings are UTF-16LE and print them as strings "
39908 "instead of hex sequences. Remove the final zero codepoint from strings if "
39913 #: ../tools/virt-win-reg.pl:192
39915 "This is unsafe and does not preserve the fidelity of strings in the original "
39916 "Registry for various reasons:"
39920 #: ../tools/virt-win-reg.pl:199
39922 "Assumes the original encoding is UTF-16LE. ASCII strings and strings in "
39923 "other encodings will be corrupted by this transformation."
39927 #: ../tools/virt-win-reg.pl:204
39929 "Assumes that everything which has type 1 or 2 is really a string and that "
39930 "everything else is not a string, but the type field in real Registries is "
39935 #: ../tools/virt-win-reg.pl:210
39937 "Loses information about whether a zero codepoint followed the string in the "
39942 #: ../tools/virt-win-reg.pl:215
39944 "This all happens because the Registry itself contains no information about "
39945 "how strings are encoded (see L<Win::Hivex::Regedit(3)/ENCODING STRINGS>)."
39949 #: ../tools/virt-win-reg.pl:219
39951 "You should only use this option for quick hacking and debugging of the "
39952 "Registry contents, and I<never> use it if the output is going to be passed "
39953 "into another program or stored in another Registry."
39957 #: ../tools/virt-win-reg.pl:556
39958 msgid "SUPPORTED SYSTEMS"
39962 #: ../tools/virt-win-reg.pl:558
39964 "The program currently supports Windows NT-derived guests starting with "
39965 "Windows XP through to at least Windows 7."
39969 #: ../tools/virt-win-reg.pl:561
39970 msgid "The following Registry keys are supported:"
39974 #: ../tools/virt-win-reg.pl:565
39975 msgid "C<HKEY_LOCAL_MACHINE\\SAM>"
39979 #: ../tools/virt-win-reg.pl:567
39980 msgid "C<HKEY_LOCAL_MACHINE\\SECURITY>"
39984 #: ../tools/virt-win-reg.pl:569
39985 msgid "C<HKEY_LOCAL_MACHINE\\SOFTWARE>"
39989 #: ../tools/virt-win-reg.pl:571
39990 msgid "C<HKEY_LOCAL_MACHINE\\SYSTEM>"
39994 #: ../tools/virt-win-reg.pl:573
39995 msgid "C<HKEY_USERS\\.DEFAULT>"
39999 #: ../tools/virt-win-reg.pl:575
40000 msgid "C<HKEY_USERS\\I<SID>>"
40004 #: ../tools/virt-win-reg.pl:577
40005 msgid "where I<SID> is a Windows User SID (eg. C<S-1-5-18>)."
40009 #: ../tools/virt-win-reg.pl:579
40010 msgid "C<HKEY_USERS\\I<username>>"
40014 #: ../tools/virt-win-reg.pl:581
40015 msgid "where I<username> is a local user name (this is a libguestfs extension)."
40019 #: ../tools/virt-win-reg.pl:585
40021 "You can use C<HKLM> as a shorthand for C<HKEY_LOCAL_MACHINE>, and C<HKU> for "
40026 #: ../tools/virt-win-reg.pl:588
40028 "The literal keys C<HKEY_USERS\\$SID> and C<HKEY_CURRENT_USER> are not "
40029 "supported (there is no \"current user\")."
40033 #: ../tools/virt-win-reg.pl:591
40038 #: ../tools/virt-win-reg.pl:593
40040 "C<virt-win-reg> expects that regedit files have already been reencoded in "
40041 "the local encoding. Usually on Linux hosts, this means UTF-8 with "
40042 "Unix-style line endings. Since Windows regedit files are often in UTF-16LE "
40043 "with Windows-style line endings, you may need to reencode the whole file "
40044 "before or after processing."
40048 #: ../tools/virt-win-reg.pl:599
40050 "To reencode a file from Windows format to Linux (before processing it with "
40051 "the I<--merge> option), you would do something like this:"
40055 #: ../tools/virt-win-reg.pl:602
40058 " iconv -f utf-16le -t utf-8 < win.reg | dos2unix > linux.reg\n"
40063 #: ../tools/virt-win-reg.pl:604
40065 "To go in the opposite direction, after exporting and before sending the file "
40066 "to a Windows user, do something like this:"
40070 #: ../tools/virt-win-reg.pl:607
40073 " unix2dos linux.reg | iconv -f utf-8 -t utf-16le > win.reg\n"
40078 #: ../tools/virt-win-reg.pl:609
40079 msgid "For more information about encoding, see L<Win::Hivex::Regedit(3)>."
40083 #: ../tools/virt-win-reg.pl:611
40085 "If you are unsure about the current encoding, use the L<file(1)> command. "
40086 "Recent versions of Windows regedit.exe produce a UTF-16LE file with "
40087 "Windows-style (CRLF) line endings, like this:"
40091 #: ../tools/virt-win-reg.pl:615
40094 " $ file software.reg\n"
40095 " software.reg: Little-endian UTF-16 Unicode text, with very long lines,\n"
40096 " with CRLF line terminators\n"
40101 #: ../tools/virt-win-reg.pl:619
40102 msgid "This file would need conversion before you could I<--merge> it."
40106 #: ../tools/virt-win-reg.pl:621
40107 msgid "CurrentControlSet etc."
40111 #: ../tools/virt-win-reg.pl:623
40113 "Registry keys like C<CurrentControlSet> don't really exist in the Windows "
40114 "Registry at the level of the hive file, and therefore you cannot modify "
40119 #: ../tools/virt-win-reg.pl:627
40121 "C<CurrentControlSet> is usually an alias for C<ControlSet001>. In some "
40122 "circumstances it might refer to another control set. The way to find out is "
40123 "to look at the C<HKLM\\SYSTEM\\Select> key:"
40127 #: ../tools/virt-win-reg.pl:631
40130 " # virt-win-reg WindowsGuest 'HKLM\\SYSTEM\\Select'\n"
40131 " [HKEY_LOCAL_MACHINE\\SYSTEM\\Select]\n"
40132 " \"Current\"=dword:00000001\n"
40133 " \"Default\"=dword:00000001\n"
40134 " \"Failed\"=dword:00000000\n"
40135 " \"LastKnownGood\"=dword:00000002\n"
40140 #: ../tools/virt-win-reg.pl:638
40141 msgid "\"Current\" is the one which Windows will choose when it boots."
40145 #: ../tools/virt-win-reg.pl:640
40146 msgid "Similarly, other C<Current...> keys in the path may need to be replaced."
40150 #: ../tools/virt-win-reg.pl:643
40151 msgid "WINDOWS TIPS"
40155 #: ../tools/virt-win-reg.pl:645
40157 "Note that some of these tips modify the guest disk image. The guest I<must> "
40158 "be shut off, else you will get disk corruption."
40162 #: ../tools/virt-win-reg.pl:648
40163 msgid "RUNNING A BATCH SCRIPT WHEN A USER LOGS IN"
40167 #: ../tools/virt-win-reg.pl:650
40169 "Prepare a DOS batch script, VBScript or executable. Upload this using "
40170 "L<guestfish(1)>. For this example the script is called C<test.bat> and it "
40171 "is uploaded into C<C:\\>:"
40175 #: ../tools/virt-win-reg.pl:654
40178 " guestfish -i -d WindowsGuest upload test.bat /test.bat\n"
40183 #: ../tools/virt-win-reg.pl:656
40184 msgid "Prepare a regedit file containing the registry change:"
40188 #: ../tools/virt-win-reg.pl:658
40191 " cat > test.reg <<'EOF'\n"
40192 " [HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\RunOnce]\n"
40193 " \"Test\"=\"c:\\\\test.bat\"\n"
40199 #: ../tools/virt-win-reg.pl:663
40201 "In this example we use the key C<RunOnce> which means that the script will "
40202 "run precisely once when the first user logs in. If you want it to run every "
40203 "time a user logs in, replace C<RunOnce> with C<Run>."
40207 #: ../tools/virt-win-reg.pl:667
40208 msgid "Now update the registry:"
40212 #: ../tools/virt-win-reg.pl:669
40215 " virt-win-reg --merge WindowsGuest test.reg\n"
40220 #: ../tools/virt-win-reg.pl:671
40221 msgid "INSTALLING A SERVICE"
40225 #: ../tools/virt-win-reg.pl:673
40227 "This section assumes you are familiar with Windows services, and you either "
40228 "have a program which handles the Windows Service Control Protocol directly "
40229 "or you want to run any program using a service wrapper like SrvAny or the "
40234 #: ../tools/virt-win-reg.pl:678
40236 "First upload the program and optionally the service wrapper. In this case "
40237 "the test program is called C<test.exe> and we are using the RHSrvAny "
40242 #: ../tools/virt-win-reg.pl:682
40245 " guestfish -i -d WindowsGuest <<EOF\n"
40246 " upload rhsrvany.exe /rhsrvany.exe\n"
40247 " upload test.exe /test.exe\n"
40253 #: ../tools/virt-win-reg.pl:687
40255 "Prepare a regedit file containing the registry changes. In this example, "
40256 "the first registry change is needed for the service itself or the service "
40257 "wrapper (if used). The second registry change is only needed because I am "
40258 "using the RHSrvAny service wrapper."
40262 #: ../tools/virt-win-reg.pl:692
40265 " cat > service.reg <<'EOF'\n"
40266 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny]\n"
40267 " \"Type\"=dword:00000010\n"
40268 " \"Start\"=dword:00000002\n"
40269 " \"ErrorControl\"=dword:00000001\n"
40270 " \"ImagePath\"=\"c:\\\\rhsrvany.exe\"\n"
40271 " \"DisplayName\"=\"RHSrvAny\"\n"
40272 " \"ObjectName\"=\"NetworkService\"\n"
40277 #: ../tools/virt-win-reg.pl:701
40280 " [HKLM\\SYSTEM\\ControlSet001\\services\\RHSrvAny\\Parameters]\n"
40281 " \"CommandLine\"=\"c:\\\\test.exe\"\n"
40282 " \"PWD\"=\"c:\\\\Temp\"\n"
40288 #: ../tools/virt-win-reg.pl:712
40290 "For use of C<ControlSet001> see the section above in this manual page. You "
40291 "may need to adjust this according to the control set that is in use by the "
40296 #: ../tools/virt-win-reg.pl:718
40298 "C<\"ObjectName\"> controls the privileges that the service will have. An "
40299 "alternative is C<\"ObjectName\"=\"LocalSystem\"> which would be the most "
40300 "privileged account."
40304 #: ../tools/virt-win-reg.pl:724
40306 "For the meaning of the magic numbers, see this Microsoft KB article: "
40307 "L<http://support.microsoft.com/kb/103000>."
40311 #: ../tools/virt-win-reg.pl:729
40312 msgid "Update the registry:"
40316 #: ../tools/virt-win-reg.pl:731
40319 " virt-win-reg --merge WindowsGuest service.reg\n"
40324 #: ../tools/virt-win-reg.pl:735
40326 "Be careful when passing parameters containing C<\\> (backslash) in the "
40327 "shell. Usually you will have to use 'single quotes' or double backslashes "
40328 "(but not both) to protect them from the shell."
40332 #: ../tools/virt-win-reg.pl:739
40333 msgid "Paths and value names are case-insensitive."
40337 #: ../tools/virt-win-reg.pl:748
40339 "L<hivex(3)>, L<hivexsh(1)>, L<hivexregedit(1)>, L<guestfs(3)>, "
40340 "L<guestfish(1)>, L<virt-cat(1)>, L<Sys::Guestfs(3)>, "
40341 "L<Sys::Guestfs::Lib(3)>, L<Win::Hivex(3)>, L<Win::Hivex::Regedit(3)>, "
40342 "L<Sys::Virt(3)>, L<http://libguestfs.org/>."
40346 #: ../tools/virt-win-reg.pl:766
40349 " export LIBGUESTFS_DEBUG=1\n"
40350 " virt-win-reg --debug [... rest ...] > /tmp/virt-win-reg.log 2>&1\n"
40355 #: ../tools/virt-win-reg.pl:769
40357 "Attach /tmp/virt-win-reg.log to a new bug report at "
40358 "L<https://bugzilla.redhat.com/>"